@valbuild/tanstack-build 0.151.0 → 0.153.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.
@@ -1210,7 +1210,7 @@ var packageJson = {
1210
1210
  url: "git+https://github.com/valbuild/val.git"
1211
1211
  },
1212
1212
  license: "MIT",
1213
- version: "0.151.0",
1213
+ version: "0.153.0",
1214
1214
  sideEffects: false,
1215
1215
  main: "dist/valbuild-tanstack-build.cjs.js",
1216
1216
  module: "dist/valbuild-tanstack-build.esm.js",
@@ -1389,6 +1389,16 @@ var PROPOSAL_BLOCK_V1 = "/*\n * THE PROPOSAL this isolate serves the address of,
1389
1389
  * arrives in files wired before it the same way: {@link rebakeContent}.
1390
1390
  */
1391
1391
  var CONTENT_BLOCK = "/*\n * THE CONTENT VERSION the site serves, when the platform says it differs from\n * the one this build bundles (`VAL_CONTENT`: its id, the publish that made\n * it, and the Source and Val files that differ). Val reads that Source instead\n * of the bundle's and names that publish as its position. valbuild/home\n * `docs/hosted-publishing.md`, step 2.\n *\n * Parsed here, like the proposal above, because this file is compiled against\n * whatever @valbuild/tanstack the PROJECT installed. One from before content\n * versions ignores the `contentVersion` key below and serves the bundle --\n * and never says it applied the version, which is how the platform knows not\n * to serve this build a version it does not bundle. A version that does not\n * parse is thrown, not served as the bundle.\n *\n * A version too large for one variable names others under `refs`\n * (`\"env://VAL_CONTENT_1\"`), each holding one module's Source or one file's\n * text. Only `refs` is resolved, never a string inside Source, and only\n * `VAL_CONTENT_<n>` is read: Source is text editors write, and resolving a\n * reference in there would read `VAL_SECRET` into a page. The same rules as\n * `contentFromEnv` in @valbuild/server.\n */\nconst contentVersion = (() => {\n const handed = secret(\"VAL_CONTENT\");\n if (!handed) return undefined;\n const isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n const parsed: unknown = JSON.parse(handed);\n if (!isRecord(parsed)) throw new Error(\"Val: VAL_CONTENT is not an object\");\n const id = parsed.id;\n if (typeof id !== \"string\" || id === \"\") {\n throw new Error(\"Val: VAL_CONTENT has no id\");\n }\n const where = \"Val: content version \" + id;\n const nullableString = (key: string): string | null => {\n const value = parsed[key] ?? null;\n if (value !== null && typeof value !== \"string\") {\n throw new Error(where + \": \" + key + \" must be a string or null\");\n }\n return value;\n };\n const record = (value: unknown, name: string): Record<string, unknown> => {\n const found = value ?? {};\n if (!isRecord(found)) throw new Error(where + \": \" + name + \" must be an object\");\n return found;\n };\n const job = nullableString(\"job\");\n const commit = nullableString(\"commit\");\n const modules: Record<string, unknown> = { ...record(parsed.modules, \"modules\") };\n const filesIn = record(parsed.files, \"files\");\n const files: Record<string, string> = {};\n for (const [path, text] of Object.entries(filesIn)) {\n if (typeof text === \"string\") files[path] = text;\n }\n const refs = record(parsed.refs, \"refs\");\n const read = (kind: string, path: string, ref: unknown): string => {\n const at = where + \": refs.\" + kind + \"[\" + path + \"]\";\n if (typeof ref !== \"string\" || !ref.startsWith(\"env://\")) {\n throw new Error(at + \" is \" + String(ref) + \": only env://VAL_CONTENT_<n> is read\");\n }\n const name = ref.slice(\"env://\".length);\n if (!/^VAL_CONTENT_[0-9]+$/.test(name)) {\n throw new Error(at + \" names \" + name + \": only VAL_CONTENT_<n> is read\");\n }\n const value = secret(name);\n if (value === undefined) {\n throw new Error(at + \" names \" + name + \", which is not set\");\n }\n return value;\n };\n for (const [path, ref] of Object.entries(record(refs.modules, \"refs.modules\"))) {\n if (Object.prototype.hasOwnProperty.call(modules, path)) {\n throw new Error(where + \": \" + path + \" is in modules and refs.modules\");\n }\n modules[path] = JSON.parse(read(\"modules\", path, ref));\n }\n for (const [path, ref] of Object.entries(record(refs.files, \"refs.files\"))) {\n if (Object.prototype.hasOwnProperty.call(filesIn, path)) {\n throw new Error(where + \": \" + path + \" is in files and refs.files\");\n }\n files[path] = read(\"files\", path, ref);\n }\n if (job === null && commit === null) {\n throw new Error(where + \" must name a job or a commit, or it would be placed at the build it runs in\");\n }\n return { id, job, commit, modules, files };\n})();\n";
1392
+ /**
1393
+ * What each Val module depends on, as the build resolved its imports
1394
+ * (`valModulesEntry` in this package): the build defines it as a global
1395
+ * (`MODULE_DEPENDENCIES_GLOBAL`), and this hands it to Val's server as
1396
+ * `moduleDependencies`. After {@link CONTENT_BLOCK}, where a rebake puts it
1397
+ * in a file wired before it.
1398
+ */
1399
+ var DEPENDENCIES_BLOCK = "/*\n * WHAT EACH VAL MODULE DEPENDS ON, as this build resolved its imports.\n *\n * At a proposal's address it is how Val knows that a module whose own file\n * is not staged is still of code this build was not made of, through a file\n * it imports. Defined by the build; `undefined` from a builder that\n * predates it, and then only staged module files count.\n */\nconst MODULE_DEPENDENCIES = globalThis.__VAL_MODULE_DEPENDENCIES__;\n\n";
1400
+ /** And the option that hands it to Val, after the content version's. */
1401
+ var DEPENDENCIES_OPTION = " ...(MODULE_DEPENDENCIES !== undefined\n ? { moduleDependencies: MODULE_DEPENDENCIES }\n : {}),\n";
1392
1402
  /** Where {@link PROPOSAL_BLOCK} goes: right after this line. */
1393
1403
  var SERVED_BUILD_LINE = 'const servedBuild = secret("VAL_BUILD");\n';
1394
1404
  /** And the option that hands it to Val, after the build's. */
@@ -1398,7 +1408,7 @@ var CONTENT_OPTION = " ...(contentVersion !== undefined ? { contentVersio
1398
1408
  var PUBLISH_BUILD_OPTION = " ...(servedBuild !== undefined ? { publishBuild: servedBuild } : {}),\n";
