sv 1.1.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{shared.json → addons/ai-tools.json} +18 -199
- package/dist/{addons-DaktRhvH.mjs → addons-BCioxI2r.mjs} +134 -53
- package/dist/bin.mjs +39 -27
- package/dist/{engine-CpcTzL2R.mjs → engine-S8UpCG24.mjs} +81 -119
- package/dist/{engine-BLZdMrao.d.mts → engine-fNvU_-IL.d.mts} +3 -2
- package/dist/playground/PlaygroundLayout.svelte +218 -0
- package/dist/src/index.d.mts +36 -6
- package/dist/src/index.mjs +2 -2
- package/dist/src/testing.d.mts +1 -1
- package/dist/src/testing.mjs +1 -1
- package/dist/templates/addon/assets/CONTRIBUTING.md +48 -0
- package/dist/templates/addon/assets/README.md +29 -0
- package/dist/templates/addon/files.types=checkjs.json +10 -1
- package/dist/templates/addon/files.types=none.json +10 -1
- package/dist/templates/addon/files.types=typescript.json +10 -1
- package/dist/templates/addon/package.json +22 -16
- package/dist/templates/demo/assets/README.md +49 -0
- package/dist/templates/demo/files.types=checkjs.json +12 -0
- package/dist/templates/demo/files.types=none.json +12 -0
- package/dist/templates/demo/files.types=typescript.json +12 -0
- package/dist/templates/demo/package.json +11 -7
- package/dist/templates/library/assets/README.md +72 -0
- package/dist/templates/library/files.types=checkjs.json +12 -0
- package/dist/templates/library/files.types=none.json +12 -0
- package/dist/templates/library/files.types=typescript.json +12 -0
- package/dist/templates/library/package.json +29 -18
- package/dist/templates/minimal/assets/README.md +49 -0
- package/dist/templates/minimal/files.types=checkjs.json +12 -0
- package/dist/templates/minimal/files.types=none.json +12 -0
- package/dist/templates/minimal/files.types=typescript.json +12 -0
- package/dist/templates/minimal/package.json +11 -7
- package/package.json +4 -8
- package/dist/templates/demo/assets/DOT-npmrc +0 -1
- package/dist/templates/library/assets/DOT-npmrc +0 -1
- package/dist/templates/minimal/assets/DOT-npmrc +0 -1
|
@@ -1,13 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "$SV-NAME-TODO$",
|
|
3
|
-
"private": true,
|
|
4
3
|
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#lib": "./src/lib/index.js",
|
|
8
|
+
"#lib/*": "./src/lib/*"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"dev": "vite dev",
|
|
8
12
|
"build": "vite build",
|
|
9
13
|
"preview": "vite preview",
|
|
10
|
-
"prepare": "svelte-kit sync || echo ''"
|
|
14
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
15
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
16
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
11
17
|
},
|
|
12
18
|
"devDependencies": {
|
|
13
19
|
"@fontsource/fira-mono": "^5.2.7",
|
|
@@ -15,11 +21,9 @@
|
|
|
15
21
|
"@sveltejs/adapter-auto": "^8.0.0",
|
|
16
22
|
"@sveltejs/kit": "^3.0.0",
|
|
17
23
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
18
|
-
"svelte": "^5.57.
|
|
24
|
+
"svelte": "^5.57.2",
|
|
25
|
+
"svelte-check": "^4.6.0",
|
|
26
|
+
"typescript": "^6.0.3",
|
|
19
27
|
"vite": "^8.3.0"
|
|
20
|
-
},
|
|
21
|
-
"imports": {
|
|
22
|
-
"#lib": "./src/lib/index.js",
|
|
23
|
-
"#lib/*": "./src/lib/*"
|
|
24
28
|
}
|
|
25
29
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Svelte library
|
|
2
|
+
|
|
3
|
+
Everything you need to build a Svelte library, powered by [`sv`](https://npmjs.com/package/sv).
|
|
4
|
+
|
|
5
|
+
Read more about creating a library [in the docs](https://svelte.dev/docs/kit/packaging).
|
|
6
|
+
|
|
7
|
+
## Creating a project
|
|
8
|
+
|
|
9
|
+
If you're seeing this, you've probably already done this step. Congrats!
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
# create a new project in the current directory
|
|
13
|
+
npx sv create
|
|
14
|
+
|
|
15
|
+
# create a new project in my-app
|
|
16
|
+
npx sv create my-app
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Adding features
|
|
20
|
+
|
|
21
|
+
Add features to your project with `sv add`:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npx sv add
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For example, to add Tailwind CSS:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npx sv add tailwindcss
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Developing
|
|
34
|
+
|
|
35
|
+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npm run dev
|
|
39
|
+
|
|
40
|
+
# or start the server and open the app in a new browser tab
|
|
41
|
+
npm run dev -- --open
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
|
|
45
|
+
|
|
46
|
+
## Building
|
|
47
|
+
|
|
48
|
+
To build your library:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npm pack
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
To create a production version of your showcase app:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npm run build
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
You can preview the production build with `npm run preview`.
|
|
61
|
+
|
|
62
|
+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
63
|
+
|
|
64
|
+
## Publishing
|
|
65
|
+
|
|
66
|
+
Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
|
|
67
|
+
|
|
68
|
+
To publish your library to [npm](https://www.npmjs.com):
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
npm publish
|
|
72
|
+
```
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "package.json",
|
|
4
|
+
"contents": "{\n\t\"name\": \"$SV-NAME-TODO$\",\n\t\"version\": \"0.0.1\",\n\t\"keywords\": [\n\t\t\"svelte\"\n\t],\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"!dist/**/*.test.*\",\n\t\t\"!dist/**/*.spec.*\"\n\t],\n\t\"type\": \"module\",\n\t\"sideEffects\": [\n\t\t\"**/*.css\"\n\t],\n\t\"types\": \"./dist/index.d.ts\",\n\t\"svelte\": \"./dist/index.js\",\n\t\"imports\": {\n\t\t\"#lib\": \"./src/lib/index.js\",\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t},\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"svelte\": \"./dist/index.js\"\n\t\t}\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build && npm run prepack\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\",\n\t\t\"prepack\": \"svelte-kit sync && svelte-package && publint\",\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@sveltejs/adapter-auto\": \"^8.0.0\",\n\t\t\"@sveltejs/kit\": \"^3.0.0\",\n\t\t\"@sveltejs/package\": \"^2.5.8\",\n\t\t\"@sveltejs/vite-plugin-svelte\": \"^7.2.0\",\n\t\t\"publint\": \"^0.3.21\",\n\t\t\"svelte\": \"^5.57.2\",\n\t\t\"svelte-check\": \"^4.6.0\",\n\t\t\"typescript\": \"^6.0.3\",\n\t\t\"vite\": \"^8.3.0\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"svelte\": \"^5.0.0\"\n\t}\n}\n"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"name": "src/app.d.ts",
|
|
4
8
|
"contents": "// See https://svelte.dev/docs/kit/types#app.d.ts\n// for information about these interfaces\ndeclare global {\n\tnamespace App {\n\t\t// interface Error {}\n\t\t// interface Locals {}\n\t\t// interface PageData {}\n\t\t// interface PageState {}\n\t\t// interface Platform {}\n\t}\n}\n\nexport {};\n"
|
|
@@ -10,5 +14,13 @@
|
|
|
10
14
|
{
|
|
11
15
|
"name": "src/routes/+page.svelte",
|
|
12
16
|
"contents": "<h1>Welcome to your library project</h1>\n<p>Create your package using @sveltejs/package and preview/showcase your work with SvelteKit</p>\n<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>\n"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "jsconfig.json",
|
|
20
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "vite.config.js",
|
|
24
|
+
"contents": "import adapter from '@sveltejs/adapter-auto';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n\tplugins: [\n\t\tsveltekit({\n\t\t\tcompilerOptions: {\n\t\t\t\t// Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n\t\t\t\trunes: ({ filename }) =>\n\t\t\t\t\tfilename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n\t\t\t},\n\n\t\t\t// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n\t\t\t// If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n\t\t\t// See https://svelte.dev/docs/kit/adapters for more information about adapters.\n\t\t\tadapter: adapter()\n\t\t})\n\t]\n});\n"
|
|
13
25
|
}
|
|
14
26
|
]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "package.json",
|
|
4
|
+
"contents": "{\n\t\"name\": \"$SV-NAME-TODO$\",\n\t\"version\": \"0.0.1\",\n\t\"keywords\": [\n\t\t\"svelte\"\n\t],\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"!dist/**/*.test.*\",\n\t\t\"!dist/**/*.spec.*\"\n\t],\n\t\"type\": \"module\",\n\t\"sideEffects\": [\n\t\t\"**/*.css\"\n\t],\n\t\"types\": \"./dist/index.d.ts\",\n\t\"svelte\": \"./dist/index.js\",\n\t\"imports\": {\n\t\t\"#lib\": \"./src/lib/index.js\",\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t},\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"svelte\": \"./dist/index.js\"\n\t\t}\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build && npm run prepack\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\",\n\t\t\"prepack\": \"svelte-kit sync && svelte-package && publint\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@sveltejs/adapter-auto\": \"^8.0.0\",\n\t\t\"@sveltejs/kit\": \"^3.0.0\",\n\t\t\"@sveltejs/package\": \"^2.5.8\",\n\t\t\"@sveltejs/vite-plugin-svelte\": \"^7.2.0\",\n\t\t\"publint\": \"^0.3.21\",\n\t\t\"svelte\": \"^5.57.2\",\n\t\t\"typescript\": \"^6.0.3\",\n\t\t\"vite\": \"^8.3.0\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"svelte\": \"^5.0.0\"\n\t}\n}\n"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"name": "src/lib/index.js",
|
|
4
8
|
"contents": "// Reexport your entry components here\n"
|
|
@@ -6,5 +10,13 @@
|
|
|
6
10
|
{
|
|
7
11
|
"name": "src/routes/+page.svelte",
|
|
8
12
|
"contents": "<h1>Welcome to your library project</h1>\n<p>Create your package using @sveltejs/package and preview/showcase your work with SvelteKit</p>\n<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>\n"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"name": "jsconfig.json",
|
|
16
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "vite.config.js",
|
|
20
|
+
"contents": "import adapter from '@sveltejs/adapter-auto';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n\tplugins: [\n\t\tsveltekit({\n\t\t\tcompilerOptions: {\n\t\t\t\t// Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n\t\t\t\trunes: ({ filename }) =>\n\t\t\t\t\tfilename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n\t\t\t},\n\n\t\t\t// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n\t\t\t// If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n\t\t\t// See https://svelte.dev/docs/kit/adapters for more information about adapters.\n\t\t\tadapter: adapter()\n\t\t})\n\t]\n});\n"
|
|
9
21
|
}
|
|
10
22
|
]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "package.json",
|
|
4
|
+
"contents": "{\n\t\"name\": \"$SV-NAME-TODO$\",\n\t\"version\": \"0.0.1\",\n\t\"keywords\": [\n\t\t\"svelte\"\n\t],\n\t\"files\": [\n\t\t\"dist\",\n\t\t\"!dist/**/*.test.*\",\n\t\t\"!dist/**/*.spec.*\"\n\t],\n\t\"type\": \"module\",\n\t\"sideEffects\": [\n\t\t\"**/*.css\"\n\t],\n\t\"types\": \"./dist/index.d.ts\",\n\t\"svelte\": \"./dist/index.js\",\n\t\"imports\": {\n\t\t\"#lib\": \"./src/lib/index.js\",\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t},\n\t\"exports\": {\n\t\t\".\": {\n\t\t\t\"types\": \"./dist/index.d.ts\",\n\t\t\t\"svelte\": \"./dist/index.js\"\n\t\t}\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build && npm run prepack\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\",\n\t\t\"prepack\": \"svelte-kit sync && svelte-package && publint\",\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@sveltejs/adapter-auto\": \"^8.0.0\",\n\t\t\"@sveltejs/kit\": \"^3.0.0\",\n\t\t\"@sveltejs/package\": \"^2.5.8\",\n\t\t\"@sveltejs/vite-plugin-svelte\": \"^7.2.0\",\n\t\t\"publint\": \"^0.3.21\",\n\t\t\"svelte\": \"^5.57.2\",\n\t\t\"svelte-check\": \"^4.6.0\",\n\t\t\"typescript\": \"^6.0.3\",\n\t\t\"vite\": \"^8.3.0\"\n\t},\n\t\"peerDependencies\": {\n\t\t\"svelte\": \"^5.0.0\"\n\t}\n}\n"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"name": "src/app.d.ts",
|
|
4
8
|
"contents": "// See https://svelte.dev/docs/kit/types#app.d.ts\n// for information about these interfaces\ndeclare global {\n\tnamespace App {\n\t\t// interface Error {}\n\t\t// interface Locals {}\n\t\t// interface PageData {}\n\t\t// interface PageState {}\n\t\t// interface Platform {}\n\t}\n}\n\nexport {};\n"
|
|
@@ -10,5 +14,13 @@
|
|
|
10
14
|
{
|
|
11
15
|
"name": "src/routes/+page.svelte",
|
|
12
16
|
"contents": "<h1>Welcome to your library project</h1>\n<p>Create your package using @sveltejs/package and preview/showcase your work with SvelteKit</p>\n<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>\n"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "tsconfig.json",
|
|
20
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "vite.config.ts",
|
|
24
|
+
"contents": "import adapter from '@sveltejs/adapter-auto';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n\tplugins: [\n\t\tsveltekit({\n\t\t\tcompilerOptions: {\n\t\t\t\t// Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n\t\t\t\trunes: ({ filename }) =>\n\t\t\t\t\tfilename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n\t\t\t},\n\n\t\t\t// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n\t\t\t// If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n\t\t\t// See https://svelte.dev/docs/kit/adapters for more information about adapters.\n\t\t\tadapter: adapter()\n\t\t})\n\t]\n});\n"
|
|
13
25
|
}
|
|
14
26
|
]
|
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "$SV-NAME-TODO$",
|
|
3
3
|
"version": "0.0.1",
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"sideEffects": ["**/*.css"],
|
|
13
|
-
"svelte": "./dist/index.js",
|
|
14
|
-
"types": "./dist/index.d.ts",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"svelte"
|
|
6
|
+
],
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"!dist/**/*.test.*",
|
|
10
|
+
"!dist/**/*.spec.*"
|
|
11
|
+
],
|
|
15
12
|
"type": "module",
|
|
13
|
+
"sideEffects": [
|
|
14
|
+
"**/*.css"
|
|
15
|
+
],
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"svelte": "./dist/index.js",
|
|
18
|
+
"imports": {
|
|
19
|
+
"#lib": "./src/lib/index.js",
|
|
20
|
+
"#lib/*": "./src/lib/*"
|
|
21
|
+
},
|
|
16
22
|
"exports": {
|
|
17
23
|
".": {
|
|
18
24
|
"types": "./dist/index.d.ts",
|
|
19
25
|
"svelte": "./dist/index.js"
|
|
20
26
|
}
|
|
21
27
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "vite dev",
|
|
30
|
+
"build": "vite build && npm run prepack",
|
|
31
|
+
"preview": "vite preview",
|
|
32
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
33
|
+
"prepack": "svelte-kit sync && svelte-package && publint",
|
|
34
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
35
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
24
36
|
},
|
|
25
37
|
"devDependencies": {
|
|
26
38
|
"@sveltejs/adapter-auto": "^8.0.0",
|
|
@@ -28,13 +40,12 @@
|
|
|
28
40
|
"@sveltejs/package": "^2.5.8",
|
|
29
41
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
30
42
|
"publint": "^0.3.21",
|
|
31
|
-
"svelte": "^5.57.
|
|
43
|
+
"svelte": "^5.57.2",
|
|
44
|
+
"svelte-check": "^4.6.0",
|
|
32
45
|
"typescript": "^6.0.3",
|
|
33
46
|
"vite": "^8.3.0"
|
|
34
47
|
},
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
"#lib": "./src/lib/index.js",
|
|
38
|
-
"#lib/*": "./src/lib/*"
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"svelte": "^5.0.0"
|
|
39
50
|
}
|
|
40
51
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# sv
|
|
2
|
+
|
|
3
|
+
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
|
4
|
+
|
|
5
|
+
## Creating a project
|
|
6
|
+
|
|
7
|
+
If you're seeing this, you've probably already done this step. Congrats!
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# create a new project
|
|
11
|
+
npx sv create my-app
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Adding features
|
|
15
|
+
|
|
16
|
+
Add features to your project with `sv add`:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npx sv add
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
For example, to add Tailwind CSS:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npx sv add tailwindcss
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Developing
|
|
29
|
+
|
|
30
|
+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npm run dev
|
|
34
|
+
|
|
35
|
+
# or start the server and open the app in a new browser tab
|
|
36
|
+
npm run dev -- --open
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Building
|
|
40
|
+
|
|
41
|
+
To create a production version of your app:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npm run build
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
You can preview the production build with `npm run preview`.
|
|
48
|
+
|
|
49
|
+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "package.json",
|
|
4
|
+
"contents": "{\n\t\"name\": \"$SV-NAME-TODO$\",\n\t\"version\": \"0.0.1\",\n\t\"private\": true,\n\t\"type\": \"module\",\n\t\"imports\": {\n\t\t\"#lib\": \"./src/lib/index.js\",\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\",\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@sveltejs/adapter-auto\": \"^8.0.0\",\n\t\t\"@sveltejs/kit\": \"^3.0.0\",\n\t\t\"@sveltejs/vite-plugin-svelte\": \"^7.2.0\",\n\t\t\"svelte\": \"^5.57.2\",\n\t\t\"svelte-check\": \"^4.6.0\",\n\t\t\"typescript\": \"^6.0.3\",\n\t\t\"vite\": \"^8.3.0\"\n\t}\n}\n"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"name": "src/app.d.ts",
|
|
4
8
|
"contents": "// See https://svelte.dev/docs/kit/types#app.d.ts\n// for information about these interfaces\ndeclare global {\n\tnamespace App {\n\t\t// interface Error {}\n\t\t// interface Locals {}\n\t\t// interface PageData {}\n\t\t// interface PageState {}\n\t\t// interface Platform {}\n\t}\n}\n\nexport {};\n"
|
|
@@ -14,5 +18,13 @@
|
|
|
14
18
|
{
|
|
15
19
|
"name": "src/routes/+page.svelte",
|
|
16
20
|
"contents": "<h1>Welcome to SvelteKit</h1>\n<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "jsconfig.json",
|
|
24
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "vite.config.js",
|
|
28
|
+
"contents": "import adapter from '@sveltejs/adapter-auto';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n\tplugins: [\n\t\tsveltekit({\n\t\t\tcompilerOptions: {\n\t\t\t\t// Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n\t\t\t\trunes: ({ filename }) =>\n\t\t\t\t\tfilename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n\t\t\t},\n\n\t\t\t// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n\t\t\t// If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n\t\t\t// See https://svelte.dev/docs/kit/adapters for more information about adapters.\n\t\t\tadapter: adapter()\n\t\t})\n\t]\n});\n"
|
|
17
29
|
}
|
|
18
30
|
]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "package.json",
|
|
4
|
+
"contents": "{\n\t\"name\": \"$SV-NAME-TODO$\",\n\t\"version\": \"0.0.1\",\n\t\"private\": true,\n\t\"type\": \"module\",\n\t\"imports\": {\n\t\t\"#lib\": \"./src/lib/index.js\",\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@sveltejs/adapter-auto\": \"^8.0.0\",\n\t\t\"@sveltejs/kit\": \"^3.0.0\",\n\t\t\"@sveltejs/vite-plugin-svelte\": \"^7.2.0\",\n\t\t\"svelte\": \"^5.57.2\",\n\t\t\"vite\": \"^8.3.0\"\n\t}\n}\n"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"name": "src/lib/index.js",
|
|
4
8
|
"contents": "// place files you want to import through the `#lib` alias in this folder.\n"
|
|
@@ -10,5 +14,13 @@
|
|
|
10
14
|
{
|
|
11
15
|
"name": "src/routes/+page.svelte",
|
|
12
16
|
"contents": "<h1>Welcome to SvelteKit</h1>\n<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>\n"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "jsconfig.json",
|
|
20
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "vite.config.js",
|
|
24
|
+
"contents": "import adapter from '@sveltejs/adapter-auto';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n\tplugins: [\n\t\tsveltekit({\n\t\t\tcompilerOptions: {\n\t\t\t\t// Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n\t\t\t\trunes: ({ filename }) =>\n\t\t\t\t\tfilename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n\t\t\t},\n\n\t\t\t// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n\t\t\t// If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n\t\t\t// See https://svelte.dev/docs/kit/adapters for more information about adapters.\n\t\t\tadapter: adapter()\n\t\t})\n\t]\n});\n"
|
|
13
25
|
}
|
|
14
26
|
]
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"name": "package.json",
|
|
4
|
+
"contents": "{\n\t\"name\": \"$SV-NAME-TODO$\",\n\t\"version\": \"0.0.1\",\n\t\"private\": true,\n\t\"type\": \"module\",\n\t\"imports\": {\n\t\t\"#lib\": \"./src/lib/index.js\",\n\t\t\"#lib/*\": \"./src/lib/*\"\n\t},\n\t\"scripts\": {\n\t\t\"dev\": \"vite dev\",\n\t\t\"build\": \"vite build\",\n\t\t\"preview\": \"vite preview\",\n\t\t\"prepare\": \"svelte-kit sync || echo ''\",\n\t\t\"check\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json\",\n\t\t\"check:watch\": \"svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@sveltejs/adapter-auto\": \"^8.0.0\",\n\t\t\"@sveltejs/kit\": \"^3.0.0\",\n\t\t\"@sveltejs/vite-plugin-svelte\": \"^7.2.0\",\n\t\t\"svelte\": \"^5.57.2\",\n\t\t\"svelte-check\": \"^4.6.0\",\n\t\t\"typescript\": \"^6.0.3\",\n\t\t\"vite\": \"^8.3.0\"\n\t}\n}\n"
|
|
5
|
+
},
|
|
2
6
|
{
|
|
3
7
|
"name": "src/app.d.ts",
|
|
4
8
|
"contents": "// See https://svelte.dev/docs/kit/types#app.d.ts\n// for information about these interfaces\ndeclare global {\n\tnamespace App {\n\t\t// interface Error {}\n\t\t// interface Locals {}\n\t\t// interface PageData {}\n\t\t// interface PageState {}\n\t\t// interface Platform {}\n\t}\n}\n\nexport {};\n"
|
|
@@ -14,5 +18,13 @@
|
|
|
14
18
|
{
|
|
15
19
|
"name": "src/routes/+page.svelte",
|
|
16
20
|
"contents": "<h1>Welcome to SvelteKit</h1>\n<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>\n"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "tsconfig.json",
|
|
24
|
+
"contents": "{\n\t\"extends\": \"$app/tsconfig\",\n\t\"compilerOptions\": {\n\t\t\"strict\": true\n\t},\n\t\"include\": [\"src\", \"vite.config.ts\"]\n}\n"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "vite.config.ts",
|
|
28
|
+
"contents": "import adapter from '@sveltejs/adapter-auto';\nimport { sveltekit } from '@sveltejs/kit/vite';\nimport { defineConfig } from 'vite';\n\nexport default defineConfig({\n\tplugins: [\n\t\tsveltekit({\n\t\t\tcompilerOptions: {\n\t\t\t\t// Force runes mode for the project, except for libraries. Can be removed in svelte 6.\n\t\t\t\trunes: ({ filename }) =>\n\t\t\t\t\tfilename.split(/[/\\\\]/).includes('node_modules') ? undefined : true\n\t\t\t},\n\n\t\t\t// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.\n\t\t\t// If your environment is not supported, or you settled on a specific environment, switch out the adapter.\n\t\t\t// See https://svelte.dev/docs/kit/adapters for more information about adapters.\n\t\t\tadapter: adapter()\n\t\t})\n\t]\n});\n"
|
|
17
29
|
}
|
|
18
30
|
]
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "$SV-NAME-TODO$",
|
|
3
|
-
"private": true,
|
|
4
3
|
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
|
+
"imports": {
|
|
7
|
+
"#lib": "./src/lib/index.js",
|
|
8
|
+
"#lib/*": "./src/lib/*"
|
|
9
|
+
},
|
|
6
10
|
"scripts": {
|
|
7
11
|
"dev": "vite dev",
|
|
8
12
|
"build": "vite build",
|
|
9
13
|
"preview": "vite preview",
|
|
10
|
-
"prepare": "svelte-kit sync || echo ''"
|
|
14
|
+
"prepare": "svelte-kit sync || echo ''",
|
|
15
|
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
|
16
|
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
|
11
17
|
},
|
|
12
18
|
"devDependencies": {
|
|
13
19
|
"@sveltejs/adapter-auto": "^8.0.0",
|
|
14
20
|
"@sveltejs/kit": "^3.0.0",
|
|
15
21
|
"@sveltejs/vite-plugin-svelte": "^7.2.0",
|
|
16
|
-
"svelte": "^5.57.
|
|
22
|
+
"svelte": "^5.57.2",
|
|
23
|
+
"svelte-check": "^4.6.0",
|
|
24
|
+
"typescript": "^6.0.3",
|
|
17
25
|
"vite": "^8.3.0"
|
|
18
|
-
},
|
|
19
|
-
"imports": {
|
|
20
|
-
"#lib": "./src/lib/index.js",
|
|
21
|
-
"#lib/*": "./src/lib/*"
|
|
22
26
|
}
|
|
23
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sv",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A command line interface (CLI) for creating and maintaining Svelte applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create",
|
|
@@ -34,27 +34,23 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@sveltejs/sv-utils": "1.0
|
|
37
|
+
"@sveltejs/sv-utils": "1.1.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@clack/prompts": "1.5.0",
|
|
41
|
-
"@types/gitignore-parser": "^0.0.3",
|
|
42
41
|
"@types/ps-tree": "^1.1.6",
|
|
43
42
|
"commander": "^15.0.0",
|
|
44
43
|
"create-vite": "^9.2.1",
|
|
45
44
|
"empathic": "^2.0.1",
|
|
46
|
-
"gitignore-parser": "^0.0.2",
|
|
47
45
|
"modern-tar": "^0.7.7",
|
|
48
46
|
"ps-tree": "^1.2.0",
|
|
49
47
|
"sucrase": "^3.35.1",
|
|
50
|
-
"svelte": "^5.
|
|
48
|
+
"svelte": "^5.57.2",
|
|
51
49
|
"tinyexec": "^1.2.4",
|
|
52
50
|
"valibot": "^1.4.1"
|
|
53
51
|
},
|
|
54
52
|
"scripts": {
|
|
55
|
-
"check": "tsgo"
|
|
56
|
-
"update-kit-template-railway": "./src/create/scripts/update-kit-template-railway.sh",
|
|
57
|
-
"update-template-repo": "./src/create/scripts/update-template-repo.sh"
|
|
53
|
+
"check": "tsgo"
|
|
58
54
|
},
|
|
59
55
|
"bin": {
|
|
60
56
|
"sv": "./dist/bin.mjs"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
engine-strict=true
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
engine-strict=true
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
engine-strict=true
|