@skafform/create 0.2.0 → 0.2.1

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 ADDED
@@ -0,0 +1,78 @@
1
+ # create-skafform
2
+
3
+ Scaffold a new [Skafform](https://github.com/skafform) project with Next.js or Nuxt, pre-configured with security headers, CSP, and the Skafform module system.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npm create @skafform@latest <project-name> [next|nuxt]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ | Argument | Description |
14
+ |----------|-------------|
15
+ | `next` | Scaffold a Next.js project (default) |
16
+ | `nuxt` | Scaffold a Nuxt project _(coming soon)_ |
17
+ | `-v, --version` | Show version number |
18
+ | `-h, --help` | Show help message |
19
+
20
+ ## Examples
21
+
22
+ ```bash
23
+ # Next.js (default)
24
+ npm create @skafform@latest my-app
25
+
26
+ # Next.js (explicit)
27
+ npm create @skafform@latest my-app next
28
+
29
+ # Nuxt (coming soon)
30
+ npm create @skafform@latest my-app nuxt
31
+ ```
32
+
33
+ ## What's included
34
+
35
+ ### Next.js
36
+ - Next.js with TypeScript, Tailwind CSS, ESLint, and App Router
37
+ - Content Security Policy (CSP) via `next.config.ts`
38
+ - Security headers: `X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`, `Permissions-Policy`
39
+ - Middleware proxy via `proxy.ts` with `beforeAuth` / `afterAuth` hooks
40
+ - `Providers` wrapper in `app/layout.tsx`
41
+
42
+ ### Project structure
43
+
44
+ ```
45
+ my-app/
46
+ ├── .skafform/
47
+ │ ├── contracts/ # Skafform module contracts
48
+ │ ├── modules/ # Installed module overrides
49
+ │ ├── installed.json # Installed modules registry
50
+ │ ├── csp.ts # CSP builder (managed)
51
+ │ ├── proxy.ts # Middleware logic (managed)
52
+ │ └── providers.tsx # React providers (managed)
53
+ ├── proxy.ts # User-owned middleware entry point
54
+ └── ...
55
+ ```
56
+
57
+ ## After scaffolding
58
+
59
+ ```bash
60
+ cd my-app
61
+ npm run dev
62
+ ```
63
+
64
+ To add integrations:
65
+
66
+ ```bash
67
+ npx skafform serve
68
+ ```
69
+
70
+ ## Project name rules
71
+
72
+ Only lowercase letters, numbers, hyphens, and underscores are allowed.
73
+
74
+ ```bash
75
+ my-app # valid
76
+ my_app # valid
77
+ MyApp # invalid
78
+ ```
package/dist/index.js CHANGED
@@ -12,25 +12,26 @@ if (process.argv[2] === "--version" || process.argv[2] === "-v") {
12
12
  }
13
13
  if (process.argv[2] === "--help" || process.argv[2] === "-h") {
14
14
  console.log(`
15
- Usage: create-skafform <project-name> [--next|--nuxt]
15
+ Usage: create-skafform <project-name> [next|nuxt]
16
16
 
17
17
  Options:
18
- --next Scaffold a Next.js project (default)
19
- --nuxt Scaffold a Nuxt project
18
+ next Scaffold a Next.js project (default)
19
+ nuxt Scaffold a Nuxt project
20
20
  -v, --version Show version number
21
21
  -h, --help Show this help message
22
22
 
23
23
  Examples:
24
- npx create-skafform my-app --next
25
- npx create-skafform my-app --nuxt
24
+ npm create @skafform@latest my-app
25
+ npm create @skafform@latest my-app next
26
+ npm create @skafform@latest my-app nuxt
26
27
  `);
27
28
  process.exit(0);
28
29
  }
29
30
  const name = process.argv[2];
30
- const flags = process.argv.slice(3);
31
- const isNuxt = flags.includes("--nuxt");
31
+ const framework = process.argv[3];
32
+ const isNuxt = framework === "nuxt";
32
33
  if (!name) {
33
- console.error("Usage: npx create-skafform <project-name> [--next|--nuxt]");
34
+ console.error("Usage: npm create @skafform@latest <project-name> [next|nuxt]");
34
35
  process.exit(1);
35
36
  }
36
37
  if (!/^[a-z0-9-_]+$/.test(name)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skafform/create",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Scaffold a new Skafform project",
5
5
  "bin": {
6
6
  "create-skafform": "./dist/index.js"