1399
1409
  var valServerSource = function valServerSource(_ref) {
1400
1410
  var git = _ref.git;
1401
- return "".concat(WIRED_MARKER, "\nimport {\n initValContent,\n initValServer,\n} from \"@valbuild/tanstack/server\";\nimport { config } from \"../../val.config\";\nimport valModules from \"../../val.modules\";\n/*\n * This build's own source, which a publish patches. A project with no\n * repository has no other copy of its `.val.ts` text: content keeps its\n * content as data. Ignored by a @valbuild/tanstack that predates it.\n */\nimport { FILES } from \"platform:project-source\";\n\n/**\n * A secret, as the platform hands it over at RUNTIME.\n *\n * Preferred over `process.env`, which the builder inlines as a literal into\n * this bundle: that puts the value in storage inside the code, copies it into\n * every isolate that loads it, and makes rotating it a republish.\n *\n * Falls back to the build-time value, so an app published before secrets\n * existed keeps working.\n */\nfunction secret(name: string): string | undefined {\n return (globalThis.__PLATFORM_SECRETS ?? {})[name] ?? process.env[name];\n}\n\n/**\n * The commit this build was made from, and the branch it commits to.\n *\n * Baked in rather than handed over at runtime, unlike a secret, because it is\n * not configuration -- it is a property OF THIS BUILD. Every read of a\n * `.val.ts` in http mode fetches that path from the content service at this\n * sha, so a build served with somebody else's commit renders and edits a\n * version of its files it was not compiled from. A secret can be rotated under\n * a running build; this cannot, and publishing again is how it changes.\n *\n * WHAT THIS IS NOT. It is not every read: a committed render reads the source\n * bundled into this build and asks the content service nothing. It is the\n * PUBLISH path -- turning pending patches into new `.val.ts` text means\n * fetching the current text to patch, and that is the read that happens at\n * this sha. The docblock used to say \"every read\", which sent readers looking\n * for a content call on the serving path that is not there.\n *\n * `null` when the source came from no commit -- a record assembled in a tab,\n * a fixture, or ANY build this platform makes, which is the common case rather\n * than the exception. Such a build has no repository to mirror commits into,\n * and does not need one: the content service is the store of record for\n * content and mints its own commit shas. Val is in http mode on credentials\n * alone.\n */\nconst BUILT_FROM = ").concat(git ? JSON.stringify(git) : "null", ";\n\n/**\n * The publish job this build was made for, when a Studio built it in a tab.\n *\n * A tab's build has no commit to bake -- the job's is minted at the seal, after\n * the build -- so this is how it says where it sits in the content service's\n * chain. Without it the service places it at whatever build is live, which is\n * a different build for a request this one is still serving when the pointer\n * moves. Set by the Studio (`rebakeGit`), `null` for any other build.\n */\nconst BUILT_FOR_JOB = null;\n\n/**\n * What puts Val in http mode: its content service owns the content.\n *\n * The same three things any deployed Val app is configured with. Note what is\n * NOT here: no `sourceFiles`, so patches are relayed to the content service\n * instead of being kept by this platform, and the browser uploads an image\n * straight there on a presigned URL instead of streaming it through here.\n *\n * `undefined` when a credential or the commit is missing, and deliberately not\n * a throw at module scope: that would take the isolate down with it, page\n * renders included. Val is left to refuse the request and name what it wanted\n * -- `VAL_ENV=app` is set on this build precisely so that a missing credential\n * is an error instead of a fall-through to `fs` mode, looking for a working\n * tree that is not in here.\n */\nconst apiKey = secret(\"VAL_API_KEY\");\nconst valSecret = secret(\"VAL_SECRET\");\n/*\n * Which content service, for a project that is not pointed at the real one.\n *\n * A secret rather than a baked literal, because unlike the commit this IS\n * configuration: the same build should be servable against a stand-in and\n * against production. It is what makes the editing path testable at all --\n * Val's own `e2e/mock-content-host` implements this wire protocol with no git\n * repository behind it -- and without it a build could only ever talk to\n * content.val.build.\n *\n * It does NOT redirect everything, and the gap is in Val rather than here:\n * `getSettings`, which remote FILES use, reads `process.env.VAL_CONTENT_URL`\n * at module scope inside @valbuild/server. This platform bundles its\n * dependencies separately from the app, so nothing it sets reaches that read --\n * the same reason `apiKey` has to be passed in rather than found. So patches,\n * commits and source reads go where this says, and remote file uploads still\n * address the real host.\n */\nconst valContentUrl = secret(\"VAL_CONTENT_URL\");\n/*\n * WHICH project's content this is, at the content service.\n *\n * Val's own name for the project (`org/name`), which is not the platform's\n * project id and cannot be derived from it. A repository that is deployed\n * anywhere else puts it in `val.config.ts`; one imported here need not have,\n * so it is configuration the platform can supply -- and it goes through\n * `secret` rather than `--env` for a second reason: a build-time literal\n * would have to be baked into the shared dependency layer, where\n * @valbuild/server reads `process.env.VAL_PROJECT`, and that layer is reused\n * by every project with the same dependencies.\n *\n * What the app configured wins over nothing at all, so a repository that does\n * name its project keeps working with no secret set.\n */\nconst valProject = secret(\"VAL_PROJECT\");\n/*\n * WHICH BUILD this is, as the platform running it says.\n *\n * Not baked like `BUILT_FROM`, because it cannot be: a build's hash is taken\n * of its output, this file included. The platform hands it over at runtime,\n * and Val sends it to the content service, which places this build's overlay\n * by it -- the one answer that holds for the minute after a publish in which\n * the edge still serves this build while the pointer already names the next.\n * Ignored by a @valbuild/tanstack that predates it.\n */\nconst servedBuild = secret(\"VAL_BUILD\");\n").concat(PROPOSAL_BLOCK).concat(CONTENT_BLOCK, "const valConfig = {\n ...config,\n ...(valProject !== undefined ? { project: valProject } : {}),\n};\n/*\n * CREDENTIALS ALONE. A commit is not part of what puts Val in http mode.\n *\n * It used to be: `GIT !== null` was in this condition, and a build with no\n * commit fell through to `undefined` -- which meant every site this platform\n * seeded was silently unable to edit, because a shared build cannot know a\n * commit. The binding that worked around it (`VAL_GIT_COMMIT` /\n * `VAL_GIT_BRANCH` out of the project's secrets) is gone with it: it named a\n * commit in the TEMPLATE's repository, which was true only for as long as\n * seeding and repository creation shared a template, and it was one more thing\n * in KV that could go stale.\n *\n * The commit is optional NOW, and it is still sent where there is one -- see\n * the note at the spread below. What is gone is the binding that supplied one\n * from KV, so there is one source per environment and no precedence rule\n * between a baked value and a bound one.\n */\nconst http =\n apiKey !== undefined && valSecret !== undefined\n ? {\n apiKey,\n valSecret,\n /*\n * BOTH SPELLINGS OF THE COMMIT, because the APP decides which one is\n * read and this file cannot know which app it is being written into.\n *\n * `ValHttpMode` has been renamed in both directions. Up to 0.132 it\n * took `gitCommit`/`gitBranch`; 0.133.0 replaced that pair with a\n * nested `git`; the version this package ships beside flattens it\n * back again. The generated file is compiled against whatever\n * `@valbuild/tanstack` the PROJECT installed -- the starter pins\n * 0.133.0 -- and a platform writing this file has no say in that. So\n * this is not one rename behind or ahead: it is on both sides of one at\n * once, and will be until every app it publishes has moved.\n *\n * Sending only the wrong one is SILENT, which is why this is belt and\n * braces rather than a version check. An unknown key on the options\n * object is ignored, so the commit is simply dropped and a build wired\n * FROM A COMMIT runs as though it had none -- which means a publish\n * produces no mirrored `.val.ts`, so a save commits and hands over\n * nothing, and the site keeps serving its old content with the patches\n * already consumed. Nothing reports it. valbuild/home's loop is the one\n * thing that sees it, and it was bisected there: 25/25 with the key the\n * installed version reads, 21/23 without, failing at exactly \"the save\n * left the file it rewrote pending\".\n *\n * Whichever version is installed reads its own key and ignores the\n * other two. Drop this to one spelling when every app this platform\n * publishes is past the rename -- not before, and not on the say-so of\n * a compiler in the Val repository, which is looking at a different\n * version of `@valbuild/tanstack` than the app is.\n */\n ...(BUILT_FROM !== null\n ? {\n git: BUILT_FROM,\n gitCommit: BUILT_FROM.commit,\n gitBranch: BUILT_FROM.branch,\n }\n : {}),\n ...(valContentUrl !== undefined ? { valContentUrl } : {}),\n projectSource: FILES,\n ...(BUILT_FOR_JOB !== null ? { publishJob: BUILT_FOR_JOB } : {}),\n ...(servedBuild !== undefined ? { publishBuild: servedBuild } : {}),\n").concat(PROPOSAL_OPTION).concat(CONTENT_OPTION, " }\n : undefined;\n\nconst { valApiHandler, draftMode } = initValServer(\n valModules,\n valConfig,\n {\n ...(http ? { http } : {}),\n },\n);\n\nconst content = initValContent(valConfig, valModules, {\n draftMode,\n /*\n * The SAME object the API got.\n *\n * These readers resolve content through a Val server of their own rather than\n * by calling the API over HTTP, so the mode question is put to them\n * separately -- configuring only `initValServer` left them inferring `fs`\n * mode, looking for a working tree that is not in here. `gitCommit` is the\n * field that would be silently wrong rather than loudly missing: two\n * different shas means the API edits one version of a file while the page\n * renders another.\n */\n ...(http ? { http } : {}),\n});\n\nconst {\n fetchValStega: fetchVal,\n fetchValKeyStega: fetchValKey,\n fetchValRouteStega: fetchValRoute,\n fetchValRouteUrl,\n} = content;\n\n/**\n * The draft a page renders with in preview: `<ValProvider draft>`, read in the\n * site layout's loader. The starter imports it from this file, so a file\n * without it fails the build with a missing export.\n *\n * Asked of the result rather than destructured, because this file is compiled\n * against whatever `@valbuild/tanstack` the PROJECT installed, and one from\n * before 0.140 has no such reader. There it is \"no draft\", which is the\n * render that version had anyway -- and it is still a function either way, so\n * a page that calls it compiles against both.\n */\nconst fetchValDraft = async () =>\n \"fetchValDraft\" in content && typeof content.fetchValDraft === \"function\"\n ? content.fetchValDraft()\n : null;\n\n/**\n * Content analytics for `<ValProvider analytics>`, read in the site layout's\n * loader beside `fetchValDraft`: whether it is on, and the content version.\n *\n * A setting of the project, which its owner turns on in the project's settings\n * and the platform hands over as the `VAL_ANALYTICS` secret -- at RUNTIME,\n * like every secret, so switching it is not a rebuild. The value reaches the\n * browser in the layout's loader data, which a prerendered page has baked in;\n * the platform keeps a prerendered page only for the secrets it was rendered\n * with, so after a switch pages render live until they are prerendered again.\n * Off unless that secret says `true`. A `@valbuild/tanstack` from before analytics ignores the\n * prop, so this is safe to call against any version.\n *\n * With it, the id of the content version this render serves\n * (`VAL_CONTENT_VERSION`, which the loader hands every isolate it starts for\n * the site, whether the version is the bundle's own or handed over), so every\n * count is stored with the version it was seen in.\n *\n * What the platform handed over ONLY, not `secret()`: that falls back to\n * `process.env`, which the builder bakes into this bundle, so a\n * `VAL_ANALYTICS` set at build time would be a second switch in the code --\n * and one that keeps counting after the owner has turned it off.\n */\nconst fetchValAnalytics = async (): Promise<{\n enabled: boolean;\n contentVersion?: string;\n}> => {\n const handed = globalThis.__PLATFORM_SECRETS ?? {};\n const contentVersion = handed[\"VAL_CONTENT_VERSION\"];\n return {\n enabled: handed[\"VAL_ANALYTICS\"] === \"true\",\n ...(contentVersion ? { contentVersion } : {}),\n };\n};\n\n/**\n * A build that is MEANT to edit and cannot, refusing instead of pretending to.\n *\n * `BUILT_FROM` being non-null says this build came from a commit, so it was\n * made to edit against a content service. If the credentials for that service are not\n * here, the configuration is broken -- and the failure that was reaching people\n * was not an error at all. Val picks its storage mode by inference, so an\n * isolate with no api key lands in a mode that ACCEPTS the write and keeps it\n * in the isolate. Cloudflare starts an isolate per concurrent request, so the\n * save answers 200 and the next request, served by a different isolate, has\n * never heard of it. The edit is simply gone, and nothing anywhere said so.\n *\n * That is the worst available outcome: a person is told their work is saved\n * when it is not. Refusing is strictly better, and naming the missing secret\n * turns an evening of reading logs into one line in a response body.\n *\n * WHY HERE rather than relying on `VAL_ENV=app`: that is a build-time\n * substitution into the shared dependency layer, so whether a build fails\n * loudly depends on which layer it happens to be pinned to. This file is\n * written on every build, by the platform, and cannot be missing from one.\n *\n * Only the editing API. Page renders do not come through here, and a site whose\n * content cannot be edited should still serve the content it has.\n */\nconst editingApiHandler =\n http === undefined\n ? async () => {\n const missing = [\n apiKey === undefined ? \"VAL_API_KEY\" : null,\n valSecret === undefined ? \"VAL_SECRET\" : null,\n /*\n * A build from no commit is listed the same way, because from the\n * outside the two are one state. It is not a secret somebody can set\n * -- a commit is a property OF THE BUILD, and the only cure is\n * publishing this project's own repository over whatever is serving\n * it. Named anyway, because \"it was built from no commit\" is the\n * sentence that ends the search.\n */\n BUILT_FROM === null ? \"a commit (this build was made from none)\" : null,\n ].filter(Boolean);\n return Response.json(\n {\n error:\n \"This site cannot be edited. Its content lives in a content service, and \" +\n missing.join(\", \") +\n \" \" +\n (missing.length > 1 ? \"are\" : \"is\") +\n \" missing, so there is nothing to edit against. Editing is refused rather \" +\n \"than kept in this isolate's memory, where it would be lost without being \" +\n \"reported.\" +\n (BUILT_FROM === null\n ? \" A build made from no commit is usually one SEEDED from a template: \" +\n \"publish this project's own repository to replace it.\"\n : \" This build was made from commit \" + BUILT_FROM.commit.slice(0, 8) + \".\"),\n missing,\n },\n { status: 503 },\n );\n }\n : valApiHandler;\n\nexport {\n editingApiHandler as valApiHandler,\n draftMode,\n fetchVal,\n fetchValKey,\n fetchValRoute,\n fetchValRouteUrl,\n fetchValDraft,\n fetchValAnalytics,\n};\n");
1411
+ return "".concat(WIRED_MARKER, "\nimport {\n initValContent,\n initValServer,\n} from \"@valbuild/tanstack/server\";\nimport { config } from \"../../val.config\";\nimport valModules from \"../../val.modules\";\n/*\n * This build's own source, which a publish patches. A project with no\n * repository has no other copy of its `.val.ts` text: content keeps its\n * content as data. Ignored by a @valbuild/tanstack that predates it.\n */\nimport { FILES } from \"platform:project-source\";\n\n/**\n * A secret, as the platform hands it over at RUNTIME.\n *\n * Preferred over `process.env`, which the builder inlines as a literal into\n * this bundle: that puts the value in storage inside the code, copies it into\n * every isolate that loads it, and makes rotating it a republish.\n *\n * Falls back to the build-time value, so an app published before secrets\n * existed keeps working.\n */\nfunction secret(name: string): string | undefined {\n return (globalThis.__PLATFORM_SECRETS ?? {})[name] ?? process.env[name];\n}\n\n/**\n * The commit this build was made from, and the branch it commits to.\n *\n * Baked in rather than handed over at runtime, unlike a secret, because it is\n * not configuration -- it is a property OF THIS BUILD. Every read of a\n * `.val.ts` in http mode fetches that path from the content service at this\n * sha, so a build served with somebody else's commit renders and edits a\n * version of its files it was not compiled from. A secret can be rotated under\n * a running build; this cannot, and publishing again is how it changes.\n *\n * WHAT THIS IS NOT. It is not every read: a committed render reads the source\n * bundled into this build and asks the content service nothing. It is the\n * PUBLISH path -- turning pending patches into new `.val.ts` text means\n * fetching the current text to patch, and that is the read that happens at\n * this sha. The docblock used to say \"every read\", which sent readers looking\n * for a content call on the serving path that is not there.\n *\n * `null` when the source came from no commit -- a record assembled in a tab,\n * a fixture, or ANY build this platform makes, which is the common case rather\n * than the exception. Such a build has no repository to mirror commits into,\n * and does not need one: the content service is the store of record for\n * content and mints its own commit shas. Val is in http mode on credentials\n * alone.\n */\nconst BUILT_FROM = ").concat(git ? JSON.stringify(git) : "null", ";\n\n/**\n * The publish job this build was made for, when a Studio built it in a tab.\n *\n * A tab's build has no commit to bake -- the job's is minted at the seal, after\n * the build -- so this is how it says where it sits in the content service's\n * chain. Without it the service places it at whatever build is live, which is\n * a different build for a request this one is still serving when the pointer\n * moves. Set by the Studio (`rebakeGit`), `null` for any other build.\n */\nconst BUILT_FOR_JOB = null;\n\n/**\n * What puts Val in http mode: its content service owns the content.\n *\n * The same three things any deployed Val app is configured with. Note what is\n * NOT here: no `sourceFiles`, so patches are relayed to the content service\n * instead of being kept by this platform, and the browser uploads an image\n * straight there on a presigned URL instead of streaming it through here.\n *\n * `undefined` when a credential or the commit is missing, and deliberately not\n * a throw at module scope: that would take the isolate down with it, page\n * renders included. Val is left to refuse the request and name what it wanted\n * -- `VAL_ENV=app` is set on this build precisely so that a missing credential\n * is an error instead of a fall-through to `fs` mode, looking for a working\n * tree that is not in here.\n */\nconst apiKey = secret(\"VAL_API_KEY\");\nconst valSecret = secret(\"VAL_SECRET\");\n/*\n * Which content service, for a project that is not pointed at the real one.\n *\n * A secret rather than a baked literal, because unlike the commit this IS\n * configuration: the same build should be servable against a stand-in and\n * against production. It is what makes the editing path testable at all --\n * Val's own `e2e/mock-content-host` implements this wire protocol with no git\n * repository behind it -- and without it a build could only ever talk to\n * content.val.build.\n *\n * It does NOT redirect everything, and the gap is in Val rather than here:\n * `getSettings`, which remote FILES use, reads `process.env.VAL_CONTENT_URL`\n * at module scope inside @valbuild/server. This platform bundles its\n * dependencies separately from the app, so nothing it sets reaches that read --\n * the same reason `apiKey` has to be passed in rather than found. So patches,\n * commits and source reads go where this says, and remote file uploads still\n * address the real host.\n */\nconst valContentUrl = secret(\"VAL_CONTENT_URL\");\n/*\n * WHICH project's content this is, at the content service.\n *\n * Val's own name for the project (`org/name`), which is not the platform's\n * project id and cannot be derived from it. A repository that is deployed\n * anywhere else puts it in `val.config.ts`; one imported here need not have,\n * so it is configuration the platform can supply -- and it goes through\n * `secret` rather than `--env` for a second reason: a build-time literal\n * would have to be baked into the shared dependency layer, where\n * @valbuild/server reads `process.env.VAL_PROJECT`, and that layer is reused\n * by every project with the same dependencies.\n *\n * What the app configured wins over nothing at all, so a repository that does\n * name its project keeps working with no secret set.\n */\nconst valProject = secret(\"VAL_PROJECT\");\n/*\n * WHICH BUILD this is, as the platform running it says.\n *\n * Not baked like `BUILT_FROM`, because it cannot be: a build's hash is taken\n * of its output, this file included. The platform hands it over at runtime,\n * and Val sends it to the content service, which places this build's overlay\n * by it -- the one answer that holds for the minute after a publish in which\n * the edge still serves this build while the pointer already names the next.\n * Ignored by a @valbuild/tanstack that predates it.\n */\nconst servedBuild = secret(\"VAL_BUILD\");\n").concat(PROPOSAL_BLOCK).concat(CONTENT_BLOCK).concat(DEPENDENCIES_BLOCK, "const valConfig = {\n ...config,\n ...(valProject !== undefined ? { project: valProject } : {}),\n};\n/*\n * CREDENTIALS ALONE. A commit is not part of what puts Val in http mode.\n *\n * It used to be: `GIT !== null` was in this condition, and a build with no\n * commit fell through to `undefined` -- which meant every site this platform\n * seeded was silently unable to edit, because a shared build cannot know a\n * commit. The binding that worked around it (`VAL_GIT_COMMIT` /\n * `VAL_GIT_BRANCH` out of the project's secrets) is gone with it: it named a\n * commit in the TEMPLATE's repository, which was true only for as long as\n * seeding and repository creation shared a template, and it was one more thing\n * in KV that could go stale.\n *\n * The commit is optional NOW, and it is still sent where there is one -- see\n * the note at the spread below. What is gone is the binding that supplied one\n * from KV, so there is one source per environment and no precedence rule\n * between a baked value and a bound one.\n */\nconst http =\n apiKey !== undefined && valSecret !== undefined\n ? {\n apiKey,\n valSecret,\n /*\n * BOTH SPELLINGS OF THE COMMIT, because the APP decides which one is\n * read and this file cannot know which app it is being written into.\n *\n * `ValHttpMode` has been renamed in both directions. Up to 0.132 it\n * took `gitCommit`/`gitBranch`; 0.133.0 replaced that pair with a\n * nested `git`; the version this package ships beside flattens it\n * back again. The generated file is compiled against whatever\n * `@valbuild/tanstack` the PROJECT installed -- the starter pins\n * 0.133.0 -- and a platform writing this file has no say in that. So\n * this is not one rename behind or ahead: it is on both sides of one at\n * once, and will be until every app it publishes has moved.\n *\n * Sending only the wrong one is SILENT, which is why this is belt and\n * braces rather than a version check. An unknown key on the options\n * object is ignored, so the commit is simply dropped and a build wired\n * FROM A COMMIT runs as though it had none -- which means a publish\n * produces no mirrored `.val.ts`, so a save commits and hands over\n * nothing, and the site keeps serving its old content with the patches\n * already consumed. Nothing reports it. valbuild/home's loop is the one\n * thing that sees it, and it was bisected there: 25/25 with the key the\n * installed version reads, 21/23 without, failing at exactly \"the save\n * left the file it rewrote pending\".\n *\n * Whichever version is installed reads its own key and ignores the\n * other two. Drop this to one spelling when every app this platform\n * publishes is past the rename -- not before, and not on the say-so of\n * a compiler in the Val repository, which is looking at a different\n * version of `@valbuild/tanstack` than the app is.\n */\n ...(BUILT_FROM !== null\n ? {\n git: BUILT_FROM,\n gitCommit: BUILT_FROM.commit,\n gitBranch: BUILT_FROM.branch,\n }\n : {}),\n ...(valContentUrl !== undefined ? { valContentUrl } : {}),\n projectSource: FILES,\n ...(BUILT_FOR_JOB !== null ? { publishJob: BUILT_FOR_JOB } : {}),\n ...(servedBuild !== undefined ? { publishBuild: servedBuild } : {}),\n").concat(PROPOSAL_OPTION).concat(CONTENT_OPTION).concat(DEPENDENCIES_OPTION, " }\n : undefined;\n\nconst { valApiHandler, draftMode } = initValServer(\n valModules,\n valConfig,\n {\n ...(http ? { http } : {}),\n },\n);\n\nconst content = initValContent(valConfig, valModules, {\n draftMode,\n /*\n * The SAME object the API got.\n *\n * These readers resolve content through a Val server of their own rather than\n * by calling the API over HTTP, so the mode question is put to them\n * separately -- configuring only `initValServer` left them inferring `fs`\n * mode, looking for a working tree that is not in here. `gitCommit` is the\n * field that would be silently wrong rather than loudly missing: two\n * different shas means the API edits one version of a file while the page\n * renders another.\n */\n ...(http ? { http } : {}),\n});\n\nconst {\n fetchValStega: fetchVal,\n fetchValKeyStega: fetchValKey,\n fetchValRouteStega: fetchValRoute,\n fetchValRouteUrl,\n} = content;\n\n/**\n * The draft a page renders with in preview: `<ValProvider draft>`, read in the\n * site layout's loader. The starter imports it from this file, so a file\n * without it fails the build with a missing export.\n *\n * Asked of the result rather than destructured, because this file is compiled\n * against whatever `@valbuild/tanstack` the PROJECT installed, and one from\n * before 0.140 has no such reader. There it is \"no draft\", which is the\n * render that version had anyway -- and it is still a function either way, so\n * a page that calls it compiles against both.\n */\nconst fetchValDraft = async () =>\n \"fetchValDraft\" in content && typeof content.fetchValDraft === \"function\"\n ? content.fetchValDraft()\n : null;\n\n/**\n * Content analytics for `<ValProvider analytics>`, read in the site layout's\n * loader beside `fetchValDraft`: whether it is on, and the content version.\n *\n * A setting of the project, which its owner turns on in the project's settings\n * and the platform hands over as the `VAL_ANALYTICS` secret -- at RUNTIME,\n * like every secret, so switching it is not a rebuild. The value reaches the\n * browser in the layout's loader data, which a prerendered page has baked in;\n * the platform keeps a prerendered page only for the secrets it was rendered\n * with, so after a switch pages render live until they are prerendered again.\n * Off unless that secret says `true`. A `@valbuild/tanstack` from before analytics ignores the\n * prop, so this is safe to call against any version.\n *\n * With it, the id of the content version this render serves\n * (`VAL_CONTENT_VERSION`, which the loader hands every isolate it starts for\n * the site, whether the version is the bundle's own or handed over), so every\n * count is stored with the version it was seen in.\n *\n * What the platform handed over ONLY, not `secret()`: that falls back to\n * `process.env`, which the builder bakes into this bundle, so a\n * `VAL_ANALYTICS` set at build time would be a second switch in the code --\n * and one that keeps counting after the owner has turned it off.\n */\nconst fetchValAnalytics = async (): Promise<{\n enabled: boolean;\n contentVersion?: string;\n}> => {\n const handed = globalThis.__PLATFORM_SECRETS ?? {};\n const contentVersion = handed[\"VAL_CONTENT_VERSION\"];\n return {\n enabled: handed[\"VAL_ANALYTICS\"] === \"true\",\n ...(contentVersion ? { contentVersion } : {}),\n };\n};\n\n/**\n * A build that is MEANT to edit and cannot, refusing instead of pretending to.\n *\n * `BUILT_FROM` being non-null says this build came from a commit, so it was\n * made to edit against a content service. If the credentials for that service are not\n * here, the configuration is broken -- and the failure that was reaching people\n * was not an error at all. Val picks its storage mode by inference, so an\n * isolate with no api key lands in a mode that ACCEPTS the write and keeps it\n * in the isolate. Cloudflare starts an isolate per concurrent request, so the\n * save answers 200 and the next request, served by a different isolate, has\n * never heard of it. The edit is simply gone, and nothing anywhere said so.\n *\n * That is the worst available outcome: a person is told their work is saved\n * when it is not. Refusing is strictly better, and naming the missing secret\n * turns an evening of reading logs into one line in a response body.\n *\n * WHY HERE rather than relying on `VAL_ENV=app`: that is a build-time\n * substitution into the shared dependency layer, so whether a build fails\n * loudly depends on which layer it happens to be pinned to. This file is\n * written on every build, by the platform, and cannot be missing from one.\n *\n * Only the editing API. Page renders do not come through here, and a site whose\n * content cannot be edited should still serve the content it has.\n */\nconst editingApiHandler =\n http === undefined\n ? async () => {\n const missing = [\n apiKey === undefined ? \"VAL_API_KEY\" : null,\n valSecret === undefined ? \"VAL_SECRET\" : null,\n /*\n * A build from no commit is listed the same way, because from the\n * outside the two are one state. It is not a secret somebody can set\n * -- a commit is a property OF THE BUILD, and the only cure is\n * publishing this project's own repository over whatever is serving\n * it. Named anyway, because \"it was built from no commit\" is the\n * sentence that ends the search.\n */\n BUILT_FROM === null ? \"a commit (this build was made from none)\" : null,\n ].filter(Boolean);\n return Response.json(\n {\n error:\n \"This site cannot be edited. Its content lives in a content service, and \" +\n missing.join(\", \") +\n \" \" +\n (missing.length > 1 ? \"are\" : \"is\") +\n \" missing, so there is nothing to edit against. Editing is refused rather \" +\n \"than kept in this isolate's memory, where it would be lost without being \" +\n \"reported.\" +\n (BUILT_FROM === null\n ? \" A build made from no commit is usually one SEEDED from a template: \" +\n \"publish this project's own repository to replace it.\"\n : \" This build was made from commit \" + BUILT_FROM.commit.slice(0, 8) + \".\"),\n missing,\n },\n { status: 503 },\n );\n }\n : valApiHandler;\n\nexport {\n editingApiHandler as valApiHandler,\n draftMode,\n fetchVal,\n fetchValKey,\n fetchValRoute,\n fetchValRouteUrl,\n fetchValDraft,\n fetchValAnalytics,\n};\n");
1402
1412
  };
