@webflow/cloud-app 0.1.0-beta.7

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 (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/dist/bindings.d.ts +185 -0
  4. package/dist/bindings.d.ts.map +1 -0
  5. package/dist/bindings.js +120 -0
  6. package/dist/bindings.js.map +1 -0
  7. package/dist/config/package-json.d.ts +57 -0
  8. package/dist/config/package-json.d.ts.map +1 -0
  9. package/dist/config/package-json.js +94 -0
  10. package/dist/config/package-json.js.map +1 -0
  11. package/dist/config/webflow-json.d.ts +53 -0
  12. package/dist/config/webflow-json.d.ts.map +1 -0
  13. package/dist/config/webflow-json.js +72 -0
  14. package/dist/config/webflow-json.js.map +1 -0
  15. package/dist/create-webflow-json.d.ts +24 -0
  16. package/dist/create-webflow-json.d.ts.map +1 -0
  17. package/dist/create-webflow-json.js +170 -0
  18. package/dist/create-webflow-json.js.map +1 -0
  19. package/dist/errors.d.ts +13 -0
  20. package/dist/errors.d.ts.map +1 -0
  21. package/dist/errors.js +23 -0
  22. package/dist/errors.js.map +1 -0
  23. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts +36 -0
  24. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts.map +1 -0
  25. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js +94 -0
  26. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js.map +1 -0
  27. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts +2 -0
  28. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts.map +1 -0
  29. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js +97 -0
  30. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js.map +1 -0
  31. package/dist/frameworks/astro/astro5.d.ts +28 -0
  32. package/dist/frameworks/astro/astro5.d.ts.map +1 -0
  33. package/dist/frameworks/astro/astro5.js +259 -0
  34. package/dist/frameworks/astro/astro5.js.map +1 -0
  35. package/dist/frameworks/astro/astro6.d.ts +28 -0
  36. package/dist/frameworks/astro/astro6.d.ts.map +1 -0
  37. package/dist/frameworks/astro/astro6.js +286 -0
  38. package/dist/frameworks/astro/astro6.js.map +1 -0
  39. package/dist/frameworks/astro/astro7.d.ts +28 -0
  40. package/dist/frameworks/astro/astro7.d.ts.map +1 -0
  41. package/dist/frameworks/astro/astro7.js +283 -0
  42. package/dist/frameworks/astro/astro7.js.map +1 -0
  43. package/dist/frameworks/astro/index.d.ts +10 -0
  44. package/dist/frameworks/astro/index.d.ts.map +1 -0
  45. package/dist/frameworks/astro/index.js +16 -0
  46. package/dist/frameworks/astro/index.js.map +1 -0
  47. package/dist/frameworks/astro/templates/astro.config.webflow.ts +61 -0
  48. package/dist/frameworks/astro/templates/v5/astro.config.mjs.template +25 -0
  49. package/dist/frameworks/astro/templates/v5/webflow-loader.ts +103 -0
  50. package/dist/frameworks/astro/templates/v5/wrangler.json +6 -0
  51. package/dist/frameworks/astro/templates/v6/astro.config.mjs.template +35 -0
  52. package/dist/frameworks/astro/templates/v6/webflow-loader.ts +112 -0
  53. package/dist/frameworks/astro/templates/v6/wrangler.json +9 -0
  54. package/dist/frameworks/astro/templates/v7/astro.config.mjs.template +34 -0
  55. package/dist/frameworks/astro/templates/v7/webflow-loader.ts +113 -0
  56. package/dist/frameworks/astro/templates/v7/wrangler.json +9 -0
  57. package/dist/frameworks/base.d.ts +134 -0
  58. package/dist/frameworks/base.d.ts.map +1 -0
  59. package/dist/frameworks/base.js +175 -0
  60. package/dist/frameworks/base.js.map +1 -0
  61. package/dist/frameworks/errors.d.ts +72 -0
  62. package/dist/frameworks/errors.d.ts.map +1 -0
  63. package/dist/frameworks/errors.js +120 -0
  64. package/dist/frameworks/errors.js.map +1 -0
  65. package/dist/frameworks/nextjs/adapter-resolver.d.ts +72 -0
  66. package/dist/frameworks/nextjs/adapter-resolver.d.ts.map +1 -0
  67. package/dist/frameworks/nextjs/adapter-resolver.js +246 -0
  68. package/dist/frameworks/nextjs/adapter-resolver.js.map +1 -0
  69. package/dist/frameworks/nextjs/index.d.ts +38 -0
  70. package/dist/frameworks/nextjs/index.d.ts.map +1 -0
  71. package/dist/frameworks/nextjs/index.js +268 -0
  72. package/dist/frameworks/nextjs/index.js.map +1 -0
  73. package/dist/frameworks/nextjs/templates/next.config.ts.template +13 -0
  74. package/dist/frameworks/nextjs/templates/next.config.webflow.ts +46 -0
  75. package/dist/frameworks/nextjs/templates/open-next.config.ts +3 -0
  76. package/dist/frameworks/nextjs/templates/webflow-loader.ts +44 -0
  77. package/dist/frameworks/nextjs/templates/wrangler.json +6 -0
  78. package/dist/frameworks/registry.d.ts +127 -0
  79. package/dist/frameworks/registry.d.ts.map +1 -0
  80. package/dist/frameworks/registry.js +257 -0
  81. package/dist/frameworks/registry.js.map +1 -0
  82. package/dist/frameworks/static/index.d.ts +93 -0
  83. package/dist/frameworks/static/index.d.ts.map +1 -0
  84. package/dist/frameworks/static/index.js +352 -0
  85. package/dist/frameworks/static/index.js.map +1 -0
  86. package/dist/frameworks/static/templates/wrangler.json +7 -0
  87. package/dist/frameworks/types.d.ts +138 -0
  88. package/dist/frameworks/types.d.ts.map +1 -0
  89. package/dist/frameworks/types.js +3 -0
  90. package/dist/frameworks/types.js.map +1 -0
  91. package/dist/frameworks/vite/index.d.ts +46 -0
  92. package/dist/frameworks/vite/index.d.ts.map +1 -0
  93. package/dist/frameworks/vite/index.js +303 -0
  94. package/dist/frameworks/vite/index.js.map +1 -0
  95. package/dist/frameworks/vite/templates/vite.config.ts.template +14 -0
  96. package/dist/frameworks/vite/templates/vite.config.webflow.ts +52 -0
  97. package/dist/frameworks/vite/templates/wrangler.json +10 -0
  98. package/dist/index.d.ts +44 -0
  99. package/dist/index.d.ts.map +1 -0
  100. package/dist/index.js +118 -0
  101. package/dist/index.js.map +1 -0
  102. package/dist/pipeline.d.ts +8 -0
  103. package/dist/pipeline.d.ts.map +1 -0
  104. package/dist/pipeline.js +263 -0
  105. package/dist/pipeline.js.map +1 -0
  106. package/dist/ports/command-runner.d.ts +60 -0
  107. package/dist/ports/command-runner.d.ts.map +1 -0
  108. package/dist/ports/command-runner.js +116 -0
  109. package/dist/ports/command-runner.js.map +1 -0
  110. package/dist/ports/filesystem.d.ts +19 -0
  111. package/dist/ports/filesystem.d.ts.map +1 -0
  112. package/dist/ports/filesystem.js +68 -0
  113. package/dist/ports/filesystem.js.map +1 -0
  114. package/dist/ports/index.d.ts +17 -0
  115. package/dist/ports/index.d.ts.map +1 -0
  116. package/dist/ports/index.js +14 -0
  117. package/dist/ports/index.js.map +1 -0
  118. package/dist/ports/logger.d.ts +22 -0
  119. package/dist/ports/logger.d.ts.map +1 -0
  120. package/dist/ports/logger.js +18 -0
  121. package/dist/ports/logger.js.map +1 -0
  122. package/dist/ports/telemetry.d.ts +23 -0
  123. package/dist/ports/telemetry.d.ts.map +1 -0
  124. package/dist/ports/telemetry.js +12 -0
  125. package/dist/ports/telemetry.js.map +1 -0
  126. package/dist/toolchain/errors.d.ts +32 -0
  127. package/dist/toolchain/errors.d.ts.map +1 -0
  128. package/dist/toolchain/errors.js +31 -0
  129. package/dist/toolchain/errors.js.map +1 -0
  130. package/dist/toolchain/resolver.d.ts +25 -0
  131. package/dist/toolchain/resolver.d.ts.map +1 -0
  132. package/dist/toolchain/resolver.js +200 -0
  133. package/dist/toolchain/resolver.js.map +1 -0
  134. package/dist/toolchain/types.d.ts +52 -0
  135. package/dist/toolchain/types.d.ts.map +1 -0
  136. package/dist/toolchain/types.js +10 -0
  137. package/dist/toolchain/types.js.map +1 -0
  138. package/dist/types.d.ts +66 -0
  139. package/dist/types.d.ts.map +1 -0
  140. package/dist/types.js +3 -0
  141. package/dist/types.js.map +1 -0
  142. package/dist/utils/fs.d.ts +29 -0
  143. package/dist/utils/fs.d.ts.map +1 -0
  144. package/dist/utils/fs.js +126 -0
  145. package/dist/utils/fs.js.map +1 -0
  146. package/dist/utils/index.d.ts +11 -0
  147. package/dist/utils/index.d.ts.map +1 -0
  148. package/dist/utils/index.js +27 -0
  149. package/dist/utils/index.js.map +1 -0
  150. package/dist/utils/node-version.d.ts +20 -0
  151. package/dist/utils/node-version.d.ts.map +1 -0
  152. package/dist/utils/node-version.js +113 -0
  153. package/dist/utils/node-version.js.map +1 -0
  154. package/dist/utils/process.d.ts +25 -0
  155. package/dist/utils/process.d.ts.map +1 -0
  156. package/dist/utils/process.js +40 -0
  157. package/dist/utils/process.js.map +1 -0
  158. package/dist/utils/reserved-env.d.ts +26 -0
  159. package/dist/utils/reserved-env.d.ts.map +1 -0
  160. package/dist/utils/reserved-env.js +51 -0
  161. package/dist/utils/reserved-env.js.map +1 -0
  162. package/dist/utils/template.d.ts +15 -0
  163. package/dist/utils/template.d.ts.map +1 -0
  164. package/dist/utils/template.js +75 -0
  165. package/dist/utils/template.js.map +1 -0
  166. package/dist/utils/version.d.ts +9 -0
  167. package/dist/utils/version.d.ts.map +1 -0
  168. package/dist/utils/version.js +52 -0
  169. package/dist/utils/version.js.map +1 -0
  170. package/dist/wrangler.d.ts +192 -0
  171. package/dist/wrangler.d.ts.map +1 -0
  172. package/dist/wrangler.js +246 -0
  173. package/dist/wrangler.js.map +1 -0
  174. package/package.json +47 -0
@@ -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,192 @@
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`.
187
+ * 3. Merge user `kv_namespaces` / `r2_buckets` / `d1_databases` into it.
188
+ * 4. Copy D1 migrations dirs into `clouduser/migrations/<dir>`.
189
+ */
190
+ export declare function handleWranglerJson(log: Logger, builder: FrameworkBuilder, cwd: string): void;
191
+ export {};
192
+ //# 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;AAW1D,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAoDR,CAAC;AAEjB,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,wBAAgB,gBAAgB,CAC9B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,MAAwB,GAC7B,YAAY,GAAG,SAAS,CA+B1B;AAOD;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAmI5F"}
@@ -0,0 +1,246 @@
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.loadWranglerJson = loadWranglerJson;
37
+ exports.handleWranglerJson = handleWranglerJson;
38
+ /**
39
+ * Build-phase wrangler.json synthesis.
40
+ *
41
+ * `handleWranglerJson` is the SOLE writer of wrangler.json during the build —
42
+ * it runs before `builder.prepareConfig()`, and framework builders must not
43
+ * touch the file. It backs up the user's wrangler aside as
44
+ * `clouduser.wrangler.json` (always `.json`, even from a `.jsonc` source, since
45
+ * the deployer hardcodes that path), copies the framework template into place,
46
+ * and merges the user's KV/R2/D1 bindings + D1 migrations.
47
+ *
48
+ * Deploy-phase wrangler generation (regenerating from the deployment-type
49
+ * template, binding namespacing) lives in the deployer/host, not here.
50
+ */
51
+ const fs = __importStar(require("node:fs"));
52
+ const path = __importStar(require("node:path"));
53
+ const zod_1 = require("zod");
54
+ const jsonc = __importStar(require("jsonc-parser"));
55
+ const utils_1 = require("./utils");
56
+ const webflow_json_1 = require("./config/webflow-json");
57
+ const bindings_1 = require("./bindings");
58
+ // Schema covers all wrangler.json variants we read: user source and framework
59
+ // template. `main` is optional because the user's source may omit it.
60
+ const wranglerJsonSchema = zod_1.z
61
+ .object({
62
+ name: zod_1.z.string(),
63
+ main: zod_1.z.string().optional(),
64
+ compatibility_date: zod_1.z.string(),
65
+ compatibility_flags: zod_1.z.array(zod_1.z.string()).optional(),
66
+ placement: zod_1.z
67
+ .object({
68
+ mode: zod_1.z.literal('smart'),
69
+ })
70
+ .passthrough()
71
+ .optional(),
72
+ assets: zod_1.z
73
+ .object({
74
+ directory: zod_1.z.string(),
75
+ binding: zod_1.z.string().optional(),
76
+ })
77
+ .passthrough()
78
+ .optional(),
79
+ d1_databases: zod_1.z
80
+ .array(zod_1.z
81
+ .object({
82
+ database_name: zod_1.z.string(),
83
+ database_id: zod_1.z.string(),
84
+ binding: zod_1.z.string(),
85
+ migrations_dir: zod_1.z.string().optional(),
86
+ })
87
+ .passthrough())
88
+ .default([]),
89
+ kv_namespaces: zod_1.z
90
+ .array(zod_1.z
91
+ .object({
92
+ binding: zod_1.z.string(),
93
+ id: zod_1.z.string(),
94
+ })
95
+ .passthrough())
96
+ .default([]),
97
+ r2_buckets: zod_1.z
98
+ .array(zod_1.z
99
+ .object({
100
+ binding: zod_1.z.string(),
101
+ bucket_name: zod_1.z.string(),
102
+ })
103
+ .passthrough())
104
+ .default([]),
105
+ })
106
+ .passthrough();
107
+ function loadWranglerJson(log, cwd, file = 'wrangler.json') {
108
+ const filePath = path.join(cwd, file);
109
+ if (!fs.statSync(filePath, { throwIfNoEntry: false })) {
110
+ if (file.endsWith('.json')) {
111
+ log?.warn(`${filePath} not found, checking for ${filePath}c`);
112
+ return loadWranglerJson(log, cwd, file + 'c');
113
+ }
114
+ log?.warn(`${filePath} not found`);
115
+ return undefined;
116
+ }
117
+ const raw = fs.readFileSync(filePath).toString('utf8');
118
+ log.debug(`read ${filePath}: ${JSON.stringify(raw)}`);
119
+ let unparsed;
120
+ try {
121
+ unparsed = jsonc.parse(raw);
122
+ }
123
+ catch (e) {
124
+ log?.error(`${filePath} loaded but could not parse as JSONC: ${e}`);
125
+ return undefined;
126
+ }
127
+ try {
128
+ const wranglerJson = wranglerJsonSchema.parse(unparsed);
129
+ log.debug(`loaded ${filePath}: ${JSON.stringify(wranglerJson)}`);
130
+ return wranglerJson;
131
+ }
132
+ catch (e) {
133
+ log?.error(`${filePath} valid JSONC but schema validation failed: ${e}`);
134
+ return undefined;
135
+ }
136
+ }
137
+ /** Whether a parsed wrangler.json declares any KV / R2 / D1 bindings. */
138
+ function hasLegacyBindings(w) {
139
+ return Boolean(w.kv_namespaces?.length || w.r2_buckets?.length || w.d1_databases?.length);
140
+ }
141
+ /**
142
+ * Sole writer of `wrangler.json` during the build. Runs before
143
+ * `builder.prepareConfig()`; frameworks must not touch the file.
144
+ *
145
+ * 1. Save user `wrangler.{json,jsonc}` as `clouduser.wrangler.json`.
146
+ * 2. Copy `builder.getWranglerTemplatePath()` over `wrangler.json`.
147
+ * 3. Merge user `kv_namespaces` / `r2_buckets` / `d1_databases` into it.
148
+ * 4. Copy D1 migrations dirs into `clouduser/migrations/<dir>`.
149
+ */
150
+ function handleWranglerJson(log, builder, cwd) {
151
+ // Find the user's wrangler config (prefer .json, fall back to .jsonc).
152
+ let originalFilePath = null;
153
+ const jsonPath = path.join(cwd, 'wrangler.json');
154
+ const jsoncPath = path.join(cwd, 'wrangler.jsonc');
155
+ if (fs.statSync(jsonPath, { throwIfNoEntry: false })) {
156
+ originalFilePath = jsonPath;
157
+ }
158
+ else if (fs.statSync(jsoncPath, { throwIfNoEntry: false })) {
159
+ originalFilePath = jsoncPath;
160
+ }
161
+ const legacyUserWrangler = originalFilePath
162
+ ? loadWranglerJson(log, cwd, path.basename(originalFilePath))
163
+ : undefined;
164
+ // Bindings declared in webflow.json (the canonical, user-facing surface) take
165
+ // precedence over a legacy user wrangler.json. Synthesize the same binding
166
+ // bridge from them so the rest of this function — and the deployer — are
167
+ // unchanged.
168
+ const webflowBindings = (0, bindings_1.parseBindings)((0, webflow_json_1.loadWebflowJson)(log, cwd)?.cloud?.bindings);
169
+ let userProvided;
170
+ if ((0, bindings_1.hasAnyBindings)(webflowBindings)) {
171
+ (0, bindings_1.validateBindings)(webflowBindings);
172
+ if (legacyUserWrangler && hasLegacyBindings(legacyUserWrangler)) {
173
+ log.warn('bindings declared in both webflow.json and wrangler.json; using webflow.json (the canonical source)');
174
+ }
175
+ log.info('using cloud bindings declared in webflow.json');
176
+ userProvided = (0, bindings_1.bindingsToWranglerJson)(webflowBindings, legacyUserWrangler?.name);
177
+ // Preserve a custom worker entry from a legacy wrangler.json, if present.
178
+ if (legacyUserWrangler?.main) {
179
+ userProvided.main = legacyUserWrangler.main;
180
+ }
181
+ }
182
+ else {
183
+ userProvided = legacyUserWrangler;
184
+ }
185
+ // Step 1: save the parsed user config as clouduser.wrangler.json. We always
186
+ // normalize to .json — even when the source is .jsonc — because every
187
+ // downstream consumer hardcodes that path. Comments in the user's .jsonc are
188
+ // stripped during parse; the bindings/migrations we consume survive intact.
189
+ if (userProvided) {
190
+ log.info(`saving user-provided wrangler JSON as ${cwd}/clouduser.wrangler.json...`);
191
+ fs.writeFileSync(path.join(cwd, 'clouduser.wrangler.json'), JSON.stringify(userProvided));
192
+ }
193
+ // Step 2: copy framework template into place. This is the ONLY write of
194
+ // wrangler.json during the build lifecycle.
195
+ const templatePath = builder.getWranglerTemplatePath();
196
+ const targetPath = path.join(cwd, 'wrangler.json');
197
+ if (!fs.statSync(templatePath, { throwIfNoEntry: false })) {
198
+ throw new Error(`Wrangler template not found at ${templatePath}. Make sure the template is properly copied during build.`);
199
+ }
200
+ log.info(`copying wrangler template for ${builder.info.name} to ${targetPath}`);
201
+ fs.copyFileSync(templatePath, targetPath);
202
+ if (!userProvided) {
203
+ log.debug('no user-provided wrangler.json found, skipping binding merge and migrations');
204
+ return;
205
+ }
206
+ // Step 3: merge user bindings (KV / R2 / D1) into the template wrangler.json.
207
+ const templateWrangler = JSON.parse(fs.readFileSync(targetPath, 'utf8'));
208
+ if (userProvided.kv_namespaces && userProvided.kv_namespaces.length > 0) {
209
+ templateWrangler.kv_namespaces = userProvided.kv_namespaces;
210
+ log.info(`merged ${userProvided.kv_namespaces.length} KV namespace(s) into template`);
211
+ }
212
+ if (userProvided.r2_buckets && userProvided.r2_buckets.length > 0) {
213
+ templateWrangler.r2_buckets = userProvided.r2_buckets;
214
+ log.info(`merged ${userProvided.r2_buckets.length} R2 bucket(s) into template`);
215
+ }
216
+ if (userProvided.d1_databases && userProvided.d1_databases.length > 0) {
217
+ templateWrangler.d1_databases = userProvided.d1_databases;
218
+ log.info(`merged ${userProvided.d1_databases.length} D1 database(s) into template`);
219
+ }
220
+ fs.writeFileSync(targetPath, JSON.stringify(templateWrangler, null, 2));
221
+ // Step 4: copy D1 migration dirs into clouduser/migrations/<dir> for the deployer.
222
+ if (userProvided.d1_databases.length === 0) {
223
+ log.debug('no d1_databases in user-provided wrangler.json, skipping migrations');
224
+ return;
225
+ }
226
+ for (const i in userProvided.d1_databases) {
227
+ const db = userProvided.d1_databases[i];
228
+ if (!db.migrations_dir) {
229
+ log.debug(`skipping migrations for database ${i} in wrangler.json; migrations dir is not defined`);
230
+ continue;
231
+ }
232
+ const migrationDir = db.migrations_dir;
233
+ if (!fs.statSync(path.join(cwd, migrationDir), { throwIfNoEntry: false })) {
234
+ log.debug(`skipping migrations for database ${i} in wrangler.json; migrations dir (${path.join(cwd, migrationDir)}) does not exist`);
235
+ continue;
236
+ }
237
+ const filesCount = (0, utils_1.recursiveCopy)(log, path.join(cwd, migrationDir), path.join(cwd, 'clouduser', 'migrations', migrationDir));
238
+ if (filesCount > 0) {
239
+ log.info(`copied ${filesCount} migration(s) to ${path.join(cwd, 'clouduser', 'migrations', migrationDir)}`);
240
+ }
241
+ else {
242
+ log.debug(`skipping migrations for database ${i} in wrangler.json; migrations dir (${path.join(cwd, migrationDir)}) is empty`);
243
+ }
244
+ }
245
+ }
246
+ //# sourceMappingURL=wrangler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wrangler.js","sourceRoot":"","sources":["../src/wrangler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,4CAmCC;AAgBD,gDAmIC;AA9QD;;;;;;;;;;;;GAYG;AACH,4CAA8B;AAC9B,gDAAkC;AAElC,6BAAwB;AACxB,oDAAsC;AAGtC,mCAAwC;AAExC,wDAAwD;AACxD,yCAKoB;AAEpB,8EAA8E;AAC9E,sEAAsE;AACtE,MAAM,kBAAkB,GAAG,OAAC;KACzB,MAAM,CAAC;IACN,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC9B,mBAAmB,EAAE,OAAC,CAAC,KA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AC,IAAI,CAClF,GAAG,EACH,YAAY,CACb,YAAY,CACd,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@webflow/cloud-app",
3
+ "version": "0.1.0-beta.7",
4
+ "description": "Build a JS framework app (Vite, Next.js, Astro) into a Webflow Cloud (Cloudflare Workers) bundle. Framework detection, adapter injection, and config generation are handled for you — declare what you need in webflow.json and nothing else.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/webflow/webflow-cli.git",
9
+ "directory": "apps/webflow-cloud-app"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "main": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "files": [
17
+ "dist",
18
+ "README.md",
19
+ "LICENSE"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsc && node scripts/copy-templates.mjs",
23
+ "test": "jest --ci",
24
+ "test:unit": "jest --ci",
25
+ "test:local": "jest",
26
+ "type-check": "tsc --noEmit",
27
+ "prepublishOnly": "npm run build"
28
+ },
29
+ "dependencies": {
30
+ "@webflow/cosmic-deploy-contract": "^1.1.0",
31
+ "jsonc-parser": "^3.3.1",
32
+ "semver": "^7.7.2",
33
+ "zod": "^3.25.57"
34
+ },
35
+ "devDependencies": {
36
+ "@types/jest": "^30.0.0",
37
+ "@types/node": "^20.0.0",
38
+ "@types/semver": "^7.5.8",
39
+ "jest": "^30.0.3",
40
+ "ts-jest": "^29.4.0",
41
+ "tsconfig": "*",
42
+ "typescript": "^5"
43
+ },
44
+ "engines": {
45
+ "node": ">=20"
46
+ }
47
+ }