strutvane 0.0.0-stage → 0.1.0-next.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 The Strutvane Authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,18 @@
1
- # Temporary Holding Version
1
+ # strutvane
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The `strutvane` command. A tiny, dependency-free launcher that always runs the `@strutvane/cli` version pinned in your project, so generators and runtime match your packages.
4
+
5
+ ```bash
6
+ npx strutvane new acme # create a project (runs create-strutvane)
7
+ cd acme && npx strutvane routes # inside a project: delegates to node_modules/@strutvane/cli
8
+ ```
9
+
10
+ - Inside a project, project commands are handed to the local CLI with the same arguments and exit code. Local always wins over global.
11
+ - A folder is a project only when its package.json lists `@strutvane/cli` (dependencies or devDependencies) or it contains `strutvane.config.ts`. The search walks up from the working directory but never accepts a drive or file-system root, the OS temp folder or a folder above your home directory; on macOS and Linux the folder must belong to you.
12
+ - `--version`, `help`, `new` and `create` are always answered by the launcher itself, never delegated. To list a project's commands, run `pnpm exec strutvane-cli help`.
13
+ - Outside a project, only `new`, `doctor --global`, `--version` and `help` run. `npx` is started as `node npx-cli.js` without a shell when npm sits next to Node.js; on Windows the fallback resolves `npx.cmd` from PATH only, never the working directory.
14
+ - A version difference between launcher and local CLI is noted once on stderr (silenced by `--json`, `--quiet` or `STRUTVANE_NO_UPDATE_NOTICE=1`).
15
+
16
+ > Pre-release (`0.1.0-next.0`). Full documentation: https://github.com/vishwajit-vm/strutvane-cli#readme
17
+
18
+ MIT © 2026 The Strutvane Authors
package/dist/bin.d.mts ADDED
@@ -0,0 +1 @@
1
+ export {}
package/dist/bin.mjs ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { m as nodeLaunchSpawner, v as runLauncher } from "./launcher-BrUi5a5_.mjs";
3
+ import { readFileSync } from "node:fs";
4
+ // src/bin.ts
5
+ /**
6
+ * `strutvane` executable: runs the launcher for this process.
7
+ *
8
+ * @module
9
+ */
10
+ function ownVersion() {
11
+ try {
12
+ const version = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version;
13
+ return typeof version === "string" ? version : "0.0.0";
14
+ } catch {
15
+ return "0.0.0";
16
+ }
17
+ }
18
+ process.exitCode = await runLauncher(process.argv.slice(2), {
19
+ cwd: process.cwd(),
20
+ env: process.env,
21
+ execPath: process.execPath,
22
+ platform: process.platform,
23
+ version: ownVersion(),
24
+ stdout: (text) => process.stdout.write(text),
25
+ stderr: (text) => process.stderr.write(text),
26
+ spawn: nodeLaunchSpawner
27
+ });
28
+ export {};
29
+
30
+ //# sourceMappingURL=bin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.mjs","names":[],"sources":["../src/bin.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * `strutvane` executable: runs the launcher for this process.\n *\n * @module\n */\nimport { readFileSync } from 'node:fs'\nimport { nodeLaunchSpawner, runLauncher } from './launcher.ts'\n\nfunction ownVersion(): string {\n try {\n const manifest: unknown = JSON.parse(\n readFileSync(new URL('../package.json', import.meta.url), 'utf8'),\n )\n const version = (manifest as { version?: unknown }).version\n return typeof version === 'string' ? version : '0.0.0'\n } catch {\n return '0.0.0'\n }\n}\n\nprocess.exitCode = await runLauncher(process.argv.slice(2), {\n cwd: process.cwd(),\n env: process.env,\n execPath: process.execPath,\n platform: process.platform,\n version: ownVersion(),\n stdout: (text) => process.stdout.write(text),\n stderr: (text) => process.stderr.write(text),\n spawn: nodeLaunchSpawner,\n})\n"],"mappings":";;;;;;;;;AASA,SAAS,aAAqB;CAC5B,IAAI;EAIF,MAAM,UAHoB,KAAK,MAC7B,aAAa,IAAI,IAAI,mBAAmB,YAAY,GAAG,GAAG,MAAM,CAE1C,CAAC,CAA2B;EACpD,OAAO,OAAO,YAAY,WAAW,UAAU;CACjD,QAAQ;EACN,OAAO;CACT;AACF;AAEA,QAAQ,WAAW,MAAM,YAAY,QAAQ,KAAK,MAAM,CAAC,GAAG;CAC1D,KAAK,QAAQ,IAAI;CACjB,KAAK,QAAQ;CACb,UAAU,QAAQ;CAClB,UAAU,QAAQ;CAClB,SAAS,WAAW;CACpB,SAAS,SAAS,QAAQ,OAAO,MAAM,IAAI;CAC3C,SAAS,SAAS,QAAQ,OAAO,MAAM,IAAI;CAC3C,OAAO;AACT,CAAC"}
@@ -0,0 +1,371 @@
1
+ import { spawn } from "node:child_process";
2
+ import { existsSync, readFileSync, realpathSync, statSync } from "node:fs";
3
+ import { homedir, tmpdir } from "node:os";
4
+ import { dirname, isAbsolute, join, relative, resolve, win32 } from "node:path";
5
+ // src/launcher.ts
6
+ /**
7
+ * The `strutvane` launcher (docs/09 §1.1).
8
+ *
9
+ * Installed globally or run through `npx strutvane`, it finds the project-local
10
+ * `@strutvane/cli` and hands project commands to it, so generators and runtime always match the
11
+ * versions pinned in the project's package.json. **Local wins over global for project commands.**
12
+ *
13
+ * **Which folder counts as a project.** Running a `node_modules` folder means running its code, so
14
+ * the search is deliberately narrow. From the working directory (or `--cwd`) upwards, a folder is
15
+ * used only when:
16
+ * - it is a project: its package.json declares `@strutvane/cli` (dependencies or devDependencies)
17
+ * or it contains `strutvane.config.ts`;
18
+ * - it is not a file-system or drive root, not the OS temp directory itself and not a folder above
19
+ * the user's home directory (the search stops at any of these);
20
+ * - on POSIX, it is owned by the current user.
21
+ * A folder with `strutvane.config.ts` also ends the search. See {@link findLocalCli}.
22
+ *
23
+ * **Never delegated:** `--version`, `help` (and no command at all), `new` and `create`. These are
24
+ * the commands people run outside projects, so the launcher always answers them itself.
25
+ *
26
+ * Without a local CLI only project-less commands run: `--version`, `help`, `new <name>` (via
27
+ * `create-strutvane`) and `doctor --global` (via `@strutvane/cli` matching this launcher).
28
+ *
29
+ * The launcher has zero dependencies and does no parsing beyond what delegation needs; it is
30
+ * deliberately tiny so it never has to change when the CLI does. The project boundary rules are
31
+ * mirrored in `@strutvane/cli`'s `project/boundary.ts` (the launcher cannot import it); keep the
32
+ * two in step.
33
+ *
34
+ * @module
35
+ */
36
+ /** Environment variable carrying the delegation depth (guards against delegation loops). */
37
+ const DEPTH_ENV = "STRUTVANE_LAUNCHER_DEPTH";
38
+ /** Overrides the project starter command (a JSON array), e.g. for tests or mirrors. */
39
+ const CREATE_ENV = "STRUTVANE_CREATE_COMMAND";
40
+ /** Set to `1` to silence the version-mismatch notice. */
41
+ const NO_NOTICE_ENV = "STRUTVANE_NO_UPDATE_NOTICE";
42
+ /** The file that marks a Strutvane project root. */
43
+ const PROJECT_MARKER = "strutvane.config.ts";
44
+ /** The boundary facts of this process. */
45
+ function processBoundary() {
46
+ return {
47
+ home: homedir(),
48
+ temp: tmpdir(),
49
+ uid: typeof process.getuid === "function" ? process.getuid() : void 0
50
+ };
51
+ }
52
+ function readJson(path) {
53
+ try {
54
+ const parsed = JSON.parse(readFileSync(path, "utf8").replace(/^/, ""));
55
+ return typeof parsed === "object" && parsed !== null && !Array.isArray(parsed) ? parsed : void 0;
56
+ } catch {
57
+ return;
58
+ }
59
+ }
60
+ const CONTROL = /[\u0000-\u001f\u007f-\u009f]/g;
61
+ /**
62
+ * Remove control characters (ANSI escapes, line breaks…) from text that came from a file the
63
+ * launcher does not control, before it is printed to a terminal.
64
+ */
65
+ function printable(text) {
66
+ return text.replace(CONTROL, "");
67
+ }
68
+ /** Every spelling of a path worth comparing: as given and with symlinks resolved. */
69
+ function spellings(path) {
70
+ const out = [resolve(path)];
71
+ try {
72
+ out.push(realpathSync(path));
73
+ } catch {}
74
+ return out;
75
+ }
76
+ /** Path equality; case-insensitive on Windows and macOS, whose file systems usually are. */
77
+ function samePath(a, b) {
78
+ const fold = process.platform === "win32" || process.platform === "darwin";
79
+ const norm = (p) => {
80
+ const r = resolve(p);
81
+ return fold ? r.toLowerCase() : r;
82
+ };
83
+ return norm(a) === norm(b);
84
+ }
85
+ /** Whether `ancestor` is a strict ancestor of `path`. */
86
+ function isStrictAncestor(ancestor, path) {
87
+ const rel = relative(ancestor, path);
88
+ return rel !== "" && !rel.startsWith("..") && !isAbsolute(rel);
89
+ }
90
+ /**
91
+ * Whether `dir` may never be treated as a project: a file-system or drive root, the OS temp
92
+ * directory itself, or a folder above the user's home directory. Anyone with write access to
93
+ * those (other users, downloads, extracted archives) could otherwise plant a `node_modules` that
94
+ * runs for every command typed below them.
95
+ */
96
+ function isForbiddenProjectDir(dir, facts) {
97
+ for (const d of spellings(dir)) {
98
+ if (dirname(d) === d) return true;
99
+ for (const temp of spellings(facts.temp)) if (samePath(d, temp)) return true;
100
+ for (const home of spellings(facts.home)) if (isStrictAncestor(d, home)) return true;
101
+ }
102
+ return false;
103
+ }
104
+ /** POSIX only: whether `dir` is owned by the current user. Always `true` without a uid. */
105
+ function isOwnedByCurrentUser(dir, facts) {
106
+ if (facts.uid === void 0) return true;
107
+ try {
108
+ return statSync(dir).uid === facts.uid;
109
+ } catch {
110
+ return false;
111
+ }
112
+ }
113
+ /** Whether a package.json declares `@strutvane/cli` as a dependency or devDependency. */
114
+ function declaresCli(manifest) {
115
+ if (manifest === void 0) return false;
116
+ return ["dependencies", "devDependencies"].some((field) => {
117
+ const deps = manifest[field];
118
+ return typeof deps === "object" && deps !== null && Object.hasOwn(deps, "@strutvane/cli") && typeof deps["@strutvane/cli"] === "string";
119
+ });
120
+ }
121
+ /** The executable declared by a CLI manifest, if it resolves inside the package. */
122
+ function binOf(packageDir, manifest) {
123
+ const bin = manifest["bin"];
124
+ const rel = typeof bin === "string" ? bin : typeof bin === "object" && bin !== null ? bin["strutvane-cli"] ?? Object.values(bin)[0] : void 0;
125
+ if (typeof rel !== "string") return void 0;
126
+ const path = resolve(packageDir, rel);
127
+ if (!existsSync(path)) return void 0;
128
+ const realDir = realpathSync(packageDir);
129
+ const inner = relative(realDir, realpathSync(path));
130
+ return inner.startsWith("..") || isAbsolute(inner) ? void 0 : path;
131
+ }
132
+ /**
133
+ * Find the project-local `@strutvane/cli`, searching upwards from `start` under the boundary
134
+ * rules in the module documentation. Returns `undefined` when there is none (or none that may be
135
+ * trusted).
136
+ */
137
+ function findLocalCli(start, facts = processBoundary()) {
138
+ let dir = resolve(start);
139
+ for (;;) {
140
+ if (isForbiddenProjectDir(dir, facts)) return void 0;
141
+ const hasMarker = existsSync(join(dir, PROJECT_MARKER));
142
+ if ((hasMarker || declaresCli(readJson(join(dir, "package.json")))) && isOwnedByCurrentUser(dir, facts)) {
143
+ const packageDir = join(dir, "node_modules", "@strutvane", "cli");
144
+ const manifest = readJson(join(packageDir, "package.json"));
145
+ if (manifest !== void 0) {
146
+ const bin = binOf(packageDir, manifest);
147
+ if (bin !== void 0) return {
148
+ packageDir,
149
+ version: printable(typeof manifest["version"] === "string" ? manifest["version"] : "0.0.0").slice(0, 64),
150
+ bin
151
+ };
152
+ }
153
+ }
154
+ if (hasMarker) return void 0;
155
+ const parent = dirname(dir);
156
+ if (parent === dir) return void 0;
157
+ dir = parent;
158
+ }
159
+ }
160
+ /** The `--cwd` value from argv, if any (`--cwd x` or `--cwd=x`). */
161
+ function cwdFlag(argv) {
162
+ for (let i = 0; i < argv.length; i++) {
163
+ const token = argv[i] ?? "";
164
+ if (token === "--") return void 0;
165
+ if (token === "--cwd") return argv[i + 1];
166
+ if (token.startsWith("--cwd=")) return token.slice(6);
167
+ }
168
+ }
169
+ /** The leading command word of argv (skipping flags and the `--cwd` value), if any. */
170
+ function commandWord(argv) {
171
+ for (let i = 0; i < argv.length; i++) {
172
+ const token = argv[i] ?? "";
173
+ if (token === "--") return void 0;
174
+ if (token === "--cwd") {
175
+ i++;
176
+ continue;
177
+ }
178
+ if (!token.startsWith("-")) return token;
179
+ }
180
+ }
181
+ /** Commands the launcher always answers itself, even inside a project. */
182
+ const LAUNCHER_COMMANDS = /* @__PURE__ */ new Set([
183
+ "help",
184
+ "new",
185
+ "create"
186
+ ]);
187
+ /**
188
+ * Whether argv is a command the launcher answers itself and never delegates: no command word
189
+ * (`strutvane`, `strutvane --version`, `strutvane --help`), `help`, `new` or `create`.
190
+ */
191
+ function isLauncherCommand(argv) {
192
+ const word = commandWord(argv);
193
+ return word === void 0 || LAUNCHER_COMMANDS.has(word);
194
+ }
195
+ const SIGNAL_CODES = {
196
+ SIGINT: 130,
197
+ SIGTERM: 143,
198
+ SIGHUP: 129
199
+ };
200
+ /** The real spawner: inherits stdio and ignores Ctrl+C itself so the child decides. */
201
+ const nodeLaunchSpawner = (command, args, options) => new Promise((resolvePromise, reject) => {
202
+ const ignore = () => {};
203
+ process.on("SIGINT", ignore);
204
+ const child = spawn(command, [...args], {
205
+ stdio: "inherit",
206
+ env: options.env,
207
+ shell: options.shell
208
+ });
209
+ child.on("error", (error) => {
210
+ process.off("SIGINT", ignore);
211
+ reject(error);
212
+ });
213
+ child.on("exit", (code, signal) => {
214
+ process.off("SIGINT", ignore);
215
+ resolvePromise(code ?? (signal === null ? 1 : SIGNAL_CODES[signal] ?? 1));
216
+ });
217
+ });
218
+ /** Characters allowed in arguments that pass through a Windows shell (the npx.cmd fallback). */
219
+ const SHELL_SAFE = /^[A-Za-z0-9@._/:=+,-]+$/;
220
+ /** Characters allowed in an absolute shim path that is quoted for cmd.exe. */
221
+ const SHELL_SAFE_PATH = /^[^"%!^&|<>\r\n]+$/;
222
+ /**
223
+ * Environment for child processes. On Windows, `NoDefaultCurrentDirectoryInExePath` stops
224
+ * cmd.exe (and the `.cmd` shims it runs) from finding programs in the working directory before
225
+ * PATH, so a project folder can never shadow `node` or `npm`.
226
+ */
227
+ function childEnv(env, platform, extra = {}) {
228
+ return {
229
+ ...env,
230
+ ...platform === "win32" ? { NoDefaultCurrentDirectoryInExePath: "1" } : {},
231
+ ...extra
232
+ };
233
+ }
234
+ /**
235
+ * npm's `npx-cli.js` next to the running Node.js, so npx runs as `node npx-cli.js` with no shell
236
+ * and no PATH lookup. Windows installs keep npm in `<node dir>/node_modules/npm`; POSIX installs
237
+ * in `<prefix>/lib/node_modules/npm`.
238
+ */
239
+ function findNpxCli(execPath, platform) {
240
+ const p = platform === "win32" ? win32 : {
241
+ join,
242
+ dirname
243
+ };
244
+ const dir = p.dirname(execPath);
245
+ return (platform === "win32" ? [p.join(dir, "node_modules", "npm", "bin", "npx-cli.js")] : [p.join(dir, "..", "lib", "node_modules", "npm", "bin", "npx-cli.js"), p.join(dir, "node_modules", "npm", "bin", "npx-cli.js")]).find((c) => existsSync(c));
246
+ }
247
+ /**
248
+ * Windows only: the absolute path of `name` (e.g. `npx`) from PATH, trying each PATHEXT
249
+ * extension. The working directory, relative PATH entries and empty entries are skipped, which is
250
+ * exactly the lookup order cmd.exe would otherwise use to run a planted `npx.cmd` from the
251
+ * project folder.
252
+ */
253
+ function resolveWindowsExecutable(name, env, cwd, exists = existsSync) {
254
+ const pathValue = env["PATH"] ?? env["Path"] ?? "";
255
+ const exts = (env["PATHEXT"] ?? ".COM;.EXE;.BAT;.CMD").split(";").filter((e) => e.startsWith("."));
256
+ const here = win32.resolve(cwd).toLowerCase();
257
+ for (const entry of pathValue.split(";")) {
258
+ const dir = entry.trim().replace(/^"(.*)"$/, "$1");
259
+ if (dir === "" || !win32.isAbsolute(dir) || win32.resolve(dir).toLowerCase() === here) continue;
260
+ for (const ext of exts) {
261
+ const candidate = win32.join(dir, `${name}${ext.toLowerCase()}`);
262
+ if (exists(candidate)) return candidate;
263
+ }
264
+ }
265
+ }
266
+ function help(version, local) {
267
+ const lines = [`strutvane ${version}: the Strutvane command line launcher`, ""];
268
+ if (local === void 0) lines.push("No project-local @strutvane/cli was found, so only these commands are available:");
269
+ else lines.push(`This project uses @strutvane/cli ${local.version}; it handles every project command`, "(e.g. strutvane make:model Invoice, strutvane migrate). To list them all, run:", " pnpm exec strutvane-cli help (or: npx strutvane-cli help)", "", "The launcher itself answers:");
270
+ lines.push(" strutvane new <name> [flags] Create a project (runs create-strutvane)", " strutvane doctor --global Check this machine (Node.js version, package managers)", " strutvane --version Print the launcher version", " strutvane help Show this help", "");
271
+ if (local === void 0) lines.push("Inside a project (a folder whose package.json lists @strutvane/cli, or with", "strutvane.config.ts), project commands are handled by the project's own @strutvane/cli,", "so they always match the versions in package.json.", "");
272
+ return lines.join("\n");
273
+ }
274
+ /** Parse `STRUTVANE_CREATE_COMMAND`: a non-empty JSON array of strings, else `undefined`. */
275
+ function parseCommandOverride(value) {
276
+ let parsed;
277
+ try {
278
+ parsed = JSON.parse(value);
279
+ } catch {
280
+ return;
281
+ }
282
+ if (!Array.isArray(parsed) || parsed.length === 0 || !parsed.every((p) => typeof p === "string" && p !== "")) return;
283
+ return parsed;
284
+ }
285
+ /** Run a project-less command through npx (or the override in `STRUTVANE_CREATE_COMMAND`). */
286
+ async function viaNpx(env, pkg, args) {
287
+ const childEnvironment = childEnv(env.env, env.platform);
288
+ const override = env.env[CREATE_ENV];
289
+ if (override !== void 0 && pkg.startsWith("create-strutvane")) {
290
+ const parsed = parseCommandOverride(override);
291
+ if (parsed === void 0) {
292
+ env.stderr(`strutvane: ${CREATE_ENV} must be a JSON array of strings.\n`);
293
+ return 2;
294
+ }
295
+ const [command = "", ...rest] = parsed;
296
+ return env.spawn(command, [...rest, ...args], {
297
+ env: childEnvironment,
298
+ shell: false
299
+ });
300
+ }
301
+ const npxArgs = [
302
+ "--yes",
303
+ pkg,
304
+ ...args
305
+ ];
306
+ const npxCli = findNpxCli(env.execPath, env.platform);
307
+ if (npxCli !== void 0) return env.spawn(env.execPath, [npxCli, ...npxArgs], {
308
+ env: childEnvironment,
309
+ shell: false
310
+ });
311
+ if (env.platform !== "win32") return env.spawn("npx", npxArgs, {
312
+ env: childEnvironment,
313
+ shell: false
314
+ });
315
+ const shim = resolveWindowsExecutable("npx", env.env, env.cwd);
316
+ if (shim === void 0 || !SHELL_SAFE_PATH.test(shim)) {
317
+ env.stderr("strutvane: could not find npx on PATH. Install Node.js with npm.\n");
318
+ return 2;
319
+ }
320
+ const unsafe = npxArgs.find((a) => !SHELL_SAFE.test(a));
321
+ if (unsafe !== void 0) {
322
+ env.stderr(`strutvane: refusing to pass "${printable(unsafe)}" to a shell. Use plain names and flags.\n`);
323
+ return 2;
324
+ }
325
+ return env.spawn(`"${shim}"`, npxArgs, {
326
+ env: childEnvironment,
327
+ shell: true
328
+ });
329
+ }
330
+ /** Run the launcher. Returns the exit code (the delegated CLI's, when delegating). */
331
+ async function runLauncher(argv, env) {
332
+ const depth = Number(env.env["STRUTVANE_LAUNCHER_DEPTH"] ?? "0");
333
+ const flag = cwdFlag(argv);
334
+ const start = flag === void 0 ? env.cwd : resolve(env.cwd, flag);
335
+ const boundary = env.boundary ?? processBoundary();
336
+ const local = depth >= 1 ? void 0 : findLocalCli(start, boundary);
337
+ if (local !== void 0 && !isLauncherCommand(argv)) {
338
+ const quiet = argv.includes("--json") || argv.includes("--quiet") || argv.includes("-q");
339
+ if (local.version !== env.version && !quiet && env.env["STRUTVANE_NO_UPDATE_NOTICE"] !== "1") env.stderr(`strutvane: using the project's @strutvane/cli ${local.version} (launcher ${env.version}).\n`);
340
+ return env.spawn(env.execPath, [local.bin, ...argv], {
341
+ env: childEnv(env.env, env.platform, { [DEPTH_ENV]: String(depth + 1) }),
342
+ shell: false
343
+ });
344
+ }
345
+ const word = commandWord(argv);
346
+ if (word === void 0 && (argv.includes("--version") || argv.includes("-V"))) {
347
+ env.stdout(`strutvane ${env.version}\n`);
348
+ if (local !== void 0) env.stdout(`project @strutvane/cli ${local.version}\n`);
349
+ return 0;
350
+ }
351
+ if (word === void 0 || word === "help") {
352
+ env.stdout(help(env.version, local));
353
+ return 0;
354
+ }
355
+ const [first, ...rest] = argv;
356
+ if (first === "new" || first === "create") return viaNpx(env, "create-strutvane@latest", rest);
357
+ if (first === "doctor" && rest.includes("--global")) return viaNpx(env, `@strutvane/cli@${env.version}`, argv);
358
+ env.stderr([
359
+ `strutvane: "${printable(word)}" needs a Strutvane project, but no project-local @strutvane/cli was found`,
360
+ ` (searched from ${start} upwards; only folders whose package.json lists @strutvane/cli`,
361
+ " or that contain strutvane.config.ts count, and never a drive root, the temp folder or a",
362
+ " folder above your home directory).",
363
+ " Run it inside a project, or add the CLI to this one: pnpm add -D @strutvane/cli",
364
+ " Create a new project with: strutvane new <name>",
365
+ ""
366
+ ].join("\n"));
367
+ return 2;
368
+ }
369
+ export { resolveWindowsExecutable as _, childEnv as a, declaresCli as c, isForbiddenProjectDir as d, isLauncherCommand as f, processBoundary as g, printable as h, PROJECT_MARKER as i, findLocalCli as l, nodeLaunchSpawner as m, DEPTH_ENV as n, commandWord as o, isOwnedByCurrentUser as p, NO_NOTICE_ENV as r, cwdFlag as s, CREATE_ENV as t, findNpxCli as u, runLauncher as v };
370
+
371
+ //# sourceMappingURL=launcher-BrUi5a5_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launcher-BrUi5a5_.mjs","names":[],"sources":["../src/launcher.ts"],"sourcesContent":["/**\n * The `strutvane` launcher (docs/09 §1.1).\n *\n * Installed globally or run through `npx strutvane`, it finds the project-local\n * `@strutvane/cli` and hands project commands to it, so generators and runtime always match the\n * versions pinned in the project's package.json. **Local wins over global for project commands.**\n *\n * **Which folder counts as a project.** Running a `node_modules` folder means running its code, so\n * the search is deliberately narrow. From the working directory (or `--cwd`) upwards, a folder is\n * used only when:\n * - it is a project: its package.json declares `@strutvane/cli` (dependencies or devDependencies)\n * or it contains `strutvane.config.ts`;\n * - it is not a file-system or drive root, not the OS temp directory itself and not a folder above\n * the user's home directory (the search stops at any of these);\n * - on POSIX, it is owned by the current user.\n * A folder with `strutvane.config.ts` also ends the search. See {@link findLocalCli}.\n *\n * **Never delegated:** `--version`, `help` (and no command at all), `new` and `create`. These are\n * the commands people run outside projects, so the launcher always answers them itself.\n *\n * Without a local CLI only project-less commands run: `--version`, `help`, `new <name>` (via\n * `create-strutvane`) and `doctor --global` (via `@strutvane/cli` matching this launcher).\n *\n * The launcher has zero dependencies and does no parsing beyond what delegation needs; it is\n * deliberately tiny so it never has to change when the CLI does. The project boundary rules are\n * mirrored in `@strutvane/cli`'s `project/boundary.ts` (the launcher cannot import it); keep the\n * two in step.\n *\n * @module\n */\nimport { spawn } from 'node:child_process'\nimport { existsSync, readFileSync, realpathSync, statSync } from 'node:fs'\nimport { homedir, tmpdir } from 'node:os'\nimport { dirname, isAbsolute, join, relative, resolve, win32 } from 'node:path'\n\n/** Environment variable carrying the delegation depth (guards against delegation loops). */\nexport const DEPTH_ENV = 'STRUTVANE_LAUNCHER_DEPTH'\n/** Overrides the project starter command (a JSON array), e.g. for tests or mirrors. */\nexport const CREATE_ENV = 'STRUTVANE_CREATE_COMMAND'\n/** Set to `1` to silence the version-mismatch notice. */\nexport const NO_NOTICE_ENV = 'STRUTVANE_NO_UPDATE_NOTICE'\n\n/** The file that marks a Strutvane project root. */\nexport const PROJECT_MARKER = 'strutvane.config.ts'\n\n/** A project-local CLI the launcher can delegate to. */\nexport interface LocalCli {\n readonly packageDir: string\n /** The manifest's version, with control characters removed (safe to print). */\n readonly version: string\n /** Absolute path of the CLI's executable script. */\n readonly bin: string\n}\n\n/**\n * Facts the project boundary rules depend on. Injectable so tests can place \"home\" and \"temp\"\n * anywhere, and exercise the POSIX ownership rule on any OS.\n */\nexport interface BoundaryFacts {\n /** The user's home directory. */\n readonly home: string\n /** The OS temp directory. */\n readonly temp: string\n /** The current user's uid on POSIX; `undefined` where ownership is not checked (Windows). */\n readonly uid: number | undefined\n}\n\n/** The boundary facts of this process. */\nexport function processBoundary(): BoundaryFacts {\n return {\n home: homedir(),\n temp: tmpdir(),\n uid: typeof process.getuid === 'function' ? process.getuid() : undefined,\n }\n}\n\nfunction readJson(path: string): Record<string, unknown> | undefined {\n try {\n const parsed: unknown = JSON.parse(readFileSync(path, 'utf8').replace(/^/, ''))\n return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed)\n ? (parsed as Record<string, unknown>)\n : undefined\n } catch {\n return undefined\n }\n}\n\n// biome-ignore lint/suspicious/noControlCharactersInRegex: matching control characters is the point\nconst CONTROL = /[\\u0000-\\u001f\\u007f-\\u009f]/g\n\n/**\n * Remove control characters (ANSI escapes, line breaks…) from text that came from a file the\n * launcher does not control, before it is printed to a terminal.\n */\nexport function printable(text: string): string {\n return text.replace(CONTROL, '')\n}\n\n/** Every spelling of a path worth comparing: as given and with symlinks resolved. */\nfunction spellings(path: string): string[] {\n const out = [resolve(path)]\n try {\n out.push(realpathSync(path))\n } catch {\n // a path that does not exist has only its given spelling\n }\n return out\n}\n\n/** Path equality; case-insensitive on Windows and macOS, whose file systems usually are. */\nfunction samePath(a: string, b: string): boolean {\n const fold = process.platform === 'win32' || process.platform === 'darwin'\n const norm = (p: string): string => {\n const r = resolve(p)\n return fold ? r.toLowerCase() : r\n }\n return norm(a) === norm(b)\n}\n\n/** Whether `ancestor` is a strict ancestor of `path`. */\nfunction isStrictAncestor(ancestor: string, path: string): boolean {\n const rel = relative(ancestor, path)\n return rel !== '' && !rel.startsWith('..') && !isAbsolute(rel)\n}\n\n/**\n * Whether `dir` may never be treated as a project: a file-system or drive root, the OS temp\n * directory itself, or a folder above the user's home directory. Anyone with write access to\n * those (other users, downloads, extracted archives) could otherwise plant a `node_modules` that\n * runs for every command typed below them.\n */\nexport function isForbiddenProjectDir(dir: string, facts: BoundaryFacts): boolean {\n for (const d of spellings(dir)) {\n if (dirname(d) === d) return true\n for (const temp of spellings(facts.temp)) if (samePath(d, temp)) return true\n for (const home of spellings(facts.home)) if (isStrictAncestor(d, home)) return true\n }\n return false\n}\n\n/** POSIX only: whether `dir` is owned by the current user. Always `true` without a uid. */\nexport function isOwnedByCurrentUser(dir: string, facts: BoundaryFacts): boolean {\n if (facts.uid === undefined) return true\n try {\n return statSync(dir).uid === facts.uid\n } catch {\n return false\n }\n}\n\n/** Whether a package.json declares `@strutvane/cli` as a dependency or devDependency. */\nexport function declaresCli(manifest: Readonly<Record<string, unknown>> | undefined): boolean {\n if (manifest === undefined) return false\n return ['dependencies', 'devDependencies'].some((field) => {\n const deps = manifest[field]\n return (\n typeof deps === 'object' &&\n deps !== null &&\n Object.hasOwn(deps, '@strutvane/cli') &&\n typeof (deps as Record<string, unknown>)['@strutvane/cli'] === 'string'\n )\n })\n}\n\n/** The executable declared by a CLI manifest, if it resolves inside the package. */\nfunction binOf(packageDir: string, manifest: Record<string, unknown>): string | undefined {\n const bin = manifest['bin']\n const rel =\n typeof bin === 'string'\n ? bin\n : typeof bin === 'object' && bin !== null\n ? ((bin as Record<string, unknown>)['strutvane-cli'] ?? Object.values(bin)[0])\n : undefined\n if (typeof rel !== 'string') return undefined\n const path = resolve(packageDir, rel)\n if (!existsSync(path)) return undefined\n const realDir = realpathSync(packageDir)\n const inner = relative(realDir, realpathSync(path))\n return inner.startsWith('..') || isAbsolute(inner) ? undefined : path\n}\n\n/**\n * Find the project-local `@strutvane/cli`, searching upwards from `start` under the boundary\n * rules in the module documentation. Returns `undefined` when there is none (or none that may be\n * trusted).\n */\nexport function findLocalCli(\n start: string,\n facts: BoundaryFacts = processBoundary(),\n): LocalCli | undefined {\n let dir = resolve(start)\n for (;;) {\n if (isForbiddenProjectDir(dir, facts)) return undefined\n const hasMarker = existsSync(join(dir, PROJECT_MARKER))\n const isProject = hasMarker || declaresCli(readJson(join(dir, 'package.json')))\n if (isProject && isOwnedByCurrentUser(dir, facts)) {\n const packageDir = join(dir, 'node_modules', '@strutvane', 'cli')\n const manifest = readJson(join(packageDir, 'package.json'))\n if (manifest !== undefined) {\n const bin = binOf(packageDir, manifest)\n if (bin !== undefined) {\n const raw = typeof manifest['version'] === 'string' ? manifest['version'] : '0.0.0'\n return { packageDir, version: printable(raw).slice(0, 64), bin }\n }\n }\n }\n if (hasMarker) return undefined // project root: stop\n const parent = dirname(dir)\n if (parent === dir) return undefined\n dir = parent\n }\n}\n\n/** The `--cwd` value from argv, if any (`--cwd x` or `--cwd=x`). */\nexport function cwdFlag(argv: readonly string[]): string | undefined {\n for (let i = 0; i < argv.length; i++) {\n const token = argv[i] ?? ''\n if (token === '--') return undefined\n if (token === '--cwd') return argv[i + 1]\n if (token.startsWith('--cwd=')) return token.slice('--cwd='.length)\n }\n return undefined\n}\n\n/** The leading command word of argv (skipping flags and the `--cwd` value), if any. */\nexport function commandWord(argv: readonly string[]): string | undefined {\n for (let i = 0; i < argv.length; i++) {\n const token = argv[i] ?? ''\n if (token === '--') return undefined\n if (token === '--cwd') {\n i++\n continue\n }\n if (!token.startsWith('-')) return token\n }\n return undefined\n}\n\n/** Commands the launcher always answers itself, even inside a project. */\nconst LAUNCHER_COMMANDS: ReadonlySet<string> = new Set(['help', 'new', 'create'])\n\n/**\n * Whether argv is a command the launcher answers itself and never delegates: no command word\n * (`strutvane`, `strutvane --version`, `strutvane --help`), `help`, `new` or `create`.\n */\nexport function isLauncherCommand(argv: readonly string[]): boolean {\n const word = commandWord(argv)\n return word === undefined || LAUNCHER_COMMANDS.has(word)\n}\n\n/** Runs a child process with inherited stdio and resolves with its exit code. */\nexport type LaunchSpawner = (\n command: string,\n args: readonly string[],\n options: { readonly env: NodeJS.ProcessEnv; readonly shell: boolean },\n) => Promise<number>\n\nconst SIGNAL_CODES: Readonly<Record<string, number>> = { SIGINT: 130, SIGTERM: 143, SIGHUP: 129 }\n\n/** The real spawner: inherits stdio and ignores Ctrl+C itself so the child decides. */\nexport const nodeLaunchSpawner: LaunchSpawner = (command, args, options) =>\n new Promise((resolvePromise, reject) => {\n const ignore = (): void => {}\n process.on('SIGINT', ignore)\n const child = spawn(command, [...args], {\n stdio: 'inherit',\n env: options.env,\n shell: options.shell,\n })\n child.on('error', (error) => {\n process.off('SIGINT', ignore)\n reject(error)\n })\n child.on('exit', (code, signal) => {\n process.off('SIGINT', ignore)\n resolvePromise(code ?? (signal === null ? 1 : (SIGNAL_CODES[signal] ?? 1)))\n })\n })\n\n/** Process facts the launcher needs (injectable for tests). */\nexport interface LauncherEnvironment {\n readonly cwd: string\n readonly env: NodeJS.ProcessEnv\n readonly execPath: string\n readonly platform: NodeJS.Platform\n readonly version: string\n readonly stdout: (text: string) => void\n readonly stderr: (text: string) => void\n readonly spawn: LaunchSpawner\n /** Project boundary facts. Default: this process's ({@link processBoundary}). */\n readonly boundary?: BoundaryFacts\n}\n\n/** Characters allowed in arguments that pass through a Windows shell (the npx.cmd fallback). */\nconst SHELL_SAFE = /^[A-Za-z0-9@._/:=+,-]+$/\n/** Characters allowed in an absolute shim path that is quoted for cmd.exe. */\nconst SHELL_SAFE_PATH = /^[^\"%!^&|<>\\r\\n]+$/\n\n/**\n * Environment for child processes. On Windows, `NoDefaultCurrentDirectoryInExePath` stops\n * cmd.exe (and the `.cmd` shims it runs) from finding programs in the working directory before\n * PATH, so a project folder can never shadow `node` or `npm`.\n */\nexport function childEnv(\n env: NodeJS.ProcessEnv,\n platform: NodeJS.Platform,\n extra: Readonly<Record<string, string>> = {},\n): NodeJS.ProcessEnv {\n return {\n ...env,\n ...(platform === 'win32' ? { NoDefaultCurrentDirectoryInExePath: '1' } : {}),\n ...extra,\n }\n}\n\n/**\n * npm's `npx-cli.js` next to the running Node.js, so npx runs as `node npx-cli.js` with no shell\n * and no PATH lookup. Windows installs keep npm in `<node dir>/node_modules/npm`; POSIX installs\n * in `<prefix>/lib/node_modules/npm`.\n */\nexport function findNpxCli(execPath: string, platform: NodeJS.Platform): string | undefined {\n const p = platform === 'win32' ? win32 : { join, dirname }\n const dir = p.dirname(execPath)\n const candidates =\n platform === 'win32'\n ? [p.join(dir, 'node_modules', 'npm', 'bin', 'npx-cli.js')]\n : [\n p.join(dir, '..', 'lib', 'node_modules', 'npm', 'bin', 'npx-cli.js'),\n p.join(dir, 'node_modules', 'npm', 'bin', 'npx-cli.js'),\n ]\n return candidates.find((c) => existsSync(c))\n}\n\n/**\n * Windows only: the absolute path of `name` (e.g. `npx`) from PATH, trying each PATHEXT\n * extension. The working directory, relative PATH entries and empty entries are skipped, which is\n * exactly the lookup order cmd.exe would otherwise use to run a planted `npx.cmd` from the\n * project folder.\n */\nexport function resolveWindowsExecutable(\n name: string,\n env: NodeJS.ProcessEnv,\n cwd: string,\n exists: (path: string) => boolean = existsSync,\n): string | undefined {\n const pathValue = env['PATH'] ?? env['Path'] ?? ''\n const exts = (env['PATHEXT'] ?? '.COM;.EXE;.BAT;.CMD').split(';').filter((e) => e.startsWith('.'))\n const here = win32.resolve(cwd).toLowerCase()\n for (const entry of pathValue.split(';')) {\n const dir = entry.trim().replace(/^\"(.*)\"$/, '$1')\n if (dir === '' || !win32.isAbsolute(dir) || win32.resolve(dir).toLowerCase() === here) continue\n for (const ext of exts) {\n const candidate = win32.join(dir, `${name}${ext.toLowerCase()}`)\n if (exists(candidate)) return candidate\n }\n }\n return undefined\n}\n\nfunction help(version: string, local: LocalCli | undefined): string {\n const lines = [`strutvane ${version}: the Strutvane command line launcher`, '']\n if (local === undefined) {\n lines.push('No project-local @strutvane/cli was found, so only these commands are available:')\n } else {\n lines.push(\n `This project uses @strutvane/cli ${local.version}; it handles every project command`,\n '(e.g. strutvane make:model Invoice, strutvane migrate). To list them all, run:',\n ' pnpm exec strutvane-cli help (or: npx strutvane-cli help)',\n '',\n 'The launcher itself answers:',\n )\n }\n lines.push(\n ' strutvane new <name> [flags] Create a project (runs create-strutvane)',\n ' strutvane doctor --global Check this machine (Node.js version, package managers)',\n ' strutvane --version Print the launcher version',\n ' strutvane help Show this help',\n '',\n )\n if (local === undefined) {\n lines.push(\n 'Inside a project (a folder whose package.json lists @strutvane/cli, or with',\n \"strutvane.config.ts), project commands are handled by the project's own @strutvane/cli,\",\n 'so they always match the versions in package.json.',\n '',\n )\n }\n return lines.join('\\n')\n}\n\n/** Parse `STRUTVANE_CREATE_COMMAND`: a non-empty JSON array of strings, else `undefined`. */\nfunction parseCommandOverride(value: string): string[] | undefined {\n let parsed: unknown\n try {\n parsed = JSON.parse(value)\n } catch {\n return undefined\n }\n if (\n !Array.isArray(parsed) ||\n parsed.length === 0 ||\n !parsed.every((p) => typeof p === 'string' && p !== '')\n ) {\n return undefined\n }\n return parsed as string[]\n}\n\n/** Run a project-less command through npx (or the override in `STRUTVANE_CREATE_COMMAND`). */\nasync function viaNpx(\n env: LauncherEnvironment,\n pkg: string,\n args: readonly string[],\n): Promise<number> {\n const childEnvironment = childEnv(env.env, env.platform)\n const override = env.env[CREATE_ENV]\n if (override !== undefined && pkg.startsWith('create-strutvane')) {\n const parsed = parseCommandOverride(override)\n if (parsed === undefined) {\n env.stderr(`strutvane: ${CREATE_ENV} must be a JSON array of strings.\\n`)\n return 2\n }\n const [command = '', ...rest] = parsed\n return env.spawn(command, [...rest, ...args], { env: childEnvironment, shell: false })\n }\n const npxArgs = ['--yes', pkg, ...args]\n // Preferred everywhere: `node npx-cli.js …` (no shell, no PATH lookup, any argument is safe).\n const npxCli = findNpxCli(env.execPath, env.platform)\n if (npxCli !== undefined) {\n return env.spawn(env.execPath, [npxCli, ...npxArgs], { env: childEnvironment, shell: false })\n }\n if (env.platform !== 'win32') {\n return env.spawn('npx', npxArgs, { env: childEnvironment, shell: false })\n }\n // Windows fallback: npx is a .cmd shim, which needs a shell. Resolve it from PATH (never the\n // working directory) and refuse arguments with shell meaning rather than escaping them.\n const shim = resolveWindowsExecutable('npx', env.env, env.cwd)\n if (shim === undefined || !SHELL_SAFE_PATH.test(shim)) {\n env.stderr('strutvane: could not find npx on PATH. Install Node.js with npm.\\n')\n return 2\n }\n const unsafe = npxArgs.find((a) => !SHELL_SAFE.test(a))\n if (unsafe !== undefined) {\n env.stderr(\n `strutvane: refusing to pass \"${printable(unsafe)}\" to a shell. Use plain names and flags.\\n`,\n )\n return 2\n }\n return env.spawn(`\"${shim}\"`, npxArgs, { env: childEnvironment, shell: true })\n}\n\n/** Run the launcher. Returns the exit code (the delegated CLI's, when delegating). */\nexport async function runLauncher(\n argv: readonly string[],\n env: LauncherEnvironment,\n): Promise<number> {\n const depth = Number(env.env[DEPTH_ENV] ?? '0')\n const flag = cwdFlag(argv)\n const start = flag === undefined ? env.cwd : resolve(env.cwd, flag)\n const boundary = env.boundary ?? processBoundary()\n const local = depth >= 1 ? undefined : findLocalCli(start, boundary)\n\n if (local !== undefined && !isLauncherCommand(argv)) {\n const quiet = argv.includes('--json') || argv.includes('--quiet') || argv.includes('-q')\n if (local.version !== env.version && !quiet && env.env[NO_NOTICE_ENV] !== '1') {\n env.stderr(\n `strutvane: using the project's @strutvane/cli ${local.version} (launcher ${env.version}).\\n`,\n )\n }\n return env.spawn(env.execPath, [local.bin, ...argv], {\n env: childEnv(env.env, env.platform, { [DEPTH_ENV]: String(depth + 1) }),\n shell: false,\n })\n }\n\n const word = commandWord(argv)\n if (word === undefined && (argv.includes('--version') || argv.includes('-V'))) {\n env.stdout(`strutvane ${env.version}\\n`)\n if (local !== undefined) env.stdout(`project @strutvane/cli ${local.version}\\n`)\n return 0\n }\n if (word === undefined || word === 'help') {\n env.stdout(help(env.version, local))\n return 0\n }\n const [first, ...rest] = argv\n if (first === 'new' || first === 'create') {\n return viaNpx(env, 'create-strutvane@latest', rest)\n }\n if (first === 'doctor' && rest.includes('--global')) {\n return viaNpx(env, `@strutvane/cli@${env.version}`, argv)\n }\n env.stderr(\n [\n `strutvane: \"${printable(word)}\" needs a Strutvane project, but no project-local @strutvane/cli was found`,\n ` (searched from ${start} upwards; only folders whose package.json lists @strutvane/cli`,\n ' or that contain strutvane.config.ts count, and never a drive root, the temp folder or a',\n ' folder above your home directory).',\n ' Run it inside a project, or add the CLI to this one: pnpm add -D @strutvane/cli',\n ' Create a new project with: strutvane new <name>',\n '',\n ].join('\\n'),\n )\n return 2\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAa,YAAY;;AAEzB,MAAa,aAAa;;AAE1B,MAAa,gBAAgB;;AAG7B,MAAa,iBAAiB;;AAyB9B,SAAgB,kBAAiC;CAC/C,OAAO;EACL,MAAM,QAAQ;EACd,MAAM,OAAO;EACb,KAAK,OAAO,QAAQ,WAAW,aAAa,QAAQ,OAAO,IAAI,KAAA;CACjE;AACF;AAEA,SAAS,SAAS,MAAmD;CACnE,IAAI;EACF,MAAM,SAAkB,KAAK,MAAM,aAAa,MAAM,MAAM,CAAC,CAAC,QAAQ,MAAM,EAAE,CAAC;EAC/E,OAAO,OAAO,WAAW,YAAY,WAAW,QAAQ,CAAC,MAAM,QAAQ,MAAM,IACxE,SACD,KAAA;CACN,QAAQ;EACN;CACF;AACF;AAGA,MAAM,UAAU;;;;;AAMhB,SAAgB,UAAU,MAAsB;CAC9C,OAAO,KAAK,QAAQ,SAAS,EAAE;AACjC;;AAGA,SAAS,UAAU,MAAwB;CACzC,MAAM,MAAM,CAAC,QAAQ,IAAI,CAAC;CAC1B,IAAI;EACF,IAAI,KAAK,aAAa,IAAI,CAAC;CAC7B,QAAQ,CAER;CACA,OAAO;AACT;;AAGA,SAAS,SAAS,GAAW,GAAoB;CAC/C,MAAM,OAAO,QAAQ,aAAa,WAAW,QAAQ,aAAa;CAClE,MAAM,QAAQ,MAAsB;EAClC,MAAM,IA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UAAU,KAAA,GAAW,IAAI,OAAO,0BAA0B,MAAM,QAAQ,GAAG;EAC/E,OAAO;CACT;CACA,IAAI,SAAS,KAAA,KAAa,SAAS,QAAQ;EACzC,IAAI,OAAO,KAAK,IAAI,SAAS,KAAK,CAAC;EACnC,OAAO;CACT;CACA,MAAM,CAAC,OAAO,GAAG,QAAQ;CACzB,IAAI,UAAU,SAAS,UAAU,UAC/B,OAAO,OAAO,KAAK,2BAA2B,IAAI;CAEpD,IAAI,UAAU,YAAY,KAAK,SAAS,UAAU,GAChD,OAAO,OAAO,KAAK,kBAAkB,IAAI,WAAW,IAAI;CAE1D,IAAI,OACF;EACE,eAAe,UAAU,IAAI,EAAE;EAC/B,oBAAoB,MAAM;EAC1B;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,IAAI,CACb;CACA,OAAO;AACT"}
@@ -0,0 +1,103 @@
1
+ /** Environment variable carrying the delegation depth (guards against delegation loops). */
2
+ export declare const DEPTH_ENV = "STRUTVANE_LAUNCHER_DEPTH";
3
+ /** Overrides the project starter command (a JSON array), e.g. for tests or mirrors. */
4
+ export declare const CREATE_ENV = "STRUTVANE_CREATE_COMMAND";
5
+ /** Set to `1` to silence the version-mismatch notice. */
6
+ export declare const NO_NOTICE_ENV = "STRUTVANE_NO_UPDATE_NOTICE";
7
+ /** The file that marks a Strutvane project root. */
8
+ export declare const PROJECT_MARKER = "strutvane.config.ts";
9
+ /** A project-local CLI the launcher can delegate to. */
10
+ export interface LocalCli {
11
+ readonly packageDir: string;
12
+ /** The manifest's version, with control characters removed (safe to print). */
13
+ readonly version: string;
14
+ /** Absolute path of the CLI's executable script. */
15
+ readonly bin: string;
16
+ }
17
+ /**
18
+ * Facts the project boundary rules depend on. Injectable so tests can place "home" and "temp"
19
+ * anywhere, and exercise the POSIX ownership rule on any OS.
20
+ */
21
+ export interface BoundaryFacts {
22
+ /** The user's home directory. */
23
+ readonly home: string;
24
+ /** The OS temp directory. */
25
+ readonly temp: string;
26
+ /** The current user's uid on POSIX; `undefined` where ownership is not checked (Windows). */
27
+ readonly uid: number | undefined;
28
+ }
29
+ /** The boundary facts of this process. */
30
+ export declare function processBoundary(): BoundaryFacts;
31
+ /**
32
+ * Remove control characters (ANSI escapes, line breaks…) from text that came from a file the
33
+ * launcher does not control, before it is printed to a terminal.
34
+ */
35
+ export declare function printable(text: string): string;
36
+ /**
37
+ * Whether `dir` may never be treated as a project: a file-system or drive root, the OS temp
38
+ * directory itself, or a folder above the user's home directory. Anyone with write access to
39
+ * those (other users, downloads, extracted archives) could otherwise plant a `node_modules` that
40
+ * runs for every command typed below them.
41
+ */
42
+ export declare function isForbiddenProjectDir(dir: string, facts: BoundaryFacts): boolean;
43
+ /** POSIX only: whether `dir` is owned by the current user. Always `true` without a uid. */
44
+ export declare function isOwnedByCurrentUser(dir: string, facts: BoundaryFacts): boolean;
45
+ /** Whether a package.json declares `@strutvane/cli` as a dependency or devDependency. */
46
+ export declare function declaresCli(manifest: Readonly<Record<string, unknown>> | undefined): boolean;
47
+ /**
48
+ * Find the project-local `@strutvane/cli`, searching upwards from `start` under the boundary
49
+ * rules in the module documentation. Returns `undefined` when there is none (or none that may be
50
+ * trusted).
51
+ */
52
+ export declare function findLocalCli(start: string, facts?: BoundaryFacts): LocalCli | undefined;
53
+ /** The `--cwd` value from argv, if any (`--cwd x` or `--cwd=x`). */
54
+ export declare function cwdFlag(argv: readonly string[]): string | undefined;
55
+ /** The leading command word of argv (skipping flags and the `--cwd` value), if any. */
56
+ export declare function commandWord(argv: readonly string[]): string | undefined;
57
+ /**
58
+ * Whether argv is a command the launcher answers itself and never delegates: no command word
59
+ * (`strutvane`, `strutvane --version`, `strutvane --help`), `help`, `new` or `create`.
60
+ */
61
+ export declare function isLauncherCommand(argv: readonly string[]): boolean;
62
+ /** Runs a child process with inherited stdio and resolves with its exit code. */
63
+ export type LaunchSpawner = (command: string, args: readonly string[], options: {
64
+ readonly env: NodeJS.ProcessEnv;
65
+ readonly shell: boolean;
66
+ }) => Promise<number>;
67
+ /** The real spawner: inherits stdio and ignores Ctrl+C itself so the child decides. */
68
+ export declare const nodeLaunchSpawner: LaunchSpawner;
69
+ /** Process facts the launcher needs (injectable for tests). */
70
+ export interface LauncherEnvironment {
71
+ readonly cwd: string;
72
+ readonly env: NodeJS.ProcessEnv;
73
+ readonly execPath: string;
74
+ readonly platform: NodeJS.Platform;
75
+ readonly version: string;
76
+ readonly stdout: (text: string) => void;
77
+ readonly stderr: (text: string) => void;
78
+ readonly spawn: LaunchSpawner;
79
+ /** Project boundary facts. Default: this process's ({@link processBoundary}). */
80
+ readonly boundary?: BoundaryFacts;
81
+ }
82
+ /**
83
+ * Environment for child processes. On Windows, `NoDefaultCurrentDirectoryInExePath` stops
84
+ * cmd.exe (and the `.cmd` shims it runs) from finding programs in the working directory before
85
+ * PATH, so a project folder can never shadow `node` or `npm`.
86
+ */
87
+ export declare function childEnv(env: NodeJS.ProcessEnv, platform: NodeJS.Platform, extra?: Readonly<Record<string, string>>): NodeJS.ProcessEnv;
88
+ /**
89
+ * npm's `npx-cli.js` next to the running Node.js, so npx runs as `node npx-cli.js` with no shell
90
+ * and no PATH lookup. Windows installs keep npm in `<node dir>/node_modules/npm`; POSIX installs
91
+ * in `<prefix>/lib/node_modules/npm`.
92
+ */
93
+ export declare function findNpxCli(execPath: string, platform: NodeJS.Platform): string | undefined;
94
+ /**
95
+ * Windows only: the absolute path of `name` (e.g. `npx`) from PATH, trying each PATHEXT
96
+ * extension. The working directory, relative PATH entries and empty entries are skipped, which is
97
+ * exactly the lookup order cmd.exe would otherwise use to run a planted `npx.cmd` from the
98
+ * project folder.
99
+ */
100
+ export declare function resolveWindowsExecutable(name: string, env: NodeJS.ProcessEnv, cwd: string, exists?: (path: string) => boolean): string | undefined;
101
+ /** Run the launcher. Returns the exit code (the delegated CLI's, when delegating). */
102
+ export declare function runLauncher(argv: readonly string[], env: LauncherEnvironment): Promise<number>;
103
+ //# sourceMappingURL=launcher.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launcher.d.mts","names":[],"sources":["../src/launcher.ts"],"mappings":";qBAoCa;;qBAEA;;qBAEA;;qBAGA;;iBAGI;WACN;;WAEA;;WAEA;;;;;;iBAOM;;WAEN;;WAEA;;WAEA;;;wBAIK,mBAAmB;;;;;wBA0BnB,UAAU;;;;;;;wBAqCV,sBAAsB,aAAa,OAAO;;wBAU1C,qBAAqB,aAAa,OAAO;;wBAUzC,YAAY,UAAU,SAAS;;;;;;wBAmC/B,aACd,eACA,QAAO,gBACN;;wBAyBa,QAAQ;;wBAWR,YAAY;;;;;wBAoBZ,kBAAkB;;YAMtB,iBACV,iBACA,yBACA;WAAoB,KAAK,OAAO;WAAqB;MAClD;;qBAKQ,mBAAmB;;iBAoBf;WACN;WACA,KAAK,OAAO;WACZ;WACA,UAAU,OAAO;WACjB;WACA,SAAS;WACT,SAAS;WACT,OAAO;;WAEP,WAAW;;;;;;;wBAaN,SACd,KAAK,OAAO,YACZ,UAAU,OAAO,UACjB,QAAO,SAAS,0BACf,OAAO;;;;;;wBAaM,WAAW,kBAAkB,UAAU,OAAO;;;;;;;wBAmB9C,yBACd,cACA,KAAK,OAAO,YACZ,aACA,UAAS;;wBA6GW,YACpB,yBACA,KAAK,sBACJ"}
@@ -0,0 +1 @@
1
+ export { t as CREATE_ENV, n as DEPTH_ENV, r as NO_NOTICE_ENV, i as PROJECT_MARKER, a as childEnv, o as commandWord, s as cwdFlag, c as declaresCli, l as findLocalCli, u as findNpxCli, d as isForbiddenProjectDir, f as isLauncherCommand, p as isOwnedByCurrentUser, m as nodeLaunchSpawner, h as printable, g as processBoundary, _ as resolveWindowsExecutable, v as runLauncher } from "./launcher-BrUi5a5_.mjs";
package/package.json CHANGED
@@ -1,6 +1,47 @@
1
1
  {
2
2
  "name": "strutvane",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0-next.0",
4
+ "description": "The `strutvane` command. A tiny launcher that always runs the @strutvane/cli version pinned in your project, so generators match your packages.",
5
+ "keywords": [
6
+ "strutvane",
7
+ "cli",
8
+ "framework",
9
+ "typescript",
10
+ "launcher"
11
+ ],
12
+ "homepage": "https://github.com/vishwajit-vm/strutvane-cli#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/vishwajit-vm/strutvane-cli/issues"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/vishwajit-vm/strutvane-cli.git",
19
+ "directory": "packages/launcher"
20
+ },
21
+ "license": "MIT",
22
+ "author": "The Strutvane Authors",
23
+ "type": "module",
24
+ "sideEffects": false,
25
+ "bin": {
26
+ "strutvane": "./dist/bin.mjs"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/launcher.d.mts",
31
+ "default": "./dist/launcher.mjs"
32
+ },
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE"
39
+ ],
40
+ "engines": {
41
+ "node": ">=24"
42
+ },
43
+ "publishConfig": {
44
+ "access": "public",
45
+ "provenance": true
46
+ }
47
+ }