create-sailor 1.9.6 → 1.10.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/bin/create-sailor.js +28 -0
- package/dist/index.js +229 -210
- package/package.json +8 -2
- package/templates/infra/ops/README.md +16 -0
- package/templates/infra/ops/platform-expected.example.json +54 -0
- package/templates/tests/README.md +18 -0
- package/templates/tests/degradation.test.example.ts +469 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Committed bin entry for `create-sailor`.
|
|
3
|
+
//
|
|
4
|
+
// pnpm links bins before any lifecycle script or build runs, so package.json#bin
|
|
5
|
+
// must point at a file that exists in a fresh checkout — dist/ does not. This
|
|
6
|
+
// file exists at link time and hands off to the tsup output once it is built.
|
|
7
|
+
// Guarded by tests/architecture/workspace-bin-stubs.test.ts.
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { dirname, resolve } from "node:path";
|
|
10
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
+
|
|
12
|
+
const entry = resolve(dirname(fileURLToPath(import.meta.url)), "../dist/index.js");
|
|
13
|
+
|
|
14
|
+
if (!existsSync(entry)) {
|
|
15
|
+
process.stderr.write(
|
|
16
|
+
[
|
|
17
|
+
`create-sailor: built entry not found at ${entry}`,
|
|
18
|
+
"The package has not been built yet. Run `pnpm --filter create-sailor build` and retry.",
|
|
19
|
+
"",
|
|
20
|
+
].join("\n"),
|
|
21
|
+
);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Keep argv identical to a direct `node dist/index.js …` so commander and any
|
|
26
|
+
// main-module check in the built entry see exactly what they saw before.
|
|
27
|
+
process.argv[1] = entry;
|
|
28
|
+
await import(pathToFileURL(entry).href);
|