Skip to content

Commit

Permalink
Allow to set up templates with Svelte 5 (#378)
Browse files Browse the repository at this point in the history
* Allow to set up templates with Svelte 5

* Add changeset, rebase on main, resolve conflicts

* Apply updates
  • Loading branch information
ttytm committed Jun 1, 2024
1 parent 8eba1d8 commit cc36b7f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-panthers-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-svelte-ux': minor
---

Allow to set up templates with Svelte 5
10 changes: 10 additions & 0 deletions packages/create-svelte-ux/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,15 @@ const template = options_cli.template
if (p.isCancel(template)) {
process.exit(1);
}
const svelteNext = await p.confirm({
message: 'Would you like to use Svelte 5 (unstable)?',
initialValue: false,
});
if (p.isCancel(svelteNext)) {
process.exit(1);
}
const svelteVersion = svelteNext ? 'next' : 'latest';

const templateDir = path.join(templatesDir, template);
const templateMeta = options.find((option) => option.value === template);
if (!templateMeta) {
Expand All @@ -120,6 +129,7 @@ copy(
{
PROJECT_NAME: projectName,
SVELTE_UX_VERSION: version,
SVELTE_VERSION: svelteVersion,
},
{ '.meta..gitignore': '.gitignore' },
['.meta.json']
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte-ux/templates/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"postcss-load-config": "^5.1.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "^4.2.17",
"svelte": "SVELTE_VERSION",
"svelte-check": "^3.8.0",
"svelte-ux": "latest",
"tailwindcss": "^3.4.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/create-svelte-ux/templates/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"postcss-load-config": "^5.1.0",
"prettier": "^3.2.5",
"prettier-plugin-svelte": "^3.2.3",
"svelte": "^4.2.17",
"svelte": "SVELTE_VERSION",
"svelte-check": "^3.8.0",
"svelte-ux": "latest",
"tailwindcss": "^3.4.3",
Expand Down

0 comments on commit cc36b7f

Please sign in to comment.