create-wordjs 2.0.0 → 2.1.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 +3 -3
- package/index.js +12 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ That single command takes you from nothing to the browser install wizard:
|
|
|
31
31
|
clickable URL:
|
|
32
32
|
|
|
33
33
|
```
|
|
34
|
-
→ https://localhost:3000/install
|
|
34
|
+
→ https://localhost:3000/install#token=…
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
Open the URL, pick your database, create your admin account, and you're in. The wizard offers
|
|
@@ -47,7 +47,7 @@ in CI — plus a pure-JS *SQLite (legacy / WASM)* fallback for hosts where the n
|
|
|
47
47
|
| Option | Description |
|
|
48
48
|
| --- | --- |
|
|
49
49
|
| `--zip <path-or-url>` | Use a local release ZIP (or a direct ZIP URL) instead of querying the GitHub API. Handy offline or when rate-limited. |
|
|
50
|
-
| `--version <tag>` | Install a specific release (e.g. `--version
|
|
50
|
+
| `--version <tag>` | Install a specific release (e.g. `--version v2.1.0`) instead of the latest. |
|
|
51
51
|
| `--http` | Serve plain HTTP instead of self-signed HTTPS (sets `WORDJS_HTTP=1`). |
|
|
52
52
|
| `--no-start` | Scaffold and install dependencies only — start the server yourself later. |
|
|
53
53
|
| `--yes`, `-y` | Skip the confirmation prompt (required when `upgrade` runs non-interactively). |
|
|
@@ -119,7 +119,7 @@ need `openssl` on the PATH. Full details, port matrix and the manual (source-che
|
|
|
119
119
|
- **GitHub rate limit / offline**: the release lookup uses the unauthenticated GitHub API. If it
|
|
120
120
|
is rate-limited or you're offline, download `wordjs-v*.zip` from the
|
|
121
121
|
[releases page](https://github.com/jaimemartinez/wordjs/releases) and run
|
|
122
|
-
`npx create-wordjs@latest my-site --zip ./wordjs-
|
|
122
|
+
`npx create-wordjs@latest my-site --zip ./wordjs-v2.1.0.zip`.
|
|
123
123
|
- **Existing directories**: the target directory must not exist (or must be empty) — the tool
|
|
124
124
|
refuses to overwrite anything.
|
|
125
125
|
|
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 1. Downloads the latest pre-compiled WordJS release ZIP from GitHub (no build step needed).
|
|
11
11
|
* 2. Extracts it into <dir> and installs the runtime dependencies (npm run release:install).
|
|
12
12
|
* 3. Generates a one-time install token and starts the server (npm run start:mono) with it,
|
|
13
|
-
* printing a clickable https://localhost:3000/install
|
|
13
|
+
* printing a clickable https://localhost:3000/install#token=… URL — the browser install
|
|
14
14
|
* wizard takes it from there (pick SQLite/PostgreSQL, create your admin, done).
|
|
15
15
|
*
|
|
16
16
|
* Plain Node, no TypeScript. Only runtime dependency: adm-zip (ZIP extraction).
|
|
@@ -49,7 +49,7 @@ Usage:
|
|
|
49
49
|
|
|
50
50
|
Options:
|
|
51
51
|
--zip <path-or-url> Use a local release ZIP (or a direct ZIP URL) instead of asking GitHub.
|
|
52
|
-
--version <tag> Install/upgrade to a specific release tag (e.g.
|
|
52
|
+
--version <tag> Install/upgrade to a specific release tag (e.g. v2.1.0) instead of the latest.
|
|
53
53
|
--http Serve plain HTTP instead of self-signed HTTPS (sets WORDJS_HTTP=1). (create)
|
|
54
54
|
--no-start Scaffold + install dependencies only; don't start the server.
|
|
55
55
|
--yes, -y Skip the confirmation prompt (required when upgrading non-interactively).
|
|
@@ -65,7 +65,7 @@ Options:
|
|
|
65
65
|
|
|
66
66
|
Examples:
|
|
67
67
|
npx create-wordjs@latest my-site
|
|
68
|
-
npx create-wordjs@latest my-site --version
|
|
68
|
+
npx create-wordjs@latest my-site --version v2.1.0
|
|
69
69
|
npx create-wordjs@latest upgrade # from inside your site directory
|
|
70
70
|
npx create-wordjs@latest upgrade ./my-site --yes
|
|
71
71
|
|
|
@@ -103,7 +103,7 @@ function parseArgs(argv) {
|
|
|
103
103
|
const a = argv[i];
|
|
104
104
|
if (a === '-h' || a === '--help') { console.log(HELP); process.exit(0); }
|
|
105
105
|
else if (a === '--zip') { opts.zip = argv[++i] || fail('--zip needs a value (path or URL to a wordjs-*.zip).'); }
|
|
106
|
-
else if (a === '--version') { opts.version = argv[++i] || fail('--version needs a value (a release tag, e.g.
|
|
106
|
+
else if (a === '--version') { opts.version = argv[++i] || fail('--version needs a value (a release tag, e.g. v2.1.0).'); }
|
|
107
107
|
else if (a === '--http') opts.http = true;
|
|
108
108
|
else if (a === '--no-start') opts.start = false;
|
|
109
109
|
else if (a === '--yes' || a === '-y') opts.yes = true;
|
|
@@ -130,7 +130,7 @@ function parseArgs(argv) {
|
|
|
130
130
|
else if (opts.mode === 'join') opts.dir = opts.role ? `wordjs-${opts.role}` : 'wordjs-node';
|
|
131
131
|
else fail('Please specify a directory for your new site.', 'Example: npx create-wordjs@latest my-site');
|
|
132
132
|
}
|
|
133
|
-
if (opts.version && /^\d/.test(opts.version)) opts.version = 'v' + opts.version; // accept "1.0
|
|
133
|
+
if (opts.version && /^\d/.test(opts.version)) opts.version = 'v' + opts.version; // accept "2.1.0" for "v2.1.0"
|
|
134
134
|
return opts;
|
|
135
135
|
}
|
|
136
136
|
|
|
@@ -729,7 +729,7 @@ async function main() {
|
|
|
729
729
|
console.log(` cd ${opts.dir}`);
|
|
730
730
|
console.log(` npm run start:mono${opts.http ? ' (with WORDJS_HTTP=1 in the environment for plain HTTP)' : ''}`);
|
|
731
731
|
console.log('');
|
|
732
|
-
console.log(` The console will print your one-time install URL (${proto}://localhost:3000/install
|
|
732
|
+
console.log(` The console will print your one-time install URL (${proto}://localhost:3000/install#token=…).`);
|
|
733
733
|
console.log(line + '\n');
|
|
734
734
|
return;
|
|
735
735
|
}
|
|
@@ -743,7 +743,12 @@ async function main() {
|
|
|
743
743
|
console.log(`\n${line}`);
|
|
744
744
|
console.log('✅ WordJS is ready — finish setup in your browser:');
|
|
745
745
|
console.log('');
|
|
746
|
-
|
|
746
|
+
// The token rides in the URL FRAGMENT, not a `?token=` query string: a fragment is never sent to
|
|
747
|
+
// any server, so this bootstrap secret stays out of access/proxy logs and out of the `Referer` of
|
|
748
|
+
// every sub-resource the install page loads. The wizard reads `#token=` (and still accepts a
|
|
749
|
+
// legacy `?token=`) and scrubs it from the address bar. Keep in sync with the backend's own
|
|
750
|
+
// banner in backend/src/core/install-token.ts.
|
|
751
|
+
console.log(` → ${proto}://localhost:3000/install#token=${token}`);
|
|
747
752
|
console.log('');
|
|
748
753
|
console.log(' • The server is starting below — give it ~15–30 seconds, then open the URL.');
|
|
749
754
|
if (!opts.http) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-wordjs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Create a WordJS site with one command — the self-hosted CMS where third-party plugins run in an OS-isolated process with per-capability permission grants. SSR/SEO out of the box, SQLite by default, no PHP.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jaime Martinez (https://github.com/jaimemartinez)",
|