@svgrid/create 1.0.0 → 1.0.2
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/README.md +5 -5
- package/index.mjs +13 -10
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -5,18 +5,18 @@ Scaffold a [Svelte](https://svelte.dev) app powered by
|
|
|
5
5
|
command.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm create
|
|
8
|
+
npm create @svgrid@latest
|
|
9
9
|
# or
|
|
10
|
-
pnpm create
|
|
10
|
+
pnpm create @svgrid
|
|
11
11
|
# or
|
|
12
|
-
yarn create
|
|
12
|
+
yarn create @svgrid
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Interactive by default. Or pass a directory and template directly:
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm create
|
|
19
|
-
pnpm create
|
|
18
|
+
npm create @svgrid@latest my-app -- --template admin-dashboard
|
|
19
|
+
pnpm create @svgrid my-app -t minimal
|
|
20
20
|
```
|
|
21
21
|
|
|
22
22
|
## Templates
|
package/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// @svgrid/create - scaffold a Svelte app powered by SvGrid.
|
|
3
3
|
//
|
|
4
|
-
// npm create
|
|
5
|
-
// pnpm create
|
|
6
|
-
// npm create
|
|
7
|
-
// npm create
|
|
4
|
+
// npm create @svgrid@latest # interactive
|
|
5
|
+
// pnpm create @svgrid # interactive
|
|
6
|
+
// npm create @svgrid@latest my-app -- --template admin-dashboard
|
|
7
|
+
// npm create @svgrid@latest my-app -- -t minimal
|
|
8
8
|
//
|
|
9
9
|
// Zero runtime dependencies - Node built-ins only. Copies a bundled template,
|
|
10
10
|
// renames `_`-prefixed dotfiles, and rewrites the project name.
|
|
@@ -68,7 +68,7 @@ function printHelp() {
|
|
|
68
68
|
${color('bold', '@svgrid/create')} - scaffold a Svelte app powered by SvGrid
|
|
69
69
|
|
|
70
70
|
${color('bold', 'Usage')}
|
|
71
|
-
npm create
|
|
71
|
+
npm create @svgrid@latest [dir] -- [--template <name>] [--force]
|
|
72
72
|
|
|
73
73
|
${color('bold', 'Templates')}
|
|
74
74
|
${Object.entries(TEMPLATES)
|
|
@@ -76,9 +76,9 @@ ${Object.entries(TEMPLATES)
|
|
|
76
76
|
.join('\n')}
|
|
77
77
|
|
|
78
78
|
${color('bold', 'Examples')}
|
|
79
|
-
npm create
|
|
80
|
-
npm create
|
|
81
|
-
pnpm create
|
|
79
|
+
npm create @svgrid@latest
|
|
80
|
+
npm create @svgrid@latest my-app -- --template admin-dashboard
|
|
81
|
+
pnpm create @svgrid my-app -t minimal
|
|
82
82
|
`)
|
|
83
83
|
}
|
|
84
84
|
|
|
@@ -100,10 +100,13 @@ function resolveTemplateDir(key) {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
async function copyTemplate(srcDir, destDir) {
|
|
103
|
+
// Match only on the path RELATIVE to the template root. The absolute `src`
|
|
104
|
+
// includes the install location (e.g. `.../node_modules/@svgrid/create/...`),
|
|
105
|
+
// so testing it directly would match `node_modules` and skip the whole copy.
|
|
106
|
+
const skip = /(^|[\\/])(node_modules|\.svelte-kit|\.vercel|build|dist)([\\/]|$)/
|
|
103
107
|
await cp(srcDir, destDir, {
|
|
104
108
|
recursive: true,
|
|
105
|
-
filter: (src) =>
|
|
106
|
-
!/[\\/](node_modules|\.svelte-kit|\.vercel|build|dist)([\\/]|$)/.test(src),
|
|
109
|
+
filter: (src) => !skip.test(src.slice(srcDir.length)),
|
|
107
110
|
})
|
|
108
111
|
// Rename `_`-prefixed files back to their real dotfile names.
|
|
109
112
|
await renameBack(destDir)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svgrid/create",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Scaffold a Svelte app powered by SvGrid in one command: npm create
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "Scaffold a Svelte app powered by SvGrid in one command: npm create @svgrid@latest",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "jQWidgets Ltd",
|
|
@@ -23,9 +23,7 @@
|
|
|
23
23
|
"starter",
|
|
24
24
|
"template"
|
|
25
25
|
],
|
|
26
|
-
"bin":
|
|
27
|
-
"@svgrid/create": "index.mjs"
|
|
28
|
-
},
|
|
26
|
+
"bin": "index.mjs",
|
|
29
27
|
"files": [
|
|
30
28
|
"index.mjs",
|
|
31
29
|
"templates"
|