create-kabyn 0.1.0-alpha.9
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 +36 -0
- package/dist/index.js +41 -0
- package/package.json +29 -0
package/README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# create-kabyn
|
|
2
|
+
|
|
3
|
+
Initialize a new or existing Kabyn workspace:
|
|
4
|
+
|
|
5
|
+
```powershell
|
|
6
|
+
npm create kabyn@latest
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
For non-interactive use, choose the operation and scope explicitly:
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
npm create kabyn@latest contacts -- --create --tenant tenant-1
|
|
13
|
+
npm create kabyn@latest contacts -- --checkout --tenant tenant-1
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## One-time npm package bootstrap
|
|
17
|
+
|
|
18
|
+
Trusted publishing can only be configured from an existing npm package's
|
|
19
|
+
settings. Seed `create-kabyn` once with a Kabyn CLI version that is already
|
|
20
|
+
published:
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
cd create-kabyn
|
|
24
|
+
npm install
|
|
25
|
+
npm run build
|
|
26
|
+
npm test
|
|
27
|
+
npm run release:prepare -- 0.1.0-alpha.9
|
|
28
|
+
npm pack --dry-run
|
|
29
|
+
npm publish --access public --tag next
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The publishing account must have two-factor authentication or an appropriate
|
|
33
|
+
granular access token. After publication, configure the package's trusted
|
|
34
|
+
publisher for `kabyn-io/kabyn-platform` and
|
|
35
|
+
`publish-developer-tooling.yml`. Restore the locally rewritten package files
|
|
36
|
+
before committing unrelated work.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
export function resolveKabynCli() {
|
|
10
|
+
try {
|
|
11
|
+
const packageFile = require.resolve("kabyn/package.json");
|
|
12
|
+
return path.join(path.dirname(packageFile), "dist", "cli.js");
|
|
13
|
+
} catch (error) {
|
|
14
|
+
if (error?.code !== "MODULE_NOT_FOUND") throw error;
|
|
15
|
+
return fileURLToPath(new URL("../../cli/dist/cli.js", import.meta.url));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function bootstrapArguments(argv) {
|
|
20
|
+
return ["bootstrap", ...argv];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function launch(argv = process.argv.slice(2)) {
|
|
24
|
+
const child = spawn(
|
|
25
|
+
process.execPath,
|
|
26
|
+
[resolveKabynCli(), ...bootstrapArguments(argv)],
|
|
27
|
+
{ stdio: "inherit" },
|
|
28
|
+
);
|
|
29
|
+
child.on("error", (error) => {
|
|
30
|
+
console.error(error.message);
|
|
31
|
+
process.exitCode = 1;
|
|
32
|
+
});
|
|
33
|
+
child.on("close", (code) => {
|
|
34
|
+
process.exitCode = code ?? 1;
|
|
35
|
+
});
|
|
36
|
+
return child;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
|
|
40
|
+
launch();
|
|
41
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-kabyn",
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
|
+
"description": "Initialize a new or existing Kabyn workspace project",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/kabyn-io/kabyn-platform.git",
|
|
9
|
+
"directory": "create-kabyn"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"bin": {
|
|
13
|
+
"create-kabyn": "dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "node scripts/build.mjs",
|
|
20
|
+
"release:prepare": "node scripts/prepare-release.mjs",
|
|
21
|
+
"test": "node --test \"test/*.test.mjs\""
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"kabyn": "0.1.0-alpha.9"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=22"
|
|
28
|
+
}
|
|
29
|
+
}
|