@stratify/cli 0.2.2 → 0.2.4
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 +9 -1
- package/dist/bin.js +14 -3
- package/package.json +4 -4
- package/template/package.json +12 -12
package/README.md
CHANGED
|
@@ -12,8 +12,16 @@ npm install -g @stratify/cli
|
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
|
+
With `npx` (no global install required):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npx @stratify/cli new <app-name>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or, after a global install:
|
|
22
|
+
|
|
15
23
|
```bash
|
|
16
|
-
|
|
24
|
+
stratify-cli new <app-name>
|
|
17
25
|
```
|
|
18
26
|
|
|
19
27
|
Creates a new project with:
|
package/dist/bin.js
CHANGED
|
@@ -1,19 +1,30 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
3
|
import { runNew } from "./new.js";
|
|
4
|
+
function sanitizeAppName(value) {
|
|
5
|
+
if (!value) {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
8
|
+
const trimmed = value.trim();
|
|
9
|
+
if (!trimmed || trimmed.includes("..") || /[\\/]/.test(trimmed)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
return /^[a-z0-9][a-z0-9-_]*$/i.test(trimmed) ? trimmed : undefined;
|
|
13
|
+
}
|
|
4
14
|
async function main() {
|
|
5
|
-
const [cmd,
|
|
15
|
+
const [cmd, rawName] = process.argv.slice(2).map((arg) => arg?.trim());
|
|
6
16
|
if (!cmd || cmd !== "new") {
|
|
7
17
|
console.error(`Usage:
|
|
8
|
-
npx stratify
|
|
18
|
+
npx @stratify/cli new <app-name>
|
|
9
19
|
|
|
10
20
|
Commands:
|
|
11
21
|
new Scaffold a new Stratify app
|
|
12
22
|
`);
|
|
13
23
|
process.exit(1);
|
|
14
24
|
}
|
|
25
|
+
const name = sanitizeAppName(rawName);
|
|
15
26
|
if (!name) {
|
|
16
|
-
console.error("Please provide
|
|
27
|
+
console.error("Please provide a valid app name (letters, numbers, dashes or underscores), e.g. npx @stratify/cli new my-app");
|
|
17
28
|
process.exit(1);
|
|
18
29
|
}
|
|
19
30
|
const templateDir = resolve(new URL("../template", import.meta.url).pathname);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stratify/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"stratify-cli": "./dist/bin.js"
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@types/node": "^
|
|
25
|
-
"tsx": "^4.
|
|
26
|
-
"typescript": "^5.
|
|
24
|
+
"@types/node": "^25.2.3",
|
|
25
|
+
"tsx": "^4.21.0",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
27
|
},
|
|
28
28
|
"keywords": [
|
|
29
29
|
"stratify",
|
package/template/package.json
CHANGED
|
@@ -11,19 +11,19 @@
|
|
|
11
11
|
"test": "tsx --test"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@fastify/cors": "^
|
|
15
|
-
"@sinclair/typebox": "^0.
|
|
16
|
-
"@stratify/core": "^0.2.
|
|
17
|
-
"close-with-grace": "2.
|
|
14
|
+
"@fastify/cors": "^11.2.0",
|
|
15
|
+
"@sinclair/typebox": "^0.34.48",
|
|
16
|
+
"@stratify/core": "^0.2.2",
|
|
17
|
+
"close-with-grace": "2.4.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@eslint/js": "^9.
|
|
21
|
-
"
|
|
22
|
-
"eslint
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"typescript
|
|
27
|
-
"
|
|
20
|
+
"@eslint/js": "^9.39.2",
|
|
21
|
+
"@types/node": "25.2.3",
|
|
22
|
+
"eslint": "^9.39.2",
|
|
23
|
+
"eslint-plugin-import": "^2.32.0",
|
|
24
|
+
"prettier": "^3.8.1",
|
|
25
|
+
"tsx": "^4.21.0",
|
|
26
|
+
"typescript": "^5.9.3",
|
|
27
|
+
"typescript-eslint": "^8.55.0"
|
|
28
28
|
}
|
|
29
29
|
}
|