@runeditrun/rer 0.2.42 → 0.2.44
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 +21 -15
- package/cli/README.md +3 -1
- package/cli/browser-runtime.mjs +17 -8
- package/cli/business/command.mjs +1 -1
- package/cli/business/keychain.mjs +1 -1
- package/cli/business/lease.mjs +1 -1
- package/cli/business/questions.mjs +2 -2
- package/cli/contract.mjs +1 -1
- package/cli/deploy-command.mjs +12 -0
- package/cli/deploy-readiness.mjs +2 -2
- package/cli/deploy.mjs +17 -4
- package/cli/hydration/browser.mjs +2 -2
- package/cli/lifecycle.mjs +18 -5
- package/cli/main.mjs +1 -0
- package/cli/parse.mjs +9 -3
- package/cli/port.mjs +3 -3
- package/cli/portability-worker.mjs +3 -1
- package/cli/portability.mjs +7 -3
- package/cli/sqlite-notice.mjs +11 -0
- package/global/CHANGELOG.md +20 -0
- package/global/README.md +21 -15
- package/global/cli/install.mjs +9 -4
- package/global/cli/path-link.mjs +42 -9
- package/global/cli/repository.mjs +4 -1
- package/global/launch/facts.mjs +3 -3
- package/global/main.mjs +5 -1
- package/global/rer.mjs +1 -1
- package/global/run.mjs +64 -0
- package/global/update/command.mjs +1 -1
- package/install.sh +8 -7
- package/modules/dependencies/README.md +5 -2
- package/modules/dependencies/index.mjs +4 -3
- package/modules/dependencies/protocol.mjs +7 -5
- package/modules/deploy-kit/README.md +1 -0
- package/modules/deploy-kit/owner-cli.mjs +8 -6
- package/modules/deploy-kit/owner-secret-copy.mjs +38 -0
- package/modules/deploy-kit/owner-secret-names.mjs +1 -1
- package/modules/deploy-kit/owner-secret.mjs +39 -18
- package/modules/deploy-kit/owner.mjs +23 -14
- package/modules/deploy-kit/provider.mjs +20 -3
- package/modules/operator-auth/README.md +5 -0
- package/modules/operator-auth/accounts/display-name.mjs +23 -0
- package/modules/operator-auth/identity/oidc/config.mjs +10 -8
- package/modules/operator-auth/index.d.mts +2 -0
- package/modules/operator-auth/routes.mjs +4 -3
- package/modules/operator-auth/service.mjs +2 -0
- package/modules/operator-auth/signin/index.mjs +3 -3
- package/modules/portability/README.md +13 -1
- package/modules/portability/import.mjs +19 -7
- package/modules/portability/legacy-safety.mjs +4 -20
- package/modules/portability/restore-safety.mjs +23 -0
- package/modules/release/catalogue.mjs +1 -1
- package/onboarding/port-probe.mjs +4 -2
- package/onboarding/process-diagnostics.mjs +4 -1
- package/onboarding/schema/setup-validation.mjs +1 -1
- package/onboarding/theme.mjs +1 -1
- package/onboarding/ui/app.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,10 +14,10 @@ rer dev just-every/run-inkwell
|
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The installer needs no Node: without Node 22 or later on PATH it installs a
|
|
17
|
-
private one for `rer` (see below). It edits no shell profile
|
|
18
|
-
`~/.local/bin` is not on PATH
|
|
19
|
-
|
|
20
|
-
one line:
|
|
17
|
+
private one for `rer` (see below). It edits no shell profile: it names the next
|
|
18
|
+
command, `rer dev <owner>/<repo>`, and when `~/.local/bin` is not on PATH for new
|
|
19
|
+
terminals its last line is the one to run first, which adds it for your shell.
|
|
20
|
+
The same start also fits on one line:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
curl -fsSL https://runeditrun.com/install.sh | sh -s -- dev just-every/run-inkwell
|
|
@@ -57,16 +57,19 @@ verifies the tarball against that release's published `SHASUMS256.txt`, and
|
|
|
57
57
|
prints its location. The launcher uses this private runtime on later runs.
|
|
58
58
|
System Node and other PATH directories are left alone: the private runtime's
|
|
59
59
|
`node`, `npm` and `npx` are not put on PATH, because `rer` is the one command
|
|
60
|
-
the installer provides. With no arguments the script
|
|
61
|
-
|
|
60
|
+
the installer provides. With no arguments the script names the next command,
|
|
61
|
+
`rer dev <owner>/<repo>`, and ends with the PATH line below when one is needed.
|
|
62
62
|
|
|
63
63
|
No installer edits shell profiles. The canonical launcher is `~/.local/bin/rer`.
|
|
64
64
|
Installation creates that directory if needed and never writes into another
|
|
65
65
|
PATH directory. It names any existing `rer` elsewhere on PATH and leaves it
|
|
66
|
-
unchanged. If `~/.local/bin` is absent from PATH
|
|
67
|
-
|
|
68
|
-
`export PATH="$HOME/.local/bin:$PATH"`
|
|
69
|
-
|
|
66
|
+
unchanged. If `~/.local/bin` is absent from PATH, another command shadows it,
|
|
67
|
+
or no startup file of your shell adds it for new terminals, its last line is
|
|
68
|
+
one command to run: it appends `export PATH="$HOME/.local/bin:$PATH"` to that
|
|
69
|
+
startup file (`~/.zshrc` for zsh; `~/.bash_profile` for bash on macOS and
|
|
70
|
+
`~/.bashrc` elsewhere; `~/.profile` otherwise) and runs it in the current shell.
|
|
71
|
+
For fish it is `fish_add_path ~/.local/bin`. Without a private runtime, the
|
|
72
|
+
launcher uses `node` from PATH. A re-run with the same build changes
|
|
70
73
|
nothing; a different build is installed beside the current one, the previous one
|
|
71
74
|
is kept and older ones are removed. It refuses to replace a `~/.local/bin/rer`
|
|
72
75
|
that it did not write.
|
|
@@ -88,11 +91,14 @@ install in place.
|
|
|
88
91
|
- For `install.sh`: `curl`, `tar`, and `shasum` or `sha256sum` when it installs
|
|
89
92
|
Node. macOS includes these tools.
|
|
90
93
|
- For the npm/npx install alternatives: Node 22 or later on PATH.
|
|
91
|
-
- Checkout commands acquire the checkout's pinned Node and pnpm when needed
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
- Checkout commands acquire the checkout's pinned Node and pnpm when needed,
|
|
95
|
+
in rer's own cache: neither goes on PATH. `rer run SCRIPT [ARGS]` runs a
|
|
96
|
+
package.json script with them, so a project's `pnpm run X -- ARGS` is
|
|
97
|
+
`rer run X -- ARGS`. `rer install` downloads no browser: the checkout's
|
|
98
|
+
Playwright Chromium and headless shell download the first time a command needs
|
|
99
|
+
them (`rer verify`, or `rer run` of a script that runs Playwright). Downloads
|
|
100
|
+
print progress. `rer doctor` lists browsers not downloaded yet, without
|
|
101
|
+
counting them as a problem or downloading anything itself.
|
|
96
102
|
|
|
97
103
|
Not supported: native Windows (`install.sh` and `rer` say to use WSL2), and
|
|
98
104
|
`OPERATIONS.json` version 1 projects.
|
package/cli/README.md
CHANGED
|
@@ -332,7 +332,9 @@ upload.
|
|
|
332
332
|
child build environment and are redacted; the caller environment is restored
|
|
333
333
|
on success and failure. `--remove`, `--set-secret` and `--unset-secret` always go
|
|
334
334
|
through the owner-account controller, without invoking the application's build
|
|
335
|
-
or deploy hook.
|
|
335
|
+
or deploy hook. `--set-secret A,B` (or the flag repeated) changes several
|
|
336
|
+
secrets in one Worker version or none, after checking that each is declared
|
|
337
|
+
and, when set, has its value. Failure reports distinguish deployment, owner claim and token
|
|
336
338
|
retirement and preserve the environment, checkout and env-file in recovery
|
|
337
339
|
commands. Retirement can be finished with `rer deploy --unset-secret SETUP_TOKEN`
|
|
338
340
|
plus the same `--environment`, `--env-file` and `--cwd` arguments.
|
package/cli/browser-runtime.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Browser prerequisites come from the checkout's Playwright, including its
|
|
2
2
|
// platform/revision and PLAYWRIGHT_BROWSERS_PATH handling. Inspection never
|
|
3
|
-
// launches a browser or downloads anything.
|
|
3
|
+
// launches a browser or downloads anything. The browser itself downloads on
|
|
4
|
+
// the first command that needs it (rer verify, or rer run of a Playwright
|
|
5
|
+
// script), never during rer install: a deploy-only owner never fetches it.
|
|
4
6
|
import { access, constants } from 'node:fs/promises';
|
|
5
7
|
import { createRequire } from 'node:module';
|
|
6
8
|
import { dirname, join, relative } from 'node:path';
|
|
@@ -8,6 +10,7 @@ import { RerError } from './errors.mjs';
|
|
|
8
10
|
import { shared } from './shared.mjs';
|
|
9
11
|
|
|
10
12
|
export const browserRepair = 'rer install';
|
|
13
|
+
export const browserDownload = 'rer verify downloads them the first time it runs';
|
|
11
14
|
|
|
12
15
|
export function checkoutPlaywright(root, { required = true } = {}) {
|
|
13
16
|
const require = createRequire(join(root, 'package.json'));
|
|
@@ -44,22 +47,28 @@ export async function browserDoctor(root) {
|
|
|
44
47
|
if (path) try { await access(path, process.platform === 'win32' ? constants.F_OK : constants.X_OK); ok = true; } catch {}
|
|
45
48
|
executables.push({ name, ...(path ? { path } : {}), ok });
|
|
46
49
|
}
|
|
50
|
+
// Not yet downloaded is the normal state until a command needs the browser.
|
|
47
51
|
const missing = executables.filter(executable => !executable.ok).map(executable => executable.name);
|
|
48
|
-
return { ok:
|
|
52
|
+
return { ok: true, package: resolved.name, executables, ...(missing.length ? { note: `Playwright browsers not downloaded yet: ${missing.join(', ')}; ${browserDownload}.` } : {}) };
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
export async function ensureChromium(root, store, signal, { required = true } = {}) {
|
|
52
|
-
//
|
|
53
|
-
// Verification requires Playwright;
|
|
56
|
+
// A first-party adapter without browser dependencies remains valid.
|
|
57
|
+
// Verification requires Playwright; rer run provisions it when declared.
|
|
54
58
|
const resolved = checkoutPlaywright(root, { required });
|
|
55
59
|
if (!resolved) return;
|
|
56
|
-
|
|
57
|
-
if (before.ok) return;
|
|
60
|
+
if (await browsersPresent(root)) return;
|
|
58
61
|
const { cli } = resolved;
|
|
59
62
|
const { dependencyEnvironment } = await shared('dependency-environment.mjs');
|
|
60
63
|
const env = dependencyEnvironment();
|
|
61
64
|
if (process.env.PLAYWRIGHT_BROWSERS_PATH !== undefined) env.PLAYWRIGHT_BROWSERS_PATH = process.env.PLAYWRIGHT_BROWSERS_PATH;
|
|
62
65
|
await store.run('Installing Chromium and its headless shell from the checkout’s Playwright', 'pnpm', ['exec', 'node', cli, 'install', 'chromium'], { cwd: root, signal, env, display: `pnpm exec node ${relative(root, cli)} install chromium` });
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
66
|
+
const absent = (await browserDoctor(root)).executables.filter(executable => !executable.ok).map(executable => executable.name);
|
|
67
|
+
if (absent.length) throw new RerError('browser_install_incomplete', `The checkout's Playwright did not install every browser it pins (missing: ${absent.join(', ')}). Run the same command again; it retries the download.`, 3);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Whether every browser the checkout's Playwright pins is on disk.
|
|
71
|
+
export async function browsersPresent(root) {
|
|
72
|
+
const browser = await browserDoctor(root).catch(() => undefined);
|
|
73
|
+
return Boolean(browser?.ok && !browser.note);
|
|
65
74
|
}
|
package/cli/business/command.mjs
CHANGED
|
@@ -11,7 +11,7 @@ const usage = `Usage: rer business VERB
|
|
|
11
11
|
run [--once] Run consented local discovery; vendor upload integration pending
|
|
12
12
|
next Return one templated question or nothing yet within 60 seconds
|
|
13
13
|
answer ID VENDOR USAGE [CONFIDENCE]
|
|
14
|
-
|
|
14
|
+
Catalog vendor or none; uses, sells, both, product-dependency
|
|
15
15
|
vendor-key add|remove VENDOR Keep a vendor key in OS credential storage
|
|
16
16
|
token MCP headersHelper output; send directly to the MCP client
|
|
17
17
|
status [--json] Pairing, service, current task and checkpoint
|
|
@@ -94,7 +94,7 @@ export async function readSecret({ input = process.stdin, output = process.stder
|
|
|
94
94
|
input.setRawMode(Boolean(wasRaw)); if (!wasFlowing) input.pause(); output.write('\n');
|
|
95
95
|
if (error) reject(error); else { try { resolve(checkedSecret(secret)); } catch (e) { reject(e); } }
|
|
96
96
|
}
|
|
97
|
-
const interrupted = () => finish(new Error('Credential entry
|
|
97
|
+
const interrupted = () => finish(new Error('Credential entry canceled.'));
|
|
98
98
|
const terminated = () => finish(new Error('Credential entry interrupted.'));
|
|
99
99
|
const ended = () => finish(new Error('Credential input ended before confirmation.'));
|
|
100
100
|
function data(chunk) {
|
package/cli/business/lease.mjs
CHANGED
|
@@ -43,7 +43,7 @@ export class Lease {
|
|
|
43
43
|
this.expires = expires;
|
|
44
44
|
this.cursor = Number.isSafeInteger(result.cursor) ? result.cursor : this.cursor;
|
|
45
45
|
if (result.cancel_requested || result.controls?.some(control => control.kind === 'cancel' || control.instruction === 'pause')) {
|
|
46
|
-
this.controller.abort(Error('Business task was paused or
|
|
46
|
+
this.controller.abort(Error('Business task was paused or canceled in the browser.'));
|
|
47
47
|
this.signal.throwIfAborted();
|
|
48
48
|
}
|
|
49
49
|
// Controls contain only closed enums. A requested checkpoint is already
|
|
@@ -66,7 +66,7 @@ export async function next() {
|
|
|
66
66
|
export async function answer(id, vendorId, choice, rawConfidence = '1') {
|
|
67
67
|
identifier(id);
|
|
68
68
|
// Reject free text before even looking up the question or minting a bearer.
|
|
69
|
-
if (typeof vendorId !== 'string' || !/^[a-z][a-z0-9-]{0,79}$/.test(vendorId) || sensitive(vendorId)) throw Error('Choose a
|
|
69
|
+
if (typeof vendorId !== 'string' || !/^[a-z][a-z0-9-]{0,79}$/.test(vendorId) || sensitive(vendorId)) throw Error('Choose a catalog vendor id from rer business next, or none.');
|
|
70
70
|
if (!classifications.includes(choice)) throw Error(`Choose an enum: ${classifications.join(', ')}.`);
|
|
71
71
|
if (!/^(?:0(?:\.\d+)?|1(?:\.0+)?)$/.test(rawConfidence)) throw Error('Choose a numeric confidence between 0 and 1.');
|
|
72
72
|
const confidence = Number(rawConfidence);
|
|
@@ -75,7 +75,7 @@ export async function answer(id, vendorId, choice, rawConfidence = '1') {
|
|
|
75
75
|
if (summary.runner === 'owner' || ownerKinds.has(summary.kind)) throw Error(`This item requires the owner in the browser: ${ownerLink(state)}`);
|
|
76
76
|
if (summary.kind !== 'classify.row' || summary.runner !== 'executor') throw Error('This item does not accept a CLI classification answer.');
|
|
77
77
|
const { vendors } = classification(summary);
|
|
78
|
-
if (!vendors.includes(vendorId)) throw Error('Choose a
|
|
78
|
+
if (!vendors.includes(vendorId)) throw Error('Choose a catalog vendor id from this question, or none.');
|
|
79
79
|
const tool = await mcpClient(api, { taskId: id, signal });
|
|
80
80
|
let lease = summary;
|
|
81
81
|
if (summary.state === 'ready') lease = await tool('answer', { task_id: id, action: 'claim', client_event_id: randomUUID(), fence: summary.fence });
|
package/cli/contract.mjs
CHANGED
|
@@ -11,7 +11,7 @@ const definitions = {
|
|
|
11
11
|
build: [['--site'], 'Production build with private local settings excluded and restored. --site instead writes the static run site (homepage, /run, docs) to its declared folder and prints that folder.'],
|
|
12
12
|
verify: [[], 'Run the complete internal verification target.'],
|
|
13
13
|
reset: [['--yes'], 'Confirmed removal of the declared local inventory only.'],
|
|
14
|
-
deploy: [['--environment', '--dry-run', '--site', '--demo', '--host', '--env-file', '--image', '--bind-address', '--http-port', '--https-port', '--remove', '--yes', '--set-secret', '--unset-secret', '--rotate-secret'], 'Owner-account deployment and health; dry run performs local validation/build only. Builds and deploy hooks run with the checkout\'s local settings files moved aside, and a build output holding one (.dev.vars, .env) is refused. Declared secrets come from the environment or --env-file (an owned 0600 KEY=VALUE file); a new Worker gets the local setup owner and fresh generated secrets when they are not given. rer keeps the secrets it generates in .rer/deploy/ENVIRONMENT.secrets.env (0600) and reuses them on every redeploy; it refuses to generate a replacement for one a live Worker holds, and --rotate-secret NAME[,NAME] replaces them on purpose. After a healthy deploy rer claims the setup owner on the hosted app with the one-time setup token, then removes the token. --set-secret NAME (value from the environment or --env-file) and --unset-secret NAME change
|
|
14
|
+
deploy: [['--environment', '--dry-run', '--site', '--demo', '--host', '--env-file', '--image', '--bind-address', '--http-port', '--https-port', '--remove', '--yes', '--set-secret', '--unset-secret', '--rotate-secret'], 'Owner-account deployment and health; dry run performs local validation/build only. Builds and deploy hooks run with the checkout\'s local settings files moved aside, and a build output holding one (.dev.vars, .env) is refused. Declared secrets come from the environment or --env-file (an owned 0600 KEY=VALUE file); a new Worker gets the local setup owner and fresh generated secrets when they are not given. rer keeps the secrets it generates in .rer/deploy/ENVIRONMENT.secrets.env (0600) and reuses them on every redeploy; it refuses to generate a replacement for one a live Worker holds, and --rotate-secret NAME[,NAME] replaces them on purpose. After a healthy deploy rer claims the setup owner on the hosted app with the one-time setup token, then removes the token. --set-secret NAME[,NAME] (each value from the environment or --env-file; repeat the flag or join names with commas) and --unset-secret NAME[,NAME] change those secrets of the deployed Worker without a build, all of them in one new Worker version or none, and record that version; a missing value refuses before any change. --remove --yes deletes what this environment\'s deploy record says rer created (Worker, D1, R2, KV, queues), reads back that each is gone, and touches nothing else. --site deploys the run site instead: an assets-only Worker on its custom domain with www redirected; with --dry-run it builds the site and prints the plan with no provider request. --demo deploys the hosted demo instead (deploy-demo.json): a front Worker on demo.<domain> giving each visitor their own signed-in, throwaway native Worker isolate of this seed with real public reads/checks and simulated external writes; --dry-run writes it to .rer/demo-host with no provider request; --demo --remove --yes deletes that demo (its Worker, demo.<domain> Custom Domain, each only while the record its deploy left proves it the demo\'s), reads back that each is gone, and is a no-op once it is.'],
|
|
15
15
|
export: [['--target', '--output', '--origin', '--session-file'], 'Complete supported archive of the local copy on this computer, with integrity and exclusions, written to --output. The hosted install cannot be exported yet: --origin or --target remote refuses (exit 2) before any effect and names the command that saves the hosted database.'],
|
|
16
16
|
import: [['--target', '--input', '--journal', '--origin', '--session-file', '--yes', '--legacy-v1', '--acknowledge-unverified-metadata', '--output'], 'Confirmed atomic restore into an empty destination; --journal LATER_ARCHIVE also fences rows that installation erased since. Backup-only local v1 recovery requires --legacy-v1 --acknowledge-unverified-metadata and a new --output v2 archive; --journal requires normal v2 import.'],
|
|
17
17
|
doctor: [[], 'Read-only installed tool, configuration and state diagnostics.'],
|
package/cli/deploy-command.mjs
CHANGED
|
@@ -44,6 +44,18 @@ export async function declarationFor(root, adapter) {
|
|
|
44
44
|
return matches[0];
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
// What a real deploy of this checkout still needs from its owner, read from its
|
|
48
|
+
// deploy declaration as a dry run reads it. Local setup lists it when it ends.
|
|
49
|
+
export async function hostedDeployNeeds(project) {
|
|
50
|
+
const { adapter, root, setupManifest, setupSeed } = project;
|
|
51
|
+
if (typeof adapter?.deploy !== 'function') return [];
|
|
52
|
+
const { path, value: declaration } = await declarationFor(root, adapter);
|
|
53
|
+
const options = { dryRun: true }, settings = adapter.hooks?.secrets ?? adapter.settings;
|
|
54
|
+
const { env } = await deployEnvironment({ root, options, declaration, setupManifest, settings, localOnlyKeys: adapter.localOnlyKeys ?? [] });
|
|
55
|
+
const { signIn } = await requireProductionAuth({ root, declaration, env, setupManifest, setupSeed, adapter, declarationPath: path, options }) ?? {};
|
|
56
|
+
return neededForRealDeploy({ declaration, env, signIn });
|
|
57
|
+
}
|
|
58
|
+
|
|
47
59
|
export async function deployCommand(context) {
|
|
48
60
|
const { adapter, root, options, store, setupManifest, linkDependencies, localOnlyKeys = [] } = context;
|
|
49
61
|
validateDeployOptions(options);
|
package/cli/deploy-readiness.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// response. Only show that response through the command's existing redactor.
|
|
3
3
|
export function mutationReadinessFailure(error, { again, redact }) {
|
|
4
4
|
if (!error.secretChange) return undefined;
|
|
5
|
-
const {
|
|
5
|
+
const { bindings, present } = error.secretChange, binding = bindings.join(', ');
|
|
6
6
|
const last = error.attempts?.at(-1);
|
|
7
7
|
const status = last?.status == null ? 'no HTTP response' : `HTTP ${last.status}`;
|
|
8
8
|
const first = redact(String(last?.body ?? '').split(/[\r\n]/, 1)[0]).slice(0, 256);
|
|
@@ -11,6 +11,6 @@ export function mutationReadinessFailure(error, { again, redact }) {
|
|
|
11
11
|
: `The secret change for ${binding} was applied and its new Worker version recorded.`;
|
|
12
12
|
const step = error.ownerFinalization ? 'owner claim/token retirement' : `secret change for ${binding}`;
|
|
13
13
|
const reason = /^[a-zA-Z0-9_-]{1,120}$/.test(error.message) ? error.message : 'health-check-failed';
|
|
14
|
-
const retirement = error.ownerFinalization ||
|
|
14
|
+
const retirement = error.ownerFinalization || bindings.includes('SETUP_TOKEN') && !present;
|
|
15
15
|
return redact(`${state} Hosted readiness failed after ${step}. ${status} (${reason}).${first ? ` First response line: ${first}` : ''} Update the seed/app configuration to match the changed secrets and redeploy with ${again}. ${retirement ? 'If the app requires the spent setup token, remove that requirement from its configuration before redeploying; keep the recorded owner and token retirement.' : 'If the secret input was incorrect, correct it and apply the intended secret change again.'}`);
|
|
16
16
|
}
|
package/cli/deploy.mjs
CHANGED
|
@@ -58,6 +58,7 @@ export function ownerDeploy(declarationPath, lifecycle) {
|
|
|
58
58
|
return { dryRun: true, deployed: false };
|
|
59
59
|
}
|
|
60
60
|
const { env, supplied, generated, reused, rotated } = await deployEnvironment({ root, options, declaration, setupManifest, settings: lifecycle.settings, localOnlyKeys });
|
|
61
|
+
if (options.setSecret || options.unsetSecret) secretChangeInputs(declaration, options, env, again);
|
|
61
62
|
const kept = keptSecrets(declaration, setupManifest);
|
|
62
63
|
if (cloudflareCredentials.some(name => !env[name]?.trim())) throw missing(missingCredentialsMessage(declaration, env));
|
|
63
64
|
const { main } = await import('../modules/deploy-kit/owner-cli.mjs');
|
|
@@ -93,10 +94,10 @@ export function ownerDeploy(declarationPath, lifecycle) {
|
|
|
93
94
|
}
|
|
94
95
|
if (change.length) {
|
|
95
96
|
step = 'secrets';
|
|
96
|
-
const
|
|
97
|
-
await owner('secret', [
|
|
98
|
-
store.report(`${options.setSecret ?
|
|
99
|
-
return {
|
|
97
|
+
const bindings = (options.setSecret ?? options.unsetSecret).split(','), flag = options.setSecret ? '--set' : '--unset';
|
|
98
|
+
await owner('secret', [...bindings.flatMap(binding => [flag, binding]), ...(state ? ['--state', state] : [])]);
|
|
99
|
+
store.report(`${options.setSecret ? 'Set' : 'Removed'} ${bindings.join(', ')} on this environment's Worker as one new version, recorded it and verified hosted readiness.`);
|
|
100
|
+
return { bindings, present: Boolean(options.setSecret), deployed: false };
|
|
100
101
|
}
|
|
101
102
|
store.report(`Deploying the ${environment} environment to your Cloudflare account.`);
|
|
102
103
|
deployed = await owner('deploy', [], env, { notice: line => store.report(line), onCreated: resource => created.push(redaction.redact(resource)) });
|
|
@@ -131,6 +132,18 @@ export function ownerDeploy(declarationPath, lifecycle) {
|
|
|
131
132
|
}, { declaration: declarationPath, managesHostedOwner: true });
|
|
132
133
|
}
|
|
133
134
|
|
|
135
|
+
// Every secret named in --set-secret or --unset-secret is declared, and each one set has its
|
|
136
|
+
// value, before any provider request: a group of secrets is changed whole or not at all.
|
|
137
|
+
function secretChangeInputs(declaration, options, env, again) {
|
|
138
|
+
const declared = Array.isArray(declaration.secrets) ? declaration.secrets : [], flag = options.setSecret ? '--set-secret' : '--unset-secret';
|
|
139
|
+
const named = (options.setSecret ?? options.unsetSecret).split(',');
|
|
140
|
+
const undeclared = named.filter(name => !declared.some(item => item?.binding === name));
|
|
141
|
+
if (undeclared.length) throw invalid(`${flag} names ${undeclared.join(', ')}, which the deploy declaration does not list as ${undeclared.length > 1 ? 'secrets' : 'a secret'}${declared.length ? ` (it declares ${declared.map(item => item.binding).join(', ')})` : ''}. Nothing was changed.`);
|
|
142
|
+
if (!options.setSecret) return;
|
|
143
|
+
const absent = named.map(name => declared.find(item => item.binding === name).environment).filter(name => !env[name]?.trim());
|
|
144
|
+
if (absent.length) throw missing(`${flag} ${options.setSecret} needs a value for each secret; ${absent.join(', ')} ${absent.length > 1 ? 'are' : 'is'} not set. Set ${absent.length > 1 ? 'them' : 'it'} in the environment or in an --env-file file (owned, mode 0600, one line per secret), then run ${again} ${flag} ${options.setSecret} again. Nothing was changed.`);
|
|
145
|
+
}
|
|
146
|
+
|
|
134
147
|
// The failing step, its redacted cause, what this run created and the command that continues.
|
|
135
148
|
function failureText({ error, step, created, again, retry, secretChange, deployed, redact }) {
|
|
136
149
|
if (step === 'remove') {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Chromium from the seed's own Playwright, the two ways of serving pages to it
|
|
2
2
|
// (the production build as rer deploy hosts it, or a running origin), and one
|
|
3
3
|
// load: scripts held until the probe releases them, every external request aborted.
|
|
4
|
-
import { checkoutPlaywright
|
|
4
|
+
import { checkoutPlaywright } from '../browser-runtime.mjs';
|
|
5
5
|
import { RerError } from '../errors.mjs';
|
|
6
6
|
import { serveHosted } from '../hosted-output.mjs';
|
|
7
7
|
import { probe } from './probe.mjs';
|
|
@@ -12,7 +12,7 @@ export async function launchChromium(root) {
|
|
|
12
12
|
// Pages fulfilled by the check would otherwise count as public, and Chromium would
|
|
13
13
|
// refuse a dev server's loopback HMR socket from them.
|
|
14
14
|
try { return await playwright.chromium.launch({ args: ['--disable-features=LocalNetworkAccessChecks'] }); }
|
|
15
|
-
catch (error) { throw new RerError('hydration_browser_missing', `The hydration check could not start Chromium from the seed's ${name}: ${String(error.message).split('\n').find(line => line.trim()) ?? error}.
|
|
15
|
+
catch (error) { throw new RerError('hydration_browser_missing', `The hydration check could not start Chromium from the seed's ${name}: ${String(error.message).split('\n').find(line => line.trim()) ?? error}. Run rer verify, which downloads the browser it pins first.`, 1); }
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const strip = new Set(['content-encoding', 'content-length', 'transfer-encoding', 'connection']);
|
package/cli/lifecycle.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { ensureChromium } from './browser-runtime.mjs';
|
|
|
2
2
|
import { dependencyInputs } from './dependency-input.mjs';
|
|
3
3
|
import { linkDependencies } from './dependencies.mjs';
|
|
4
4
|
import { savedSetupAnswers } from './setup-answers.mjs';
|
|
5
|
+
import { localDefaultsVariable } from './setup-input.mjs';
|
|
5
6
|
import { mkdtemp, rm } from 'node:fs/promises';
|
|
6
7
|
import { tmpdir } from 'node:os';
|
|
7
8
|
import { join } from 'node:path';
|
|
@@ -93,9 +94,10 @@ async function runLifecycle(project, options, out, deployRedaction) {
|
|
|
93
94
|
try {
|
|
94
95
|
const { dependencyEnvironment } = await shared('dependency-environment.mjs');
|
|
95
96
|
await store.run('Installing frozen dependencies', 'pnpm', ['install', '--frozen-lockfile'], { cwd: project.root, signal, env: { ...dependencyEnvironment(), CI: 'true' }, display: 'pnpm install --frozen-lockfile' });
|
|
96
|
-
//
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
// The test browser downloads on first need (verify), not here. Package
|
|
98
|
+
// scripts run with the pinned pnpm through rer run, which keeps pnpm off PATH.
|
|
99
|
+
if (!options.json) store.report('Run this project\'s package scripts with rer run SCRIPT (it uses the pnpm this project pins).');
|
|
100
|
+
return {};
|
|
99
101
|
} catch (error) { if (signal.aborted) throw error; throw await installStepError(error, store, project.root); }
|
|
100
102
|
}
|
|
101
103
|
if (options.verb === 'verify') {
|
|
@@ -144,8 +146,12 @@ async function runLifecycle(project, options, out, deployRedaction) {
|
|
|
144
146
|
}
|
|
145
147
|
await store.stop(app);
|
|
146
148
|
await rememberSetupAnswers(project, input);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
const deployNeeds = await hostedNeeds(project);
|
|
150
|
+
if (options.json) out.event('setup-ready', { url, setupUrl: url+'/setup', ...(deployNeeds.length ? { neededForDeploy: deployNeeds } : {}) });
|
|
151
|
+
else {
|
|
152
|
+
out.human(`RER_SETUP_READY ${url}`); out.human(`Next: rer dev opens ${url} signed in as the owner; first-run setup finishes at ${url}/setup.`);
|
|
153
|
+
if (deployNeeds.length) out.human(['To host it on your own Cloudflare account later, rer deploy needs:', ...deployNeeds.map(item => ` - ${item}`), 'Set them in your environment or a private (mode 0600) file passed with --env-file, then check with rer deploy --dry-run.'].join('\n'));
|
|
154
|
+
}
|
|
149
155
|
} else if (options.verb !== 'build') throw refuse('The requested first-party capability is unavailable.');
|
|
150
156
|
return {};
|
|
151
157
|
} catch (error) {
|
|
@@ -167,6 +173,13 @@ async function runLifecycle(project, options, out, deployRedaction) {
|
|
|
167
173
|
}
|
|
168
174
|
}
|
|
169
175
|
|
|
176
|
+
// An explicit rer setup lists what hosting this checkout will need; the setup
|
|
177
|
+
// a zero-setup rer dev runs does not. The list is advice: it never fails setup.
|
|
178
|
+
async function hostedNeeds(project) {
|
|
179
|
+
if (process.env[localDefaultsVariable] === '1') return [];
|
|
180
|
+
try { return await (await import('./deploy-command.mjs')).hostedDeployNeeds(project); } catch { return []; }
|
|
181
|
+
}
|
|
182
|
+
|
|
170
183
|
// A failed install step names itself: its command, exit code, last output and
|
|
171
184
|
// full log. A step that stopped outside a command still names the step and log.
|
|
172
185
|
async function installStepError(error, store, root) {
|
package/cli/main.mjs
CHANGED
package/cli/parse.mjs
CHANGED
|
@@ -36,14 +36,16 @@ export function parse(argv, cwd = process.cwd(), { independent = false, deferTai
|
|
|
36
36
|
const suggestion=[...allowed].sort((a,b)=>distance(flag,a)-distance(flag,b))[0];
|
|
37
37
|
throw invalid(`Unsupported flag ${/^--[a-zA-Z-]{1,40}$/.test(flag)?flag:'(invalid)'} for ${verb}.${suggestion?` Did you mean ${suggestion}?`:''} Run rer ${verb} --help.`);
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
// Several secrets change in one deploy: --set-secret A --set-secret B is --set-secret A,B.
|
|
40
|
+
const listed = ['--set-secret', '--unset-secret'].includes(flag);
|
|
41
|
+
if (options.supplied.has(flag) && !listed) throw invalid(`Repeated flag ${flag} for ${verb}. Run rer ${verb} --help.`);
|
|
40
42
|
options.supplied.add(flag);
|
|
41
43
|
const key = flag.slice(2).replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
42
44
|
if (booleans.has(flag)) options[key] = true;
|
|
43
45
|
else {
|
|
44
46
|
const value = args[++i];
|
|
45
47
|
if (value === undefined || value.startsWith('--') || !value.trim()) throw invalid(`A value is required for ${flag}.`);
|
|
46
|
-
options[key] = value;
|
|
48
|
+
options[key] = listed && options[key] !== undefined ? `${options[key]},${value}` : value;
|
|
47
49
|
}
|
|
48
50
|
}
|
|
49
51
|
if (options.help) return options;
|
|
@@ -83,7 +85,11 @@ export function parse(argv, cwd = process.cwd(), { independent = false, deferTai
|
|
|
83
85
|
if (options.target !== undefined && !['local', 'remote'].includes(options.target)) throw invalid('Target must be local or remote.');
|
|
84
86
|
if (options.profile !== undefined && options.profile !== 'first-party') throw invalid('The supported explicit profile is first-party.');
|
|
85
87
|
if (options.environment !== undefined && !/^[a-z][a-z0-9-]{0,39}$/.test(options.environment)) throw invalid('Provide a valid deployment environment name.');
|
|
86
|
-
for (const key of ['setSecret', 'unsetSecret']) if (options[key] !== undefined
|
|
88
|
+
for (const key of ['setSecret', 'unsetSecret']) if (options[key] !== undefined) {
|
|
89
|
+
const names = [...new Set(options[key].split(','))];
|
|
90
|
+
if (names.length > 16 || !names.every(name => /^[A-Z][A-Z0-9_]{0,63}$/.test(name))) throw invalid(`--${key === 'setSecret' ? '' : 'un'}set-secret names declared secret bindings, repeated or separated by commas, such as SESSION_SECRET or MAIL_API_KEY,MAIL_FROM.`);
|
|
91
|
+
options[key] = names.join(',');
|
|
92
|
+
}
|
|
87
93
|
if (options.rotateSecret !== undefined && !/^[A-Z][A-Z0-9_]{0,63}(?:,[A-Z][A-Z0-9_]{0,63}){0,15}$/.test(options.rotateSecret)) throw invalid('--rotate-secret names generated secret bindings, separated by commas, such as SESSION_SECRET.');
|
|
88
94
|
if(verb==='deploy'&&options.demo&&(options.site||['platform','image','bindAddress','httpPort','httpsPort','envFile','host','setSecret','unsetSecret','rotateSecret'].some(key=>options[key]!==undefined)))throw invalid('--demo takes only --environment, --dry-run and --remove --yes: the hosted demo is its own Worker on demo.<domain>.');
|
|
89
95
|
if(verb==='deploy'&&options.demo&&options.remove&&(options.dryRun||!options.yes))throw invalid(options.dryRun?'Use --remove and --dry-run on separate runs.':'deploy --demo --remove deletes the hosted demo\'s Worker, its demo.<domain> Custom Domain. Add --yes to confirm.');
|
package/cli/port.mjs
CHANGED
|
@@ -11,11 +11,11 @@ export const defaultPort = 8787;
|
|
|
11
11
|
// this host can bind. Another checkout's server may listen on every address,
|
|
12
12
|
// which a bind to 127.0.0.1 alone does not notice.
|
|
13
13
|
export async function firstFreePort(host, from = defaultPort, context) {
|
|
14
|
-
const {
|
|
14
|
+
const { searchContext } = await shared('process-diagnostics.mjs');
|
|
15
15
|
const { probePort } = await shared('port-probe.mjs');
|
|
16
|
-
context ??=
|
|
16
|
+
context ??= searchContext({verb:'setup'});
|
|
17
17
|
for (let port = from; port <= 65535; port++) {
|
|
18
|
-
if ((await probePort(host, port, { context, anyAddress: true })).available) return port;
|
|
18
|
+
if ((await probePort(host, port, { context, anyAddress: true, searching: true })).available) return port;
|
|
19
19
|
if (performance.now() >= context.deadline) throw Error('Could not find a free port in time (system busy). Run rer setup again.');
|
|
20
20
|
}
|
|
21
21
|
throw Error(`No free port from ${from} upward.`);
|
|
@@ -71,6 +71,8 @@ catch (error) {
|
|
|
71
71
|
const reason = error instanceof PortabilityError ? error.code.split(':')[0] : /^[A-Z_]+$/.test(error.code ?? '') ? error.code : error.message === 'archive_json' ? 'archive_json' : 'native_error';
|
|
72
72
|
// A later migration that changes restorable data is named: it is a file of this installation.
|
|
73
73
|
const migration = error instanceof PortabilityError && error.code.startsWith('schema_mismatch:migration_data:') ? error.code.slice('schema_mismatch:migration_data:'.length) : undefined;
|
|
74
|
+
// A populated destination names its table or bucket: schema names, never row data.
|
|
75
|
+
const occupied = error instanceof PortabilityError && /^(target|bucket)_not_empty:/.test(error.code) ? error.code.slice(error.code.indexOf(':') + 1) : undefined;
|
|
74
76
|
process.exitCode = exitCode;
|
|
75
|
-
await reply({ ok: false, code: exitCode === 2 ? 'invalid_archive' : exitCode === 4 ? 'restore_refused' : 'transfer_failed', reason, ...(migration ? { migration } : {}), exitCode });
|
|
77
|
+
await reply({ ok: false, code: exitCode === 2 ? 'invalid_archive' : exitCode === 4 ? 'restore_refused' : 'transfer_failed', reason, ...(migration ? { migration } : {}), ...(occupied ? { occupied } : {}), exitCode });
|
|
76
78
|
}
|
package/cli/portability.mjs
CHANGED
|
@@ -54,9 +54,11 @@ export function localPortability({ database, binding = 'DB', buckets = {}, polic
|
|
|
54
54
|
// Check real existing bindings first; finalize repeats this under the lock.
|
|
55
55
|
if(legacyRecovery)await nativeWorker(store,'legacy-preflight',input,signal);
|
|
56
56
|
// Local migrations need no provider account: wrangler runs without credentials.
|
|
57
|
+
// Its info lines (the local location and "Use --remote if you want to access
|
|
58
|
+
// the remote instance") only confuse a local backup; warnings and errors print.
|
|
57
59
|
const { dependencyEnvironment } = await shared('dependency-environment.mjs');
|
|
58
60
|
await store.run('Applying local data migrations', 'pnpm', ['exec', 'wrangler', 'd1', 'migrations', 'apply', database, '--local', '--persist-to', '.wrangler/state', '--config', 'wrangler.jsonc'], {
|
|
59
|
-
cwd: root, signal, env: { ...dependencyEnvironment(), RER_LOCAL_OPERATION: operationToken, WRANGLER_SEND_METRICS: 'false' },
|
|
61
|
+
cwd: root, signal, env: { ...dependencyEnvironment(), RER_LOCAL_OPERATION: operationToken, WRANGLER_SEND_METRICS: 'false', WRANGLER_LOG: 'warn' },
|
|
60
62
|
});
|
|
61
63
|
const receipt=await nativeWorker(store,direction,input,signal);
|
|
62
64
|
if(legacyRecovery)receipt.output=relative(root,legacyRecovery.output);
|
|
@@ -66,9 +68,10 @@ export function localPortability({ database, binding = 'DB', buckets = {}, polic
|
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
async function nativeWorker(store,direction,input,signal) {
|
|
69
|
-
|
|
71
|
+
// The notice filter loads before the worker links its static node:sqlite import.
|
|
72
|
+
const worker = fileURLToPath(new URL('./portability-worker.mjs', import.meta.url)), notice = new URL('./sqlite-notice.mjs', import.meta.url).href;
|
|
70
73
|
const child = store.spawn(`${direction === 'policy-preflight' ? 'Checking archive policy' : direction === 'legacy-preflight' ? 'Checking empty recovery destination' : direction === 'export' ? 'Exporting' : 'Restoring'} local installation data`, process.execPath,
|
|
71
|
-
[worker, direction, JSON.stringify(input)], { cwd: input.root, signal, env: { ...process.env, WRANGLER_SEND_METRICS: 'false' }, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });
|
|
74
|
+
['--import', notice, worker, direction, JSON.stringify(input)], { cwd: input.root, signal, env: { ...process.env, WRANGLER_SEND_METRICS: 'false' }, stdio: ['ignore', 'pipe', 'pipe', 'ipc'] });
|
|
72
75
|
let receipt;
|
|
73
76
|
child.once('message', message => { receipt = message; });
|
|
74
77
|
const closed = new Promise(resolve => child.once('close', (code, signal) => resolve({ code, signal })));
|
|
@@ -79,6 +82,7 @@ async function nativeWorker(store,direction,input,signal) {
|
|
|
79
82
|
if (status.code !== 0 || !receipt.ok) throw new RerError(receipt.code ?? 'transfer_failed', receipt.reason==='legacy_restored_export_failed'
|
|
80
83
|
? 'Legacy data was restored and audited, but its v2 export failed. Preserve this installation, resolve the output problem, then run rer export --output FILE. Do not reset it to retry recovery.'
|
|
81
84
|
: receipt.migration ? `Restore refused (schema_mismatch:migration_data): migration ${receipt.migration} changed data after this archive was made, so its rows would skip that change. Restore an archive made after it.`
|
|
85
|
+
: receipt.occupied ? `Restore refused (${receipt.reason}): ${receipt.reason === 'bucket_not_empty' ? `storage bucket ${receipt.occupied} in this installation already holds files` : `table ${receipt.occupied} in this installation already holds rows its migrations did not insert`}, and a restore only goes into an empty installation. To replace this installation's data with the archive, keep a copy with rer export --output exports/before-restore.rer, then run rer reset --yes and rer import --input ${relative(input.root, input.path)} --yes again.`
|
|
82
86
|
: `The portability module refused or failed the archive operation (${receipt.reason ?? 'incomplete'}).`, receipt.exitCode ?? 1);
|
|
83
87
|
delete receipt.ok;
|
|
84
88
|
return receipt;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Node 22 marks node:sqlite experimental and prints a warning when it loads.
|
|
2
|
+
// rer reads local SQLite on purpose (reset, export, import), so that one notice
|
|
3
|
+
// is dropped; every other warning still prints. Import it before node:sqlite
|
|
4
|
+
// loads: a static import of node:sqlite warns while its module graph links, so
|
|
5
|
+
// a process whose entry imports it statically preloads this with --import.
|
|
6
|
+
const emitWarning = process.emitWarning;
|
|
7
|
+
process.emitWarning = function (warning, ...rest) {
|
|
8
|
+
const type = typeof rest[0] === 'string' ? rest[0] : rest[0]?.type;
|
|
9
|
+
if (type === 'ExperimentalWarning' && /^SQLite is an experimental feature/.test(String(warning?.message ?? warning))) return;
|
|
10
|
+
return emitWarning.call(process, warning, ...rest);
|
|
11
|
+
};
|
package/global/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.44
|
|
4
|
+
|
|
5
|
+
- **Under `rer dev`, a seed can link to another local seed over http.** The dependencies module accepts a provider address of `http://127.0.0.1`, `http://[::1]` or `http://localhost`, on any port, for the RER auth preset, but only when the app runs under `rer dev`. That lets a local Balm link to a local Auth. Every other `http` address, and every hosted deploy, still requires https (#196).
|
|
6
|
+
- **`rer deploy` sets or removes a group of secrets in one Worker version.** Name the secrets with the flag repeated, `rer deploy --set-secret A --set-secret B`, or as a comma list, `--set-secret A,B`, and the same for `--unset-secret`. Either every named secret changes in one new Worker version, or none does, so a seed page can give one copy-paste command for the whole group. Every named secret must be declared, and each one being set needs its value in the environment or `--env-file`. Otherwise rer names each missing secret and changes nothing. An unchanged repeat writes nothing. Other repeated flags are still refused (#199).
|
|
7
|
+
- **A seed's first hosted change no longer trips the credential scan on the /contract styles.** `contract-style.ts` renames its `TOKENS` constant to `DEFAULTS`. The CSS bytes are unchanged. The old name, given a long CSS value, matched the hosted change scan's credential rule (SEC-3). A seed that carries `src/base/runtime/contract-style.ts` picks this up on its next Base refresh (#203).
|
|
8
|
+
- **A test host now moves a seed's secondary demo hosts too.** Before, the run-demo template's "Scope the test host" step moved only the demo domain. Now it also moves every deploy-demo.json setting that equals `demo.<domain>` or ends in `.demo.<domain>`, placing each under `demo.test.<domain>`. A seed such as Lamp, whose demo has a secondary page host, can now plan a test-host demo. Production runs are unchanged (#200).
|
|
9
|
+
- **Base's user-facing copy uses US spelling.** The /run footer reads "MIT license". The sign-in alerts read "Your organization requires…" and "Sign-in was canceled at the provider." Setup's "Brand color" label, "Choose a color", the color validation messages and other CLI messages now use color, catalog and canceled. Identifiers, status codes and data keys are unchanged (#206).
|
|
10
|
+
|
|
11
|
+
## 0.2.43
|
|
12
|
+
|
|
13
|
+
- **The installer ends with the line that puts `rer` on PATH.** `install.sh` and `rer cli install` end with `Next, start an app: rer dev <owner>/<repo>`. When new terminals will not find `rer`, the last line is the one command that adds `~/.local/bin` for your shell, for example `echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc && export PATH="$HOME/.local/bin:$PATH"` (bash: `~/.bash_profile` on macOS and `~/.bashrc` elsewhere; fish: `fish_add_path ~/.local/bin`; otherwise `~/.profile`). Once a startup file already adds it, no line is printed. The installer still never edits a shell profile itself (#190).
|
|
14
|
+
- **`rer run SCRIPT` runs a project's scripts without pnpm on PATH.** `rer run X -- ARGS` is `pnpm run X -- ARGS` with the pnpm and Node the checkout pins, taken from rer's own cache. `rer run` alone lists the scripts. Where a seed's docs say `pnpm run …`, a newcomer without pnpm can now run them (#190).
|
|
15
|
+
- **`rer install` no longer downloads a browser.** The Playwright browser a seed's tests use (about 99 MiB) downloads the first time a command needs it: `rer verify`, or `rer run` of a script that runs Playwright. An owner who only deploys never fetches it. `rer doctor` lists a browser not yet downloaded as a note, not a failure (#190).
|
|
16
|
+
- **`rer dev <owner>/<repo>` clones every release tag.** The clone uses `--filter=blob:none` instead of `--depth 1`: it has every commit and tag, and file contents arrive as a checkout needs them, so `git checkout <tag>` adopts an older release (#190).
|
|
17
|
+
- **`rer setup` says what a hosted deploy still needs.** An explicit `rer setup` ends with what `rer deploy` will need, read from the deploy declaration: the Cloudflare account ID and API token, each required secret not yet set, and production sign-in's mail inputs. With `--json`, the `setup-ready` event carries `neededForDeploy` (#190).
|
|
18
|
+
- **A busy computer no longer fails the first `rer dev` on the port search.** The search moves past a port in use as soon as it cannot bind it, and its time allowance grows with the load per CPU (15 seconds, up to 60). Before, every busy port ran a slow ownership check inside one 15-second budget (#190).
|
|
19
|
+
- **Plainer wording, less noise.** The installer says "start an app", not "start a seed". `rer export`, `rer reset` and `rer import` no longer print Node's "SQLite is an experimental feature" notice or wrangler's "Use --remote if you want to access the remote instance"; warnings and errors still print (#190).
|
|
20
|
+
- **A restore into a fresh install accepts the rows the seed's own migrations insert.** `rer import` into a fresh or reset install used to refuse any seed whose migrations insert rows, such as default settings, with only "(target_not_empty)". Now a table that holds exactly the rows a replay of the applied migrations leaves counts as empty, and the archive's rows replace them. Any other row still refuses, and the message names the table and the next step: keep a copy with `rer export`, then `rer reset --yes` and `rer import --input <file> --yes`. A non-empty bucket is named the same way. This covers local and Node runners; a hosted (Worker) import still needs `replaceableTables` (#193).
|
|
21
|
+
- **The owner can change their display name.** `/setup` shows "Your name" as an editable field, saved on Finish setup. `POST /auth/display-name` changes it later, and the reference app's Operator access panel has a "Your name" form (#193).
|
|
22
|
+
|
|
3
23
|
## 0.2.42
|
|
4
24
|
|
|
5
25
|
- **`rer export` never exports the local copy under a hosted address.** `rer export --origin <hosted address>` used to ignore the address and export this computer's books, so an owner who believed the hosted books were saved could take them down and lose them. Now `--origin` or `--target remote` stops before anything runs (exit 2) and saves nothing. The message says this exports only the local copy and to keep the hosted install until its data is saved. It also names the command that exports each hosted database the checkout deployed, run with the Cloudflare credentials that deployed it: `npx wrangler d1 export <database> --remote --output exports/<database>.sql`. It lists the R2 buckets that command does not cover. A finished export's last line names the copy: "Exported the local copy to exports/x.rer (…)". RUN-LOCALLY.md now says to save the hosted data this way before `rer deploy --remove --yes` (#194).
|
package/global/README.md
CHANGED
|
@@ -14,10 +14,10 @@ rer dev just-every/run-inkwell
|
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The installer needs no Node: without Node 22 or later on PATH it installs a
|
|
17
|
-
private one for `rer` (see below). It edits no shell profile
|
|
18
|
-
`~/.local/bin` is not on PATH
|
|
19
|
-
|
|
20
|
-
one line:
|
|
17
|
+
private one for `rer` (see below). It edits no shell profile: it names the next
|
|
18
|
+
command, `rer dev <owner>/<repo>`, and when `~/.local/bin` is not on PATH for new
|
|
19
|
+
terminals its last line is the one to run first, which adds it for your shell.
|
|
20
|
+
The same start also fits on one line:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
curl -fsSL https://runeditrun.com/install.sh | sh -s -- dev just-every/run-inkwell
|
|
@@ -57,16 +57,19 @@ verifies the tarball against that release's published `SHASUMS256.txt`, and
|
|
|
57
57
|
prints its location. The launcher uses this private runtime on later runs.
|
|
58
58
|
System Node and other PATH directories are left alone: the private runtime's
|
|
59
59
|
`node`, `npm` and `npx` are not put on PATH, because `rer` is the one command
|
|
60
|
-
the installer provides. With no arguments the script
|
|
61
|
-
|
|
60
|
+
the installer provides. With no arguments the script names the next command,
|
|
61
|
+
`rer dev <owner>/<repo>`, and ends with the PATH line below when one is needed.
|
|
62
62
|
|
|
63
63
|
No installer edits shell profiles. The canonical launcher is `~/.local/bin/rer`.
|
|
64
64
|
Installation creates that directory if needed and never writes into another
|
|
65
65
|
PATH directory. It names any existing `rer` elsewhere on PATH and leaves it
|
|
66
|
-
unchanged. If `~/.local/bin` is absent from PATH
|
|
67
|
-
|
|
68
|
-
`export PATH="$HOME/.local/bin:$PATH"`
|
|
69
|
-
|
|
66
|
+
unchanged. If `~/.local/bin` is absent from PATH, another command shadows it,
|
|
67
|
+
or no startup file of your shell adds it for new terminals, its last line is
|
|
68
|
+
one command to run: it appends `export PATH="$HOME/.local/bin:$PATH"` to that
|
|
69
|
+
startup file (`~/.zshrc` for zsh; `~/.bash_profile` for bash on macOS and
|
|
70
|
+
`~/.bashrc` elsewhere; `~/.profile` otherwise) and runs it in the current shell.
|
|
71
|
+
For fish it is `fish_add_path ~/.local/bin`. Without a private runtime, the
|
|
72
|
+
launcher uses `node` from PATH. A re-run with the same build changes
|
|
70
73
|
nothing; a different build is installed beside the current one, the previous one
|
|
71
74
|
is kept and older ones are removed. It refuses to replace a `~/.local/bin/rer`
|
|
72
75
|
that it did not write.
|
|
@@ -88,11 +91,14 @@ install in place.
|
|
|
88
91
|
- For `install.sh`: `curl`, `tar`, and `shasum` or `sha256sum` when it installs
|
|
89
92
|
Node. macOS includes these tools.
|
|
90
93
|
- For the npm/npx install alternatives: Node 22 or later on PATH.
|
|
91
|
-
- Checkout commands acquire the checkout's pinned Node and pnpm when needed
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
- Checkout commands acquire the checkout's pinned Node and pnpm when needed,
|
|
95
|
+
in rer's own cache: neither goes on PATH. `rer run SCRIPT [ARGS]` runs a
|
|
96
|
+
package.json script with them, so a project's `pnpm run X -- ARGS` is
|
|
97
|
+
`rer run X -- ARGS`. `rer install` downloads no browser: the checkout's
|
|
98
|
+
Playwright Chromium and headless shell download the first time a command needs
|
|
99
|
+
them (`rer verify`, or `rer run` of a script that runs Playwright). Downloads
|
|
100
|
+
print progress. `rer doctor` lists browsers not downloaded yet, without
|
|
101
|
+
counting them as a problem or downloading anything itself.
|
|
96
102
|
|
|
97
103
|
Not supported: native Windows (`install.sh` and `rer` say to use WSL2), and
|
|
98
104
|
`OPERATIONS.json` version 1 projects.
|