1403
1413
 
1404
1414
  /**
@@ -1416,7 +1426,7 @@ var valServerSource = function valServerSource(_ref) {
1416
1426
  * declaration, and a top-level `declare var` is a global without needing
1417
1427
  * `declare global`, which a script may not contain.
1418
1428
  */
1419
- var PROJECT_SOURCE_DECLARATIONS = "// Generated by the Val studio when this project was wired up to the platform.\n// The build resolves this specifier to the project's own source, shipped into\n// the isolate as a module.\n//\n// Deliberately not a module: an `export` anywhere in this file would turn the\n// declaration below into an augmentation, and the import would stop resolving.\ndeclare module 'platform:project-source' {\n /** Every source file of this project, keyed by its path from the root. */\n export const FILES: Record<string, string>\n}\n\n/**\n * The project this isolate is serving, set per request by the platform from\n * the id the loader resolved off the hostname.\n *\n * Absent when server-rendering outside the platform, and in the browser.\n */\n// eslint-disable-next-line no-var\ndeclare var __PLATFORM_PROJECT_ID: string | undefined\n/**\n * This project's secrets, handed over per request rather than built in.\n *\n * SERVER ONLY -- set by the platform's Worker entry, which never runs in a\n * browser. Absent outside the platform.\n */\n// eslint-disable-next-line no-var\ndeclare var __PLATFORM_SECRETS: Record<string, string> | undefined\n";
1429
+ var PROJECT_SOURCE_DECLARATIONS = "// Generated by the Val studio when this project was wired up to the platform.\n// The build resolves this specifier to the project's own source, shipped into\n// the isolate as a module.\n//\n// Deliberately not a module: an `export` anywhere in this file would turn the\n// declaration below into an augmentation, and the import would stop resolving.\ndeclare module 'platform:project-source' {\n /** Every source file of this project, keyed by its path from the root. */\n export const FILES: Record<string, string>\n}\n\n/**\n * The project this isolate is serving, set per request by the platform from\n * the id the loader resolved off the hostname.\n *\n * Absent when server-rendering outside the platform, and in the browser.\n */\n// eslint-disable-next-line no-var\ndeclare var __PLATFORM_PROJECT_ID: string | undefined\n/**\n * This project's secrets, handed over per request rather than built in.\n *\n * SERVER ONLY -- set by the platform's Worker entry, which never runs in a\n * browser. Absent outside the platform.\n */\n// eslint-disable-next-line no-var\ndeclare var __PLATFORM_SECRETS: Record<string, string> | undefined\n/**\n * What each Val module of this build depends on, by path, as the build\n * resolved its imports. Defined by the platform's build; absent from a\n * builder that predates it.\n */\n// eslint-disable-next-line no-var\ndeclare var __VAL_MODULE_DEPENDENCIES__: Record<string, string[]> | undefined\n";
1420
1430
 
