@openelement/create 0.44.0-beta.2.2 → 1.0.0-alpha.10

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.
Files changed (42) hide show
  1. package/README.md +105 -24
  2. package/package.json +16 -4
  3. package/src/cli.d.ts +1 -1
  4. package/src/cli.js +126 -66
  5. package/src/install-command.d.ts +50 -0
  6. package/src/install-command.js +52 -0
  7. package/src/template-builder.js +128 -166
  8. package/src/version.js +23 -2
  9. package/templates/README.tmpl +56 -23
  10. package/templates/app/components/{page-404.tsx → page-404.tsx.tmpl} +6 -2
  11. package/templates/app/components/{page-blog-index.tsx → page-blog-index.tsx.tmpl} +6 -2
  12. package/templates/app/components/{page-blog-welcome.tsx → page-blog-welcome.tsx.tmpl} +9 -6
  13. package/templates/app/components/{page-contact.tsx → page-contact.tsx.tmpl} +5 -2
  14. package/templates/app/components/{page-freshness.tsx → page-freshness.tsx.tmpl} +6 -2
  15. package/templates/app/components/{page-home.tsx → page-home.tsx.tmpl} +10 -7
  16. package/templates/app/components/page-styles.ts.tmpl +123 -0
  17. package/templates/app/head.tsx.tmpl +42 -0
  18. package/templates/app/islands/app-shell.tsx.tmpl +83 -0
  19. package/templates/app/islands/my-counter.tsx.tmpl +55 -0
  20. package/templates/app/islands/only-ticker.tsx.tmpl +51 -0
  21. package/templates/app/routes/{404.tsx → 404.tsx.tmpl} +1 -1
  22. package/templates/app/routes/blog/{index.tsx → index.tsx.tmpl} +1 -1
  23. package/templates/app/routes/blog/{welcome.tsx → welcome.tsx.tmpl} +1 -1
  24. package/templates/app/routes/{contact.tsx → contact.tsx.tmpl} +1 -1
  25. package/templates/app/routes/{freshness.tsx → freshness.tsx.tmpl} +1 -1
  26. package/templates/app/routes/{index.tsx → index.tsx.tmpl} +1 -1
  27. package/templates/app/styles/tokens.css +57 -0
  28. package/templates/gitignore.tmpl +1 -0
  29. package/templates/openelement.config.ts.tmpl +31 -0
  30. package/templates/package.json.tmpl +29 -0
  31. package/templates/tailwind/theme.css +108 -0
  32. package/templates/tailwind/vite.config.ts.tmpl +38 -0
  33. package/templates/tsconfig.json.tmpl +15 -0
  34. package/templates/vite.config.ts.tmpl +11 -0
  35. package/templates/app/components/page-styles.ts +0 -64
  36. package/templates/app/data/_generated-blog-data.d.ts +0 -21
  37. package/templates/app/islands/app-shell.tsx +0 -58
  38. package/templates/app/islands/my-counter.tsx +0 -38
  39. package/templates/app/islands/only-ticker.tsx +0 -34
  40. package/templates/deno.json.tmpl +0 -26
  41. package/templates/vite.config.ts +0 -100
  42. /package/templates/app/routes/api/{health.ts → health.ts.tmpl} +0 -0
package/README.md CHANGED
@@ -2,47 +2,128 @@
2
2
 
3
3
  Project scaffolding CLI for openElement applications.
4
4
 
5
- > Stable surface (frozen under ADR-0122):
6
- > Framework product entry. This package is part of the
7
- > first-run Framework story alongside `@openelement/app` and
8
- > `@openelement/adapter-vite`.
5
+ Docs and guides: <https://openelement.org>.
6
+
7
+ > 1.0 Alpha line: the supported creation entry for Element and Router. The
8
+ > published npm versions and dist-tags are registry truth (query them with
9
+ > `npm view @openelement/create dist-tags`); `latest` stays on the stable 0.43
10
+ > line until a separately admitted stable release.
9
11
 
10
12
  `@openelement/create` generates a new openElement project with the recommended
11
- directory structure, Deno configuration, Vite setup, and starter pages.
13
+ directory structure, a pnpm-scripted package manifest, Vite setup, and starter
14
+ pages. The generated project is a plain Node/pnpm project.
12
15
 
