@reliantlabs/forge-web-runtime 0.7.0 → 0.8.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/dist/vite.d.ts +56 -0
- package/dist/vite.js +116 -0
- package/dist/vite.js.map +1 -0
- package/package.json +5 -1
package/dist/vite.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { IncomingMessage, ServerResponse } from "node:http";
|
|
2
|
+
/**
|
|
3
|
+
* The environment variable `forge env up` sets on a frontend's dev server
|
|
4
|
+
* when the frontend's runtime config document was rendered outside its tree.
|
|
5
|
+
* Its value is an absolute path.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FORGE_RUNTIME_CONFIG_FILE_ENV = "FORGE_RUNTIME_CONFIG_FILE";
|
|
8
|
+
type NextFn = (err?: unknown) => void;
|
|
9
|
+
type Middleware = (req: IncomingMessage, res: ServerResponse, next: NextFn) => void;
|
|
10
|
+
/** The part of a Vite dev / preview server this plugin uses. */
|
|
11
|
+
export interface RuntimeConfigServer {
|
|
12
|
+
config: {
|
|
13
|
+
base: string;
|
|
14
|
+
logger: {
|
|
15
|
+
warn(msg: string): void;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
middlewares: {
|
|
19
|
+
use(fn: Middleware): unknown;
|
|
20
|
+
};
|
|
21
|
+
watcher?: {
|
|
22
|
+
add(paths: string | readonly string[]): unknown;
|
|
23
|
+
on(event: "change", listener: (path: string) => void): unknown;
|
|
24
|
+
};
|
|
25
|
+
ws?: {
|
|
26
|
+
send(payload: {
|
|
27
|
+
type: "full-reload";
|
|
28
|
+
path?: string;
|
|
29
|
+
}): void;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export interface ForgeRuntimeConfigOptions {
|
|
33
|
+
/**
|
|
34
|
+
* The document to serve. Defaults to `process.env.FORGE_RUNTIME_CONFIG_FILE`
|
|
35
|
+
* as the dev server sees it. Empty or unset makes the plugin inert.
|
|
36
|
+
*/
|
|
37
|
+
file?: string;
|
|
38
|
+
}
|
|
39
|
+
/** The plugin object; structurally a Vite `Plugin`. */
|
|
40
|
+
export interface ForgeRuntimeConfigPlugin {
|
|
41
|
+
name: string;
|
|
42
|
+
configureServer(server: RuntimeConfigServer): void;
|
|
43
|
+
configurePreviewServer(server: RuntimeConfigServer): void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* forgeRuntimeConfig serves `<base>config.js` from the file forge rendered
|
|
47
|
+
* for this frontend, when there is one. Add it to `plugins` in
|
|
48
|
+
* vite.config.ts:
|
|
49
|
+
*
|
|
50
|
+
* ```ts
|
|
51
|
+
* import { forgeRuntimeConfig } from "@reliantlabs/forge-web-runtime/vite";
|
|
52
|
+
* export default defineConfig({ plugins: [react(), forgeRuntimeConfig()] });
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function forgeRuntimeConfig(options?: ForgeRuntimeConfigOptions): ForgeRuntimeConfigPlugin;
|
|
56
|
+
export {};
|
package/dist/vite.js
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// Part of @reliantlabs/forge-web-runtime — the web twin of forge/pkg.
|
|
2
|
+
//
|
|
3
|
+
// forgeRuntimeConfig — a Vite plugin that serves the frontend's runtime
|
|
4
|
+
// config document (`config.js`, which sets `window.__FORGE_CONFIG__`) from a
|
|
5
|
+
// file forge rendered OUTSIDE the frontend's own tree.
|
|
6
|
+
//
|
|
7
|
+
// # Why
|
|
8
|
+
//
|
|
9
|
+
// A frontend normally carries its dev document at `public/config.js`, written
|
|
10
|
+
// by `forge generate` / `forge env up` in the project that owns the frontend.
|
|
11
|
+
// A frontend whose code lives in ANOTHER repository — a sibling checkout
|
|
12
|
+
// (`path: "../reliant/web"`) in dev, a source pin when building — has no
|
|
13
|
+
// directory forge may write into: putting one repo's rendered environment in
|
|
14
|
+
// another repo's working tree is a diff in someone else's `git status`. So the
|
|
15
|
+
// project that declares the environment renders the document to its own
|
|
16
|
+
// `.forge/runtime-config/<frontend>/config.js`, and `forge env up` hands the
|
|
17
|
+
// path to the frontend's dev server as FORGE_RUNTIME_CONFIG_FILE. This plugin
|
|
18
|
+
// is the dev server's half: it answers `<base>config.js` from that file.
|
|
19
|
+
//
|
|
20
|
+
// With the variable unset (the frontend's own repo runs its own dev server,
|
|
21
|
+
// or a build) the plugin does nothing, and `public/config.js` is served as
|
|
22
|
+
// before — so adding it to a vite.config.ts is safe in every mode.
|
|
23
|
+
//
|
|
24
|
+
// The file is read on EVERY request rather than once: `forge env up`
|
|
25
|
+
// re-renders it after identity and jobs converge, and a page reload must see
|
|
26
|
+
// that, not the value from when the dev server started. A change also sends
|
|
27
|
+
// the page a full reload, so an open tab picks it up without a click.
|
|
28
|
+
//
|
|
29
|
+
// Structural types only: this module imports nothing from `vite`, so the
|
|
30
|
+
// package takes no dependency on any Vite major. The plugin object is
|
|
31
|
+
// assignable to Vite's `Plugin` (vite.test.ts pins that).
|
|
32
|
+
import { readFile } from "node:fs/promises";
|
|
33
|
+
import { resolve } from "node:path";
|
|
34
|
+
/**
|
|
35
|
+
* The environment variable `forge env up` sets on a frontend's dev server
|
|
36
|
+
* when the frontend's runtime config document was rendered outside its tree.
|
|
37
|
+
* Its value is an absolute path.
|
|
38
|
+
*/
|
|
39
|
+
export const FORGE_RUNTIME_CONFIG_FILE_ENV = "FORGE_RUNTIME_CONFIG_FILE";
|
|
40
|
+
/** The document's file name, which is also the path it is served at. */
|
|
41
|
+
const CONFIG_JS = "config.js";
|
|
42
|
+
/**
|
|
43
|
+
* configPath is the request path the document is served at under `base`.
|
|
44
|
+
* Vite normalizes a dev server's base to "/" or "/prefix/"; a relative base
|
|
45
|
+
* ("./", a build-only setting) is served from the root.
|
|
46
|
+
*/
|
|
47
|
+
function configPath(base) {
|
|
48
|
+
const b = base.startsWith("/") ? base : "/";
|
|
49
|
+
return (b.endsWith("/") ? b : `${b}/`) + CONFIG_JS;
|
|
50
|
+
}
|
|
51
|
+
function requestPath(req) {
|
|
52
|
+
const url = req.url ?? "";
|
|
53
|
+
const q = url.search(/[?#]/);
|
|
54
|
+
return q < 0 ? url : url.slice(0, q);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* forgeRuntimeConfig serves `<base>config.js` from the file forge rendered
|
|
58
|
+
* for this frontend, when there is one. Add it to `plugins` in
|
|
59
|
+
* vite.config.ts:
|
|
60
|
+
*
|
|
61
|
+
* ```ts
|
|
62
|
+
* import { forgeRuntimeConfig } from "@reliantlabs/forge-web-runtime/vite";
|
|
63
|
+
* export default defineConfig({ plugins: [react(), forgeRuntimeConfig()] });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export function forgeRuntimeConfig(options = {}) {
|
|
67
|
+
const raw = options.file ?? process.env[FORGE_RUNTIME_CONFIG_FILE_ENV] ?? "";
|
|
68
|
+
const file = raw.trim() === "" ? "" : resolve(raw.trim());
|
|
69
|
+
const install = (server, live) => {
|
|
70
|
+
if (file === "")
|
|
71
|
+
return;
|
|
72
|
+
const path = configPath(server.config.base);
|
|
73
|
+
server.middlewares.use((req, res, next) => {
|
|
74
|
+
if ((req.method !== "GET" && req.method !== "HEAD") ||
|
|
75
|
+
requestPath(req) !== path) {
|
|
76
|
+
next();
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
readFile(file, "utf8").then((body) => {
|
|
80
|
+
res.statusCode = 200;
|
|
81
|
+
res.setHeader("Content-Type", "text/javascript; charset=utf-8");
|
|
82
|
+
// The document is per environment and re-rendered while the dev
|
|
83
|
+
// server runs; a cached copy is a stale environment.
|
|
84
|
+
res.setHeader("Cache-Control", "no-store");
|
|
85
|
+
res.end(req.method === "HEAD" ? undefined : body);
|
|
86
|
+
}, (err) => {
|
|
87
|
+
// Loud, not silent: the page will fall back to whatever
|
|
88
|
+
// public/config.js says (or to config_gen.ts's defaults), and the
|
|
89
|
+
// only clue is this line in the dev server's log.
|
|
90
|
+
server.config.logger.warn(`[forge-runtime-config] ${FORGE_RUNTIME_CONFIG_FILE_ENV}=${file} is unreadable ` +
|
|
91
|
+
`(${err instanceof Error ? err.message : String(err)}); ` +
|
|
92
|
+
`serving ${path} from the frontend's own tree instead. ` +
|
|
93
|
+
"Re-run `forge env up` in the project that declares this frontend.");
|
|
94
|
+
next();
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
if (live && server.watcher) {
|
|
98
|
+
server.watcher.add(file);
|
|
99
|
+
server.watcher.on("change", (changed) => {
|
|
100
|
+
if (resolve(changed) === file) {
|
|
101
|
+
server.ws?.send({ type: "full-reload", path: "*" });
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
return {
|
|
107
|
+
name: "forge-runtime-config",
|
|
108
|
+
configureServer(server) {
|
|
109
|
+
install(server, true);
|
|
110
|
+
},
|
|
111
|
+
configurePreviewServer(server) {
|
|
112
|
+
install(server, false);
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vite.js","sourceRoot":"","sources":["../src/vite.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,wEAAwE;AACxE,6EAA6E;AAC7E,uDAAuD;AACvD,EAAE;AACF,QAAQ;AACR,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,yEAAyE;AACzE,yEAAyE;AACzE,6EAA6E;AAC7E,+EAA+E;AAC/E,wEAAwE;AACxE,6EAA6E;AAC7E,8EAA8E;AAC9E,yEAAyE;AACzE,EAAE;AACF,4EAA4E;AAC5E,2EAA2E;AAC3E,mEAAmE;AACnE,EAAE;AACF,qEAAqE;AACrE,6EAA6E;AAC7E,4EAA4E;AAC5E,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,sEAAsE;AACtE,0DAA0D;AAC1D,OAAO,EAAE,QAAQ,EA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AAE,CAAC;YAC3B,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACzB,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;gBACtC,IAAI,OAAO,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;oBAC9B,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;gBACtD,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,eAAe,CAAC,MAAM;YACpB,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACxB,CAAC;QACD,sBAAsB,CAAC,MAAM;YAC3B,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACzB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Part of @reliantlabs/forge-web-runtime — the web twin of forge/pkg.\n//\n// forgeRuntimeConfig — a Vite plugin that serves the frontend's runtime\n// config document (`config.js`, which sets `window.__FORGE_CONFIG__`) from a\n// file forge rendered OUTSIDE the frontend's own tree.\n//\n// # Why\n//\n// A frontend normally carries its dev document at `public/config.js`, written\n// by `forge generate` / `forge env up` in the project that owns the frontend.\n// A frontend whose code lives in ANOTHER repository — a sibling checkout\n// (`path: \"../reliant/web\"`) in dev, a source pin when building — has no\n// directory forge may write into: putting one repo's rendered environment in\n// another repo's working tree is a diff in someone else's `git status`. So the\n// project that declares the environment renders the document to its own\n// `.forge/runtime-config/<frontend>/config.js`, and `forge env up` hands the\n// path to the frontend's dev server as FORGE_RUNTIME_CONFIG_FILE. This plugin\n// is the dev server's half: it answers `<base>config.js` from that file.\n//\n// With the variable unset (the frontend's own repo runs its own dev server,\n// or a build) the plugin does nothing, and `public/config.js` is served as\n// before — so adding it to a vite.config.ts is safe in every mode.\n//\n// The file is read on EVERY request rather than once: `forge env up`\n// re-renders it after identity and jobs converge, and a page reload must see\n// that, not the value from when the dev server started. A change also sends\n// the page a full reload, so an open tab picks it up without a click.\n//\n// Structural types only: this module imports nothing from `vite`, so the\n// package takes no dependency on any Vite major. The plugin object is\n// assignable to Vite's `Plugin` (vite.test.ts pins that).\nimport { readFile } from \"node:fs/promises\";\nimport type { IncomingMessage, ServerResponse } from \"node:http\";\nimport { resolve } from \"node:path\";\n\n/**\n * The environment variable `forge env up` sets on a frontend's dev server\n * when the frontend's runtime config document was rendered outside its tree.\n * Its value is an absolute path.\n */\nexport const FORGE_RUNTIME_CONFIG_FILE_ENV = \"FORGE_RUNTIME_CONFIG_FILE\";\n\n/** The document's file name, which is also the path it is served at. */\nconst CONFIG_JS = \"config.js\";\n\ntype NextFn = (err?: unknown) => void;\ntype Middleware = (\n req: IncomingMessage,\n res: ServerResponse,\n next: NextFn,\n) => void;\n\n/** The part of a Vite dev / preview server this plugin uses. */\nexport interface RuntimeConfigServer {\n config: {\n base: string;\n logger: { warn(msg: string): void };\n };\n middlewares: { use(fn: Middleware): unknown };\n watcher?: {\n add(paths: string | readonly string[]): unknown;\n on(event: \"change\", listener: (path: string) => void): unknown;\n };\n ws?: { send(payload: { type: \"full-reload\"; path?: string }): void };\n}\n\nexport interface ForgeRuntimeConfigOptions {\n /**\n * The document to serve. Defaults to `process.env.FORGE_RUNTIME_CONFIG_FILE`\n * as the dev server sees it. Empty or unset makes the plugin inert.\n */\n file?: string;\n}\n\n/** The plugin object; structurally a Vite `Plugin`. */\nexport interface ForgeRuntimeConfigPlugin {\n name: string;\n configureServer(server: RuntimeConfigServer): void;\n configurePreviewServer(server: RuntimeConfigServer): void;\n}\n\n/**\n * configPath is the request path the document is served at under `base`.\n * Vite normalizes a dev server's base to \"/\" or \"/prefix/\"; a relative base\n * (\"./\", a build-only setting) is served from the root.\n */\nfunction configPath(base: string): string {\n const b = base.startsWith(\"/\") ? base : \"/\";\n return (b.endsWith(\"/\") ? b : `${b}/`) + CONFIG_JS;\n}\n\nfunction requestPath(req: IncomingMessage): string {\n const url = req.url ?? \"\";\n const q = url.search(/[?#]/);\n return q < 0 ? url : url.slice(0, q);\n}\n\n/**\n * forgeRuntimeConfig serves `<base>config.js` from the file forge rendered\n * for this frontend, when there is one. Add it to `plugins` in\n * vite.config.ts:\n *\n * ```ts\n * import { forgeRuntimeConfig } from \"@reliantlabs/forge-web-runtime/vite\";\n * export default defineConfig({ plugins: [react(), forgeRuntimeConfig()] });\n * ```\n */\nexport function forgeRuntimeConfig(\n options: ForgeRuntimeConfigOptions = {},\n): ForgeRuntimeConfigPlugin {\n const raw = options.file ?? process.env[FORGE_RUNTIME_CONFIG_FILE_ENV] ?? \"\";\n const file = raw.trim() === \"\" ? \"\" : resolve(raw.trim());\n\n const install = (server: RuntimeConfigServer, live: boolean): void => {\n if (file === \"\") return;\n const path = configPath(server.config.base);\n server.middlewares.use((req, res, next) => {\n if (\n (req.method !== \"GET\" && req.method !== \"HEAD\") ||\n requestPath(req) !== path\n ) {\n next();\n return;\n }\n readFile(file, \"utf8\").then(\n (body) => {\n res.statusCode = 200;\n res.setHeader(\"Content-Type\", \"text/javascript; charset=utf-8\");\n // The document is per environment and re-rendered while the dev\n // server runs; a cached copy is a stale environment.\n res.setHeader(\"Cache-Control\", \"no-store\");\n res.end(req.method === \"HEAD\" ? undefined : body);\n },\n (err: unknown) => {\n // Loud, not silent: the page will fall back to whatever\n // public/config.js says (or to config_gen.ts's defaults), and the\n // only clue is this line in the dev server's log.\n server.config.logger.warn(\n `[forge-runtime-config] ${FORGE_RUNTIME_CONFIG_FILE_ENV}=${file} is unreadable ` +\n `(${err instanceof Error ? err.message : String(err)}); ` +\n `serving ${path} from the frontend's own tree instead. ` +\n \"Re-run `forge env up` in the project that declares this frontend.\",\n );\n next();\n },\n );\n });\n if (live && server.watcher) {\n server.watcher.add(file);\n server.watcher.on(\"change\", (changed) => {\n if (resolve(changed) === file) {\n server.ws?.send({ type: \"full-reload\", path: \"*\" });\n }\n });\n }\n };\n\n return {\n name: \"forge-runtime-config\",\n configureServer(server) {\n install(server, true);\n },\n configurePreviewServer(server) {\n install(server, false);\n },\n };\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reliantlabs/forge-web-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The forge frontend runtime: Connect interceptor stack, session, error boundary, toast queue, <Resource> container, W3C trace propagation and the HyperDX browser SDK wiring (errors, console, network, traces; replay off by default). The web twin of forge/pkg.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"//repository note": "REQUIRED for `npm publish --provenance`, not decoration. npm cross-checks this against the repository in the signed provenance statement and rejects the publish with a 422 if they disagree — an absent field reads as \"\" and fails that comparison. `directory` names the subdirectory this package lives in, so the provenance points at the real source. Omitting this is what made the first 0.3.1 publish fail AFTER the tarball had been signed and written to the sigstore transparency log.",
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"types": "./dist/telemetry.d.ts",
|
|
55
55
|
"default": "./dist/telemetry.js"
|
|
56
56
|
},
|
|
57
|
+
"./vite": {
|
|
58
|
+
"types": "./dist/vite.d.ts",
|
|
59
|
+
"default": "./dist/vite.js"
|
|
60
|
+
},
|
|
57
61
|
"./package.json": "./package.json"
|
|
58
62
|
},
|
|
59
63
|
"scripts": {
|