@open-nodo/cli 0.6.0 → 0.7.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/README.md +0 -1
- package/bin/nodo.js +7 -6
- package/package.json +1 -1
- package/src/add.js +3 -2
- package/src/console.js +22 -20
- package/src/deploy.js +1 -1
- package/src/init.js +2 -2
- package/src/versions.generated.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,6 @@ Scaffolds a self-hosted Open Nodo instance and installs supported public
|
|
|
4
4
|
modules.
|
|
5
5
|
|
|
6
6
|
```sh
|
|
7
|
-
export NODE_AUTH_TOKEN=$(gh auth token) # GitHub Packages: read:packages
|
|
8
7
|
npx @open-nodo/cli init <selection-token> [directory]
|
|
9
8
|
npx @open-nodo/cli add accounting
|
|
10
9
|
npx @open-nodo/cli add patrimony
|
package/bin/nodo.js
CHANGED
|
@@ -2,21 +2,22 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Nodo self-host CLI — argument parsing and dispatch only. Each command lives in src/.
|
|
4
4
|
*
|
|
5
|
-
* npx @open-nodo/cli init <selection-token> [dir]
|
|
5
|
+
* npx @open-nodo/cli init <selection-token> [dir]
|
|
6
6
|
* npx @open-nodo/cli add <module>[@version]
|
|
7
7
|
* npx @open-nodo/cli deploy [--target vercel]
|
|
8
8
|
*
|
|
9
|
-
* Registry
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Dependency lines are always @open-nodo/* either way.
|
|
9
|
+
* Registry: public npmjs by default since the 2026-08-30 cutover — no scaffold
|
|
10
|
+
* .npmrc, no token. --github-packages / OPENNODO_GITHUB_PACKAGES=1 restores the
|
|
11
|
+
* old path for pre-cutover installs. Dependency lines are @open-nodo/* either way.
|
|
13
12
|
*/
|
|
14
13
|
import { usage } from "../src/console.js";
|
|
15
14
|
import { cmdInit } from "../src/init.js";
|
|
16
15
|
import { cmdAdd } from "../src/add.js";
|
|
17
16
|
import { cmdDeploy } from "../src/deploy.js";
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
// --public-npm is the old spelling of what is now the default; accepted, ignored.
|
|
19
|
+
const REGISTRY_FLAGS = new Set(["--public-npm", "--github-packages"]);
|
|
20
|
+
const [cmd, ...rest] = process.argv.slice(2).filter((a) => !REGISTRY_FLAGS.has(a));
|
|
20
21
|
|
|
21
22
|
if (!cmd || cmd === "-h" || cmd === "--help") usage(0);
|
|
22
23
|
|
package/package.json
CHANGED
package/src/add.js
CHANGED
|
@@ -71,8 +71,9 @@ export function cmdAdd(spec) {
|
|
|
71
71
|
if (install.status !== 0) {
|
|
72
72
|
die(
|
|
73
73
|
`npm install ${depSpec} failed (exit ${install.status}).\n` +
|
|
74
|
-
`
|
|
75
|
-
`
|
|
74
|
+
` @open-nodo/* is public on npmjs and needs no token; check your network\n` +
|
|
75
|
+
` and that the version exists. Only with --github-packages do you also need:\n` +
|
|
76
|
+
` export NODE_AUTH_TOKEN=$(gh auth token) # read:packages`,
|
|
76
77
|
);
|
|
77
78
|
}
|
|
78
79
|
|
package/src/console.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/** Process exit, usage text, and registry-auth guidance — everything that only talks to the user. */
|
|
2
2
|
import { MODULE_PACKAGES } from "./module-registry.js";
|
|
3
3
|
|
|
4
|
-
const GH_PACKAGES = "https://npm.pkg.github.com";
|
|
5
|
-
|
|
6
4
|
export function die(msg) {
|
|
7
5
|
console.error(`\n ✗ ${msg}\n`);
|
|
8
6
|
process.exit(1);
|
|
@@ -12,25 +10,32 @@ export function authToken() {
|
|
|
12
10
|
return (process.env["NODE_AUTH_TOKEN"] || process.env["GITHUB_TOKEN"] || "").trim();
|
|
13
11
|
}
|
|
14
12
|
|
|
13
|
+
/**
|
|
14
|
+
* npmjs is the default since the 2026-08-30 cutover: every @open-nodo/* package is
|
|
15
|
+
* public there, so a scaffold needs no registry override and no token at all.
|
|
16
|
+
*
|
|
17
|
+
* The GitHub Packages path stays reachable for anyone with an install predating
|
|
18
|
+
* the cutover, behind --github-packages / OPENNODO_GITHUB_PACKAGES=1. --public-npm
|
|
19
|
+
* is still accepted and does nothing: it is what the flag used to be called, and
|
|
20
|
+
* silently erroring on a flag that now describes the default would be gratuitous.
|
|
21
|
+
*/
|
|
15
22
|
export function publicNpmMode(argv = process.argv) {
|
|
16
|
-
|
|
17
|
-
process.env["
|
|
18
|
-
process.env["
|
|
19
|
-
argv.includes("--
|
|
20
|
-
|
|
23
|
+
const optOut =
|
|
24
|
+
process.env["OPENNODO_GITHUB_PACKAGES"] === "1" ||
|
|
25
|
+
process.env["OPENNODO_GITHUB_PACKAGES"] === "true" ||
|
|
26
|
+
argv.includes("--github-packages");
|
|
27
|
+
return !optOut;
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
export function printAuthHelp() {
|
|
24
31
|
console.error(`
|
|
25
|
-
|
|
32
|
+
You asked for the GitHub Packages registry, which requires auth even to read.
|
|
26
33
|
|
|
27
|
-
One-shot
|
|
28
|
-
export NODE_AUTH_TOKEN=$(gh auth token) # needs read:packages
|
|
29
|
-
npx @open-nodo/cli init <selection-token> [dir]
|
|
34
|
+
One-shot:
|
|
35
|
+
export NODE_AUTH_TOKEN=$(gh auth token) # needs read:packages
|
|
36
|
+
npx @open-nodo/cli init <selection-token> [dir] --github-packages
|
|
30
37
|
|
|
31
|
-
|
|
32
|
-
@open-nodo:registry=${GH_PACKAGES}
|
|
33
|
-
//npm.pkg.github.com/:_authToken=<your-github-token>
|
|
38
|
+
Or drop the flag: @open-nodo/* is on public npmjs and needs no token.
|
|
34
39
|
`);
|
|
35
40
|
}
|
|
36
41
|
|
|
@@ -49,7 +54,7 @@ export function usage(exit = 0) {
|
|
|
49
54
|
Nodo CLI — self-host scaffolder and module installer
|
|
50
55
|
|
|
51
56
|
Usage:
|
|
52
|
-
npx @open-nodo/cli init <selection-token> [directory]
|
|
57
|
+
npx @open-nodo/cli init <selection-token> [directory]
|
|
53
58
|
npx @open-nodo/cli add <module>[@version]
|
|
54
59
|
npx @open-nodo/cli deploy [--target vercel]
|
|
55
60
|
|
|
@@ -57,11 +62,8 @@ export function usage(exit = 0) {
|
|
|
57
62
|
${Object.keys(MODULE_PACKAGES).join(", ")}
|
|
58
63
|
|
|
59
64
|
Registry:
|
|
60
|
-
default
|
|
61
|
-
--
|
|
62
|
-
|
|
63
|
-
Auth (GitHub Packages):
|
|
64
|
-
export NODE_AUTH_TOKEN=$(gh auth token)
|
|
65
|
+
default public npmjs — no token, no .npmrc
|
|
66
|
+
--github-packages GitHub Packages (.npmrc + NODE_AUTH_TOKEN); pre-cutover installs
|
|
65
67
|
`);
|
|
66
68
|
process.exit(exit);
|
|
67
69
|
}
|
package/src/deploy.js
CHANGED
|
@@ -16,8 +16,8 @@ export function cmdDeploy(target) {
|
|
|
16
16
|
console.log(" Vercel CLI not found. Install and deploy:");
|
|
17
17
|
console.log(" npm i -g vercel");
|
|
18
18
|
console.log(" vercel link");
|
|
19
|
-
console.log(" vercel env add NODE_AUTH_TOKEN");
|
|
20
19
|
console.log(" vercel --prod\n");
|
|
20
|
+
console.log(" (vercel env add NODE_AUTH_TOKEN — only for a --github-packages scaffold)\n");
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
|
package/src/init.js
CHANGED
|
@@ -68,9 +68,9 @@ function writeScaffoldManifest(targetDir, installable) {
|
|
|
68
68
|
function printNextSteps(dirName, usePublicNpm, installable) {
|
|
69
69
|
console.log(` ✓ Wrote .env (NODO_SELECTION_TOKEN + NODO_RAIL_URL)`);
|
|
70
70
|
if (usePublicNpm) {
|
|
71
|
-
console.log(` ✓
|
|
71
|
+
console.log(` ✓ No .npmrc needed — @open-nodo/* resolves from registry.npmjs.org`);
|
|
72
72
|
} else {
|
|
73
|
-
console.log(` ✓ Wrote .npmrc (@open-nodo → GitHub Packages)`);
|
|
73
|
+
console.log(` ✓ Wrote .npmrc (@open-nodo → GitHub Packages, --github-packages)`);
|
|
74
74
|
}
|
|
75
75
|
if (installable.length) {
|
|
76
76
|
console.log(` ✓ package.json deps for: ${installable.map((k) => MODULE_PACKAGES[k]).join(", ")}`);
|