13
- ## Usage
16
+ ## Usage (1.0 Alpha)
14
17
 
15
18
  ```bash
16
- deno run -A --minimum-dependency-age 0 npm:@openelement/create my-app
19
+ npm create @openelement@alpha my-app
17
20
  cd my-app
18
- deno task dev
21
+ pnpm install
22
+ pnpm dev
23
+ ```
24
+
25
+ `npm create @openelement@alpha` rides npm's initializer alias: a bare `@scope`
26
+ resolves to `@scope/create` at the same tag, so the canonical spelling names
27
+ the scope, and npm runs this package's generator. The version `@alpha` resolves
28
+ to is registered in
29
+ `the tracked release-state manifest` (currently `1.0.0-alpha.9`, a new baseline —
30
+ not a 0.x upgrade, with no migration path from 0.x). Pin that exact version
31
+ when reproducibility matters (verify against the live registry with
32
+ `npm view @openelement/create dist-tags.alpha`):
33
+
34
+ ```bash
35
+ npm create @openelement@1.0.0-alpha.9 my-app
36
+ ```
37
+
38
+ The generated starter pins the exact `@openelement/*` versions it was built
39
+ from in its `package.json` dependencies.
40
+
41
+ The canonical install command is exported from `@openelement/create/install-command` (one builder, every documented copy derives from it).
42
+
43
+ ## Tailwind form (the one scaffold question)
44
+
45
+ The scaffold ships the **Tailwind-ON starter by default**: a preset-wired
46
+ `vite.config.ts` (the `@openelement/router` Tailwind preset), the
47
+ `app/styles/theme.css` `@theme` role sheet (semantic roles over the Tailwind
48
+ default scale), and exact `tailwindcss` / `@tailwindcss/vite` pins in
49
+ `devDependencies`. Interactively the CLI asks exactly one question —
50
+ `Enable Tailwind CSS + @theme role sheet? (Y/n)` — and every non-interactive
51
+ run (CI, packed consumers) takes the same `Y` default. Pass a flag to skip the
52
+ question; the flags reach the generator through the spellings that forward
53
+ trailing arguments (`npx`, `pnpm dlx`, or a directly invoked bin):
54
+
55
+ ```bash
56
+ npx @openelement/create@alpha my-app --no-tailwind # the minimal starter
57
+ npx @openelement/create@alpha my-app --tailwind # explicit ON (the default)
19
58
  ```
20
59
 
21
- The default dist-tag is the stable 0.43 line, and
22
- `--minimum-dependency-age 0` is needed because Deno's default
23
- minimumDependencyAge (~24h) refuses packages published within the last day.
60
+ `--no-tailwind` generates the pre-#1524 minimal starter: no Tailwind
61
+ dependency surface, no preset wiring, no role sheet.
62
+
63
+ ## The bootstrap is a plain npm invocation; the generated project is Node
64
+
65
+ The documented bootstrap runs the generator through `npm create` (or the
66
+ `npx` short form, or `pnpm dlx`) — plain Node tooling, no second runtime.
67
+ Node.js 24.2+ is the only host requirement for both the bootstrap and the
68
+ generated project. The packed package ships two equivalent npm bins
69
+ (`openelement-create`, `create-openelement`, both the same entry), so the pnpm
70
+ form must name one explicitly:
71
+
72
+ ```bash
73
+ npx @openelement/create@alpha my-app
74
+ pnpm dlx --package=@openelement/create@alpha openelement-create my-app
75
+ ```
76
+
77
+ The scaffolded project itself is Node-native: Node.js 24.2+ and
78
+ pnpm run its scripts.
79
+
80
+ ## Stable 0.43 (maintenance line)
81
+
82
+ The stable 0.43 line is still published, but it is not the Alpha install path.
83
+ A versionless install resolves the npm `latest` dist-tag to it; pin the line
84
+ explicitly instead:
85
+
86
+ ```bash
87
+ npm create @openelement@0.43 my-app
88
+ ```
24
89
 
25
90
  ## Requirements
26
91
 
