wrangler 2.4.4 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/wrangler.js +20 -8
- package/miniflare-dist/index.mjs +90 -41
- package/package.json +3 -3
- package/src/__tests__/configuration.test.ts +211 -0
- package/src/__tests__/delete.test.ts +81 -48
- package/src/__tests__/dev.test.tsx +25 -8
- package/src/__tests__/helpers/mock-oauth-flow.ts +5 -1
- package/src/__tests__/helpers/msw/handlers/oauth.ts +13 -18
- package/src/__tests__/init.test.ts +18 -3
- package/src/__tests__/logout.test.ts +47 -0
- package/src/__tests__/metrics.test.ts +88 -43
- package/src/__tests__/pages-deployment-tail.test.ts +165 -101
- package/src/__tests__/publish.test.ts +94 -7
- package/src/__tests__/pubsub.test.ts +208 -88
- package/src/__tests__/queues.test.ts +155 -67
- package/src/__tests__/tail.test.ts +207 -108
- package/src/__tests__/type-generation.test.ts +7 -0
- package/src/__tests__/user.test.ts +43 -69
- package/src/config/environment.ts +16 -0
- package/src/config/index.ts +31 -8
- package/src/config/validation.ts +49 -0
- package/src/create-worker-upload-form.ts +9 -0
- package/src/d1/backups.tsx +7 -2
- package/src/d1/delete.tsx +4 -4
- package/src/d1/index.ts +2 -0
- package/src/d1/migrations/apply.tsx +6 -5
- package/src/d1/migrations/helpers.ts +4 -2
- package/src/d1/migrations/list.tsx +2 -2
- package/src/d1/migrations/options.ts +18 -0
- package/src/dev/dev.tsx +46 -22
- package/src/dev/local.tsx +63 -29
- package/src/dev/start-server.ts +18 -21
- package/src/dev.tsx +33 -13
- package/src/git-client.ts +15 -4
- package/src/index.tsx +1 -0
- package/src/init.ts +8 -0
- package/src/miniflare-cli/assets.ts +55 -28
- package/src/miniflare-cli/index.ts +2 -1
- package/src/pages/dev.tsx +7 -0
- package/src/proxy.ts +5 -0
- package/src/publish/publish.ts +1 -0
- package/src/secret/index.ts +1 -0
- package/src/type-generation.ts +10 -2
- package/src/worker.ts +6 -0
- package/wrangler-dist/cli.d.ts +15 -0
- package/wrangler-dist/cli.js +2045 -636
package/src/publish/publish.ts
CHANGED
|
@@ -540,6 +540,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
540
540
|
r2_buckets: config.r2_buckets,
|
|
541
541
|
d1_databases: identifyD1BindingsAsBeta(config.d1_databases),
|
|
542
542
|
services: config.services,
|
|
543
|
+
analytics_engine_datasets: config.analytics_engine_datasets,
|
|
543
544
|
dispatch_namespaces: config.dispatch_namespaces,
|
|
544
545
|
logfwdr: config.logfwdr,
|
|
545
546
|
unsafe: config.unsafe?.bindings,
|
package/src/secret/index.ts
CHANGED
package/src/type-generation.ts
CHANGED
|
@@ -59,6 +59,14 @@ export async function generateTypes(
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
if (configToDTS.analytics_engine_datasets) {
|
|
63
|
+
for (const analyticsEngine of configToDTS.analytics_engine_datasets) {
|
|
64
|
+
envTypeStructure.push(
|
|
65
|
+
`${analyticsEngine.binding}: AnalyticsEngineDataset;`
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
62
70
|
if (configToDTS.dispatch_namespaces) {
|
|
63
71
|
for (const namespace of configToDTS.dispatch_namespaces) {
|
|
64
72
|
envTypeStructure.push(`${namespace.binding}: any;`);
|
|
@@ -156,11 +164,11 @@ function writeDTSFile({
|
|
|
156
164
|
if (formatType === "modules") {
|
|
157
165
|
combinedTypeStrings += `interface Env {\n${envTypeStructure
|
|
158
166
|
.map((value) => `\t${value}`)
|
|
159
|
-
.join("\n")}
|
|
167
|
+
.join("\n")}\n}\n${modulesTypeStructure.join("\n")}`;
|
|
160
168
|
} else {
|
|
161
169
|
combinedTypeStrings += `export {};\ndeclare global {\n${envTypeStructure
|
|
162
170
|
.map((value) => `\tconst ${value}`)
|
|
163
|
-
.join("\n")}
|
|
171
|
+
.join("\n")}\n}\n${modulesTypeStructure.join("\n")}`;
|
|
164
172
|
}
|
|
165
173
|
|
|
166
174
|
if (envTypeStructure.length || modulesTypeStructure.length) {
|
package/src/worker.ts
CHANGED
|
@@ -144,6 +144,11 @@ interface CfService {
|
|
|
144
144
|
environment?: string;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
+
interface CfAnalyticsEngineDataset {
|
|
148
|
+
binding: string;
|
|
149
|
+
dataset?: string;
|
|
150
|
+
}
|
|
151
|
+
|
|
147
152
|
interface CfDispatchNamespace {
|
|
148
153
|
binding: string;
|
|
149
154
|
namespace: string;
|
|
@@ -207,6 +212,7 @@ export interface CfWorkerInit {
|
|
|
207
212
|
r2_buckets: CfR2Bucket[] | undefined;
|
|
208
213
|
d1_databases: CfD1Database[] | undefined;
|
|
209
214
|
services: CfService[] | undefined;
|
|
215
|
+
analytics_engine_datasets: CfAnalyticsEngineDataset[] | undefined;
|
|
210
216
|
dispatch_namespaces: CfDispatchNamespace[] | undefined;
|
|
211
217
|
logfwdr: CfLogfwdr | undefined;
|
|
212
218
|
unsafe: CfUnsafeBinding[] | undefined;
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -527,6 +527,21 @@ declare interface EnvironmentNonInheritable {
|
|
|
527
527
|
/** The environment of the service (e.g. production, staging, etc). */
|
|
528
528
|
environment?: string;
|
|
529
529
|
}[] | undefined;
|
|
530
|
+
/**
|
|
531
|
+
* Specifies analytics engine datasets that are bound to this Worker environment.
|
|
532
|
+
*
|
|
533
|
+
* NOTE: This field is not automatically inherited from the top level environment,
|
|
534
|
+
* and so must be specified in every named environment.
|
|
535
|
+
*
|
|
536
|
+
* @default `[]`
|
|
537
|
+
* @nonInheritable
|
|
538
|
+
*/
|
|
539
|
+
analytics_engine_datasets: {
|
|
540
|
+
/** The binding name used to refer to the dataset in the worker. */
|
|
541
|
+
binding: string;
|
|
542
|
+
/** The name of this dataset to write to. */
|
|
543
|
+
dataset?: string;
|
|
544
|
+
}[];
|
|
530
545
|
/**
|
|
531
546
|
* "Unsafe" tables for features that aren't directly supported by wrangler.
|
|
532
547
|
*
|