1421
1431
  /**
1422
1432
  * The wired `val.server.ts`, on its own.
@@ -1536,6 +1546,38 @@ function rebakeContent(source) {
1536
1546
  });
1537
1547
  }
1538
1548
 
1549
+ /**
1550
+ * `source` handing Val each module's dependencies: {@link DEPENDENCIES_BLOCK}
1551
+ * and its option added after the content version's, to a file wired before
1552
+ * they existed. Idempotent, and only where both places are exactly as
1553
+ * generated -- a file somebody edited is left as it is, and Val counts only
1554
+ * staged module files at a proposal's address, as before.
1555
+ */
1556
+ function rebakeDependencies(source) {
1557
+ var once = function once(needle) {
1558
+ var at = source.indexOf(needle);
1559
+ return at !== -1 && source.indexOf(needle, at + 1) === -1;
1560
+ };
1561
+ if (!once(CONTENT_BLOCK) || !once(CONTENT_OPTION)) return source;
1562
+ var hasBlock = source.includes(DEPENDENCIES_BLOCK);
1563
+ var hasOption = source.includes(DEPENDENCIES_OPTION);
1564
+ if (hasBlock && hasOption) return source;
1565
+ // Each piece once, whatever left the other there: an option without its
1566
+ // block names a constant that does not exist.
1567
+ var next = source;
1568
+ if (!hasBlock) {
1569
+ next = next.replace(CONTENT_BLOCK, function () {
1570
+ return CONTENT_BLOCK + DEPENDENCIES_BLOCK;
1571
+ });
1572
+ }
1573
+ if (!hasOption) {
1574
+ next = next.replace(CONTENT_OPTION, function () {
1575
+ return CONTENT_OPTION + DEPENDENCIES_OPTION;
1576
+ });
1577
+ }
1578
+ return next;
1579
+ }
1580
+
1539
1581
  /** `source` with its job set, or `source` itself when it cannot carry one. */
