create-cloudflare 2.18.0 → 2.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +809 -682
- package/package.json +2 -2
- 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/hello-world-python/py/wrangler.toml +94 -0
- package/templates/nuxt/c3.ts +1 -1
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 = "2.
|
|
3900
|
+
version = "2.19.0";
|
|
3901
3901
|
devDependencies = {
|
|
3902
3902
|
"@babel/parser": "^7.21.3",
|
|
3903
3903
|
"@babel/types": "^7.21.4",
|
|
@@ -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,
|
|
@@ -24604,6 +24604,7 @@ var init_package2 = __esm({
|
|
|
24604
24604
|
],
|
|
24605
24605
|
dependencies: {
|
|
24606
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
|
}
|
|
@@ -29705,7 +29707,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
29705
29707
|
}
|
|
29706
29708
|
}
|
|
29707
29709
|
};
|
|
29708
|
-
var
|
|
29710
|
+
var types7 = createCommonjsModule(function(module3, exports3) {
|
|
29709
29711
|
exports3.name = /* @__PURE__ */ new Map([
|
|
29710
29712
|
["0", "File"],
|
|
29711
29713
|
// same as File
|
|
@@ -29959,14 +29961,14 @@ var require_index_688c5d50 = __commonJS({
|
|
|
29959
29961
|
}
|
|
29960
29962
|
}
|
|
29961
29963
|
get type() {
|
|
29962
|
-
return
|
|
29964
|
+
return types7.name.get(this[TYPE]) || this[TYPE];
|
|
29963
29965
|
}
|
|
29964
29966
|
get typeKey() {
|
|
29965
29967
|
return this[TYPE];
|
|
29966
29968
|
}
|
|
29967
29969
|
set type(type) {
|
|
29968
|
-
if (
|
|
29969
|
-
this[TYPE] =
|
|
29970
|
+
if (types7.code.has(type))
|
|
29971
|
+
this[TYPE] = types7.code.get(type);
|
|
29970
29972
|
else
|
|
29971
29973
|
this[TYPE] = type;
|
|
29972
29974
|
}
|
|
@@ -33078,7 +33080,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
33078
33080
|
exports3.WriteEntry = writeEntry;
|
|
33079
33081
|
exports3.Header = header;
|
|
33080
33082
|
exports3.Pax = pax;
|
|
33081
|
-
exports3.types =
|
|
33083
|
+
exports3.types = types7;
|
|
33082
33084
|
});
|
|
33083
33085
|
var colorName = {
|
|
33084
33086
|
"aliceblue": [240, 248, 255],
|
|
@@ -39421,97 +39423,6 @@ var init_validators = __esm({
|
|
|
39421
39423
|
}
|
|
39422
39424
|
});
|
|
39423
39425
|
|
|
39424
|
-
// templates/angular/c3.ts
|
|
39425
|
-
var c3_exports = {};
|
|
39426
|
-
__export(c3_exports, {
|
|
39427
|
-
default: () => c3_default
|
|
39428
|
-
});
|
|
39429
|
-
async function installCFWorker() {
|
|
39430
|
-
await installPackages(
|
|
39431
|
-
["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
|
|
39432
|
-
{
|
|
39433
|
-
dev: true,
|
|
39434
|
-
startText: "Installing adapter dependencies",
|
|
39435
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
39436
|
-
}
|
|
39437
|
-
);
|
|
39438
|
-
}
|
|
39439
|
-
async function updateAppCode() {
|
|
39440
|
-
const s = spinner();
|
|
39441
|
-
s.start(`Updating application code`);
|
|
39442
|
-
const appConfigPath = "src/app/app.config.ts";
|
|
39443
|
-
const appConfig = readFile((0, import_node_path.resolve)(appConfigPath));
|
|
39444
|
-
const newAppConfig = "import { provideHttpClient, withFetch } from '@angular/common/http';\n" + appConfig.replace(
|
|
39445
|
-
"providers: [",
|
|
39446
|
-
"providers: [provideHttpClient(withFetch()), "
|
|
39447
|
-
);
|
|
39448
|
-
writeFile2((0, import_node_path.resolve)(appConfigPath), newAppConfig);
|
|
39449
|
-
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
39450
|
-
s.start(`Updating package.json`);
|
|
39451
|
-
const packageJsonPath = (0, import_node_path.resolve)("package.json");
|
|
39452
|
-
const packageManifest = readJSON(packageJsonPath);
|
|
39453
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
39454
|
-
delete packageManifest["dependencies"]["express"];
|
|
39455
|
-
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
39456
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`package.json\``)}`);
|
|
39457
|
-
}
|
|
39458
|
-
function updateAngularJson(ctx) {
|
|
39459
|
-
const s = spinner();
|
|
39460
|
-
s.start(`Updating angular.json config`);
|
|
39461
|
-
const angularJson = readJSON((0, import_node_path.resolve)("angular.json"));
|
|
39462
|
-
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
39463
|
-
architectSection.build.options.outputPath = "dist";
|
|
39464
|
-
architectSection.build.options.assets.push("src/_routes.json");
|
|
39465
|
-
writeFile2((0, import_node_path.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
39466
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
39467
|
-
}
|
|
39468
|
-
var import_node_path, npm, generate, configure, config, c3_default;
|
|
39469
|
-
var init_c3 = __esm({
|
|
39470
|
-
"templates/angular/c3.ts"() {
|
|
39471
|
-
import_node_path = require("node:path");
|
|
39472
|
-
init_cli();
|
|
39473
|
-
init_colors();
|
|
39474
|
-
init_interactive();
|
|
39475
|
-
init_frameworks();
|
|
39476
|
-
init_compatDate();
|
|
39477
|
-
init_files();
|
|
39478
|
-
init_packageManagers();
|
|
39479
|
-
init_packages();
|
|
39480
|
-
({ npm } = detectPackageManager());
|
|
39481
|
-
generate = async (ctx) => {
|
|
39482
|
-
await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
|
|
39483
|
-
logRaw("");
|
|
39484
|
-
};
|
|
39485
|
-
configure = async (ctx) => {
|
|
39486
|
-
updateAngularJson(ctx);
|
|
39487
|
-
await updateAppCode();
|
|
39488
|
-
await installCFWorker();
|
|
39489
|
-
};
|
|
39490
|
-
config = {
|
|
39491
|
-
configVersion: 1,
|
|
39492
|
-
id: "angular",
|
|
39493
|
-
displayName: "Angular",
|
|
39494
|
-
platform: "pages",
|
|
39495
|
-
copyFiles: {
|
|
39496
|
-
path: "./templates"
|
|
39497
|
-
},
|
|
39498
|
-
devScript: "start",
|
|
39499
|
-
deployScript: "deploy",
|
|
39500
|
-
generate,
|
|
39501
|
-
configure,
|
|
39502
|
-
transformPackageJson: async () => ({
|
|
39503
|
-
scripts: {
|
|
39504
|
-
start: `${npm} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
|
|
39505
|
-
build: `ng build && ${npm} run process`,
|
|
39506
|
-
process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
|
|
39507
|
-
deploy: `${npm} run build && wrangler pages deploy dist/cloudflare`
|
|
39508
|
-
}
|
|
39509
|
-
})
|
|
39510
|
-
};
|
|
39511
|
-
c3_default = config;
|
|
39512
|
-
}
|
|
39513
|
-
});
|
|
39514
|
-
|
|
39515
39426
|
// ../../node_modules/.pnpm/tslib@2.5.3/node_modules/tslib/tslib.es6.mjs
|
|
39516
39427
|
var tslib_es6_exports = {};
|
|
39517
39428
|
__export(tslib_es6_exports, {
|
|
@@ -40102,9 +40013,9 @@ var require_types = __commonJS({
|
|
|
40102
40013
|
/** @class */
|
|
40103
40014
|
function(_super) {
|
|
40104
40015
|
(0, tslib_1.__extends)(OrType2, _super);
|
|
40105
|
-
function OrType2(
|
|
40016
|
+
function OrType2(types7) {
|
|
40106
40017
|
var _this = _super.call(this) || this;
|
|
40107
|
-
_this.types =
|
|
40018
|
+
_this.types = types7;
|
|
40108
40019
|
_this.kind = "OrType";
|
|
40109
40020
|
return _this;
|
|
40110
40021
|
}
|
|
@@ -40249,11 +40160,11 @@ var require_types = __commonJS({
|
|
|
40249
40160
|
function typesPlugin(_fork) {
|
|
40250
40161
|
var Type = {
|
|
40251
40162
|
or: function() {
|
|
40252
|
-
var
|
|
40163
|
+
var types7 = [];
|
|
40253
40164
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
40254
|
-
|
|
40165
|
+
types7[_i] = arguments[_i];
|
|
40255
40166
|
}
|
|
40256
|
-
return new OrType(
|
|
40167
|
+
return new OrType(types7.map(function(type) {
|
|
40257
40168
|
return Type.from(type);
|
|
40258
40169
|
}));
|
|
40259
40170
|
},
|
|
@@ -40702,9 +40613,9 @@ var require_path = __commonJS({
|
|
|
40702
40613
|
var Op = Object.prototype;
|
|
40703
40614
|
var hasOwn = Op.hasOwnProperty;
|
|
40704
40615
|
function pathPlugin(fork) {
|
|
40705
|
-
var
|
|
40706
|
-
var isArray =
|
|
40707
|
-
var isNumber =
|
|
40616
|
+
var types7 = fork.use(types_1.default);
|
|
40617
|
+
var isArray = types7.builtInTypes.array;
|
|
40618
|
+
var isNumber = types7.builtInTypes.number;
|
|
40708
40619
|
var Path = function Path2(value, parentPath, name) {
|
|
40709
40620
|
if (!(this instanceof Path2)) {
|
|
40710
40621
|
throw new Error("Path constructor cannot be invoked without 'new'");
|
|
@@ -41004,13 +40915,13 @@ var require_scope = __commonJS({
|
|
|
41004
40915
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
41005
40916
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
41006
40917
|
function scopePlugin(fork) {
|
|
41007
|
-
var
|
|
41008
|
-
var Type =
|
|
41009
|
-
var namedTypes =
|
|
40918
|
+
var types7 = fork.use(types_1.default);
|
|
40919
|
+
var Type = types7.Type;
|
|
40920
|
+
var namedTypes = types7.namedTypes;
|
|
41010
40921
|
var Node = namedTypes.Node;
|
|
41011
40922
|
var Expression = namedTypes.Expression;
|
|
41012
|
-
var isArray =
|
|
41013
|
-
var b2 =
|
|
40923
|
+
var isArray = types7.builtInTypes.array;
|
|
40924
|
+
var b2 = types7.builders;
|
|
41014
40925
|
var Scope = function Scope2(path4, parentScope) {
|
|
41015
40926
|
if (!(this instanceof Scope2)) {
|
|
41016
40927
|
throw new Error("Scope constructor cannot be invoked without 'new'");
|
|
@@ -41078,7 +40989,7 @@ var require_scope = __commonJS({
|
|
|
41078
40989
|
++index;
|
|
41079
40990
|
}
|
|
41080
40991
|
var name = prefix + index;
|
|
41081
|
-
return this.bindings[name] =
|
|
40992
|
+
return this.bindings[name] = types7.builders.identifier(name);
|
|
41082
40993
|
};
|
|
41083
40994
|
Sp.injectTemporary = function(identifier, init) {
|
|
41084
40995
|
identifier || (identifier = this.declareTemporary());
|
|
@@ -41158,7 +41069,7 @@ var require_scope = __commonJS({
|
|
|
41158
41069
|
bindings
|
|
41159
41070
|
);
|
|
41160
41071
|
} else if (Node.check(node) && !Expression.check(node)) {
|
|
41161
|
-
|
|
41072
|
+
types7.eachField(node, function(name, child) {
|
|
41162
41073
|
var childPath = path4.get(name);
|
|
41163
41074
|
if (!pathHasValue(childPath, child)) {
|
|
41164
41075
|
throw new Error("");
|
|
@@ -41237,24 +41148,24 @@ var require_scope = __commonJS({
|
|
|
41237
41148
|
addPattern(patternPath.get("argument"), bindings);
|
|
41238
41149
|
}
|
|
41239
41150
|
}
|
|
41240
|
-
function addTypePattern(patternPath,
|
|
41151
|
+
function addTypePattern(patternPath, types8) {
|
|
41241
41152
|
var pattern = patternPath.value;
|
|
41242
41153
|
namedTypes.Pattern.assert(pattern);
|
|
41243
41154
|
if (namedTypes.Identifier.check(pattern)) {
|
|
41244
|
-
if (hasOwn.call(
|
|
41245
|
-
|
|
41155
|
+
if (hasOwn.call(types8, pattern.name)) {
|
|
41156
|
+
types8[pattern.name].push(patternPath);
|
|
41246
41157
|
} else {
|
|
41247
|
-
|
|
41158
|
+
types8[pattern.name] = [patternPath];
|
|
41248
41159
|
}
|
|
41249
41160
|
}
|
|
41250
41161
|
}
|
|
41251
|
-
function addTypeParameter(parameterPath,
|
|
41162
|
+
function addTypeParameter(parameterPath, types8) {
|
|
41252
41163
|
var parameter = parameterPath.value;
|
|
41253
41164
|
FlowOrTSTypeParameterType.assert(parameter);
|
|
41254
|
-
if (hasOwn.call(
|
|
41255
|
-
|
|
41165
|
+
if (hasOwn.call(types8, parameter.name)) {
|
|
41166
|
+
types8[parameter.name].push(parameterPath);
|
|
41256
41167
|
} else {
|
|
41257
|
-
|
|
41168
|
+
types8[parameter.name] = [parameterPath];
|
|
41258
41169
|
}
|
|
41259
41170
|
}
|
|
41260
41171
|
Sp.lookup = function(name) {
|
|
@@ -41292,11 +41203,11 @@ var require_node_path = __commonJS({
|
|
|
41292
41203
|
var path_1 = (0, tslib_1.__importDefault)(require_path());
|
|
41293
41204
|
var scope_1 = (0, tslib_1.__importDefault)(require_scope());
|
|
41294
41205
|
function nodePathPlugin(fork) {
|
|
41295
|
-
var
|
|
41296
|
-
var n2 =
|
|
41297
|
-
var b2 =
|
|
41298
|
-
var isNumber =
|
|
41299
|
-
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;
|
|
41300
41211
|
var Path = fork.use(path_1.default);
|
|
41301
41212
|
var Scope = fork.use(scope_1.default);
|
|
41302
41213
|
var NodePath = function NodePath2(value, parentPath, name) {
|
|
@@ -41387,7 +41298,7 @@ var require_node_path = __commonJS({
|
|
|
41387
41298
|
return scope || null;
|
|
41388
41299
|
};
|
|
41389
41300
|
NPp.getValueProperty = function(name) {
|
|
41390
|
-
return
|
|
41301
|
+
return types7.getFieldValue(this.value, name);
|
|
41391
41302
|
};
|
|
41392
41303
|
NPp.needsParens = function(assumeExpressionContext) {
|
|
41393
41304
|
var pp = this.parentPath;
|
|
@@ -41529,7 +41440,7 @@ var require_node_path = __commonJS({
|
|
|
41529
41440
|
return node.some(containsCallExpression);
|
|
41530
41441
|
}
|
|
41531
41442
|
if (n2.Node.check(node)) {
|
|
41532
|
-
return
|
|
41443
|
+
return types7.someField(node, function(_name, child) {
|
|
41533
41444
|
return containsCallExpression(child);
|
|
41534
41445
|
});
|
|
41535
41446
|
}
|
|
@@ -41647,11 +41558,11 @@ var require_path_visitor = __commonJS({
|
|
|
41647
41558
|
var node_path_1 = (0, tslib_1.__importDefault)(require_node_path());
|
|
41648
41559
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
41649
41560
|
function pathVisitorPlugin(fork) {
|
|
41650
|
-
var
|
|
41561
|
+
var types7 = fork.use(types_1.default);
|
|
41651
41562
|
var NodePath = fork.use(node_path_1.default);
|
|
41652
|
-
var isArray =
|
|
41653
|
-
var isObject2 =
|
|
41654
|
-
var isFunction2 =
|
|
41563
|
+
var isArray = types7.builtInTypes.array;
|
|
41564
|
+
var isObject2 = types7.builtInTypes.object;
|
|
41565
|
+
var isFunction2 = types7.builtInTypes.function;
|
|
41655
41566
|
var undefined2;
|
|
41656
41567
|
var PathVisitor = function PathVisitor2() {
|
|
41657
41568
|
if (!(this instanceof PathVisitor2)) {
|
|
@@ -41671,7 +41582,7 @@ var require_path_visitor = __commonJS({
|
|
|
41671
41582
|
typeNames[methodName.slice("visit".length)] = true;
|
|
41672
41583
|
}
|
|
41673
41584
|
}
|
|
41674
|
-
var supertypeTable =
|
|
41585
|
+
var supertypeTable = types7.computeSupertypeLookupTable(typeNames);
|
|
41675
41586
|
var methodNameTable = /* @__PURE__ */ Object.create(null);
|
|
41676
41587
|
var typeNameKeys = Object.keys(supertypeTable);
|
|
41677
41588
|
var typeNameCount = typeNameKeys.length;
|
|
@@ -41790,7 +41701,7 @@ var require_path_visitor = __commonJS({
|
|
|
41790
41701
|
path4.each(visitor.visitWithoutReset, visitor);
|
|
41791
41702
|
} else if (!isObject2.check(value)) {
|
|
41792
41703
|
} else {
|
|
41793
|
-
var childNames =
|
|
41704
|
+
var childNames = types7.getFieldNames(value);
|
|
41794
41705
|
if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
|
|
41795
41706
|
childNames.push("comments");
|
|
41796
41707
|
}
|
|
@@ -41799,7 +41710,7 @@ var require_path_visitor = __commonJS({
|
|
|
41799
41710
|
for (var i = 0; i < childCount; ++i) {
|
|
41800
41711
|
var childName = childNames[i];
|
|
41801
41712
|
if (!hasOwn.call(value, childName)) {
|
|
41802
|
-
value[childName] =
|
|
41713
|
+
value[childName] = types7.getFieldValue(value, childName);
|
|
41803
41714
|
}
|
|
41804
41715
|
childPaths.push(path4.get(childName));
|
|
41805
41716
|
}
|
|
@@ -41939,13 +41850,13 @@ var require_equiv = __commonJS({
|
|
|
41939
41850
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
41940
41851
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
41941
41852
|
function default_1(fork) {
|
|
41942
|
-
var
|
|
41943
|
-
var getFieldNames =
|
|
41944
|
-
var getFieldValue =
|
|
41945
|
-
var isArray =
|
|
41946
|
-
var isObject2 =
|
|
41947
|
-
var isDate =
|
|
41948
|
-
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;
|
|
41949
41860
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
41950
41861
|
function astNodesAreEquivalent(a, b2, problemPath) {
|
|
41951
41862
|
if (isArray.check(problemPath)) {
|
|
@@ -42095,24 +42006,24 @@ var require_fork = __commonJS({
|
|
|
42095
42006
|
var node_path_1 = (0, tslib_1.__importDefault)(require_node_path());
|
|
42096
42007
|
function default_1(plugins) {
|
|
42097
42008
|
var fork = createFork();
|
|
42098
|
-
var
|
|
42009
|
+
var types7 = fork.use(types_1.default);
|
|
42099
42010
|
plugins.forEach(fork.use);
|
|
42100
|
-
|
|
42011
|
+
types7.finalize();
|
|
42101
42012
|
var PathVisitor = fork.use(path_visitor_1.default);
|
|
42102
42013
|
return {
|
|
42103
|
-
Type:
|
|
42104
|
-
builtInTypes:
|
|
42105
|
-
namedTypes:
|
|
42106
|
-
builders:
|
|
42107
|
-
defineMethod:
|
|
42108
|
-
getFieldNames:
|
|
42109
|
-
getFieldValue:
|
|
42110
|
-
eachField:
|
|
42111
|
-
someField:
|
|
42112
|
-
getSupertypeNames:
|
|
42113
|
-
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,
|
|
42114
42025
|
astNodesAreEquivalent: fork.use(equiv_1.default),
|
|
42115
|
-
finalize:
|
|
42026
|
+
finalize: types7.finalize,
|
|
42116
42027
|
Path: fork.use(path_1.default),
|
|
42117
42028
|
NodePath: fork.use(node_path_1.default),
|
|
42118
42029
|
PathVisitor,
|
|
@@ -42148,9 +42059,9 @@ var require_shared = __commonJS({
|
|
|
42148
42059
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
42149
42060
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42150
42061
|
function default_1(fork) {
|
|
42151
|
-
var
|
|
42152
|
-
var Type =
|
|
42153
|
-
var builtin =
|
|
42062
|
+
var types7 = fork.use(types_1.default);
|
|
42063
|
+
var Type = types7.Type;
|
|
42064
|
+
var builtin = types7.builtInTypes;
|
|
42154
42065
|
var isNumber = builtin.number;
|
|
42155
42066
|
function geq(than) {
|
|
42156
42067
|
return Type.from(function(value) {
|
|
@@ -42329,8 +42240,8 @@ var require_core2 = __commonJS({
|
|
|
42329
42240
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42330
42241
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42331
42242
|
function default_1(fork) {
|
|
42332
|
-
var
|
|
42333
|
-
var Type =
|
|
42243
|
+
var types7 = fork.use(types_1.default);
|
|
42244
|
+
var Type = types7.Type;
|
|
42334
42245
|
var def = Type.def;
|
|
42335
42246
|
var or = Type.or;
|
|
42336
42247
|
var shared = fork.use(shared_1.default);
|
|
@@ -42420,9 +42331,9 @@ var require_es6 = __commonJS({
|
|
|
42420
42331
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42421
42332
|
function default_1(fork) {
|
|
42422
42333
|
fork.use(core_1.default);
|
|
42423
|
-
var
|
|
42424
|
-
var def =
|
|
42425
|
-
var or =
|
|
42334
|
+
var types7 = fork.use(types_1.default);
|
|
42335
|
+
var def = types7.Type.def;
|
|
42336
|
+
var or = types7.Type.or;
|
|
42426
42337
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42427
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"]);
|
|
42428
42339
|
def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
|
|
@@ -42508,8 +42419,8 @@ var require_es2017 = __commonJS({
|
|
|
42508
42419
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42509
42420
|
function default_1(fork) {
|
|
42510
42421
|
fork.use(es2016_1.default);
|
|
42511
|
-
var
|
|
42512
|
-
var def =
|
|
42422
|
+
var types7 = fork.use(types_1.default);
|
|
42423
|
+
var def = types7.Type.def;
|
|
42513
42424
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42514
42425
|
def("Function").field("async", Boolean, defaults["false"]);
|
|
42515
42426
|
def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
|
|
@@ -42530,9 +42441,9 @@ var require_es2018 = __commonJS({
|
|
|
42530
42441
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42531
42442
|
function default_1(fork) {
|
|
42532
42443
|
fork.use(es2017_1.default);
|
|
42533
|
-
var
|
|
42534
|
-
var def =
|
|
42535
|
-
var or =
|
|
42444
|
+
var types7 = fork.use(types_1.default);
|
|
42445
|
+
var def = types7.Type.def;
|
|
42446
|
+
var or = types7.Type.or;
|
|
42536
42447
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42537
42448
|
def("ForOfStatement").field("await", Boolean, defaults["false"]);
|
|
42538
42449
|
def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
|
|
@@ -42562,9 +42473,9 @@ var require_es2019 = __commonJS({
|
|
|
42562
42473
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42563
42474
|
function default_1(fork) {
|
|
42564
42475
|
fork.use(es2018_1.default);
|
|
42565
|
-
var
|
|
42566
|
-
var def =
|
|
42567
|
-
var or =
|
|
42476
|
+
var types7 = fork.use(types_1.default);
|
|
42477
|
+
var def = types7.Type.def;
|
|
42478
|
+
var or = types7.Type.or;
|
|
42568
42479
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42569
42480
|
def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
|
|
42570
42481
|
}
|
|
@@ -42586,9 +42497,9 @@ var require_es20202 = __commonJS({
|
|
|
42586
42497
|
function default_1(fork) {
|
|
42587
42498
|
fork.use(es2020_1.default);
|
|
42588
42499
|
fork.use(es2019_1.default);
|
|
42589
|
-
var
|
|
42590
|
-
var def =
|
|
42591
|
-
var or =
|
|
42500
|
+
var types7 = fork.use(types_1.default);
|
|
42501
|
+
var def = types7.Type.def;
|
|
42502
|
+
var or = types7.Type.or;
|
|
42592
42503
|
var shared = fork.use(shared_1.default);
|
|
42593
42504
|
var defaults = shared.defaults;
|
|
42594
42505
|
def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
|
|
@@ -42632,8 +42543,8 @@ var require_es2022 = __commonJS({
|
|
|
42632
42543
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42633
42544
|
function default_1(fork) {
|
|
42634
42545
|
fork.use(es2021_1.default);
|
|
42635
|
-
var
|
|
42636
|
-
var def =
|
|
42546
|
+
var types7 = fork.use(types_1.default);
|
|
42547
|
+
var def = types7.Type.def;
|
|
42637
42548
|
def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
|
|
42638
42549
|
}
|
|
42639
42550
|
exports2.default = default_1;
|
|
@@ -42652,9 +42563,9 @@ var require_es_proposals = __commonJS({
|
|
|
42652
42563
|
var es2022_1 = (0, tslib_1.__importDefault)(require_es2022());
|
|
42653
42564
|
function default_1(fork) {
|
|
42654
42565
|
fork.use(es2022_1.default);
|
|
42655
|
-
var
|
|
42656
|
-
var Type =
|
|
42657
|
-
var def =
|
|
42566
|
+
var types7 = fork.use(types_1.default);
|
|
42567
|
+
var Type = types7.Type;
|
|
42568
|
+
var def = types7.Type.def;
|
|
42658
42569
|
var or = Type.or;
|
|
42659
42570
|
var shared = fork.use(shared_1.default);
|
|
42660
42571
|
var defaults = shared.defaults;
|
|
@@ -42692,9 +42603,9 @@ var require_jsx = __commonJS({
|
|
|
42692
42603
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42693
42604
|
function default_1(fork) {
|
|
42694
42605
|
fork.use(es_proposals_1.default);
|
|
42695
|
-
var
|
|
42696
|
-
var def =
|
|
42697
|
-
var or =
|
|
42606
|
+
var types7 = fork.use(types_1.default);
|
|
42607
|
+
var def = types7.Type.def;
|
|
42608
|
+
var or = types7.Type.or;
|
|
42698
42609
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42699
42610
|
def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
|
|
42700
42611
|
def("Literal"),
|
|
@@ -42756,9 +42667,9 @@ var require_type_annotations = __commonJS({
|
|
|
42756
42667
|
var types_1 = (0, tslib_1.__importDefault)(require_types());
|
|
42757
42668
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42758
42669
|
function default_1(fork) {
|
|
42759
|
-
var
|
|
42760
|
-
var def =
|
|
42761
|
-
var or =
|
|
42670
|
+
var types7 = fork.use(types_1.default);
|
|
42671
|
+
var def = types7.Type.def;
|
|
42672
|
+
var or = types7.Type.or;
|
|
42762
42673
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42763
42674
|
var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
|
|
42764
42675
|
var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
|
|
@@ -42791,9 +42702,9 @@ var require_flow = __commonJS({
|
|
|
42791
42702
|
function default_1(fork) {
|
|
42792
42703
|
fork.use(es_proposals_1.default);
|
|
42793
42704
|
fork.use(type_annotations_1.default);
|
|
42794
|
-
var
|
|
42795
|
-
var def =
|
|
42796
|
-
var or =
|
|
42705
|
+
var types7 = fork.use(types_1.default);
|
|
42706
|
+
var def = types7.Type.def;
|
|
42707
|
+
var or = types7.Type.or;
|
|
42797
42708
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42798
42709
|
def("Flow").bases("Node");
|
|
42799
42710
|
def("FlowType").bases("Flow");
|
|
@@ -42908,10 +42819,10 @@ var require_esprima = __commonJS({
|
|
|
42908
42819
|
var shared_1 = (0, tslib_1.__importDefault)(require_shared());
|
|
42909
42820
|
function default_1(fork) {
|
|
42910
42821
|
fork.use(es_proposals_1.default);
|
|
42911
|
-
var
|
|
42822
|
+
var types7 = fork.use(types_1.default);
|
|
42912
42823
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42913
|
-
var def =
|
|
42914
|
-
var or =
|
|
42824
|
+
var def = types7.Type.def;
|
|
42825
|
+
var or = types7.Type.or;
|
|
42915
42826
|
def("VariableDeclaration").field("declarations", [or(
|
|
42916
42827
|
def("VariableDeclarator"),
|
|
42917
42828
|
def("Identifier")
|
|
@@ -42968,11 +42879,11 @@ var require_babel_core = __commonJS({
|
|
|
42968
42879
|
function default_1(fork) {
|
|
42969
42880
|
var _a2, _b2, _c2, _d, _e;
|
|
42970
42881
|
fork.use(es_proposals_1.default);
|
|
42971
|
-
var
|
|
42882
|
+
var types7 = fork.use(types_1.default);
|
|
42972
42883
|
var defaults = fork.use(shared_1.default).defaults;
|
|
42973
|
-
var def =
|
|
42974
|
-
var or =
|
|
42975
|
-
var isUndefined =
|
|
42884
|
+
var def = types7.Type.def;
|
|
42885
|
+
var or = types7.Type.or;
|
|
42886
|
+
var isUndefined = types7.builtInTypes.undefined;
|
|
42976
42887
|
def("Noop").bases("Statement").build();
|
|
42977
42888
|
def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
|
|
42978
42889
|
def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
|
|
@@ -43007,7 +42918,7 @@ var require_babel_core = __commonJS({
|
|
|
43007
42918
|
raw: String
|
|
43008
42919
|
},
|
|
43009
42920
|
function getDefault() {
|
|
43010
|
-
var value =
|
|
42921
|
+
var value = types7.getFieldValue(this, "value");
|
|
43011
42922
|
return {
|
|
43012
42923
|
rawValue: value,
|
|
43013
42924
|
raw: toRaw ? toRaw(value) : String(value)
|
|
@@ -43098,8 +43009,8 @@ var require_babel = __commonJS({
|
|
|
43098
43009
|
var babel_core_1 = (0, tslib_1.__importDefault)(require_babel_core());
|
|
43099
43010
|
var flow_1 = (0, tslib_1.__importDefault)(require_flow());
|
|
43100
43011
|
function default_1(fork) {
|
|
43101
|
-
var
|
|
43102
|
-
var def =
|
|
43012
|
+
var types7 = fork.use(types_1.default);
|
|
43013
|
+
var def = types7.Type.def;
|
|
43103
43014
|
fork.use(babel_core_1.default);
|
|
43104
43015
|
fork.use(flow_1.default);
|
|
43105
43016
|
def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
|
|
@@ -43123,12 +43034,12 @@ var require_typescript = __commonJS({
|
|
|
43123
43034
|
function default_1(fork) {
|
|
43124
43035
|
fork.use(babel_core_1.default);
|
|
43125
43036
|
fork.use(type_annotations_1.default);
|
|
43126
|
-
var
|
|
43127
|
-
var n2 =
|
|
43128
|
-
var def =
|
|
43129
|
-
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;
|
|
43130
43041
|
var defaults = fork.use(shared_1.default).defaults;
|
|
43131
|
-
var StringLiteral =
|
|
43042
|
+
var StringLiteral = types7.Type.from(function(value, deep) {
|
|
43132
43043
|
if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
|
|
43133
43044
|
return true;
|
|
43134
43045
|
}
|
|
@@ -45106,8 +45017,8 @@ var require_util9 = __commonJS({
|
|
|
45106
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;
|
|
45107
45018
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
45108
45019
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
45109
|
-
var
|
|
45110
|
-
var n2 =
|
|
45020
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
45021
|
+
var n2 = types7.namedTypes;
|
|
45111
45022
|
var source_map_1 = tslib_1.__importDefault(require_source_map());
|
|
45112
45023
|
var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
|
|
45113
45024
|
var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
|
|
@@ -51532,13 +51443,13 @@ var require_esprima2 = __commonJS({
|
|
|
51532
51443
|
return Reader2;
|
|
51533
51444
|
}();
|
|
51534
51445
|
var Tokenizer = function() {
|
|
51535
|
-
function Tokenizer2(code,
|
|
51446
|
+
function Tokenizer2(code, config14) {
|
|
51536
51447
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
51537
|
-
this.errorHandler.tolerant =
|
|
51448
|
+
this.errorHandler.tolerant = config14 ? typeof config14.tolerant === "boolean" && config14.tolerant : false;
|
|
51538
51449
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
51539
|
-
this.scanner.trackComment =
|
|
51540
|
-
this.trackRange =
|
|
51541
|
-
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;
|
|
51542
51453
|
this.buffer = [];
|
|
51543
51454
|
this.reader = new Reader();
|
|
51544
51455
|
}
|
|
@@ -52520,10 +52431,10 @@ var require_comments = __commonJS({
|
|
|
52520
52431
|
exports2.printComments = exports2.attach = void 0;
|
|
52521
52432
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
52522
52433
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
52523
|
-
var
|
|
52524
|
-
var n2 =
|
|
52525
|
-
var isArray =
|
|
52526
|
-
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;
|
|
52527
52438
|
var lines_1 = require_lines();
|
|
52528
52439
|
var util_1 = require_util9();
|
|
52529
52440
|
var childNodesCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -52554,7 +52465,7 @@ var require_comments = __commonJS({
|
|
|
52554
52465
|
if (isArray.check(node)) {
|
|
52555
52466
|
names = Object.keys(node);
|
|
52556
52467
|
} else if (isObject2.check(node)) {
|
|
52557
|
-
names =
|
|
52468
|
+
names = types7.getFieldNames(node);
|
|
52558
52469
|
} else {
|
|
52559
52470
|
return resultArray;
|
|
52560
52471
|
}
|
|
@@ -52734,7 +52645,7 @@ var require_comments = __commonJS({
|
|
|
52734
52645
|
function printComments(path4, print2) {
|
|
52735
52646
|
var value = path4.getValue();
|
|
52736
52647
|
var innerLines = print2(path4);
|
|
52737
|
-
var comments = n2.Node.check(value) &&
|
|
52648
|
+
var comments = n2.Node.check(value) && types7.getFieldValue(value, "comments");
|
|
52738
52649
|
if (!comments || comments.length === 0) {
|
|
52739
52650
|
return innerLines;
|
|
52740
52651
|
}
|
|
@@ -52742,8 +52653,8 @@ var require_comments = __commonJS({
|
|
|
52742
52653
|
var trailingParts = [innerLines];
|
|
52743
52654
|
path4.each(function(commentPath) {
|
|
52744
52655
|
var comment = commentPath.getValue();
|
|
52745
|
-
var leading =
|
|
52746
|
-
var trailing =
|
|
52656
|
+
var leading = types7.getFieldValue(comment, "leading");
|
|
52657
|
+
var trailing = types7.getFieldValue(comment, "trailing");
|
|
52747
52658
|
if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
|
|
52748
52659
|
leadingParts.push(printLeadingComment(commentPath, print2));
|
|
52749
52660
|
} else if (trailing) {
|
|
@@ -52765,10 +52676,10 @@ var require_parser2 = __commonJS({
|
|
|
52765
52676
|
exports2.parse = void 0;
|
|
52766
52677
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
52767
52678
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
52768
|
-
var
|
|
52769
|
-
var b2 =
|
|
52770
|
-
var isObject2 =
|
|
52771
|
-
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;
|
|
52772
52683
|
var options_1 = require_options();
|
|
52773
52684
|
var lines_1 = require_lines();
|
|
52774
52685
|
var comments_1 = require_comments();
|
|
@@ -52955,11 +52866,11 @@ var require_fast_path = __commonJS({
|
|
|
52955
52866
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
52956
52867
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
52957
52868
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
52958
|
-
var
|
|
52869
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
52959
52870
|
var util = tslib_1.__importStar(require_util9());
|
|
52960
|
-
var n2 =
|
|
52961
|
-
var isArray =
|
|
52962
|
-
var isNumber =
|
|
52871
|
+
var n2 = types7.namedTypes;
|
|
52872
|
+
var isArray = types7.builtInTypes.array;
|
|
52873
|
+
var isNumber = types7.builtInTypes.number;
|
|
52963
52874
|
var PRECEDENCE = {};
|
|
52964
52875
|
[
|
|
52965
52876
|
["??"],
|
|
@@ -52988,7 +52899,7 @@ var require_fast_path = __commonJS({
|
|
|
52988
52899
|
if (obj instanceof FastPath) {
|
|
52989
52900
|
return obj.copy();
|
|
52990
52901
|
}
|
|
52991
|
-
if (obj instanceof
|
|
52902
|
+
if (obj instanceof types7.NodePath) {
|
|
52992
52903
|
var copy = Object.create(FastPath.prototype);
|
|
52993
52904
|
var stack = [obj.value];
|
|
52994
52905
|
for (var pp = void 0; pp = obj.parentPath; obj = pp)
|
|
@@ -53299,7 +53210,7 @@ var require_fast_path = __commonJS({
|
|
|
53299
53210
|
return node.some(containsCallExpression);
|
|
53300
53211
|
}
|
|
53301
53212
|
if (n2.Node.check(node)) {
|
|
53302
|
-
return
|
|
53213
|
+
return types7.someField(node, function(_name, child) {
|
|
53303
53214
|
return containsCallExpression(child);
|
|
53304
53215
|
});
|
|
53305
53216
|
}
|
|
@@ -53389,16 +53300,16 @@ var require_patcher = __commonJS({
|
|
|
53389
53300
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
53390
53301
|
var assert_1 = tslib_1.__importDefault(require("assert"));
|
|
53391
53302
|
var linesModule = tslib_1.__importStar(require_lines());
|
|
53392
|
-
var
|
|
53393
|
-
var Printable =
|
|
53394
|
-
var Expression =
|
|
53395
|
-
var ReturnStatement =
|
|
53396
|
-
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;
|
|
53397
53308
|
var util_1 = require_util9();
|
|
53398
53309
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
53399
|
-
var isObject2 =
|
|
53400
|
-
var isArray =
|
|
53401
|
-
var isString =
|
|
53310
|
+
var isObject2 = types7.builtInTypes.object;
|
|
53311
|
+
var isArray = types7.builtInTypes.array;
|
|
53312
|
+
var isString = types7.builtInTypes.string;
|
|
53402
53313
|
var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
|
|
53403
53314
|
var Patcher = function Patcher2(lines) {
|
|
53404
53315
|
assert_1.default.ok(this instanceof Patcher2);
|
|
@@ -53677,8 +53588,8 @@ var require_patcher = __commonJS({
|
|
|
53677
53588
|
if (k2.charAt(0) === "_") {
|
|
53678
53589
|
continue;
|
|
53679
53590
|
}
|
|
53680
|
-
newPath.stack.push(k2,
|
|
53681
|
-
oldPath.stack.push(k2,
|
|
53591
|
+
newPath.stack.push(k2, types7.getFieldValue(newNode, k2));
|
|
53592
|
+
oldPath.stack.push(k2, types7.getFieldValue(oldNode, k2));
|
|
53682
53593
|
var canReprint = findAnyReprints(newPath, oldPath, reprints);
|
|
53683
53594
|
newPath.stack.length -= 2;
|
|
53684
53595
|
oldPath.stack.length -= 2;
|
|
@@ -53706,10 +53617,10 @@ var require_printer = __commonJS({
|
|
|
53706
53617
|
var lines_1 = require_lines();
|
|
53707
53618
|
var options_1 = require_options();
|
|
53708
53619
|
var patcher_1 = require_patcher();
|
|
53709
|
-
var
|
|
53710
|
-
var namedTypes =
|
|
53711
|
-
var isString =
|
|
53712
|
-
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;
|
|
53713
53624
|
var fast_path_1 = tslib_1.__importDefault(require_fast_path());
|
|
53714
53625
|
var util = tslib_1.__importStar(require_util9());
|
|
53715
53626
|
var PrintResult = function PrintResult2(code, sourceMap) {
|
|
@@ -53731,11 +53642,11 @@ var require_printer = __commonJS({
|
|
|
53731
53642
|
return this.code;
|
|
53732
53643
|
};
|
|
53733
53644
|
var emptyPrintResult = new PrintResult("");
|
|
53734
|
-
var Printer = function Printer2(
|
|
53645
|
+
var Printer = function Printer2(config14) {
|
|
53735
53646
|
assert_1.default.ok(this instanceof Printer2);
|
|
53736
|
-
var explicitTabWidth =
|
|
53737
|
-
|
|
53738
|
-
|
|
53647
|
+
var explicitTabWidth = config14 && config14.tabWidth;
|
|
53648
|
+
config14 = options_1.normalize(config14);
|
|
53649
|
+
config14.sourceFileName = null;
|
|
53739
53650
|
function makePrintFunctionWith(options, overrides) {
|
|
53740
53651
|
options = Object.assign({}, options, overrides);
|
|
53741
53652
|
return function(path4) {
|
|
@@ -53750,11 +53661,11 @@ var require_printer = __commonJS({
|
|
|
53750
53661
|
includeComments: false
|
|
53751
53662
|
}));
|
|
53752
53663
|
}
|
|
53753
|
-
var oldTabWidth =
|
|
53664
|
+
var oldTabWidth = config14.tabWidth;
|
|
53754
53665
|
if (!explicitTabWidth) {
|
|
53755
53666
|
var loc = path4.getNode().loc;
|
|
53756
53667
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
53757
|
-
|
|
53668
|
+
config14.tabWidth = loc.lines.guessTabWidth();
|
|
53758
53669
|
}
|
|
53759
53670
|
}
|
|
53760
53671
|
var reprinter = patcher_1.getReprinter(path4);
|
|
@@ -53768,11 +53679,11 @@ var require_printer = __commonJS({
|
|
|
53768
53679
|
// right choice because it gives us the opportunity to reprint
|
|
53769
53680
|
// such nodes using their original source.
|
|
53770
53681
|
reprinter(print2)
|
|
53771
|
-
) : genericPrint(path4,
|
|
53682
|
+
) : genericPrint(path4, config14, options, makePrintFunctionWith(options, {
|
|
53772
53683
|
includeComments: true,
|
|
53773
53684
|
avoidRootParens: false
|
|
53774
53685
|
}));
|
|
53775
|
-
|
|
53686
|
+
config14.tabWidth = oldTabWidth;
|
|
53776
53687
|
return lines;
|
|
53777
53688
|
}
|
|
53778
53689
|
this.print = function(ast) {
|
|
@@ -53783,7 +53694,7 @@ var require_printer = __commonJS({
|
|
|
53783
53694
|
includeComments: true,
|
|
53784
53695
|
avoidRootParens: false
|
|
53785
53696
|
});
|
|
53786
|
-
return new PrintResult(lines.toString(
|
|
53697
|
+
return new PrintResult(lines.toString(config14), util.composeSourceMaps(config14.inputSourceMap, lines.getSourceMap(config14.sourceMapName, config14.sourceRoot)));
|
|
53787
53698
|
};
|
|
53788
53699
|
this.printGenerically = function(ast) {
|
|
53789
53700
|
if (!ast) {
|
|
@@ -53791,26 +53702,26 @@ var require_printer = __commonJS({
|
|
|
53791
53702
|
}
|
|
53792
53703
|
function printGenerically(path5) {
|
|
53793
53704
|
return comments_1.printComments(path5, function(path6) {
|
|
53794
|
-
return genericPrint(path6,
|
|
53705
|
+
return genericPrint(path6, config14, {
|
|
53795
53706
|
includeComments: true,
|
|
53796
53707
|
avoidRootParens: false
|
|
53797
53708
|
}, printGenerically);
|
|
53798
53709
|
});
|
|
53799
53710
|
}
|
|
53800
53711
|
var path4 = fast_path_1.default.from(ast);
|
|
53801
|
-
var oldReuseWhitespace =
|
|
53802
|
-
|
|
53803
|
-
var pr = new PrintResult(printGenerically(path4).toString(
|
|
53804
|
-
|
|
53712
|
+
var oldReuseWhitespace = config14.reuseWhitespace;
|
|
53713
|
+
config14.reuseWhitespace = false;
|
|
53714
|
+
var pr = new PrintResult(printGenerically(path4).toString(config14));
|
|
53715
|
+
config14.reuseWhitespace = oldReuseWhitespace;
|
|
53805
53716
|
return pr;
|
|
53806
53717
|
};
|
|
53807
53718
|
};
|
|
53808
53719
|
exports2.Printer = Printer;
|
|
53809
|
-
function genericPrint(path4,
|
|
53720
|
+
function genericPrint(path4, config14, options, printPath) {
|
|
53810
53721
|
assert_1.default.ok(path4 instanceof fast_path_1.default);
|
|
53811
53722
|
var node = path4.getValue();
|
|
53812
53723
|
var parts = [];
|
|
53813
|
-
var linesWithoutParens = genericPrintNoParens(path4,
|
|
53724
|
+
var linesWithoutParens = genericPrintNoParens(path4, config14, printPath);
|
|
53814
53725
|
if (!node || linesWithoutParens.isEmpty()) {
|
|
53815
53726
|
return linesWithoutParens;
|
|
53816
53727
|
}
|
|
@@ -53883,7 +53794,7 @@ var require_printer = __commonJS({
|
|
|
53883
53794
|
case "OptionalMemberExpression": {
|
|
53884
53795
|
parts.push(path4.call(print2, "object"));
|
|
53885
53796
|
var property = path4.call(print2, "property");
|
|
53886
|
-
var optional =
|
|
53797
|
+
var optional = types7.getFieldValue(n2, "optional");
|
|
53887
53798
|
if (n2.computed) {
|
|
53888
53799
|
parts.push(optional ? "?.[" : "[", property, "]");
|
|
53889
53800
|
} else {
|
|
@@ -54154,7 +54065,7 @@ var require_printer = __commonJS({
|
|
|
54154
54065
|
if (n2.typeArguments) {
|
|
54155
54066
|
parts.push(path4.call(print2, "typeArguments"));
|
|
54156
54067
|
}
|
|
54157
|
-
if (
|
|
54068
|
+
if (types7.getFieldValue(n2, "optional")) {
|
|
54158
54069
|
parts.push("?.");
|
|
54159
54070
|
}
|
|
54160
54071
|
parts.push(printArgumentsList(path4, options, print2));
|
|
@@ -55786,8 +55697,8 @@ var require_printer = __commonJS({
|
|
|
55786
55697
|
});
|
|
55787
55698
|
}
|
|
55788
55699
|
function getPossibleRaw(node) {
|
|
55789
|
-
var value =
|
|
55790
|
-
var extra =
|
|
55700
|
+
var value = types7.getFieldValue(node, "value");
|
|
55701
|
+
var extra = types7.getFieldValue(node, "extra");
|
|
55791
55702
|
if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
|
|
55792
55703
|
return extra.raw;
|
|
55793
55704
|
}
|
|
@@ -55835,8 +55746,8 @@ var require_main3 = __commonJS({
|
|
|
55835
55746
|
exports2.run = exports2.prettyPrint = exports2.print = exports2.visit = exports2.types = exports2.parse = void 0;
|
|
55836
55747
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
55837
55748
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
55838
|
-
var
|
|
55839
|
-
exports2.types =
|
|
55749
|
+
var types7 = tslib_1.__importStar(require_main2());
|
|
55750
|
+
exports2.types = types7;
|
|
55840
55751
|
var parser_1 = require_parser2();
|
|
55841
55752
|
Object.defineProperty(exports2, "parse", { enumerable: true, get: function() {
|
|
55842
55753
|
return parser_1.parse;
|
|
@@ -56700,14 +56611,14 @@ var require_lib = __commonJS({
|
|
|
56700
56611
|
this.preserveSpace = !!preserveSpace;
|
|
56701
56612
|
}
|
|
56702
56613
|
};
|
|
56703
|
-
var
|
|
56614
|
+
var types7 = {
|
|
56704
56615
|
brace: new TokContext("{"),
|
|
56705
56616
|
j_oTag: new TokContext("<tag"),
|
|
56706
56617
|
j_cTag: new TokContext("</tag"),
|
|
56707
56618
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
56708
56619
|
};
|
|
56709
56620
|
{
|
|
56710
|
-
|
|
56621
|
+
types7.template = new TokContext("`", true);
|
|
56711
56622
|
}
|
|
56712
56623
|
var beforeExpr = true;
|
|
56713
56624
|
var startsExpr = true;
|
|
@@ -57239,17 +57150,17 @@ var require_lib = __commonJS({
|
|
|
57239
57150
|
context.pop();
|
|
57240
57151
|
};
|
|
57241
57152
|
tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
|
|
57242
|
-
context.push(
|
|
57153
|
+
context.push(types7.brace);
|
|
57243
57154
|
};
|
|
57244
57155
|
tokenTypes[22].updateContext = (context) => {
|
|
57245
|
-
if (context[context.length - 1] ===
|
|
57156
|
+
if (context[context.length - 1] === types7.template) {
|
|
57246
57157
|
context.pop();
|
|
57247
57158
|
} else {
|
|
57248
|
-
context.push(
|
|
57159
|
+
context.push(types7.template);
|
|
57249
57160
|
}
|
|
57250
57161
|
};
|
|
57251
57162
|
tokenTypes[140].updateContext = (context) => {
|
|
57252
|
-
context.push(
|
|
57163
|
+
context.push(types7.j_expr, types7.j_oTag);
|
|
57253
57164
|
};
|
|
57254
57165
|
}
|
|
57255
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";
|
|
@@ -57855,7 +57766,7 @@ var require_lib = __commonJS({
|
|
|
57855
57766
|
this.lastTokEndLoc = null;
|
|
57856
57767
|
this.lastTokStartLoc = null;
|
|
57857
57768
|
this.lastTokStart = 0;
|
|
57858
|
-
this.context = [
|
|
57769
|
+
this.context = [types7.brace];
|
|
57859
57770
|
this.canStartJSXElement = true;
|
|
57860
57771
|
this.containsEsc = false;
|
|
57861
57772
|
this.firstInvalidTemplateEscapePos = null;
|
|
@@ -61746,7 +61657,7 @@ var require_lib = __commonJS({
|
|
|
61746
61657
|
context
|
|
61747
61658
|
} = this.state;
|
|
61748
61659
|
const currentContext = context[context.length - 1];
|
|
61749
|
-
if (currentContext ===
|
|
61660
|
+
if (currentContext === types7.j_oTag || currentContext === types7.j_expr) {
|
|
61750
61661
|
context.pop();
|
|
61751
61662
|
}
|
|
61752
61663
|
}
|
|
@@ -62804,9 +62715,9 @@ var require_lib = __commonJS({
|
|
|
62804
62715
|
switch (this.state.type) {
|
|
62805
62716
|
case 5:
|
|
62806
62717
|
node = this.startNode();
|
|
62807
|
-
this.setContext(
|
|
62718
|
+
this.setContext(types7.brace);
|
|
62808
62719
|
this.next();
|
|
62809
|
-
node = this.jsxParseExpressionContainer(node,
|
|
62720
|
+
node = this.jsxParseExpressionContainer(node, types7.j_oTag);
|
|
62810
62721
|
if (node.expression.type === "JSXEmptyExpression") {
|
|
62811
62722
|
this.raise(JsxErrors.AttributeIsEmpty, {
|
|
62812
62723
|
at: node
|
|
@@ -62829,7 +62740,7 @@ var require_lib = __commonJS({
|
|
|
62829
62740
|
jsxParseSpreadChild(node) {
|
|
62830
62741
|
this.next();
|
|
62831
62742
|
node.expression = this.parseExpression();
|
|
62832
|
-
this.setContext(
|
|
62743
|
+
this.setContext(types7.j_expr);
|
|
62833
62744
|
this.state.canStartJSXElement = true;
|
|
62834
62745
|
this.expect(8);
|
|
62835
62746
|
return this.finishNode(node, "JSXSpreadChild");
|
|
@@ -62849,11 +62760,11 @@ var require_lib = __commonJS({
|
|
|
62849
62760
|
jsxParseAttribute() {
|
|
62850
62761
|
const node = this.startNode();
|
|
62851
62762
|
if (this.match(5)) {
|
|
62852
|
-
this.setContext(
|
|
62763
|
+
this.setContext(types7.brace);
|
|
62853
62764
|
this.next();
|
|
62854
62765
|
this.expect(21);
|
|
62855
62766
|
node.argument = this.parseMaybeAssignAllowIn();
|
|
62856
|
-
this.setContext(
|
|
62767
|
+
this.setContext(types7.j_oTag);
|
|
62857
62768
|
this.state.canStartJSXElement = true;
|
|
62858
62769
|
this.expect(8);
|
|
62859
62770
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
@@ -62912,12 +62823,12 @@ var require_lib = __commonJS({
|
|
|
62912
62823
|
break;
|
|
62913
62824
|
case 5: {
|
|
62914
62825
|
const node2 = this.startNode();
|
|
62915
|
-
this.setContext(
|
|
62826
|
+
this.setContext(types7.brace);
|
|
62916
62827
|
this.next();
|
|
62917
62828
|
if (this.match(21)) {
|
|
62918
62829
|
children.push(this.jsxParseSpreadChild(node2));
|
|
62919
62830
|
} else {
|
|
62920
|
-
children.push(this.jsxParseExpressionContainer(node2,
|
|
62831
|
+
children.push(this.jsxParseExpressionContainer(node2, types7.j_expr));
|
|
62921
62832
|
}
|
|
62922
62833
|
break;
|
|
62923
62834
|
}
|
|
@@ -62988,11 +62899,11 @@ var require_lib = __commonJS({
|
|
|
62988
62899
|
}
|
|
62989
62900
|
getTokenFromCode(code) {
|
|
62990
62901
|
const context = this.curContext();
|
|
62991
|
-
if (context ===
|
|
62902
|
+
if (context === types7.j_expr) {
|
|
62992
62903
|
this.jsxReadToken();
|
|
62993
62904
|
return;
|
|
62994
62905
|
}
|
|
62995
|
-
if (context ===
|
|
62906
|
+
if (context === types7.j_oTag || context === types7.j_cTag) {
|
|
62996
62907
|
if (isIdentifierStart(code)) {
|
|
62997
62908
|
this.jsxReadWord();
|
|
62998
62909
|
return;
|
|
@@ -63002,7 +62913,7 @@ var require_lib = __commonJS({
|
|
|
63002
62913
|
this.finishToken(141);
|
|
63003
62914
|
return;
|
|
63004
62915
|
}
|
|
63005
|
-
if ((code === 34 || code === 39) && context ===
|
|
62916
|
+
if ((code === 34 || code === 39) && context === types7.j_oTag) {
|
|
63006
62917
|
this.jsxReadString(code);
|
|
63007
62918
|
return;
|
|
63008
62919
|
}
|
|
@@ -63020,17 +62931,17 @@ var require_lib = __commonJS({
|
|
|
63020
62931
|
type
|
|
63021
62932
|
} = this.state;
|
|
63022
62933
|
if (type === 56 && prevType === 140) {
|
|
63023
|
-
context.splice(-2, 2,
|
|
62934
|
+
context.splice(-2, 2, types7.j_cTag);
|
|
63024
62935
|
this.state.canStartJSXElement = false;
|
|
63025
62936
|
} else if (type === 140) {
|
|
63026
|
-
context.push(
|
|
62937
|
+
context.push(types7.j_oTag);
|
|
63027
62938
|
} else if (type === 141) {
|
|
63028
62939
|
const out = context[context.length - 1];
|
|
63029
|
-
if (out ===
|
|
62940
|
+
if (out === types7.j_oTag && prevType === 56 || out === types7.j_cTag) {
|
|
63030
62941
|
context.pop();
|
|
63031
|
-
this.state.canStartJSXElement = context[context.length - 1] ===
|
|
62942
|
+
this.state.canStartJSXElement = context[context.length - 1] === types7.j_expr;
|
|
63032
62943
|
} else {
|
|
63033
|
-
this.setContext(
|
|
62944
|
+
this.setContext(types7.j_expr);
|
|
63034
62945
|
this.state.canStartJSXElement = true;
|
|
63035
62946
|
}
|
|
63036
62947
|
} else {
|
|
@@ -64474,14 +64385,14 @@ var require_lib = __commonJS({
|
|
|
64474
64385
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
64475
64386
|
const node = this.startNode();
|
|
64476
64387
|
const hasLeadingOperator = this.eat(operator);
|
|
64477
|
-
const
|
|
64388
|
+
const types8 = [];
|
|
64478
64389
|
do {
|
|
64479
|
-
|
|
64390
|
+
types8.push(parseConstituentType());
|
|
64480
64391
|
} while (this.eat(operator));
|
|
64481
|
-
if (
|
|
64482
|
-
return
|
|
64392
|
+
if (types8.length === 1 && !hasLeadingOperator) {
|
|
64393
|
+
return types8[0];
|
|
64483
64394
|
}
|
|
64484
|
-
node.types =
|
|
64395
|
+
node.types = types8;
|
|
64485
64396
|
return this.finishNode(node, kind);
|
|
64486
64397
|
}
|
|
64487
64398
|
tsParseIntersectionTypeOrHigher() {
|
|
@@ -65055,7 +64966,7 @@ var require_lib = __commonJS({
|
|
|
65055
64966
|
this.raise(TSErrors.EmptyTypeArguments, {
|
|
65056
64967
|
at: node
|
|
65057
64968
|
});
|
|
65058
|
-
} else if (!this.state.inType && this.curContext() ===
|
|
64969
|
+
} else if (!this.state.inType && this.curContext() === types7.brace) {
|
|
65059
64970
|
this.reScan_lt_gt();
|
|
65060
64971
|
}
|
|
65061
64972
|
this.expect(48);
|
|
@@ -65732,7 +65643,7 @@ var require_lib = __commonJS({
|
|
|
65732
65643
|
context
|
|
65733
65644
|
} = this.state;
|
|
65734
65645
|
const currentContext = context[context.length - 1];
|
|
65735
|
-
if (currentContext ===
|
|
65646
|
+
if (currentContext === types7.j_oTag || currentContext === types7.j_expr) {
|
|
65736
65647
|
context.pop();
|
|
65737
65648
|
}
|
|
65738
65649
|
}
|
|
@@ -70620,13 +70531,224 @@ var init_codemod = __esm({
|
|
|
70620
70531
|
}
|
|
70621
70532
|
});
|
|
70622
70533
|
|
|
70623
|
-
// 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
|
|
70624
70655
|
var c3_exports2 = {};
|
|
70625
70656
|
__export(c3_exports2, {
|
|
70626
70657
|
default: () => c3_default2
|
|
70627
70658
|
});
|
|
70628
|
-
|
|
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;
|
|
70629
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({
|
|
70630
70752
|
"templates/astro/c3.ts"() {
|
|
70631
70753
|
init_cli();
|
|
70632
70754
|
init_colors();
|
|
@@ -70635,13 +70757,13 @@ var init_c32 = __esm({
|
|
|
70635
70757
|
init_command();
|
|
70636
70758
|
init_files();
|
|
70637
70759
|
init_packageManagers();
|
|
70638
|
-
|
|
70760
|
+
recast3 = __toESM(require_main3());
|
|
70639
70761
|
({ npx: npx2 } = detectPackageManager());
|
|
70640
|
-
|
|
70762
|
+
generate3 = async (ctx) => {
|
|
70641
70763
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
70642
70764
|
logRaw("");
|
|
70643
70765
|
};
|
|
70644
|
-
|
|
70766
|
+
configure3 = async (ctx) => {
|
|
70645
70767
|
await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
|
|
70646
70768
|
silent: true,
|
|
70647
70769
|
startText: "Installing adapter",
|
|
@@ -70661,7 +70783,7 @@ var init_c32 = __esm({
|
|
|
70661
70783
|
if (callee.name !== "cloudflare") {
|
|
70662
70784
|
return this.traverse(n2);
|
|
70663
70785
|
}
|
|
70664
|
-
const b2 =
|
|
70786
|
+
const b2 = recast3.types.builders;
|
|
70665
70787
|
n2.node.arguments = [
|
|
70666
70788
|
b2.objectExpression([
|
|
70667
70789
|
b2.objectProperty(
|
|
@@ -70686,7 +70808,7 @@ var init_c32 = __esm({
|
|
|
70686
70808
|
visitProgram: function(n2) {
|
|
70687
70809
|
const snippets = loadTemplateSnippets(ctx);
|
|
70688
70810
|
const patch = snippets.runtimeDeclarationTs;
|
|
70689
|
-
const b2 =
|
|
70811
|
+
const b2 = recast3.types.builders;
|
|
70690
70812
|
const comments = n2.get("comments").value;
|
|
70691
70813
|
n2.node.comments = comments.map(
|
|
70692
70814
|
(c2) => b2.commentLine(c2.value)
|
|
@@ -70696,7 +70818,7 @@ var init_c32 = __esm({
|
|
|
70696
70818
|
}
|
|
70697
70819
|
});
|
|
70698
70820
|
};
|
|
70699
|
-
|
|
70821
|
+
config3 = {
|
|
70700
70822
|
configVersion: 1,
|
|
70701
70823
|
id: "astro",
|
|
70702
70824
|
platform: "pages",
|
|
@@ -70707,8 +70829,8 @@ var init_c32 = __esm({
|
|
|
70707
70829
|
devScript: "dev",
|
|
70708
70830
|
deployScript: "deploy",
|
|
70709
70831
|
previewScript: "preview",
|
|
70710
|
-
generate:
|
|
70711
|
-
configure:
|
|
70832
|
+
generate: generate3,
|
|
70833
|
+
configure: configure3,
|
|
70712
70834
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
70713
70835
|
scripts: {
|
|
70714
70836
|
deploy: `astro build && wrangler pages deploy ./dist`,
|
|
@@ -70717,55 +70839,55 @@ var init_c32 = __esm({
|
|
|
70717
70839
|
}
|
|
70718
70840
|
})
|
|
70719
70841
|
};
|
|
70720
|
-
|
|
70842
|
+
c3_default3 = config3;
|
|
70721
70843
|
}
|
|
70722
70844
|
});
|
|
70723
70845
|
|
|
70724
70846
|
// templates/docusaurus/c3.ts
|
|
70725
|
-
var
|
|
70726
|
-
__export(
|
|
70727
|
-
default: () =>
|
|
70847
|
+
var c3_exports4 = {};
|
|
70848
|
+
__export(c3_exports4, {
|
|
70849
|
+
default: () => c3_default4
|
|
70728
70850
|
});
|
|
70729
|
-
var
|
|
70730
|
-
var
|
|
70851
|
+
var npm3, generate4, config4, c3_default4;
|
|
70852
|
+
var init_c34 = __esm({
|
|
70731
70853
|
"templates/docusaurus/c3.ts"() {
|
|
70732
70854
|
init_frameworks();
|
|
70733
70855
|
init_packageManagers();
|
|
70734
|
-
({ npm:
|
|
70735
|
-
|
|
70856
|
+
({ npm: npm3 } = detectPackageManager());
|
|
70857
|
+
generate4 = async (ctx) => {
|
|
70736
70858
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
70737
70859
|
};
|
|
70738
|
-
|
|
70860
|
+
config4 = {
|
|
70739
70861
|
configVersion: 1,
|
|
70740
70862
|
id: "docusaurus",
|
|
70741
70863
|
platform: "pages",
|
|
70742
70864
|
displayName: "Docusaurus",
|
|
70743
|
-
generate:
|
|
70865
|
+
generate: generate4,
|
|
70744
70866
|
transformPackageJson: async () => ({
|
|
70745
70867
|
scripts: {
|
|
70746
|
-
deploy: `${
|
|
70868
|
+
deploy: `${npm3} run build && wrangler pages deploy ./build`
|
|
70747
70869
|
}
|
|
70748
70870
|
}),
|
|
70749
70871
|
devScript: "start",
|
|
70750
70872
|
deployScript: "deploy"
|
|
70751
70873
|
};
|
|
70752
|
-
|
|
70874
|
+
c3_default4 = config4;
|
|
70753
70875
|
}
|
|
70754
70876
|
});
|
|
70755
70877
|
|
|
70756
70878
|
// templates/gatsby/c3.ts
|
|
70757
|
-
var
|
|
70758
|
-
__export(
|
|
70759
|
-
default: () =>
|
|
70879
|
+
var c3_exports5 = {};
|
|
70880
|
+
__export(c3_exports5, {
|
|
70881
|
+
default: () => c3_default5
|
|
70760
70882
|
});
|
|
70761
|
-
var
|
|
70762
|
-
var
|
|
70883
|
+
var npm4, generate5, config5, c3_default5;
|
|
70884
|
+
var init_c35 = __esm({
|
|
70763
70885
|
"templates/gatsby/c3.ts"() {
|
|
70764
70886
|
init_interactive();
|
|
70765
70887
|
init_frameworks();
|
|
70766
70888
|
init_packageManagers();
|
|
70767
|
-
({ npm:
|
|
70768
|
-
|
|
70889
|
+
({ npm: npm4 } = detectPackageManager());
|
|
70890
|
+
generate5 = async (ctx) => {
|
|
70769
70891
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
70770
70892
|
const useTemplate = await inputPrompt({
|
|
70771
70893
|
type: "confirm",
|
|
@@ -70784,37 +70906,37 @@ var init_c34 = __esm({
|
|
|
70784
70906
|
}
|
|
70785
70907
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
70786
70908
|
};
|
|
70787
|
-
|
|
70909
|
+
config5 = {
|
|
70788
70910
|
configVersion: 1,
|
|
70789
70911
|
id: "gatsby",
|
|
70790
70912
|
platform: "pages",
|
|
70791
70913
|
displayName: "Gatsby",
|
|
70792
|
-
generate:
|
|
70914
|
+
generate: generate5,
|
|
70793
70915
|
transformPackageJson: async () => ({
|
|
70794
70916
|
scripts: {
|
|
70795
|
-
deploy: `${
|
|
70796
|
-
preview: `${
|
|
70917
|
+
deploy: `${npm4} run build && wrangler pages deploy ./public`,
|
|
70918
|
+
preview: `${npm4} run build && wrangler pages dev ./public`
|
|
70797
70919
|
}
|
|
70798
70920
|
}),
|
|
70799
70921
|
devScript: "develop",
|
|
70800
70922
|
deployScript: "deploy",
|
|
70801
70923
|
previewScript: "preview"
|
|
70802
70924
|
};
|
|
70803
|
-
|
|
70925
|
+
c3_default5 = config5;
|
|
70804
70926
|
}
|
|
70805
70927
|
});
|
|
70806
70928
|
|
|
70807
70929
|
// templates/hono/c3.ts
|
|
70808
|
-
var
|
|
70809
|
-
__export(
|
|
70810
|
-
default: () =>
|
|
70930
|
+
var c3_exports6 = {};
|
|
70931
|
+
__export(c3_exports6, {
|
|
70932
|
+
default: () => c3_default6
|
|
70811
70933
|
});
|
|
70812
|
-
var
|
|
70813
|
-
var
|
|
70934
|
+
var generate6, config6, c3_default6;
|
|
70935
|
+
var init_c36 = __esm({
|
|
70814
70936
|
"templates/hono/c3.ts"() {
|
|
70815
70937
|
init_cli();
|
|
70816
70938
|
init_frameworks();
|
|
70817
|
-
|
|
70939
|
+
generate6 = async (ctx) => {
|
|
70818
70940
|
await runFrameworkGenerator(ctx, [
|
|
70819
70941
|
ctx.project.name,
|
|
70820
70942
|
"--template",
|
|
@@ -70822,28 +70944,28 @@ var init_c35 = __esm({
|
|
|
70822
70944
|
]);
|
|
70823
70945
|
logRaw("");
|
|
70824
70946
|
};
|
|
70825
|
-
|
|
70947
|
+
config6 = {
|
|
70826
70948
|
configVersion: 1,
|
|
70827
70949
|
id: "hono",
|
|
70828
70950
|
displayName: "Hono",
|
|
70829
70951
|
platform: "workers",
|
|
70830
|
-
generate:
|
|
70952
|
+
generate: generate6,
|
|
70831
70953
|
devScript: "dev",
|
|
70832
70954
|
deployScript: "deploy"
|
|
70833
70955
|
};
|
|
70834
|
-
|
|
70956
|
+
c3_default6 = config6;
|
|
70835
70957
|
}
|
|
70836
70958
|
});
|
|
70837
70959
|
|
|
70838
70960
|
// templates/next/c3.ts
|
|
70839
|
-
var
|
|
70840
|
-
__export(
|
|
70841
|
-
default: () =>
|
|
70961
|
+
var c3_exports7 = {};
|
|
70962
|
+
__export(c3_exports7, {
|
|
70963
|
+
default: () => c3_default7,
|
|
70842
70964
|
shouldInstallNextOnPagesEslintPlugin: () => shouldInstallNextOnPagesEslintPlugin,
|
|
70843
70965
|
writeEslintrc: () => writeEslintrc
|
|
70844
70966
|
});
|
|
70845
|
-
var import_path13,
|
|
70846
|
-
var
|
|
70967
|
+
var import_path13, npm5, npx3, generate7, updateNextConfig, configure4, shouldInstallNextOnPagesEslintPlugin, writeEslintrc, addDevDependencies, c3_default7;
|
|
70968
|
+
var init_c37 = __esm({
|
|
70847
70969
|
"templates/next/c3.ts"() {
|
|
70848
70970
|
import_path13 = require("path");
|
|
70849
70971
|
init_cli();
|
|
@@ -70855,8 +70977,8 @@ var init_c36 = __esm({
|
|
|
70855
70977
|
init_packageManagers();
|
|
70856
70978
|
init_packages();
|
|
70857
70979
|
init_templates();
|
|
70858
|
-
({ npm:
|
|
70859
|
-
|
|
70980
|
+
({ npm: npm5, npx: npx3 } = detectPackageManager());
|
|
70981
|
+
generate7 = async (ctx) => {
|
|
70860
70982
|
const projectName = ctx.project.name;
|
|
70861
70983
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
70862
70984
|
const wranglerToml = readFile((0, import_path13.join)(getTemplatePath(ctx), "wrangler.toml"));
|
|
@@ -70889,7 +71011,7 @@ ${$1}`
|
|
|
70889
71011
|
writeFile2(configFile, updatedConfigFile);
|
|
70890
71012
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
70891
71013
|
};
|
|
70892
|
-
|
|
71014
|
+
configure4 = async (ctx) => {
|
|
70893
71015
|
const projectPath = ctx.project.path;
|
|
70894
71016
|
const path4 = probePaths([
|
|
70895
71017
|
`${projectPath}/pages/api`,
|
|
@@ -70963,13 +71085,13 @@ ${$1}`
|
|
|
70963
71085
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
70964
71086
|
});
|
|
70965
71087
|
};
|
|
70966
|
-
|
|
71088
|
+
c3_default7 = {
|
|
70967
71089
|
configVersion: 1,
|
|
70968
71090
|
id: "next",
|
|
70969
71091
|
platform: "pages",
|
|
70970
71092
|
displayName: "Next",
|
|
70971
|
-
generate:
|
|
70972
|
-
configure:
|
|
71093
|
+
generate: generate7,
|
|
71094
|
+
configure: configure4,
|
|
70973
71095
|
copyFiles: {
|
|
70974
71096
|
async selectVariant(ctx) {
|
|
70975
71097
|
const isApp = probePaths([
|
|
@@ -71000,12 +71122,12 @@ ${$1}`
|
|
|
71000
71122
|
}
|
|
71001
71123
|
},
|
|
71002
71124
|
transformPackageJson: async (_2, ctx) => {
|
|
71003
|
-
const isNpm =
|
|
71004
|
-
const isBun =
|
|
71125
|
+
const isNpm = npm5 === "npm";
|
|
71126
|
+
const isBun = npm5 === "bun";
|
|
71005
71127
|
const isNpmOrBun = isNpm || isBun;
|
|
71006
71128
|
const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
|
|
71007
71129
|
const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
|
|
71008
|
-
const pmCommand = isNpmOrBun ? npx3 :
|
|
71130
|
+
const pmCommand = isNpmOrBun ? npx3 : npm5;
|
|
71009
71131
|
const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
|
|
71010
71132
|
return {
|
|
71011
71133
|
scripts: {
|
|
@@ -71027,12 +71149,12 @@ ${$1}`
|
|
|
71027
71149
|
});
|
|
71028
71150
|
|
|
71029
71151
|
// templates/nuxt/c3.ts
|
|
71030
|
-
var
|
|
71031
|
-
__export(
|
|
71032
|
-
default: () =>
|
|
71152
|
+
var c3_exports8 = {};
|
|
71153
|
+
__export(c3_exports8, {
|
|
71154
|
+
default: () => c3_default8
|
|
71033
71155
|
});
|
|
71034
|
-
var
|
|
71035
|
-
var
|
|
71156
|
+
var recast4, npm6, pm2, generate8, configure5, updateEnvTypes2, updateNuxtConfig, config7, c3_default8;
|
|
71157
|
+
var init_c38 = __esm({
|
|
71036
71158
|
"templates/nuxt/c3.ts"() {
|
|
71037
71159
|
init_cli();
|
|
71038
71160
|
init_colors();
|
|
@@ -71043,39 +71165,39 @@ var init_c37 = __esm({
|
|
|
71043
71165
|
init_files();
|
|
71044
71166
|
init_packageManagers();
|
|
71045
71167
|
init_packages();
|
|
71046
|
-
|
|
71047
|
-
({ npm:
|
|
71048
|
-
|
|
71168
|
+
recast4 = __toESM(require_main3());
|
|
71169
|
+
({ npm: npm6, name: pm2 } = detectPackageManager());
|
|
71170
|
+
generate8 = async (ctx) => {
|
|
71049
71171
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
71050
71172
|
await runFrameworkGenerator(ctx, [
|
|
71051
71173
|
"init",
|
|
71052
71174
|
ctx.project.name,
|
|
71053
71175
|
"--packageManager",
|
|
71054
|
-
|
|
71176
|
+
npm6,
|
|
71055
71177
|
gitFlag
|
|
71056
71178
|
]);
|
|
71057
71179
|
writeFile2("./.node-version", "17");
|
|
71058
71180
|
logRaw("");
|
|
71059
71181
|
};
|
|
71060
|
-
|
|
71182
|
+
configure5 = async (ctx) => {
|
|
71061
71183
|
const packages = ["nitro-cloudflare-dev"];
|
|
71062
|
-
if (
|
|
71184
|
+
if (pm2 === "pnpm") {
|
|
71063
71185
|
packages.push("h3");
|
|
71064
71186
|
}
|
|
71065
71187
|
await installPackages(packages, {
|
|
71066
71188
|
dev: true,
|
|
71067
71189
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
71068
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
71190
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
|
|
71069
71191
|
});
|
|
71070
71192
|
updateNuxtConfig();
|
|
71071
|
-
|
|
71193
|
+
updateEnvTypes2(ctx);
|
|
71072
71194
|
};
|
|
71073
|
-
|
|
71195
|
+
updateEnvTypes2 = (ctx) => {
|
|
71074
71196
|
const filepath = "env.d.ts";
|
|
71075
71197
|
const s = spinner();
|
|
71076
71198
|
s.start(`Updating ${filepath}`);
|
|
71077
71199
|
let file = readFile(filepath);
|
|
71078
|
-
let typesEntrypoint = `@cloudflare/workers-types
|
|
71200
|
+
let typesEntrypoint = `@cloudflare/workers-types`;
|
|
71079
71201
|
const latestEntrypoint = getLatestTypesEntrypoint(ctx);
|
|
71080
71202
|
if (latestEntrypoint) {
|
|
71081
71203
|
typesEntrypoint += `/${latestEntrypoint}`;
|
|
@@ -71088,7 +71210,7 @@ var init_c37 = __esm({
|
|
|
71088
71210
|
const s = spinner();
|
|
71089
71211
|
const configFile = "nuxt.config.ts";
|
|
71090
71212
|
s.start(`Updating \`${configFile}\``);
|
|
71091
|
-
const b2 =
|
|
71213
|
+
const b2 = recast4.types.builders;
|
|
71092
71214
|
const presetDef = b2.objectProperty(
|
|
71093
71215
|
b2.identifier("nitro"),
|
|
71094
71216
|
b2.objectExpression([
|
|
@@ -71115,7 +71237,7 @@ var init_c37 = __esm({
|
|
|
71115
71237
|
});
|
|
71116
71238
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
71117
71239
|
};
|
|
71118
|
-
|
|
71240
|
+
config7 = {
|
|
71119
71241
|
configVersion: 1,
|
|
71120
71242
|
id: "nuxt",
|
|
71121
71243
|
platform: "pages",
|
|
@@ -71123,12 +71245,12 @@ var init_c37 = __esm({
|
|
|
71123
71245
|
copyFiles: {
|
|
71124
71246
|
path: "./templates"
|
|
71125
71247
|
},
|
|
71126
|
-
generate:
|
|
71127
|
-
configure:
|
|
71248
|
+
generate: generate8,
|
|
71249
|
+
configure: configure5,
|
|
71128
71250
|
transformPackageJson: async () => ({
|
|
71129
71251
|
scripts: {
|
|
71130
|
-
deploy: `${
|
|
71131
|
-
preview: `${
|
|
71252
|
+
deploy: `${npm6} run build && wrangler pages deploy ./dist`,
|
|
71253
|
+
preview: `${npm6} run build && wrangler pages dev ./dist`,
|
|
71132
71254
|
"build-cf-types": `wrangler types`
|
|
71133
71255
|
}
|
|
71134
71256
|
}),
|
|
@@ -71136,17 +71258,17 @@ var init_c37 = __esm({
|
|
|
71136
71258
|
deployScript: "deploy",
|
|
71137
71259
|
previewScript: "preview"
|
|
71138
71260
|
};
|
|
71139
|
-
|
|
71261
|
+
c3_default8 = config7;
|
|
71140
71262
|
}
|
|
71141
71263
|
});
|
|
71142
71264
|
|
|
71143
71265
|
// templates/qwik/c3.ts
|
|
71144
|
-
var
|
|
71145
|
-
__export(
|
|
71146
|
-
default: () =>
|
|
71266
|
+
var c3_exports9 = {};
|
|
71267
|
+
__export(c3_exports9, {
|
|
71268
|
+
default: () => c3_default9
|
|
71147
71269
|
});
|
|
71148
|
-
var
|
|
71149
|
-
var
|
|
71270
|
+
var recast5, npm7, npx4, generate9, configure6, addBindingsProxy, populateCloudflareEnv, config8, c3_default9;
|
|
71271
|
+
var init_c39 = __esm({
|
|
71150
71272
|
"templates/qwik/c3.ts"() {
|
|
71151
71273
|
init_cli();
|
|
71152
71274
|
init_colors();
|
|
@@ -71156,12 +71278,12 @@ var init_c38 = __esm({
|
|
|
71156
71278
|
init_command();
|
|
71157
71279
|
init_files();
|
|
71158
71280
|
init_packageManagers();
|
|
71159
|
-
|
|
71160
|
-
({ npm:
|
|
71161
|
-
|
|
71281
|
+
recast5 = __toESM(require_main3());
|
|
71282
|
+
({ npm: npm7, npx: npx4 } = detectPackageManager());
|
|
71283
|
+
generate9 = async (ctx) => {
|
|
71162
71284
|
await runFrameworkGenerator(ctx, ["basic", ctx.project.name]);
|
|
71163
71285
|
};
|
|
71164
|
-
|
|
71286
|
+
configure6 = async (ctx) => {
|
|
71165
71287
|
const cmd = [npx4, "qwik", "add", "cloudflare-pages"];
|
|
71166
71288
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
71167
71289
|
await runCommand(cmd);
|
|
@@ -71175,7 +71297,7 @@ var init_c38 = __esm({
|
|
|
71175
71297
|
const s = spinner();
|
|
71176
71298
|
s.start("Updating `vite.config.ts`");
|
|
71177
71299
|
const snippets = loadTemplateSnippets(ctx);
|
|
71178
|
-
const b2 =
|
|
71300
|
+
const b2 = recast5.types.builders;
|
|
71179
71301
|
transformFile("vite.config.ts", {
|
|
71180
71302
|
// Insert the env declaration after the last import (but before the rest of the body)
|
|
71181
71303
|
visitProgram: function(n2) {
|
|
@@ -71217,7 +71339,7 @@ var init_c38 = __esm({
|
|
|
71217
71339
|
s.start(`Updating \`${entrypointPath}\``);
|
|
71218
71340
|
transformFile(entrypointPath, {
|
|
71219
71341
|
visitTSInterfaceDeclaration: function(n2) {
|
|
71220
|
-
const b2 =
|
|
71342
|
+
const b2 = recast5.types.builders;
|
|
71221
71343
|
const id = n2.node.id;
|
|
71222
71344
|
if (id.name !== "QwikCityPlatform") {
|
|
71223
71345
|
this.traverse(n2);
|
|
@@ -71238,7 +71360,7 @@ var init_c38 = __esm({
|
|
|
71238
71360
|
});
|
|
71239
71361
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
71240
71362
|
};
|
|
71241
|
-
|
|
71363
|
+
config8 = {
|
|
71242
71364
|
configVersion: 1,
|
|
71243
71365
|
id: "qwik",
|
|
71244
71366
|
displayName: "Qwik",
|
|
@@ -71246,12 +71368,12 @@ var init_c38 = __esm({
|
|
|
71246
71368
|
copyFiles: {
|
|
71247
71369
|
path: "./templates"
|
|
71248
71370
|
},
|
|
71249
|
-
generate:
|
|
71250
|
-
configure:
|
|
71371
|
+
generate: generate9,
|
|
71372
|
+
configure: configure6,
|
|
71251
71373
|
transformPackageJson: async () => ({
|
|
71252
71374
|
scripts: {
|
|
71253
|
-
deploy: `${
|
|
71254
|
-
preview: `${
|
|
71375
|
+
deploy: `${npm7} run build && wrangler pages deploy ./dist`,
|
|
71376
|
+
preview: `${npm7} run build && wrangler pages dev ./dist`,
|
|
71255
71377
|
"build-cf-types": `wrangler types`
|
|
71256
71378
|
}
|
|
71257
71379
|
}),
|
|
@@ -71259,53 +71381,53 @@ var init_c38 = __esm({
|
|
|
71259
71381
|
deployScript: "deploy",
|
|
71260
71382
|
previewScript: "preview"
|
|
71261
71383
|
};
|
|
71262
|
-
|
|
71384
|
+
c3_default9 = config8;
|
|
71263
71385
|
}
|
|
71264
71386
|
});
|
|
71265
71387
|
|
|
71266
71388
|
// templates/react/c3.ts
|
|
71267
|
-
var
|
|
71268
|
-
__export(
|
|
71269
|
-
default: () =>
|
|
71389
|
+
var c3_exports10 = {};
|
|
71390
|
+
__export(c3_exports10, {
|
|
71391
|
+
default: () => c3_default10
|
|
71270
71392
|
});
|
|
71271
|
-
var
|
|
71272
|
-
var
|
|
71393
|
+
var npm8, generate10, config9, c3_default10;
|
|
71394
|
+
var init_c310 = __esm({
|
|
71273
71395
|
"templates/react/c3.ts"() {
|
|
71274
71396
|
init_cli();
|
|
71275
71397
|
init_frameworks();
|
|
71276
71398
|
init_packageManagers();
|
|
71277
|
-
({ npm:
|
|
71278
|
-
|
|
71399
|
+
({ npm: npm8 } = detectPackageManager());
|
|
71400
|
+
generate10 = async (ctx) => {
|
|
71279
71401
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
71280
71402
|
logRaw("");
|
|
71281
71403
|
};
|
|
71282
|
-
|
|
71404
|
+
config9 = {
|
|
71283
71405
|
configVersion: 1,
|
|
71284
71406
|
id: "react",
|
|
71285
71407
|
displayName: "React",
|
|
71286
71408
|
platform: "pages",
|
|
71287
|
-
generate:
|
|
71409
|
+
generate: generate10,
|
|
71288
71410
|
transformPackageJson: async () => ({
|
|
71289
71411
|
scripts: {
|
|
71290
|
-
deploy: `${
|
|
71291
|
-
preview: `${
|
|
71412
|
+
deploy: `${npm8} run build && wrangler pages deploy ./build`,
|
|
71413
|
+
preview: `${npm8} run build && wrangler pages dev ./build`
|
|
71292
71414
|
}
|
|
71293
71415
|
}),
|
|
71294
71416
|
devScript: "dev",
|
|
71295
71417
|
deployScript: "deploy",
|
|
71296
71418
|
previewScript: "preview"
|
|
71297
71419
|
};
|
|
71298
|
-
|
|
71420
|
+
c3_default10 = config9;
|
|
71299
71421
|
}
|
|
71300
71422
|
});
|
|
71301
71423
|
|
|
71302
71424
|
// templates/remix/c3.ts
|
|
71303
|
-
var
|
|
71304
|
-
__export(
|
|
71305
|
-
default: () =>
|
|
71425
|
+
var c3_exports11 = {};
|
|
71426
|
+
__export(c3_exports11, {
|
|
71427
|
+
default: () => c3_default11
|
|
71306
71428
|
});
|
|
71307
|
-
var
|
|
71308
|
-
var
|
|
71429
|
+
var npm9, generate11, configure7, config10, c3_default11;
|
|
71430
|
+
var init_c311 = __esm({
|
|
71309
71431
|
"templates/remix/c3.ts"() {
|
|
71310
71432
|
init_cli();
|
|
71311
71433
|
init_colors();
|
|
@@ -71313,8 +71435,8 @@ var init_c310 = __esm({
|
|
|
71313
71435
|
init_frameworks();
|
|
71314
71436
|
init_codemod();
|
|
71315
71437
|
init_packageManagers();
|
|
71316
|
-
({ npm:
|
|
71317
|
-
|
|
71438
|
+
({ npm: npm9 } = detectPackageManager());
|
|
71439
|
+
generate11 = async (ctx) => {
|
|
71318
71440
|
await runFrameworkGenerator(ctx, [
|
|
71319
71441
|
ctx.project.name,
|
|
71320
71442
|
"--template",
|
|
@@ -71322,7 +71444,7 @@ var init_c310 = __esm({
|
|
|
71322
71444
|
]);
|
|
71323
71445
|
logRaw("");
|
|
71324
71446
|
};
|
|
71325
|
-
|
|
71447
|
+
configure7 = async () => {
|
|
71326
71448
|
const typeDefsPath = "load-context.ts";
|
|
71327
71449
|
const s = spinner();
|
|
71328
71450
|
s.start(`Updating \`${typeDefsPath}\``);
|
|
@@ -71337,7 +71459,7 @@ var init_c310 = __esm({
|
|
|
71337
71459
|
});
|
|
71338
71460
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
71339
71461
|
};
|
|
71340
|
-
|
|
71462
|
+
config10 = {
|
|
71341
71463
|
configVersion: 1,
|
|
71342
71464
|
id: "remix",
|
|
71343
71465
|
platform: "pages",
|
|
@@ -71345,12 +71467,12 @@ var init_c310 = __esm({
|
|
|
71345
71467
|
copyFiles: {
|
|
71346
71468
|
path: "./templates"
|
|
71347
71469
|
},
|
|
71348
|
-
generate:
|
|
71349
|
-
configure:
|
|
71470
|
+
generate: generate11,
|
|
71471
|
+
configure: configure7,
|
|
71350
71472
|
transformPackageJson: async () => ({
|
|
71351
71473
|
scripts: {
|
|
71352
|
-
deploy: `${
|
|
71353
|
-
preview: `${
|
|
71474
|
+
deploy: `${npm9} run build && wrangler pages deploy ./build/client`,
|
|
71475
|
+
preview: `${npm9} run build && wrangler pages dev ./build/client`,
|
|
71354
71476
|
"build-cf-types": `wrangler types`
|
|
71355
71477
|
}
|
|
71356
71478
|
}),
|
|
@@ -71358,17 +71480,17 @@ var init_c310 = __esm({
|
|
|
71358
71480
|
deployScript: "deploy",
|
|
71359
71481
|
previewScript: "preview"
|
|
71360
71482
|
};
|
|
71361
|
-
|
|
71483
|
+
c3_default11 = config10;
|
|
71362
71484
|
}
|
|
71363
71485
|
});
|
|
71364
71486
|
|
|
71365
71487
|
// templates/solid/c3.ts
|
|
71366
|
-
var
|
|
71367
|
-
__export(
|
|
71368
|
-
default: () =>
|
|
71488
|
+
var c3_exports12 = {};
|
|
71489
|
+
__export(c3_exports12, {
|
|
71490
|
+
default: () => c3_default12
|
|
71369
71491
|
});
|
|
71370
|
-
var
|
|
71371
|
-
var
|
|
71492
|
+
var recast6, npm10, generate12, configure8, config11, c3_default12;
|
|
71493
|
+
var init_c312 = __esm({
|
|
71372
71494
|
"templates/solid/c3.ts"() {
|
|
71373
71495
|
init_cli();
|
|
71374
71496
|
init_colors();
|
|
@@ -71377,13 +71499,13 @@ var init_c311 = __esm({
|
|
|
71377
71499
|
init_compatDate();
|
|
71378
71500
|
init_files();
|
|
71379
71501
|
init_packageManagers();
|
|
71380
|
-
|
|
71381
|
-
({ npm:
|
|
71382
|
-
|
|
71502
|
+
recast6 = __toESM(require_main3());
|
|
71503
|
+
({ npm: npm10 } = detectPackageManager());
|
|
71504
|
+
generate12 = async (ctx) => {
|
|
71383
71505
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
71384
71506
|
logRaw("");
|
|
71385
71507
|
};
|
|
71386
|
-
|
|
71508
|
+
configure8 = async (ctx) => {
|
|
71387
71509
|
usesTypescript(ctx);
|
|
71388
71510
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
71389
71511
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
@@ -71393,7 +71515,7 @@ var init_c311 = __esm({
|
|
|
71393
71515
|
if (callee.name !== "defineConfig") {
|
|
71394
71516
|
return this.traverse(n2);
|
|
71395
71517
|
}
|
|
71396
|
-
const b2 =
|
|
71518
|
+
const b2 = recast6.types.builders;
|
|
71397
71519
|
n2.node.arguments = [
|
|
71398
71520
|
b2.objectExpression([
|
|
71399
71521
|
b2.objectProperty(
|
|
@@ -71420,17 +71542,17 @@ var init_c311 = __esm({
|
|
|
71420
71542
|
}
|
|
71421
71543
|
});
|
|
71422
71544
|
};
|
|
71423
|
-
|
|
71545
|
+
config11 = {
|
|
71424
71546
|
configVersion: 1,
|
|
71425
71547
|
id: "solid",
|
|
71426
71548
|
displayName: "Solid",
|
|
71427
71549
|
platform: "pages",
|
|
71428
|
-
generate:
|
|
71429
|
-
configure:
|
|
71550
|
+
generate: generate12,
|
|
71551
|
+
configure: configure8,
|
|
71430
71552
|
transformPackageJson: async () => ({
|
|
71431
71553
|
scripts: {
|
|
71432
|
-
preview: `${
|
|
71433
|
-
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`
|
|
71434
71556
|
}
|
|
71435
71557
|
}),
|
|
71436
71558
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -71438,17 +71560,17 @@ var init_c311 = __esm({
|
|
|
71438
71560
|
deployScript: "deploy",
|
|
71439
71561
|
previewScript: "preview"
|
|
71440
71562
|
};
|
|
71441
|
-
|
|
71563
|
+
c3_default12 = config11;
|
|
71442
71564
|
}
|
|
71443
71565
|
});
|
|
71444
71566
|
|
|
71445
71567
|
// templates/svelte/c3.ts
|
|
71446
|
-
var
|
|
71447
|
-
__export(
|
|
71448
|
-
default: () =>
|
|
71568
|
+
var c3_exports13 = {};
|
|
71569
|
+
__export(c3_exports13, {
|
|
71570
|
+
default: () => c3_default13
|
|
71449
71571
|
});
|
|
71450
|
-
var import_node_os,
|
|
71451
|
-
var
|
|
71572
|
+
var import_node_os, recast7, npm11, generate13, configure9, updateSvelteConfig, updateTypeDefinitions, config12, c3_default13;
|
|
71573
|
+
var init_c313 = __esm({
|
|
71452
71574
|
"templates/svelte/c3.ts"() {
|
|
71453
71575
|
import_node_os = require("node:os");
|
|
71454
71576
|
init_cli();
|
|
@@ -71458,13 +71580,13 @@ var init_c312 = __esm({
|
|
|
71458
71580
|
init_files();
|
|
71459
71581
|
init_packageManagers();
|
|
71460
71582
|
init_packages();
|
|
71461
|
-
|
|
71462
|
-
({ npm:
|
|
71463
|
-
|
|
71583
|
+
recast7 = __toESM(require_main3());
|
|
71584
|
+
({ npm: npm11 } = detectPackageManager());
|
|
71585
|
+
generate13 = async (ctx) => {
|
|
71464
71586
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
71465
71587
|
logRaw("");
|
|
71466
71588
|
};
|
|
71467
|
-
|
|
71589
|
+
configure9 = async (ctx) => {
|
|
71468
71590
|
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
71469
71591
|
await installPackages([pkg], {
|
|
71470
71592
|
dev: true,
|
|
@@ -71491,7 +71613,7 @@ var init_c312 = __esm({
|
|
|
71491
71613
|
return;
|
|
71492
71614
|
}
|
|
71493
71615
|
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
71494
|
-
const b2 =
|
|
71616
|
+
const b2 = recast7.types.builders;
|
|
71495
71617
|
transformFile("src/app.d.ts", {
|
|
71496
71618
|
visitTSModuleDeclaration(n2) {
|
|
71497
71619
|
if (n2.value.id.name === "App" && n2.node.body) {
|
|
@@ -71523,7 +71645,7 @@ var init_c312 = __esm({
|
|
|
71523
71645
|
}
|
|
71524
71646
|
});
|
|
71525
71647
|
};
|
|
71526
|
-
|
|
71648
|
+
config12 = {
|
|
71527
71649
|
configVersion: 1,
|
|
71528
71650
|
id: "svelte",
|
|
71529
71651
|
displayName: "Svelte",
|
|
@@ -71534,12 +71656,12 @@ var init_c312 = __esm({
|
|
|
71534
71656
|
ts: { path: "./ts" }
|
|
71535
71657
|
}
|
|
71536
71658
|
},
|
|
71537
|
-
generate:
|
|
71538
|
-
configure:
|
|
71659
|
+
generate: generate13,
|
|
71660
|
+
configure: configure9,
|
|
71539
71661
|
transformPackageJson: async (original, ctx) => {
|
|
71540
71662
|
let scripts = {
|
|
71541
|
-
preview: `${
|
|
71542
|
-
deploy: `${
|
|
71663
|
+
preview: `${npm11} run build && wrangler pages dev .svelte-kit/cloudflare`,
|
|
71664
|
+
deploy: `${npm11} run build && wrangler pages deploy .svelte-kit/cloudflare`
|
|
71543
71665
|
};
|
|
71544
71666
|
if (usesTypescript(ctx)) {
|
|
71545
71667
|
const mv = (0, import_node_os.platform)() === "win32" ? "move" : "mv";
|
|
@@ -71554,53 +71676,53 @@ var init_c312 = __esm({
|
|
|
71554
71676
|
deployScript: "deploy",
|
|
71555
71677
|
previewScript: "preview"
|
|
71556
71678
|
};
|
|
71557
|
-
|
|
71679
|
+
c3_default13 = config12;
|
|
71558
71680
|
}
|
|
71559
71681
|
});
|
|
71560
71682
|
|
|
71561
71683
|
// templates/vue/c3.ts
|
|
71562
|
-
var
|
|
71563
|
-
__export(
|
|
71564
|
-
default: () =>
|
|
71684
|
+
var c3_exports14 = {};
|
|
71685
|
+
__export(c3_exports14, {
|
|
71686
|
+
default: () => c3_default14
|
|
71565
71687
|
});
|
|
71566
|
-
var
|
|
71567
|
-
var
|
|
71688
|
+
var npm12, generate14, config13, c3_default14;
|
|
71689
|
+
var init_c314 = __esm({
|
|
71568
71690
|
"templates/vue/c3.ts"() {
|
|
71569
71691
|
init_frameworks();
|
|
71570
71692
|
init_packageManagers();
|
|
71571
|
-
({ npm:
|
|
71572
|
-
|
|
71693
|
+
({ npm: npm12 } = detectPackageManager());
|
|
71694
|
+
generate14 = async (ctx) => {
|
|
71573
71695
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
71574
71696
|
};
|
|
71575
|
-
|
|
71697
|
+
config13 = {
|
|
71576
71698
|
configVersion: 1,
|
|
71577
71699
|
id: "vue",
|
|
71578
71700
|
displayName: "Vue",
|
|
71579
71701
|
platform: "pages",
|
|
71580
|
-
generate:
|
|
71702
|
+
generate: generate14,
|
|
71581
71703
|
transformPackageJson: async () => ({
|
|
71582
71704
|
scripts: {
|
|
71583
|
-
deploy: `${
|
|
71584
|
-
preview: `${
|
|
71705
|
+
deploy: `${npm12} run build && wrangler pages deploy ./dist`,
|
|
71706
|
+
preview: `${npm12} run build && wrangler pages dev ./dist`
|
|
71585
71707
|
}
|
|
71586
71708
|
}),
|
|
71587
71709
|
devScript: "dev",
|
|
71588
71710
|
deployScript: "deploy",
|
|
71589
71711
|
previewScript: "preview"
|
|
71590
71712
|
};
|
|
71591
|
-
|
|
71713
|
+
c3_default14 = config13;
|
|
71592
71714
|
}
|
|
71593
71715
|
});
|
|
71594
71716
|
|
|
71595
71717
|
// templates/hello-world/c3.ts
|
|
71596
|
-
var
|
|
71597
|
-
__export(
|
|
71598
|
-
default: () =>
|
|
71718
|
+
var c3_exports15 = {};
|
|
71719
|
+
__export(c3_exports15, {
|
|
71720
|
+
default: () => c3_default15
|
|
71599
71721
|
});
|
|
71600
|
-
var
|
|
71601
|
-
var
|
|
71722
|
+
var c3_default15;
|
|
71723
|
+
var init_c315 = __esm({
|
|
71602
71724
|
"templates/hello-world/c3.ts"() {
|
|
71603
|
-
|
|
71725
|
+
c3_default15 = {
|
|
71604
71726
|
configVersion: 1,
|
|
71605
71727
|
id: "hello-world",
|
|
71606
71728
|
displayName: '"Hello World" Worker',
|
|
@@ -71620,14 +71742,14 @@ var init_c314 = __esm({
|
|
|
71620
71742
|
});
|
|
71621
71743
|
|
|
71622
71744
|
// templates/hello-world-python/c3.ts
|
|
71623
|
-
var
|
|
71624
|
-
__export(
|
|
71625
|
-
default: () =>
|
|
71745
|
+
var c3_exports16 = {};
|
|
71746
|
+
__export(c3_exports16, {
|
|
71747
|
+
default: () => c3_default16
|
|
71626
71748
|
});
|
|
71627
|
-
var
|
|
71628
|
-
var
|
|
71749
|
+
var c3_default16;
|
|
71750
|
+
var init_c316 = __esm({
|
|
71629
71751
|
"templates/hello-world-python/c3.ts"() {
|
|
71630
|
-
|
|
71752
|
+
c3_default16 = {
|
|
71631
71753
|
configVersion: 1,
|
|
71632
71754
|
id: "hello-world-python",
|
|
71633
71755
|
displayName: '"Hello World" Worker (Python)',
|
|
@@ -71640,14 +71762,14 @@ var init_c315 = __esm({
|
|
|
71640
71762
|
});
|
|
71641
71763
|
|
|
71642
71764
|
// templates/hello-world-durable-object/c3.ts
|
|
71643
|
-
var
|
|
71644
|
-
__export(
|
|
71645
|
-
default: () =>
|
|
71765
|
+
var c3_exports17 = {};
|
|
71766
|
+
__export(c3_exports17, {
|
|
71767
|
+
default: () => c3_default17
|
|
71646
71768
|
});
|
|
71647
|
-
var
|
|
71648
|
-
var
|
|
71769
|
+
var c3_default17;
|
|
71770
|
+
var init_c317 = __esm({
|
|
71649
71771
|
"templates/hello-world-durable-object/c3.ts"() {
|
|
71650
|
-
|
|
71772
|
+
c3_default17 = {
|
|
71651
71773
|
configVersion: 1,
|
|
71652
71774
|
id: "hello-world-durable-object",
|
|
71653
71775
|
displayName: '"Hello World" Durable Object',
|
|
@@ -71667,14 +71789,14 @@ var init_c316 = __esm({
|
|
|
71667
71789
|
});
|
|
71668
71790
|
|
|
71669
71791
|
// templates/common/c3.ts
|
|
71670
|
-
var
|
|
71671
|
-
__export(
|
|
71672
|
-
default: () =>
|
|
71792
|
+
var c3_exports18 = {};
|
|
71793
|
+
__export(c3_exports18, {
|
|
71794
|
+
default: () => c3_default18
|
|
71673
71795
|
});
|
|
71674
|
-
var
|
|
71675
|
-
var
|
|
71796
|
+
var c3_default18;
|
|
71797
|
+
var init_c318 = __esm({
|
|
71676
71798
|
"templates/common/c3.ts"() {
|
|
71677
|
-
|
|
71799
|
+
c3_default18 = {
|
|
71678
71800
|
configVersion: 1,
|
|
71679
71801
|
id: "common",
|
|
71680
71802
|
displayName: "Example router & proxy Worker",
|
|
@@ -71694,14 +71816,14 @@ var init_c317 = __esm({
|
|
|
71694
71816
|
});
|
|
71695
71817
|
|
|
71696
71818
|
// templates/scheduled/c3.ts
|
|
71697
|
-
var
|
|
71698
|
-
__export(
|
|
71699
|
-
default: () =>
|
|
71819
|
+
var c3_exports19 = {};
|
|
71820
|
+
__export(c3_exports19, {
|
|
71821
|
+
default: () => c3_default19
|
|
71700
71822
|
});
|
|
71701
|
-
var
|
|
71702
|
-
var
|
|
71823
|
+
var c3_default19;
|
|
71824
|
+
var init_c319 = __esm({
|
|
71703
71825
|
"templates/scheduled/c3.ts"() {
|
|
71704
|
-
|
|
71826
|
+
c3_default19 = {
|
|
71705
71827
|
configVersion: 1,
|
|
71706
71828
|
id: "scheduled",
|
|
71707
71829
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -71721,14 +71843,14 @@ var init_c318 = __esm({
|
|
|
71721
71843
|
});
|
|
71722
71844
|
|
|
71723
71845
|
// templates/queues/c3.ts
|
|
71724
|
-
var
|
|
71725
|
-
__export(
|
|
71726
|
-
default: () =>
|
|
71846
|
+
var c3_exports20 = {};
|
|
71847
|
+
__export(c3_exports20, {
|
|
71848
|
+
default: () => c3_default20
|
|
71727
71849
|
});
|
|
71728
|
-
var
|
|
71729
|
-
var
|
|
71850
|
+
var c3_default20;
|
|
71851
|
+
var init_c320 = __esm({
|
|
71730
71852
|
"templates/queues/c3.ts"() {
|
|
71731
|
-
|
|
71853
|
+
c3_default20 = {
|
|
71732
71854
|
configVersion: 1,
|
|
71733
71855
|
id: "queues",
|
|
71734
71856
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -71758,14 +71880,14 @@ var init_c319 = __esm({
|
|
|
71758
71880
|
});
|
|
71759
71881
|
|
|
71760
71882
|
// templates/openapi/c3.ts
|
|
71761
|
-
var
|
|
71762
|
-
__export(
|
|
71763
|
-
default: () =>
|
|
71883
|
+
var c3_exports21 = {};
|
|
71884
|
+
__export(c3_exports21, {
|
|
71885
|
+
default: () => c3_default21
|
|
71764
71886
|
});
|
|
71765
|
-
var
|
|
71766
|
-
var
|
|
71887
|
+
var c3_default21;
|
|
71888
|
+
var init_c321 = __esm({
|
|
71767
71889
|
"templates/openapi/c3.ts"() {
|
|
71768
|
-
|
|
71890
|
+
c3_default21 = {
|
|
71769
71891
|
configVersion: 1,
|
|
71770
71892
|
id: "openapi",
|
|
71771
71893
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -71778,10 +71900,10 @@ var init_c320 = __esm({
|
|
|
71778
71900
|
});
|
|
71779
71901
|
|
|
71780
71902
|
// templates/pre-existing/c3.ts
|
|
71781
|
-
var
|
|
71782
|
-
__export(
|
|
71903
|
+
var c3_exports22 = {};
|
|
71904
|
+
__export(c3_exports22, {
|
|
71783
71905
|
copyExistingWorkerFiles: () => copyExistingWorkerFiles,
|
|
71784
|
-
default: () =>
|
|
71906
|
+
default: () => c3_default22
|
|
71785
71907
|
});
|
|
71786
71908
|
async function copyExistingWorkerFiles(ctx) {
|
|
71787
71909
|
const { dlx } = detectPackageManager();
|
|
@@ -71830,8 +71952,8 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
71830
71952
|
(0, import_path14.join)(ctx.project.path, "wrangler.toml")
|
|
71831
71953
|
);
|
|
71832
71954
|
}
|
|
71833
|
-
var import_promises, import_os, import_path14,
|
|
71834
|
-
var
|
|
71955
|
+
var import_promises, import_os, import_path14, c3_default22;
|
|
71956
|
+
var init_c322 = __esm({
|
|
71835
71957
|
"templates/pre-existing/c3.ts"() {
|
|
71836
71958
|
import_promises = require("fs/promises");
|
|
71837
71959
|
import_os = require("os");
|
|
@@ -71841,7 +71963,7 @@ var init_c321 = __esm({
|
|
|
71841
71963
|
init_command();
|
|
71842
71964
|
init_packageManagers();
|
|
71843
71965
|
init_accounts();
|
|
71844
|
-
|
|
71966
|
+
c3_default22 = {
|
|
71845
71967
|
configVersion: 1,
|
|
71846
71968
|
id: "pre-existing",
|
|
71847
71969
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
@@ -71905,36 +72027,37 @@ var init_templates = __esm({
|
|
|
71905
72027
|
return typescript ? "ts" : "js";
|
|
71906
72028
|
};
|
|
71907
72029
|
getFrameworkMap = async () => ({
|
|
71908
|
-
|
|
71909
|
-
|
|
71910
|
-
|
|
71911
|
-
|
|
71912
|
-
|
|
71913
|
-
|
|
71914
|
-
|
|
71915
|
-
|
|
71916
|
-
|
|
71917
|
-
|
|
71918
|
-
|
|
71919
|
-
|
|
71920
|
-
|
|
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
|
|
71921
72044
|
});
|
|
71922
72045
|
getTemplateMap = async () => {
|
|
71923
72046
|
return {
|
|
71924
|
-
"hello-world": (await Promise.resolve().then(() => (
|
|
71925
|
-
"hello-world-python": (await Promise.resolve().then(() => (
|
|
71926
|
-
"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,
|
|
71927
72050
|
// Dummy record -- actual template config resolved in `selectFramework`
|
|
71928
72051
|
"web-framework": { displayName: "Website or web app" },
|
|
71929
|
-
common: (await Promise.resolve().then(() => (
|
|
71930
|
-
scheduled: (await Promise.resolve().then(() => (
|
|
71931
|
-
queues: (await Promise.resolve().then(() => (
|
|
71932
|
-
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,
|
|
71933
72056
|
// Dummy record -- actual template config resolved in `processRemoteTemplate`
|
|
71934
72057
|
"remote-template": {
|
|
71935
72058
|
displayName: "Worker built from a template hosted in a git repository"
|
|
71936
72059
|
},
|
|
71937
|
-
"pre-existing": (await Promise.resolve().then(() => (
|
|
72060
|
+
"pre-existing": (await Promise.resolve().then(() => (init_c322(), c3_exports22))).default
|
|
71938
72061
|
};
|
|
71939
72062
|
};
|
|
71940
72063
|
selectTemplate = async (args) => {
|
|
@@ -71985,8 +72108,8 @@ var init_templates = __esm({
|
|
|
71985
72108
|
selectFramework = async (args) => {
|
|
71986
72109
|
const frameworkMap = await getFrameworkMap();
|
|
71987
72110
|
const frameworkOptions = Object.entries(frameworkMap).map(
|
|
71988
|
-
([key,
|
|
71989
|
-
label:
|
|
72111
|
+
([key, config14]) => ({
|
|
72112
|
+
label: config14.displayName,
|
|
71990
72113
|
value: key
|
|
71991
72114
|
})
|
|
71992
72115
|
);
|
|
@@ -72035,27 +72158,27 @@ var init_templates = __esm({
|
|
|
72035
72158
|
defaultValue: C3_DEFAULTS.template
|
|
72036
72159
|
});
|
|
72037
72160
|
const path4 = await downloadRemoteTemplate(templateUrl);
|
|
72038
|
-
const
|
|
72039
|
-
validateTemplate(path4,
|
|
72161
|
+
const config14 = inferTemplateConfig(path4);
|
|
72162
|
+
validateTemplate(path4, config14);
|
|
72040
72163
|
return {
|
|
72041
72164
|
path: path4,
|
|
72042
|
-
...
|
|
72165
|
+
...config14
|
|
72043
72166
|
};
|
|
72044
72167
|
};
|
|
72045
|
-
validateTemplate = (path4,
|
|
72046
|
-
if (!
|
|
72168
|
+
validateTemplate = (path4, config14) => {
|
|
72169
|
+
if (!config14.copyFiles) {
|
|
72047
72170
|
return;
|
|
72048
72171
|
}
|
|
72049
|
-
if (isVariantInfo(
|
|
72050
|
-
validateTemplateSrcDirectory((0, import_path15.resolve)(path4,
|
|
72172
|
+
if (isVariantInfo(config14.copyFiles)) {
|
|
72173
|
+
validateTemplateSrcDirectory((0, import_path15.resolve)(path4, config14.copyFiles.path), config14);
|
|
72051
72174
|
} else {
|
|
72052
|
-
for (const variant of Object.values(
|
|
72053
|
-
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);
|
|
72054
72177
|
}
|
|
72055
72178
|
}
|
|
72056
72179
|
};
|
|
72057
|
-
validateTemplateSrcDirectory = (path4,
|
|
72058
|
-
if (
|
|
72180
|
+
validateTemplateSrcDirectory = (path4, config14) => {
|
|
72181
|
+
if (config14.platform === "workers") {
|
|
72059
72182
|
const wranglerTomlPath = (0, import_path15.resolve)(path4, "wrangler.toml");
|
|
72060
72183
|
if (!(0, import_fs12.existsSync)(wranglerTomlPath)) {
|
|
72061
72184
|
crash(`create-cloudflare templates must contain a "wrangler.toml" file.`);
|
|
@@ -73105,23 +73228,23 @@ var YargsParser = class {
|
|
|
73105
73228
|
const configPath = argv2[configKey] || configLookup[configKey];
|
|
73106
73229
|
if (configPath) {
|
|
73107
73230
|
try {
|
|
73108
|
-
let
|
|
73231
|
+
let config14 = null;
|
|
73109
73232
|
const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
|
|
73110
73233
|
const resolveConfig = flags.configs[configKey];
|
|
73111
73234
|
if (typeof resolveConfig === "function") {
|
|
73112
73235
|
try {
|
|
73113
|
-
|
|
73236
|
+
config14 = resolveConfig(resolvedConfigPath);
|
|
73114
73237
|
} catch (e) {
|
|
73115
|
-
|
|
73238
|
+
config14 = e;
|
|
73116
73239
|
}
|
|
73117
|
-
if (
|
|
73118
|
-
error2 =
|
|
73240
|
+
if (config14 instanceof Error) {
|
|
73241
|
+
error2 = config14;
|
|
73119
73242
|
return;
|
|
73120
73243
|
}
|
|
73121
73244
|
} else {
|
|
73122
|
-
|
|
73245
|
+
config14 = mixin2.require(resolvedConfigPath);
|
|
73123
73246
|
}
|
|
73124
|
-
setConfigObject(
|
|
73247
|
+
setConfigObject(config14);
|
|
73125
73248
|
} catch (ex) {
|
|
73126
73249
|
if (ex.name === "PermissionDenied")
|
|
73127
73250
|
error2 = ex;
|
|
@@ -73131,9 +73254,9 @@ var YargsParser = class {
|
|
|
73131
73254
|
}
|
|
73132
73255
|
});
|
|
73133
73256
|
}
|
|
73134
|
-
function setConfigObject(
|
|
73135
|
-
Object.keys(
|
|
73136
|
-
const value =
|
|
73257
|
+
function setConfigObject(config14, prev) {
|
|
73258
|
+
Object.keys(config14).forEach(function(key) {
|
|
73259
|
+
const value = config14[key];
|
|
73137
73260
|
const fullKey = prev ? prev + "." + key : key;
|
|
73138
73261
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
|
|
73139
73262
|
setConfigObject(value, fullKey);
|
|
@@ -74285,11 +74408,11 @@ var CommandInstance = class {
|
|
|
74285
74408
|
});
|
|
74286
74409
|
if (!unparsed.length)
|
|
74287
74410
|
return;
|
|
74288
|
-
const
|
|
74411
|
+
const config14 = Object.assign({}, options.configuration, {
|
|
74289
74412
|
"populate--": false
|
|
74290
74413
|
});
|
|
74291
74414
|
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
|
|
74292
|
-
configuration:
|
|
74415
|
+
configuration: config14
|
|
74293
74416
|
}));
|
|
74294
74417
|
if (parsed.error) {
|
|
74295
74418
|
yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
|
|
@@ -75511,31 +75634,31 @@ ${customMsgs.join("\n")}` : "";
|
|
|
75511
75634
|
// ../../node_modules/.pnpm/yargs@17.7.1/node_modules/yargs/build/lib/utils/apply-extends.js
|
|
75512
75635
|
var previouslyVisitedConfigs = [];
|
|
75513
75636
|
var shim2;
|
|
75514
|
-
function applyExtends(
|
|
75637
|
+
function applyExtends(config14, cwd, mergeExtends, _shim) {
|
|
75515
75638
|
shim2 = _shim;
|
|
75516
75639
|
let defaultConfig = {};
|
|
75517
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
75518
|
-
if (typeof
|
|
75640
|
+
if (Object.prototype.hasOwnProperty.call(config14, "extends")) {
|
|
75641
|
+
if (typeof config14.extends !== "string")
|
|
75519
75642
|
return defaultConfig;
|
|
75520
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
75643
|
+
const isPath = /\.json|\..*rc$/.test(config14.extends);
|
|
75521
75644
|
let pathToDefault = null;
|
|
75522
75645
|
if (!isPath) {
|
|
75523
75646
|
try {
|
|
75524
|
-
pathToDefault = require.resolve(
|
|
75647
|
+
pathToDefault = require.resolve(config14.extends);
|
|
75525
75648
|
} catch (_err) {
|
|
75526
|
-
return
|
|
75649
|
+
return config14;
|
|
75527
75650
|
}
|
|
75528
75651
|
} else {
|
|
75529
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
75652
|
+
pathToDefault = getPathToDefaultConfig(cwd, config14.extends);
|
|
75530
75653
|
}
|
|
75531
75654
|
checkForCircularExtends(pathToDefault);
|
|
75532
75655
|
previouslyVisitedConfigs.push(pathToDefault);
|
|
75533
|
-
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(
|
|
75534
|
-
delete
|
|
75656
|
+
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config14.extends);
|
|
75657
|
+
delete config14.extends;
|
|
75535
75658
|
defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
|
|
75536
75659
|
}
|
|
75537
75660
|
previouslyVisitedConfigs = [];
|
|
75538
|
-
return mergeExtends ? mergeDeep(defaultConfig,
|
|
75661
|
+
return mergeExtends ? mergeDeep(defaultConfig, config14) : Object.assign({}, defaultConfig, config14);
|
|
75539
75662
|
}
|
|
75540
75663
|
function checkForCircularExtends(cfgPath) {
|
|
75541
75664
|
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
|
@@ -76316,9 +76439,9 @@ var YargsInstance = class {
|
|
|
76316
76439
|
}
|
|
76317
76440
|
return maybePromise;
|
|
76318
76441
|
}
|
|
76319
|
-
parserConfiguration(
|
|
76320
|
-
argsert("<object>", [
|
|
76321
|
-
__classPrivateFieldSet(this, _YargsInstance_parserConfig,
|
|
76442
|
+
parserConfiguration(config14) {
|
|
76443
|
+
argsert("<object>", [config14], arguments.length);
|
|
76444
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config14, "f");
|
|
76322
76445
|
return this;
|
|
76323
76446
|
}
|
|
76324
76447
|
pkgConf(key, rootPath) {
|
|
@@ -76490,9 +76613,9 @@ var YargsInstance = class {
|
|
|
76490
76613
|
return this;
|
|
76491
76614
|
}
|
|
76492
76615
|
}
|
|
76493
|
-
usageConfiguration(
|
|
76494
|
-
argsert("<object>", [
|
|
76495
|
-
__classPrivateFieldSet(this, _YargsInstance_usageConfig,
|
|
76616
|
+
usageConfiguration(config14) {
|
|
76617
|
+
argsert("<object>", [config14], arguments.length);
|
|
76618
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config14, "f");
|
|
76496
76619
|
return this;
|
|
76497
76620
|
}
|
|
76498
76621
|
version(opt, msg, ver) {
|
|
@@ -76898,11 +77021,11 @@ var YargsInstance = class {
|
|
|
76898
77021
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
|
|
76899
77022
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
|
|
76900
77023
|
const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
|
|
76901
|
-
const
|
|
77024
|
+
const config14 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
|
|
76902
77025
|
"populate--": true
|
|
76903
77026
|
});
|
|
76904
77027
|
const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
|
|
76905
|
-
configuration: { "parse-positional-numbers": false, ...
|
|
77028
|
+
configuration: { "parse-positional-numbers": false, ...config14 }
|
|
76906
77029
|
}));
|
|
76907
77030
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
76908
77031
|
let argvPromise = void 0;
|
|
@@ -77339,15 +77462,15 @@ var showHelp = ({
|
|
|
77339
77462
|
options,
|
|
77340
77463
|
intro
|
|
77341
77464
|
}) => {
|
|
77342
|
-
const { name:
|
|
77465
|
+
const { name: pm3 } = detectPackageManager();
|
|
77343
77466
|
logRaw(`${brandColor("create-cloudflare")} ${dim("v" + version)}
|
|
77344
77467
|
`);
|
|
77345
77468
|
indent(`${intro.trim()}
|
|
77346
77469
|
`, 1);
|
|
77347
77470
|
logRaw(bold("USAGE\n"));
|
|
77348
|
-
const latest =
|
|
77349
|
-
const opts =
|
|
77350
|
-
indent(`${
|
|
77471
|
+
const latest = pm3 === "yarn" ? "" : "@latest";
|
|
77472
|
+
const opts = pm3 === "npm" ? "-- options" : "options";
|
|
77473
|
+
indent(`${pm3} create cloudflare${latest} [directory] [${opts}]
|
|
77351
77474
|
`, 1);
|
|
77352
77475
|
logRaw(bold("OPTIONS\n"));
|
|
77353
77476
|
renderPositionals(positionals);
|
|
@@ -77476,6 +77599,7 @@ var cliDefinition = {
|
|
|
77476
77599
|
pnpm create clouldfare --framework next -- --ts
|
|
77477
77600
|
`,
|
|
77478
77601
|
values: [
|
|
77602
|
+
{ name: "analog" },
|
|
77479
77603
|
{ name: "angular" },
|
|
77480
77604
|
{ name: "astro" },
|
|
77481
77605
|
{ name: "docusaurus" },
|
|
@@ -77676,7 +77800,7 @@ init_command();
|
|
|
77676
77800
|
init_packageManagers();
|
|
77677
77801
|
|
|
77678
77802
|
// ../wrangler/package.json
|
|
77679
|
-
var version2 = "3.
|
|
77803
|
+
var version2 = "3.51.0";
|
|
77680
77804
|
|
|
77681
77805
|
// src/git.ts
|
|
77682
77806
|
init_package();
|
|
@@ -78971,7 +79095,7 @@ var writeWranglerToml = (ctx, contents) => {
|
|
|
78971
79095
|
|
|
78972
79096
|
// src/deploy.ts
|
|
78973
79097
|
var offerToDeploy = async (ctx) => {
|
|
78974
|
-
const { npm:
|
|
79098
|
+
const { npm: npm14 } = detectPackageManager();
|
|
78975
79099
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
78976
79100
|
if (!await isDeployable(ctx)) {
|
|
78977
79101
|
ctx.args.deploy = false;
|
|
@@ -78982,7 +79106,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
78982
79106
|
);
|
|
78983
79107
|
}
|
|
78984
79108
|
const label = `deploy via \`${quoteShellArgs([
|
|
78985
|
-
|
|
79109
|
+
npm14,
|
|
78986
79110
|
"run",
|
|
78987
79111
|
ctx.template.deployScript ?? "deploy"
|
|
78988
79112
|
])}\``;
|
|
@@ -79013,18 +79137,18 @@ var isDeployable = async (ctx) => {
|
|
|
79013
79137
|
return true;
|
|
79014
79138
|
};
|
|
79015
79139
|
var runDeploy = async (ctx) => {
|
|
79016
|
-
const { npm:
|
|
79140
|
+
const { npm: npm14, name: pm3 } = detectPackageManager();
|
|
79017
79141
|
if (!ctx.account?.id) {
|
|
79018
79142
|
crash("Failed to read Cloudflare account.");
|
|
79019
79143
|
return;
|
|
79020
79144
|
}
|
|
79021
|
-
const baseDeployCmd = [
|
|
79145
|
+
const baseDeployCmd = [npm14, "run", ctx.template.deployScript ?? "deploy"];
|
|
79022
79146
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
79023
79147
|
const deployCmd = [
|
|
79024
79148
|
...baseDeployCmd,
|
|
79025
79149
|
// Important: the following assumes that all framework deploy commands terminate with `wrangler pages deploy`
|
|
79026
79150
|
...ctx.template.platform === "pages" && ctx.commitMessage && !insideGitRepo ? [
|
|
79027
|
-
...
|
|
79151
|
+
...pm3 === "npm" ? ["--"] : [],
|
|
79028
79152
|
"--commit-message",
|
|
79029
79153
|
JSON.stringify(ctx.commitMessage)
|
|
79030
79154
|
] : []
|
|
@@ -79032,7 +79156,10 @@ var runDeploy = async (ctx) => {
|
|
|
79032
79156
|
const result = await runCommand(deployCmd, {
|
|
79033
79157
|
silent: true,
|
|
79034
79158
|
cwd: ctx.project.path,
|
|
79035
|
-
env: {
|
|
79159
|
+
env: {
|
|
79160
|
+
CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
|
|
79161
|
+
NODE_ENV: "production"
|
|
79162
|
+
},
|
|
79036
79163
|
startText: "Deploying your application",
|
|
79037
79164
|
doneText: `${brandColor("deployed")} ${dim(
|
|
79038
79165
|
`via \`${quoteShellArgs(baseDeployCmd)}\``
|
|
@@ -79059,8 +79186,8 @@ init_command();
|
|
|
79059
79186
|
init_packageManagers();
|
|
79060
79187
|
|
|
79061
79188
|
// src/helpers/retry.ts
|
|
79062
|
-
var retry = async (
|
|
79063
|
-
let { times } =
|
|
79189
|
+
var retry = async (config14, fn) => {
|
|
79190
|
+
let { times } = config14;
|
|
79064
79191
|
let error2 = null;
|
|
79065
79192
|
while (times > 0) {
|
|
79066
79193
|
try {
|
|
@@ -79068,7 +79195,7 @@ var retry = async (config13, fn) => {
|
|
|
79068
79195
|
} catch (e) {
|
|
79069
79196
|
error2 = e;
|
|
79070
79197
|
times--;
|
|
79071
|
-
if (
|
|
79198
|
+
if (config14.exitCondition?.(e)) {
|
|
79072
79199
|
break;
|
|
79073
79200
|
}
|
|
79074
79201
|
}
|
|
@@ -79257,23 +79384,23 @@ function secondsSince(start) {
|
|
|
79257
79384
|
|
|
79258
79385
|
// src/summary.ts
|
|
79259
79386
|
var printSummary = async (ctx) => {
|
|
79260
|
-
const { npm:
|
|
79387
|
+
const { npm: npm14 } = detectPackageManager();
|
|
79261
79388
|
const dirRelativePath = (0, import_path10.relative)(ctx.originalCWD, ctx.project.path);
|
|
79262
79389
|
const nextSteps = [
|
|
79263
79390
|
dirRelativePath ? ["Navigate to the new directory", `cd ${dirRelativePath}`] : [],
|
|
79264
79391
|
[
|
|
79265
79392
|
"Run the development server",
|
|
79266
|
-
quoteShellArgs([
|
|
79393
|
+
quoteShellArgs([npm14, "run", ctx.template.devScript ?? "start"])
|
|
79267
79394
|
],
|
|
79268
79395
|
...ctx.template.previewScript ? [
|
|
79269
79396
|
[
|
|
79270
79397
|
"Preview your application",
|
|
79271
|
-
quoteShellArgs([
|
|
79398
|
+
quoteShellArgs([npm14, "run", ctx.template.previewScript])
|
|
79272
79399
|
]
|
|
79273
79400
|
] : [],
|
|
79274
79401
|
[
|
|
79275
79402
|
"Deploy your application",
|
|
79276
|
-
quoteShellArgs([
|
|
79403
|
+
quoteShellArgs([npm14, "run", ctx.template.deployScript ?? "deploy"])
|
|
79277
79404
|
],
|
|
79278
79405
|
[
|
|
79279
79406
|
"Read the documentation",
|
|
@@ -79295,7 +79422,7 @@ var printSummary = async (ctx) => {
|
|
|
79295
79422
|
`${bgGreen(" APPLICATION CREATED ")}`,
|
|
79296
79423
|
`${dim("Deploy your application with")}`,
|
|
79297
79424
|
`${blue(
|
|
79298
|
-
quoteShellArgs([
|
|
79425
|
+
quoteShellArgs([npm14, "run", ctx.template.deployScript ?? "deploy"])
|
|
79299
79426
|
)}`
|
|
79300
79427
|
].join(" ");
|
|
79301
79428
|
logRaw(msg);
|
|
@@ -80639,14 +80766,14 @@ function applyEdits(text, edits) {
|
|
|
80639
80766
|
|
|
80640
80767
|
// src/workers.ts
|
|
80641
80768
|
async function installWorkersTypes(ctx) {
|
|
80642
|
-
const { npm:
|
|
80769
|
+
const { npm: npm14 } = detectPackageManager();
|
|
80643
80770
|
if (!usesTypescript(ctx)) {
|
|
80644
80771
|
return;
|
|
80645
80772
|
}
|
|
80646
80773
|
await installPackages(["@cloudflare/workers-types"], {
|
|
80647
80774
|
dev: true,
|
|
80648
80775
|
startText: "Installing @cloudflare/workers-types",
|
|
80649
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
80776
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm14}`)}`
|
|
80650
80777
|
});
|
|
80651
80778
|
await addWorkersTypesToTsConfig(ctx);
|
|
80652
80779
|
}
|
|
@@ -80669,8 +80796,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
80669
80796
|
}
|
|
80670
80797
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
80671
80798
|
try {
|
|
80672
|
-
const
|
|
80673
|
-
const currentTypes =
|
|
80799
|
+
const config14 = parse3(tsconfig);
|
|
80800
|
+
const currentTypes = config14.compilerOptions?.types ?? [];
|
|
80674
80801
|
const explicitEntrypoint = currentTypes.some(
|
|
80675
80802
|
(t) => t.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
80676
80803
|
);
|
|
@@ -80700,7 +80827,7 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
80700
80827
|
}
|
|
80701
80828
|
|
|
80702
80829
|
// src/cli.ts
|
|
80703
|
-
var { npm:
|
|
80830
|
+
var { npm: npm13 } = detectPackageManager();
|
|
80704
80831
|
var main = async (argv) => {
|
|
80705
80832
|
const args = await parseArgs(argv);
|
|
80706
80833
|
logRaw("");
|
|
@@ -80712,10 +80839,10 @@ var main = async (argv) => {
|
|
|
80712
80839
|
};
|
|
80713
80840
|
var runLatest = async () => {
|
|
80714
80841
|
const args = process.argv.slice(2);
|
|
80715
|
-
if (
|
|
80842
|
+
if (npm13 === "npm") {
|
|
80716
80843
|
args.unshift("--");
|
|
80717
80844
|
}
|
|
80718
|
-
await runCommand([
|
|
80845
|
+
await runCommand([npm13, "create", "cloudflare@latest", ...args]);
|
|
80719
80846
|
};
|
|
80720
80847
|
var runCli = async (args) => {
|
|
80721
80848
|
printBanner();
|
|
@@ -80760,7 +80887,7 @@ var setupProjectDirectory = (args) => {
|
|
|
80760
80887
|
};
|
|
80761
80888
|
var runTemplate = async (ctx) => {
|
|
80762
80889
|
await create(ctx);
|
|
80763
|
-
await
|
|
80890
|
+
await configure10(ctx);
|
|
80764
80891
|
await deploy(ctx);
|
|
80765
80892
|
await printSummary(ctx);
|
|
80766
80893
|
};
|
|
@@ -80776,7 +80903,7 @@ var create = async (ctx) => {
|
|
|
80776
80903
|
await rectifyPmMismatch(ctx);
|
|
80777
80904
|
endSection(`Application created`);
|
|
80778
80905
|
};
|
|
80779
|
-
var
|
|
80906
|
+
var configure10 = async (ctx) => {
|
|
80780
80907
|
startSection("Configuring your application for Cloudflare", "Step 2 of 3");
|
|
80781
80908
|
await installWrangler();
|
|
80782
80909
|
await installWorkersTypes(ctx);
|