@webflow/cloud-app 0.1.0-beta.10

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.
Files changed (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -0
  3. package/dist/bindings.d.ts +190 -0
  4. package/dist/bindings.d.ts.map +1 -0
  5. package/dist/bindings.js +126 -0
  6. package/dist/bindings.js.map +1 -0
  7. package/dist/compat-date.d.ts +68 -0
  8. package/dist/compat-date.d.ts.map +1 -0
  9. package/dist/compat-date.js +169 -0
  10. package/dist/compat-date.js.map +1 -0
  11. package/dist/config/package-json.d.ts +57 -0
  12. package/dist/config/package-json.d.ts.map +1 -0
  13. package/dist/config/package-json.js +94 -0
  14. package/dist/config/package-json.js.map +1 -0
  15. package/dist/config/webflow-json.d.ts +47 -0
  16. package/dist/config/webflow-json.d.ts.map +1 -0
  17. package/dist/config/webflow-json.js +72 -0
  18. package/dist/config/webflow-json.js.map +1 -0
  19. package/dist/create-webflow-json.d.ts +21 -0
  20. package/dist/create-webflow-json.d.ts.map +1 -0
  21. package/dist/create-webflow-json.js +168 -0
  22. package/dist/create-webflow-json.js.map +1 -0
  23. package/dist/diagnostics.d.ts +23 -0
  24. package/dist/diagnostics.d.ts.map +1 -0
  25. package/dist/diagnostics.js +31 -0
  26. package/dist/diagnostics.js.map +1 -0
  27. package/dist/errors.d.ts +13 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +23 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.d.ts +28 -0
  32. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.d.ts.map +1 -0
  33. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.js +148 -0
  34. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.js.map +1 -0
  35. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.d.ts +34 -0
  36. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.d.ts.map +1 -0
  37. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.js +89 -0
  38. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.js.map +1 -0
  39. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.d.ts +39 -0
  40. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.d.ts.map +1 -0
  41. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.js +93 -0
  42. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.js.map +1 -0
  43. package/dist/frameworks/astro/astro5.d.ts +28 -0
  44. package/dist/frameworks/astro/astro5.d.ts.map +1 -0
  45. package/dist/frameworks/astro/astro5.js +276 -0
  46. package/dist/frameworks/astro/astro5.js.map +1 -0
  47. package/dist/frameworks/astro/astro6.d.ts +28 -0
  48. package/dist/frameworks/astro/astro6.d.ts.map +1 -0
  49. package/dist/frameworks/astro/astro6.js +305 -0
  50. package/dist/frameworks/astro/astro6.js.map +1 -0
  51. package/dist/frameworks/astro/astro7.d.ts +28 -0
  52. package/dist/frameworks/astro/astro7.d.ts.map +1 -0
  53. package/dist/frameworks/astro/astro7.js +303 -0
  54. package/dist/frameworks/astro/astro7.js.map +1 -0
  55. package/dist/frameworks/astro/index.d.ts +10 -0
  56. package/dist/frameworks/astro/index.d.ts.map +1 -0
  57. package/dist/frameworks/astro/index.js +16 -0
  58. package/dist/frameworks/astro/index.js.map +1 -0
  59. package/dist/frameworks/astro/session-check.d.ts +24 -0
  60. package/dist/frameworks/astro/session-check.d.ts.map +1 -0
  61. package/dist/frameworks/astro/session-check.js +166 -0
  62. package/dist/frameworks/astro/session-check.js.map +1 -0
  63. package/dist/frameworks/astro/templates/astro.config.webflow.ts +61 -0
  64. package/dist/frameworks/astro/templates/v5/astro.config.mjs.template +25 -0
  65. package/dist/frameworks/astro/templates/v5/webflow-loader.ts +126 -0
  66. package/dist/frameworks/astro/templates/v5/wrangler.json +6 -0
  67. package/dist/frameworks/astro/templates/v6/astro.config.mjs.template +35 -0
  68. package/dist/frameworks/astro/templates/v6/webflow-loader.ts +126 -0
  69. package/dist/frameworks/astro/templates/v6/wrangler.json +9 -0
  70. package/dist/frameworks/astro/templates/v7/astro.config.mjs.template +34 -0
  71. package/dist/frameworks/astro/templates/v7/webflow-loader.ts +125 -0
  72. package/dist/frameworks/astro/templates/v7/wrangler.json +9 -0
  73. package/dist/frameworks/astro/templates/webflow-image-url.ts +140 -0
  74. package/dist/frameworks/base.d.ts +134 -0
  75. package/dist/frameworks/base.d.ts.map +1 -0
  76. package/dist/frameworks/base.js +175 -0
  77. package/dist/frameworks/base.js.map +1 -0
  78. package/dist/frameworks/errors.d.ts +72 -0
  79. package/dist/frameworks/errors.d.ts.map +1 -0
  80. package/dist/frameworks/errors.js +120 -0
  81. package/dist/frameworks/errors.js.map +1 -0
  82. package/dist/frameworks/nextjs/adapter-resolver.d.ts +72 -0
  83. package/dist/frameworks/nextjs/adapter-resolver.d.ts.map +1 -0
  84. package/dist/frameworks/nextjs/adapter-resolver.js +246 -0
  85. package/dist/frameworks/nextjs/adapter-resolver.js.map +1 -0
  86. package/dist/frameworks/nextjs/index.d.ts +38 -0
  87. package/dist/frameworks/nextjs/index.d.ts.map +1 -0
  88. package/dist/frameworks/nextjs/index.js +268 -0
  89. package/dist/frameworks/nextjs/index.js.map +1 -0
  90. package/dist/frameworks/nextjs/templates/next.config.ts.template +13 -0
  91. package/dist/frameworks/nextjs/templates/next.config.webflow.ts +46 -0
  92. package/dist/frameworks/nextjs/templates/open-next.config.ts +3 -0
  93. package/dist/frameworks/nextjs/templates/webflow-loader.ts +44 -0
  94. package/dist/frameworks/nextjs/templates/wrangler.json +6 -0
  95. package/dist/frameworks/registry.d.ts +127 -0
  96. package/dist/frameworks/registry.d.ts.map +1 -0
  97. package/dist/frameworks/registry.js +257 -0
  98. package/dist/frameworks/registry.js.map +1 -0
  99. package/dist/frameworks/static/index.d.ts +116 -0
  100. package/dist/frameworks/static/index.d.ts.map +1 -0
  101. package/dist/frameworks/static/index.js +394 -0
  102. package/dist/frameworks/static/index.js.map +1 -0
  103. package/dist/frameworks/static/templates/wrangler.json +8 -0
  104. package/dist/frameworks/types.d.ts +138 -0
  105. package/dist/frameworks/types.d.ts.map +1 -0
  106. package/dist/frameworks/types.js +3 -0
  107. package/dist/frameworks/types.js.map +1 -0
  108. package/dist/frameworks/vite/index.d.ts +46 -0
  109. package/dist/frameworks/vite/index.d.ts.map +1 -0
  110. package/dist/frameworks/vite/index.js +303 -0
  111. package/dist/frameworks/vite/index.js.map +1 -0
  112. package/dist/frameworks/vite/templates/vite.config.ts.template +14 -0
  113. package/dist/frameworks/vite/templates/vite.config.webflow.ts +52 -0
  114. package/dist/frameworks/vite/templates/wrangler.json +10 -0
  115. package/dist/index.d.ts +49 -0
  116. package/dist/index.d.ts.map +1 -0
  117. package/dist/index.js +136 -0
  118. package/dist/index.js.map +1 -0
  119. package/dist/pipeline.d.ts +12 -0
  120. package/dist/pipeline.d.ts.map +1 -0
  121. package/dist/pipeline.js +293 -0
  122. package/dist/pipeline.js.map +1 -0
  123. package/dist/ports/command-runner.d.ts +59 -0
  124. package/dist/ports/command-runner.d.ts.map +1 -0
  125. package/dist/ports/command-runner.js +126 -0
  126. package/dist/ports/command-runner.js.map +1 -0
  127. package/dist/ports/filesystem.d.ts +19 -0
  128. package/dist/ports/filesystem.d.ts.map +1 -0
  129. package/dist/ports/filesystem.js +68 -0
  130. package/dist/ports/filesystem.js.map +1 -0
  131. package/dist/ports/index.d.ts +17 -0
  132. package/dist/ports/index.d.ts.map +1 -0
  133. package/dist/ports/index.js +14 -0
  134. package/dist/ports/index.js.map +1 -0
  135. package/dist/ports/logger.d.ts +22 -0
  136. package/dist/ports/logger.d.ts.map +1 -0
  137. package/dist/ports/logger.js +18 -0
  138. package/dist/ports/logger.js.map +1 -0
  139. package/dist/ports/telemetry.d.ts +23 -0
  140. package/dist/ports/telemetry.d.ts.map +1 -0
  141. package/dist/ports/telemetry.js +12 -0
  142. package/dist/ports/telemetry.js.map +1 -0
  143. package/dist/static-base-href.d.ts +31 -0
  144. package/dist/static-base-href.d.ts.map +1 -0
  145. package/dist/static-base-href.js +183 -0
  146. package/dist/static-base-href.js.map +1 -0
  147. package/dist/toolchain/errors.d.ts +32 -0
  148. package/dist/toolchain/errors.d.ts.map +1 -0
  149. package/dist/toolchain/errors.js +31 -0
  150. package/dist/toolchain/errors.js.map +1 -0
  151. package/dist/toolchain/resolver.d.ts +25 -0
  152. package/dist/toolchain/resolver.d.ts.map +1 -0
  153. package/dist/toolchain/resolver.js +200 -0
  154. package/dist/toolchain/resolver.js.map +1 -0
  155. package/dist/toolchain/types.d.ts +52 -0
  156. package/dist/toolchain/types.d.ts.map +1 -0
  157. package/dist/toolchain/types.js +10 -0
  158. package/dist/toolchain/types.js.map +1 -0
  159. package/dist/types.d.ts +71 -0
  160. package/dist/types.d.ts.map +1 -0
  161. package/dist/types.js +3 -0
  162. package/dist/types.js.map +1 -0
  163. package/dist/utils/fs.d.ts +29 -0
  164. package/dist/utils/fs.d.ts.map +1 -0
  165. package/dist/utils/fs.js +126 -0
  166. package/dist/utils/fs.js.map +1 -0
  167. package/dist/utils/index.d.ts +11 -0
  168. package/dist/utils/index.d.ts.map +1 -0
  169. package/dist/utils/index.js +27 -0
  170. package/dist/utils/index.js.map +1 -0
  171. package/dist/utils/node-version.d.ts +20 -0
  172. package/dist/utils/node-version.d.ts.map +1 -0
  173. package/dist/utils/node-version.js +113 -0
  174. package/dist/utils/node-version.js.map +1 -0
  175. package/dist/utils/process.d.ts +25 -0
  176. package/dist/utils/process.d.ts.map +1 -0
  177. package/dist/utils/process.js +40 -0
  178. package/dist/utils/process.js.map +1 -0
  179. package/dist/utils/reserved-env.d.ts +26 -0
  180. package/dist/utils/reserved-env.d.ts.map +1 -0
  181. package/dist/utils/reserved-env.js +51 -0
  182. package/dist/utils/reserved-env.js.map +1 -0
  183. package/dist/utils/template.d.ts +15 -0
  184. package/dist/utils/template.d.ts.map +1 -0
  185. package/dist/utils/template.js +75 -0
  186. package/dist/utils/template.js.map +1 -0
  187. package/dist/utils/version.d.ts +9 -0
  188. package/dist/utils/version.d.ts.map +1 -0
  189. package/dist/utils/version.js +52 -0
  190. package/dist/utils/version.js.map +1 -0
  191. package/dist/wrangler.d.ts +195 -0
  192. package/dist/wrangler.d.ts.map +1 -0
  193. package/dist/wrangler.js +372 -0
  194. package/dist/wrangler.js.map +1 -0
  195. package/package.json +48 -0
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Logger port.
3
+ *
4
+ * The engine never reaches for `console` directly — it logs through this
5
+ * interface so each host can route output its own way: cosmic-builder wraps its
6
+ * structured ECS logger (with secret redaction), the CLI wraps its oclif logger
7
+ * with spinners/colors, and headless/agent hosts can stay silent or capture.
8
+ *
9
+ * Intentionally the minimal four-level surface the build pipeline needs. Hosts
10
+ * with richer loggers adapt down to this; they lose nothing the engine relies on.
11
+ */
12
+ export interface Logger {
13
+ debug(message: string, ...args: unknown[]): void;
14
+ info(message: string, ...args: unknown[]): void;
15
+ warn(message: string, ...args: unknown[]): void;
16
+ error(message: string, ...args: unknown[]): void;
17
+ }
18
+ /** Default logger that writes to the console. Useful for the CLI and local runs. */
19
+ export declare const consoleLogger: Logger;
20
+ /** Logger that drops everything. Useful for tests and headless callers. */
21
+ export declare const silentLogger: Logger;
22
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/ports/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,MAAM;IACrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACjD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAClD;AAED,oFAAoF;AACpF,eAAO,MAAM,aAAa,EAAE,MAK3B,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,YAAY,EAAE,MAK1B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.silentLogger = exports.consoleLogger = void 0;
4
+ /** Default logger that writes to the console. Useful for the CLI and local runs. */
5
+ exports.consoleLogger = {
6
+ debug: (message, ...args) => console.debug(message, ...args),
7
+ info: (message, ...args) => console.info(message, ...args),
8
+ warn: (message, ...args) => console.warn(message, ...args),
9
+ error: (message, ...args) => console.error(message, ...args),
10
+ };
11
+ /** Logger that drops everything. Useful for tests and headless callers. */
12
+ exports.silentLogger = {
13
+ debug: () => { },
14
+ info: () => { },
15
+ warn: () => { },
16
+ error: () => { },
17
+ };
18
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/ports/logger.ts"],"names":[],"mappings":";;;AAkBA,oFAAoF;AACvE,QAAA,aAAa,GAAW;IACnC,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC5D,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC1D,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;IAC1D,KAAK,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC;CAC7D,CAAC;AAEF,2EAA2E;AAC9D,QAAA,YAAY,GAAW;IAClC,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;IACf,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;IACd,IAAI,EAAE,GAAG,EAAE,GAAE,CAAC;IACd,KAAK,EAAE,GAAG,EAAE,GAAE,CAAC;CAChB,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Telemetry port.
3
+ *
4
+ * The engine emits spans for the build phases (detect, install, build,
5
+ * dry-run) through this port. cosmic-builder wraps `dd-trace` so its existing
6
+ * Datadog dashboards keep working; the CLI and headless hosts pass the no-op.
7
+ * Keeping `dd-trace` out of the engine is what lets it stay public and
8
+ * dependency-light.
9
+ */
10
+ export type TagValue = string | number | boolean;
11
+ export interface Span {
12
+ /** Attach a tag to the span (e.g. `framework`, `deployment.type`). */
13
+ setTag(key: string, value: TagValue): void;
14
+ /** Finish the span. Pass an error to mark it failed. */
15
+ end(error?: unknown): void;
16
+ }
17
+ export interface Telemetry {
18
+ /** Start a span for a build phase. Tags may be supplied up front. */
19
+ startSpan(name: string, tags?: Record<string, TagValue>): Span;
20
+ }
21
+ /** Telemetry that records nothing. Default when a host injects none. */
22
+ export declare const noopTelemetry: Telemetry;
23
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/ports/telemetry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEjD,MAAM,WAAW,IAAI;IACnB,sEAAsE;IACtE,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3C,wDAAwD;IACxD,GAAG,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,qEAAqE;IACrE,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,CAAC;CAChE;AAOD,wEAAwE;AACxE,eAAO,MAAM,aAAa,EAAE,SAE3B,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.noopTelemetry = void 0;
4
+ const noopSpan = {
5
+ setTag: () => { },
6
+ end: () => { },
7
+ };
8
+ /** Telemetry that records nothing. Default when a host injects none. */
9
+ exports.noopTelemetry = {
10
+ startSpan: () => noopSpan,
11
+ };
12
+ //# sourceMappingURL=telemetry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/ports/telemetry.ts"],"names":[],"mappings":";;;AAuBA,MAAM,QAAQ,GAAS;IACrB,MAAM,EAAE,GAAG,EAAE,GAAE,CAAC;IAChB,GAAG,EAAE,GAAG,EAAE,GAAE,CAAC;CACd,CAAC;AAEF,wEAAwE;AAC3D,QAAA,aAAa,GAAc;IACtC,SAAS,EAAE,GAAG,EAAE,CAAC,QAAQ;CAC1B,CAAC"}
@@ -0,0 +1,31 @@
1
+ import type { Logger } from './ports/logger';
2
+ /**
3
+ * The `<base>` href for a static app served under `prefix` (the mount / asset
4
+ * path prefix) and an optional document sub-directory, or `null` for a root
5
+ * mount, where relative URLs already resolve correctly and no base is needed.
6
+ * Always a single leading + trailing slash so relative URLs resolve against
7
+ * that directory; each segment is percent-encoded so a space/unicode mount
8
+ * yields a valid URL matching the served (encoded) asset path.
9
+ */
10
+ export declare function staticBaseHref(prefix: string, subDir?: string): string | null;
11
+ /**
12
+ * Insert `<base href>` into one HTML document, ignoring any match inside an HTML
13
+ * comment. Returns the input unchanged when the document already declares a real
14
+ * `<base href>` (the author's wins) — a bare `<base target>`, a `<base-card>`
15
+ * custom element, or a commented-out `<base>` do not count. The tag goes
16
+ * immediately after the opening `<head>` so it precedes any URL-bearing element;
17
+ * a document with no `<head>`/`<html>` gets a minimal `<head>` wrapper after any
18
+ * leading doctype, so the base never precedes the doctype (quirks mode).
19
+ */
20
+ export declare function injectBaseHref(html: string, baseHref: string): string;
21
+ /**
22
+ * Inject a document-relative `<base>` into every `.html`/`.htm` file under
23
+ * `dir`, where `prefix` is the mount / asset-path prefix the tree is served
24
+ * under. Each file's base points at its own sub-directory within the mount.
25
+ * Files are read and written as binary (`latin1`) so non-UTF-8 content survives
26
+ * the round-trip untouched (the injected tag is ASCII). Symlinks are not
27
+ * followed (matches the asset copy policy). A root mount (`/`) is a no-op.
28
+ * Returns the number of files changed.
29
+ */
30
+ export declare function injectBaseHrefIntoTree(log: Logger, dir: string, prefix: string): number;
31
+ //# sourceMappingURL=static-base-href.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-base-href.d.ts","sourceRoot":"","sources":["../src/static-base-href.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAgC7C;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,SAAK,GAAG,MAAM,GAAG,IAAI,CASzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA4BrE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CA4CvF"}
@@ -0,0 +1,183 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.staticBaseHref = staticBaseHref;
37
+ exports.injectBaseHref = injectBaseHref;
38
+ exports.injectBaseHrefIntoTree = injectBaseHrefIntoTree;
39
+ /**
40
+ * Mount-aware `<base href>` injection for no-framework static apps.
41
+ *
42
+ * A static app's HTML is served verbatim — nothing rewrites its URLs. When the
43
+ * app is mounted under a path (e.g. `/docs`), a relative reference like
44
+ * `<link href="styles.css">` resolves against the *request* URL, not the asset
45
+ * location: the index served slash-less at `/docs` resolves it to `/styles.css`
46
+ * (404) instead of `/docs/styles.css`. Framework apps avoid this because the
47
+ * framework bakes the mount into its asset URLs as a `base`/`basePath`; a static
48
+ * app has no build step to do that, so the engine injects the base at copy time.
49
+ *
50
+ * Each document gets a `<base>` pointing at ITS OWN directory within the mount,
51
+ * so relative URLs resolve exactly as a browser would against that document's
52
+ * location: the root `index.html` and a root `404.html` get `/docs/`, while a
53
+ * sub-page `about/index.html` gets `/docs/about/`. This fixes the slash-less
54
+ * mount-root case without changing how a sub-page resolves `./img.png`.
55
+ */
56
+ const fs = __importStar(require("node:fs"));
57
+ const path = __importStar(require("node:path"));
58
+ const HTML_FILE = /\.html?$/i;
59
+ /** Byte spans of `<!-- ... -->` comments, so tag matching can skip them. */
60
+ function commentRanges(html) {
61
+ const ranges = [];
62
+ const re = /<!--[\s\S]*?-->/g;
63
+ let m;
64
+ while ((m = re.exec(html)) !== null) {
65
+ ranges.push([m.index, m.index + m[0].length]);
66
+ }
67
+ return ranges;
68
+ }
69
+ /** First match of `re` (must be global) whose start is outside every comment. */
70
+ function matchOutsideComments(html, re, comments) {
71
+ re.lastIndex = 0;
72
+ let m;
73
+ while ((m = re.exec(html)) !== null) {
74
+ const i = m.index;
75
+ if (!comments.some(([s, e]) => i >= s && i < e)) {
76
+ return m;
77
+ }
78
+ }
79
+ return null;
80
+ }
81
+ /**
82
+ * The `<base>` href for a static app served under `prefix` (the mount / asset
83
+ * path prefix) and an optional document sub-directory, or `null` for a root
84
+ * mount, where relative URLs already resolve correctly and no base is needed.
85
+ * Always a single leading + trailing slash so relative URLs resolve against
86
+ * that directory; each segment is percent-encoded so a space/unicode mount
87
+ * yields a valid URL matching the served (encoded) asset path.
88
+ */
89
+ function staticBaseHref(prefix, subDir = '') {
90
+ const encode = (p) => p.split('/').filter(Boolean).map(encodeURIComponent).join('/');
91
+ const mount = encode(prefix);
92
+ if (!mount) {
93
+ return null;
94
+ }
95
+ const sub = encode(subDir);
96
+ return sub ? `/${mount}/${sub}/` : `/${mount}/`;
97
+ }
98
+ /**
99
+ * Insert `<base href>` into one HTML document, ignoring any match inside an HTML
100
+ * comment. Returns the input unchanged when the document already declares a real
101
+ * `<base href>` (the author's wins) — a bare `<base target>`, a `<base-card>`
102
+ * custom element, or a commented-out `<base>` do not count. The tag goes
103
+ * immediately after the opening `<head>` so it precedes any URL-bearing element;
104
+ * a document with no `<head>`/`<html>` gets a minimal `<head>` wrapper after any
105
+ * leading doctype, so the base never precedes the doctype (quirks mode).
106
+ */
107
+ function injectBaseHref(html, baseHref) {
108
+ const comments = commentRanges(html);
109
+ if (matchOutsideComments(html, /<base\b[^>]*\bhref\s*=/gi, comments)) {
110
+ return html;
111
+ }
112
+ const tag = `<base href="${baseHref}" />`;
113
+ const head = matchOutsideComments(html, /<head\b[^>]*>/gi, comments);
114
+ if (head) {
115
+ const at = head.index + head[0].length;
116
+ return `${html.slice(0, at)}\n ${tag}${html.slice(at)}`;
117
+ }
118
+ const htmlTag = matchOutsideComments(html, /<html\b[^>]*>/gi, comments);
119
+ if (htmlTag) {
120
+ const at = htmlTag.index + htmlTag[0].length;
121
+ return `${html.slice(0, at)}\n <head>${tag}</head>${html.slice(at)}`;
122
+ }
123
+ const doctype = matchOutsideComments(html, /<!doctype\b[^>]*>/gi, comments);
124
+ if (doctype) {
125
+ const at = doctype.index + doctype[0].length;
126
+ return `${html.slice(0, at)}\n<head>${tag}</head>${html.slice(at)}`;
127
+ }
128
+ return `<head>${tag}</head>\n${html}`;
129
+ }
130
+ /**
131
+ * Inject a document-relative `<base>` into every `.html`/`.htm` file under
132
+ * `dir`, where `prefix` is the mount / asset-path prefix the tree is served
133
+ * under. Each file's base points at its own sub-directory within the mount.
134
+ * Files are read and written as binary (`latin1`) so non-UTF-8 content survives
135
+ * the round-trip untouched (the injected tag is ASCII). Symlinks are not
136
+ * followed (matches the asset copy policy). A root mount (`/`) is a no-op.
137
+ * Returns the number of files changed.
138
+ */
139
+ function injectBaseHrefIntoTree(log, dir, prefix) {
140
+ if (staticBaseHref(prefix) === null) {
141
+ return 0;
142
+ }
143
+ let changed = 0;
144
+ const walk = (d, rel) => {
145
+ let entries;
146
+ try {
147
+ entries = fs.readdirSync(d, { withFileTypes: true });
148
+ }
149
+ catch (error) {
150
+ // The tree was just written by the copy step, so a read failure here is
151
+ // abnormal — surface it rather than silently shipping unstyled pages.
152
+ log.warn(`could not read ${d} while injecting <base>: ${String(error)}`);
153
+ return;
154
+ }
155
+ for (const entry of entries) {
156
+ const p = path.join(d, entry.name);
157
+ if (entry.isSymbolicLink()) {
158
+ continue;
159
+ }
160
+ if (entry.isDirectory()) {
161
+ walk(p, rel ? `${rel}/${entry.name}` : entry.name);
162
+ continue;
163
+ }
164
+ if (!entry.isFile() || !HTML_FILE.test(entry.name)) {
165
+ continue;
166
+ }
167
+ const baseHref = staticBaseHref(prefix, rel);
168
+ if (!baseHref) {
169
+ continue;
170
+ }
171
+ const html = fs.readFileSync(p, 'latin1');
172
+ const next = injectBaseHref(html, baseHref);
173
+ if (next !== html) {
174
+ fs.writeFileSync(p, next, 'latin1');
175
+ changed++;
176
+ log.debug(`injected <base href="${baseHref}"> into ${p}`);
177
+ }
178
+ }
179
+ };
180
+ walk(dir, '');
181
+ return changed;
182
+ }
183
+ //# sourceMappingURL=static-base-href.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"static-base-href.js","sourceRoot":"","sources":["../src/static-base-href.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,wCASC;AAWD,wCA4BC;AAWD,wDA4CC;AAnKD;;;;;;;;;;;;;;;;GAgBG;AACH,4CAA8B;AAC9B,gDAAkC;AAIlC,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,4EAA4E;AAC5E,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,MAAM,EAAE,GAAG,kBAAkB,CAAC;IAC9B,IAAI,CAAyB,CAAC;IAC9B,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACpC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,EA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CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;gBACnD,SAAS;YACX,CAAC;YACD,MAAM,QAAQ,GAAG,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACd,SAAS;YACX,CAAC;YACD,MAAM,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;YAC1C,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC5C,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAClB,EAAE,CAAC,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;gBACpC,OAAO,EAAE,CAAC;gBACV,GAAG,CAAC,KAAK,CAAC,wBAAwB,QAAQ,WAAW,CAAC,EAAE,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACd,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { WebflowAppError } from '../errors';
2
+ import type { NodeVersionDeclarationSource } from './types';
3
+ export type NodeToolchainFailurePhase = 'provisioning' | 'verification';
4
+ /** Stable, customer-safe categories a host can persist and render. */
5
+ export type NodeToolchainFailureCode = 'NVM_PROVISION_FAILED' | 'NODE_RUNTIME_VERIFICATION_FAILED';
6
+ export interface NodeToolchainErrorOptions {
7
+ code: NodeToolchainFailureCode;
8
+ phase: NodeToolchainFailurePhase;
9
+ declarationSource?: NodeVersionDeclarationSource;
10
+ requestedVersion?: string;
11
+ resolvedVersion?: string;
12
+ remediation: string;
13
+ /** Provisioning and verification errors may be retried by a host. */
14
+ retryable: boolean;
15
+ cause?: unknown;
16
+ }
17
+ /**
18
+ * A Node-toolchain failure with a stable code and safe remediation. Hosts can
19
+ * log its cause privately while sending only these fields to customer surfaces.
20
+ */
21
+ export declare class NodeToolchainError extends WebflowAppError {
22
+ readonly code: NodeToolchainFailureCode;
23
+ readonly phase: NodeToolchainFailurePhase;
24
+ readonly declarationSource?: NodeVersionDeclarationSource;
25
+ readonly requestedVersion?: string;
26
+ readonly resolvedVersion?: string;
27
+ readonly remediation: string;
28
+ readonly retryable: boolean;
29
+ readonly cause?: unknown;
30
+ constructor(message: string, options: NodeToolchainErrorOptions);
31
+ }
32
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/toolchain/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAE5D,MAAM,MAAM,yBAAyB,GAAG,cAAc,GAAG,cAAc,CAAC;AAExE,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG,sBAAsB,GAAG,kCAAkC,CAAC;AAEnG,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,wBAAwB,CAAC;IAC/B,KAAK,EAAE,yBAAyB,CAAC;IACjC,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;IACjD,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,eAAe;IACrD,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,QAAQ,CAAC,KAAK,EAAE,yBAAyB,CAAC;IAC1C,QAAQ,CAAC,iBAAiB,CAAC,EAAE,4BAA4B,CAAC;IAC1D,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;gBAEb,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB;CAWhE"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NodeToolchainError = void 0;
4
+ const errors_1 = require("../errors");
5
+ /**
6
+ * A Node-toolchain failure with a stable code and safe remediation. Hosts can
7
+ * log its cause privately while sending only these fields to customer surfaces.
8
+ */
9
+ class NodeToolchainError extends errors_1.WebflowAppError {
10
+ code;
11
+ phase;
12
+ declarationSource;
13
+ requestedVersion;
14
+ resolvedVersion;
15
+ remediation;
16
+ retryable;
17
+ cause;
18
+ constructor(message, options) {
19
+ super(message);
20
+ this.code = options.code;
21
+ this.phase = options.phase;
22
+ this.declarationSource = options.declarationSource;
23
+ this.requestedVersion = options.requestedVersion;
24
+ this.resolvedVersion = options.resolvedVersion;
25
+ this.remediation = options.remediation;
26
+ this.retryable = options.retryable;
27
+ this.cause = options.cause;
28
+ }
29
+ }
30
+ exports.NodeToolchainError = NodeToolchainError;
31
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/toolchain/errors.ts"],"names":[],"mappings":";;;AAAA,sCAA4C;AAqB5C;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,wBAAe;IAC5C,IAAI,CAA2B;IAC/B,KAAK,CAA4B;IACjC,iBAAiB,CAAgC;IACjD,gBAAgB,CAAU;IAC1B,eAAe,CAAU;IACzB,WAAW,CAAS;IACpB,SAAS,CAAU;IACnB,KAAK,CAAW;IAEzB,YAAY,OAAe,EAAE,OAAkC;QAC7D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC;QACnD,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;QACjD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC7B,CAAC;CACF;AArBD,gDAqBC"}
@@ -0,0 +1,25 @@
1
+ import type { PackageJson } from '../config/package-json';
2
+ import type { NodeToolchainPolicy, ResolvedNodeToolchain } from './types';
3
+ /**
4
+ * Initial hosted-build policy. The resolver accepts a policy from the host so
5
+ * later LTS releases do not require changing customer-facing resolution logic.
6
+ */
7
+ export declare const DEFAULT_NODE_TOOLCHAIN_POLICY: NodeToolchainPolicy;
8
+ export interface ResolveNodeToolchainOptions {
9
+ /** Ephemeral project workspace containing version files and package.json. */
10
+ projectDir: string;
11
+ packageJson: PackageJson;
12
+ /** Omit to use the initial Node 24 policy. */
13
+ policy?: NodeToolchainPolicy;
14
+ }
15
+ /**
16
+ * Resolve a project's Node declaration to one exact version allowed by the
17
+ * policy. Version declarations use the Cloud contract's precedence order:
18
+ * .nvmrc, then .node-version, then package.json engines. Lower-priority
19
+ * declarations are ignored unless they resolve to a different supported
20
+ * release, in which case the result is marked as conflicting. An invalid or
21
+ * unsupported selected declaration falls back to the host default and returns
22
+ * a customer-safe warning.
23
+ */
24
+ export declare function resolveNodeToolchain(options: ResolveNodeToolchainOptions): ResolvedNodeToolchain;
25
+ //# sourceMappingURL=resolver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.d.ts","sourceRoot":"","sources":["../../src/toolchain/resolver.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,EACV,mBAAmB,EAEnB,qBAAqB,EACtB,MAAM,SAAS,CAAC;AAEjB;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,mBAI3C,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,6EAA6E;IAC7E,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B;AAuBD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,qBAAqB,CA4EhG"}
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.DEFAULT_NODE_TOOLCHAIN_POLICY = void 0;
37
+ exports.resolveNodeToolchain = resolveNodeToolchain;
38
+ const fs = __importStar(require("node:fs"));
39
+ const path = __importStar(require("node:path"));
40
+ const semver = __importStar(require("semver"));
41
+ /**
42
+ * Initial hosted-build policy. The resolver accepts a policy from the host so
43
+ * later LTS releases do not require changing customer-facing resolution logic.
44
+ */
45
+ exports.DEFAULT_NODE_TOOLCHAIN_POLICY = {
46
+ defaultVersion: '24.15.0',
47
+ supportedVersions: ['24.15.0'],
48
+ supportedLtsVersions: ['24.15.0'],
49
+ };
50
+ /**
51
+ * Resolve a project's Node declaration to one exact version allowed by the
52
+ * policy. Version declarations use the Cloud contract's precedence order:
53
+ * .nvmrc, then .node-version, then package.json engines. Lower-priority
54
+ * declarations are ignored unless they resolve to a different supported
55
+ * release, in which case the result is marked as conflicting. An invalid or
56
+ * unsupported selected declaration falls back to the host default and returns
57
+ * a customer-safe warning.
58
+ */
59
+ function resolveNodeToolchain(options) {
60
+ const policy = normalizePolicy(options.policy ?? exports.DEFAULT_NODE_TOOLCHAIN_POLICY);
61
+ const declarations = readDeclarations(options.projectDir, options.packageJson);
62
+ const declaration = declarations[0];
63
+ if (!declaration) {
64
+ return {
65
+ declarationSource: 'default',
66
+ resolvedVersion: policy.defaultVersion,
67
+ resolution: 'default',
68
+ };
69
+ }
70
+ if (!isValidDeclaration(declaration)) {
71
+ return {
72
+ declarationSource: declaration.source,
73
+ requestedVersion: declaration.requestedVersion,
74
+ resolvedVersion: policy.defaultVersion,
75
+ resolution: 'invalid',
76
+ warning: `The Node.js version declared in ${sourceLabel(declaration.source)} is invalid` +
77
+ `${declaration.requestedVersion ? ` (${declaration.requestedVersion})` : ''}. ` +
78
+ `Using the baseline Node.js ${policy.defaultVersion} instead.`,
79
+ };
80
+ }
81
+ const resolvedVersion = resolveSupportedVersion(declaration, policy);
82
+ if (!resolvedVersion) {
83
+ return {
84
+ declarationSource: declaration.source,
85
+ requestedVersion: declaration.requestedVersion,
86
+ resolvedVersion: policy.defaultVersion,
87
+ resolution: declaration.kind === 'lts' ? 'unresolvable' : 'unsupported',
88
+ warning: declaration.kind === 'lts'
89
+ ? `The Node.js LTS version requested by ${sourceLabel(declaration.source)} could not be resolved ` +
90
+ `from Webflow Cloud's supported LTS releases. Using the baseline Node.js ${policy.defaultVersion} instead.`
91
+ : `The Node.js version requested by ${sourceLabel(declaration.source)} (${declaration.requestedVersion}) ` +
92
+ `is not supported by Webflow Cloud. Using the baseline Node.js ${policy.defaultVersion} instead.`,
93
+ };
94
+ }
95
+ const conflictingDeclarationSources = declarations
96
+ .slice(1)
97
+ .filter(isValidDeclaration)
98
+ .flatMap((lowerPriority) => {
99
+ const lowerPriorityVersion = resolveSupportedVersion(lowerPriority, policy);
100
+ return lowerPriorityVersion && lowerPriorityVersion !== resolvedVersion
101
+ ? [lowerPriority.source]
102
+ : [];
103
+ });
104
+ if (conflictingDeclarationSources.length > 0) {
105
+ return {
106
+ declarationSource: declaration.source,
107
+ requestedVersion: declaration.requestedVersion,
108
+ resolvedVersion,
109
+ resolution: 'conflicting',
110
+ conflictingDeclarationSources,
111
+ warning: `Conflicting Node.js version declarations were found. Using ${sourceLabel(declaration.source)} ` +
112
+ `(${declaration.requestedVersion}) according to precedence.`,
113
+ };
114
+ }
115
+ return {
116
+ declarationSource: declaration.source,
117
+ requestedVersion: declaration.requestedVersion,
118
+ resolvedVersion,
119
+ resolution: 'declared',
120
+ warning: declaration.requestedVersion === resolvedVersion
121
+ ? undefined
122
+ : `Resolved ${sourceLabel(declaration.source)} (${declaration.requestedVersion}) to supported Node.js ${resolvedVersion}.`,
123
+ };
124
+ }
125
+ function normalizePolicy(policy) {
126
+ const supportedVersions = policy.supportedVersions.map((version) => semver.valid(version));
127
+ if (supportedVersions.some((version) => version === null)) {
128
+ throw new TypeError('Node toolchain policy supportedVersions must contain exact semver versions.');
129
+ }
130
+ const defaultVersion = semver.valid(policy.defaultVersion);
131
+ if (!defaultVersion || !supportedVersions.includes(defaultVersion)) {
132
+ throw new TypeError('Node toolchain policy defaultVersion must be an exact supported semver version.');
133
+ }
134
+ const supportedLtsVersions = policy.supportedLtsVersions.map((version) => semver.valid(version));
135
+ if (supportedLtsVersions.some((version) => version === null) ||
136
+ supportedLtsVersions.some((version) => !supportedVersions.includes(version))) {
137
+ throw new TypeError('Node toolchain policy supportedLtsVersions must contain exact supported semver versions.');
138
+ }
139
+ return {
140
+ defaultVersion,
141
+ supportedVersions: supportedVersions.sort(semver.rcompare),
142
+ supportedLtsVersions: supportedLtsVersions.sort(semver.rcompare),
143
+ };
144
+ }
145
+ function readDeclarations(projectDir, packageJson) {
146
+ const declarations = [];
147
+ const nvmrc = readVersionFile(projectDir, '.nvmrc');
148
+ if (nvmrc !== undefined) {
149
+ declarations.push(parseDeclaration('nvmrc', nvmrc));
150
+ }
151
+ const nodeVersion = readVersionFile(projectDir, '.node-version');
152
+ if (nodeVersion !== undefined) {
153
+ declarations.push(parseDeclaration('node-version', nodeVersion));
154
+ }
155
+ if (packageJson.engines?.node !== undefined) {
156
+ declarations.push(parseDeclaration('package-engines', packageJson.engines.node));
157
+ }
158
+ return declarations;
159
+ }
160
+ function readVersionFile(projectDir, filename) {
161
+ const filePath = path.join(projectDir, filename);
162
+ if (!fs.statSync(filePath, { throwIfNoEntry: false })) {
163
+ return undefined;
164
+ }
165
+ const declaration = fs.readFileSync(filePath, 'utf8').trim();
166
+ return declaration || undefined;
167
+ }
168
+ function parseDeclaration(source, raw) {
169
+ if (typeof raw !== 'string' || raw.trim() === '') {
170
+ return { source, requestedVersion: typeof raw === 'string' ? raw : undefined };
171
+ }
172
+ const requestedVersion = raw.trim();
173
+ // NVM's generic LTS alias can safely resolve to the host's current LTS
174
+ // allowlist. Named LTS aliases are intentionally not supported in v1.
175
+ if (source !== 'package-engines' && requestedVersion === 'lts/*') {
176
+ return { source, requestedVersion, kind: 'lts' };
177
+ }
178
+ const range = semver.validRange(requestedVersion.startsWith('v') ? requestedVersion.slice(1) : requestedVersion);
179
+ if (range === null) {
180
+ return { source, requestedVersion };
181
+ }
182
+ return { source, requestedVersion, kind: 'range', range };
183
+ }
184
+ function isValidDeclaration(declaration) {
185
+ return 'kind' in declaration;
186
+ }
187
+ function resolveSupportedVersion(declaration, policy) {
188
+ if (declaration.kind === 'lts') {
189
+ return policy.supportedLtsVersions[0];
190
+ }
191
+ return policy.supportedVersions.find((version) => semver.satisfies(version, declaration.range));
192
+ }
193
+ function sourceLabel(source) {
194
+ if (source === 'nvmrc')
195
+ return '.nvmrc';
196
+ if (source === 'node-version')
197
+ return '.node-version';
198
+ return 'package.json#engines.node';
199
+ }
200
+ //# sourceMappingURL=resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolver.js","sourceRoot":"","sources":["../../src/toolchain/resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,oDA4EC;AAzID,4CAA8B;AAC9B,gDAAkC;AAElC,+CAAiC;AAUjC;;;GAGG;AACU,QAAA,6BAA6B,GAAwB;IAChE,cAAc,EAAE,SAAS;IACzB,iBAAiB,EAAE,CAAC,SAAS,CAAC;IAC9B,oBAAoB,EAAE,CAAC,SAAS,CAAC;CAClC,CAAC;AA+BF;;;;;;;;GAQG;AACH,SAAgB,oBAAoB,CAAC,OAAoC;IACvE,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,MAAM,IAAI,qCAA6B,CAAC,CAAC;IAChF,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC/E,MAAM,WAAW,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IAEpC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC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