1540
1582
  function rebakeJob(source, job) {
1541
1583
  var line = "const BUILT_FOR_JOB = ".concat(job === null ? "null" : JSON.stringify(job), ";");
@@ -1619,7 +1661,7 @@ job) {
1619
1661
  if (!BUILT_FROM_LINE.test(source)) return files;
1620
1662
  var withGit = source.replace(BUILT_FROM_LINE, "const BUILT_FROM = ".concat(git === null ? "null" : JSON.stringify(git), ";"));
1621
1663
  var withJob = job === undefined ? withGit : rebakeJob(withGit, job);
1622
- return regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, files), {}, regeneratorValues._defineProperty({}, VAL_SERVER, rebakeContent(rebakeProposal(withJob))));
1664
+ return regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, files), {}, regeneratorValues._defineProperty({}, VAL_SERVER, rebakeDependencies(rebakeContent(rebakeProposal(withJob)))));
1623
1665
  }
1624
1666
 
1625
1667
  /** Is this a Val project at all? */
@@ -2113,30 +2155,67 @@ function bundleValModules(_x) {
2113
2155
  }
2114
2156
 
2115
2157
  /**
2116
- * A build's `val.modules` registry, as the build emits it beside its client
2117
- * chunks: `{ "val-modules-<build>.js": code }`, served at `/_app/` with
2118
- * them, its npm imports pointing at the site's vendor chunks on its own
2119
- * origin (`/_vendor/`, `/_pvendor/<rev>/`) as the client bundle's do.
2120
- *
2121
- * What a Studio opened on an older build imports, once the server's
2122
- * manifest names it (`registry`, from the build's name the platform hands
2123
- * the server: `VAL_BUILD`), to take this build's schemas in WITHOUT
2124
- * reloading the page: `HostStore.reloadCode` in `@valbuild/ui`, and phase 9
2125
- * of `docs/plans/one-content-model.md` in valbuild/val.
2126
- *
2127
- * Empty -- and the build goes on -- for a project with no `val.modules.ts`,
2128
- * or one whose Val modules cannot be bundled for the browser (a `.val.ts`
2129
- * importing something server-only): such a build has no entry, and a Studio
2130
- * that cannot import one reloads the page instead, as it did before. Said
2131
- * in the build's warnings.
2158
+ * For each module file (`*.val.ts` / `*.val.js`) the graph reaches, every
2159
+ * project file it depends on, transitively, sorted: what tells Val's server
2160
+ * at a proposal's address that a module whose own file is not staged is of
2161
+ * code the build was not made of, through a file it imports
2162
+ * (`moduleDependencies`, `stagedAfterBuild` in `@valbuild/server`). From the
2163
+ * imports as this bundle resolved them -- relative, tsconfig aliases,
2164
+ * whatever resolved -- so it cannot disagree with what the build evaluated.
2165
+ * An entry's `.val.json` is left out: it is content, and a record of 10,000
2166
+ * entries would make the map that long.
2132
2167
  */
