create-cloudflare 0.0.0-6c47355a → 0.0.0-6c85e067
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/dist/cli.js +817 -685
- package/package.json +4 -4
- package/templates/analog/c3.ts +134 -0
- package/templates/analog/snippets/devBindingsModule.ts +7 -0
- package/templates/analog/templates/env.d.ts +13 -0
- package/templates/analog/templates/src/dev-bindings.ts +18 -0
- package/templates/analog/templates/worker-configuration.d.ts +4 -0
- package/templates/analog/templates/wrangler.toml +78 -0
- package/templates/astro/templates/wrangler.toml +1 -0
- package/templates/common/js/wrangler.toml +1 -0
- package/templates/common/ts/wrangler.toml +1 -0
- package/templates/hello-world/js/package.json +2 -1
- package/templates/hello-world/js/test/index.spec.js +1 -1
- package/templates/hello-world/js/wrangler.toml +1 -0
- package/templates/hello-world/ts/test/index.spec.ts +2 -2
- package/templates/hello-world/ts/wrangler.toml +1 -0
- package/templates/hello-world-durable-object/js/wrangler.toml +1 -0
- package/templates/hello-world-durable-object/ts/wrangler.toml +1 -0
- package/templates/hello-world-python/py/wrangler.toml +95 -0
- package/templates/next/wrangler.toml +1 -0
- package/templates/nuxt/c3.ts +1 -1
- package/templates/nuxt/templates/wrangler.toml +1 -0
- package/templates/openapi/ts/wrangler.toml +1 -0
- package/templates/pre-existing/js/wrangler.toml +1 -0
- package/templates/queues/js/wrangler.toml +1 -0
- package/templates/queues/ts/wrangler.toml +1 -0
- package/templates/qwik/templates/wrangler.toml +1 -0
- package/templates/remix/templates/wrangler.toml +1 -0
- package/templates/scheduled/js/wrangler.toml +1 -0
- package/templates/scheduled/ts/wrangler.toml +1 -0
- package/templates/svelte/js/wrangler.toml +1 -0
- package/templates/svelte/ts/wrangler.toml +1 -0
package/dist/cli.js
CHANGED
|
@@ -3569,37 +3569,37 @@ var init_interactive = __esm({
|
|
|
3569
3569
|
}
|
|
3570
3570
|
return input;
|
|
3571
3571
|
};
|
|
3572
|
-
renderSubmit = (
|
|
3573
|
-
const { question, label } =
|
|
3574
|
-
if (
|
|
3572
|
+
renderSubmit = (config14, value) => {
|
|
3573
|
+
const { question, label } = config14;
|
|
3574
|
+
if (config14.type !== "confirm" && value.length === 0) {
|
|
3575
3575
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
3576
3576
|
}
|
|
3577
|
-
const content =
|
|
3577
|
+
const content = config14.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
|
|
3578
3578
|
return [`${leftT} ${question}`, content, `${grayBar}`];
|
|
3579
3579
|
};
|
|
3580
3580
|
handleCancel = () => {
|
|
3581
3581
|
cancel("Operation cancelled.");
|
|
3582
3582
|
process.exit(0);
|
|
3583
3583
|
};
|
|
3584
|
-
getRenderers = (
|
|
3585
|
-
switch (
|
|
3584
|
+
getRenderers = (config14) => {
|
|
3585
|
+
switch (config14.type) {
|
|
3586
3586
|
case "select":
|
|
3587
|
-
return getSelectRenderers(
|
|
3587
|
+
return getSelectRenderers(config14);
|
|
3588
3588
|
case "confirm":
|
|
3589
|
-
return getConfirmRenderers(
|
|
3589
|
+
return getConfirmRenderers(config14);
|
|
3590
3590
|
case "text":
|
|
3591
|
-
return getTextRenderers(
|
|
3591
|
+
return getTextRenderers(config14);
|
|
3592
3592
|
case "multiselect":
|
|
3593
|
-
return getSelectRenderers(
|
|
3593
|
+
return getSelectRenderers(config14);
|
|
3594
3594
|
case "list":
|
|
3595
|
-
return getSelectListRenderers(
|
|
3595
|
+
return getSelectListRenderers(config14);
|
|
3596
3596
|
}
|
|
3597
3597
|
};
|
|
3598
|
-
getTextRenderers = (
|
|
3599
|
-
const { question } =
|
|
3600
|
-
const helpText =
|
|
3601
|
-
const format5 =
|
|
3602
|
-
const defaultValue =
|
|
3598
|
+
getTextRenderers = (config14) => {
|
|
3599
|
+
const { question } = config14;
|
|
3600
|
+
const helpText = config14.helpText ?? "";
|
|
3601
|
+
const format5 = config14.format ?? ((val) => String(val));
|
|
3602
|
+
const defaultValue = config14.defaultValue?.toString() ?? "";
|
|
3603
3603
|
return {
|
|
3604
3604
|
initial: () => [
|
|
3605
3605
|
`${blCorner} ${bold(question)} ${dim(helpText)}`,
|
|
@@ -3621,14 +3621,14 @@ var init_interactive = __esm({
|
|
|
3621
3621
|
``
|
|
3622
3622
|
// extra line for readability
|
|
3623
3623
|
],
|
|
3624
|
-
submit: ({ value }) => renderSubmit(
|
|
3624
|
+
submit: ({ value }) => renderSubmit(config14, format5(value ?? "")),
|
|
3625
3625
|
cancel: handleCancel
|
|
3626
3626
|
};
|
|
3627
3627
|
};
|
|
3628
|
-
getSelectRenderers = (
|
|
3629
|
-
const { options, question, helpText: _helpText } =
|
|
3628
|
+
getSelectRenderers = (config14) => {
|
|
3629
|
+
const { options, question, helpText: _helpText } = config14;
|
|
3630
3630
|
const helpText = _helpText ?? "";
|
|
3631
|
-
const maxItemsPerPage =
|
|
3631
|
+
const maxItemsPerPage = config14.maxItemsPerPage ?? 32;
|
|
3632
3632
|
const defaultRenderer = ({ cursor, value }) => {
|
|
3633
3633
|
cursor = cursor ?? 0;
|
|
3634
3634
|
const renderOption = (opt, i) => {
|
|
@@ -3675,21 +3675,21 @@ ${space(2)}${dim("...")}` : ""}`,
|
|
|
3675
3675
|
submit: ({ value }) => {
|
|
3676
3676
|
if (Array.isArray(value)) {
|
|
3677
3677
|
return renderSubmit(
|
|
3678
|
-
|
|
3678
|
+
config14,
|
|
3679
3679
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
3680
3680
|
);
|
|
3681
3681
|
}
|
|
3682
3682
|
return renderSubmit(
|
|
3683
|
-
|
|
3683
|
+
config14,
|
|
3684
3684
|
options.find((o) => o.value === value)?.label
|
|
3685
3685
|
);
|
|
3686
3686
|
},
|
|
3687
3687
|
cancel: handleCancel
|
|
3688
3688
|
};
|
|
3689
3689
|
};
|
|
3690
|
-
getSelectListRenderers = (
|
|
3691
|
-
const { question, helpText: _helpText } =
|
|
3692
|
-
let options =
|
|
3690
|
+
getSelectListRenderers = (config14) => {
|
|
3691
|
+
const { question, helpText: _helpText } = config14;
|
|
3692
|
+
let options = config14.options;
|
|
3693
3693
|
const helpText = _helpText ?? "";
|
|
3694
3694
|
const { rows } = stdout;
|
|
3695
3695
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -3770,20 +3770,20 @@ ${space(2)}${dim("...")}` : ""}`,
|
|
|
3770
3770
|
submit: ({ value }) => {
|
|
3771
3771
|
if (Array.isArray(value)) {
|
|
3772
3772
|
return renderSubmit(
|
|
3773
|
-
|
|
3773
|
+
config14,
|
|
3774
3774
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
3775
3775
|
);
|
|
3776
3776
|
}
|
|
3777
3777
|
return renderSubmit(
|
|
3778
|
-
|
|
3778
|
+
config14,
|
|
3779
3779
|
options.find((o) => o.value === value)?.value
|
|
3780
3780
|
);
|
|
3781
3781
|
},
|
|
3782
3782
|
cancel: handleCancel
|
|
3783
3783
|
};
|
|
3784
3784
|
};
|
|
3785
|
-
getConfirmRenderers = (
|
|
3786
|
-
const { activeText, inactiveText, question, helpText: _helpText } =
|
|
3785
|
+
getConfirmRenderers = (config14) => {
|
|
3786
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config14;
|
|
3787
3787
|
const helpText = _helpText ?? "";
|
|
3788
3788
|
const active = activeText || "Yes";
|
|
3789
3789
|
const inactive = inactiveText || "No";
|
|
@@ -3800,7 +3800,7 @@ ${space(2)}${dim("...")}` : ""}`,
|
|
|
3800
3800
|
active: defaultRenderer,
|
|
3801
3801
|
confirm: defaultRenderer,
|
|
3802
3802
|
error: defaultRenderer,
|
|
3803
|
-
submit: ({ value }) => renderSubmit(
|
|
3803
|
+
submit: ({ value }) => renderSubmit(config14, value ? "yes" : "no"),
|
|
3804
3804
|
cancel: handleCancel
|
|
3805
3805
|
};
|
|
3806
3806
|
};
|
|
@@ -3897,7 +3897,7 @@ var init_args = __esm({
|
|
|
3897
3897
|
var version, devDependencies;
|
|
3898
3898
|
var init_package = __esm({
|
|
3899
3899
|
"package.json"() {
|
|
3900
|
-
version = "0.0.0-
|
|
3900
|
+
version = "0.0.0-6c85e067";
|
|
3901
3901
|
devDependencies = {
|
|
3902
3902
|
"@babel/parser": "^7.21.3",
|
|
3903
3903
|
"@babel/types": "^7.21.4",
|
|
@@ -3905,7 +3905,7 @@ var init_package = __esm({
|
|
|
3905
3905
|
"@cloudflare/cli": "workspace:*",
|
|
3906
3906
|
"@cloudflare/eslint-config-worker": "*",
|
|
3907
3907
|
"@cloudflare/workers-tsconfig": "workspace:*",
|
|
3908
|
-
"@cloudflare/workers-types": "^4.
|
|
3908
|
+
"@cloudflare/workers-types": "^4.20240405.0",
|
|
3909
3909
|
"@iarna/toml": "^3.0.0",
|
|
3910
3910
|
"@types/command-exists": "^1.2.0",
|
|
3911
3911
|
"@types/cross-spawn": "^6.0.2",
|
|
@@ -7065,7 +7065,7 @@ var init_packageManagers = __esm({
|
|
|
7065
7065
|
}
|
|
7066
7066
|
};
|
|
7067
7067
|
rectifyPmMismatch = async (ctx) => {
|
|
7068
|
-
const { npm:
|
|
7068
|
+
const { npm: npm14 } = detectPackageManager();
|
|
7069
7069
|
if (!detectPmMismatch(ctx)) {
|
|
7070
7070
|
return;
|
|
7071
7071
|
}
|
|
@@ -7075,17 +7075,17 @@ var init_packageManagers = __esm({
|
|
|
7075
7075
|
const lockfilePath = import_path5.default.join(ctx.project.path, "package-lock.json");
|
|
7076
7076
|
if ((0, import_fs5.existsSync)(lockfilePath))
|
|
7077
7077
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
7078
|
-
await runCommand([
|
|
7078
|
+
await runCommand([npm14, "install"], {
|
|
7079
7079
|
silent: true,
|
|
7080
7080
|
cwd: ctx.project.path,
|
|
7081
7081
|
startText: "Installing dependencies",
|
|
7082
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
7082
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
|
|
7083
7083
|
});
|
|
7084
7084
|
};
|
|
7085
7085
|
detectPmMismatch = (ctx) => {
|
|
7086
|
-
const { npm:
|
|
7086
|
+
const { npm: npm14 } = detectPackageManager();
|
|
7087
7087
|
const projectPath = ctx.project.path;
|
|
7088
|
-
switch (
|
|
7088
|
+
switch (npm14) {
|
|
7089
7089
|
case "npm":
|
|
7090
7090
|
return false;
|
|
7091
7091
|
case "yarn":
|
|
@@ -7509,22 +7509,22 @@ var require_dist_web = __commonJS({
|
|
|
7509
7509
|
_createClass(Haikunator3, [{
|
|
7510
7510
|
key: "haikunate",
|
|
7511
7511
|
value: function haikunate(options) {
|
|
7512
|
-
var
|
|
7513
|
-
if (
|
|
7514
|
-
|
|
7512
|
+
var config14 = (0, _lodash["default"])(options, this.config);
|
|
7513
|
+
if (config14.tokenHex === true) {
|
|
7514
|
+
config14.tokenChars = "0123456789abcdef";
|
|
7515
7515
|
}
|
|
7516
7516
|
var adjective = this._randomElement(this.adjectives);
|
|
7517
7517
|
var noun = this._randomElement(this.nouns);
|
|
7518
|
-
if (!
|
|
7519
|
-
|
|
7518
|
+
if (!config14.tokenLength)
|
|
7519
|
+
config14.tokenLength = 0;
|
|
7520
7520
|
var token = "";
|
|
7521
|
-
for (var i = 0; i <
|
|
7522
|
-
token += this._randomElement(
|
|
7521
|
+
for (var i = 0; i < config14.tokenLength; i++) {
|
|
7522
|
+
token += this._randomElement(config14.tokenChars);
|
|
7523
7523
|
}
|
|
7524
7524
|
var sections = [adjective, noun, token];
|
|
7525
7525
|
return sections.filter(function(e) {
|
|
7526
7526
|
return !!e;
|
|
7527
|
-
}).join(
|
|
7527
|
+
}).join(config14.delimiter);
|
|
7528
7528
|
}
|
|
7529
7529
|
/**
|
|
7530
7530
|
* Get a random element from an array/string
|
|
@@ -11101,7 +11101,7 @@ var require_symbols2 = __commonJS({
|
|
|
11101
11101
|
var require_webidl = __commonJS({
|
|
11102
11102
|
"../../node_modules/.pnpm/undici@5.28.3/node_modules/undici/lib/fetch/webidl.js"(exports2, module2) {
|
|
11103
11103
|
"use strict";
|
|
11104
|
-
var { types:
|
|
11104
|
+
var { types: types7 } = require("util");
|
|
11105
11105
|
var { hasOwn, toUSVString } = require_util2();
|
|
11106
11106
|
var webidl = {};
|
|
11107
11107
|
webidl.converters = {};
|
|
@@ -11266,7 +11266,7 @@ var require_webidl = __commonJS({
|
|
|
11266
11266
|
});
|
|
11267
11267
|
}
|
|
11268
11268
|
const result = {};
|
|
11269
|
-
if (!
|
|
11269
|
+
if (!types7.isProxy(O2)) {
|
|
11270
11270
|
const keys2 = Object.keys(O2);
|
|
11271
11271
|
for (const key of keys2) {
|
|
11272
11272
|
const typedKey = keyConverter(key);
|
|
@@ -11392,14 +11392,14 @@ var require_webidl = __commonJS({
|
|
|
11392
11392
|
return x2;
|
|
11393
11393
|
};
|
|
11394
11394
|
webidl.converters.ArrayBuffer = function(V2, opts = {}) {
|
|
11395
|
-
if (webidl.util.Type(V2) !== "Object" || !
|
|
11395
|
+
if (webidl.util.Type(V2) !== "Object" || !types7.isAnyArrayBuffer(V2)) {
|
|
11396
11396
|
throw webidl.errors.conversionFailed({
|
|
11397
11397
|
prefix: `${V2}`,
|
|
11398
11398
|
argument: `${V2}`,
|
|
11399
11399
|
types: ["ArrayBuffer"]
|
|
11400
11400
|
});
|
|
11401
11401
|
}
|
|
11402
|
-
if (opts.allowShared === false &&
|
|
11402
|
+
if (opts.allowShared === false && types7.isSharedArrayBuffer(V2)) {
|
|
11403
11403
|
throw webidl.errors.exception({
|
|
11404
11404
|
header: "ArrayBuffer",
|
|
11405
11405
|
message: "SharedArrayBuffer is not allowed."
|
|
@@ -11408,14 +11408,14 @@ var require_webidl = __commonJS({
|
|
|
11408
11408
|
return V2;
|
|
11409
11409
|
};
|
|
11410
11410
|
webidl.converters.TypedArray = function(V2, T2, opts = {}) {
|
|
11411
|
-
if (webidl.util.Type(V2) !== "Object" || !
|
|
11411
|
+
if (webidl.util.Type(V2) !== "Object" || !types7.isTypedArray(V2) || V2.constructor.name !== T2.name) {
|
|
11412
11412
|
throw webidl.errors.conversionFailed({
|
|
11413
11413
|
prefix: `${T2.name}`,
|
|
11414
11414
|
argument: `${V2}`,
|
|
11415
11415
|
types: [T2.name]
|
|
11416
11416
|
});
|
|
11417
11417
|
}
|
|
11418
|
-
if (opts.allowShared === false &&
|
|
11418
|
+
if (opts.allowShared === false && types7.isSharedArrayBuffer(V2.buffer)) {
|
|
11419
11419
|
throw webidl.errors.exception({
|
|
11420
11420
|
header: "ArrayBuffer",
|
|
11421
11421
|
message: "SharedArrayBuffer is not allowed."
|
|
@@ -11424,13 +11424,13 @@ var require_webidl = __commonJS({
|
|
|
11424
11424
|
return V2;
|
|
11425
11425
|
};
|
|
11426
11426
|
webidl.converters.DataView = function(V2, opts = {}) {
|
|
11427
|
-
if (webidl.util.Type(V2) !== "Object" || !
|
|
11427
|
+
if (webidl.util.Type(V2) !== "Object" || !types7.isDataView(V2)) {
|
|
11428
11428
|
throw webidl.errors.exception({
|
|
11429
11429
|
header: "DataView",
|
|
11430
11430
|
message: "Object is not a DataView."
|
|
11431
11431
|
});
|
|
11432
11432
|
}
|
|
11433
|
-
if (opts.allowShared === false &&
|
|
11433
|
+
if (opts.allowShared === false && types7.isSharedArrayBuffer(V2.buffer)) {
|
|
11434
11434
|
throw webidl.errors.exception({
|
|
11435
11435
|
header: "ArrayBuffer",
|
|
11436
11436
|
message: "SharedArrayBuffer is not allowed."
|
|
@@ -11439,13 +11439,13 @@ var require_webidl = __commonJS({
|
|
|
11439
11439
|
return V2;
|
|
11440
11440
|
};
|
|
11441
11441
|
webidl.converters.BufferSource = function(V2, opts = {}) {
|
|
11442
|
-
if (
|
|
11442
|
+
if (types7.isAnyArrayBuffer(V2)) {
|
|
11443
11443
|
return webidl.converters.ArrayBuffer(V2, opts);
|
|
11444
11444
|
}
|
|
11445
|
-
if (
|
|
11445
|
+
if (types7.isTypedArray(V2)) {
|
|
11446
11446
|
return webidl.converters.TypedArray(V2, V2.constructor);
|
|
11447
11447
|
}
|
|
11448
|
-
if (
|
|
11448
|
+
if (types7.isDataView(V2)) {
|
|
11449
11449
|
return webidl.converters.DataView(V2, opts);
|
|
11450
11450
|
}
|
|
11451
11451
|
throw new TypeError(`Could not convert ${V2} to a BufferSource.`);
|
|
@@ -11760,7 +11760,7 @@ var require_file = __commonJS({
|
|
|
11760
11760
|
"../../node_modules/.pnpm/undici@5.28.3/node_modules/undici/lib/fetch/file.js"(exports2, module2) {
|
|
11761
11761
|
"use strict";
|
|
11762
11762
|
var { Blob: Blob2, File: NativeFile } = require("buffer");
|
|
11763
|
-
var { types:
|
|
11763
|
+
var { types: types7 } = require("util");
|
|
11764
11764
|
var { kState } = require_symbols2();
|
|
11765
11765
|
var { isBlobLike } = require_util2();
|
|
11766
11766
|
var { webidl } = require_webidl();
|
|
@@ -11869,7 +11869,7 @@ var require_file = __commonJS({
|
|
|
11869
11869
|
if (isBlobLike(V2)) {
|
|
11870
11870
|
return webidl.converters.Blob(V2, { strict: false });
|
|
11871
11871
|
}
|
|
11872
|
-
if (ArrayBuffer.isView(V2) ||
|
|
11872
|
+
if (ArrayBuffer.isView(V2) || types7.isAnyArrayBuffer(V2)) {
|
|
11873
11873
|
return webidl.converters.BufferSource(V2, opts);
|
|
11874
11874
|
}
|
|
11875
11875
|
}
|
|
@@ -11913,7 +11913,7 @@ var require_file = __commonJS({
|
|
|
11913
11913
|
s = convertLineEndingsNative(s);
|
|
11914
11914
|
}
|
|
11915
11915
|
bytes.push(encoder.encode(s));
|
|
11916
|
-
} else if (
|
|
11916
|
+
} else if (types7.isAnyArrayBuffer(element) || types7.isTypedArray(element)) {
|
|
11917
11917
|
if (!element.buffer) {
|
|
11918
11918
|
bytes.push(new Uint8Array(element));
|
|
11919
11919
|
} else {
|
|
@@ -18802,7 +18802,7 @@ var require_response = __commonJS({
|
|
|
18802
18802
|
var { URLSerializer } = require_dataURL();
|
|
18803
18803
|
var { kHeadersList, kConstruct } = require_symbols();
|
|
18804
18804
|
var assert = require("assert");
|
|
18805
|
-
var { types:
|
|
18805
|
+
var { types: types7 } = require("util");
|
|
18806
18806
|
var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream;
|
|
18807
18807
|
var textEncoder = new TextEncoder("utf-8");
|
|
18808
18808
|
var Response = class {
|
|
@@ -19105,7 +19105,7 @@ var require_response = __commonJS({
|
|
|
19105
19105
|
if (isBlobLike(V2)) {
|
|
19106
19106
|
return webidl.converters.Blob(V2, { strict: false });
|
|
19107
19107
|
}
|
|
19108
|
-
if (
|
|
19108
|
+
if (types7.isArrayBuffer(V2) || types7.isTypedArray(V2) || types7.isDataView(V2)) {
|
|
19109
19109
|
return webidl.converters.BufferSource(V2);
|
|
19110
19110
|
}
|
|
19111
19111
|
if (util.isFormDataLike(V2)) {
|
|
@@ -21211,7 +21211,7 @@ var require_util4 = __commonJS({
|
|
|
21211
21211
|
var { getEncoding } = require_encoding();
|
|
21212
21212
|
var { DOMException: DOMException2 } = require_constants2();
|
|
21213
21213
|
var { serializeAMimeType, parseMIMEType } = require_dataURL();
|
|
21214
|
-
var { types:
|
|
21214
|
+
var { types: types7 } = require("util");
|
|
21215
21215
|
var { StringDecoder } = require("string_decoder");
|
|
21216
21216
|
var { btoa: btoa2 } = require("buffer");
|
|
21217
21217
|
var staticPropertyDescriptors = {
|
|
@@ -21241,7 +21241,7 @@ var require_util4 = __commonJS({
|
|
|
21241
21241
|
});
|
|
21242
21242
|
}
|
|
21243
21243
|
isFirstChunk = false;
|
|
21244
|
-
if (!done &&
|
|
21244
|
+
if (!done && types7.isUint8Array(value)) {
|
|
21245
21245
|
bytes.push(value);
|
|
21246
21246
|
if ((fr[kLastProgressEventFired] === void 0 || Date.now() - fr[kLastProgressEventFired] >= 50) && !fr[kAborted]) {
|
|
21247
21247
|
fr[kLastProgressEventFired] = Date.now();
|
|
@@ -23623,7 +23623,7 @@ var require_websocket = __commonJS({
|
|
|
23623
23623
|
var { ByteParser } = require_receiver();
|
|
23624
23624
|
var { kEnumerableProperty, isBlobLike } = require_util();
|
|
23625
23625
|
var { getGlobalDispatcher } = require_global2();
|
|
23626
|
-
var { types:
|
|
23626
|
+
var { types: types7 } = require("util");
|
|
23627
23627
|
var experimentalWarned = false;
|
|
23628
23628
|
var WebSocket = class extends EventTarget {
|
|
23629
23629
|
#events = {
|
|
@@ -23770,7 +23770,7 @@ var require_websocket = __commonJS({
|
|
|
23770
23770
|
socket.write(buffer, () => {
|
|
23771
23771
|
this.#bufferedAmount -= value.byteLength;
|
|
23772
23772
|
});
|
|
23773
|
-
} else if (
|
|
23773
|
+
} else if (types7.isArrayBuffer(data)) {
|
|
23774
23774
|
const value = Buffer.from(data);
|
|
23775
23775
|
const frame = new WebsocketFrameSend(value);
|
|
23776
23776
|
const buffer = frame.createFrame(opcodes.BINARY);
|
|
@@ -23992,7 +23992,7 @@ var require_websocket = __commonJS({
|
|
|
23992
23992
|
if (isBlobLike(V2)) {
|
|
23993
23993
|
return webidl.converters.Blob(V2, { strict: false });
|
|
23994
23994
|
}
|
|
23995
|
-
if (ArrayBuffer.isView(V2) ||
|
|
23995
|
+
if (ArrayBuffer.isView(V2) || types7.isAnyArrayBuffer(V2)) {
|
|
23996
23996
|
return webidl.converters.BufferSource(V2);
|
|
23997
23997
|
}
|
|
23998
23998
|
}
|
|
@@ -24158,28 +24158,28 @@ var init_packages = __esm({
|
|
|
24158
24158
|
import_undici = __toESM(require_undici());
|
|
24159
24159
|
init_command();
|
|
24160
24160
|
init_packageManagers();
|
|
24161
|
-
installPackages = async (packages,
|
|
24162
|
-
const { npm:
|
|
24161
|
+
installPackages = async (packages, config14 = {}) => {
|
|
24162
|
+
const { npm: npm14 } = detectPackageManager();
|
|
24163
24163
|
let saveFlag;
|
|
24164
24164
|
let cmd;
|
|
24165
|
-
switch (
|
|
24165
|
+
switch (npm14) {
|
|
24166
24166
|
case "yarn":
|
|
24167
24167
|
cmd = "add";
|
|
24168
|
-
saveFlag =
|
|
24168
|
+
saveFlag = config14.dev ? "-D" : "";
|
|
24169
24169
|
break;
|
|
24170
24170
|
case "bun":
|
|
24171
24171
|
cmd = "add";
|
|
24172
|
-
saveFlag =
|
|
24172
|
+
saveFlag = config14.dev ? "-d" : "";
|
|
24173
24173
|
break;
|
|
24174
24174
|
case "npm":
|
|
24175
24175
|
case "pnpm":
|
|
24176
24176
|
default:
|
|
24177
24177
|
cmd = "install";
|
|
24178
|
-
saveFlag =
|
|
24178
|
+
saveFlag = config14.dev ? "--save-dev" : "";
|
|
24179
24179
|
break;
|
|
24180
24180
|
}
|
|
24181
|
-
await runCommand([
|
|
24182
|
-
...
|
|
24181
|
+
await runCommand([npm14, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
|
|
24182
|
+
...config14,
|
|
24183
24183
|
silent: true
|
|
24184
24184
|
});
|
|
24185
24185
|
};
|
|
@@ -24188,15 +24188,15 @@ var init_packages = __esm({
|
|
|
24188
24188
|
if ((0, import_fs6.existsSync)(nodeModulesPath)) {
|
|
24189
24189
|
return;
|
|
24190
24190
|
}
|
|
24191
|
-
const { npm:
|
|
24192
|
-
await runCommand([
|
|
24191
|
+
const { npm: npm14 } = detectPackageManager();
|
|
24192
|
+
await runCommand([npm14, "install"], {
|
|
24193
24193
|
silent: true,
|
|
24194
24194
|
startText: "Installing dependencies",
|
|
24195
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
24195
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
|
|
24196
24196
|
});
|
|
24197
24197
|
};
|
|
24198
24198
|
installWrangler = async () => {
|
|
24199
|
-
const { npm:
|
|
24199
|
+
const { npm: npm14 } = detectPackageManager();
|
|
24200
24200
|
if ((0, import_fs6.existsSync)(import_path6.default.resolve("node_modules", "wrangler"))) {
|
|
24201
24201
|
return;
|
|
24202
24202
|
}
|
|
@@ -24206,7 +24206,7 @@ var init_packages = __esm({
|
|
|
24206
24206
|
"A command line tool for building Cloudflare Workers"
|
|
24207
24207
|
)}`,
|
|
24208
24208
|
doneText: `${brandColor("installed")} ${dim(
|
|
24209
|
-
`via \`${
|
|
24209
|
+
`via \`${npm14} install wrangler --save-dev\``
|
|
24210
24210
|
)}`
|
|
24211
24211
|
});
|
|
24212
24212
|
};
|
|
@@ -24575,7 +24575,7 @@ var init_cli2 = __esm({
|
|
|
24575
24575
|
C3_DEFAULTS = {
|
|
24576
24576
|
projectName: new import_haikunator.default().haikunate({ tokenHex: true }),
|
|
24577
24577
|
type: "hello-world",
|
|
24578
|
-
framework: "
|
|
24578
|
+
framework: "analog",
|
|
24579
24579
|
autoUpdate: true,
|
|
24580
24580
|
deploy: true,
|
|
24581
24581
|
git: true,
|
|
@@ -24603,7 +24603,8 @@ var init_package2 = __esm({
|
|
|
24603
24603
|
"additionally it also contains a map that maps frameworks to their respective clis"
|
|
24604
24604
|
],
|
|
24605
24605
|
dependencies: {
|
|
24606
|
-
"create-astro": "4.7.
|
|
24606
|
+
"create-astro": "4.7.5",
|
|
24607
|
+
"create-analog": "1.2.0",
|
|
24607
24608
|
"@angular/create": "17.2.3",
|
|
24608
24609
|
"create-docusaurus": "3.1.1",
|
|
24609
24610
|
"create-hono": "0.5.0",
|
|
@@ -24613,11 +24614,12 @@ var init_package2 = __esm({
|
|
|
24613
24614
|
"create-remix": "2.8.1",
|
|
24614
24615
|
"create-solid": "0.5.5",
|
|
24615
24616
|
"create-svelte": "6.0.10",
|
|
24616
|
-
"create-vue": "3.
|
|
24617
|
+
"create-vue": "3.10.2",
|
|
24617
24618
|
gatsby: "5.13.3",
|
|
24618
24619
|
nuxi: "3.11.1"
|
|
24619
24620
|
},
|
|
24620
24621
|
frameworkCliMap: {
|
|
24622
|
+
analog: "create-analog",
|
|
24621
24623
|
angular: "@angular/create",
|
|
24622
24624
|
astro: "create-astro",
|
|
24623
24625
|
docusaurus: "create-docusaurus",
|
|
@@ -24656,9 +24658,9 @@ var init_frameworks = __esm({
|
|
|
24656
24658
|
};
|
|
24657
24659
|
runFrameworkGenerator = async (ctx, args) => {
|
|
24658
24660
|
const cli = getFrameworkCli(ctx, true);
|
|
24659
|
-
const { npm:
|
|
24660
|
-
const cmd = [...
|
|
24661
|
-
const env2 =
|
|
24661
|
+
const { npm: npm14, dlx } = detectPackageManager();
|
|
24662
|
+
const cmd = [...npm14 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
24663
|
+
const env2 = npm14 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
|
|
24662
24664
|
if (ctx.args.additionalArgs?.length) {
|
|
24663
24665
|
cmd.push(...ctx.args.additionalArgs);
|
|
24664
24666
|
}
|
|
@@ -24686,7 +24688,12 @@ var init_accounts = __esm({
|
|
|
24686
24688
|
s.start(`Selecting Cloudflare account ${dim("retrieving accounts")}`);
|
|
24687
24689
|
const accounts = await listAccounts();
|
|
24688
24690
|
let accountId;
|
|
24689
|
-
|
|
24691
|
+
const numAccounts = Object.keys(accounts).length;
|
|
24692
|
+
if (numAccounts === 0) {
|
|
24693
|
+
throw new Error(
|
|
24694
|
+
"Unable to find any accounts to deploy to! Please ensure you're logged in as a user that can deploy Workers."
|
|
24695
|
+
);
|
|
24696
|
+
} else if (numAccounts === 1) {
|
|
24690
24697
|
const accountName2 = Object.keys(accounts)[0];
|
|
24691
24698
|
accountId = accounts[accountName2];
|
|
24692
24699
|
s.stop(`${brandColor("account")} ${dim(accountName2)}`);
|
|
@@ -29700,7 +29707,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
29700
29707
|
}
|
|
29701
29708
|
}
|
|
29702
29709
|
};
|
|
29703
|
-
var
|
|
29710
|
+
var types7 = createCommonjsModule(function(module3, exports3) {
|
|
29704
29711
|
exports3.name = /* @__PURE__ */ new Map([
|
|
29705
29712
|
["0", "File"],
|
|
29706
29713
|
// same as File
|
|
@@ -29954,14 +29961,14 @@ var require_index_688c5d50 = __commonJS({
|
|
|
29954
29961
|
}
|
|
29955
29962
|
}
|
|
29956
29963
|
get type() {
|
|
29957
|
-
return
|
|
29964
|
+
return types7.name.get(this[TYPE]) || this[TYPE];
|
|
29958
29965
|
}
|
|
29959
29966
|
get typeKey() {
|
|
29960
29967
|
return this[TYPE];
|
|
29961
29968
|
}
|
|
29962
29969
|
set type(type) {
|
|
29963
|
-
if (
|
|
29964
|
-
this[TYPE] =
|
|
29970
|
+
if (types7.code.has(type))
|
|
29971
|
+
this[TYPE] = types7.code.get(type);
|
|
29965
29972
|
else
|
|
29966
29973
|
this[TYPE] = type;
|
|
29967
29974
|
}
|
|
@@ -33073,7 +33080,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
33073
33080
|
exports3.WriteEntry = writeEntry;
|
|
33074
33081
|
exports3.Header = header;
|
|
33075
33082
|
exports3.Pax = pax;
|
|
33076
|
-
exports3.types =
|
|
33083
|
+
exports3.types = types7;
|
|
33077
33084
|
});
|
|
33078
33085
|
var colorName = {
|
|
33079
33086
|
"aliceblue": [240, 248, 255],
|
|
@@ -39416,97 +39423,6 @@ var init_validators = __esm({
|
|
|
39416
39423
|
}
|
|
39417
39424
|
});
|
|
39418
39425
|
|
|
39419
|
-
// templates/angular/c3.ts
|
|
39420
|
-
var c3_exports = {};
|
|
39421
|
-
__export(c3_exports, {
|
|
39422
|
-
default: () => c3_default
|
|
39423
|
-
});
|
|
39424
|
-
async function installCFWorker() {
|
|
39425
|
-
await installPackages(
|
|
39426
|
-
["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
|
|
39427
|
-
{
|
|
39428
|
-
dev: true,
|
|
39429
|
-
startText: "Installing adapter dependencies",
|
|
39430
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
39431
|
-
}
|
|
39432
|
-
);
|
|
39433
|
-
}
|
|
39434
|
-
async function updateAppCode() {
|
|
39435
|
-
const s = spinner();
|
|
39436
|
-
s.start(`Updating application code`);
|
|
39437
|
-
const appConfigPath = "src/app/app.config.ts";
|
|
39438
|
-
const appConfig = readFile((0, import_node_path.resolve)(appConfigPath));
|
|
39439
|
-
const newAppConfig = "import { provideHttpClient, withFetch } from '@angular/common/http';\n" + appConfig.replace(
|
|
39440
|
-
"providers: [",
|
|
39441
|
-
"providers: [provideHttpClient(withFetch()), "
|
|
39442
|
-
);
|
|
39443
|
-
writeFile2((0, import_node_path.resolve)(appConfigPath), newAppConfig);
|
|
39444
|
-
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
39445
|
-
s.start(`Updating package.json`);
|
|
39446
|
-
const packageJsonPath = (0, import_node_path.resolve)("package.json");
|
|
39447
|
-
const packageManifest = readJSON(packageJsonPath);
|
|
39448
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
39449
|
-
delete packageManifest["dependencies"]["express"];
|
|
39450
|
-
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
39451
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`package.json\``)}`);
|
|
39452
|
-
}
|
|
39453
|
-
function updateAngularJson(ctx) {
|
|
39454
|
-
const s = spinner();
|
|
39455
|
-
s.start(`Updating angular.json config`);
|
|
39456
|
-
const angularJson = readJSON((0, import_node_path.resolve)("angular.json"));
|
|
39457
|
-
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
39458
|
-
architectSection.build.options.outputPath = "dist";
|
|
39459
|
-
architectSection.build.options.assets.push("src/_routes.json");
|
|
39460
|
-
writeFile2((0, import_node_path.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
39461
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
39462
|
-
}
|
|
39463
|
-
var import_node_path, npm, generate, configure, config, c3_default;
|
|
39464
|
-
var init_c3 = __esm({
|
|
39465
|
-
"templates/angular/c3.ts"() {
|
|
39466
|
-
import_node_path = require("node:path");
|
|
39467
|
-
init_cli();
|
|
39468
|
-
init_colors();
|
|
39469
|
-
init_interactive();
|
|
39470
|
-
init_frameworks();
|
|
39471
|
-
init_compatDate();
|
|
39472
|
-
init_files();
|
|
39473
|
-
init_packageManagers();
|
|
39474
|
-
init_packages();
|
|
39475
|
-
({ npm } = detectPackageManager());
|
|
39476
|
-
generate = async (ctx) => {
|
|
39477
|
-
await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
|
|
39478
|
-
logRaw("");
|
|
39479
|
-
};
|
|
39480
|
-
configure = async (ctx) => {
|
|
39481
|
-
updateAngularJson(ctx);
|
|
39482
|
-
await updateAppCode();
|
|
39483
|
-
await installCFWorker();
|
|
39484
|
-
};
|
|
39485
|
-
config = {
|
|
39486
|
-
configVersion: 1,
|
|
39487
|
-
id: "angular",
|
|
39488
|
-
displayName: "Angular",
|
|
39489
|
-
platform: "pages",
|
|
39490
|
-
copyFiles: {
|
|
39491
|
-
path: "./templates"
|
|
39492
|
-
},
|
|
39493
|
-
devScript: "start",
|
|
39494
|
-
deployScript: "deploy",
|
|
39495
|
-
generate,
|
|
39496
|
-
configure,
|
|
39497
|
-
transformPackageJson: async () => ({
|
|
39498
|
-
scripts: {
|
|
39499
|
-
start: `${npm} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
|
|
39500
|
-
build: `ng build && ${npm} run process`,
|
|
39501
|
-
process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
|
|
39502
|
-
deploy: `${npm} run build && wrangler pages deploy dist/cloudflare`
|
|
39503
|
-
}
|
|
39504
|
-
})
|
|
39505
|
-
};
|
|
39506
|
-
c3_default = config;
|
|
39507
|
-
}
|
|
39508
|
-
});
|
|
39509
|
-
|
|
39510
39426
|
// ../../node_modules/.pnpm/tslib@2.5.3/node_modules/tslib/tslib.es6.mjs
|
|
39511
39427
|
var tslib_es6_exports = {};
|
|
39512
39428
|
__export(tslib_es6_exports, {
|
|
@@ -40097,9 +40013,9 @@ var require_types = __commonJS({
|
|
|
40097
40013
|
/** @class */
|
|
40098
40014
|
function(_super) {
|
|
40099
40015
|
(0, tslib_1.__extends)(OrType2, _super);
|
|
40100
|
-
function OrType2(
|
|
40016
|
+
function OrType2(types7) {
|
|
40101
40017
|
var _this = _super.call(this) || this;
|
|
40102
|
-
_this.types =
|
|
40018
|
+
_this.types = types7;
|
|
40103
40019
|
_this.kind = "OrType";
|
|
40104
40020
|
return _this;
|
|
40105
40021
|
}
|
|
@@ -40244,11 +40160,11 @@ var require_types = __commonJS({
|
|
|
40244
40160
|
function typesPlugin(_fork) {
|
|
40245
40161
|
var Type = {
|
|
40246
40162
|
or: function() {
|
|
40247
|
-
var
|
|
40163
|
+
var types7 = [];
|
|
40248
40164
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
40249
|
-
|
|
40165
|
+
types7[_i] = arguments[_i];
|
|
40250
40166
|
}
|
|
40251
|
-
return new OrType(
|
|
40167
|
+
return new OrType(types7.map(function(type) {
|
|
40252
40168
|
return Type.from(type);
|
|
40253
40169
|
}));
|
|
40254
40170
|
},
|
|
@@ -40697,9 +40613,9 @@ var require_path = __commonJS({
|
|
|
40697
40613
|
var Op = Object.prototype;
|
|
40698
40614
|
var hasOwn = Op.hasOwnProperty;
|
|
40699
40615
|
function pathPlugin(fork) {
|
|
40700
|
-
var
|
|
40701
|
-
var isArray =
|
|
40702
|
-
var isNumber =
|
|
40616
|
+
var types7 = fork.use(types_1.default);
|
|
40617
|
+
var isArray = types7.builtInTypes.array;
|
|
40618
|
+
var isNumber = types7.builtInTypes.number;
|
|
40703
40619
|
var Path = function Path2(value, parentPath, name) {
|
|
40704
40620
|
if (!(this instanceof Path2)) {
|
|
40705
40621
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -40999,13 +40915,13 @@ var require_scope = __commonJS({
|
|
|
40999
40915
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
41000
40916
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
41001
40917
|
function scopePlugin(fork) {
|
|
41002
|
-
var
|
|
41003
|
-
var Type =
|
|
41004
|
-
var namedTypes =
|
|
40918
|
+
var types7 = fork.use(types_1.default);
|
|
40919
|
+
var Type = types7.Type;
|
|
40920
|
+
var namedTypes = types7.namedTypes;
|
|
41005
40921
|
var Node = namedTypes.Node;
|
|
41006
40922
|
var Expression = namedTypes.Expression;
|
|
41007
|
-
var isArray =
|
|
41008
|
-
var b2 =
|
|
40923
|
+
var isArray = types7.builtInTypes.array;
|
|
40924
|
+
var b2 = types7.builders;
|
|
41009
40925
|
var Scope = function Scope2(path4, parentScope) {
|
|
41010
40926
|
if (!(this instanceof Scope2)) {
|
|
41011
40927
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -41073,7 +40989,7 @@ var require_scope = __commonJS({
|
|
|
41073
40989
|
++index;
|
|
41074
40990
|
}
|
|
41075
40991
|
var name = prefix + index;
|
|
41076
|
-
return this.bindings[name] =
|
|
40992
|
+
return this.bindings[name] = types7.builders.identifier(name);
|
|
41077
40993
|
};
|
|
41078
40994
|
Sp.injectTemporary = function(identifier, init) {
|
|
41079
40995
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -41153,7 +41069,7 @@ var require_scope = __commonJS({
|
|
|
41153
41069
|
bindings
|
|
41154
41070
|
);
|
|
41155
41071
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
41156
|
-
|
|
41072
|
+
types7.eachField(node, function(name, child) {
|
|
41157
41073
|
var childPath = path4.get(name);
|
|
41158
41074
|
if (!pathHasValue(childPath, child)) {
|
|
41159
41075
|
throw new Error("");
|
|
@@ -41232,24 +41148,24 @@ var require_scope = __commonJS({
|
|
|
41232
41148
|
addPattern(patternPath.get("argument"), bindings);
|
|
41233
41149
|
}
|
|
41234
41150
|
}
|
|
41235
|
-
function addTypePattern(patternPath,
|
|
41151
|
+
function addTypePattern(patternPath, types8) {
|
|
41236
41152
|
var pattern = patternPath.value;
|
|
41237
41153
|
namedTypes.Pattern.assert(pattern);
|
|
41238
41154
|
if (namedTypes.Identifier.check(pattern)) {
|
|
41239
|
-
if (hasOwn.call(
|
|
41240
|
-
|
|
41155
|
+
if (hasOwn.call(types8, pattern.name)) {
|
|
41156
|
+
types8[pattern.name].push(patternPath);
|
|
41241
41157
|
} else {
|
|
41242
|
-
|
|
41158
|
+
types8[pattern.name] = [patternPath];
|
|
41243
41159
|
}
|
|
41244
41160
|
}
|
|
41245
41161
|
}
|
|
41246
|
-
function addTypeParameter(parameterPath,
|
|
41162
|
+
function addTypeParameter(parameterPath, types8) {
|
|
41247
41163
|
var parameter = parameterPath.value;
|
|
41248
41164
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
41249
|
-
if (hasOwn.call(
|
|
41250
|
-
|
|
41165
|
+
if (hasOwn.call(types8, parameter.name)) {
|
|
41166
|
+
types8[parameter.name].push(parameterPath);
|
|
41251
41167
|
} else {
|
|
41252
|
-
|
|
41168
|
+
types8[parameter.name] = [parameterPath];
|
|
41253
41169
|
}
|
|
41254
41170
|
}
|
|
41255
41171
|
Sp.lookup = function(name) {
|
|
@@ -41287,11 +41203,11 @@ var require_node_path = __commonJS({
|
|
|
41287
41203
|
var path_1 = (0, tslib_1.__importDefault)(require_path());
|
|
41288
41204
|
var scope_1 = (0, tslib_1.__importDefault)(require_scope());
|
|
41289
41205
|
function nodePathPlugin(fork) {
|
|
41290
|
-
var
|
|
41291
|
-
var n2 =
|
|
41292
|
-
var b2 =
|
|
41293
|
-
var isNumber =
|
|
41294
|
-
var isArray =
|
|
41206
|
+
var types7 = fork.use(types_1.default);
|
|
41207
|
+
var n2 = types7.namedTypes;
|
|
41208
|
+
var b2 = types7.builders;
|
|
41209
|
+
var isNumber = types7.builtInTypes.number;
|
|
41210
|
+
var isArray = types7.builtInTypes.array;
|
|
41295
41211
|
var Path = fork.use(path_1.default);
|
|
41296
41212
|
var Scope = fork.use(scope_1.default);
|
|
41297
41213
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -41382,7 +41298,7 @@ var require_node_path = __commonJS({
|
|
|
41382
41298
|
return scope || null;
|
|
41383
41299
|
};
|
|
41384
41300
|
NPp.getValueProperty = function(name) {
|
|
41385
|
-
return
|
|
41301
|
+
return types7.getFieldValue(this.value, name);
|
|
41386
41302
|
};
|
|
41387
41303
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
41388
41304
|
var pp = this.parentPath;
|
|
@@ -41524,7 +41440,7 @@ var require_node_path = __commonJS({
|
|
|
41524
41440
|
return node.some(containsCallExpression);
|
|
41525
41441
|
}
|
|
41526
41442
|
if (n2.Node.check(node)) {
|
|
41527
|
-
return
|
|
41443
|
+
return types7.someField(node, function(_name, child) {
|
|
41528
41444
|
return containsCallExpression(child);
|
|
41529
41445
|
});
|
|
41530
41446
|
}
|
|
@@ -41642,11 +41558,11 @@ var require_path_visitor = __commonJS({
|
|
|
41642
41558
|
var node_path_1 = (0, tslib_1.__importDefault)(require_node_path());
|
|
41643
41559
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
41644
41560
|
function pathVisitorPlugin(fork) {
|
|
41645
|
-
var
|
|
41561
|
+
var types7 = fork.use(types_1.default);
|
|
41646
41562
|
var NodePath = fork.use(node_path_1.default);
|
|
41647
|
-
var isArray =
|
|
41648
|
-
var isObject2 =
|
|
41649
|
-
var isFunction2 =
|
|
41563
|
+
var isArray = types7.builtInTypes.array;
|
|
41564
|
+
var isObject2 = types7.builtInTypes.object;
|
|
41565
|
+
var isFunction2 = types7.builtInTypes.function;
|
|
41650
41566
|
var undefined2;
|
|
41651
41567
|
var PathVisitor = function PathVisitor2() {
|
|
41652
41568
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -41666,7 +41582,7 @@ var require_path_visitor = __commonJS({
|
|
|
41666
41582
|
typeNames[methodName.slice("visit".length)] = true;
|
|
41667
41583
|
}
|
|
41668
41584
|
}
|
|
41669
|
-
var supertypeTable =
|
|
41585
|
+
var supertypeTable = types7.computeSupertypeLookupTable(typeNames);
|
|
41670
41586
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
41671
41587
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
41672
41588
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -41785,7 +41701,7 @@ var require_path_visitor = __commonJS({
|
|
|
41785
41701
|
path4.each(visitor.visitWithoutReset, visitor);
|
|
41786
41702
|
} else if (!isObject2.check(value)) {
|
|
41787
41703
|
} else {
|
|
41788
|
-
var childNames =
|
|
41704
|
+
var childNames = types7.getFieldNames(value);
|
|
41789
41705
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
41790
41706
|
childNames.push("comments");
|
|
41791
41707
|
}
|
|
@@ -41794,7 +41710,7 @@ var require_path_visitor = __commonJS({
|
|
|
41794
41710
|
for (var i = 0; i < childCount; ++i) {
|
|
41795
41711
|
var childName = childNames[i];
|
|
41796
41712
|
if (!hasOwn.call(value, childName)) {
|
|
41797
|
-
value[childName] =
|
|
41713
|
+
value[childName] = types7.getFieldValue(value, childName);
|
|
41798
41714
|
}
|
|
41799
41715
|
childPaths.push(path4.get(childName));
|
|
41800
41716
|
}
|
|
@@ -41934,13 +41850,13 @@ var require_equiv = __commonJS({
|
|
|
41934
41850
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
41935
41851
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
41936
41852
|
function default_1(fork) {
|
|
41937
|
-
var
|
|
41938
|
-
var getFieldNames =
|
|
41939
|
-
var getFieldValue =
|
|
41940
|
-
var isArray =
|
|
41941
|
-
var isObject2 =
|
|
41942
|
-
var isDate =
|
|
41943
|
-
var isRegExp =
|
|
41853
|
+
var types7 = fork.use(types_1.default);
|
|
41854
|
+
var getFieldNames = types7.getFieldNames;
|
|
41855
|
+
var getFieldValue = types7.getFieldValue;
|
|
41856
|
+
var isArray = types7.builtInTypes.array;
|
|
41857
|
+
var isObject2 = types7.builtInTypes.object;
|
|
41858
|
+
var isDate = types7.builtInTypes.Date;
|
|
41859
|
+
var isRegExp = types7.builtInTypes.RegExp;
|
|
41944
41860
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
41945
41861
|
function astNodesAreEquivalent(a, b2, problemPath) {
|
|
41946
41862
|
if (isArray.check(problemPath)) {
|
|
@@ -42090,24 +42006,24 @@ var require_fork = __commonJS({
|
|
|
42090
42006
|
var node_path_1 = (0, tslib_1.__importDefault)(require_node_path());
|
|
42091
42007
|
function default_1(plugins) {
|
|
42092
42008
|
var fork = createFork();
|
|
42093
|
-
var
|
|
42009
|
+
var types7 = fork.use(types_1.default);
|
|
42094
42010
|
plugins.forEach(fork.use);
|
|
42095
|
-
|
|
42011
|
+
types7.finalize();
|
|
42096
42012
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
42097
42013
|
return {
|
|
42098
|
-
Type:
|
|
42099
|
-
builtInTypes:
|
|
42100
|
-
namedTypes:
|
|
42101
|
-
builders:
|
|
42102
|
-
defineMethod:
|
|
42103
|
-
getFieldNames:
|
|
42104
|
-
getFieldValue:
|
|
42105
|
-
eachField:
|
|
42106
|
-
someField:
|
|
42107
|
-
getSupertypeNames:
|
|
42108
|
-
getBuilderName:
|
|
42014
|
+
Type: types7.Type,
|
|
42015
|
+
builtInTypes: types7.builtInTypes,
|
|
42016
|
+
namedTypes: types7.namedTypes,
|
|
42017
|
+
builders: types7.builders,
|
|
42018
|
+
defineMethod: types7.defineMethod,
|
|
42019
|
+
getFieldNames: types7.getFieldNames,
|
|
42020
|
+
getFieldValue: types7.getFieldValue,
|
|
42021
|
+
eachField: types7.eachField,
|
|
42022
|
+
someField: types7.someField,
|
|
42023
|
+
getSupertypeNames: types7.getSupertypeNames,
|
|
42024
|
+
getBuilderName: types7.getBuilderName,
|
|
42109
42025
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
42110
|
-
finalize:
|
|
42026
|
+
finalize: types7.finalize,
|
|
42111
42027
|
Path: fork.use(path_1.default),
|
|
42112
42028
|
NodePath: fork.use(node_path_1.default),
|
|
42113
42029
|
PathVisitor,
|
|
@@ -42143,9 +42059,9 @@ var require_shared = __commonJS({
|
|
|
42143
42059
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
42144
42060
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42145
42061
|
function default_1(fork) {
|
|
42146
|
-
var
|
|
42147
|
-
var Type =
|
|
42148
|
-
var builtin =
|
|
42062
|
+
var types7 = fork.use(types_1.default);
|
|
42063
|
+
var Type = types7.Type;
|
|
42064
|
+
var builtin = types7.builtInTypes;
|
|
42149
42065
|
var isNumber = builtin.number;
|
|
42150
42066
|
function geq(than) {
|
|
42151
42067
|
return Type.from(function(value) {
|
|
@@ -42324,8 +42240,8 @@ var require_core2 = __commonJS({
|
|
|
42324
42240
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42325
42241
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42326
42242
|
function default_1(fork) {
|
|
42327
|
-
var
|
|
42328
|
-
var Type =
|
|
42243
|
+
var types7 = fork.use(types_1.default);
|
|
42244
|
+
var Type = types7.Type;
|
|
42329
42245
|
var def = Type.def;
|
|
42330
42246
|
var or = Type.or;
|
|
42331
42247
|
var shared = fork.use(shared_1.default);
|
|
@@ -42415,9 +42331,9 @@ var require_es6 = __commonJS({
|
|
|
42415
42331
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42416
42332
|
function default_1(fork) {
|
|
42417
42333
|
fork.use(core_1.default);
|
|
42418
|
-
var
|
|
42419
|
-
var def =
|
|
42420
|
-
var or =
|
|
42334
|
+
var types7 = fork.use(types_1.default);
|
|
42335
|
+
var def = types7.Type.def;
|
|
42336
|
+
var or = types7.Type.or;
|
|
42421
42337
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42422
42338
|
def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
|
|
42423
42339
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -42503,8 +42419,8 @@ var require_es2017 = __commonJS({
|
|
|
42503
42419
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42504
42420
|
function default_1(fork) {
|
|
42505
42421
|
fork.use(es2016_1.default);
|
|
42506
|
-
var
|
|
42507
|
-
var def =
|
|
42422
|
+
var types7 = fork.use(types_1.default);
|
|
42423
|
+
var def = types7.Type.def;
|
|
42508
42424
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42509
42425
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
42510
42426
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -42525,9 +42441,9 @@ var require_es2018 = __commonJS({
|
|
|
42525
42441
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42526
42442
|
function default_1(fork) {
|
|
42527
42443
|
fork.use(es2017_1.default);
|
|
42528
|
-
var
|
|
42529
|
-
var def =
|
|
42530
|
-
var or =
|
|
42444
|
+
var types7 = fork.use(types_1.default);
|
|
42445
|
+
var def = types7.Type.def;
|
|
42446
|
+
var or = types7.Type.or;
|
|
42531
42447
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42532
42448
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
42533
42449
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -42557,9 +42473,9 @@ var require_es2019 = __commonJS({
|
|
|
42557
42473
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42558
42474
|
function default_1(fork) {
|
|
42559
42475
|
fork.use(es2018_1.default);
|
|
42560
|
-
var
|
|
42561
|
-
var def =
|
|
42562
|
-
var or =
|
|
42476
|
+
var types7 = fork.use(types_1.default);
|
|
42477
|
+
var def = types7.Type.def;
|
|
42478
|
+
var or = types7.Type.or;
|
|
42563
42479
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42564
42480
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
42565
42481
|
}
|
|
@@ -42581,9 +42497,9 @@ var require_es20202 = __commonJS({
|
|
|
42581
42497
|
function default_1(fork) {
|
|
42582
42498
|
fork.use(es2020_1.default);
|
|
42583
42499
|
fork.use(es2019_1.default);
|
|
42584
|
-
var
|
|
42585
|
-
var def =
|
|
42586
|
-
var or =
|
|
42500
|
+
var types7 = fork.use(types_1.default);
|
|
42501
|
+
var def = types7.Type.def;
|
|
42502
|
+
var or = types7.Type.or;
|
|
42587
42503
|
var shared = fork.use(shared_1.default);
|
|
42588
42504
|
var defaults = shared.defaults;
|
|
42589
42505
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -42627,8 +42543,8 @@ var require_es2022 = __commonJS({
|
|
|
42627
42543
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42628
42544
|
function default_1(fork) {
|
|
42629
42545
|
fork.use(es2021_1.default);
|
|
42630
|
-
var
|
|
42631
|
-
var def =
|
|
42546
|
+
var types7 = fork.use(types_1.default);
|
|
42547
|
+
var def = types7.Type.def;
|
|
42632
42548
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
42633
42549
|
}
|
|
42634
42550
|
exports2.default = default_1;
|
|
@@ -42647,9 +42563,9 @@ var require_es_proposals = __commonJS({
|
|
|
42647
42563
|
var es2022_1 = (0, tslib_1.__importDefault)(require_es2022());
|
|
42648
42564
|
function default_1(fork) {
|
|
42649
42565
|
fork.use(es2022_1.default);
|
|
42650
|
-
var
|
|
42651
|
-
var Type =
|
|
42652
|
-
var def =
|
|
42566
|
+
var types7 = fork.use(types_1.default);
|
|
42567
|
+
var Type = types7.Type;
|
|
42568
|
+
var def = types7.Type.def;
|
|
42653
42569
|
var or = Type.or;
|
|
42654
42570
|
var shared = fork.use(shared_1.default);
|
|
42655
42571
|
var defaults = shared.defaults;
|
|
@@ -42687,9 +42603,9 @@ var require_jsx = __commonJS({
|
|
|
42687
42603
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42688
42604
|
function default_1(fork) {
|
|
42689
42605
|
fork.use(es_proposals_1.default);
|
|
42690
|
-
var
|
|
42691
|
-
var def =
|
|
42692
|
-
var or =
|
|
42606
|
+
var types7 = fork.use(types_1.default);
|
|
42607
|
+
var def = types7.Type.def;
|
|
42608
|
+
var or = types7.Type.or;
|
|
42693
42609
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42694
42610
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
42695
42611
|
def("Literal"),
|
|
@@ -42751,9 +42667,9 @@ var require_type_annotations = __commonJS({
|
|
|
42751
42667
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42752
42668
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42753
42669
|
function default_1(fork) {
|
|
42754
|
-
var
|
|
42755
|
-
var def =
|
|
42756
|
-
var or =
|
|
42670
|
+
var types7 = fork.use(types_1.default);
|
|
42671
|
+
var def = types7.Type.def;
|
|
42672
|
+
var or = types7.Type.or;
|
|
42757
42673
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42758
42674
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
42759
42675
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -42786,9 +42702,9 @@ var require_flow = __commonJS({
|
|
|
42786
42702
|
function default_1(fork) {
|
|
42787
42703
|
fork.use(es_proposals_1.default);
|
|
42788
42704
|
fork.use(type_annotations_1.default);
|
|
42789
|
-
var
|
|
42790
|
-
var def =
|
|
42791
|
-
var or =
|
|
42705
|
+
var types7 = fork.use(types_1.default);
|
|
42706
|
+
var def = types7.Type.def;
|
|
42707
|
+
var or = types7.Type.or;
|
|
42792
42708
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42793
42709
|
def("Flow").bases("Node");
|
|
42794
42710
|
def("FlowType").bases("Flow");
|
|
@@ -42903,10 +42819,10 @@ var require_esprima = __commonJS({
|
|
|
42903
42819
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42904
42820
|
function default_1(fork) {
|
|
42905
42821
|
fork.use(es_proposals_1.default);
|
|
42906
|
-
var
|
|
42822
|
+
var types7 = fork.use(types_1.default);
|
|
42907
42823
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42908
|
-
var def =
|
|
42909
|
-
var or =
|
|
42824
|
+
var def = types7.Type.def;
|
|
42825
|
+
var or = types7.Type.or;
|
|
42910
42826
|
def("VariableDeclaration").field("declarations", [or(
|
|
42911
42827
|
def("VariableDeclarator"),
|
|
42912
42828
|
def("Identifier")
|
|
@@ -42963,11 +42879,11 @@ var require_babel_core = __commonJS({
|
|
|
42963
42879
|
function default_1(fork) {
|
|
42964
42880
|
var _a2, _b2, _c2, _d, _e;
|
|
42965
42881
|
fork.use(es_proposals_1.default);
|
|
42966
|
-
var
|
|
42882
|
+
var types7 = fork.use(types_1.default);
|
|
42967
42883
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42968
|
-
var def =
|
|
42969
|
-
var or =
|
|
42970
|
-
var isUndefined =
|
|
42884
|
+
var def = types7.Type.def;
|
|
42885
|
+
var or = types7.Type.or;
|
|
42886
|
+
var isUndefined = types7.builtInTypes.undefined;
|
|
42971
42887
|
def("Noop").bases("Statement").build();
|
|
42972
42888
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
42973
42889
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -43002,7 +42918,7 @@ var require_babel_core = __commonJS({
|
|
|
43002
42918
|
raw: String
|
|
43003
42919
|
},
|
|
43004
42920
|
function getDefault() {
|
|
43005
|
-
var value =
|
|
42921
|
+
var value = types7.getFieldValue(this, "value");
|
|
43006
42922
|
return {
|
|
43007
42923
|
rawValue: value,
|
|
43008
42924
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -43093,8 +43009,8 @@ var require_babel = __commonJS({
|
|
|
43093
43009
|
var babel_core_1 = (0, tslib_1.__importDefault)(require_babel_core());
|
|
43094
43010
|
var flow_1 = (0, tslib_1.__importDefault)(require_flow());
|
|
43095
43011
|
function default_1(fork) {
|
|
43096
|
-
var
|
|
43097
|
-
var def =
|
|
43012
|
+
var types7 = fork.use(types_1.default);
|
|
43013
|
+
var def = types7.Type.def;
|
|
43098
43014
|
fork.use(babel_core_1.default);
|
|
43099
43015
|
fork.use(flow_1.default);
|
|
43100
43016
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -43118,12 +43034,12 @@ var require_typescript = __commonJS({
|
|
|
43118
43034
|
function default_1(fork) {
|
|
43119
43035
|
fork.use(babel_core_1.default);
|
|
43120
43036
|
fork.use(type_annotations_1.default);
|
|
43121
|
-
var
|
|
43122
|
-
var n2 =
|
|
43123
|
-
var def =
|
|
43124
|
-
var or =
|
|
43037
|
+
var types7 = fork.use(types_1.default);
|
|
43038
|
+
var n2 = types7.namedTypes;
|
|
43039
|
+
var def = types7.Type.def;
|
|
43040
|
+
var or = types7.Type.or;
|
|
43125
43041
|
var defaults = fork.use(shared_1.default).defaults;
|
|
43126
|
-
var StringLiteral =
|
|
43042
|
+
var StringLiteral = types7.Type.from(function(value, deep) {
|
|
43127
43043
|
if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
|
|
43128
43044
|
return true;
|
|
43129
43045
|
}
|
|
@@ -45101,8 +45017,8 @@ var require_util9 = __commonJS({
|
|
|
45101
45017
|
exports2.isTrailingCommaEnabled = exports2.getParentExportDeclaration = exports2.isExportDeclaration = exports2.fixFaultyLocations = exports2.getTrueLoc = exports2.composeSourceMaps = exports2.copyPos = exports2.comparePos = exports2.getUnionOfKeys = exports2.getOption = exports2.isBrowser = exports2.getLineTerminator = void 0;
|
|
45102
45018
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
45103
45019
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
45104
|
-
var
|
|
45105
|
-
var n2 =
|
|
45020
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
45021
|
+
var n2 = types7.namedTypes;
|
|
45106
45022
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
45107
45023
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
45108
45024
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -51527,13 +51443,13 @@ var require_esprima2 = __commonJS({
|
|
|
51527
51443
|
return Reader2;
|
|
51528
51444
|
}();
|
|
51529
51445
|
var Tokenizer = function() {
|
|
51530
|
-
function Tokenizer2(code,
|
|
51446
|
+
function Tokenizer2(code, config14) {
|
|
51531
51447
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
51532
|
-
this.errorHandler.tolerant =
|
|
51448
|
+
this.errorHandler.tolerant = config14 ? typeof config14.tolerant === "boolean" && config14.tolerant : false;
|
|
51533
51449
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
51534
|
-
this.scanner.trackComment =
|
|
51535
|
-
this.trackRange =
|
|
51536
|
-
this.trackLoc =
|
|
51450
|
+
this.scanner.trackComment = config14 ? typeof config14.comment === "boolean" && config14.comment : false;
|
|
51451
|
+
this.trackRange = config14 ? typeof config14.range === "boolean" && config14.range : false;
|
|
51452
|
+
this.trackLoc = config14 ? typeof config14.loc === "boolean" && config14.loc : false;
|
|
51537
51453
|
this.buffer = [];
|
|
51538
51454
|
this.reader = new Reader();
|
|
51539
51455
|
}
|
|
@@ -52515,10 +52431,10 @@ var require_comments = __commonJS({
|
|
|
52515
52431
|
exports2.printComments = exports2.attach = void 0;
|
|
52516
52432
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
52517
52433
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
52518
|
-
var
|
|
52519
|
-
var n2 =
|
|
52520
|
-
var isArray =
|
|
52521
|
-
var isObject2 =
|
|
52434
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
52435
|
+
var n2 = types7.namedTypes;
|
|
52436
|
+
var isArray = types7.builtInTypes.array;
|
|
52437
|
+
var isObject2 = types7.builtInTypes.object;
|
|
52522
52438
|
var lines_1 = require_lines();
|
|
52523
52439
|
var util_1 = require_util9();
|
|
52524
52440
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -52549,7 +52465,7 @@ var require_comments = __commonJS({
|
|
|
52549
52465
|
if (isArray.check(node)) {
|
|
52550
52466
|
names = Object.keys(node);
|
|
52551
52467
|
} else if (isObject2.check(node)) {
|
|
52552
|
-
names =
|
|
52468
|
+
names = types7.getFieldNames(node);
|
|
52553
52469
|
} else {
|
|
52554
52470
|
return resultArray;
|
|
52555
52471
|
}
|
|
@@ -52729,7 +52645,7 @@ var require_comments = __commonJS({
|
|
|
52729
52645
|
function printComments(path4, print2) {
|
|
52730
52646
|
var value = path4.getValue();
|
|
52731
52647
|
var innerLines = print2(path4);
|
|
52732
|
-
var comments = n2.Node.check(value) &&
|
|
52648
|
+
var comments = n2.Node.check(value) && types7.getFieldValue(value, "comments");
|
|
52733
52649
|
if (!comments || comments.length === 0) {
|
|
52734
52650
|
return innerLines;
|
|
52735
52651
|
}
|
|
@@ -52737,8 +52653,8 @@ var require_comments = __commonJS({
|
|
|
52737
52653
|
var trailingParts = [innerLines];
|
|
52738
52654
|
path4.each(function(commentPath) {
|
|
52739
52655
|
var comment = commentPath.getValue();
|
|
52740
|
-
var leading =
|
|
52741
|
-
var trailing =
|
|
52656
|
+
var leading = types7.getFieldValue(comment, "leading");
|
|
52657
|
+
var trailing = types7.getFieldValue(comment, "trailing");
|
|
52742
52658
|
if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
52743
52659
|
leadingParts.push(printLeadingComment(commentPath, print2));
|
|
52744
52660
|
} else if (trailing) {
|
|
@@ -52760,10 +52676,10 @@ var require_parser2 = __commonJS({
|
|
|
52760
52676
|
exports2.parse = void 0;
|
|
52761
52677
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
52762
52678
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
52763
|
-
var
|
|
52764
|
-
var b2 =
|
|
52765
|
-
var isObject2 =
|
|
52766
|
-
var isArray =
|
|
52679
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
52680
|
+
var b2 = types7.builders;
|
|
52681
|
+
var isObject2 = types7.builtInTypes.object;
|
|
52682
|
+
var isArray = types7.builtInTypes.array;
|
|
52767
52683
|
var options_1 = require_options();
|
|
52768
52684
|
var lines_1 = require_lines();
|
|
52769
52685
|
var comments_1 = require_comments();
|
|
@@ -52950,11 +52866,11 @@ var require_fast_path = __commonJS({
|
|
|
52950
52866
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
52951
52867
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
52952
52868
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
52953
|
-
var
|
|
52869
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
52954
52870
|
var util = tslib_1.__importStar(require_util9());
|
|
52955
|
-
var n2 =
|
|
52956
|
-
var isArray =
|
|
52957
|
-
var isNumber =
|
|
52871
|
+
var n2 = types7.namedTypes;
|
|
52872
|
+
var isArray = types7.builtInTypes.array;
|
|
52873
|
+
var isNumber = types7.builtInTypes.number;
|
|
52958
52874
|
var PRECEDENCE = {};
|
|
52959
52875
|
[
|
|
52960
52876
|
["??"],
|
|
@@ -52983,7 +52899,7 @@ var require_fast_path = __commonJS({
|
|
|
52983
52899
|
if (obj instanceof FastPath) {
|
|
52984
52900
|
return obj.copy();
|
|
52985
52901
|
}
|
|
52986
|
-
if (obj instanceof
|
|
52902
|
+
if (obj instanceof types7.NodePath) {
|
|
52987
52903
|
var copy = Object.create(FastPath.prototype);
|
|
52988
52904
|
var stack = [obj.value];
|
|
52989
52905
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -53294,7 +53210,7 @@ var require_fast_path = __commonJS({
|
|
|
53294
53210
|
return node.some(containsCallExpression);
|
|
53295
53211
|
}
|
|
53296
53212
|
if (n2.Node.check(node)) {
|
|
53297
|
-
return
|
|
53213
|
+
return types7.someField(node, function(_name, child) {
|
|
53298
53214
|
return containsCallExpression(child);
|
|
53299
53215
|
});
|
|
53300
53216
|
}
|
|
@@ -53384,16 +53300,16 @@ var require_patcher = __commonJS({
|
|
|
53384
53300
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
53385
53301
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
53386
53302
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
53387
|
-
var
|
|
53388
|
-
var Printable =
|
|
53389
|
-
var Expression =
|
|
53390
|
-
var ReturnStatement =
|
|
53391
|
-
var SourceLocation =
|
|
53303
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
53304
|
+
var Printable = types7.namedTypes.Printable;
|
|
53305
|
+
var Expression = types7.namedTypes.Expression;
|
|
53306
|
+
var ReturnStatement = types7.namedTypes.ReturnStatement;
|
|
53307
|
+
var SourceLocation = types7.namedTypes.SourceLocation;
|
|
53392
53308
|
var util_1 = require_util9();
|
|
53393
53309
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
53394
|
-
var isObject2 =
|
|
53395
|
-
var isArray =
|
|
53396
|
-
var isString =
|
|
53310
|
+
var isObject2 = types7.builtInTypes.object;
|
|
53311
|
+
var isArray = types7.builtInTypes.array;
|
|
53312
|
+
var isString = types7.builtInTypes.string;
|
|
53397
53313
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
53398
53314
|
var Patcher = function Patcher2(lines) {
|
|
53399
53315
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -53672,8 +53588,8 @@ var require_patcher = __commonJS({
|
|
|
53672
53588
|
if (k2.charAt(0) === "_") {
|
|
53673
53589
|
continue;
|
|
53674
53590
|
}
|
|
53675
|
-
newPath.stack.push(k2,
|
|
53676
|
-
oldPath.stack.push(k2,
|
|
53591
|
+
newPath.stack.push(k2, types7.getFieldValue(newNode, k2));
|
|
53592
|
+
oldPath.stack.push(k2, types7.getFieldValue(oldNode, k2));
|
|
53677
53593
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
53678
53594
|
newPath.stack.length -= 2;
|
|
53679
53595
|
oldPath.stack.length -= 2;
|
|
@@ -53701,10 +53617,10 @@ var require_printer = __commonJS({
|
|
|
53701
53617
|
var lines_1 = require_lines();
|
|
53702
53618
|
var options_1 = require_options();
|
|
53703
53619
|
var patcher_1 = require_patcher();
|
|
53704
|
-
var
|
|
53705
|
-
var namedTypes =
|
|
53706
|
-
var isString =
|
|
53707
|
-
var isObject2 =
|
|
53620
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
53621
|
+
var namedTypes = types7.namedTypes;
|
|
53622
|
+
var isString = types7.builtInTypes.string;
|
|
53623
|
+
var isObject2 = types7.builtInTypes.object;
|
|
53708
53624
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
53709
53625
|
var util = tslib_1.__importStar(require_util9());
|
|
53710
53626
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
@@ -53726,11 +53642,11 @@ var require_printer = __commonJS({
|
|
|
53726
53642
|
return this.code;
|
|
53727
53643
|
};
|
|
53728
53644
|
var emptyPrintResult = new PrintResult("");
|
|
53729
|
-
var Printer = function Printer2(
|
|
53645
|
+
var Printer = function Printer2(config14) {
|
|
53730
53646
|
assert_1.default.ok(this instanceof Printer2);
|
|
53731
|
-
var explicitTabWidth =
|
|
53732
|
-
|
|
53733
|
-
|
|
53647
|
+
var explicitTabWidth = config14 && config14.tabWidth;
|
|
53648
|
+
config14 = options_1.normalize(config14);
|
|
53649
|
+
config14.sourceFileName = null;
|
|
53734
53650
|
function makePrintFunctionWith(options, overrides) {
|
|
53735
53651
|
options = Object.assign({}, options, overrides);
|
|
53736
53652
|
return function(path4) {
|
|
@@ -53745,11 +53661,11 @@ var require_printer = __commonJS({
|
|
|
53745
53661
|
includeComments: false
|
|
53746
53662
|
}));
|
|
53747
53663
|
}
|
|
53748
|
-
var oldTabWidth =
|
|
53664
|
+
var oldTabWidth = config14.tabWidth;
|
|
53749
53665
|
if (!explicitTabWidth) {
|
|
53750
53666
|
var loc = path4.getNode().loc;
|
|
53751
53667
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
53752
|
-
|
|
53668
|
+
config14.tabWidth = loc.lines.guessTabWidth();
|
|
53753
53669
|
}
|
|
53754
53670
|
}
|
|
53755
53671
|
var reprinter = patcher_1.getReprinter(path4);
|
|
@@ -53763,11 +53679,11 @@ var require_printer = __commonJS({
|
|
|
53763
53679
|
// right choice because it gives us the opportunity to reprint
|
|
53764
53680
|
// such nodes using their original source.
|
|
53765
53681
|
reprinter(print2)
|
|
53766
|
-
) : genericPrint(path4,
|
|
53682
|
+
) : genericPrint(path4, config14, options, makePrintFunctionWith(options, {
|
|
53767
53683
|
includeComments: true,
|
|
53768
53684
|
avoidRootParens: false
|
|
53769
53685
|
}));
|
|
53770
|
-
|
|
53686
|
+
config14.tabWidth = oldTabWidth;
|
|
53771
53687
|
return lines;
|
|
53772
53688
|
}
|
|
53773
53689
|
this.print = function(ast) {
|
|
@@ -53778,7 +53694,7 @@ var require_printer = __commonJS({
|
|
|
53778
53694
|
includeComments: true,
|
|
53779
53695
|
avoidRootParens: false
|
|
53780
53696
|
});
|
|
53781
|
-
return new PrintResult(lines.toString(
|
|
53697
|
+
return new PrintResult(lines.toString(config14), util.composeSourceMaps(config14.inputSourceMap, lines.getSourceMap(config14.sourceMapName, config14.sourceRoot)));
|
|
53782
53698
|
};
|
|
53783
53699
|
this.printGenerically = function(ast) {
|
|
53784
53700
|
if (!ast) {
|
|
@@ -53786,26 +53702,26 @@ var require_printer = __commonJS({
|
|
|
53786
53702
|
}
|
|
53787
53703
|
function printGenerically(path5) {
|
|
53788
53704
|
return comments_1.printComments(path5, function(path6) {
|
|
53789
|
-
return genericPrint(path6,
|
|
53705
|
+
return genericPrint(path6, config14, {
|
|
53790
53706
|
includeComments: true,
|
|
53791
53707
|
avoidRootParens: false
|
|
53792
53708
|
}, printGenerically);
|
|
53793
53709
|
});
|
|
53794
53710
|
}
|
|
53795
53711
|
var path4 = fast_path_1.default.from(ast);
|
|
53796
|
-
var oldReuseWhitespace =
|
|
53797
|
-
|
|
53798
|
-
var pr = new PrintResult(printGenerically(path4).toString(
|
|
53799
|
-
|
|
53712
|
+
var oldReuseWhitespace = config14.reuseWhitespace;
|
|
53713
|
+
config14.reuseWhitespace = false;
|
|
53714
|
+
var pr = new PrintResult(printGenerically(path4).toString(config14));
|
|
53715
|
+
config14.reuseWhitespace = oldReuseWhitespace;
|
|
53800
53716
|
return pr;
|
|
53801
53717
|
};
|
|
53802
53718
|
};
|
|
53803
53719
|
exports2.Printer = Printer;
|
|
53804
|
-
function genericPrint(path4,
|
|
53720
|
+
function genericPrint(path4, config14, options, printPath) {
|
|
53805
53721
|
assert_1.default.ok(path4 instanceof fast_path_1.default);
|
|
53806
53722
|
var node = path4.getValue();
|
|
53807
53723
|
var parts = [];
|
|
53808
|
-
var linesWithoutParens = genericPrintNoParens(path4,
|
|
53724
|
+
var linesWithoutParens = genericPrintNoParens(path4, config14, printPath);
|
|
53809
53725
|
if (!node || linesWithoutParens.isEmpty()) {
|
|
53810
53726
|
return linesWithoutParens;
|
|
53811
53727
|
}
|
|
@@ -53878,7 +53794,7 @@ var require_printer = __commonJS({
|
|
|
53878
53794
|
case "OptionalMemberExpression": {
|
|
53879
53795
|
parts.push(path4.call(print2, "object"));
|
|
53880
53796
|
var property = path4.call(print2, "property");
|
|
53881
|
-
var optional =
|
|
53797
|
+
var optional = types7.getFieldValue(n2, "optional");
|
|
53882
53798
|
if (n2.computed) {
|
|
53883
53799
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
53884
53800
|
} else {
|
|
@@ -54149,7 +54065,7 @@ var require_printer = __commonJS({
|
|
|
54149
54065
|
if (n2.typeArguments) {
|
|
54150
54066
|
parts.push(path4.call(print2, "typeArguments"));
|
|
54151
54067
|
}
|
|
54152
|
-
if (
|
|
54068
|
+
if (types7.getFieldValue(n2, "optional")) {
|
|
54153
54069
|
parts.push("?.");
|
|
54154
54070
|
}
|
|
54155
54071
|
parts.push(printArgumentsList(path4, options, print2));
|
|
@@ -55781,8 +55697,8 @@ var require_printer = __commonJS({
|
|
|
55781
55697
|
});
|
|
55782
55698
|
}
|
|
55783
55699
|
function getPossibleRaw(node) {
|
|
55784
|
-
var value =
|
|
55785
|
-
var extra =
|
|
55700
|
+
var value = types7.getFieldValue(node, "value");
|
|
55701
|
+
var extra = types7.getFieldValue(node, "extra");
|
|
55786
55702
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
55787
55703
|
return extra.raw;
|
|
55788
55704
|
}
|
|
@@ -55830,8 +55746,8 @@ var require_main3 = __commonJS({
|
|
|
55830
55746
|
exports2.run = exports2.prettyPrint = exports2.print = exports2.visit = exports2.types = exports2.parse = void 0;
|
|
55831
55747
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
55832
55748
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
55833
|
-
var
|
|
55834
|
-
exports2.types =
|
|
55749
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
55750
|
+
exports2.types = types7;
|
|
55835
55751
|
var parser_1 = require_parser2();
|
|
55836
55752
|
Object.defineProperty(exports2, "parse", { enumerable: true, get: function() {
|
|
55837
55753
|
return parser_1.parse;
|
|
@@ -56695,14 +56611,14 @@ var require_lib = __commonJS({
|
|
|
56695
56611
|
this.preserveSpace = !!preserveSpace;
|
|
56696
56612
|
}
|
|
56697
56613
|
};
|
|
56698
|
-
var
|
|
56614
|
+
var types7 = {
|
|
56699
56615
|
brace: new TokContext("{"),
|
|
56700
56616
|
j_oTag: new TokContext("<tag"),
|
|
56701
56617
|
j_cTag: new TokContext("</tag"),
|
|
56702
56618
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
56703
56619
|
};
|
|
56704
56620
|
{
|
|
56705
|
-
|
|
56621
|
+
types7.template = new TokContext("`", true);
|
|
56706
56622
|
}
|
|
56707
56623
|
var beforeExpr = true;
|
|
56708
56624
|
var startsExpr = true;
|
|
@@ -57234,17 +57150,17 @@ var require_lib = __commonJS({
|
|
|
57234
57150
|
context.pop();
|
|
57235
57151
|
};
|
|
57236
57152
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
57237
|
-
context.push(
|
|
57153
|
+
context.push(types7.brace);
|
|
57238
57154
|
};
|
|
57239
57155
|
tokenTypes[22].updateContext = (context) => {
|
|
57240
|
-
if (context[context.length - 1] ===
|
|
57156
|
+
if (context[context.length - 1] === types7.template) {
|
|
57241
57157
|
context.pop();
|
|
57242
57158
|
} else {
|
|
57243
|
-
context.push(
|
|
57159
|
+
context.push(types7.template);
|
|
57244
57160
|
}
|
|
57245
57161
|
};
|
|
57246
57162
|
tokenTypes[140].updateContext = (context) => {
|
|
57247
|
-
context.push(
|
|
57163
|
+
context.push(types7.j_expr, types7.j_oTag);
|
|
57248
57164
|
};
|
|
57249
57165
|
}
|
|
57250
57166
|
var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
|
|
@@ -57850,7 +57766,7 @@ var require_lib = __commonJS({
|
|
|
57850
57766
|
this.lastTokEndLoc = null;
|
|
57851
57767
|
this.lastTokStartLoc = null;
|
|
57852
57768
|
this.lastTokStart = 0;
|
|
57853
|
-
this.context = [
|
|
57769
|
+
this.context = [types7.brace];
|
|
57854
57770
|
this.canStartJSXElement = true;
|
|
57855
57771
|
this.containsEsc = false;
|
|
57856
57772
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -61741,7 +61657,7 @@ var require_lib = __commonJS({
|
|
|
61741
61657
|
context
|
|
61742
61658
|
} = this.state;
|
|
61743
61659
|
const currentContext = context[context.length - 1];
|
|
61744
|
-
if (currentContext ===
|
|
61660
|
+
if (currentContext === types7.j_oTag || currentContext === types7.j_expr) {
|
|
61745
61661
|
context.pop();
|
|
61746
61662
|
}
|
|
61747
61663
|
}
|
|
@@ -62799,9 +62715,9 @@ var require_lib = __commonJS({
|
|
|
62799
62715
|
switch (this.state.type) {
|
|
62800
62716
|
case 5:
|
|
62801
62717
|
node = this.startNode();
|
|
62802
|
-
this.setContext(
|
|
62718
|
+
this.setContext(types7.brace);
|
|
62803
62719
|
this.next();
|
|
62804
|
-
node = this.jsxParseExpressionContainer(node,
|
|
62720
|
+
node = this.jsxParseExpressionContainer(node, types7.j_oTag);
|
|
62805
62721
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
62806
62722
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
62807
62723
|
at: node
|
|
@@ -62824,7 +62740,7 @@ var require_lib = __commonJS({
|
|
|
62824
62740
|
jsxParseSpreadChild(node) {
|
|
62825
62741
|
this.next();
|
|
62826
62742
|
node.expression = this.parseExpression();
|
|
62827
|
-
this.setContext(
|
|
62743
|
+
this.setContext(types7.j_expr);
|
|
62828
62744
|
this.state.canStartJSXElement = true;
|
|
62829
62745
|
this.expect(8);
|
|
62830
62746
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -62844,11 +62760,11 @@ var require_lib = __commonJS({
|
|
|
62844
62760
|
jsxParseAttribute() {
|
|
62845
62761
|
const node = this.startNode();
|
|
62846
62762
|
if (this.match(5)) {
|
|
62847
|
-
this.setContext(
|
|
62763
|
+
this.setContext(types7.brace);
|
|
62848
62764
|
this.next();
|
|
62849
62765
|
this.expect(21);
|
|
62850
62766
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
62851
|
-
this.setContext(
|
|
62767
|
+
this.setContext(types7.j_oTag);
|
|
62852
62768
|
this.state.canStartJSXElement = true;
|
|
62853
62769
|
this.expect(8);
|
|
62854
62770
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -62907,12 +62823,12 @@ var require_lib = __commonJS({
|
|
|
62907
62823
|
break;
|
|
62908
62824
|
case 5: {
|
|
62909
62825
|
const node2 = this.startNode();
|
|
62910
|
-
this.setContext(
|
|
62826
|
+
this.setContext(types7.brace);
|
|
62911
62827
|
this.next();
|
|
62912
62828
|
if (this.match(21)) {
|
|
62913
62829
|
children.push(this.jsxParseSpreadChild(node2));
|
|
62914
62830
|
} else {
|
|
62915
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
62831
|
+
children.push(this.jsxParseExpressionContainer(node2, types7.j_expr));
|
|
62916
62832
|
}
|
|
62917
62833
|
break;
|
|
62918
62834
|
}
|
|
@@ -62983,11 +62899,11 @@ var require_lib = __commonJS({
|
|
|
62983
62899
|
}
|
|
62984
62900
|
getTokenFromCode(code) {
|
|
62985
62901
|
const context = this.curContext();
|
|
62986
|
-
if (context ===
|
|
62902
|
+
if (context === types7.j_expr) {
|
|
62987
62903
|
this.jsxReadToken();
|
|
62988
62904
|
return;
|
|
62989
62905
|
}
|
|
62990
|
-
if (context ===
|
|
62906
|
+
if (context === types7.j_oTag || context === types7.j_cTag) {
|
|
62991
62907
|
if (isIdentifierStart(code)) {
|
|
62992
62908
|
this.jsxReadWord();
|
|
62993
62909
|
return;
|
|
@@ -62997,7 +62913,7 @@ var require_lib = __commonJS({
|
|
|
62997
62913
|
this.finishToken(141);
|
|
62998
62914
|
return;
|
|
62999
62915
|
}
|
|
63000
|
-
if ((code === 34 || code === 39) && context ===
|
|
62916
|
+
if ((code === 34 || code === 39) && context === types7.j_oTag) {
|
|
63001
62917
|
this.jsxReadString(code);
|
|
63002
62918
|
return;
|
|
63003
62919
|
}
|
|
@@ -63015,17 +62931,17 @@ var require_lib = __commonJS({
|
|
|
63015
62931
|
type
|
|
63016
62932
|
} = this.state;
|
|
63017
62933
|
if (type === 56 && prevType === 140) {
|
|
63018
|
-
context.splice(-2, 2,
|
|
62934
|
+
context.splice(-2, 2, types7.j_cTag);
|
|
63019
62935
|
this.state.canStartJSXElement = false;
|
|
63020
62936
|
} else if (type === 140) {
|
|
63021
|
-
context.push(
|
|
62937
|
+
context.push(types7.j_oTag);
|
|
63022
62938
|
} else if (type === 141) {
|
|
63023
62939
|
const out = context[context.length - 1];
|
|
63024
|
-
if (out ===
|
|
62940
|
+
if (out === types7.j_oTag && prevType === 56 || out === types7.j_cTag) {
|
|
63025
62941
|
context.pop();
|
|
63026
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
62942
|
+
this.state.canStartJSXElement = context[context.length - 1] === types7.j_expr;
|
|
63027
62943
|
} else {
|
|
63028
|
-
this.setContext(
|
|
62944
|
+
this.setContext(types7.j_expr);
|
|
63029
62945
|
this.state.canStartJSXElement = true;
|
|
63030
62946
|
}
|
|
63031
62947
|
} else {
|
|
@@ -64469,14 +64385,14 @@ var require_lib = __commonJS({
|
|
|
64469
64385
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
64470
64386
|
const node = this.startNode();
|
|
64471
64387
|
const hasLeadingOperator = this.eat(operator);
|
|
64472
|
-
const
|
|
64388
|
+
const types8 = [];
|
|
64473
64389
|
do {
|
|
64474
|
-
|
|
64390
|
+
types8.push(parseConstituentType());
|
|
64475
64391
|
} while (this.eat(operator));
|
|
64476
|
-
if (
|
|
64477
|
-
return
|
|
64392
|
+
if (types8.length === 1 && !hasLeadingOperator) {
|
|
64393
|
+
return types8[0];
|
|
64478
64394
|
}
|
|
64479
|
-
node.types =
|
|
64395
|
+
node.types = types8;
|
|
64480
64396
|
return this.finishNode(node, kind);
|
|
64481
64397
|
}
|
|
64482
64398
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -65050,7 +64966,7 @@ var require_lib = __commonJS({
|
|
|
65050
64966
|
this.raise(TSErrors.EmptyTypeArguments, {
|
|
65051
64967
|
at: node
|
|
65052
64968
|
});
|
|
65053
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
64969
|
+
} else if (!this.state.inType && this.curContext() === types7.brace) {
|
|
65054
64970
|
this.reScan_lt_gt();
|
|
65055
64971
|
}
|
|
65056
64972
|
this.expect(48);
|
|
@@ -65727,7 +65643,7 @@ var require_lib = __commonJS({
|
|
|
65727
65643
|
context
|
|
65728
65644
|
} = this.state;
|
|
65729
65645
|
const currentContext = context[context.length - 1];
|
|
65730
|
-
if (currentContext ===
|
|
65646
|
+
if (currentContext === types7.j_oTag || currentContext === types7.j_expr) {
|
|
65731
65647
|
context.pop();
|
|
65732
65648
|
}
|
|
65733
65649
|
}
|
|
@@ -70615,13 +70531,224 @@ var init_codemod = __esm({
|
|
|
70615
70531
|
}
|
|
70616
70532
|
});
|
|
70617
70533
|
|
|
70618
|
-
// templates/
|
|
70534
|
+
// templates/analog/c3.ts
|
|
70535
|
+
var c3_exports = {};
|
|
70536
|
+
__export(c3_exports, {
|
|
70537
|
+
default: () => c3_default
|
|
70538
|
+
});
|
|
70539
|
+
var recast2, npm, pm, generate, configure, updateEnvTypes, updateViteConfig, config, c3_default;
|
|
70540
|
+
var init_c3 = __esm({
|
|
70541
|
+
"templates/analog/c3.ts"() {
|
|
70542
|
+
init_cli();
|
|
70543
|
+
init_colors();
|
|
70544
|
+
init_interactive();
|
|
70545
|
+
init_frameworks();
|
|
70546
|
+
init_codemod();
|
|
70547
|
+
init_compatDate();
|
|
70548
|
+
init_files();
|
|
70549
|
+
init_packageManagers();
|
|
70550
|
+
init_packages();
|
|
70551
|
+
recast2 = __toESM(require_main3());
|
|
70552
|
+
({ npm, name: pm } = detectPackageManager());
|
|
70553
|
+
generate = async (ctx) => {
|
|
70554
|
+
await runFrameworkGenerator(ctx, [
|
|
70555
|
+
ctx.project.name,
|
|
70556
|
+
"--template",
|
|
70557
|
+
"angular-v17"
|
|
70558
|
+
]);
|
|
70559
|
+
logRaw("");
|
|
70560
|
+
};
|
|
70561
|
+
configure = async (ctx) => {
|
|
70562
|
+
if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
|
|
70563
|
+
const packages = [];
|
|
70564
|
+
packages.push("nitropack");
|
|
70565
|
+
packages.push("h3");
|
|
70566
|
+
packages.push("@ngtools/webpack");
|
|
70567
|
+
packages.push("@angular-devkit/build-angular");
|
|
70568
|
+
await installPackages(packages, {
|
|
70569
|
+
dev: true,
|
|
70570
|
+
startText: `Installing ${packages.join(", ")}`,
|
|
70571
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
70572
|
+
});
|
|
70573
|
+
}
|
|
70574
|
+
updateViteConfig(ctx);
|
|
70575
|
+
updateEnvTypes(ctx);
|
|
70576
|
+
};
|
|
70577
|
+
updateEnvTypes = (ctx) => {
|
|
70578
|
+
const filepath = "env.d.ts";
|
|
70579
|
+
const s = spinner();
|
|
70580
|
+
s.start(`Updating ${filepath}`);
|
|
70581
|
+
let file = readFile(filepath);
|
|
70582
|
+
let typesEntrypoint = `@cloudflare/workers-types`;
|
|
70583
|
+
const latestEntrypoint = getLatestTypesEntrypoint(ctx);
|
|
70584
|
+
if (latestEntrypoint) {
|
|
70585
|
+
typesEntrypoint += `/${latestEntrypoint}`;
|
|
70586
|
+
}
|
|
70587
|
+
file = file.replace("WORKERS_TYPES_ENTRYPOINT", typesEntrypoint);
|
|
70588
|
+
writeFile2("env.d.ts", file);
|
|
70589
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
|
|
70590
|
+
};
|
|
70591
|
+
updateViteConfig = (ctx) => {
|
|
70592
|
+
const b2 = recast2.types.builders;
|
|
70593
|
+
const s = spinner();
|
|
70594
|
+
const configFile = "vite.config.ts";
|
|
70595
|
+
s.start(`Updating \`${configFile}\``);
|
|
70596
|
+
const snippets = loadTemplateSnippets(ctx);
|
|
70597
|
+
transformFile(configFile, {
|
|
70598
|
+
visitProgram(n2) {
|
|
70599
|
+
const lastImportIndex = n2.node.body.findLastIndex(
|
|
70600
|
+
(t) => t.type === "ImportDeclaration"
|
|
70601
|
+
);
|
|
70602
|
+
const lastImport = n2.get("body", lastImportIndex);
|
|
70603
|
+
lastImport.insertAfter(...snippets.devBindingsModuleTs);
|
|
70604
|
+
return this.traverse(n2);
|
|
70605
|
+
},
|
|
70606
|
+
visitCallExpression(n2) {
|
|
70607
|
+
const callee = n2.node.callee;
|
|
70608
|
+
if (callee.name === "analog") {
|
|
70609
|
+
const pluginArguments = b2.objectProperty(
|
|
70610
|
+
b2.identifier("nitro"),
|
|
70611
|
+
b2.objectExpression([
|
|
70612
|
+
b2.objectProperty(
|
|
70613
|
+
b2.identifier("preset"),
|
|
70614
|
+
b2.stringLiteral("cloudflare-pages")
|
|
70615
|
+
),
|
|
70616
|
+
b2.objectProperty(
|
|
70617
|
+
b2.identifier("modules"),
|
|
70618
|
+
b2.arrayExpression([b2.identifier("devBindingsModule")])
|
|
70619
|
+
)
|
|
70620
|
+
])
|
|
70621
|
+
);
|
|
70622
|
+
n2.node.arguments = [b2.objectExpression([pluginArguments])];
|
|
70623
|
+
}
|
|
70624
|
+
return this.traverse(n2);
|
|
70625
|
+
}
|
|
70626
|
+
});
|
|
70627
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
70628
|
+
};
|
|
70629
|
+
config = {
|
|
70630
|
+
configVersion: 1,
|
|
70631
|
+
id: "analog",
|
|
70632
|
+
platform: "pages",
|
|
70633
|
+
displayName: "Analog",
|
|
70634
|
+
copyFiles: {
|
|
70635
|
+
path: "./templates"
|
|
70636
|
+
},
|
|
70637
|
+
generate,
|
|
70638
|
+
configure,
|
|
70639
|
+
transformPackageJson: async () => ({
|
|
70640
|
+
scripts: {
|
|
70641
|
+
preview: `${npm} run build && wrangler pages dev`,
|
|
70642
|
+
deploy: `${npm} run build && wrangler pages deploy`,
|
|
70643
|
+
"build-cf-types": `wrangler types`
|
|
70644
|
+
}
|
|
70645
|
+
}),
|
|
70646
|
+
devScript: "dev",
|
|
70647
|
+
deployScript: "deploy",
|
|
70648
|
+
previewScript: "preview"
|
|
70649
|
+
};
|
|
70650
|
+
c3_default = config;
|
|
70651
|
+
}
|
|
70652
|
+
});
|
|
70653
|
+
|
|
70654
|
+
// templates/angular/c3.ts
|
|
70619
70655
|
var c3_exports2 = {};
|
|
70620
70656
|
__export(c3_exports2, {
|
|
70621
70657
|
default: () => c3_default2
|
|
70622
70658
|
});
|
|
70623
|
-
|
|
70659
|
+
async function installCFWorker() {
|
|
70660
|
+
await installPackages(
|
|
70661
|
+
["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
|
|
70662
|
+
{
|
|
70663
|
+
dev: true,
|
|
70664
|
+
startText: "Installing adapter dependencies",
|
|
70665
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
|
|
70666
|
+
}
|
|
70667
|
+
);
|
|
70668
|
+
}
|
|
70669
|
+
async function updateAppCode() {
|
|
70670
|
+
const s = spinner();
|
|
70671
|
+
s.start(`Updating application code`);
|
|
70672
|
+
const appConfigPath = "src/app/app.config.ts";
|
|
70673
|
+
const appConfig = readFile((0, import_node_path.resolve)(appConfigPath));
|
|
70674
|
+
const newAppConfig = "import { provideHttpClient, withFetch } from '@angular/common/http';\n" + appConfig.replace(
|
|
70675
|
+
"providers: [",
|
|
70676
|
+
"providers: [provideHttpClient(withFetch()), "
|
|
70677
|
+
);
|
|
70678
|
+
writeFile2((0, import_node_path.resolve)(appConfigPath), newAppConfig);
|
|
70679
|
+
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
70680
|
+
s.start(`Updating package.json`);
|
|
70681
|
+
const packageJsonPath = (0, import_node_path.resolve)("package.json");
|
|
70682
|
+
const packageManifest = readJSON(packageJsonPath);
|
|
70683
|
+
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
70684
|
+
delete packageManifest["dependencies"]["express"];
|
|
70685
|
+
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
70686
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`package.json\``)}`);
|
|
70687
|
+
}
|
|
70688
|
+
function updateAngularJson(ctx) {
|
|
70689
|
+
const s = spinner();
|
|
70690
|
+
s.start(`Updating angular.json config`);
|
|
70691
|
+
const angularJson = readJSON((0, import_node_path.resolve)("angular.json"));
|
|
70692
|
+
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
70693
|
+
architectSection.build.options.outputPath = "dist";
|
|
70694
|
+
architectSection.build.options.assets.push("src/_routes.json");
|
|
70695
|
+
writeFile2((0, import_node_path.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
70696
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
70697
|
+
}
|
|
70698
|
+
var import_node_path, npm2, generate2, configure2, config2, c3_default2;
|
|
70624
70699
|
var init_c32 = __esm({
|
|
70700
|
+
"templates/angular/c3.ts"() {
|
|
70701
|
+
import_node_path = require("node:path");
|
|
70702
|
+
init_cli();
|
|
70703
|
+
init_colors();
|
|
70704
|
+
init_interactive();
|
|
70705
|
+
init_frameworks();
|
|
70706
|
+
init_compatDate();
|
|
70707
|
+
init_files();
|
|
70708
|
+
init_packageManagers();
|
|
70709
|
+
init_packages();
|
|
70710
|
+
({ npm: npm2 } = detectPackageManager());
|
|
70711
|
+
generate2 = async (ctx) => {
|
|
70712
|
+
await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
|
|
70713
|
+
logRaw("");
|
|
70714
|
+
};
|
|
70715
|
+
configure2 = async (ctx) => {
|
|
70716
|
+
updateAngularJson(ctx);
|
|
70717
|
+
await updateAppCode();
|
|
70718
|
+
await installCFWorker();
|
|
70719
|
+
};
|
|
70720
|
+
config2 = {
|
|
70721
|
+
configVersion: 1,
|
|
70722
|
+
id: "angular",
|
|
70723
|
+
displayName: "Angular",
|
|
70724
|
+
platform: "pages",
|
|
70725
|
+
copyFiles: {
|
|
70726
|
+
path: "./templates"
|
|
70727
|
+
},
|
|
70728
|
+
devScript: "start",
|
|
70729
|
+
deployScript: "deploy",
|
|
70730
|
+
generate: generate2,
|
|
70731
|
+
configure: configure2,
|
|
70732
|
+
transformPackageJson: async () => ({
|
|
70733
|
+
scripts: {
|
|
70734
|
+
start: `${npm2} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
|
|
70735
|
+
build: `ng build && ${npm2} run process`,
|
|
70736
|
+
process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
|
|
70737
|
+
deploy: `${npm2} run build && wrangler pages deploy dist/cloudflare`
|
|
70738
|
+
}
|
|
70739
|
+
})
|
|
70740
|
+
};
|
|
70741
|
+
c3_default2 = config2;
|
|
70742
|
+
}
|
|
70743
|
+
});
|
|
70744
|
+
|
|
70745
|
+
// templates/astro/c3.ts
|
|
70746
|
+
var c3_exports3 = {};
|
|
70747
|
+
__export(c3_exports3, {
|
|
70748
|
+
default: () => c3_default3
|
|
70749
|
+
});
|
|
70750
|
+
var recast3, npx2, generate3, configure3, updateAstroConfig, updateEnvDeclaration, config3, c3_default3;
|
|
70751
|
+
var init_c33 = __esm({
|
|
70625
70752
|
"templates/astro/c3.ts"() {
|
|
70626
70753
|
init_cli();
|
|
70627
70754
|
init_colors();
|
|
@@ -70630,13 +70757,13 @@ var init_c32 = __esm({
|
|
|
70630
70757
|
init_command();
|
|
70631
70758
|
init_files();
|
|
70632
70759
|
init_packageManagers();
|
|
70633
|
-
|
|
70760
|
+
recast3 = __toESM(require_main3());
|
|
70634
70761
|
({ npx: npx2 } = detectPackageManager());
|
|
70635
|
-
|
|
70762
|
+
generate3 = async (ctx) => {
|
|
70636
70763
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
70637
70764
|
logRaw("");
|
|
70638
70765
|
};
|
|
70639
|
-
|
|
70766
|
+
configure3 = async (ctx) => {
|
|
70640
70767
|
await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
|
|
70641
70768
|
silent: true,
|
|
70642
70769
|
startText: "Installing adapter",
|
|
@@ -70656,7 +70783,7 @@ var init_c32 = __esm({
|
|
|
70656
70783
|
if (callee.name !== "cloudflare") {
|
|
70657
70784
|
return this.traverse(n2);
|
|
70658
70785
|
}
|
|
70659
|
-
const b2 =
|
|
70786
|
+
const b2 = recast3.types.builders;
|
|
70660
70787
|
n2.node.arguments = [
|
|
70661
70788
|
b2.objectExpression([
|
|
70662
70789
|
b2.objectProperty(
|
|
@@ -70681,7 +70808,7 @@ var init_c32 = __esm({
|
|
|
70681
70808
|
visitProgram: function(n2) {
|
|
70682
70809
|
const snippets = loadTemplateSnippets(ctx);
|
|
70683
70810
|
const patch = snippets.runtimeDeclarationTs;
|
|
70684
|
-
const b2 =
|
|
70811
|
+
const b2 = recast3.types.builders;
|
|
70685
70812
|
const comments = n2.get("comments").value;
|
|
70686
70813
|
n2.node.comments = comments.map(
|
|
70687
70814
|
(c2) => b2.commentLine(c2.value)
|
|
@@ -70691,7 +70818,7 @@ var init_c32 = __esm({
|
|
|
70691
70818
|
}
|
|
70692
70819
|
});
|
|
70693
70820
|
};
|
|
70694
|
-
|
|
70821
|
+
config3 = {
|
|
70695
70822
|
configVersion: 1,
|
|
70696
70823
|
id: "astro",
|
|
70697
70824
|
platform: "pages",
|
|
@@ -70702,8 +70829,8 @@ var init_c32 = __esm({
|
|
|
70702
70829
|
devScript: "dev",
|
|
70703
70830
|
deployScript: "deploy",
|
|
70704
70831
|
previewScript: "preview",
|
|
70705
|
-
generate:
|
|
70706
|
-
configure:
|
|
70832
|
+
generate: generate3,
|
|
70833
|
+
configure: configure3,
|
|
70707
70834
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
70708
70835
|
scripts: {
|
|
70709
70836
|
deploy: `astro build && wrangler pages deploy ./dist`,
|
|
@@ -70712,55 +70839,55 @@ var init_c32 = __esm({
|
|
|
70712
70839
|
}
|
|
70713
70840
|
})
|
|
70714
70841
|
};
|
|
70715
|
-
|
|
70842
|
+
c3_default3 = config3;
|
|
70716
70843
|
}
|
|
70717
70844
|
});
|
|
70718
70845
|
|
|
70719
70846
|
// templates/docusaurus/c3.ts
|
|
70720
|
-
var
|
|
70721
|
-
__export(
|
|
70722
|
-
default: () =>
|
|
70847
|
+
var c3_exports4 = {};
|
|
70848
|
+
__export(c3_exports4, {
|
|
70849
|
+
default: () => c3_default4
|
|
70723
70850
|
});
|
|
70724
|
-
var
|
|
70725
|
-
var
|
|
70851
|
+
var npm3, generate4, config4, c3_default4;
|
|
70852
|
+
var init_c34 = __esm({
|
|
70726
70853
|
"templates/docusaurus/c3.ts"() {
|
|
70727
70854
|
init_frameworks();
|
|
70728
70855
|
init_packageManagers();
|
|
70729
|
-
({ npm:
|
|
70730
|
-
|
|
70856
|
+
({ npm: npm3 } = detectPackageManager());
|
|
70857
|
+
generate4 = async (ctx) => {
|
|
70731
70858
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
70732
70859
|
};
|
|
70733
|
-
|
|
70860
|
+
config4 = {
|
|
70734
70861
|
configVersion: 1,
|
|
70735
70862
|
id: "docusaurus",
|
|
70736
70863
|
platform: "pages",
|
|
70737
70864
|
displayName: "Docusaurus",
|
|
70738
|
-
generate:
|
|
70865
|
+
generate: generate4,
|
|
70739
70866
|
transformPackageJson: async () => ({
|
|
70740
70867
|
scripts: {
|
|
70741
|
-
deploy: `${
|
|
70868
|
+
deploy: `${npm3} run build && wrangler pages deploy ./build`
|
|
70742
70869
|
}
|
|
70743
70870
|
}),
|
|
70744
70871
|
devScript: "start",
|
|
70745
70872
|
deployScript: "deploy"
|
|
70746
70873
|
};
|
|
70747
|
-
|
|
70874
|
+
c3_default4 = config4;
|
|
70748
70875
|
}
|
|
70749
70876
|
});
|
|
70750
70877
|
|
|
70751
70878
|
// templates/gatsby/c3.ts
|
|
70752
|
-
var
|
|
70753
|
-
__export(
|
|
70754
|
-
default: () =>
|
|
70879
|
+
var c3_exports5 = {};
|
|
70880
|
+
__export(c3_exports5, {
|
|
70881
|
+
default: () => c3_default5
|
|
70755
70882
|
});
|
|
70756
|
-
var
|
|
70757
|
-
var
|
|
70883
|
+
var npm4, generate5, config5, c3_default5;
|
|
70884
|
+
var init_c35 = __esm({
|
|
70758
70885
|
"templates/gatsby/c3.ts"() {
|
|
70759
70886
|
init_interactive();
|
|
70760
70887
|
init_frameworks();
|
|
70761
70888
|
init_packageManagers();
|
|
70762
|
-
({ npm:
|
|
70763
|
-
|
|
70889
|
+
({ npm: npm4 } = detectPackageManager());
|
|
70890
|
+
generate5 = async (ctx) => {
|
|
70764
70891
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
70765
70892
|
const useTemplate = await inputPrompt({
|
|
70766
70893
|
type: "confirm",
|
|
@@ -70779,37 +70906,37 @@ var init_c34 = __esm({
|
|
|
70779
70906
|
}
|
|
70780
70907
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
70781
70908
|
};
|
|
70782
|
-
|
|
70909
|
+
config5 = {
|
|
70783
70910
|
configVersion: 1,
|
|
70784
70911
|
id: "gatsby",
|
|
70785
70912
|
platform: "pages",
|
|
70786
70913
|
displayName: "Gatsby",
|
|
70787
|
-
generate:
|
|
70914
|
+
generate: generate5,
|
|
70788
70915
|
transformPackageJson: async () => ({
|
|
70789
70916
|
scripts: {
|
|
70790
|
-
deploy: `${
|
|
70791
|
-
preview: `${
|
|
70917
|
+
deploy: `${npm4} run build && wrangler pages deploy ./public`,
|
|
70918
|
+
preview: `${npm4} run build && wrangler pages dev ./public`
|
|
70792
70919
|
}
|
|
70793
70920
|
}),
|
|
70794
70921
|
devScript: "develop",
|
|
70795
70922
|
deployScript: "deploy",
|
|
70796
70923
|
previewScript: "preview"
|
|
70797
70924
|
};
|
|
70798
|
-
|
|
70925
|
+
c3_default5 = config5;
|
|
70799
70926
|
}
|
|
70800
70927
|
});
|
|
70801
70928
|
|
|
70802
70929
|
// templates/hono/c3.ts
|
|
70803
|
-
var
|
|
70804
|
-
__export(
|
|
70805
|
-
default: () =>
|
|
70930
|
+
var c3_exports6 = {};
|
|
70931
|
+
__export(c3_exports6, {
|
|
70932
|
+
default: () => c3_default6
|
|
70806
70933
|
});
|
|
70807
|
-
var
|
|
70808
|
-
var
|
|
70934
|
+
var generate6, config6, c3_default6;
|
|
70935
|
+
var init_c36 = __esm({
|
|
70809
70936
|
"templates/hono/c3.ts"() {
|
|
70810
70937
|
init_cli();
|
|
70811
70938
|
init_frameworks();
|
|
70812
|
-
|
|
70939
|
+
generate6 = async (ctx) => {
|
|
70813
70940
|
await runFrameworkGenerator(ctx, [
|
|
70814
70941
|
ctx.project.name,
|
|
70815
70942
|
"--template",
|
|
@@ -70817,28 +70944,28 @@ var init_c35 = __esm({
|
|
|
70817
70944
|
]);
|
|
70818
70945
|
logRaw("");
|
|
70819
70946
|
};
|
|
70820
|
-
|
|
70947
|
+
config6 = {
|
|
70821
70948
|
configVersion: 1,
|
|
70822
70949
|
id: "hono",
|
|
70823
70950
|
displayName: "Hono",
|
|
70824
70951
|
platform: "workers",
|
|
70825
|
-
generate:
|
|
70952
|
+
generate: generate6,
|
|
70826
70953
|
devScript: "dev",
|
|
70827
70954
|
deployScript: "deploy"
|
|
70828
70955
|
};
|
|
70829
|
-
|
|
70956
|
+
c3_default6 = config6;
|
|
70830
70957
|
}
|
|
70831
70958
|
});
|
|
70832
70959
|
|
|
70833
70960
|
// templates/next/c3.ts
|
|
70834
|
-
var
|
|
70835
|
-
__export(
|
|
70836
|
-
default: () =>
|
|
70961
|
+
var c3_exports7 = {};
|
|
70962
|
+
__export(c3_exports7, {
|
|
70963
|
+
default: () => c3_default7,
|
|
70837
70964
|
shouldInstallNextOnPagesEslintPlugin: () => shouldInstallNextOnPagesEslintPlugin,
|
|
70838
70965
|
writeEslintrc: () => writeEslintrc
|
|
70839
70966
|
});
|
|
70840
|
-
var import_path13,
|
|
70841
|
-
var
|
|
70967
|
+
var import_path13, npm5, npx3, generate7, updateNextConfig, configure4, shouldInstallNextOnPagesEslintPlugin, writeEslintrc, addDevDependencies, c3_default7;
|
|
70968
|
+
var init_c37 = __esm({
|
|
70842
70969
|
"templates/next/c3.ts"() {
|
|
70843
70970
|
import_path13 = require("path");
|
|
70844
70971
|
init_cli();
|
|
@@ -70850,8 +70977,8 @@ var init_c36 = __esm({
|
|
|
70850
70977
|
init_packageManagers();
|
|
70851
70978
|
init_packages();
|
|
70852
70979
|
init_templates();
|
|
70853
|
-
({ npm:
|
|
70854
|
-
|
|
70980
|
+
({ npm: npm5, npx: npx3 } = detectPackageManager());
|
|
70981
|
+
generate7 = async (ctx) => {
|
|
70855
70982
|
const projectName = ctx.project.name;
|
|
70856
70983
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
70857
70984
|
const wranglerToml = readFile((0, import_path13.join)(getTemplatePath(ctx), "wrangler.toml"));
|
|
@@ -70884,7 +71011,7 @@ ${$1}`
|
|
|
70884
71011
|
writeFile2(configFile, updatedConfigFile);
|
|
70885
71012
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
70886
71013
|
};
|
|
70887
|
-
|
|
71014
|
+
configure4 = async (ctx) => {
|
|
70888
71015
|
const projectPath = ctx.project.path;
|
|
70889
71016
|
const path4 = probePaths([
|
|
70890
71017
|
`${projectPath}/pages/api`,
|
|
@@ -70958,13 +71085,13 @@ ${$1}`
|
|
|
70958
71085
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
70959
71086
|
});
|
|
70960
71087
|
};
|
|
70961
|
-
|
|
71088
|
+
c3_default7 = {
|
|
70962
71089
|
configVersion: 1,
|
|
70963
71090
|
id: "next",
|
|
70964
71091
|
platform: "pages",
|
|
70965
71092
|
displayName: "Next",
|
|
70966
|
-
generate:
|
|
70967
|
-
configure:
|
|
71093
|
+
generate: generate7,
|
|
71094
|
+
configure: configure4,
|
|
70968
71095
|
copyFiles: {
|
|
70969
71096
|
async selectVariant(ctx) {
|
|
70970
71097
|
const isApp = probePaths([
|
|
@@ -70995,12 +71122,12 @@ ${$1}`
|
|
|
70995
71122
|
}
|
|
70996
71123
|
},
|
|
70997
71124
|
transformPackageJson: async (_2, ctx) => {
|
|
70998
|
-
const isNpm =
|
|
70999
|
-
const isBun =
|
|
71125
|
+
const isNpm = npm5 === "npm";
|
|
71126
|
+
const isBun = npm5 === "bun";
|
|
71000
71127
|
const isNpmOrBun = isNpm || isBun;
|
|
71001
71128
|
const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
|
|
71002
71129
|
const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
|
|
71003
|
-
const pmCommand = isNpmOrBun ? npx3 :
|
|
71130
|
+
const pmCommand = isNpmOrBun ? npx3 : npm5;
|
|
71004
71131
|
const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
|
|
71005
71132
|
return {
|
|
71006
71133
|
scripts: {
|
|
@@ -71022,12 +71149,12 @@ ${$1}`
|
|
|
71022
71149
|
});
|
|
71023
71150
|
|
|
71024
71151
|
// templates/nuxt/c3.ts
|
|
71025
|
-
var
|
|
71026
|
-
__export(
|
|
71027
|
-
default: () =>
|
|
71152
|
+
var c3_exports8 = {};
|
|
71153
|
+
__export(c3_exports8, {
|
|
71154
|
+
default: () => c3_default8
|
|
71028
71155
|
});
|
|
71029
|
-
var
|
|
71030
|
-
var
|
|
71156
|
+
var recast4, npm6, pm2, generate8, configure5, updateEnvTypes2, updateNuxtConfig, config7, c3_default8;
|
|
71157
|
+
var init_c38 = __esm({
|
|
71031
71158
|
"templates/nuxt/c3.ts"() {
|
|
71032
71159
|
init_cli();
|
|
71033
71160
|
init_colors();
|
|
@@ -71038,39 +71165,39 @@ var init_c37 = __esm({
|
|
|
71038
71165
|
init_files();
|
|
71039
71166
|
init_packageManagers();
|
|
71040
71167
|
init_packages();
|
|
71041
|
-
|
|
71042
|
-
({ npm:
|
|
71043
|
-
|
|
71168
|
+
recast4 = __toESM(require_main3());
|
|
71169
|
+
({ npm: npm6, name: pm2 } = detectPackageManager());
|
|
71170
|
+
generate8 = async (ctx) => {
|
|
71044
71171
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
71045
71172
|
await runFrameworkGenerator(ctx, [
|
|
71046
71173
|
"init",
|
|
71047
71174
|
ctx.project.name,
|
|
71048
71175
|
"--packageManager",
|
|
71049
|
-
|
|
71176
|
+
npm6,
|
|
71050
71177
|
gitFlag
|
|
71051
71178
|
]);
|
|
71052
71179
|
writeFile2("./.node-version", "17");
|
|
71053
71180
|
logRaw("");
|
|
71054
71181
|
};
|
|
71055
|
-
|
|
71182
|
+
configure5 = async (ctx) => {
|
|
71056
71183
|
const packages = ["nitro-cloudflare-dev"];
|
|
71057
|
-
if (
|
|
71184
|
+
if (pm2 === "pnpm") {
|
|
71058
71185
|
packages.push("h3");
|
|
71059
71186
|
}
|
|
71060
71187
|
await installPackages(packages, {
|
|
71061
71188
|
dev: true,
|
|
71062
71189
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
71063
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
71190
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
|
|
71064
71191
|
});
|
|
71065
71192
|
updateNuxtConfig();
|
|
71066
|
-
|
|
71193
|
+
updateEnvTypes2(ctx);
|
|
71067
71194
|
};
|
|
71068
|
-
|
|
71195
|
+
updateEnvTypes2 = (ctx) => {
|
|
71069
71196
|
const filepath = "env.d.ts";
|
|
71070
71197
|
const s = spinner();
|
|
71071
71198
|
s.start(`Updating ${filepath}`);
|
|
71072
71199
|
let file = readFile(filepath);
|
|
71073
|
-
let typesEntrypoint = `@cloudflare/workers-types
|
|
71200
|
+
let typesEntrypoint = `@cloudflare/workers-types`;
|
|
71074
71201
|
const latestEntrypoint = getLatestTypesEntrypoint(ctx);
|
|
71075
71202
|
if (latestEntrypoint) {
|
|
71076
71203
|
typesEntrypoint += `/${latestEntrypoint}`;
|
|
@@ -71083,7 +71210,7 @@ var init_c37 = __esm({
|
|
|
71083
71210
|
const s = spinner();
|
|
71084
71211
|
const configFile = "nuxt.config.ts";
|
|
71085
71212
|
s.start(`Updating \`${configFile}\``);
|
|
71086
|
-
const b2 =
|
|
71213
|
+
const b2 = recast4.types.builders;
|
|
71087
71214
|
const presetDef = b2.objectProperty(
|
|
71088
71215
|
b2.identifier("nitro"),
|
|
71089
71216
|
b2.objectExpression([
|
|
@@ -71110,7 +71237,7 @@ var init_c37 = __esm({
|
|
|
71110
71237
|
});
|
|
71111
71238
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
71112
71239
|
};
|
|
71113
|
-
|
|
71240
|
+
config7 = {
|
|
71114
71241
|
configVersion: 1,
|
|
71115
71242
|
id: "nuxt",
|
|
71116
71243
|
platform: "pages",
|
|
@@ -71118,12 +71245,12 @@ var init_c37 = __esm({
|
|
|
71118
71245
|
copyFiles: {
|
|
71119
71246
|
path: "./templates"
|
|
71120
71247
|
},
|
|
71121
|
-
generate:
|
|
71122
|
-
configure:
|
|
71248
|
+
generate: generate8,
|
|
71249
|
+
configure: configure5,
|
|
71123
71250
|
transformPackageJson: async () => ({
|
|
71124
71251
|
scripts: {
|
|
71125
|
-
deploy: `${
|
|
71126
|
-
preview: `${
|
|
71252
|
+
deploy: `${npm6} run build && wrangler pages deploy ./dist`,
|
|
71253
|
+
preview: `${npm6} run build && wrangler pages dev ./dist`,
|
|
71127
71254
|
"build-cf-types": `wrangler types`
|
|
71128
71255
|
}
|
|
71129
71256
|
}),
|
|
@@ -71131,17 +71258,17 @@ var init_c37 = __esm({
|
|
|
71131
71258
|
deployScript: "deploy",
|
|
71132
71259
|
previewScript: "preview"
|
|
71133
71260
|
};
|
|
71134
|
-
|
|
71261
|
+
c3_default8 = config7;
|
|
71135
71262
|
}
|
|
71136
71263
|
});
|
|
71137
71264
|
|
|
71138
71265
|
// templates/qwik/c3.ts
|
|
71139
|
-
var
|
|
71140
|
-
__export(
|
|
71141
|
-
default: () =>
|
|
71266
|
+
var c3_exports9 = {};
|
|
71267
|
+
__export(c3_exports9, {
|
|
71268
|
+
default: () => c3_default9
|
|
71142
71269
|
});
|
|
71143
|
-
var
|
|
71144
|
-
var
|
|
71270
|
+
var recast5, npm7, npx4, generate9, configure6, addBindingsProxy, populateCloudflareEnv, config8, c3_default9;
|
|
71271
|
+
var init_c39 = __esm({
|
|
71145
71272
|
"templates/qwik/c3.ts"() {
|
|
71146
71273
|
init_cli();
|
|
71147
71274
|
init_colors();
|
|
@@ -71151,12 +71278,12 @@ var init_c38 = __esm({
|
|
|
71151
71278
|
init_command();
|
|
71152
71279
|
init_files();
|
|
71153
71280
|
init_packageManagers();
|
|
71154
|
-
|
|
71155
|
-
({ npm:
|
|
71156
|
-
|
|
71281
|
+
recast5 = __toESM(require_main3());
|
|
71282
|
+
({ npm: npm7, npx: npx4 } = detectPackageManager());
|
|
71283
|
+
generate9 = async (ctx) => {
|
|
71157
71284
|
await runFrameworkGenerator(ctx, ["basic", ctx.project.name]);
|
|
71158
71285
|
};
|
|
71159
|
-
|
|
71286
|
+
configure6 = async (ctx) => {
|
|
71160
71287
|
const cmd = [npx4, "qwik", "add", "cloudflare-pages"];
|
|
71161
71288
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
71162
71289
|
await runCommand(cmd);
|
|
@@ -71170,7 +71297,7 @@ var init_c38 = __esm({
|
|
|
71170
71297
|
const s = spinner();
|
|
71171
71298
|
s.start("Updating `vite.config.ts`");
|
|
71172
71299
|
const snippets = loadTemplateSnippets(ctx);
|
|
71173
|
-
const b2 =
|
|
71300
|
+
const b2 = recast5.types.builders;
|
|
71174
71301
|
transformFile("vite.config.ts", {
|
|
71175
71302
|
// Insert the env declaration after the last import (but before the rest of the body)
|
|
71176
71303
|
visitProgram: function(n2) {
|
|
@@ -71212,7 +71339,7 @@ var init_c38 = __esm({
|
|
|
71212
71339
|
s.start(`Updating \`${entrypointPath}\``);
|
|
71213
71340
|
transformFile(entrypointPath, {
|
|
71214
71341
|
visitTSInterfaceDeclaration: function(n2) {
|
|
71215
|
-
const b2 =
|
|
71342
|
+
const b2 = recast5.types.builders;
|
|
71216
71343
|
const id = n2.node.id;
|
|
71217
71344
|
if (id.name !== "QwikCityPlatform") {
|
|
71218
71345
|
this.traverse(n2);
|
|
@@ -71233,7 +71360,7 @@ var init_c38 = __esm({
|
|
|
71233
71360
|
});
|
|
71234
71361
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
71235
71362
|
};
|
|
71236
|
-
|
|
71363
|
+
config8 = {
|
|
71237
71364
|
configVersion: 1,
|
|
71238
71365
|
id: "qwik",
|
|
71239
71366
|
displayName: "Qwik",
|
|
@@ -71241,12 +71368,12 @@ var init_c38 = __esm({
|
|
|
71241
71368
|
copyFiles: {
|
|
71242
71369
|
path: "./templates"
|
|
71243
71370
|
},
|
|
71244
|
-
generate:
|
|
71245
|
-
configure:
|
|
71371
|
+
generate: generate9,
|
|
71372
|
+
configure: configure6,
|
|
71246
71373
|
transformPackageJson: async () => ({
|
|
71247
71374
|
scripts: {
|
|
71248
|
-
deploy: `${
|
|
71249
|
-
preview: `${
|
|
71375
|
+
deploy: `${npm7} run build && wrangler pages deploy ./dist`,
|
|
71376
|
+
preview: `${npm7} run build && wrangler pages dev ./dist`,
|
|
71250
71377
|
"build-cf-types": `wrangler types`
|
|
71251
71378
|
}
|
|
71252
71379
|
}),
|
|
@@ -71254,53 +71381,53 @@ var init_c38 = __esm({
|
|
|
71254
71381
|
deployScript: "deploy",
|
|
71255
71382
|
previewScript: "preview"
|
|
71256
71383
|
};
|
|
71257
|
-
|
|
71384
|
+
c3_default9 = config8;
|
|
71258
71385
|
}
|
|
71259
71386
|
});
|
|
71260
71387
|
|
|
71261
71388
|
// templates/react/c3.ts
|
|
71262
|
-
var
|
|
71263
|
-
__export(
|
|
71264
|
-
default: () =>
|
|
71389
|
+
var c3_exports10 = {};
|
|
71390
|
+
__export(c3_exports10, {
|
|
71391
|
+
default: () => c3_default10
|
|
71265
71392
|
});
|
|
71266
|
-
var
|
|
71267
|
-
var
|
|
71393
|
+
var npm8, generate10, config9, c3_default10;
|
|
71394
|
+
var init_c310 = __esm({
|
|
71268
71395
|
"templates/react/c3.ts"() {
|
|
71269
71396
|
init_cli();
|
|
71270
71397
|
init_frameworks();
|
|
71271
71398
|
init_packageManagers();
|
|
71272
|
-
({ npm:
|
|
71273
|
-
|
|
71399
|
+
({ npm: npm8 } = detectPackageManager());
|
|
71400
|
+
generate10 = async (ctx) => {
|
|
71274
71401
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
71275
71402
|
logRaw("");
|
|
71276
71403
|
};
|
|
71277
|
-
|
|
71404
|
+
config9 = {
|
|
71278
71405
|
configVersion: 1,
|
|
71279
71406
|
id: "react",
|
|
71280
71407
|
displayName: "React",
|
|
71281
71408
|
platform: "pages",
|
|
71282
|
-
generate:
|
|
71409
|
+
generate: generate10,
|
|
71283
71410
|
transformPackageJson: async () => ({
|
|
71284
71411
|
scripts: {
|
|
71285
|
-
deploy: `${
|
|
71286
|
-
preview: `${
|
|
71412
|
+
deploy: `${npm8} run build && wrangler pages deploy ./build`,
|
|
71413
|
+
preview: `${npm8} run build && wrangler pages dev ./build`
|
|
71287
71414
|
}
|
|
71288
71415
|
}),
|
|
71289
71416
|
devScript: "dev",
|
|
71290
71417
|
deployScript: "deploy",
|
|
71291
71418
|
previewScript: "preview"
|
|
71292
71419
|
};
|
|
71293
|
-
|
|
71420
|
+
c3_default10 = config9;
|
|
71294
71421
|
}
|
|
71295
71422
|
});
|
|
71296
71423
|
|
|
71297
71424
|
// templates/remix/c3.ts
|
|
71298
|
-
var
|
|
71299
|
-
__export(
|
|
71300
|
-
default: () =>
|
|
71425
|
+
var c3_exports11 = {};
|
|
71426
|
+
__export(c3_exports11, {
|
|
71427
|
+
default: () => c3_default11
|
|
71301
71428
|
});
|
|
71302
|
-
var
|
|
71303
|
-
var
|
|
71429
|
+
var npm9, generate11, configure7, config10, c3_default11;
|
|
71430
|
+
var init_c311 = __esm({
|
|
71304
71431
|
"templates/remix/c3.ts"() {
|
|
71305
71432
|
init_cli();
|
|
71306
71433
|
init_colors();
|
|
@@ -71308,8 +71435,8 @@ var init_c310 = __esm({
|
|
|
71308
71435
|
init_frameworks();
|
|
71309
71436
|
init_codemod();
|
|
71310
71437
|
init_packageManagers();
|
|
71311
|
-
({ npm:
|
|
71312
|
-
|
|
71438
|
+
({ npm: npm9 } = detectPackageManager());
|
|
71439
|
+
generate11 = async (ctx) => {
|
|
71313
71440
|
await runFrameworkGenerator(ctx, [
|
|
71314
71441
|
ctx.project.name,
|
|
71315
71442
|
"--template",
|
|
@@ -71317,7 +71444,7 @@ var init_c310 = __esm({
|
|
|
71317
71444
|
]);
|
|
71318
71445
|
logRaw("");
|
|
71319
71446
|
};
|
|
71320
|
-
|
|
71447
|
+
configure7 = async () => {
|
|
71321
71448
|
const typeDefsPath = "load-context.ts";
|
|
71322
71449
|
const s = spinner();
|
|
71323
71450
|
s.start(`Updating \`${typeDefsPath}\``);
|
|
@@ -71332,7 +71459,7 @@ var init_c310 = __esm({
|
|
|
71332
71459
|
});
|
|
71333
71460
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
71334
71461
|
};
|
|
71335
|
-
|
|
71462
|
+
config10 = {
|
|
71336
71463
|
configVersion: 1,
|
|
71337
71464
|
id: "remix",
|
|
71338
71465
|
platform: "pages",
|
|
@@ -71340,12 +71467,12 @@ var init_c310 = __esm({
|
|
|
71340
71467
|
copyFiles: {
|
|
71341
71468
|
path: "./templates"
|
|
71342
71469
|
},
|
|
71343
|
-
generate:
|
|
71344
|
-
configure:
|
|
71470
|
+
generate: generate11,
|
|
71471
|
+
configure: configure7,
|
|
71345
71472
|
transformPackageJson: async () => ({
|
|
71346
71473
|
scripts: {
|
|
71347
|
-
deploy: `${
|
|
71348
|
-
preview: `${
|
|
71474
|
+
deploy: `${npm9} run build && wrangler pages deploy ./build/client`,
|
|
71475
|
+
preview: `${npm9} run build && wrangler pages dev ./build/client`,
|
|
71349
71476
|
"build-cf-types": `wrangler types`
|
|
71350
71477
|
}
|
|
71351
71478
|
}),
|
|
@@ -71353,17 +71480,17 @@ var init_c310 = __esm({
|
|
|
71353
71480
|
deployScript: "deploy",
|
|
71354
71481
|
previewScript: "preview"
|
|
71355
71482
|
};
|
|
71356
|
-
|
|
71483
|
+
c3_default11 = config10;
|
|
71357
71484
|
}
|
|
71358
71485
|
});
|
|
71359
71486
|
|
|
71360
71487
|
// templates/solid/c3.ts
|
|
71361
|
-
var
|
|
71362
|
-
__export(
|
|
71363
|
-
default: () =>
|
|
71488
|
+
var c3_exports12 = {};
|
|
71489
|
+
__export(c3_exports12, {
|
|
71490
|
+
default: () => c3_default12
|
|
71364
71491
|
});
|
|
71365
|
-
var
|
|
71366
|
-
var
|
|
71492
|
+
var recast6, npm10, generate12, configure8, config11, c3_default12;
|
|
71493
|
+
var init_c312 = __esm({
|
|
71367
71494
|
"templates/solid/c3.ts"() {
|
|
71368
71495
|
init_cli();
|
|
71369
71496
|
init_colors();
|
|
@@ -71372,13 +71499,13 @@ var init_c311 = __esm({
|
|
|
71372
71499
|
init_compatDate();
|
|
71373
71500
|
init_files();
|
|
71374
71501
|
init_packageManagers();
|
|
71375
|
-
|
|
71376
|
-
({ npm:
|
|
71377
|
-
|
|
71502
|
+
recast6 = __toESM(require_main3());
|
|
71503
|
+
({ npm: npm10 } = detectPackageManager());
|
|
71504
|
+
generate12 = async (ctx) => {
|
|
71378
71505
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
71379
71506
|
logRaw("");
|
|
71380
71507
|
};
|
|
71381
|
-
|
|
71508
|
+
configure8 = async (ctx) => {
|
|
71382
71509
|
usesTypescript(ctx);
|
|
71383
71510
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
71384
71511
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
@@ -71388,7 +71515,7 @@ var init_c311 = __esm({
|
|
|
71388
71515
|
if (callee.name !== "defineConfig") {
|
|
71389
71516
|
return this.traverse(n2);
|
|
71390
71517
|
}
|
|
71391
|
-
const b2 =
|
|
71518
|
+
const b2 = recast6.types.builders;
|
|
71392
71519
|
n2.node.arguments = [
|
|
71393
71520
|
b2.objectExpression([
|
|
71394
71521
|
b2.objectProperty(
|
|
@@ -71415,17 +71542,17 @@ var init_c311 = __esm({
|
|
|
71415
71542
|
}
|
|
71416
71543
|
});
|
|
71417
71544
|
};
|
|
71418
|
-
|
|
71545
|
+
config11 = {
|
|
71419
71546
|
configVersion: 1,
|
|
71420
71547
|
id: "solid",
|
|
71421
71548
|
displayName: "Solid",
|
|
71422
71549
|
platform: "pages",
|
|
71423
|
-
generate:
|
|
71424
|
-
configure:
|
|
71550
|
+
generate: generate12,
|
|
71551
|
+
configure: configure8,
|
|
71425
71552
|
transformPackageJson: async () => ({
|
|
71426
71553
|
scripts: {
|
|
71427
|
-
preview: `${
|
|
71428
|
-
deploy: `${
|
|
71554
|
+
preview: `${npm10} run build && npx wrangler pages dev dist ${await compatDateFlag()} --compatibility-flag nodejs_compat`,
|
|
71555
|
+
deploy: `${npm10} run build && wrangler pages deploy ./dist`
|
|
71429
71556
|
}
|
|
71430
71557
|
}),
|
|
71431
71558
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -71433,17 +71560,17 @@ var init_c311 = __esm({
|
|
|
71433
71560
|
deployScript: "deploy",
|
|
71434
71561
|
previewScript: "preview"
|
|
71435
71562
|
};
|
|
71436
|
-
|
|
71563
|
+
c3_default12 = config11;
|
|
71437
71564
|
}
|
|
71438
71565
|
});
|
|
71439
71566
|
|
|
71440
71567
|
// templates/svelte/c3.ts
|
|
71441
|
-
var
|
|
71442
|
-
__export(
|
|
71443
|
-
default: () =>
|
|
71568
|
+
var c3_exports13 = {};
|
|
71569
|
+
__export(c3_exports13, {
|
|
71570
|
+
default: () => c3_default13
|
|
71444
71571
|
});
|
|
71445
|
-
var import_node_os,
|
|
71446
|
-
var
|
|
71572
|
+
var import_node_os, recast7, npm11, generate13, configure9, updateSvelteConfig, updateTypeDefinitions, config12, c3_default13;
|
|
71573
|
+
var init_c313 = __esm({
|
|
71447
71574
|
"templates/svelte/c3.ts"() {
|
|
71448
71575
|
import_node_os = require("node:os");
|
|
71449
71576
|
init_cli();
|
|
@@ -71453,13 +71580,13 @@ var init_c312 = __esm({
|
|
|
71453
71580
|
init_files();
|
|
71454
71581
|
init_packageManagers();
|
|
71455
71582
|
init_packages();
|
|
71456
|
-
|
|
71457
|
-
({ npm:
|
|
71458
|
-
|
|
71583
|
+
recast7 = __toESM(require_main3());
|
|
71584
|
+
({ npm: npm11 } = detectPackageManager());
|
|
71585
|
+
generate13 = async (ctx) => {
|
|
71459
71586
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
71460
71587
|
logRaw("");
|
|
71461
71588
|
};
|
|
71462
|
-
|
|
71589
|
+
configure9 = async (ctx) => {
|
|
71463
71590
|
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
71464
71591
|
await installPackages([pkg], {
|
|
71465
71592
|
dev: true,
|
|
@@ -71486,7 +71613,7 @@ var init_c312 = __esm({
|
|
|
71486
71613
|
return;
|
|
71487
71614
|
}
|
|
71488
71615
|
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
71489
|
-
const b2 =
|
|
71616
|
+
const b2 = recast7.types.builders;
|
|
71490
71617
|
transformFile("src/app.d.ts", {
|
|
71491
71618
|
visitTSModuleDeclaration(n2) {
|
|
71492
71619
|
if (n2.value.id.name === "App" && n2.node.body) {
|
|
@@ -71518,7 +71645,7 @@ var init_c312 = __esm({
|
|
|
71518
71645
|
}
|
|
71519
71646
|
});
|
|
71520
71647
|
};
|
|
71521
|
-
|
|
71648
|
+
config12 = {
|
|
71522
71649
|
configVersion: 1,
|
|
71523
71650
|
id: "svelte",
|
|
71524
71651
|
displayName: "Svelte",
|
|
@@ -71529,12 +71656,12 @@ var init_c312 = __esm({
|
|
|
71529
71656
|
ts: { path: "./ts" }
|
|
71530
71657
|
}
|
|
71531
71658
|
},
|
|
71532
|
-
generate:
|
|
71533
|
-
configure:
|
|
71659
|
+
generate: generate13,
|
|
71660
|
+
configure: configure9,
|
|
71534
71661
|
transformPackageJson: async (original, ctx) => {
|
|
71535
71662
|
let scripts = {
|
|
71536
|
-
preview: `${
|
|
71537
|
-
deploy: `${
|
|
71663
|
+
preview: `${npm11} run build && wrangler pages dev .svelte-kit/cloudflare`,
|
|
71664
|
+
deploy: `${npm11} run build && wrangler pages deploy .svelte-kit/cloudflare`
|
|
71538
71665
|
};
|
|
71539
71666
|
if (usesTypescript(ctx)) {
|
|
71540
71667
|
const mv = (0, import_node_os.platform)() === "win32" ? "move" : "mv";
|
|
@@ -71549,53 +71676,53 @@ var init_c312 = __esm({
|
|
|
71549
71676
|
deployScript: "deploy",
|
|
71550
71677
|
previewScript: "preview"
|
|
71551
71678
|
};
|
|
71552
|
-
|
|
71679
|
+
c3_default13 = config12;
|
|
71553
71680
|
}
|
|
71554
71681
|
});
|
|
71555
71682
|
|
|
71556
71683
|
// templates/vue/c3.ts
|
|
71557
|
-
var
|
|
71558
|
-
__export(
|
|
71559
|
-
default: () =>
|
|
71684
|
+
var c3_exports14 = {};
|
|
71685
|
+
__export(c3_exports14, {
|
|
71686
|
+
default: () => c3_default14
|
|
71560
71687
|
});
|
|
71561
|
-
var
|
|
71562
|
-
var
|
|
71688
|
+
var npm12, generate14, config13, c3_default14;
|
|
71689
|
+
var init_c314 = __esm({
|
|
71563
71690
|
"templates/vue/c3.ts"() {
|
|
71564
71691
|
init_frameworks();
|
|
71565
71692
|
init_packageManagers();
|
|
71566
|
-
({ npm:
|
|
71567
|
-
|
|
71693
|
+
({ npm: npm12 } = detectPackageManager());
|
|
71694
|
+
generate14 = async (ctx) => {
|
|
71568
71695
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
71569
71696
|
};
|
|
71570
|
-
|
|
71697
|
+
config13 = {
|
|
71571
71698
|
configVersion: 1,
|
|
71572
71699
|
id: "vue",
|
|
71573
71700
|
displayName: "Vue",
|
|
71574
71701
|
platform: "pages",
|
|
71575
|
-
generate:
|
|
71702
|
+
generate: generate14,
|
|
71576
71703
|
transformPackageJson: async () => ({
|
|
71577
71704
|
scripts: {
|
|
71578
|
-
deploy: `${
|
|
71579
|
-
preview: `${
|
|
71705
|
+
deploy: `${npm12} run build && wrangler pages deploy ./dist`,
|
|
71706
|
+
preview: `${npm12} run build && wrangler pages dev ./dist`
|
|
71580
71707
|
}
|
|
71581
71708
|
}),
|
|
71582
71709
|
devScript: "dev",
|
|
71583
71710
|
deployScript: "deploy",
|
|
71584
71711
|
previewScript: "preview"
|
|
71585
71712
|
};
|
|
71586
|
-
|
|
71713
|
+
c3_default14 = config13;
|
|
71587
71714
|
}
|
|
71588
71715
|
});
|
|
71589
71716
|
|
|
71590
71717
|
// templates/hello-world/c3.ts
|
|
71591
|
-
var
|
|
71592
|
-
__export(
|
|
71593
|
-
default: () =>
|
|
71718
|
+
var c3_exports15 = {};
|
|
71719
|
+
__export(c3_exports15, {
|
|
71720
|
+
default: () => c3_default15
|
|
71594
71721
|
});
|
|
71595
|
-
var
|
|
71596
|
-
var
|
|
71722
|
+
var c3_default15;
|
|
71723
|
+
var init_c315 = __esm({
|
|
71597
71724
|
"templates/hello-world/c3.ts"() {
|
|
71598
|
-
|
|
71725
|
+
c3_default15 = {
|
|
71599
71726
|
configVersion: 1,
|
|
71600
71727
|
id: "hello-world",
|
|
71601
71728
|
displayName: '"Hello World" Worker',
|
|
@@ -71615,14 +71742,14 @@ var init_c314 = __esm({
|
|
|
71615
71742
|
});
|
|
71616
71743
|
|
|
71617
71744
|
// templates/hello-world-python/c3.ts
|
|
71618
|
-
var
|
|
71619
|
-
__export(
|
|
71620
|
-
default: () =>
|
|
71745
|
+
var c3_exports16 = {};
|
|
71746
|
+
__export(c3_exports16, {
|
|
71747
|
+
default: () => c3_default16
|
|
71621
71748
|
});
|
|
71622
|
-
var
|
|
71623
|
-
var
|
|
71749
|
+
var c3_default16;
|
|
71750
|
+
var init_c316 = __esm({
|
|
71624
71751
|
"templates/hello-world-python/c3.ts"() {
|
|
71625
|
-
|
|
71752
|
+
c3_default16 = {
|
|
71626
71753
|
configVersion: 1,
|
|
71627
71754
|
id: "hello-world-python",
|
|
71628
71755
|
displayName: '"Hello World" Worker (Python)',
|
|
@@ -71635,14 +71762,14 @@ var init_c315 = __esm({
|
|
|
71635
71762
|
});
|
|
71636
71763
|
|
|
71637
71764
|
// templates/hello-world-durable-object/c3.ts
|
|
71638
|
-
var
|
|
71639
|
-
__export(
|
|
71640
|
-
default: () =>
|
|
71765
|
+
var c3_exports17 = {};
|
|
71766
|
+
__export(c3_exports17, {
|
|
71767
|
+
default: () => c3_default17
|
|
71641
71768
|
});
|
|
71642
|
-
var
|
|
71643
|
-
var
|
|
71769
|
+
var c3_default17;
|
|
71770
|
+
var init_c317 = __esm({
|
|
71644
71771
|
"templates/hello-world-durable-object/c3.ts"() {
|
|
71645
|
-
|
|
71772
|
+
c3_default17 = {
|
|
71646
71773
|
configVersion: 1,
|
|
71647
71774
|
id: "hello-world-durable-object",
|
|
71648
71775
|
displayName: '"Hello World" Durable Object',
|
|
@@ -71662,14 +71789,14 @@ var init_c316 = __esm({
|
|
|
71662
71789
|
});
|
|
71663
71790
|
|
|
71664
71791
|
// templates/common/c3.ts
|
|
71665
|
-
var
|
|
71666
|
-
__export(
|
|
71667
|
-
default: () =>
|
|
71792
|
+
var c3_exports18 = {};
|
|
71793
|
+
__export(c3_exports18, {
|
|
71794
|
+
default: () => c3_default18
|
|
71668
71795
|
});
|
|
71669
|
-
var
|
|
71670
|
-
var
|
|
71796
|
+
var c3_default18;
|
|
71797
|
+
var init_c318 = __esm({
|
|
71671
71798
|
"templates/common/c3.ts"() {
|
|
71672
|
-
|
|
71799
|
+
c3_default18 = {
|
|
71673
71800
|
configVersion: 1,
|
|
71674
71801
|
id: "common",
|
|
71675
71802
|
displayName: "Example router & proxy Worker",
|
|
@@ -71689,14 +71816,14 @@ var init_c317 = __esm({
|
|
|
71689
71816
|
});
|
|
71690
71817
|
|
|
71691
71818
|
// templates/scheduled/c3.ts
|
|
71692
|
-
var
|
|
71693
|
-
__export(
|
|
71694
|
-
default: () =>
|
|
71819
|
+
var c3_exports19 = {};
|
|
71820
|
+
__export(c3_exports19, {
|
|
71821
|
+
default: () => c3_default19
|
|
71695
71822
|
});
|
|
71696
|
-
var
|
|
71697
|
-
var
|
|
71823
|
+
var c3_default19;
|
|
71824
|
+
var init_c319 = __esm({
|
|
71698
71825
|
"templates/scheduled/c3.ts"() {
|
|
71699
|
-
|
|
71826
|
+
c3_default19 = {
|
|
71700
71827
|
configVersion: 1,
|
|
71701
71828
|
id: "scheduled",
|
|
71702
71829
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -71716,14 +71843,14 @@ var init_c318 = __esm({
|
|
|
71716
71843
|
});
|
|
71717
71844
|
|
|
71718
71845
|
// templates/queues/c3.ts
|
|
71719
|
-
var
|
|
71720
|
-
__export(
|
|
71721
|
-
default: () =>
|
|
71846
|
+
var c3_exports20 = {};
|
|
71847
|
+
__export(c3_exports20, {
|
|
71848
|
+
default: () => c3_default20
|
|
71722
71849
|
});
|
|
71723
|
-
var
|
|
71724
|
-
var
|
|
71850
|
+
var c3_default20;
|
|
71851
|
+
var init_c320 = __esm({
|
|
71725
71852
|
"templates/queues/c3.ts"() {
|
|
71726
|
-
|
|
71853
|
+
c3_default20 = {
|
|
71727
71854
|
configVersion: 1,
|
|
71728
71855
|
id: "queues",
|
|
71729
71856
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -71753,14 +71880,14 @@ var init_c319 = __esm({
|
|
|
71753
71880
|
});
|
|
71754
71881
|
|
|
71755
71882
|
// templates/openapi/c3.ts
|
|
71756
|
-
var
|
|
71757
|
-
__export(
|
|
71758
|
-
default: () =>
|
|
71883
|
+
var c3_exports21 = {};
|
|
71884
|
+
__export(c3_exports21, {
|
|
71885
|
+
default: () => c3_default21
|
|
71759
71886
|
});
|
|
71760
|
-
var
|
|
71761
|
-
var
|
|
71887
|
+
var c3_default21;
|
|
71888
|
+
var init_c321 = __esm({
|
|
71762
71889
|
"templates/openapi/c3.ts"() {
|
|
71763
|
-
|
|
71890
|
+
c3_default21 = {
|
|
71764
71891
|
configVersion: 1,
|
|
71765
71892
|
id: "openapi",
|
|
71766
71893
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -71773,10 +71900,10 @@ var init_c320 = __esm({
|
|
|
71773
71900
|
});
|
|
71774
71901
|
|
|
71775
71902
|
// templates/pre-existing/c3.ts
|
|
71776
|
-
var
|
|
71777
|
-
__export(
|
|
71903
|
+
var c3_exports22 = {};
|
|
71904
|
+
__export(c3_exports22, {
|
|
71778
71905
|
copyExistingWorkerFiles: () => copyExistingWorkerFiles,
|
|
71779
|
-
default: () =>
|
|
71906
|
+
default: () => c3_default22
|
|
71780
71907
|
});
|
|
71781
71908
|
async function copyExistingWorkerFiles(ctx) {
|
|
71782
71909
|
const { dlx } = detectPackageManager();
|
|
@@ -71825,8 +71952,8 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
71825
71952
|
(0, import_path14.join)(ctx.project.path, "wrangler.toml")
|
|
71826
71953
|
);
|
|
71827
71954
|
}
|
|
71828
|
-
var import_promises, import_os, import_path14,
|
|
71829
|
-
var
|
|
71955
|
+
var import_promises, import_os, import_path14, c3_default22;
|
|
71956
|
+
var init_c322 = __esm({
|
|
71830
71957
|
"templates/pre-existing/c3.ts"() {
|
|
71831
71958
|
import_promises = require("fs/promises");
|
|
71832
71959
|
import_os = require("os");
|
|
@@ -71836,7 +71963,7 @@ var init_c321 = __esm({
|
|
|
71836
71963
|
init_command();
|
|
71837
71964
|
init_packageManagers();
|
|
71838
71965
|
init_accounts();
|
|
71839
|
-
|
|
71966
|
+
c3_default22 = {
|
|
71840
71967
|
configVersion: 1,
|
|
71841
71968
|
id: "pre-existing",
|
|
71842
71969
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
@@ -71900,36 +72027,37 @@ var init_templates = __esm({
|
|
|
71900
72027
|
return typescript ? "ts" : "js";
|
|
71901
72028
|
};
|
|
71902
72029
|
getFrameworkMap = async () => ({
|
|
71903
|
-
|
|
71904
|
-
|
|
71905
|
-
|
|
71906
|
-
|
|
71907
|
-
|
|
71908
|
-
|
|
71909
|
-
|
|
71910
|
-
|
|
71911
|
-
|
|
71912
|
-
|
|
71913
|
-
|
|
71914
|
-
|
|
71915
|
-
|
|
72030
|
+
analog: (await Promise.resolve().then(() => (init_c3(), c3_exports))).default,
|
|
72031
|
+
angular: (await Promise.resolve().then(() => (init_c32(), c3_exports2))).default,
|
|
72032
|
+
astro: (await Promise.resolve().then(() => (init_c33(), c3_exports3))).default,
|
|
72033
|
+
docusaurus: (await Promise.resolve().then(() => (init_c34(), c3_exports4))).default,
|
|
72034
|
+
gatsby: (await Promise.resolve().then(() => (init_c35(), c3_exports5))).default,
|
|
72035
|
+
hono: (await Promise.resolve().then(() => (init_c36(), c3_exports6))).default,
|
|
72036
|
+
next: (await Promise.resolve().then(() => (init_c37(), c3_exports7))).default,
|
|
72037
|
+
nuxt: (await Promise.resolve().then(() => (init_c38(), c3_exports8))).default,
|
|
72038
|
+
qwik: (await Promise.resolve().then(() => (init_c39(), c3_exports9))).default,
|
|
72039
|
+
react: (await Promise.resolve().then(() => (init_c310(), c3_exports10))).default,
|
|
72040
|
+
remix: (await Promise.resolve().then(() => (init_c311(), c3_exports11))).default,
|
|
72041
|
+
solid: (await Promise.resolve().then(() => (init_c312(), c3_exports12))).default,
|
|
72042
|
+
svelte: (await Promise.resolve().then(() => (init_c313(), c3_exports13))).default,
|
|
72043
|
+
vue: (await Promise.resolve().then(() => (init_c314(), c3_exports14))).default
|
|
71916
72044
|
});
|
|
71917
72045
|
getTemplateMap = async () => {
|
|
71918
72046
|
return {
|
|
71919
|
-
"hello-world": (await Promise.resolve().then(() => (
|
|
71920
|
-
"hello-world-python": (await Promise.resolve().then(() => (
|
|
71921
|
-
"hello-world-durable-object": (await Promise.resolve().then(() => (
|
|
72047
|
+
"hello-world": (await Promise.resolve().then(() => (init_c315(), c3_exports15))).default,
|
|
72048
|
+
"hello-world-python": (await Promise.resolve().then(() => (init_c316(), c3_exports16))).default,
|
|
72049
|
+
"hello-world-durable-object": (await Promise.resolve().then(() => (init_c317(), c3_exports17))).default,
|
|
71922
72050
|
// Dummy record -- actual template config resolved in `selectFramework`
|
|
71923
72051
|
"web-framework": { displayName: "Website or web app" },
|
|
71924
|
-
common: (await Promise.resolve().then(() => (
|
|
71925
|
-
scheduled: (await Promise.resolve().then(() => (
|
|
71926
|
-
queues: (await Promise.resolve().then(() => (
|
|
71927
|
-
openapi: (await Promise.resolve().then(() => (
|
|
72052
|
+
common: (await Promise.resolve().then(() => (init_c318(), c3_exports18))).default,
|
|
72053
|
+
scheduled: (await Promise.resolve().then(() => (init_c319(), c3_exports19))).default,
|
|
72054
|
+
queues: (await Promise.resolve().then(() => (init_c320(), c3_exports20))).default,
|
|
72055
|
+
openapi: (await Promise.resolve().then(() => (init_c321(), c3_exports21))).default,
|
|
71928
72056
|
// Dummy record -- actual template config resolved in `processRemoteTemplate`
|
|
71929
72057
|
"remote-template": {
|
|
71930
72058
|
displayName: "Worker built from a template hosted in a git repository"
|
|
71931
72059
|
},
|
|
71932
|
-
"pre-existing": (await Promise.resolve().then(() => (
|
|
72060
|
+
"pre-existing": (await Promise.resolve().then(() => (init_c322(), c3_exports22))).default
|
|
71933
72061
|
};
|
|
71934
72062
|
};
|
|
71935
72063
|
selectTemplate = async (args) => {
|
|
@@ -71980,8 +72108,8 @@ var init_templates = __esm({
|
|
|
71980
72108
|
selectFramework = async (args) => {
|
|
71981
72109
|
const frameworkMap = await getFrameworkMap();
|
|
71982
72110
|
const frameworkOptions = Object.entries(frameworkMap).map(
|
|
71983
|
-
([key,
|
|
71984
|
-
label:
|
|
72111
|
+
([key, config14]) => ({
|
|
72112
|
+
label: config14.displayName,
|
|
71985
72113
|
value: key
|
|
71986
72114
|
})
|
|
71987
72115
|
);
|
|
@@ -72030,27 +72158,27 @@ var init_templates = __esm({
|
|
|
72030
72158
|
defaultValue: C3_DEFAULTS.template
|
|
72031
72159
|
});
|
|
72032
72160
|
const path4 = await downloadRemoteTemplate(templateUrl);
|
|
72033
|
-
const
|
|
72034
|
-
validateTemplate(path4,
|
|
72161
|
+
const config14 = inferTemplateConfig(path4);
|
|
72162
|
+
validateTemplate(path4, config14);
|
|
72035
72163
|
return {
|
|
72036
72164
|
path: path4,
|
|
72037
|
-
...
|
|
72165
|
+
...config14
|
|
72038
72166
|
};
|
|
72039
72167
|
};
|
|
72040
|
-
validateTemplate = (path4,
|
|
72041
|
-
if (!
|
|
72168
|
+
validateTemplate = (path4, config14) => {
|
|
72169
|
+
if (!config14.copyFiles) {
|
|
72042
72170
|
return;
|
|
72043
72171
|
}
|
|
72044
|
-
if (isVariantInfo(
|
|
72045
|
-
validateTemplateSrcDirectory((0, import_path15.resolve)(path4,
|
|
72172
|
+
if (isVariantInfo(config14.copyFiles)) {
|
|
72173
|
+
validateTemplateSrcDirectory((0, import_path15.resolve)(path4, config14.copyFiles.path), config14);
|
|
72046
72174
|
} else {
|
|
72047
|
-
for (const variant of Object.values(
|
|
72048
|
-
validateTemplateSrcDirectory((0, import_path15.resolve)(path4, variant.path),
|
|
72175
|
+
for (const variant of Object.values(config14.copyFiles.variants)) {
|
|
72176
|
+
validateTemplateSrcDirectory((0, import_path15.resolve)(path4, variant.path), config14);
|
|
72049
72177
|
}
|
|
72050
72178
|
}
|
|
72051
72179
|
};
|
|
72052
|
-
validateTemplateSrcDirectory = (path4,
|
|
72053
|
-
if (
|
|
72180
|
+
validateTemplateSrcDirectory = (path4, config14) => {
|
|
72181
|
+
if (config14.platform === "workers") {
|
|
72054
72182
|
const wranglerTomlPath = (0, import_path15.resolve)(path4, "wrangler.toml");
|
|
72055
72183
|
if (!(0, import_fs12.existsSync)(wranglerTomlPath)) {
|
|
72056
72184
|
crash(`create-cloudflare templates must contain a "wrangler.toml" file.`);
|
|
@@ -73100,23 +73228,23 @@ var YargsParser = class {
|
|
|
73100
73228
|
const configPath = argv2[configKey] || configLookup[configKey];
|
|
73101
73229
|
if (configPath) {
|
|
73102
73230
|
try {
|
|
73103
|
-
let
|
|
73231
|
+
let config14 = null;
|
|
73104
73232
|
const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
|
|
73105
73233
|
const resolveConfig = flags.configs[configKey];
|
|
73106
73234
|
if (typeof resolveConfig === "function") {
|
|
73107
73235
|
try {
|
|
73108
|
-
|
|
73236
|
+
config14 = resolveConfig(resolvedConfigPath);
|
|
73109
73237
|
} catch (e) {
|
|
73110
|
-
|
|
73238
|
+
config14 = e;
|
|
73111
73239
|
}
|
|
73112
|
-
if (
|
|
73113
|
-
error2 =
|
|
73240
|
+
if (config14 instanceof Error) {
|
|
73241
|
+
error2 = config14;
|
|
73114
73242
|
return;
|
|
73115
73243
|
}
|
|
73116
73244
|
} else {
|
|
73117
|
-
|
|
73245
|
+
config14 = mixin2.require(resolvedConfigPath);
|
|
73118
73246
|
}
|
|
73119
|
-
setConfigObject(
|
|
73247
|
+
setConfigObject(config14);
|
|
73120
73248
|
} catch (ex) {
|
|
73121
73249
|
if (ex.name === "PermissionDenied")
|
|
73122
73250
|
error2 = ex;
|
|
@@ -73126,9 +73254,9 @@ var YargsParser = class {
|
|
|
73126
73254
|
}
|
|
73127
73255
|
});
|
|
73128
73256
|
}
|
|
73129
|
-
function setConfigObject(
|
|
73130
|
-
Object.keys(
|
|
73131
|
-
const value =
|
|
73257
|
+
function setConfigObject(config14, prev) {
|
|
73258
|
+
Object.keys(config14).forEach(function(key) {
|
|
73259
|
+
const value = config14[key];
|
|
73132
73260
|
const fullKey = prev ? prev + "." + key : key;
|
|
73133
73261
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
|
|
73134
73262
|
setConfigObject(value, fullKey);
|
|
@@ -74280,11 +74408,11 @@ var CommandInstance = class {
|
|
|
74280
74408
|
});
|
|
74281
74409
|
if (!unparsed.length)
|
|
74282
74410
|
return;
|
|
74283
|
-
const
|
|
74411
|
+
const config14 = Object.assign({}, options.configuration, {
|
|
74284
74412
|
"populate--": false
|
|
74285
74413
|
});
|
|
74286
74414
|
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
|
|
74287
|
-
configuration:
|
|
74415
|
+
configuration: config14
|
|
74288
74416
|
}));
|
|
74289
74417
|
if (parsed.error) {
|
|
74290
74418
|
yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
|
|
@@ -75506,31 +75634,31 @@ ${customMsgs.join("\n")}` : "";
|
|
|
75506
75634
|
// ../../node_modules/.pnpm/yargs@17.7.1/node_modules/yargs/build/lib/utils/apply-extends.js
|
|
75507
75635
|
var previouslyVisitedConfigs = [];
|
|
75508
75636
|
var shim2;
|
|
75509
|
-
function applyExtends(
|
|
75637
|
+
function applyExtends(config14, cwd, mergeExtends, _shim) {
|
|
75510
75638
|
shim2 = _shim;
|
|
75511
75639
|
let defaultConfig = {};
|
|
75512
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
75513
|
-
if (typeof
|
|
75640
|
+
if (Object.prototype.hasOwnProperty.call(config14, "extends")) {
|
|
75641
|
+
if (typeof config14.extends !== "string")
|
|
75514
75642
|
return defaultConfig;
|
|
75515
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
75643
|
+
const isPath = /\.json|\..*rc$/.test(config14.extends);
|
|
75516
75644
|
let pathToDefault = null;
|
|
75517
75645
|
if (!isPath) {
|
|
75518
75646
|
try {
|
|
75519
|
-
pathToDefault = require.resolve(
|
|
75647
|
+
pathToDefault = require.resolve(config14.extends);
|
|
75520
75648
|
} catch (_err) {
|
|
75521
|
-
return
|
|
75649
|
+
return config14;
|
|
75522
75650
|
}
|
|
75523
75651
|
} else {
|
|
75524
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
75652
|
+
pathToDefault = getPathToDefaultConfig(cwd, config14.extends);
|
|
75525
75653
|
}
|
|
75526
75654
|
checkForCircularExtends(pathToDefault);
|
|
75527
75655
|
previouslyVisitedConfigs.push(pathToDefault);
|
|
75528
|
-
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(
|
|
75529
|
-
delete
|
|
75656
|
+
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config14.extends);
|
|
75657
|
+
delete config14.extends;
|
|
75530
75658
|
defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
|
|
75531
75659
|
}
|
|
75532
75660
|
previouslyVisitedConfigs = [];
|
|
75533
|
-
return mergeExtends ? mergeDeep(defaultConfig,
|
|
75661
|
+
return mergeExtends ? mergeDeep(defaultConfig, config14) : Object.assign({}, defaultConfig, config14);
|
|
75534
75662
|
}
|
|
75535
75663
|
function checkForCircularExtends(cfgPath) {
|
|
75536
75664
|
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
|
@@ -76311,9 +76439,9 @@ var YargsInstance = class {
|
|
|
76311
76439
|
}
|
|
76312
76440
|
return maybePromise;
|
|
76313
76441
|
}
|
|
76314
|
-
parserConfiguration(
|
|
76315
|
-
argsert("<object>", [
|
|
76316
|
-
__classPrivateFieldSet(this, _YargsInstance_parserConfig,
|
|
76442
|
+
parserConfiguration(config14) {
|
|
76443
|
+
argsert("<object>", [config14], arguments.length);
|
|
76444
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config14, "f");
|
|
76317
76445
|
return this;
|
|
76318
76446
|
}
|
|
76319
76447
|
pkgConf(key, rootPath) {
|
|
@@ -76485,9 +76613,9 @@ var YargsInstance = class {
|
|
|
76485
76613
|
return this;
|
|
76486
76614
|
}
|
|
76487
76615
|
}
|
|
76488
|
-
usageConfiguration(
|
|
76489
|
-
argsert("<object>", [
|
|
76490
|
-
__classPrivateFieldSet(this, _YargsInstance_usageConfig,
|
|
76616
|
+
usageConfiguration(config14) {
|
|
76617
|
+
argsert("<object>", [config14], arguments.length);
|
|
76618
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config14, "f");
|
|
76491
76619
|
return this;
|
|
76492
76620
|
}
|
|
76493
76621
|
version(opt, msg, ver) {
|
|
@@ -76893,11 +77021,11 @@ var YargsInstance = class {
|
|
|
76893
77021
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
|
|
76894
77022
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
|
|
76895
77023
|
const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
|
|
76896
|
-
const
|
|
77024
|
+
const config14 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
|
|
76897
77025
|
"populate--": true
|
|
76898
77026
|
});
|
|
76899
77027
|
const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
|
|
76900
|
-
configuration: { "parse-positional-numbers": false, ...
|
|
77028
|
+
configuration: { "parse-positional-numbers": false, ...config14 }
|
|
76901
77029
|
}));
|
|
76902
77030
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
76903
77031
|
let argvPromise = void 0;
|
|
@@ -77334,15 +77462,15 @@ var showHelp = ({
|
|
|
77334
77462
|
options,
|
|
77335
77463
|
intro
|
|
77336
77464
|
}) => {
|
|
77337
|
-
const { name:
|
|
77465
|
+
const { name: pm3 } = detectPackageManager();
|
|
77338
77466
|
logRaw(`${brandColor("create-cloudflare")} ${dim("v" + version)}
|
|
77339
77467
|
`);
|
|
77340
77468
|
indent(`${intro.trim()}
|
|
77341
77469
|
`, 1);
|
|
77342
77470
|
logRaw(bold("USAGE\n"));
|
|
77343
|
-
const latest =
|
|
77344
|
-
const opts =
|
|
77345
|
-
indent(`${
|
|
77471
|
+
const latest = pm3 === "yarn" ? "" : "@latest";
|
|
77472
|
+
const opts = pm3 === "npm" ? "-- options" : "options";
|
|
77473
|
+
indent(`${pm3} create cloudflare${latest} [directory] [${opts}]
|
|
77346
77474
|
`, 1);
|
|
77347
77475
|
logRaw(bold("OPTIONS\n"));
|
|
77348
77476
|
renderPositionals(positionals);
|
|
@@ -77471,6 +77599,7 @@ var cliDefinition = {
|
|
|
77471
77599
|
pnpm create clouldfare --framework next -- --ts
|
|
77472
77600
|
`,
|
|
77473
77601
|
values: [
|
|
77602
|
+
{ name: "analog" },
|
|
77474
77603
|
{ name: "angular" },
|
|
77475
77604
|
{ name: "astro" },
|
|
77476
77605
|
{ name: "docusaurus" },
|
|
@@ -77671,7 +77800,7 @@ init_command();
|
|
|
77671
77800
|
init_packageManagers();
|
|
77672
77801
|
|
|
77673
77802
|
// ../wrangler/package.json
|
|
77674
|
-
var version2 = "3.
|
|
77803
|
+
var version2 = "3.50.0";
|
|
77675
77804
|
|
|
77676
77805
|
// src/git.ts
|
|
77677
77806
|
init_package();
|
|
@@ -78966,7 +79095,7 @@ var writeWranglerToml = (ctx, contents) => {
|
|
|
78966
79095
|
|
|
78967
79096
|
// src/deploy.ts
|
|
78968
79097
|
var offerToDeploy = async (ctx) => {
|
|
78969
|
-
const { npm:
|
|
79098
|
+
const { npm: npm14 } = detectPackageManager();
|
|
78970
79099
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
78971
79100
|
if (!await isDeployable(ctx)) {
|
|
78972
79101
|
ctx.args.deploy = false;
|
|
@@ -78977,7 +79106,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
78977
79106
|
);
|
|
78978
79107
|
}
|
|
78979
79108
|
const label = `deploy via \`${quoteShellArgs([
|
|
78980
|
-
|
|
79109
|
+
npm14,
|
|
78981
79110
|
"run",
|
|
78982
79111
|
ctx.template.deployScript ?? "deploy"
|
|
78983
79112
|
])}\``;
|
|
@@ -79008,18 +79137,18 @@ var isDeployable = async (ctx) => {
|
|
|
79008
79137
|
return true;
|
|
79009
79138
|
};
|
|
79010
79139
|
var runDeploy = async (ctx) => {
|
|
79011
|
-
const { npm:
|
|
79140
|
+
const { npm: npm14, name: pm3 } = detectPackageManager();
|
|
79012
79141
|
if (!ctx.account?.id) {
|
|
79013
79142
|
crash("Failed to read Cloudflare account.");
|
|
79014
79143
|
return;
|
|
79015
79144
|
}
|
|
79016
|
-
const baseDeployCmd = [
|
|
79145
|
+
const baseDeployCmd = [npm14, "run", ctx.template.deployScript ?? "deploy"];
|
|
79017
79146
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
79018
79147
|
const deployCmd = [
|
|
79019
79148
|
...baseDeployCmd,
|
|
79020
79149
|
// Important: the following assumes that all framework deploy commands terminate with `wrangler pages deploy`
|
|
79021
79150
|
...ctx.template.platform === "pages" && ctx.commitMessage && !insideGitRepo ? [
|
|
79022
|
-
...
|
|
79151
|
+
...pm3 === "npm" ? ["--"] : [],
|
|
79023
79152
|
"--commit-message",
|
|
79024
79153
|
JSON.stringify(ctx.commitMessage)
|
|
79025
79154
|
] : []
|
|
@@ -79027,7 +79156,10 @@ var runDeploy = async (ctx) => {
|
|
|
79027
79156
|
const result = await runCommand(deployCmd, {
|
|
79028
79157
|
silent: true,
|
|
79029
79158
|
cwd: ctx.project.path,
|
|
79030
|
-
env: {
|
|
79159
|
+
env: {
|
|
79160
|
+
CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
|
|
79161
|
+
NODE_ENV: "production"
|
|
79162
|
+
},
|
|
79031
79163
|
startText: "Deploying your application",
|
|
79032
79164
|
doneText: `${brandColor("deployed")} ${dim(
|
|
79033
79165
|
`via \`${quoteShellArgs(baseDeployCmd)}\``
|
|
@@ -79054,8 +79186,8 @@ init_command();
|
|
|
79054
79186
|
init_packageManagers();
|
|
79055
79187
|
|
|
79056
79188
|
// src/helpers/retry.ts
|
|
79057
|
-
var retry = async (
|
|
79058
|
-
let { times } =
|
|
79189
|
+
var retry = async (config14, fn) => {
|
|
79190
|
+
let { times } = config14;
|
|
79059
79191
|
let error2 = null;
|
|
79060
79192
|
while (times > 0) {
|
|
79061
79193
|
try {
|
|
@@ -79063,7 +79195,7 @@ var retry = async (config13, fn) => {
|
|
|
79063
79195
|
} catch (e) {
|
|
79064
79196
|
error2 = e;
|
|
79065
79197
|
times--;
|
|
79066
|
-
if (
|
|
79198
|
+
if (config14.exitCondition?.(e)) {
|
|
79067
79199
|
break;
|
|
79068
79200
|
}
|
|
79069
79201
|
}
|
|
@@ -79252,23 +79384,23 @@ function secondsSince(start) {
|
|
|
79252
79384
|
|
|
79253
79385
|
// src/summary.ts
|
|
79254
79386
|
var printSummary = async (ctx) => {
|
|
79255
|
-
const { npm:
|
|
79387
|
+
const { npm: npm14 } = detectPackageManager();
|
|
79256
79388
|
const dirRelativePath = (0, import_path10.relative)(ctx.originalCWD, ctx.project.path);
|
|
79257
79389
|
const nextSteps = [
|
|
79258
79390
|
dirRelativePath ? ["Navigate to the new directory", `cd ${dirRelativePath}`] : [],
|
|
79259
79391
|
[
|
|
79260
79392
|
"Run the development server",
|
|
79261
|
-
quoteShellArgs([
|
|
79393
|
+
quoteShellArgs([npm14, "run", ctx.template.devScript ?? "start"])
|
|
79262
79394
|
],
|
|
79263
79395
|
...ctx.template.previewScript ? [
|
|
79264
79396
|
[
|
|
79265
79397
|
"Preview your application",
|
|
79266
|
-
quoteShellArgs([
|
|
79398
|
+
quoteShellArgs([npm14, "run", ctx.template.previewScript])
|
|
79267
79399
|
]
|
|
79268
79400
|
] : [],
|
|
79269
79401
|
[
|
|
79270
79402
|
"Deploy your application",
|
|
79271
|
-
quoteShellArgs([
|
|
79403
|
+
quoteShellArgs([npm14, "run", ctx.template.deployScript ?? "deploy"])
|
|
79272
79404
|
],
|
|
79273
79405
|
[
|
|
79274
79406
|
"Read the documentation",
|
|
@@ -79290,7 +79422,7 @@ var printSummary = async (ctx) => {
|
|
|
79290
79422
|
`${bgGreen(" APPLICATION CREATED ")}`,
|
|
79291
79423
|
`${dim("Deploy your application with")}`,
|
|
79292
79424
|
`${blue(
|
|
79293
|
-
quoteShellArgs([
|
|
79425
|
+
quoteShellArgs([npm14, "run", ctx.template.deployScript ?? "deploy"])
|
|
79294
79426
|
)}`
|
|
79295
79427
|
].join(" ");
|
|
79296
79428
|
logRaw(msg);
|
|
@@ -80634,14 +80766,14 @@ function applyEdits(text, edits) {
|
|
|
80634
80766
|
|
|
80635
80767
|
// src/workers.ts
|
|
80636
80768
|
async function installWorkersTypes(ctx) {
|
|
80637
|
-
const { npm:
|
|
80769
|
+
const { npm: npm14 } = detectPackageManager();
|
|
80638
80770
|
if (!usesTypescript(ctx)) {
|
|
80639
80771
|
return;
|
|
80640
80772
|
}
|
|
80641
80773
|
await installPackages(["@cloudflare/workers-types"], {
|
|
80642
80774
|
dev: true,
|
|
80643
80775
|
startText: "Installing @cloudflare/workers-types",
|
|
80644
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
80776
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm14}`)}`
|
|
80645
80777
|
});
|
|
80646
80778
|
await addWorkersTypesToTsConfig(ctx);
|
|
80647
80779
|
}
|
|
@@ -80664,8 +80796,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
80664
80796
|
}
|
|
80665
80797
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
80666
80798
|
try {
|
|
80667
|
-
const
|
|
80668
|
-
const currentTypes =
|
|
80799
|
+
const config14 = parse3(tsconfig);
|
|
80800
|
+
const currentTypes = config14.compilerOptions?.types ?? [];
|
|
80669
80801
|
const explicitEntrypoint = currentTypes.some(
|
|
80670
80802
|
(t) => t.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
80671
80803
|
);
|
|
@@ -80695,7 +80827,7 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
80695
80827
|
}
|
|
80696
80828
|
|
|
80697
80829
|
// src/cli.ts
|
|
80698
|
-
var { npm:
|
|
80830
|
+
var { npm: npm13 } = detectPackageManager();
|
|
80699
80831
|
var main = async (argv) => {
|
|
80700
80832
|
const args = await parseArgs(argv);
|
|
80701
80833
|
logRaw("");
|
|
@@ -80707,10 +80839,10 @@ var main = async (argv) => {
|
|
|
80707
80839
|
};
|
|
80708
80840
|
var runLatest = async () => {
|
|
80709
80841
|
const args = process.argv.slice(2);
|
|
80710
|
-
if (
|
|
80842
|
+
if (npm13 === "npm") {
|
|
80711
80843
|
args.unshift("--");
|
|
80712
80844
|
}
|
|
80713
|
-
await runCommand([
|
|
80845
|
+
await runCommand([npm13, "create", "cloudflare@latest", ...args]);
|
|
80714
80846
|
};
|
|
80715
80847
|
var runCli = async (args) => {
|
|
80716
80848
|
printBanner();
|
|
@@ -80755,7 +80887,7 @@ var setupProjectDirectory = (args) => {
|
|
|
80755
80887
|
};
|
|
80756
80888
|
var runTemplate = async (ctx) => {
|
|
80757
80889
|
await create(ctx);
|
|
80758
|
-
await
|
|
80890
|
+
await configure10(ctx);
|
|
80759
80891
|
await deploy(ctx);
|
|
80760
80892
|
await printSummary(ctx);
|
|
80761
80893
|
};
|
|
@@ -80771,7 +80903,7 @@ var create = async (ctx) => {
|
|
|
80771
80903
|
await rectifyPmMismatch(ctx);
|
|
80772
80904
|
endSection(`Application created`);
|
|
80773
80905
|
};
|
|
80774
|
-
var
|
|
80906
|
+
var configure10 = async (ctx) => {
|
|
80775
80907
|
startSection("Configuring your application for Cloudflare", "Step 2 of 3");
|
|
80776
80908
|
await installWrangler();
|
|
80777
80909
|
await installWorkersTypes(ctx);
|