@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 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
- npx stratify-cli new <app-name>
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, name] = process.argv.slice(2);
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-cli new <app-name>
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 an app name, e.g. npx stratify-cli new my-app");
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.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": "^24.7.2",
25
- "tsx": "^4.16.2",
26
- "typescript": "^5.6.3"
24
+ "@types/node": "^25.2.3",
25
+ "tsx": "^4.21.0",
26
+ "typescript": "^5.9.3"
27
27
  },
28
28
  "keywords": [
29
29
  "stratify",
@@ -11,19 +11,19 @@
11
11
  "test": "tsx --test"
12
12
  },
13
13
  "dependencies": {
14
- "@fastify/cors": "^10.0.0",
15
- "@sinclair/typebox": "^0.32.30",
16
- "@stratify/core": "^0.2.1",
17
- "close-with-grace": "2.3.0"
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.13.0",
21
- "eslint": "^9.13.0",
22
- "eslint-plugin-import": "^2.31.0",
23
- "prettier": "^3.3.3",
24
- "tsx": "^4.16.2",
25
- "typescript": "^5.6.3",
26
- "typescript-eslint": "^8.8.1",
27
- "@types/node": "24.7.2"
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
  }