2133
2168
  function _bundleValModules() {
2134
2169
  _bundleValModules = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee(input) {
2135
2170
  var _input$entry;
2136
- var files, target, origin, entry, warnings, aliases, base, project, resolveProjectPath, _yield$loadRolldown, build, result, chunks, _t;
2171
+ var files, target, origin, entry, warnings, aliases, base, project, entryPath, resolveProjectPath, imports, _yield$loadRolldown, build, result, resolveOne, chunks, _t;
2137
2172
  return regeneratorValues._regenerator().w(function (_context) {
2138
2173
  while (1) switch (_context.p = _context.n) {
2139
2174
  case 0:
2175
+ resolveOne = function _resolveOne(source, importer) {
2176
+ if (source.startsWith(".")) {
2177
+ return resolveProjectPath(resolve(dirname(importer !== null && importer !== void 0 ? importer : entryPath), source));
2178
+ }
2179
+ if (source in files) return source;
2180
+ var baseChunk = target.base.modules[source];
2181
+ if (baseChunk) {
2182
+ return {
2183
+ id: "".concat(base).concat(baseChunk, ".js"),
2184
+ external: true
2185
+ };
2186
+ }
2187
+ var projectChunk = target.project.modules[source];
2188
+ if (projectChunk && project !== null) {
2189
+ if (target.project.workerOnly.includes(source)) {
2190
+ throw new Error("'".concat(source, "' is server-only in this project's vendor layer, so a .val.ts importing it cannot be read in the browser."));
2191
+ }
2192
+ return {
2193
+ id: "".concat(project).concat(projectChunk, ".js"),
2194
+ external: true
2195
+ };
2196
+ }
2197
+ if (aliases) {
2198
+ var _iterator4 = regeneratorValues._createForOfIteratorHelper(aliases.candidates(source)),
2199
+ _step4;
2200
+ try {
2201
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
2202
+ var candidate = _step4.value;
2203
+ var _hit = resolveProjectPath(candidate);
2204
+ if (_hit) return _hit;
2205
+ }
2206
+ } catch (err) {
2207
+ _iterator4.e(err);
2208
+ } finally {
2209
+ _iterator4.f();
2210
+ }
2211
+ var fromBaseUrl = aliases.baseUrlCandidate(source);
2212
+ var hit = fromBaseUrl && resolveProjectPath(fromBaseUrl);
2213
+ if (hit) return hit;
2214
+ }
2215
+ // An error, not a warning: rolldown would otherwise leave the
2216
+ // specifier as it is, and it would fail when imported, unnamed.
2217
+ throw new Error("'".concat(source, "' is not an available dependency. Available: ").concat([].concat(regeneratorValues._toConsumableArray(Object.keys(target.base.modules)), regeneratorValues._toConsumableArray(Object.keys(target.project.modules))).join(", "), "."));
2218
+ };
2140
2219
  files = input.files, target = input.target, origin = input.origin;
2141
2220
  entry = (_input$entry = input.entry) !== null && _input$entry !== void 0 ? _input$entry : ["val.modules.ts", "val.modules.js"].find(function (path) {
2142
2221
  return path in files;
@@ -2153,9 +2232,12 @@ function _bundleValModules() {
2153
2232
  });
2154
2233
  base = "".concat(origin, "/_vendor/");
2155
2234
  project = target.project.rev === null ? null : "".concat(origin, "/_pvendor/").concat(target.project.rev, "/");
2235
+ entryPath = entry;
2156
2236
  resolveProjectPath = function resolveProjectPath(path) {
2157
2237
  return resolveInFiles(path, files);
2158
2238
  };
2239
+ /** Which project file imports which, as resolved: one edge per import. */
2240
+ imports = new Map();
2159
2241
  _context.n = 2;
2160
2242
  return loadRolldown();
2161
2243
  case 2:
@@ -2173,48 +2255,18 @@ function _bundleValModules() {
2173
2255
  plugins: [{
2174
2256
  name: "val:modules",
2175
2257
  resolveId: function resolveId(source, importer) {
2176
- if (source.startsWith(".")) {
2177
- return resolveProjectPath(resolve(dirname(importer !== null && importer !== void 0 ? importer : entry), source));
2178
- }
2179
- if (source in files) return source;
2180
- var baseChunk = target.base.modules[source];
2181
- if (baseChunk) {
2182
- return {
2183
- id: "".concat(base).concat(baseChunk, ".js"),
2184
- external: true
2185
- };
2186
- }
2187
- var projectChunk = target.project.modules[source];
2188
- if (projectChunk && project !== null) {
2189
- if (target.project.workerOnly.includes(source)) {
2190
- throw new Error("'".concat(source, "' is server-only in this project's vendor layer, so a .val.ts importing it cannot be read in the browser."));
2191
- }
2192
- return {
2193
- id: "".concat(project).concat(projectChunk, ".js"),
2194
- external: true
2195
- };
2196
- }
2197
- if (aliases) {
2198
- var _iterator = regeneratorValues._createForOfIteratorHelper(aliases.candidates(source)),
2199
- _step;
2200
- try {
2201
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
2202
- var candidate = _step.value;
2203
- var _hit = resolveProjectPath(candidate);
2204
- if (_hit) return _hit;
2205
- }
2206
- } catch (err) {
2207
- _iterator.e(err);
2208
- } finally {
2209
- _iterator.f();
2258
+ var resolved = resolveOne(source, importer);
2259
+ // A project file importing a project file: an edge of the graph
2260
+ // the dependencies are read from.
2261
+ if (importer !== undefined && importer in files && typeof resolved === "string" && resolved in files) {
2262
+ var from = imports.get(importer);
2263
+ if (from === undefined) {
2264
+ from = new Set();
2265
+ imports.set(importer, from);
2210
2266
  }
2211
- var fromBaseUrl = aliases.baseUrlCandidate(source);
2212
- var hit = fromBaseUrl && resolveProjectPath(fromBaseUrl);
2213
- if (hit) return hit;
2267
+ from.add(resolved);
2214
2268
  }
2215
- // An error, not a warning: rolldown would otherwise leave the
2216
- // specifier as it is, and it would fail when imported, unnamed.
2217
- throw new Error("'".concat(source, "' is not an available dependency. Available: ").concat([].concat(regeneratorValues._toConsumableArray(Object.keys(target.base.modules)), regeneratorValues._toConsumableArray(Object.keys(target.project.modules))).join(", "), "."));
2269
+ return resolved;
2218
2270
  },
2219
2271
  load: function load(id) {
2220
2272
  return id in files ? files[id] : null;
@@ -2256,19 +2308,98 @@ function _bundleValModules() {
2256
2308
  throw new Error("Bundling the Val modules made ".concat(chunks.length, " chunks rather than one."));
2257
2309
  case 7:
2258
2310
  return _context.a(2, {
2259
- code: chunks[0].code
2311
+ code: chunks[0].code,
2312
+ dependencies: moduleDependenciesOf(imports)
2260
2313
  });
2261
2314
  }
2262
2315
  }, _callee, null, [[3, 5]]);
2263
2316
  }));
2264
2317
  return _bundleValModules.apply(this, arguments);
2265
2318
  }
2319
+ function moduleDependenciesOf(imports) {
2320
+ var dependencies = {};
2321
+ var isModule = function isModule(path) {
2322
+ return /\.val\.(ts|js)$/.test(path);
2323
+ };
2324
+ var isEntry = function isEntry(path) {
2325
+ return path.endsWith(".val.json");
2326
+ };
2327
+ var modules = new Set();
2328
+ var _iterator = regeneratorValues._createForOfIteratorHelper(imports),
2329
+ _step;
2330
+ try {
2331
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
2332
+ var _step$value = regeneratorValues._slicedToArray(_step.value, 2),
2333
+ from = _step$value[0],
2334
+ to = _step$value[1];
2335
+ if (isModule(from)) modules.add(from);
2336
+ var _iterator3 = regeneratorValues._createForOfIteratorHelper(to),
2337
+ _step3;
2338
+ try {
2339
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
2340
+ var path = _step3.value;
2341
+ if (isModule(path)) modules.add(path);
2342
+ }
2343
+ } catch (err) {
2344
+ _iterator3.e(err);
2345
+ } finally {
2346
+ _iterator3.f();
2347
+ }
2348
+ }
2349
+ } catch (err) {
2350
+ _iterator.e(err);
2351
+ } finally {
2352
+ _iterator.f();
2353
+ }
2354
+ var _iterator2 = regeneratorValues._createForOfIteratorHelper(regeneratorValues._toConsumableArray(modules).sort()),
2355
+ _step2;
2356
+ try {
2357
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2358
+ var _imports$get;
2359
+ var module = _step2.value;
2360
+ var seen = new Set();
2361
+ var queue = regeneratorValues._toConsumableArray((_imports$get = imports.get(module)) !== null && _imports$get !== void 0 ? _imports$get : []);
2362
+ while (queue.length > 0) {
2363
+ var _imports$get2;
2364
+ var next = queue.pop();
2365
+ if (next === module || seen.has(next) || isEntry(next)) continue;
2366
+ seen.add(next);
2367
+ queue.push.apply(queue, regeneratorValues._toConsumableArray((_imports$get2 = imports.get(next)) !== null && _imports$get2 !== void 0 ? _imports$get2 : []));
2368
+ }
2369
+ dependencies[module] = regeneratorValues._toConsumableArray(seen).sort();
2370
+ }
2371
+ } catch (err) {
2372
+ _iterator2.e(err);
2373
+ } finally {
2374
+ _iterator2.f();
2375
+ }
2376
+ return dependencies;
2377
+ }
2378
+
2379
+ /**
2380
+ * A build's `val.modules` registry, as the build emits it beside its client
2381
+ * chunks: `{ "val-modules-<build>.js": code }`, served at `/_app/` with
2382
+ * them, its npm imports pointing at the site's vendor chunks on its own
2383
+ * origin (`/_vendor/`, `/_pvendor/<rev>/`) as the client bundle's do.
2384
+ *
2385
+ * What a Studio opened on an older build imports, once the server's
2386
+ * manifest names it (`registry`, from the build's name the platform hands
2387
+ * the server: `VAL_BUILD`), to take this build's schemas in WITHOUT
2388
+ * reloading the page: `HostStore.reloadCode` in `@valbuild/ui`, and phase 9
2389
+ * of `docs/plans/one-content-model.md` in valbuild/val.
2390
+ *
2391
+ * Empty -- and the build goes on -- for a project with no `val.modules.ts`,
2392
+ * or one whose Val modules cannot be bundled for the browser (a `.val.ts`
2393
+ * importing something server-only): such a build has no entry, and a Studio
2394
+ * that cannot import one reloads the page instead, as it did before. Said
2395
+ * in the build's warnings.
2396
+ */
2266
2397
  function valModulesEntry(_x2, _x3, _x4) {
2267
2398
  return _valModulesEntry.apply(this, arguments);
2268
2399
  }
2269
2400
  function _valModulesEntry() {
2270
2401
  _valModulesEntry = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee2(input, build, warnings) {
2271
- var entry, _yield$bundleValModul, code, _t2;
2402
+ var entry, _yield$bundleValModul, code, dependencies, _t2;
2272
2403
  return regeneratorValues._regenerator().w(function (_context2) {
2273
2404
  while (1) switch (_context2.p = _context2.n) {
2274
2405
  case 0:
@@ -2279,7 +2410,10 @@ function _valModulesEntry() {
2279
2410
  _context2.n = 1;
2280
2411
  break;
2281
2412
  }
2282
- return _context2.a(2, {});
2413
+ return _context2.a(2, {
2414
+ files: {},
2415
+ dependencies: null
2416
+ });
2283
2417
  case 1:
2284
2418
  _context2.p = 1;
2285
2419
  _context2.n = 2;
@@ -2294,12 +2428,19 @@ function _valModulesEntry() {
2294
2428
  case 2:
2295
2429
  _yield$bundleValModul = _context2.v;
2296
2430
  code = _yield$bundleValModul.code;
2297
- return _context2.a(2, regeneratorValues._defineProperty({}, projectPaths.valModulesEntryFile(build), code));
2431
+ dependencies = _yield$bundleValModul.dependencies;
2432
+ return _context2.a(2, {
2433
+ files: regeneratorValues._defineProperty({}, projectPaths.valModulesEntryFile(build), code),
2434
+ dependencies: dependencies
2435
+ });
2298
2436
  case 3:
2299
2437
  _context2.p = 3;
2300
2438
  _t2 = _context2.v;
2301
2439
  warnings.push("The Val modules were not emitted for the Studio, so an open Studio reloads the page to take this build's code: ".concat(_t2 instanceof Error ? _t2.message : String(_t2)));
2302
- return _context2.a(2, {});
2440
+ return _context2.a(2, {
2441
+ files: {},
2442
+ dependencies: null
2443
+ });
2303
2444
  }
2304
2445
  }, _callee2, null, [[1, 3]]);
2305
2446
  }));
@@ -3708,6 +3849,11 @@ var CSS_URL_ID = "\0platform:css-url";
3708
3849
  * would be both a leak and, for a real app, enormous.
3709
3850
  */
3710
3851
  var PROJECT_SOURCE = "platform:project-source";
3852
+ /**
3853
+ * The global the server build defines as each Val module's project
3854
+ * dependencies (`valModulesEntry`), read by the generated `val.server.ts`.
3855
+ */
3856
+ var MODULE_DEPENDENCIES_GLOBAL = "globalThis.__VAL_MODULE_DEPENDENCIES__";
3711
3857
  var PROJECT_SOURCE_ID = "\0platform:project-source";
3712
3858
  var PUBLIC_PREFIX = "PUBLIC_";
3713
3859
  var VALID_KEY = /^[A-Za-z_][A-Za-z0-9_]*$/;
@@ -4041,19 +4187,40 @@ function projectPlugin(files, projectSource, splitter, cssModules, aliases, asse
4041
4187
  }
4042
4188
 
4043
4189
  /**
4044
- * Build-time env substitution.
4190
+ * What `import.meta.env` is in a build: Vite's built-ins, inlined, and the
4191
+ * project's `PUBLIC_` variables, read at RUNTIME.
4192
+ *
4193
+ * Runtime because a hosted project's variables are set in Val Build, and a
4194
+ * build is made in an editor's browser tab: inlined, a value would sit in that
4195
+ * tab, and changing one would wait for somebody to build before it went live.
4196
+ * So `import.meta.env` is an identifier, and `inject` makes each module that
4197
+ * reads it import {@link RUNTIME_ENV_SPECIFIER} -- a real import, so it is
4198
+ * evaluated before any split chunk that reads it, top level included. That
4199
+ * module ({@link runtimeEnvSource}) reads the variables once:
4045
4200
  *
4046
- * Values are inlined as literals rather than read at runtime, which is why they
4047
- * cost nothing to use and why changing one produces a new build hash: the
4048
- * output genuinely differs.
4201
+ * - in the browser, from the `<head>` script the platform's loader writes
4202
+ * (`globalThis.__PLATFORM_PUBLIC_ENV`), which runs before any module does;
4203
+ * - on the server, from `process.env`, which the isolate's env fills before the
4204
+ * app's modules run.
4049
4205
  *
4050
- * Non-public keys resolve to `undefined` in the client bundle rather than being
4051
- * left alone. An untouched `import.meta.env.SECRET` would throw in the browser,
4052
- * and a silent `undefined` is both safer and easier to reason about.
4206
+ * Only `PUBLIC_` names, on both sides, as in Vite: a secret is
4207
+ * `process.env.NAME` on the server and nothing at all in the browser. The
4208
+ * platform refuses a secret by a `PUBLIC_` name, so nothing read here was ever
4209
+ * a secret.
4210
+ *
4211
+ * `env`, when a caller passes it, is still inlined as literals and wins -- the
4212
+ * CLI's `--env`, and every build from before this. Non-public keys of it
4213
+ * resolve to `undefined` in the client bundle rather than being left alone.
4053
4214
  */
4054
- function defineFor(env, target, warnings) {
4215
+ function envFor(env, target, warnings) {
4055
4216
  var define = {};
4056
- var visible = {};
4217
+ /**
4218
+ * What the `import.meta.env` OBJECT holds of `env`: the PUBLIC_ names, on
4219
+ * both sides, as Vite's does. A server-only name is still a literal where it
4220
+ * is read by name (above), and nowhere else -- in the object it would be in
4221
+ * the server bundle whether anything read it or not.
4222
+ */
4223
+ var inObject = {};
4057
4224
  for (var _i = 0, _Object$entries = Object.entries(env); _i < _Object$entries.length; _i++) {
4058
4225
  var _Object$entries$_i = regeneratorValues._slicedToArray(_Object$entries[_i], 2),
4059
4226
  key = _Object$entries$_i[0],
@@ -4066,7 +4233,7 @@ function defineFor(env, target, warnings) {
4066
4233
  var literal = exposed ? JSON.stringify(value) : "undefined";
4067
4234
  define["import.meta.env.".concat(key)] = literal;
4068
4235
  define["process.env.".concat(key)] = literal;
4069
- if (exposed) visible[key] = value;
4236
+ if (key.startsWith(PUBLIC_PREFIX)) inObject[key] = value;
4070
4237
  }
4071
4238
 
4072
4239
  // Vite's built-ins, and they win over a project env var of the same name as
@@ -4093,25 +4260,64 @@ function defineFor(env, target, warnings) {
4093
4260
  // "development" -- so a published site's code was told it was in dev.
4094
4261
  define["process.env.NODE_ENV"] = JSON.stringify("production");
4095
4262
 
4096
- // Always defined, even when empty: it makes `import.meta.env` destructuring
4097
- // work and stops a bare reference from throwing. Specific keys above take
4098
- // precedence over this object.
4099
- define["import.meta.env"] = JSON.stringify(regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, visible), builtins));
4100
- return define;
4263
+ // Always defined: it makes `import.meta.env` destructuring work and stops a
4264
+ // bare reference from throwing. Specific keys above take precedence.
4265
+ define["import.meta.env"] = RUNTIME_ENV;
4266
+ // In the browser `process` does not exist, so an untouched
4267
+ // `process.env.PUBLIC_X` threw there. Read as the same object instead.
4268
+ if (target === "client") define["process.env"] = RUNTIME_ENV;
4269
+ return {
4270
+ define: define,
4271
+ runtime: runtimeEnvSource(target, regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, inObject), builtins))
4272
+ };
4273
+ }
4274
+
4275
+ /**
4276
+ * The identifier `import.meta.env` becomes, and the module `inject` imports
4277
+ * for it. The specifier is resolved by {@link runtimeEnvPlugin} and nothing
4278
+ * else, and a project cannot name it: `platform:` is not a package.
4279
+ */
4280
+ var RUNTIME_ENV = "__PLATFORM_RUNTIME_ENV__";
4281
+ var RUNTIME_ENV_SPECIFIER = "platform:runtime-env";
4282
+ var RUNTIME_ENV_ID = "\0platform:runtime-env";
4283
+
4284
+ /**
4285
+ * The module {@link RUNTIME_ENV} imports. `fixed` -- the built-ins, and any
4286
+ * `env` the caller inlined -- wins over a runtime value of the same name.
4287
+ *
4288
+ * `globalThis.process?.env` rather than `process.env`: a server bundle that
4289
+ * runs where there is no `process` reads no variables instead of throwing.
4290
+ */
4291
+ function runtimeEnvSource(target, fixed) {
4292
+ var read = target === "client" ? "globalThis.__PLATFORM_PUBLIC_ENV" : "globalThis.process?.env";
4293
+ return "const source = ".concat(read, " ?? {};\n") + "const runtime = {};\n" + "for (const name of Object.keys(source)) {\n" + " if (name.startsWith(".concat(JSON.stringify(PUBLIC_PREFIX), ")) runtime[name] = source[name];\n") + "}\n" + "export default Object.freeze(Object.assign(runtime, ".concat(JSON.stringify(fixed, null, 2), "));\n");
4294
+ }
4295
+ function runtimeEnvPlugin(source) {
4296
+ return {
4297
+ name: "platform:runtime-env",
4298
+ resolveId: function resolveId(id) {
4299
+ return id === RUNTIME_ENV_SPECIFIER ? RUNTIME_ENV_ID : null;
4300
+ },
4301
+ load: function load(id) {
4302
+ return id === RUNTIME_ENV_ID ? source : null;
4303
+ }
4304
+ };
4101
4305
  }
