cursedops 0.8.0 → 0.8.1
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/package.json +1 -1
- package/src/edgeFetch.ts +20 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedops",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "The build-and-ops answers this generation's apps wrote independently and identically: finding a generation's roots — and printing a command that runs when pasted — without knowing a path, the generation's whole-tree laws run over one repo from a checkout or a worktree, macOS launchd agent install/replace/remove and the live port a job serves, the scaffolding and verdicts of a deployed smoke (origin probe, the smoke's own environment, a network that lies about DNS, a settled version), the static-serving helpers eight apps copied — the path-traversal guard among them — the API floor that keeps an unmatched /api/... from ever being answered with the app shell, the commit and dirty flag a checkout-served process reports, the Cloudflare Worker deploy toolkit four apps copied (the deploy sequence, exact-set secrets over a pipe, origin-first rollback, the curl edge fetch, the row-for-row D1 import proof, the billed-CPU tail check around a deploy's walk and smoke, and each app's worker:secrets and worker:smoke main as one function of its data), the Worker import-graph and await-port checks every Worker app's suite runs over its own source, and the public-surface ratchet three published libraries each carried a forked copy of. Mechanism only — no app knows its name from here. Bun, zero runtime dependencies (typescript is an optional peer, for public-surface only), ships source.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
package/src/edgeFetch.ts
CHANGED
|
@@ -32,6 +32,8 @@ import { spawnSync } from "node:child_process";
|
|
|
32
32
|
import { readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
33
33
|
import { tmpdir } from "node:os";
|
|
34
34
|
import { join } from "node:path";
|
|
35
|
+
// The package's own subpath, never `./roots.ts` — see `publishShape.test.ts`.
|
|
36
|
+
import { forgeState } from "cursedops/roots";
|
|
35
37
|
|
|
36
38
|
export interface CurlRun {
|
|
37
39
|
status: number | null;
|
|
@@ -172,3 +174,21 @@ export function createStageEdgeFetch(
|
|
|
172
174
|
const { read: _read, ...rest } = options;
|
|
173
175
|
return { edgeFetch: createEdgeFetch({ ...rest, headersFor: accessHeadersFor }), accessHeadersFor };
|
|
174
176
|
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* THE fleet's edge fetch — {@link createStageEdgeFetch} over `$FORGE_STATE/secrets/cloudflare-access.env`,
|
|
180
|
+
* the one file every Worker app's smoke, stage walk and CPU tail read the Access token from. Two apps
|
|
181
|
+
* carried this as a one-line edge-fetch module of their own until task 2145.
|
|
182
|
+
*
|
|
183
|
+
* `$FORGE_STATE` comes from the environment or the `forge.env` above `from` (default: wherever this
|
|
184
|
+
* package is installed, which is inside the generation's checkout). THROWS when neither answers —
|
|
185
|
+
* a smoke with no idea where its token lives must not guess one.
|
|
186
|
+
*/
|
|
187
|
+
export function fleetEdgeFetch(
|
|
188
|
+
from: string = import.meta.dir,
|
|
189
|
+
options: Omit<EdgeFetchOptions, "headersFor"> & { read?: (path: string) => string } = {},
|
|
190
|
+
): ReturnType<typeof createStageEdgeFetch> {
|
|
191
|
+
const state = forgeState(from);
|
|
192
|
+
if (!state) throw new Error(`no generation state root above ${from}: set $FORGE_STATE or run inside a checkout with forge.env`);
|
|
193
|
+
return createStageEdgeFetch(join(state, "secrets", "cloudflare-access.env"), options);
|
|
194
|
+
}
|