27
- **Deno 2.8+.** The generated starter writes the `minimumDependencyAge` config
28
- key into its `deno.json` (a key introduced in Deno 2.5.5) and is exercised
29
- against the same toolchain the repo pins in CI (2.9.x, see `.dvmrc`); 2.8 is
30
- the declared support floor. Older Deno versions do not understand the key and
31
- will warn or error.
92
+ - **Bootstrap:** Node.js 24.2+ with npm (or pnpm for the `pnpm dlx` variant) —
93
+ the verified floor this repository exercises in CI.
94
+ - **Generated project:** Node.js 24.2+ (the floor the packed `@openelement/*`
95
+ engines declare and CI exercises; `.node-version` pins the development
96
+ line) and pnpm for the lifecycle scripts.
32
97
 
33
98
  ## What It Creates
34
99
 
35
- - `deno.json` - starter authoring imports and build tasks
36
- - `vite.config.ts` - Vite build configuration with the openElement plugin
37
- - `app/` - application directory with starter pages and islands
38
- - `content/blog/` - a sample markdown post wired into the generated blog-data
39
- module
100
+ - `package.json` - starter dependencies (exact `@openelement/*` release pins)
101
+ and the lifecycle scripts (`dev`/`check`/`test`/`build`/`start`/`preview`);
102
+ the default (Tailwind-ON) form adds the exact `tailwindcss` and
103
+ `@tailwindcss/vite` dev pins
104
+ - `tsconfig.json` - the type-check surface for `pnpm check`: JSX authoring
105
+ through the element import source, whole-`app/` coverage
106
+ - `vite.config.ts` - Vite build configuration. On the default (Tailwind-ON)
107
+ form it also applies the router's public Tailwind preset so the role sheet
108
+ compiles into the linked bundle; framework options still have exactly one
109
+ home:
110
+ - `openelement.config.ts` - the framework options. It is OPTIONAL and nearly
111
+ empty by default; every option it omits comes from a file convention —
112
+ design tokens from `app/styles/tokens.css`, the app shell from
113
+ `app/islands/app-shell.tsx`, structural document-head content from
114
+ `app/head.tsx`, the site title from `package.json`. Passing framework
115
+ options inline to `openElement()` while this file carries options is a hard
116
+ error, and an unknown key fails the build with the accepted-key list.
117
+ - `app/` - application directory with starter pages and islands; the
118
+ Tailwind-ON form adds `app/styles/theme.css`, the `@theme` role sheet
119
+ - `app/routes/blog/` - the sample blog as compiled page routes (`index` list
120
+ and `welcome` post), prerendered at build time
40
121
  - `public/` - static assets
41
122
  - `README.md` and `.gitignore` - starter docs and ignore rules
42
123
 
43
- The generated import map intentionally keeps protocol and build internals out of
44
- the starter surface. Advanced contracts remain available through the published
45
- workspace packages when a project needs them.
124
+ The generated dependency set intentionally keeps protocol and build internals
125
+ out of the starter surface. Advanced contracts remain available through the
126
+ published workspace packages when a project needs them.
46
127
 
47
128
  ## License
48
129
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openelement/create",
3
- "version": "0.44.0-beta.2.2",
3
+ "version": "1.0.0-alpha.10",
4
4
  "type": "module",
5
5
  "main": "./src/cli.js",
6
6
  "types": "./src/cli.d.ts",
@@ -9,6 +9,11 @@
9
9
  "types": "./src/cli.d.ts",
10
10
  "import": "./src/cli.js",
11
11
  "default": "./src/cli.js"
12
+ },
13
+ "./install-command": {
14
+ "types": "./src/install-command.d.ts",
15
+ "import": "./src/install-command.js",
16
+ "default": "./src/install-command.js"
12
17
  }
13
18
  },
14
19
  "repository": {
@@ -22,13 +27,20 @@
22
27
  "keywords": [
23
28
  "openelement",
24
29
  "web-components",
25
- "ssg",
26
- "framework",
27
- "deno"
30
+ "scaffolding",
31
+ "generator",
32
+ "starter"
33
+ ],
34
+ "engines": {
35
+ "node": ">=24.2"
36
+ },
37
+ "sideEffects": [
38
+ "./src/cli.js"
28
39
  ],
29
40
  "bin": {
30
41
  "openelement-create": "./src/cli.js",
31
42
  "create-openelement": "./src/cli.js"
32
43
  },
44
+ "peerDependenciesMeta": {},
33
45
  "dependencies": {}
34
46
  }
