@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,51 @@
1
+ "use strict";
2
+ /**
3
+ * Environment variable names that Webflow Cloud reserves for internal use.
4
+ *
5
+ * The build/deploy pipeline injects these names and the deployer maps them to
6
+ * Cloudflare Worker bindings. If a user-defined env var collides with one of
7
+ * them, the deploy step fails when Cloudflare rejects the duplicate binding
8
+ * (e.g. `Binding name 'COSMIC_MOUNT_PATH' already in use`), which previously
9
+ * surfaced only as a silent hang.
10
+ *
11
+ * This is a safety net: the dashboard (UI) and API reject reserved names before
12
+ * they are ever stored. This filter only catches names that slip through. Keep
13
+ * it in sync with the monorepo source of truth at
14
+ * `packages/systems/cosmic/constants/reservedEnvVarNames.ts` and with the
15
+ * system env declarations in cosmic-builder's `images/env.ts`.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.RESERVED_ENV_VAR_NAMES = exports.RESERVED_ENV_VAR_PREFIXES = void 0;
19
+ exports.isReservedEnvVarName = isReservedEnvVarName;
20
+ /** Reserved name prefixes — any key starting with one of these is reserved. */
21
+ exports.RESERVED_ENV_VAR_PREFIXES = ['COSMIC_', 'CLOUDFLARE_', 'WRANGLER_'];
22
+ /** Reserved exact names not already covered by a reserved prefix. */
23
+ exports.RESERVED_ENV_VAR_NAMES = [
24
+ 'APP_NAME',
25
+ 'APP_PATH',
26
+ 'COMMIT_HASH',
27
+ 'DEPLOYMENT_ID',
28
+ 'COMPLETION_URL',
29
+ 'STARTED_URL',
30
+ 'OUTPUT_URL',
31
+ 'REPO_URL',
32
+ 'TARBALL_URL',
33
+ 'UPLOAD_CREDENTIALS',
34
+ 'HOSTNAME',
35
+ 'NODE_ENV',
36
+ 'NODE_VERSION',
37
+ ];
38
+ const RESERVED_NAME_SET = new Set(exports.RESERVED_ENV_VAR_NAMES);
39
+ /**
40
+ * Returns true if `key` is reserved for Webflow Cloud internal use and must not
41
+ * be applied as a user-defined environment variable. Matching is
42
+ * case-insensitive and ignores surrounding whitespace.
43
+ */
44
+ function isReservedEnvVarName(key) {
45
+ const normalized = key.trim().toUpperCase();
46
+ if (RESERVED_NAME_SET.has(normalized)) {
47
+ return true;
48
+ }
49
+ return exports.RESERVED_ENV_VAR_PREFIXES.some((prefix) => normalized.startsWith(prefix));
50
+ }
51
+ //# sourceMappingURL=reserved-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reserved-env.js","sourceRoot":"","sources":["../../src/utils/reserved-env.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AA6BH,oDAMC;AAjCD,+EAA+E;AAClE,QAAA,yBAAyB,GAAG,CAAC,SAAS,EAAE,aAAa,EAAE,WAAW,CAAU,CAAC;AAE1F,qEAAqE;AACxD,QAAA,sBAAsB,GAAG;IACpC,UAAU;IACV,UAAU;IACV,aAAa;IACb,eAAe;IACf,gBAAgB;IAChB,aAAa;IACb,YAAY;IACZ,UAAU;IACV,aAAa;IACb,oBAAoB;IACpB,UAAU;IACV,UAAU;IACV,cAAc;CACN,CAAC;AAEX,MAAM,iBAAiB,GAAwB,IAAI,GAAG,CAAC,8BAAsB,CAAC,CAAC;AAE/E;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,GAAW;IAC9C,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC5C,IAAI,iBAAiB,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;QACtC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,iCAAyB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;AACnF,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Substitute `${VAR}` and `$VAR` references in `input` with values from `vars`.
3
+ * Unset variables become the empty string. Single pass — substituted values are
4
+ * not re-scanned — matching `envsubst`.
5
+ */
6
+ export declare function substituteEnv(input: string, vars: Record<string, string | undefined>): string;
7
+ /**
8
+ * Render a template file to `outputPath`, substituting environment variables.
9
+ *
10
+ * @throws Error if the template file does not exist.
11
+ */
12
+ export declare function envsubst(log: {
13
+ debug(message: string): void;
14
+ }, templatePath: string, outputPath: string, env?: Record<string, string | undefined>): Promise<void>;
15
+ //# sourceMappingURL=template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,CAQ7F;AAED;;;;GAIG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE;IAAE,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACrC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACvC,OAAO,CAAC,IAAI,CAAC,CAUf"}
@@ -0,0 +1,75 @@
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.substituteEnv = substituteEnv;
37
+ exports.envsubst = envsubst;
38
+ /**
39
+ * Template rendering.
40
+ *
41
+ * The original cosmic-builder shelled out to the system `envsubst` binary
42
+ * (gettext). That's fine inside the ECS build container but not in a public,
43
+ * agent-importable package that also runs on contributors' machines and inside
44
+ * the CLI — `envsubst` is frequently absent there. This is a pure-JS
45
+ * reimplementation of the substitution semantics the templates rely on
46
+ * (`${VAR}` / `$VAR`, unset variables become the empty string, single pass with
47
+ * no recursion), so rendering is identical without the system dependency.
48
+ */
49
+ const fs = __importStar(require("node:fs"));
50
+ /**
51
+ * Substitute `${VAR}` and `$VAR` references in `input` with values from `vars`.
52
+ * Unset variables become the empty string. Single pass — substituted values are
53
+ * not re-scanned — matching `envsubst`.
54
+ */
55
+ function substituteEnv(input, vars) {
56
+ return input.replace(/\$(?:\{([A-Za-z_][A-Za-z0-9_]*)\}|([A-Za-z_][A-Za-z0-9_]*))/g, (_match, braced, bare) => {
57
+ const name = braced ?? bare ?? '';
58
+ return vars[name] ?? '';
59
+ });
60
+ }
61
+ /**
62
+ * Render a template file to `outputPath`, substituting environment variables.
63
+ *
64
+ * @throws Error if the template file does not exist.
65
+ */
66
+ async function envsubst(log, templatePath, outputPath, env) {
67
+ if (!fs.existsSync(templatePath)) {
68
+ throw new Error(`Template not found: ${templatePath}`);
69
+ }
70
+ const source = fs.readFileSync(templatePath, 'utf8');
71
+ const result = substituteEnv(source, env ?? process.env);
72
+ log.debug(`envsubst: ${templatePath} -> ${outputPath}`);
73
+ fs.writeFileSync(outputPath, result);
74
+ }
75
+ //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/utils/template.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,sCAQC;AAOD,4BAeC;AAhDD;;;;;;;;;;GAUG;AACH,4CAA8B;AAE9B;;;;GAIG;AACH,SAAgB,aAAa,CAAC,KAAa,EAAE,IAAwC;IACnF,OAAO,KAAK,CAAC,OAAO,CAClB,8DAA8D,EAC9D,CAAC,MAAM,EAAE,MAA0B,EAAE,IAAwB,EAAE,EAAE;QAC/D,MAAM,IAAI,GAAG,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC,CACF,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,QAAQ,CAC5B,GAAqC,EACrC,YAAoB,EACpB,UAAkB,EAClB,GAAwC;IAExC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACrD,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,EAAE,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;IAEzD,GAAG,CAAC,KAAK,CAAC,aAAa,YAAY,OAAO,UAAU,EAAE,CAAC,CAAC;IACxD,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Extracts the major version from a package.json version specifier.
3
+ *
4
+ * Handles `^1.2.3`, `~1.2.3`, `1.2.3`, `npm:pkg@^1.2.3`, `>=1.2.3`,
5
+ * `>=1.2.3 <2.0.0`. Returns null for unparseable specifiers (`latest`,
6
+ * `file:../local`, `workspace:*`, `link:../other`, empty string).
7
+ */
8
+ export declare function getMajorVersion(versionSpec: string): number | null;
9
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMlE"}
@@ -0,0 +1,52 @@
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.getMajorVersion = getMajorVersion;
37
+ const semver = __importStar(require("semver"));
38
+ /**
39
+ * Extracts the major version from a package.json version specifier.
40
+ *
41
+ * Handles `^1.2.3`, `~1.2.3`, `1.2.3`, `npm:pkg@^1.2.3`, `>=1.2.3`,
42
+ * `>=1.2.3 <2.0.0`. Returns null for unparseable specifiers (`latest`,
43
+ * `file:../local`, `workspace:*`, `link:../other`, empty string).
44
+ */
45
+ function getMajorVersion(versionSpec) {
46
+ if (!versionSpec) {
47
+ return null;
48
+ }
49
+ const coerced = semver.coerce(versionSpec);
50
+ return coerced ? coerced.major : null;
51
+ }
52
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,0CAMC;AAfD,+CAAiC;AAEjC;;;;;;GAMG;AACH,SAAgB,eAAe,CAAC,WAAmB;IACjD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IAC3C,OAAO,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AACxC,CAAC"}
@@ -0,0 +1,195 @@
1
+ import { z } from 'zod';
2
+ import type { Logger } from './ports';
3
+ import type { FrameworkBuilder } from './frameworks/base';
4
+ declare const wranglerJsonSchema: z.ZodObject<{
5
+ name: z.ZodString;
6
+ main: z.ZodOptional<z.ZodString>;
7
+ compatibility_date: z.ZodString;
8
+ compatibility_flags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
9
+ placement: z.ZodOptional<z.ZodObject<{
10
+ mode: z.ZodLiteral<"smart">;
11
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
12
+ mode: z.ZodLiteral<"smart">;
13
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
14
+ mode: z.ZodLiteral<"smart">;
15
+ }, z.ZodTypeAny, "passthrough">>>;
16
+ assets: z.ZodOptional<z.ZodObject<{
17
+ directory: z.ZodString;
18
+ binding: z.ZodOptional<z.ZodString>;
19
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
20
+ directory: z.ZodString;
21
+ binding: z.ZodOptional<z.ZodString>;
22
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
23
+ directory: z.ZodString;
24
+ binding: z.ZodOptional<z.ZodString>;
25
+ }, z.ZodTypeAny, "passthrough">>>;
26
+ d1_databases: z.ZodDefault<z.ZodArray<z.ZodObject<{
27
+ database_name: z.ZodString;
28
+ database_id: z.ZodString;
29
+ binding: z.ZodString;
30
+ migrations_dir: z.ZodOptional<z.ZodString>;
31
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
32
+ database_name: z.ZodString;
33
+ database_id: z.ZodString;
34
+ binding: z.ZodString;
35
+ migrations_dir: z.ZodOptional<z.ZodString>;
36
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
37
+ database_name: z.ZodString;
38
+ database_id: z.ZodString;
39
+ binding: z.ZodString;
40
+ migrations_dir: z.ZodOptional<z.ZodString>;
41
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
42
+ kv_namespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
43
+ binding: z.ZodString;
44
+ id: z.ZodString;
45
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
46
+ binding: z.ZodString;
47
+ id: z.ZodString;
48
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
49
+ binding: z.ZodString;
50
+ id: z.ZodString;
51
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
52
+ r2_buckets: z.ZodDefault<z.ZodArray<z.ZodObject<{
53
+ binding: z.ZodString;
54
+ bucket_name: z.ZodString;
55
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
56
+ binding: z.ZodString;
57
+ bucket_name: z.ZodString;
58
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
59
+ binding: z.ZodString;
60
+ bucket_name: z.ZodString;
61
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
62
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
63
+ name: z.ZodString;
64
+ main: z.ZodOptional<z.ZodString>;
65
+ compatibility_date: z.ZodString;
66
+ compatibility_flags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
67
+ placement: z.ZodOptional<z.ZodObject<{
68
+ mode: z.ZodLiteral<"smart">;
69
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
70
+ mode: z.ZodLiteral<"smart">;
71
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
72
+ mode: z.ZodLiteral<"smart">;
73
+ }, z.ZodTypeAny, "passthrough">>>;
74
+ assets: z.ZodOptional<z.ZodObject<{
75
+ directory: z.ZodString;
76
+ binding: z.ZodOptional<z.ZodString>;
77
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
78
+ directory: z.ZodString;
79
+ binding: z.ZodOptional<z.ZodString>;
80
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
81
+ directory: z.ZodString;
82
+ binding: z.ZodOptional<z.ZodString>;
83
+ }, z.ZodTypeAny, "passthrough">>>;
84
+ d1_databases: z.ZodDefault<z.ZodArray<z.ZodObject<{
85
+ database_name: z.ZodString;
86
+ database_id: z.ZodString;
87
+ binding: z.ZodString;
88
+ migrations_dir: z.ZodOptional<z.ZodString>;
89
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
90
+ database_name: z.ZodString;
91
+ database_id: z.ZodString;
92
+ binding: z.ZodString;
93
+ migrations_dir: z.ZodOptional<z.ZodString>;
94
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
95
+ database_name: z.ZodString;
96
+ database_id: z.ZodString;
97
+ binding: z.ZodString;
98
+ migrations_dir: z.ZodOptional<z.ZodString>;
99
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
100
+ kv_namespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
101
+ binding: z.ZodString;
102
+ id: z.ZodString;
103
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
104
+ binding: z.ZodString;
105
+ id: z.ZodString;
106
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
107
+ binding: z.ZodString;
108
+ id: z.ZodString;
109
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
110
+ r2_buckets: z.ZodDefault<z.ZodArray<z.ZodObject<{
111
+ binding: z.ZodString;
112
+ bucket_name: z.ZodString;
113
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
114
+ binding: z.ZodString;
115
+ bucket_name: z.ZodString;
116
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
117
+ binding: z.ZodString;
118
+ bucket_name: z.ZodString;
119
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
120
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
121
+ name: z.ZodString;
122
+ main: z.ZodOptional<z.ZodString>;
123
+ compatibility_date: z.ZodString;
124
+ compatibility_flags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
125
+ placement: z.ZodOptional<z.ZodObject<{
126
+ mode: z.ZodLiteral<"smart">;
127
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
128
+ mode: z.ZodLiteral<"smart">;
129
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
130
+ mode: z.ZodLiteral<"smart">;
131
+ }, z.ZodTypeAny, "passthrough">>>;
132
+ assets: z.ZodOptional<z.ZodObject<{
133
+ directory: z.ZodString;
134
+ binding: z.ZodOptional<z.ZodString>;
135
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
136
+ directory: z.ZodString;
137
+ binding: z.ZodOptional<z.ZodString>;
138
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
139
+ directory: z.ZodString;
140
+ binding: z.ZodOptional<z.ZodString>;
141
+ }, z.ZodTypeAny, "passthrough">>>;
142
+ d1_databases: z.ZodDefault<z.ZodArray<z.ZodObject<{
143
+ database_name: z.ZodString;
144
+ database_id: z.ZodString;
145
+ binding: z.ZodString;
146
+ migrations_dir: z.ZodOptional<z.ZodString>;
147
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
148
+ database_name: z.ZodString;
149
+ database_id: z.ZodString;
150
+ binding: z.ZodString;
151
+ migrations_dir: z.ZodOptional<z.ZodString>;
152
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
153
+ database_name: z.ZodString;
154
+ database_id: z.ZodString;
155
+ binding: z.ZodString;
156
+ migrations_dir: z.ZodOptional<z.ZodString>;
157
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
158
+ kv_namespaces: z.ZodDefault<z.ZodArray<z.ZodObject<{
159
+ binding: z.ZodString;
160
+ id: z.ZodString;
161
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
162
+ binding: z.ZodString;
163
+ id: z.ZodString;
164
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
165
+ binding: z.ZodString;
166
+ id: z.ZodString;
167
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
168
+ r2_buckets: z.ZodDefault<z.ZodArray<z.ZodObject<{
169
+ binding: z.ZodString;
170
+ bucket_name: z.ZodString;
171
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
172
+ binding: z.ZodString;
173
+ bucket_name: z.ZodString;
174
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
175
+ binding: z.ZodString;
176
+ bucket_name: z.ZodString;
177
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
178
+ }, z.ZodTypeAny, "passthrough">>;
179
+ export type WranglerJson = z.infer<typeof wranglerJsonSchema>;
180
+ export declare function loadWranglerJson(log: Logger, cwd: string, file?: string): WranglerJson | undefined;
181
+ /**
182
+ * Sole writer of `wrangler.json` during the build. Runs before
183
+ * `builder.prepareConfig()`; frameworks must not touch the file.
184
+ *
185
+ * 1. Save user `wrangler.{json,jsonc}` as `clouduser.wrangler.json`.
186
+ * 2. Copy `builder.getWranglerTemplatePath()` over `wrangler.json`, then settle its
187
+ * `compatibility_date` (see compat-date.ts) so the build bundles at it.
188
+ * 3. Merge user `kv_namespaces` / `r2_buckets` / `d1_databases` into it.
189
+ * 4. Copy D1 migrations dirs into `clouduser/migrations/<dir>`.
190
+ */
191
+ export declare function handleWranglerJson(log: Logger, builder: FrameworkBuilder, cwd: string, opts?: {
192
+ compatDatePolicy?: boolean;
193
+ }): void;
194
+ export {};
195
+ //# sourceMappingURL=wrangler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrangler.d.ts","sourceRoot":"","sources":["../src/wrangler.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAgB1D,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAoDR,CAAC;AAEjB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AA+H9D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAwB,GAC7B,YAAY,GAAG,SAAS,CA+B1B;AAOD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,gBAAgB,EACzB,GAAG,EAAE,MAAM,EACX,IAAI,GAAE;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAO,GACxC,IAAI,CA6JN"}