4102
4306
  function buildOnce(_x, _x2, _x3, _x4, _x5) {
4103
4307
  return _buildOnce.apply(this, arguments);
4104
4308
  }
4105
4309
  function _buildOnce() {
4106
4310
  _buildOnce = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee2(input, vendorBase, projectVendorBase, target, warnings) {
4107
- var _input$projectSource, _input$assets, _input$env;
4311
+ var _input$env, _input$projectSource, _input$assets;
4108
4312
  var clientModules,
4109
4313
  isRsc,
4110
4314
  assetUrls,
4111
4315
  cssModules,
4112
4316
  aliases,
4317
+ moduleDependencies,
4113
4318
  vendor,
4114
4319
  projectVendor,
4320
+ env,
4115
4321
  _yield$loadRolldown,
4116
4322
  build,
4117
4323
  result,
@@ -4130,6 +4336,7 @@ function _buildOnce() {
4130
4336
  assetUrls = _args2.length > 7 && _args2[7] !== undefined ? _args2[7] : new Map();
4131
4337
  cssModules = _args2.length > 8 && _args2[8] !== undefined ? _args2[8] : {};
4132
4338
  aliases = _args2.length > 9 && _args2[9] !== undefined ? _args2[9] : null;
4339
+ moduleDependencies = _args2.length > 10 && _args2[10] !== undefined ? _args2[10] : null;
4133
4340
  vendor = vendorRules(input.target);
4134
4341
  /*
4135
4342
  * The project's own layer, in the shape the plugin already reads.
@@ -4143,7 +4350,8 @@ function _buildOnce() {
4143
4350
  modules: input.target.project.modules,
4144
4351
  css: input.target.project.css,
4145
4352
  workerOnly: input.target.project.workerOnly
4146
- }; // The RSC pass is a server build in every respect the transforms care about:
4353
+ };
4354
+ env = envFor((_input$env = input.env) !== null && _input$env !== void 0 ? _input$env : {}, target, warnings); // The RSC pass is a server build in every respect the transforms care about:
4147
4355
  // it runs on the server, so server-only code stays and client-only code goes.
4148
4356
  // Only the vendor layer differs.
4149
4357
  _context2.n = 1;
@@ -4166,7 +4374,7 @@ function _buildOnce() {
4166
4374
  moduleTypes: {
4167
4375
  ".css": "empty"
4168
4376
  },
4169
- plugins: [projectPlugin(input.files, (_input$projectSource = input.projectSource) !== null && _input$projectSource !== void 0 ? _input$projectSource : input.files, input.routeSplitter, cssModules, aliases, (_input$assets = input.assets) !== null && _input$assets !== void 0 ? _input$assets : {}, assetUrls, vendorBase, projectVendorBase, projectVendor, vendor, warnings, target, new Set(), clientModules, isRsc)],
4377
+ plugins: [runtimeEnvPlugin(env.runtime), projectPlugin(input.files, (_input$projectSource = input.projectSource) !== null && _input$projectSource !== void 0 ? _input$projectSource : input.files, input.routeSplitter, cssModules, aliases, (_input$assets = input.assets) !== null && _input$assets !== void 0 ? _input$assets : {}, assetUrls, vendorBase, projectVendorBase, projectVendor, vendor, warnings, target, new Set(), clientModules, isRsc)],
4170
4378
  // oxc handles TS and JSX natively, so there is no separate transform pass
4171
4379
  // and no type-checking on the publish path. Types are the editor's job.
4172
4380
  transform: {
@@ -4174,7 +4382,8 @@ function _buildOnce() {
4174
4382
  runtime: "automatic",
4175
4383
  importSource: "react"
4176
4384
  },
4177
- define: defineFor((_input$env = input.env) !== null && _input$env !== void 0 ? _input$env : {}, target, warnings)
4385
+ define: regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, env.define), target === "server" && moduleDependencies !== null ? regeneratorValues._defineProperty({}, MODULE_DEPENDENCIES_GLOBAL, JSON.stringify(moduleDependencies)) : {}),
4386
+ inject: regeneratorValues._defineProperty({}, RUNTIME_ENV, RUNTIME_ENV_SPECIFIER)
4178
4387
  },
4179
4388
  output: {
4180
4389
  format: "esm",
@@ -4250,7 +4459,7 @@ function buildUserApp(_x6) {
4250
4459
  function _buildUserApp() {
4251
4460
  _buildUserApp = regeneratorValues._asyncToGenerator(/*#__PURE__*/regeneratorValues._regenerator().m(function _callee3(input) {
4252
4461
  var _input$target$project;
4253
- var warnings, started, rev, clientModules, assetUrls, assetFiles, _i3, _Object$entries3, _input$assets2, _Object$entries3$_i, path, base64, resolved, aliases, css, styles, tailwindMs, compiled, serverStarted, serverBuild, server, clientStarted, clientBuild, client, hash, registryEntry, rscBuild, publicFiles, _i4, _Object$entries4, _input$publicFiles, _Object$entries4$_i, _path, _base, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16;
4462
+ var warnings, started, rev, clientModules, assetUrls, assetFiles, _i3, _Object$entries3, _input$assets2, _Object$entries3$_i, path, base64, resolved, aliases, css, styles, tailwindMs, compiled, hash, registryEntry, serverStarted, serverBuild, server, clientStarted, clientBuild, client, rscBuild, publicFiles, _i4, _Object$entries4, _input$publicFiles, _Object$entries4$_i, _path, _base, _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16;
4254
4463
  return regeneratorValues._regenerator().w(function (_context3) {
4255
4464
  while (1) switch (_context3.n) {
4256
4465
  case 0:
@@ -4339,33 +4548,28 @@ function _buildUserApp() {
4339
4548
  tailwindMs = compiled.ms;
4340
4549
  warnings.push.apply(warnings, regeneratorValues._toConsumableArray(compiled.warnings));
4341
4550
  case 10:
4342
- serverStarted = performance.now();
4343
4551
  _context3.n = 11;
4344
- return buildOnce(input, "./vendor/", "./pvendor/", "server", warnings, clientModules, false, assetUrls, css.modules, aliases);
4552
+ return buildInputId(input);
4345
4553
  case 11:
4346
- serverBuild = _context3.v;
4347
- server = performance.now() - serverStarted;
4348
- clientStarted = performance.now();
4554
+ hash = _context3.v;
4349
4555
  _context3.n = 12;
4350
- return buildOnce(input, "/_vendor/", "/_pvendor/".concat(rev, "/"), "client", warnings, clientModules, false, assetUrls, css.modules, aliases);
4556
+ return valModulesEntry(input, hash, warnings);
4351
4557
  case 12:
4352
- clientBuild = _context3.v;
4353
- client = performance.now() - clientStarted;
4354
- /*
4355
- * The build's `val.modules` registry, as an ES module of its own beside
4356
- * the client chunks and named after the build: what a Studio opened on an
4357
- * older build imports to take this one's code in, rather than reloading
4358
- * the page (`valModulesEntry`). The build's name is a hash of its inputs,
4359
- * so it is known before anything is emitted.
4360
- */
4558
+ registryEntry = _context3.v;
4559
+ serverStarted = performance.now();
4361
4560
  _context3.n = 13;
4362
- return buildInputId(input);
4561
+ return buildOnce(input, "./vendor/", "./pvendor/", "server", warnings, clientModules, false, assetUrls, css.modules, aliases, registryEntry.dependencies);
4363
4562
  case 13:
4364
- hash = _context3.v;
4563
+ serverBuild = _context3.v;
4564
+ server = performance.now() - serverStarted;
4565
+ clientStarted = performance.now();
4365
4566
  _context3.n = 14;
4366
- return valModulesEntry(input, hash, warnings);
4567
+ return buildOnce(input, "/_vendor/", "/_pvendor/".concat(rev, "/"), "client", warnings, clientModules, false, assetUrls, css.modules, aliases);
4367
4568
  case 14:
4368
- registryEntry = _context3.v;
4569
+ clientBuild = _context3.v;
4570
+ client = performance.now() - clientStarted; // Paths are relative to `rsc/app.js`, one directory down, so both layers are
4571
+ // addressed with a leading `../`. Getting this wrong does not fail the build;
4572
+ // the cold isolate simply refuses to boot.
4369
4573
  if (!input.rsc) {
4370
4574
  _context3.n = 16;
4371
4575
  break;
@@ -4377,7 +4581,7 @@ function _buildUserApp() {
4377
4581
  // there is exactly one layer and the key is `pvendor/<name>.js`, so a
4378
4582
  // revision here is a path segment that does not exist -- and the cold
4379
4583
  // isolate is where you would find that out.
4380
- input, "../vendor-rsc/", "../pvendor/", "server", warnings, clientModules, true, assetUrls, css.modules, aliases);
4584
+ input, "../vendor-rsc/", "../pvendor/", "server", warnings, clientModules, true, assetUrls, css.modules, aliases, registryEntry.dependencies);
4381
4585
  case 15:
4382
4586
  _t2 = _context3.v;
4383
4587
  _context3.n = 17;
@@ -4397,7 +4601,7 @@ function _buildUserApp() {
4397
4601
  _t3 = serverBuild.code;
4398
4602
  _t4 = clientBuild.code;
4399
4603
  _t5 = serverBuild.chunks;
4400
- _t6 = regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, clientBuild.chunks), registryEntry);
4604
+ _t6 = regeneratorValues._objectSpread2(regeneratorValues._objectSpread2({}, clientBuild.chunks), registryEntry.files);
4401
4605
  _t7 = assetFiles;
4402
4606
  _t8 = publicFiles;
4403
4607
  _t9 = styles;
@@ -4879,6 +5083,7 @@ exports.TREE = projectPaths.TREE;
4879
5083
  exports.ARTIFACT_KEYS = artifactKeys.ARTIFACT_KEYS;
4880
5084
  exports.ARTIFACT_PREFIXES = artifactKeys.ARTIFACT_PREFIXES;
4881
5085
  exports.ENTRY_CHUNK = ENTRY_CHUNK;
5086
+ exports.MODULE_DEPENDENCIES_GLOBAL = MODULE_DEPENDENCIES_GLOBAL;
4882
5087
  exports.PROJECT_SOURCE = PROJECT_SOURCE;
4883
5088
  exports.PUBLIC_PREFIX = PUBLIC_PREFIX;
4884
5089
  exports.VAL_SERVER_PATH = VAL_SERVER_PATH;