@selvajs/cli 2.0.2 → 2.0.3
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/cli.js +14 -0
- package/bin/selva.js +14 -0
- package/package.json +2 -2
package/bin/cli.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Bootstrap entry: `npx @selvajs/cli <dir>` scaffolds a fresh deployment.
|
|
3
|
+
// Kept as a thin shim so the real logic stays in src/ and tests can import it
|
|
4
|
+
// without going through process.argv.
|
|
5
|
+
|
|
6
|
+
import pc from 'picocolors';
|
|
7
|
+
import { runCreate } from '../src/commands/create.js';
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
await runCreate(process.argv.slice(2));
|
|
11
|
+
} catch (err) {
|
|
12
|
+
console.error(`${pc.red('✗')} ${err?.message ?? err}`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
package/bin/selva.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Operator entry: `selva <command>` dispatches to one of the commands in
|
|
3
|
+
// src/commands/. Linked into the deployment's node_modules/.bin/ via the
|
|
4
|
+
// package.json bin field, so `npm run start` / `npm run doctor` resolve here.
|
|
5
|
+
|
|
6
|
+
import pc from 'picocolors';
|
|
7
|
+
import { runSelva } from '../src/cli.js';
|
|
8
|
+
|
|
9
|
+
try {
|
|
10
|
+
await runSelva(process.argv.slice(2));
|
|
11
|
+
} catch (err) {
|
|
12
|
+
console.error(`${pc.red('✗')} ${err?.message ?? err}`);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selvajs/cli",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Scaffold and operate a Selva white-label deployment. `npx @selvajs/cli <dir>` to bootstrap, `selva <cmd>` to manage.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -25,6 +25,6 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"start": "node ./bin/cli.js",
|
|
27
27
|
"selva": "node ./bin/selva.js",
|
|
28
|
-
"test": "node --input-type=module -e \"for (const m of ['./src/cli.js','./src/prompts.js','./src/env.js','./src/paths.js','./src/secrets.js','./src/commands/create.js','./src/commands/init.js','./src/commands/doctor.js','./src/commands/pm2.js','./src/commands/migrate.js','./src/commands/keys.js']) { await import(m); }\""
|
|
28
|
+
"test": "node --check ./bin/cli.js && node --check ./bin/selva.js && node --input-type=module -e \"for (const m of ['./src/cli.js','./src/prompts.js','./src/env.js','./src/paths.js','./src/secrets.js','./src/commands/create.js','./src/commands/init.js','./src/commands/doctor.js','./src/commands/pm2.js','./src/commands/migrate.js','./src/commands/keys.js']) { await import(m); }\""
|
|
29
29
|
}
|
|
30
30
|
}
|