package/src/cli.d.ts CHANGED
@@ -1 +1 @@
1
- #!/usr/bin/env -S deno run -A
1
+ export {}
package/src/cli.js CHANGED
@@ -1,76 +1,136 @@
1
- #!/usr/bin/env -S deno run -A
1
+ #!/usr/bin/env node
2
+ import { buildTemplates, resolveVersions, validateProjectName } from "./template-builder.js";
3
+ import { createInstallCommand } from "./install-command.js";
4
+ import { mkdir, stat, writeFile } from "node:fs/promises";
5
+ import process from "node:process";
6
+ import readline from "node:readline/promises";
7
+ //#region src/cli.ts
2
8
  /**
3
- * @openelement/create - Minimal project scaffold for openElement framework.
4
- *
5
- * Usage: deno run -A --minimum-dependency-age 0 npm:@openelement/create my-app
6
- *
7
- * openElement Architecture: Keep It Simple, Stupid.
8
- * One template, zero prompts, instant start.
9
- *
10
- * L9: every failure mode (invalid name, existing directory, permission or
11
- * write errors, unexpected defects) exits 1 with one actionable message —
12
- * never a runtime stack trace.
13
- */ import { dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
14
- import { buildTemplates, resolveVersions, validateProjectName } from './template-builder.js';
9
+ * @openelement/create - Minimal project scaffold for openElement framework.
10
+ *
11
+ * The install command this CLI documents is built by ./install-command.ts
12
+ * (#1414): usage output, the guides and the homepage all render that one
13
+ * string, so the documented command cannot drift from the shipped flags.
14
+ *
15
+ * openElement Architecture: Keep It Simple, Stupid.
16
+ * One template, one question, instant start. The single question is the
17
+ * Tailwind form (#1524): the default (and every non-interactive run) ships
18
+ * the Tailwind-ON starter — preset-wired vite config, @theme role sheet, and
19
+ * the exact tailwindcss/@tailwindcss/vite pins; `--no-tailwind` keeps the
20
+ * pre-#1524 minimal template.
21
+ *
22
+ * L9: every failure mode exits 1 with one actionable message — never a
23
+ * runtime stack trace.
24
+ */
15
25
  function errorMessage(error) {
16
- return error instanceof Error ? error.message : String(error);
26
+ return error instanceof Error ? error.message : String(error);
27
+ }
28
+ /** node:fs error shape for "path does not exist". */
29
+ function isNotFound(error) {
30
+ return error.code === "ENOENT";
31
+ }
32
+ /** node:fs error shapes for "not permitted". */
33
+ function isPermissionDenied(error) {
34
+ const code = error.code;
35
+ return code === "EACCES" || code === "EPERM";
17
36
  }
18
37
  function fail(message) {
19
- console.error(`error: ${message}`);
20
- Deno.exit(1);
38
+ console.error(`error: ${message}`);
39
+ process.exit(1);
40
+ }
41
+ function joinPosix(...parts) {
42
+ return parts.join("/").replace(/\/{2,}/g, "/");
43
+ }
44
+ function dirnameOf(path) {
45
+ const idx = path.replace(/\\+/g, "/").lastIndexOf("/");
46
+ if (idx <= 0) return ".";
47
+ return path.slice(0, idx);
48
+ }
49
+ /** The CLI flags and the project-name positional, parsed without a library. */
50
+ function parseArgs(argv) {
51
+ let name;
52
+ let tailwind;
53
+ for (const arg of argv) if (arg === "--tailwind") tailwind = true;
54
+ else if (arg === "--no-tailwind") tailwind = false;
55
+ else if (arg.startsWith("-")) continue;
56
+ else if (name === void 0) name = arg;
57
+ return {
58
+ name,
59
+ tailwind
60
+ };
61
+ }
62
+ /**
63
+ * Resolve the Tailwind form: a flag wins without prompting; otherwise a TTY
64
+ * asks the one scaffold question (default Y), and a non-TTY run (CI, packed
65
+ * consumers) takes the same default without prompting.
66
+ */
67
+ async function resolveTailwindForm(flag) {
68
+ if (flag !== void 0) return flag;
69
+ if (!process.stdin.isTTY || !process.stdout.isTTY) return true;
70
+ const rl = readline.createInterface({
71
+ input: process.stdin,
72
+ output: process.stdout
73
+ });
74
+ try {
75
+ for (;;) {
76
+ const answer = (await rl.question("Enable Tailwind CSS + @theme role sheet? (Y/n) ")).trim().toLowerCase();
77
+ if (answer === "" || answer === "y" || answer === "yes") return true;
78
+ if (answer === "n" || answer === "no") return false;
79
+ console.info(" please answer y (default) or n");
80
+ }
81
+ } finally {
82
+ rl.close();
83
+ }
21
84
  }
22
85
  async function main() {
23
- const name = Deno.args[0];
24
- if (!name || name === '--help' || name === '-h') {
25
- console.log('Usage: deno run -A --minimum-dependency-age 0 npm:@openelement/create <project-name>');
26
- Deno.exit(name ? 0 : 1);
27
- }
28
- // L11: npm-name + path-traversal validation before any filesystem work.
29
- const invalid = validateProjectName(name);
30
- if (invalid) fail(`Invalid project name "${name}". ${invalid}`);
31
- const cwd = Deno.cwd();
32
- const targetDir = resolve(cwd, name);
33
- const relativeTarget = relative(cwd, targetDir);
34
- // Defense in depth behind validateProjectName: even a name that passes the
35
- // character rules must resolve inside the current directory.
36
- if (!relativeTarget || relativeTarget === '..' || relativeTarget.startsWith(`..${sep}`) || isAbsolute(relativeTarget)) {
37
- fail(`Refusing to create project outside the current directory: ${name}`);
38
- }
39
- try {
40
- await Deno.stat(targetDir);
41
- fail(`Directory "${name}" already exists. Choose a different name or remove the existing directory.`);
42
- } catch (error) {
43
- if (!(error instanceof Deno.errors.NotFound)) {
44
- throw new Error(`Could not inspect target directory "${name}": ${errorMessage(error)}`);
45
- }
46
- }
47
- // Resolve package versions before generating templates
48
- const v = resolveVersions();
49
- try {
50
- await Deno.mkdir(targetDir, {
51
- recursive: true
52
- });
53
- const TPL = await buildTemplates(v);
54
- for (const [path, content] of Object.entries(TPL)){
55
- const fullPath = join(targetDir, path);
56
- await Deno.mkdir(dirname(fullPath), {
57
- recursive: true
58
- });
59
- await Deno.writeTextFile(fullPath, content);
60
- console.info(` created ${path}`);
61
- }
62
- } catch (error) {
63
- const detail = error instanceof Deno.errors.PermissionDenied ? `Permission denied. Check write permissions for ${targetDir}.` : errorMessage(error);
64
- throw new Error(`Failed to write project files in "${name}": ${detail} ` + 'Remove the partially created directory before retrying.');
65
- }
66
- console.info(`\nopenElement project created at ./${relativeTarget}/`);
67
- console.info(`\n cd ${relativeTarget}`);
68
- console.info(' deno task dev');
69
- console.info(' See README.md for all tasks (check/build/start/preview)');
86
+ const argv = process.argv.slice(2);
87
+ const { name: positionalName, tailwind: tailwindFlag } = parseArgs(argv);
88
+ const name = positionalName;
89
+ if (!name || name === "--help" || name === "-h") {
90
+ console.log(`Usage (Alpha): ${createInstallCommand()}`);
91
+ console.log("(a versionless install resolves the stable 0.43 line)");
92
+ console.log(" --tailwind ship the Tailwind-ON starter (default)");
93
+ console.log(" --no-tailwind ship the minimal starter without Tailwind");
94
+ process.exit(name ? 0 : 1);
95
+ }
96
+ if (argv.includes("--tailwind") && argv.includes("--no-tailwind")) fail("--tailwind and --no-tailwind are mutually exclusive.");
97
+ const invalid = validateProjectName(name);
98
+ if (invalid) fail(`Invalid project name "${name}". ${invalid}`);
99
+ const targetDir = `${process.cwd().replace(/\/+$/, "")}/${name}`;
100
+ const relativeTarget = name;
101
+ if (!relativeTarget || relativeTarget.includes("..") || relativeTarget.includes("/") || relativeTarget.includes("\\") || /^[a-zA-Z]:/.test(relativeTarget) || relativeTarget.startsWith("/")) fail(`Refusing to create project outside the current directory: ${name}`);
102
+ try {
103
+ await stat(targetDir);
104
+ fail(`Directory "${name}" already exists. Choose a different name or remove the existing directory.`);
105
+ } catch (error) {
106
+ if (!isNotFound(error)) throw new Error(`Could not inspect target directory "${name}": ${errorMessage(error)}`);
107
+ }
108
+ const tailwind = await resolveTailwindForm(tailwindFlag);
109
+ const v = resolveVersions();
110
+ try {
111
+ await mkdir(targetDir, { recursive: true });
112
+ const TPL = await buildTemplates(v, name, { tailwind });
113
+ for (const [path, content] of Object.entries(TPL)) {
114
+ const fullPath = joinPosix(targetDir, path);
115
+ await mkdir(dirnameOf(fullPath), { recursive: true });
116
+ await writeFile(fullPath, content, "utf8");
117
+ console.info(` created ${path}`);
118
+ }
119
+ } catch (error) {
120
+ const detail = isPermissionDenied(error) ? `Permission denied. Check write permissions for ${targetDir}.` : errorMessage(error);
121
+ throw new Error(`Failed to write project files in "${name}": ${detail} Remove the partially created directory before retrying.`);
122
+ }
123
+ console.info(`\nopenElement project created at ./${relativeTarget}/`);
124
+ console.info(tailwind ? " Tailwind: ON — app/styles/theme.css carries the @theme role sheet." : " Tailwind: OFF — minimal starter, no Tailwind dependency surface.");
125
+ console.info(`\n cd ${relativeTarget}`);
126
+ console.info(" pnpm install");
127
+ console.info(" pnpm dev");
128
+ console.info(" See README.md for all scripts (check/test/build/start/preview)");
70
129
  }
71
130
  try {
72
- await main();
131
+ await main();
73
132
  } catch (error) {
74
- fail(errorMessage(error));
133
+ fail(errorMessage(error));
75
134
  }
76
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImZpbGU6Ly8vaG9tZS9ydW5uZXIvd29yay9vcGVuZWxlbWVudC9vcGVuZWxlbWVudC9wYWNrYWdlcy9jcmVhdGUvc3JjL2NsaS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBvcGVuZWxlbWVudC9jcmVhdGUgLSBNaW5pbWFsIHByb2plY3Qgc2NhZmZvbGQgZm9yIG9wZW5FbGVtZW50IGZyYW1ld29yay5cbiAqXG4gKiBVc2FnZTogZGVubyBydW4gLUEgLS1taW5pbXVtLWRlcGVuZGVuY3ktYWdlIDAgbnBtOkBvcGVuZWxlbWVudC9jcmVhdGUgbXktYXBwXG4gKlxuICogb3BlbkVsZW1lbnQgQXJjaGl0ZWN0dXJlOiBLZWVwIEl0IFNpbXBsZSwgU3R1cGlkLlxuICogT25lIHRlbXBsYXRlLCB6ZXJvIHByb21wdHMsIGluc3RhbnQgc3RhcnQuXG4gKlxuICogTDk6IGV2ZXJ5IGZhaWx1cmUgbW9kZSAoaW52YWxpZCBuYW1lLCBleGlzdGluZyBkaXJlY3RvcnksIHBlcm1pc3Npb24gb3JcbiAqIHdyaXRlIGVycm9ycywgdW5leHBlY3RlZCBkZWZlY3RzKSBleGl0cyAxIHdpdGggb25lIGFjdGlvbmFibGUgbWVzc2FnZSDigJRcbiAqIG5ldmVyIGEgcnVudGltZSBzdGFjayB0cmFjZS5cbiAqL1xuXG5pbXBvcnQgeyBkaXJuYW1lLCBpc0Fic29sdXRlLCBqb2luLCByZWxhdGl2ZSwgcmVzb2x2ZSwgc2VwIH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EtBQUssV0FBVztNQUNqQyxNQUFNLEtBQUssS0FBSyxDQUFDLFFBQVEsV0FBVztRQUFFLFdBQVc7TUFBSztNQUN0RCxNQUFNLEtBQUssYUFBYSxDQUFDLFVBQVU7TUFDbkMsUUFBUSxJQUFJLENBQUMsQ0FBQyxVQUFVLEVBQUUsTUFBTTtJQUNsQztFQUNGLEVBQUUsT0FBTyxPQUFPO0lBQ2QsTUFBTSxTQUFTLGlCQUFpQixLQUFLLE1BQU0sQ0FBQyxnQkFBZ0IsR0FDeEQsQ0FBQywrQ0FBK0MsRUFBRSxVQUFVLENBQUMsQ0FBQyxHQUM5RCxhQUFhO0lBQ2pCLE1BQU0sSUFBSSxNQUNSLENBQUMsa0NBQWtDLEVBQUUsS0FBSyxHQUFHLEVBQUUsT0FBTyxDQUFDLENBQUMsR0FDdEQ7RUFFTjtFQUVBLFFBQVEsSUFBSSxDQUFDLENBQUMsbUNBQW1DLEVBQUUsZUFBZSxDQUFDLENBQUM7RUFDcEUsUUFBUSxJQUFJLENBQUMsQ0FBQyxPQUFPLEVBQUUsZ0JBQWdCO0VBQ3ZDLFFBQVEsSUFBSSxDQUFDO0VBQ2IsUUFBUSxJQUFJLENBQUM7QUFDZjtBQUVBLElBQUk7RUFDRixNQUFNO0FBQ1IsRUFBRSxPQUFPLE9BQU87RUFDZCxLQUFLLGFBQWE7QUFDcEIifQ==
135
+ //#endregion
136
+ export {};
@@ -0,0 +1,50 @@
1
+ //#region src/install-command.d.ts
2
+ /**
3
+ * The canonical install command — the ONE source every documented copy of it
4
+ * derives from (#1414 item 5).
5
+ *
6
+ * The command is data about this CLI, so it lives beside the CLI: `cli.ts`
7
+ * prints it in its usage output, the site's documentation generator inlines it
8
+ * into the guides and the homepage, and the install-command gate
9
+ * (the site's install-command generator --check) fails when any curated copy
10
+ * in the repository differs from this string. There is no second spelling to
11
+ * drift.
12
+ *
13
+ * This module is deliberately side-effect free (no top-level CLI execution):
14
+ * it is imported by the site build as well as by the CLI itself.
15
+ */
16
+ /** The npm specifier the generator is published under. */
17
+ export declare const CREATE_PACKAGE_SPECIFIER = "@openelement/create";
18
+ /**
19
+ * The scope `npm create` resolves to {@linkcode CREATE_PACKAGE_SPECIFIER}:
20
+ * npm's initializer alias maps a bare `@scope` (optionally `@scope@<tag>`) to
21
+ * `@scope/create` at the same tag, so the canonical spelling never repeats the
22
+ * `/create` suffix (owner-verified against npm's init alias rules).
23
+ */
24
+ export declare const CREATE_NPM_CREATE_SCOPE = "@openelement";
25
+ /** The dist-tag the documented install resolves; the exact version is registry truth. */
26
+ export declare const CREATE_INSTALL_TAG = "alpha";
27
+ /** Placeholder the usage text and the docs use in place of a project name. */
28
+ export declare const CREATE_PROJECT_PLACEHOLDER = "<project-name>";
29
+ /**
30
+ * The documented install command shapes, all verified against the published
31
+ * two-bin artifact (bins `openelement-create` and `create-openelement`, both
32
+ * `src/cli.js`; npm 11 / pnpm 12):
33
+ * - canonical: `npm create @openelement@<tag> <name>` — npm's `@scope`
34
+ * initializer alias resolves it to `@openelement/create@<tag>` (#1507
35
+ * revision, 2026-10-05; the former canonical `npm exec <pkg>@<tag> -- <name>`
36
+ * remains a verified spelling through the same artifact)
37
+ * - short form: `npx <pkg>@<tag> <name>`
38
+ * - pnpm: `pnpm dlx --package=<pkg>@<tag> openelement-create <name>` — the
39
+ * explicit `--package` plus bin is required because the packed package
40
+ * ships two bins, so a bare `pnpm dlx <pkg>` cannot resolve one (and no
41
+ * package named `create-openelement` exists on the registry).
42
+ *
43
+ * Owner ruling 2026-10-03: the former Deno bootstrap (`deno run` of the npm
44
+ * specifier) is retired with the Deno consumer surface; the generator is
45
+ * invoked through plain Node tooling.
46
+ */
47
+ export declare function createInstallCommand(projectName?: string, options?: {
48
+ tag?: string;
49
+ }): string;
50
+ //#endregion
@@ -0,0 +1,52 @@
1
+ //#region src/install-command.ts
2
+ /**
3
+ * The canonical install command — the ONE source every documented copy of it
4
+ * derives from (#1414 item 5).
5
+ *
6
+ * The command is data about this CLI, so it lives beside the CLI: `cli.ts`
7
+ * prints it in its usage output, the site's documentation generator inlines it
8
+ * into the guides and the homepage, and the install-command gate
9
+ * (the site's install-command generator --check) fails when any curated copy
10
+ * in the repository differs from this string. There is no second spelling to
11
+ * drift.
12
+ *
13
+ * This module is deliberately side-effect free (no top-level CLI execution):
14
+ * it is imported by the site build as well as by the CLI itself.
15
+ */
16
+ /** The npm specifier the generator is published under. */
17
+ const CREATE_PACKAGE_SPECIFIER = "@openelement/create";
18
+ /**
19
+ * The scope `npm create` resolves to {@linkcode CREATE_PACKAGE_SPECIFIER}:
20
+ * npm's initializer alias maps a bare `@scope` (optionally `@scope@<tag>`) to
21
+ * `@scope/create` at the same tag, so the canonical spelling never repeats the
22
+ * `/create` suffix (owner-verified against npm's init alias rules).
23
+ */
24
+ const CREATE_NPM_CREATE_SCOPE = "@openelement";
25
+ /** The dist-tag the documented install resolves; the exact version is registry truth. */
26
+ const CREATE_INSTALL_TAG = "alpha";
27
+ /** Placeholder the usage text and the docs use in place of a project name. */
28
+ const CREATE_PROJECT_PLACEHOLDER = "<project-name>";
29
+ /**
30
+ * The documented install command shapes, all verified against the published
31
+ * two-bin artifact (bins `openelement-create` and `create-openelement`, both
32
+ * `src/cli.js`; npm 11 / pnpm 12):
33
+ * - canonical: `npm create @openelement@<tag> <name>` — npm's `@scope`
34
+ * initializer alias resolves it to `@openelement/create@<tag>` (#1507
35
+ * revision, 2026-10-05; the former canonical `npm exec <pkg>@<tag> -- <name>`
36
+ * remains a verified spelling through the same artifact)
37
+ * - short form: `npx <pkg>@<tag> <name>`
38
+ * - pnpm: `pnpm dlx --package=<pkg>@<tag> openelement-create <name>` — the
39
+ * explicit `--package` plus bin is required because the packed package
40
+ * ships two bins, so a bare `pnpm dlx <pkg>` cannot resolve one (and no
41
+ * package named `create-openelement` exists on the registry).
42
+ *
43
+ * Owner ruling 2026-10-03: the former Deno bootstrap (`deno run` of the npm
44
+ * specifier) is retired with the Deno consumer surface; the generator is
45
+ * invoked through plain Node tooling.
46
+ */
47
+ function createInstallCommand(projectName = CREATE_PROJECT_PLACEHOLDER, options = {}) {
48
+ const tag = options.tag ?? "alpha";
49
+ return `npm create ${CREATE_NPM_CREATE_SCOPE}@${tag} ${projectName}`;
50
+ }
51
+ //#endregion
52
+ export { CREATE_INSTALL_TAG, CREATE_NPM_CREATE_SCOPE, CREATE_PACKAGE_SPECIFIER, CREATE_PROJECT_PLACEHOLDER, createInstallCommand };