create-cloudflare 2.33.2 → 2.33.4
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 +371 -356
- package/package.json +4 -4
- package/templates/hello-world/js/package.json +1 -1
- package/templates/hello-world/ts/package.json +1 -1
- package/templates/svelte/c3.ts +30 -0
- package/templates-experimental/hello-world-with-assets/js/package.json +1 -1
- package/templates-experimental/hello-world-with-assets/ts/package.json +1 -1
- package/templates-experimental/nuxt/c3.ts +1 -1
- package/templates-experimental/nuxt/templates/wrangler.toml +2 -2
- package/templates-experimental/solid/c3.ts +7 -50
- package/templates-experimental/solid/templates/wrangler.toml +2 -2
- package/templates-experimental/vue/c3.ts +33 -0
- package/templates-experimental/vue/templates/wrangler.toml +10 -0
- package/templates-experimental/nuxt/templates/cloudflare-preset/nitro.config.ts +0 -27
package/dist/cli.js
CHANGED
|
@@ -558,7 +558,7 @@ var require_XDGAppPaths = __commonJS({
|
|
|
558
558
|
XDGAppPaths.cache = function cache(dirOptions) {
|
|
559
559
|
return path6.join(xdg.cache(), finalPathSegment(dirOptions));
|
|
560
560
|
};
|
|
561
|
-
XDGAppPaths.config = function
|
|
561
|
+
XDGAppPaths.config = function config27(dirOptions) {
|
|
562
562
|
return path6.join(xdg.config(), finalPathSegment(dirOptions));
|
|
563
563
|
};
|
|
564
564
|
XDGAppPaths.data = function data(dirOptions) {
|
|
@@ -615,7 +615,7 @@ var require_XDG = __commonJS({
|
|
|
615
615
|
var cache = function() {
|
|
616
616
|
return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
|
|
617
617
|
};
|
|
618
|
-
var
|
|
618
|
+
var config27 = function() {
|
|
619
619
|
return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
|
|
620
620
|
};
|
|
621
621
|
var data = function() {
|
|
@@ -627,13 +627,13 @@ var require_XDG = __commonJS({
|
|
|
627
627
|
var state = function() {
|
|
628
628
|
return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
|
|
629
629
|
};
|
|
630
|
-
return { cache, config:
|
|
630
|
+
return { cache, config: config27, data, runtime, state };
|
|
631
631
|
};
|
|
632
632
|
var macos = function() {
|
|
633
633
|
var cache = function() {
|
|
634
634
|
return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
|
|
635
635
|
};
|
|
636
|
-
var
|
|
636
|
+
var config27 = function() {
|
|
637
637
|
return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
|
|
638
638
|
};
|
|
639
639
|
var data = function() {
|
|
@@ -645,7 +645,7 @@ var require_XDG = __commonJS({
|
|
|
645
645
|
var state = function() {
|
|
646
646
|
return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
|
|
647
647
|
};
|
|
648
|
-
return { cache, config:
|
|
648
|
+
return { cache, config: config27, data, runtime, state };
|
|
649
649
|
};
|
|
650
650
|
var windows = function() {
|
|
651
651
|
function appData() {
|
|
@@ -657,7 +657,7 @@ var require_XDG = __commonJS({
|
|
|
657
657
|
var cache = function() {
|
|
658
658
|
return valOrPath(env3.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
|
|
659
659
|
};
|
|
660
|
-
var
|
|
660
|
+
var config27 = function() {
|
|
661
661
|
return valOrPath(env3.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
|
|
662
662
|
};
|
|
663
663
|
var data = function() {
|
|
@@ -669,7 +669,7 @@ var require_XDG = __commonJS({
|
|
|
669
669
|
var state = function() {
|
|
670
670
|
return valOrPath(env3.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
|
|
671
671
|
};
|
|
672
|
-
return { cache, config:
|
|
672
|
+
return { cache, config: config27, data, runtime, state };
|
|
673
673
|
};
|
|
674
674
|
var XDG_ = function() {
|
|
675
675
|
function XDG_2() {
|
|
@@ -32170,22 +32170,22 @@ var require_dist_web = __commonJS({
|
|
|
32170
32170
|
_createClass(Haikunator3, [{
|
|
32171
32171
|
key: "haikunate",
|
|
32172
32172
|
value: function haikunate(options) {
|
|
32173
|
-
var
|
|
32174
|
-
if (
|
|
32175
|
-
|
|
32173
|
+
var config27 = (0, _lodash["default"])(options, this.config);
|
|
32174
|
+
if (config27.tokenHex === true) {
|
|
32175
|
+
config27.tokenChars = "0123456789abcdef";
|
|
32176
32176
|
}
|
|
32177
32177
|
var adjective = this._randomElement(this.adjectives);
|
|
32178
32178
|
var noun = this._randomElement(this.nouns);
|
|
32179
|
-
if (!
|
|
32180
|
-
|
|
32179
|
+
if (!config27.tokenLength)
|
|
32180
|
+
config27.tokenLength = 0;
|
|
32181
32181
|
var token = "";
|
|
32182
|
-
for (var i = 0; i <
|
|
32183
|
-
token += this._randomElement(
|
|
32182
|
+
for (var i = 0; i < config27.tokenLength; i++) {
|
|
32183
|
+
token += this._randomElement(config27.tokenChars);
|
|
32184
32184
|
}
|
|
32185
32185
|
var sections = [adjective, noun, token];
|
|
32186
32186
|
return sections.filter(function(e) {
|
|
32187
32187
|
return !!e;
|
|
32188
|
-
}).join(
|
|
32188
|
+
}).join(config27.delimiter);
|
|
32189
32189
|
}
|
|
32190
32190
|
/**
|
|
32191
32191
|
* Get a random element from an array/string
|
|
@@ -46608,13 +46608,13 @@ var require_esprima2 = __commonJS({
|
|
|
46608
46608
|
return Reader2;
|
|
46609
46609
|
}();
|
|
46610
46610
|
var Tokenizer = function() {
|
|
46611
|
-
function Tokenizer2(code,
|
|
46611
|
+
function Tokenizer2(code, config27) {
|
|
46612
46612
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
46613
|
-
this.errorHandler.tolerant =
|
|
46613
|
+
this.errorHandler.tolerant = config27 ? typeof config27.tolerant === "boolean" && config27.tolerant : false;
|
|
46614
46614
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
46615
|
-
this.scanner.trackComment =
|
|
46616
|
-
this.trackRange =
|
|
46617
|
-
this.trackLoc =
|
|
46615
|
+
this.scanner.trackComment = config27 ? typeof config27.comment === "boolean" && config27.comment : false;
|
|
46616
|
+
this.trackRange = config27 ? typeof config27.range === "boolean" && config27.range : false;
|
|
46617
|
+
this.trackLoc = config27 ? typeof config27.loc === "boolean" && config27.loc : false;
|
|
46618
46618
|
this.buffer = [];
|
|
46619
46619
|
this.reader = new Reader();
|
|
46620
46620
|
}
|
|
@@ -48807,11 +48807,11 @@ var require_printer = __commonJS({
|
|
|
48807
48807
|
return this.code;
|
|
48808
48808
|
};
|
|
48809
48809
|
var emptyPrintResult = new PrintResult("");
|
|
48810
|
-
var Printer = function Printer2(
|
|
48810
|
+
var Printer = function Printer2(config27) {
|
|
48811
48811
|
assert_1.default.ok(this instanceof Printer2);
|
|
48812
|
-
var explicitTabWidth =
|
|
48813
|
-
|
|
48814
|
-
|
|
48812
|
+
var explicitTabWidth = config27 && config27.tabWidth;
|
|
48813
|
+
config27 = options_1.normalize(config27);
|
|
48814
|
+
config27.sourceFileName = null;
|
|
48815
48815
|
function makePrintFunctionWith(options, overrides) {
|
|
48816
48816
|
options = Object.assign({}, options, overrides);
|
|
48817
48817
|
return function(path6) {
|
|
@@ -48826,11 +48826,11 @@ var require_printer = __commonJS({
|
|
|
48826
48826
|
includeComments: false
|
|
48827
48827
|
}));
|
|
48828
48828
|
}
|
|
48829
|
-
var oldTabWidth =
|
|
48829
|
+
var oldTabWidth = config27.tabWidth;
|
|
48830
48830
|
if (!explicitTabWidth) {
|
|
48831
48831
|
var loc = path6.getNode().loc;
|
|
48832
48832
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
48833
|
-
|
|
48833
|
+
config27.tabWidth = loc.lines.guessTabWidth();
|
|
48834
48834
|
}
|
|
48835
48835
|
}
|
|
48836
48836
|
var reprinter = patcher_1.getReprinter(path6);
|
|
@@ -48844,11 +48844,11 @@ var require_printer = __commonJS({
|
|
|
48844
48844
|
// right choice because it gives us the opportunity to reprint
|
|
48845
48845
|
// such nodes using their original source.
|
|
48846
48846
|
reprinter(print2)
|
|
48847
|
-
) : genericPrint(path6,
|
|
48847
|
+
) : genericPrint(path6, config27, options, makePrintFunctionWith(options, {
|
|
48848
48848
|
includeComments: true,
|
|
48849
48849
|
avoidRootParens: false
|
|
48850
48850
|
}));
|
|
48851
|
-
|
|
48851
|
+
config27.tabWidth = oldTabWidth;
|
|
48852
48852
|
return lines;
|
|
48853
48853
|
}
|
|
48854
48854
|
this.print = function(ast) {
|
|
@@ -48859,7 +48859,7 @@ var require_printer = __commonJS({
|
|
|
48859
48859
|
includeComments: true,
|
|
48860
48860
|
avoidRootParens: false
|
|
48861
48861
|
});
|
|
48862
|
-
return new PrintResult(lines.toString(
|
|
48862
|
+
return new PrintResult(lines.toString(config27), util.composeSourceMaps(config27.inputSourceMap, lines.getSourceMap(config27.sourceMapName, config27.sourceRoot)));
|
|
48863
48863
|
};
|
|
48864
48864
|
this.printGenerically = function(ast) {
|
|
48865
48865
|
if (!ast) {
|
|
@@ -48867,26 +48867,26 @@ var require_printer = __commonJS({
|
|
|
48867
48867
|
}
|
|
48868
48868
|
function printGenerically(path7) {
|
|
48869
48869
|
return comments_1.printComments(path7, function(path8) {
|
|
48870
|
-
return genericPrint(path8,
|
|
48870
|
+
return genericPrint(path8, config27, {
|
|
48871
48871
|
includeComments: true,
|
|
48872
48872
|
avoidRootParens: false
|
|
48873
48873
|
}, printGenerically);
|
|
48874
48874
|
});
|
|
48875
48875
|
}
|
|
48876
48876
|
var path6 = fast_path_1.default.from(ast);
|
|
48877
|
-
var oldReuseWhitespace =
|
|
48878
|
-
|
|
48879
|
-
var pr = new PrintResult(printGenerically(path6).toString(
|
|
48880
|
-
|
|
48877
|
+
var oldReuseWhitespace = config27.reuseWhitespace;
|
|
48878
|
+
config27.reuseWhitespace = false;
|
|
48879
|
+
var pr = new PrintResult(printGenerically(path6).toString(config27));
|
|
48880
|
+
config27.reuseWhitespace = oldReuseWhitespace;
|
|
48881
48881
|
return pr;
|
|
48882
48882
|
};
|
|
48883
48883
|
};
|
|
48884
48884
|
exports2.Printer = Printer;
|
|
48885
|
-
function genericPrint(path6,
|
|
48885
|
+
function genericPrint(path6, config27, options, printPath) {
|
|
48886
48886
|
assert_1.default.ok(path6 instanceof fast_path_1.default);
|
|
48887
48887
|
var node = path6.getValue();
|
|
48888
48888
|
var parts = [];
|
|
48889
|
-
var linesWithoutParens = genericPrintNoParens(path6,
|
|
48889
|
+
var linesWithoutParens = genericPrintNoParens(path6, config27, printPath);
|
|
48890
48890
|
if (!node || linesWithoutParens.isEmpty()) {
|
|
48891
48891
|
return linesWithoutParens;
|
|
48892
48892
|
}
|
|
@@ -68538,33 +68538,33 @@ var inputPrompt = async (promptConfig) => {
|
|
|
68538
68538
|
}
|
|
68539
68539
|
return input;
|
|
68540
68540
|
};
|
|
68541
|
-
var renderSubmit = (
|
|
68542
|
-
const { question, label } =
|
|
68543
|
-
if (
|
|
68541
|
+
var renderSubmit = (config27, value) => {
|
|
68542
|
+
const { question, label } = config27;
|
|
68543
|
+
if (config27.type !== "confirm" && !value) {
|
|
68544
68544
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
68545
68545
|
}
|
|
68546
|
-
const content =
|
|
68546
|
+
const content = config27.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
|
|
68547
68547
|
return [`${leftT} ${question}`, content, `${grayBar}`];
|
|
68548
68548
|
};
|
|
68549
|
-
var getRenderers = (
|
|
68550
|
-
switch (
|
|
68549
|
+
var getRenderers = (config27) => {
|
|
68550
|
+
switch (config27.type) {
|
|
68551
68551
|
case "select":
|
|
68552
|
-
return getSelectRenderers(
|
|
68552
|
+
return getSelectRenderers(config27);
|
|
68553
68553
|
case "confirm":
|
|
68554
|
-
return getConfirmRenderers(
|
|
68554
|
+
return getConfirmRenderers(config27);
|
|
68555
68555
|
case "text":
|
|
68556
|
-
return getTextRenderers(
|
|
68556
|
+
return getTextRenderers(config27);
|
|
68557
68557
|
case "multiselect":
|
|
68558
|
-
return getSelectRenderers(
|
|
68558
|
+
return getSelectRenderers(config27);
|
|
68559
68559
|
case "list":
|
|
68560
|
-
return getSelectListRenderers(
|
|
68560
|
+
return getSelectListRenderers(config27);
|
|
68561
68561
|
}
|
|
68562
68562
|
};
|
|
68563
|
-
var getTextRenderers = (
|
|
68564
|
-
const { question } =
|
|
68565
|
-
const helpText =
|
|
68566
|
-
const format5 =
|
|
68567
|
-
const defaultValue =
|
|
68563
|
+
var getTextRenderers = (config27) => {
|
|
68564
|
+
const { question } = config27;
|
|
68565
|
+
const helpText = config27.helpText ?? "";
|
|
68566
|
+
const format5 = config27.format ?? ((val) => String(val));
|
|
68567
|
+
const defaultValue = config27.defaultValue?.toString() ?? "";
|
|
68568
68568
|
const activeRenderer = ({ value }) => [
|
|
68569
68569
|
`${blCorner} ${bold(question)} ${dim(helpText)}`,
|
|
68570
68570
|
`${space(2)}${format5(value || dim(defaultValue))}`,
|
|
@@ -68587,14 +68587,14 @@ var getTextRenderers = (config26) => {
|
|
|
68587
68587
|
``
|
|
68588
68588
|
// extra line for readability
|
|
68589
68589
|
],
|
|
68590
|
-
submit: ({ value }) => renderSubmit(
|
|
68590
|
+
submit: ({ value }) => renderSubmit(config27, format5(value ?? "")),
|
|
68591
68591
|
cancel: activeRenderer
|
|
68592
68592
|
};
|
|
68593
68593
|
};
|
|
68594
|
-
var getSelectRenderers = (
|
|
68595
|
-
const { options, question, helpText: _helpText } =
|
|
68594
|
+
var getSelectRenderers = (config27) => {
|
|
68595
|
+
const { options, question, helpText: _helpText } = config27;
|
|
68596
68596
|
const helpText = _helpText ?? "";
|
|
68597
|
-
const maxItemsPerPage =
|
|
68597
|
+
const maxItemsPerPage = config27.maxItemsPerPage ?? 32;
|
|
68598
68598
|
const defaultRenderer = ({ cursor = 0, value }) => {
|
|
68599
68599
|
const renderOption = (opt, i) => {
|
|
68600
68600
|
const { label: optionLabel, value: optionValue } = opt;
|
|
@@ -68669,21 +68669,21 @@ ${space(2)}${dim("...")}` : ""}`,
|
|
|
68669
68669
|
submit: ({ value }) => {
|
|
68670
68670
|
if (Array.isArray(value)) {
|
|
68671
68671
|
return renderSubmit(
|
|
68672
|
-
|
|
68672
|
+
config27,
|
|
68673
68673
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
68674
68674
|
);
|
|
68675
68675
|
}
|
|
68676
68676
|
return renderSubmit(
|
|
68677
|
-
|
|
68677
|
+
config27,
|
|
68678
68678
|
options.find((o) => o.value === value)?.label
|
|
68679
68679
|
);
|
|
68680
68680
|
},
|
|
68681
68681
|
cancel: defaultRenderer
|
|
68682
68682
|
};
|
|
68683
68683
|
};
|
|
68684
|
-
var getSelectListRenderers = (
|
|
68685
|
-
const { question, helpText: _helpText } =
|
|
68686
|
-
let options =
|
|
68684
|
+
var getSelectListRenderers = (config27) => {
|
|
68685
|
+
const { question, helpText: _helpText } = config27;
|
|
68686
|
+
let options = config27.options;
|
|
68687
68687
|
const helpText = _helpText ?? "";
|
|
68688
68688
|
const { rows } = stdout;
|
|
68689
68689
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -68764,20 +68764,20 @@ var getSelectListRenderers = (config26) => {
|
|
|
68764
68764
|
submit: ({ value }) => {
|
|
68765
68765
|
if (Array.isArray(value)) {
|
|
68766
68766
|
return renderSubmit(
|
|
68767
|
-
|
|
68767
|
+
config27,
|
|
68768
68768
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
68769
68769
|
);
|
|
68770
68770
|
}
|
|
68771
68771
|
return renderSubmit(
|
|
68772
|
-
|
|
68772
|
+
config27,
|
|
68773
68773
|
options.find((o) => o.value === value)?.value
|
|
68774
68774
|
);
|
|
68775
68775
|
},
|
|
68776
68776
|
cancel: defaultRenderer
|
|
68777
68777
|
};
|
|
68778
68778
|
};
|
|
68779
|
-
var getConfirmRenderers = (
|
|
68780
|
-
const { activeText, inactiveText, question, helpText: _helpText } =
|
|
68779
|
+
var getConfirmRenderers = (config27) => {
|
|
68780
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config27;
|
|
68781
68781
|
const helpText = _helpText ?? "";
|
|
68782
68782
|
const active = activeText || "Yes";
|
|
68783
68783
|
const inactive = inactiveText || "No";
|
|
@@ -68794,7 +68794,7 @@ var getConfirmRenderers = (config26) => {
|
|
|
68794
68794
|
active: defaultRenderer,
|
|
68795
68795
|
confirm: defaultRenderer,
|
|
68796
68796
|
error: defaultRenderer,
|
|
68797
|
-
submit: ({ value }) => renderSubmit(
|
|
68797
|
+
submit: ({ value }) => renderSubmit(config27, value ? "yes" : "no"),
|
|
68798
68798
|
cancel: defaultRenderer
|
|
68799
68799
|
};
|
|
68800
68800
|
};
|
|
@@ -69764,23 +69764,23 @@ var YargsParser = class {
|
|
|
69764
69764
|
const configPath = argv2[configKey] || configLookup[configKey];
|
|
69765
69765
|
if (configPath) {
|
|
69766
69766
|
try {
|
|
69767
|
-
let
|
|
69767
|
+
let config27 = null;
|
|
69768
69768
|
const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
|
|
69769
69769
|
const resolveConfig = flags.configs[configKey];
|
|
69770
69770
|
if (typeof resolveConfig === "function") {
|
|
69771
69771
|
try {
|
|
69772
|
-
|
|
69772
|
+
config27 = resolveConfig(resolvedConfigPath);
|
|
69773
69773
|
} catch (e) {
|
|
69774
|
-
|
|
69774
|
+
config27 = e;
|
|
69775
69775
|
}
|
|
69776
|
-
if (
|
|
69777
|
-
error2 =
|
|
69776
|
+
if (config27 instanceof Error) {
|
|
69777
|
+
error2 = config27;
|
|
69778
69778
|
return;
|
|
69779
69779
|
}
|
|
69780
69780
|
} else {
|
|
69781
|
-
|
|
69781
|
+
config27 = mixin2.require(resolvedConfigPath);
|
|
69782
69782
|
}
|
|
69783
|
-
setConfigObject(
|
|
69783
|
+
setConfigObject(config27);
|
|
69784
69784
|
} catch (ex) {
|
|
69785
69785
|
if (ex.name === "PermissionDenied")
|
|
69786
69786
|
error2 = ex;
|
|
@@ -69790,9 +69790,9 @@ var YargsParser = class {
|
|
|
69790
69790
|
}
|
|
69791
69791
|
});
|
|
69792
69792
|
}
|
|
69793
|
-
function setConfigObject(
|
|
69794
|
-
Object.keys(
|
|
69795
|
-
const value =
|
|
69793
|
+
function setConfigObject(config27, prev) {
|
|
69794
|
+
Object.keys(config27).forEach(function(key) {
|
|
69795
|
+
const value = config27[key];
|
|
69796
69796
|
const fullKey = prev ? prev + "." + key : key;
|
|
69797
69797
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
|
|
69798
69798
|
setConfigObject(value, fullKey);
|
|
@@ -70944,11 +70944,11 @@ var CommandInstance = class {
|
|
|
70944
70944
|
});
|
|
70945
70945
|
if (!unparsed.length)
|
|
70946
70946
|
return;
|
|
70947
|
-
const
|
|
70947
|
+
const config27 = Object.assign({}, options.configuration, {
|
|
70948
70948
|
"populate--": false
|
|
70949
70949
|
});
|
|
70950
70950
|
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
|
|
70951
|
-
configuration:
|
|
70951
|
+
configuration: config27
|
|
70952
70952
|
}));
|
|
70953
70953
|
if (parsed.error) {
|
|
70954
70954
|
yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
|
|
@@ -72171,31 +72171,31 @@ ${customMsgs.join("\n")}` : "";
|
|
|
72171
72171
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
|
|
72172
72172
|
var previouslyVisitedConfigs = [];
|
|
72173
72173
|
var shim2;
|
|
72174
|
-
function applyExtends(
|
|
72174
|
+
function applyExtends(config27, cwd, mergeExtends, _shim) {
|
|
72175
72175
|
shim2 = _shim;
|
|
72176
72176
|
let defaultConfig = {};
|
|
72177
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
72178
|
-
if (typeof
|
|
72177
|
+
if (Object.prototype.hasOwnProperty.call(config27, "extends")) {
|
|
72178
|
+
if (typeof config27.extends !== "string")
|
|
72179
72179
|
return defaultConfig;
|
|
72180
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
72180
|
+
const isPath = /\.json|\..*rc$/.test(config27.extends);
|
|
72181
72181
|
let pathToDefault = null;
|
|
72182
72182
|
if (!isPath) {
|
|
72183
72183
|
try {
|
|
72184
|
-
pathToDefault = require.resolve(
|
|
72184
|
+
pathToDefault = require.resolve(config27.extends);
|
|
72185
72185
|
} catch (_err) {
|
|
72186
|
-
return
|
|
72186
|
+
return config27;
|
|
72187
72187
|
}
|
|
72188
72188
|
} else {
|
|
72189
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
72189
|
+
pathToDefault = getPathToDefaultConfig(cwd, config27.extends);
|
|
72190
72190
|
}
|
|
72191
72191
|
checkForCircularExtends(pathToDefault);
|
|
72192
72192
|
previouslyVisitedConfigs.push(pathToDefault);
|
|
72193
|
-
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(
|
|
72194
|
-
delete
|
|
72193
|
+
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config27.extends);
|
|
72194
|
+
delete config27.extends;
|
|
72195
72195
|
defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
|
|
72196
72196
|
}
|
|
72197
72197
|
previouslyVisitedConfigs = [];
|
|
72198
|
-
return mergeExtends ? mergeDeep(defaultConfig,
|
|
72198
|
+
return mergeExtends ? mergeDeep(defaultConfig, config27) : Object.assign({}, defaultConfig, config27);
|
|
72199
72199
|
}
|
|
72200
72200
|
function checkForCircularExtends(cfgPath) {
|
|
72201
72201
|
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
|
@@ -72205,17 +72205,17 @@ function checkForCircularExtends(cfgPath) {
|
|
|
72205
72205
|
function getPathToDefaultConfig(cwd, pathToExtend) {
|
|
72206
72206
|
return shim2.path.resolve(cwd, pathToExtend);
|
|
72207
72207
|
}
|
|
72208
|
-
function mergeDeep(config1,
|
|
72208
|
+
function mergeDeep(config1, config27) {
|
|
72209
72209
|
const target = {};
|
|
72210
72210
|
function isObject2(obj) {
|
|
72211
72211
|
return obj && typeof obj === "object" && !Array.isArray(obj);
|
|
72212
72212
|
}
|
|
72213
72213
|
Object.assign(target, config1);
|
|
72214
|
-
for (const key of Object.keys(
|
|
72215
|
-
if (isObject2(
|
|
72216
|
-
target[key] = mergeDeep(config1[key],
|
|
72214
|
+
for (const key of Object.keys(config27)) {
|
|
72215
|
+
if (isObject2(config27[key]) && isObject2(target[key])) {
|
|
72216
|
+
target[key] = mergeDeep(config1[key], config27[key]);
|
|
72217
72217
|
} else {
|
|
72218
|
-
target[key] =
|
|
72218
|
+
target[key] = config27[key];
|
|
72219
72219
|
}
|
|
72220
72220
|
}
|
|
72221
72221
|
return target;
|
|
@@ -72976,9 +72976,9 @@ var YargsInstance = class {
|
|
|
72976
72976
|
}
|
|
72977
72977
|
return maybePromise;
|
|
72978
72978
|
}
|
|
72979
|
-
parserConfiguration(
|
|
72980
|
-
argsert("<object>", [
|
|
72981
|
-
__classPrivateFieldSet(this, _YargsInstance_parserConfig,
|
|
72979
|
+
parserConfiguration(config27) {
|
|
72980
|
+
argsert("<object>", [config27], arguments.length);
|
|
72981
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config27, "f");
|
|
72982
72982
|
return this;
|
|
72983
72983
|
}
|
|
72984
72984
|
pkgConf(key, rootPath) {
|
|
@@ -73150,9 +73150,9 @@ var YargsInstance = class {
|
|
|
73150
73150
|
return this;
|
|
73151
73151
|
}
|
|
73152
73152
|
}
|
|
73153
|
-
usageConfiguration(
|
|
73154
|
-
argsert("<object>", [
|
|
73155
|
-
__classPrivateFieldSet(this, _YargsInstance_usageConfig,
|
|
73153
|
+
usageConfiguration(config27) {
|
|
73154
|
+
argsert("<object>", [config27], arguments.length);
|
|
73155
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config27, "f");
|
|
73156
73156
|
return this;
|
|
73157
73157
|
}
|
|
73158
73158
|
version(opt, msg, ver) {
|
|
@@ -73558,11 +73558,11 @@ var YargsInstance = class {
|
|
|
73558
73558
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
|
|
73559
73559
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
|
|
73560
73560
|
const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
|
|
73561
|
-
const
|
|
73561
|
+
const config27 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
|
|
73562
73562
|
"populate--": true
|
|
73563
73563
|
});
|
|
73564
73564
|
const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
|
|
73565
|
-
configuration: { "parse-positional-numbers": false, ...
|
|
73565
|
+
configuration: { "parse-positional-numbers": false, ...config27 }
|
|
73566
73566
|
}));
|
|
73567
73567
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
73568
73568
|
let argvPromise = void 0;
|
|
@@ -73725,7 +73725,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
73725
73725
|
var yargs_default = Yargs;
|
|
73726
73726
|
|
|
73727
73727
|
// package.json
|
|
73728
|
-
var version = "2.33.
|
|
73728
|
+
var version = "2.33.4";
|
|
73729
73729
|
|
|
73730
73730
|
// src/metrics.ts
|
|
73731
73731
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -73769,12 +73769,12 @@ function getGlobalWranglerConfigPath() {
|
|
|
73769
73769
|
}
|
|
73770
73770
|
|
|
73771
73771
|
// src/helpers/metrics-config.ts
|
|
73772
|
-
function writeMetricsConfig(
|
|
73772
|
+
function writeMetricsConfig(config27) {
|
|
73773
73773
|
(0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
|
|
73774
73774
|
(0, import_node_fs2.writeFileSync)(
|
|
73775
73775
|
getMetricsConfigPath(),
|
|
73776
73776
|
JSON.stringify(
|
|
73777
|
-
|
|
73777
|
+
config27,
|
|
73778
73778
|
(_key, value) => value instanceof Date ? value.toISOString() : value,
|
|
73779
73779
|
" "
|
|
73780
73780
|
)
|
|
@@ -73782,9 +73782,9 @@ function writeMetricsConfig(config26) {
|
|
|
73782
73782
|
}
|
|
73783
73783
|
function readMetricsConfig() {
|
|
73784
73784
|
try {
|
|
73785
|
-
const
|
|
73785
|
+
const config27 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
73786
73786
|
return JSON.parse(
|
|
73787
|
-
|
|
73787
|
+
config27,
|
|
73788
73788
|
(key, value) => key === "date" ? new Date(value) : value
|
|
73789
73789
|
);
|
|
73790
73790
|
} catch {
|
|
@@ -73794,10 +73794,10 @@ function readMetricsConfig() {
|
|
|
73794
73794
|
function getMetricsConfigPath() {
|
|
73795
73795
|
return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
|
|
73796
73796
|
}
|
|
73797
|
-
function getDeviceId(
|
|
73798
|
-
const deviceId =
|
|
73799
|
-
if (
|
|
73800
|
-
writeMetricsConfig({ ...
|
|
73797
|
+
function getDeviceId(config27) {
|
|
73798
|
+
const deviceId = config27.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
73799
|
+
if (config27.deviceId === void 0) {
|
|
73800
|
+
writeMetricsConfig({ ...config27, deviceId });
|
|
73801
73801
|
}
|
|
73802
73802
|
return deviceId;
|
|
73803
73803
|
}
|
|
@@ -73817,6 +73817,13 @@ var runCommand = async (command2, opts = {}) => {
|
|
|
73817
73817
|
doneText: opts.doneText,
|
|
73818
73818
|
promise() {
|
|
73819
73819
|
const [executable, ...args] = command2;
|
|
73820
|
+
if (args[0] === "wrangler") {
|
|
73821
|
+
const metrics = readMetricsConfig();
|
|
73822
|
+
if (metrics.c3permission?.enabled === false) {
|
|
73823
|
+
opts.env ??= {};
|
|
73824
|
+
opts.env["WRANGLER_SEND_METRICS"] = "false";
|
|
73825
|
+
}
|
|
73826
|
+
}
|
|
73820
73827
|
const abortController = new AbortController();
|
|
73821
73828
|
const cmd = (0, import_cross_spawn.spawn)(executable, [...args], {
|
|
73822
73829
|
// TODO: ideally inherit stderr, but npm install uses this for warnings
|
|
@@ -73975,7 +73982,7 @@ var detectPackageManager = () => {
|
|
|
73975
73982
|
}
|
|
73976
73983
|
};
|
|
73977
73984
|
var rectifyPmMismatch = async (ctx) => {
|
|
73978
|
-
const { npm:
|
|
73985
|
+
const { npm: npm23 } = detectPackageManager();
|
|
73979
73986
|
if (!detectPmMismatch(ctx)) {
|
|
73980
73987
|
return;
|
|
73981
73988
|
}
|
|
@@ -73987,17 +73994,17 @@ var rectifyPmMismatch = async (ctx) => {
|
|
|
73987
73994
|
if ((0, import_fs5.existsSync)(lockfilePath)) {
|
|
73988
73995
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
73989
73996
|
}
|
|
73990
|
-
await runCommand([
|
|
73997
|
+
await runCommand([npm23, "install"], {
|
|
73991
73998
|
silent: true,
|
|
73992
73999
|
cwd: ctx.project.path,
|
|
73993
74000
|
startText: "Installing dependencies",
|
|
73994
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
74001
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm23} install\``)}`
|
|
73995
74002
|
});
|
|
73996
74003
|
};
|
|
73997
74004
|
var detectPmMismatch = (ctx) => {
|
|
73998
|
-
const { npm:
|
|
74005
|
+
const { npm: npm23 } = detectPackageManager();
|
|
73999
74006
|
const projectPath = ctx.project.path;
|
|
74000
|
-
switch (
|
|
74007
|
+
switch (npm23) {
|
|
74001
74008
|
case "npm":
|
|
74002
74009
|
return false;
|
|
74003
74010
|
case "yarn":
|
|
@@ -74065,10 +74072,10 @@ function getPlatform() {
|
|
|
74065
74072
|
function createReporter() {
|
|
74066
74073
|
const events = [];
|
|
74067
74074
|
const als = new import_node_async_hooks.AsyncLocalStorage();
|
|
74068
|
-
const
|
|
74069
|
-
const isFirstUsage =
|
|
74075
|
+
const config27 = readMetricsConfig() ?? {};
|
|
74076
|
+
const isFirstUsage = config27.c3permission === void 0;
|
|
74070
74077
|
const isEnabled = isTelemetryEnabled();
|
|
74071
|
-
const deviceId = getDeviceId(
|
|
74078
|
+
const deviceId = getDeviceId(config27);
|
|
74072
74079
|
const packageManager = detectPackageManager();
|
|
74073
74080
|
const platform3 = getPlatform();
|
|
74074
74081
|
const amplitude_session_id = Date.now();
|
|
@@ -74101,7 +74108,7 @@ function createReporter() {
|
|
|
74101
74108
|
if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
|
|
74102
74109
|
return false;
|
|
74103
74110
|
}
|
|
74104
|
-
return hasSparrowSourceKey() && getC3Permission(
|
|
74111
|
+
return hasSparrowSourceKey() && getC3Permission(config27).enabled;
|
|
74105
74112
|
}
|
|
74106
74113
|
async function waitForAllEventsSettled() {
|
|
74107
74114
|
await Promise.allSettled(events);
|
|
@@ -74207,20 +74214,20 @@ function initializeC3Permission(enabled = true) {
|
|
|
74207
74214
|
date: /* @__PURE__ */ new Date()
|
|
74208
74215
|
};
|
|
74209
74216
|
}
|
|
74210
|
-
function getC3Permission(
|
|
74211
|
-
if (!
|
|
74212
|
-
|
|
74213
|
-
writeMetricsConfig(
|
|
74217
|
+
function getC3Permission(config27 = readMetricsConfig() ?? {}) {
|
|
74218
|
+
if (!config27.c3permission) {
|
|
74219
|
+
config27.c3permission = initializeC3Permission();
|
|
74220
|
+
writeMetricsConfig(config27);
|
|
74214
74221
|
}
|
|
74215
|
-
return
|
|
74222
|
+
return config27.c3permission;
|
|
74216
74223
|
}
|
|
74217
74224
|
function updateC3Pemission(enabled) {
|
|
74218
|
-
const
|
|
74219
|
-
if (
|
|
74225
|
+
const config27 = readMetricsConfig();
|
|
74226
|
+
if (config27.c3permission?.enabled === enabled) {
|
|
74220
74227
|
return;
|
|
74221
74228
|
}
|
|
74222
|
-
|
|
74223
|
-
writeMetricsConfig(
|
|
74229
|
+
config27.c3permission = initializeC3Permission(enabled);
|
|
74230
|
+
writeMetricsConfig(config27);
|
|
74224
74231
|
}
|
|
74225
74232
|
var runTelemetryCommand = (action) => {
|
|
74226
74233
|
const logTelemetryStatus = (enabled) => {
|
|
@@ -74265,28 +74272,28 @@ var import_haikunator = __toESM(require_dist_web());
|
|
|
74265
74272
|
var import_fs6 = require("fs");
|
|
74266
74273
|
var import_path6 = __toESM(require("path"));
|
|
74267
74274
|
var import_undici2 = __toESM(require_undici());
|
|
74268
|
-
var installPackages = async (packages,
|
|
74269
|
-
const { npm:
|
|
74275
|
+
var installPackages = async (packages, config27 = {}) => {
|
|
74276
|
+
const { npm: npm23 } = detectPackageManager();
|
|
74270
74277
|
let saveFlag;
|
|
74271
74278
|
let cmd;
|
|
74272
|
-
switch (
|
|
74279
|
+
switch (npm23) {
|
|
74273
74280
|
case "yarn":
|
|
74274
74281
|
cmd = "add";
|
|
74275
|
-
saveFlag =
|
|
74282
|
+
saveFlag = config27.dev ? "-D" : "";
|
|
74276
74283
|
break;
|
|
74277
74284
|
case "bun":
|
|
74278
74285
|
cmd = "add";
|
|
74279
|
-
saveFlag =
|
|
74286
|
+
saveFlag = config27.dev ? "-d" : "";
|
|
74280
74287
|
break;
|
|
74281
74288
|
case "npm":
|
|
74282
74289
|
case "pnpm":
|
|
74283
74290
|
default:
|
|
74284
74291
|
cmd = "install";
|
|
74285
|
-
saveFlag =
|
|
74292
|
+
saveFlag = config27.dev ? "--save-dev" : "";
|
|
74286
74293
|
break;
|
|
74287
74294
|
}
|
|
74288
|
-
await runCommand([
|
|
74289
|
-
...
|
|
74295
|
+
await runCommand([npm23, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
|
|
74296
|
+
...config27,
|
|
74290
74297
|
silent: true
|
|
74291
74298
|
});
|
|
74292
74299
|
};
|
|
@@ -74295,11 +74302,11 @@ var npmInstall = async (ctx) => {
|
|
|
74295
74302
|
if ((0, import_fs6.existsSync)(nodeModulesPath)) {
|
|
74296
74303
|
return;
|
|
74297
74304
|
}
|
|
74298
|
-
const { npm:
|
|
74299
|
-
await runCommand([
|
|
74305
|
+
const { npm: npm23 } = detectPackageManager();
|
|
74306
|
+
await runCommand([npm23, "install"], {
|
|
74300
74307
|
silent: true,
|
|
74301
74308
|
startText: "Installing dependencies",
|
|
74302
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
74309
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm23} install\``)}`
|
|
74303
74310
|
});
|
|
74304
74311
|
};
|
|
74305
74312
|
async function getLatestPackageVersion(packageSpecifier) {
|
|
@@ -74308,7 +74315,7 @@ async function getLatestPackageVersion(packageSpecifier) {
|
|
|
74308
74315
|
return npmInfo["dist-tags"].latest;
|
|
74309
74316
|
}
|
|
74310
74317
|
var installWrangler = async () => {
|
|
74311
|
-
const { npm:
|
|
74318
|
+
const { npm: npm23 } = detectPackageManager();
|
|
74312
74319
|
if ((0, import_fs6.existsSync)(import_path6.default.resolve("node_modules", "wrangler"))) {
|
|
74313
74320
|
return;
|
|
74314
74321
|
}
|
|
@@ -74318,7 +74325,7 @@ var installWrangler = async () => {
|
|
|
74318
74325
|
"A command line tool for building Cloudflare Workers"
|
|
74319
74326
|
)}`,
|
|
74320
74327
|
doneText: `${brandColor("installed")} ${dim(
|
|
74321
|
-
`via \`${
|
|
74328
|
+
`via \`${npm23} install wrangler --save-dev\``
|
|
74322
74329
|
)}`
|
|
74323
74330
|
});
|
|
74324
74331
|
};
|
|
@@ -74488,11 +74495,11 @@ var package_default = {
|
|
|
74488
74495
|
"create-next-app": "14.2.5",
|
|
74489
74496
|
"create-qwik": "1.11.0",
|
|
74490
74497
|
"create-vite": "5.5.5",
|
|
74491
|
-
"create-remix": "2.
|
|
74492
|
-
"create-solid": "0.5.
|
|
74498
|
+
"create-remix": "2.15.0",
|
|
74499
|
+
"create-solid": "0.5.14",
|
|
74493
74500
|
"create-vue": "3.12.1",
|
|
74494
74501
|
gatsby: "5.14.0",
|
|
74495
|
-
nuxi: "3.
|
|
74502
|
+
nuxi: "3.16.0",
|
|
74496
74503
|
sv: "0.6.1"
|
|
74497
74504
|
}
|
|
74498
74505
|
};
|
|
@@ -74508,9 +74515,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
|
|
|
74508
74515
|
};
|
|
74509
74516
|
var runFrameworkGenerator = async (ctx, args) => {
|
|
74510
74517
|
const cli = getFrameworkCli(ctx, true);
|
|
74511
|
-
const { npm:
|
|
74512
|
-
const cmd = [...
|
|
74513
|
-
const env3 =
|
|
74518
|
+
const { npm: npm23, dlx } = detectPackageManager();
|
|
74519
|
+
const cmd = [...npm23 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
74520
|
+
const env3 = npm23 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
|
|
74514
74521
|
if (ctx.args.additionalArgs?.length) {
|
|
74515
74522
|
cmd.push(...ctx.args.additionalArgs);
|
|
74516
74523
|
}
|
|
@@ -75081,7 +75088,7 @@ var updateNuxtConfig = () => {
|
|
|
75081
75088
|
b2.objectExpression([
|
|
75082
75089
|
b2.objectProperty(
|
|
75083
75090
|
b2.identifier("preset"),
|
|
75084
|
-
b2.stringLiteral("
|
|
75091
|
+
b2.stringLiteral("cloudflare_module")
|
|
75085
75092
|
)
|
|
75086
75093
|
])
|
|
75087
75094
|
);
|
|
@@ -75297,6 +75304,7 @@ var configure7 = async (ctx) => {
|
|
|
75297
75304
|
});
|
|
75298
75305
|
usesTypescript(ctx);
|
|
75299
75306
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
75307
|
+
const compatDate = await getWorkerdCompatibilityDate();
|
|
75300
75308
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
75301
75309
|
transformFile(filePath, {
|
|
75302
75310
|
visitCallExpression: function(n2) {
|
|
@@ -75311,60 +75319,14 @@ var configure7 = async (ctx) => {
|
|
|
75311
75319
|
b2.objectProperty(
|
|
75312
75320
|
b2.identifier("server"),
|
|
75313
75321
|
b2.objectExpression([
|
|
75314
|
-
// preset: "
|
|
75322
|
+
// preset: "cloudflare_module"
|
|
75315
75323
|
b2.objectProperty(
|
|
75316
75324
|
b2.identifier("preset"),
|
|
75317
|
-
b2.stringLiteral("
|
|
75318
|
-
),
|
|
75319
|
-
// output: {
|
|
75320
|
-
// dir: "{{ rootDir }}/dist",
|
|
75321
|
-
// publicDir: "{{ output.dir }}/public",
|
|
75322
|
-
// serverDir: "{{ output.dir }}/worker",
|
|
75323
|
-
// },
|
|
75324
|
-
b2.objectProperty(
|
|
75325
|
-
b2.identifier("output"),
|
|
75326
|
-
b2.objectExpression([
|
|
75327
|
-
b2.objectProperty(
|
|
75328
|
-
b2.identifier("dir"),
|
|
75329
|
-
b2.stringLiteral("{{ rootDir }}/dist")
|
|
75330
|
-
),
|
|
75331
|
-
b2.objectProperty(
|
|
75332
|
-
b2.identifier("publicDir"),
|
|
75333
|
-
b2.stringLiteral("{{ output.dir }}/public")
|
|
75334
|
-
),
|
|
75335
|
-
b2.objectProperty(
|
|
75336
|
-
b2.identifier("serverDir"),
|
|
75337
|
-
b2.stringLiteral("{{ output.dir }}/worker")
|
|
75338
|
-
)
|
|
75339
|
-
])
|
|
75325
|
+
b2.stringLiteral("cloudflare_module")
|
|
75340
75326
|
),
|
|
75341
|
-
// rollupConfig: {
|
|
75342
|
-
// external: ["node:async_hooks"],
|
|
75343
|
-
// },
|
|
75344
75327
|
b2.objectProperty(
|
|
75345
|
-
b2.identifier("
|
|
75346
|
-
b2.
|
|
75347
|
-
b2.objectProperty(
|
|
75348
|
-
b2.identifier("external"),
|
|
75349
|
-
b2.arrayExpression([b2.stringLiteral("node:async_hooks")])
|
|
75350
|
-
)
|
|
75351
|
-
])
|
|
75352
|
-
),
|
|
75353
|
-
// hooks: {
|
|
75354
|
-
// // Prevent the Pages preset from writing the _routes.json etc.
|
|
75355
|
-
// compiled() {},
|
|
75356
|
-
// },
|
|
75357
|
-
b2.objectProperty(
|
|
75358
|
-
b2.identifier("hooks"),
|
|
75359
|
-
b2.objectExpression([
|
|
75360
|
-
b2.objectMethod(
|
|
75361
|
-
"method",
|
|
75362
|
-
b2.identifier("compiled"),
|
|
75363
|
-
[],
|
|
75364
|
-
b2.blockStatement([]),
|
|
75365
|
-
false
|
|
75366
|
-
)
|
|
75367
|
-
])
|
|
75328
|
+
b2.identifier("compatibilityDate"),
|
|
75329
|
+
b2.stringLiteral(compatDate)
|
|
75368
75330
|
)
|
|
75369
75331
|
])
|
|
75370
75332
|
)
|
|
@@ -75501,10 +75463,38 @@ var config12 = {
|
|
|
75501
75463
|
};
|
|
75502
75464
|
var c3_default14 = config12;
|
|
75503
75465
|
|
|
75466
|
+
// templates-experimental/vue/c3.ts
|
|
75467
|
+
var { npm: npm9 } = detectPackageManager();
|
|
75468
|
+
var generate12 = async (ctx) => {
|
|
75469
|
+
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
75470
|
+
};
|
|
75471
|
+
var config13 = {
|
|
75472
|
+
configVersion: 1,
|
|
75473
|
+
id: "vue",
|
|
75474
|
+
frameworkCli: "create-vue",
|
|
75475
|
+
platform: "workers",
|
|
75476
|
+
displayName: "Vue",
|
|
75477
|
+
copyFiles: {
|
|
75478
|
+
path: "./templates"
|
|
75479
|
+
},
|
|
75480
|
+
path: "templates-experimental/vue",
|
|
75481
|
+
generate: generate12,
|
|
75482
|
+
transformPackageJson: async () => ({
|
|
75483
|
+
scripts: {
|
|
75484
|
+
deploy: `${npm9} run build && wrangler deploy`,
|
|
75485
|
+
preview: `${npm9} run build && wrangler dev`
|
|
75486
|
+
}
|
|
75487
|
+
}),
|
|
75488
|
+
devScript: "dev",
|
|
75489
|
+
deployScript: "deploy",
|
|
75490
|
+
previewScript: "preview"
|
|
75491
|
+
};
|
|
75492
|
+
var c3_default15 = config13;
|
|
75493
|
+
|
|
75504
75494
|
// templates/analog/c3.ts
|
|
75505
75495
|
var recast7 = __toESM(require_main3());
|
|
75506
|
-
var { npm:
|
|
75507
|
-
var
|
|
75496
|
+
var { npm: npm10, name: pm2 } = detectPackageManager();
|
|
75497
|
+
var generate13 = async (ctx) => {
|
|
75508
75498
|
await runFrameworkGenerator(ctx, [
|
|
75509
75499
|
ctx.project.name,
|
|
75510
75500
|
"--template",
|
|
@@ -75522,7 +75512,7 @@ var configure9 = async (ctx) => {
|
|
|
75522
75512
|
await installPackages(packages, {
|
|
75523
75513
|
dev: true,
|
|
75524
75514
|
startText: `Installing ${packages.join(", ")}`,
|
|
75525
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75515
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
75526
75516
|
});
|
|
75527
75517
|
}
|
|
75528
75518
|
updateViteConfig(ctx);
|
|
@@ -75580,7 +75570,7 @@ var updateViteConfig = (ctx) => {
|
|
|
75580
75570
|
});
|
|
75581
75571
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75582
75572
|
};
|
|
75583
|
-
var
|
|
75573
|
+
var config14 = {
|
|
75584
75574
|
configVersion: 1,
|
|
75585
75575
|
id: "analog",
|
|
75586
75576
|
frameworkCli: "create-analog",
|
|
@@ -75589,12 +75579,12 @@ var config13 = {
|
|
|
75589
75579
|
copyFiles: {
|
|
75590
75580
|
path: "./templates"
|
|
75591
75581
|
},
|
|
75592
|
-
generate:
|
|
75582
|
+
generate: generate13,
|
|
75593
75583
|
configure: configure9,
|
|
75594
75584
|
transformPackageJson: async () => ({
|
|
75595
75585
|
scripts: {
|
|
75596
|
-
preview: `${
|
|
75597
|
-
deploy: `${
|
|
75586
|
+
preview: `${npm10} run build && wrangler pages dev`,
|
|
75587
|
+
deploy: `${npm10} run build && wrangler pages deploy`,
|
|
75598
75588
|
"cf-typegen": `wrangler types`
|
|
75599
75589
|
}
|
|
75600
75590
|
}),
|
|
@@ -75602,12 +75592,12 @@ var config13 = {
|
|
|
75602
75592
|
deployScript: "deploy",
|
|
75603
75593
|
previewScript: "preview"
|
|
75604
75594
|
};
|
|
75605
|
-
var
|
|
75595
|
+
var c3_default16 = config14;
|
|
75606
75596
|
|
|
75607
75597
|
// templates/angular/c3.ts
|
|
75608
75598
|
var import_node_path4 = require("node:path");
|
|
75609
|
-
var { npm:
|
|
75610
|
-
var
|
|
75599
|
+
var { npm: npm11 } = detectPackageManager();
|
|
75600
|
+
var generate14 = async (ctx) => {
|
|
75611
75601
|
await runFrameworkGenerator(ctx, [
|
|
75612
75602
|
ctx.project.name,
|
|
75613
75603
|
"--ssr",
|
|
@@ -75624,7 +75614,7 @@ async function installCFWorker2() {
|
|
|
75624
75614
|
await installPackages(["xhr2"], {
|
|
75625
75615
|
dev: true,
|
|
75626
75616
|
startText: "Installing additional dependencies",
|
|
75627
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75617
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
|
|
75628
75618
|
});
|
|
75629
75619
|
}
|
|
75630
75620
|
async function updateAppCode2() {
|
|
@@ -75666,7 +75656,7 @@ function updateAngularJson2(ctx) {
|
|
|
75666
75656
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
75667
75657
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
75668
75658
|
}
|
|
75669
|
-
var
|
|
75659
|
+
var config15 = {
|
|
75670
75660
|
configVersion: 1,
|
|
75671
75661
|
id: "angular",
|
|
75672
75662
|
frameworkCli: "@angular/create",
|
|
@@ -75678,23 +75668,23 @@ var config14 = {
|
|
|
75678
75668
|
devScript: "start",
|
|
75679
75669
|
deployScript: "deploy",
|
|
75680
75670
|
previewScript: "start",
|
|
75681
|
-
generate:
|
|
75671
|
+
generate: generate14,
|
|
75682
75672
|
configure: configure10,
|
|
75683
75673
|
transformPackageJson: async () => ({
|
|
75684
75674
|
scripts: {
|
|
75685
|
-
start: `${
|
|
75686
|
-
build: `ng build && ${
|
|
75675
|
+
start: `${npm11} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
75676
|
+
build: `ng build && ${npm11} run process`,
|
|
75687
75677
|
process: "node ./tools/copy-files.mjs",
|
|
75688
|
-
deploy: `${
|
|
75678
|
+
deploy: `${npm11} run build && wrangler pages deploy dist/cloudflare`
|
|
75689
75679
|
}
|
|
75690
75680
|
})
|
|
75691
75681
|
};
|
|
75692
|
-
var
|
|
75682
|
+
var c3_default17 = config15;
|
|
75693
75683
|
|
|
75694
75684
|
// templates/astro/c3.ts
|
|
75695
75685
|
var recast8 = __toESM(require_main3());
|
|
75696
75686
|
var { npx: npx3 } = detectPackageManager();
|
|
75697
|
-
var
|
|
75687
|
+
var generate15 = async (ctx) => {
|
|
75698
75688
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
75699
75689
|
logRaw("");
|
|
75700
75690
|
};
|
|
@@ -75753,7 +75743,7 @@ var updateEnvDeclaration2 = (ctx) => {
|
|
|
75753
75743
|
}
|
|
75754
75744
|
});
|
|
75755
75745
|
};
|
|
75756
|
-
var
|
|
75746
|
+
var config16 = {
|
|
75757
75747
|
configVersion: 1,
|
|
75758
75748
|
id: "astro",
|
|
75759
75749
|
frameworkCli: "create-astro",
|
|
@@ -75765,7 +75755,7 @@ var config15 = {
|
|
|
75765
75755
|
devScript: "dev",
|
|
75766
75756
|
deployScript: "deploy",
|
|
75767
75757
|
previewScript: "preview",
|
|
75768
|
-
generate:
|
|
75758
|
+
generate: generate15,
|
|
75769
75759
|
configure: configure11,
|
|
75770
75760
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
75771
75761
|
scripts: {
|
|
@@ -75775,10 +75765,10 @@ var config15 = {
|
|
|
75775
75765
|
}
|
|
75776
75766
|
})
|
|
75777
75767
|
};
|
|
75778
|
-
var
|
|
75768
|
+
var c3_default18 = config16;
|
|
75779
75769
|
|
|
75780
75770
|
// templates/common/c3.ts
|
|
75781
|
-
var
|
|
75771
|
+
var c3_default19 = {
|
|
75782
75772
|
configVersion: 1,
|
|
75783
75773
|
id: "common",
|
|
75784
75774
|
displayName: "Example router & proxy Worker",
|
|
@@ -75798,31 +75788,31 @@ var c3_default18 = {
|
|
|
75798
75788
|
};
|
|
75799
75789
|
|
|
75800
75790
|
// templates/docusaurus/c3.ts
|
|
75801
|
-
var { npm:
|
|
75802
|
-
var
|
|
75791
|
+
var { npm: npm12 } = detectPackageManager();
|
|
75792
|
+
var generate16 = async (ctx) => {
|
|
75803
75793
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
75804
75794
|
};
|
|
75805
|
-
var
|
|
75795
|
+
var config17 = {
|
|
75806
75796
|
configVersion: 1,
|
|
75807
75797
|
id: "docusaurus",
|
|
75808
75798
|
frameworkCli: "create-docusaurus",
|
|
75809
75799
|
platform: "pages",
|
|
75810
75800
|
displayName: "Docusaurus",
|
|
75811
|
-
generate:
|
|
75801
|
+
generate: generate16,
|
|
75812
75802
|
transformPackageJson: async () => ({
|
|
75813
75803
|
scripts: {
|
|
75814
|
-
preview: `${
|
|
75815
|
-
deploy: `${
|
|
75804
|
+
preview: `${npm12} run build && wrangler pages dev ./build`,
|
|
75805
|
+
deploy: `${npm12} run build && wrangler pages deploy ./build`
|
|
75816
75806
|
}
|
|
75817
75807
|
}),
|
|
75818
75808
|
devScript: "preview",
|
|
75819
75809
|
deployScript: "deploy"
|
|
75820
75810
|
};
|
|
75821
|
-
var
|
|
75811
|
+
var c3_default20 = config17;
|
|
75822
75812
|
|
|
75823
75813
|
// templates/gatsby/c3.ts
|
|
75824
|
-
var { npm:
|
|
75825
|
-
var
|
|
75814
|
+
var { npm: npm13 } = detectPackageManager();
|
|
75815
|
+
var generate17 = async (ctx) => {
|
|
75826
75816
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
75827
75817
|
const useTemplate = await inputPrompt({
|
|
75828
75818
|
type: "confirm",
|
|
@@ -75841,27 +75831,27 @@ var generate16 = async (ctx) => {
|
|
|
75841
75831
|
}
|
|
75842
75832
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
75843
75833
|
};
|
|
75844
|
-
var
|
|
75834
|
+
var config18 = {
|
|
75845
75835
|
configVersion: 1,
|
|
75846
75836
|
id: "gatsby",
|
|
75847
75837
|
frameworkCli: "gatsby",
|
|
75848
75838
|
platform: "pages",
|
|
75849
75839
|
displayName: "Gatsby",
|
|
75850
|
-
generate:
|
|
75840
|
+
generate: generate17,
|
|
75851
75841
|
transformPackageJson: async () => ({
|
|
75852
75842
|
scripts: {
|
|
75853
|
-
deploy: `${
|
|
75854
|
-
preview: `${
|
|
75843
|
+
deploy: `${npm13} run build && wrangler pages deploy ./public`,
|
|
75844
|
+
preview: `${npm13} run build && wrangler pages dev ./public`
|
|
75855
75845
|
}
|
|
75856
75846
|
}),
|
|
75857
75847
|
devScript: "develop",
|
|
75858
75848
|
deployScript: "deploy",
|
|
75859
75849
|
previewScript: "preview"
|
|
75860
75850
|
};
|
|
75861
|
-
var
|
|
75851
|
+
var c3_default21 = config18;
|
|
75862
75852
|
|
|
75863
75853
|
// templates/hello-world-durable-object/c3.ts
|
|
75864
|
-
var
|
|
75854
|
+
var c3_default22 = {
|
|
75865
75855
|
configVersion: 1,
|
|
75866
75856
|
id: "hello-world-durable-object",
|
|
75867
75857
|
displayName: "Hello World Worker Using Durable Objects",
|
|
@@ -75880,7 +75870,7 @@ var c3_default21 = {
|
|
|
75880
75870
|
};
|
|
75881
75871
|
|
|
75882
75872
|
// templates/hello-world/c3.ts
|
|
75883
|
-
var
|
|
75873
|
+
var c3_default23 = {
|
|
75884
75874
|
configVersion: 1,
|
|
75885
75875
|
id: "hello-world",
|
|
75886
75876
|
displayName: "Hello World Worker",
|
|
@@ -75902,7 +75892,7 @@ var c3_default22 = {
|
|
|
75902
75892
|
};
|
|
75903
75893
|
|
|
75904
75894
|
// templates/hono/c3.ts
|
|
75905
|
-
var
|
|
75895
|
+
var generate18 = async (ctx) => {
|
|
75906
75896
|
const { name: pm4 } = detectPackageManager();
|
|
75907
75897
|
await runFrameworkGenerator(ctx, [
|
|
75908
75898
|
ctx.project.name,
|
|
@@ -75929,7 +75919,7 @@ var configure12 = async (ctx) => {
|
|
|
75929
75919
|
});
|
|
75930
75920
|
s.stop(`${brandColor("updated")} \`${dim(indexFile)}\``);
|
|
75931
75921
|
};
|
|
75932
|
-
var
|
|
75922
|
+
var config19 = {
|
|
75933
75923
|
configVersion: 1,
|
|
75934
75924
|
id: "hono",
|
|
75935
75925
|
frameworkCli: "create-hono",
|
|
@@ -75938,7 +75928,7 @@ var config18 = {
|
|
|
75938
75928
|
path: "./templates"
|
|
75939
75929
|
},
|
|
75940
75930
|
platform: "workers",
|
|
75941
|
-
generate:
|
|
75931
|
+
generate: generate18,
|
|
75942
75932
|
configure: configure12,
|
|
75943
75933
|
transformPackageJson: async () => ({
|
|
75944
75934
|
scripts: {
|
|
@@ -75950,12 +75940,12 @@ var config18 = {
|
|
|
75950
75940
|
devScript: "dev",
|
|
75951
75941
|
deployScript: "deploy"
|
|
75952
75942
|
};
|
|
75953
|
-
var
|
|
75943
|
+
var c3_default24 = config19;
|
|
75954
75944
|
|
|
75955
75945
|
// templates/next/c3.ts
|
|
75956
75946
|
var import_path10 = require("path");
|
|
75957
|
-
var { npm:
|
|
75958
|
-
var
|
|
75947
|
+
var { npm: npm14, npx: npx4 } = detectPackageManager();
|
|
75948
|
+
var generate19 = async (ctx) => {
|
|
75959
75949
|
const projectName = ctx.project.name;
|
|
75960
75950
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
75961
75951
|
const wranglerToml = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.toml"));
|
|
@@ -76063,13 +76053,13 @@ var addDevDependencies = async (installEslintPlugin) => {
|
|
|
76063
76053
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
76064
76054
|
});
|
|
76065
76055
|
};
|
|
76066
|
-
var
|
|
76056
|
+
var c3_default25 = {
|
|
76067
76057
|
configVersion: 1,
|
|
76068
76058
|
id: "next",
|
|
76069
76059
|
frameworkCli: "create-next-app",
|
|
76070
76060
|
platform: "pages",
|
|
76071
76061
|
displayName: "Next",
|
|
76072
|
-
generate:
|
|
76062
|
+
generate: generate19,
|
|
76073
76063
|
configure: configure13,
|
|
76074
76064
|
copyFiles: {
|
|
76075
76065
|
async selectVariant(ctx) {
|
|
@@ -76101,12 +76091,12 @@ var c3_default24 = {
|
|
|
76101
76091
|
}
|
|
76102
76092
|
},
|
|
76103
76093
|
transformPackageJson: async (_3, ctx) => {
|
|
76104
|
-
const isNpm =
|
|
76105
|
-
const isBun =
|
|
76094
|
+
const isNpm = npm14 === "npm";
|
|
76095
|
+
const isBun = npm14 === "bun";
|
|
76106
76096
|
const isNpmOrBun = isNpm || isBun;
|
|
76107
76097
|
const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
|
|
76108
76098
|
const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
|
|
76109
|
-
const pmCommand = isNpmOrBun ? npx4 :
|
|
76099
|
+
const pmCommand = isNpmOrBun ? npx4 : npm14;
|
|
76110
76100
|
const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
|
|
76111
76101
|
return {
|
|
76112
76102
|
scripts: {
|
|
@@ -76127,14 +76117,14 @@ var c3_default24 = {
|
|
|
76127
76117
|
|
|
76128
76118
|
// templates/nuxt/c3.ts
|
|
76129
76119
|
var recast9 = __toESM(require_main3());
|
|
76130
|
-
var { npm:
|
|
76131
|
-
var
|
|
76120
|
+
var { npm: npm15, name: pm3 } = detectPackageManager();
|
|
76121
|
+
var generate20 = async (ctx) => {
|
|
76132
76122
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76133
76123
|
await runFrameworkGenerator(ctx, [
|
|
76134
76124
|
"init",
|
|
76135
76125
|
ctx.project.name,
|
|
76136
76126
|
"--packageManager",
|
|
76137
|
-
|
|
76127
|
+
npm15,
|
|
76138
76128
|
gitFlag
|
|
76139
76129
|
]);
|
|
76140
76130
|
writeFile2("./.node-version", "17");
|
|
@@ -76148,7 +76138,7 @@ var configure14 = async (ctx) => {
|
|
|
76148
76138
|
await installPackages(packages, {
|
|
76149
76139
|
dev: true,
|
|
76150
76140
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76151
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76141
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm15} install\``)}`
|
|
76152
76142
|
});
|
|
76153
76143
|
updateNuxtConfig2();
|
|
76154
76144
|
updateEnvTypes3(ctx);
|
|
@@ -76199,7 +76189,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76199
76189
|
});
|
|
76200
76190
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76201
76191
|
};
|
|
76202
|
-
var
|
|
76192
|
+
var config20 = {
|
|
76203
76193
|
configVersion: 1,
|
|
76204
76194
|
id: "nuxt",
|
|
76205
76195
|
frameworkCli: "nuxi",
|
|
@@ -76208,12 +76198,12 @@ var config19 = {
|
|
|
76208
76198
|
copyFiles: {
|
|
76209
76199
|
path: "./templates"
|
|
76210
76200
|
},
|
|
76211
|
-
generate:
|
|
76201
|
+
generate: generate20,
|
|
76212
76202
|
configure: configure14,
|
|
76213
76203
|
transformPackageJson: async () => ({
|
|
76214
76204
|
scripts: {
|
|
76215
|
-
deploy: `${
|
|
76216
|
-
preview: `${
|
|
76205
|
+
deploy: `${npm15} run build && wrangler pages deploy`,
|
|
76206
|
+
preview: `${npm15} run build && wrangler pages dev`,
|
|
76217
76207
|
"cf-typegen": `wrangler types`
|
|
76218
76208
|
}
|
|
76219
76209
|
}),
|
|
@@ -76221,10 +76211,10 @@ var config19 = {
|
|
|
76221
76211
|
deployScript: "deploy",
|
|
76222
76212
|
previewScript: "preview"
|
|
76223
76213
|
};
|
|
76224
|
-
var
|
|
76214
|
+
var c3_default26 = config20;
|
|
76225
76215
|
|
|
76226
76216
|
// templates/openapi/c3.ts
|
|
76227
|
-
var
|
|
76217
|
+
var c3_default27 = {
|
|
76228
76218
|
configVersion: 1,
|
|
76229
76219
|
id: "openapi",
|
|
76230
76220
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -76383,7 +76373,7 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
76383
76373
|
(0, import_path11.join)(ctx.project.path, "wrangler.toml")
|
|
76384
76374
|
);
|
|
76385
76375
|
}
|
|
76386
|
-
var
|
|
76376
|
+
var c3_default28 = {
|
|
76387
76377
|
configVersion: 1,
|
|
76388
76378
|
id: "pre-existing",
|
|
76389
76379
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
@@ -76411,7 +76401,7 @@ function buildConfigure(params) {
|
|
|
76411
76401
|
}
|
|
76412
76402
|
|
|
76413
76403
|
// templates/queues/c3.ts
|
|
76414
|
-
var
|
|
76404
|
+
var c3_default29 = {
|
|
76415
76405
|
configVersion: 1,
|
|
76416
76406
|
id: "queues",
|
|
76417
76407
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -76441,8 +76431,8 @@ var c3_default28 = {
|
|
|
76441
76431
|
|
|
76442
76432
|
// templates/qwik/c3.ts
|
|
76443
76433
|
var recast10 = __toESM(require_main3());
|
|
76444
|
-
var { npm:
|
|
76445
|
-
var
|
|
76434
|
+
var { npm: npm16, npx: npx5 } = detectPackageManager();
|
|
76435
|
+
var generate21 = async (ctx) => {
|
|
76446
76436
|
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
76447
76437
|
};
|
|
76448
76438
|
var configure15 = async (ctx) => {
|
|
@@ -76522,7 +76512,7 @@ var populateCloudflareEnv2 = () => {
|
|
|
76522
76512
|
});
|
|
76523
76513
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
76524
76514
|
};
|
|
76525
|
-
var
|
|
76515
|
+
var config21 = {
|
|
76526
76516
|
configVersion: 1,
|
|
76527
76517
|
id: "qwik",
|
|
76528
76518
|
frameworkCli: "create-qwik",
|
|
@@ -76531,12 +76521,12 @@ var config20 = {
|
|
|
76531
76521
|
copyFiles: {
|
|
76532
76522
|
path: "./templates"
|
|
76533
76523
|
},
|
|
76534
|
-
generate:
|
|
76524
|
+
generate: generate21,
|
|
76535
76525
|
configure: configure15,
|
|
76536
76526
|
transformPackageJson: async () => ({
|
|
76537
76527
|
scripts: {
|
|
76538
|
-
deploy: `${
|
|
76539
|
-
preview: `${
|
|
76528
|
+
deploy: `${npm16} run build && wrangler pages deploy`,
|
|
76529
|
+
preview: `${npm16} run build && wrangler pages dev`,
|
|
76540
76530
|
"cf-typegen": `wrangler types`
|
|
76541
76531
|
}
|
|
76542
76532
|
}),
|
|
@@ -76544,11 +76534,11 @@ var config20 = {
|
|
|
76544
76534
|
deployScript: "deploy",
|
|
76545
76535
|
previewScript: "preview"
|
|
76546
76536
|
};
|
|
76547
|
-
var
|
|
76537
|
+
var c3_default30 = config21;
|
|
76548
76538
|
|
|
76549
76539
|
// templates/react/c3.ts
|
|
76550
|
-
var { npm:
|
|
76551
|
-
var
|
|
76540
|
+
var { npm: npm17 } = detectPackageManager();
|
|
76541
|
+
var generate22 = async (ctx) => {
|
|
76552
76542
|
const variant = await inputPrompt({
|
|
76553
76543
|
type: "select",
|
|
76554
76544
|
question: "Select a variant:",
|
|
@@ -76577,29 +76567,29 @@ var variantsOptions = [
|
|
|
76577
76567
|
label: "JavaScript + SWC"
|
|
76578
76568
|
}
|
|
76579
76569
|
];
|
|
76580
|
-
var
|
|
76570
|
+
var config22 = {
|
|
76581
76571
|
configVersion: 1,
|
|
76582
76572
|
id: "react",
|
|
76583
76573
|
// React's documentation now recommends using create-vite.
|
|
76584
76574
|
frameworkCli: "create-vite",
|
|
76585
76575
|
displayName: "React",
|
|
76586
76576
|
platform: "pages",
|
|
76587
|
-
generate:
|
|
76577
|
+
generate: generate22,
|
|
76588
76578
|
transformPackageJson: async () => ({
|
|
76589
76579
|
scripts: {
|
|
76590
|
-
deploy: `${
|
|
76591
|
-
preview: `${
|
|
76580
|
+
deploy: `${npm17} run build && wrangler pages deploy ./dist`,
|
|
76581
|
+
preview: `${npm17} run build && wrangler pages dev ./dist`
|
|
76592
76582
|
}
|
|
76593
76583
|
}),
|
|
76594
76584
|
devScript: "dev",
|
|
76595
76585
|
deployScript: "deploy",
|
|
76596
76586
|
previewScript: "preview"
|
|
76597
76587
|
};
|
|
76598
|
-
var
|
|
76588
|
+
var c3_default31 = config22;
|
|
76599
76589
|
|
|
76600
76590
|
// templates/remix/c3.ts
|
|
76601
|
-
var { npm:
|
|
76602
|
-
var
|
|
76591
|
+
var { npm: npm18 } = detectPackageManager();
|
|
76592
|
+
var generate23 = async (ctx) => {
|
|
76603
76593
|
await runFrameworkGenerator(ctx, [
|
|
76604
76594
|
ctx.project.name,
|
|
76605
76595
|
"--template",
|
|
@@ -76622,7 +76612,7 @@ var configure16 = async () => {
|
|
|
76622
76612
|
});
|
|
76623
76613
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
76624
76614
|
};
|
|
76625
|
-
var
|
|
76615
|
+
var config23 = {
|
|
76626
76616
|
configVersion: 1,
|
|
76627
76617
|
id: "remix",
|
|
76628
76618
|
frameworkCli: "create-remix",
|
|
@@ -76631,12 +76621,12 @@ var config22 = {
|
|
|
76631
76621
|
copyFiles: {
|
|
76632
76622
|
path: "./templates"
|
|
76633
76623
|
},
|
|
76634
|
-
generate:
|
|
76624
|
+
generate: generate23,
|
|
76635
76625
|
configure: configure16,
|
|
76636
76626
|
transformPackageJson: async () => ({
|
|
76637
76627
|
scripts: {
|
|
76638
|
-
deploy: `${
|
|
76639
|
-
preview: `${
|
|
76628
|
+
deploy: `${npm18} run build && wrangler pages deploy`,
|
|
76629
|
+
preview: `${npm18} run build && wrangler pages dev`,
|
|
76640
76630
|
"cf-typegen": `wrangler types`
|
|
76641
76631
|
}
|
|
76642
76632
|
}),
|
|
@@ -76644,10 +76634,10 @@ var config22 = {
|
|
|
76644
76634
|
deployScript: "deploy",
|
|
76645
76635
|
previewScript: "preview"
|
|
76646
76636
|
};
|
|
76647
|
-
var
|
|
76637
|
+
var c3_default32 = config23;
|
|
76648
76638
|
|
|
76649
76639
|
// templates/scheduled/c3.ts
|
|
76650
|
-
var
|
|
76640
|
+
var c3_default33 = {
|
|
76651
76641
|
configVersion: 1,
|
|
76652
76642
|
id: "scheduled",
|
|
76653
76643
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -76667,8 +76657,8 @@ var c3_default32 = {
|
|
|
76667
76657
|
|
|
76668
76658
|
// templates/solid/c3.ts
|
|
76669
76659
|
var recast11 = __toESM(require_main3());
|
|
76670
|
-
var { npm:
|
|
76671
|
-
var
|
|
76660
|
+
var { npm: npm19 } = detectPackageManager();
|
|
76661
|
+
var generate24 = async (ctx) => {
|
|
76672
76662
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
76673
76663
|
logRaw("");
|
|
76674
76664
|
};
|
|
@@ -76710,7 +76700,7 @@ var configure17 = async (ctx) => {
|
|
|
76710
76700
|
}
|
|
76711
76701
|
});
|
|
76712
76702
|
};
|
|
76713
|
-
var
|
|
76703
|
+
var config24 = {
|
|
76714
76704
|
configVersion: 1,
|
|
76715
76705
|
id: "solid",
|
|
76716
76706
|
frameworkCli: "create-solid",
|
|
@@ -76719,12 +76709,12 @@ var config23 = {
|
|
|
76719
76709
|
copyFiles: {
|
|
76720
76710
|
path: "./templates"
|
|
76721
76711
|
},
|
|
76722
|
-
generate:
|
|
76712
|
+
generate: generate24,
|
|
76723
76713
|
configure: configure17,
|
|
76724
76714
|
transformPackageJson: async () => ({
|
|
76725
76715
|
scripts: {
|
|
76726
|
-
preview: `${
|
|
76727
|
-
deploy: `${
|
|
76716
|
+
preview: `${npm19} run build && npx wrangler pages dev`,
|
|
76717
|
+
deploy: `${npm19} run build && wrangler pages deploy`
|
|
76728
76718
|
}
|
|
76729
76719
|
}),
|
|
76730
76720
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -76732,13 +76722,14 @@ var config23 = {
|
|
|
76732
76722
|
deployScript: "deploy",
|
|
76733
76723
|
previewScript: "preview"
|
|
76734
76724
|
};
|
|
76735
|
-
var
|
|
76725
|
+
var c3_default34 = config24;
|
|
76736
76726
|
|
|
76737
76727
|
// templates/svelte/c3.ts
|
|
76728
|
+
var import_node_fs3 = require("node:fs");
|
|
76738
76729
|
var import_node_os4 = require("node:os");
|
|
76739
76730
|
var recast12 = __toESM(require_main3());
|
|
76740
|
-
var { npm:
|
|
76741
|
-
var
|
|
76731
|
+
var { npm: npm20 } = detectPackageManager();
|
|
76732
|
+
var generate25 = async (ctx) => {
|
|
76742
76733
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
76743
76734
|
logRaw("");
|
|
76744
76735
|
};
|
|
@@ -76750,6 +76741,7 @@ var configure18 = async (ctx) => {
|
|
|
76750
76741
|
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
76751
76742
|
});
|
|
76752
76743
|
updateSvelteConfig2();
|
|
76744
|
+
updatePlaywrightConfig(usesTypescript(ctx));
|
|
76753
76745
|
updateTypeDefinitions2(ctx);
|
|
76754
76746
|
};
|
|
76755
76747
|
var updateSvelteConfig2 = () => {
|
|
@@ -76764,6 +76756,28 @@ var updateSvelteConfig2 = () => {
|
|
|
76764
76756
|
}
|
|
76765
76757
|
});
|
|
76766
76758
|
};
|
|
76759
|
+
var updatePlaywrightConfig = (shouldUseTypescript) => {
|
|
76760
|
+
const filePath = `playwright.config.${shouldUseTypescript ? "ts" : "js"}`;
|
|
76761
|
+
if (!(0, import_node_fs3.existsSync)(filePath)) {
|
|
76762
|
+
return;
|
|
76763
|
+
}
|
|
76764
|
+
updateStatus(`Changing webServer port in ${blue(filePath)}`);
|
|
76765
|
+
transformFile(filePath, {
|
|
76766
|
+
visitObjectExpression: function(n2) {
|
|
76767
|
+
const portProp = n2.node.properties.find((prop) => {
|
|
76768
|
+
if (!("key" in prop) || !("name" in prop.key)) {
|
|
76769
|
+
return false;
|
|
76770
|
+
}
|
|
76771
|
+
return prop.key.name === "port";
|
|
76772
|
+
});
|
|
76773
|
+
if (!portProp || !("value" in portProp) || !("value" in portProp.value)) {
|
|
76774
|
+
return this.traverse(n2);
|
|
76775
|
+
}
|
|
76776
|
+
portProp.value.value = 8788;
|
|
76777
|
+
return false;
|
|
76778
|
+
}
|
|
76779
|
+
});
|
|
76780
|
+
};
|
|
76767
76781
|
var updateTypeDefinitions2 = (ctx) => {
|
|
76768
76782
|
if (!usesTypescript(ctx)) {
|
|
76769
76783
|
return;
|
|
@@ -76801,7 +76815,7 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
76801
76815
|
}
|
|
76802
76816
|
});
|
|
76803
76817
|
};
|
|
76804
|
-
var
|
|
76818
|
+
var config25 = {
|
|
76805
76819
|
configVersion: 1,
|
|
76806
76820
|
id: "svelte",
|
|
76807
76821
|
frameworkCli: "sv",
|
|
@@ -76813,12 +76827,12 @@ var config24 = {
|
|
|
76813
76827
|
ts: { path: "./ts" }
|
|
76814
76828
|
}
|
|
76815
76829
|
},
|
|
76816
|
-
generate:
|
|
76830
|
+
generate: generate25,
|
|
76817
76831
|
configure: configure18,
|
|
76818
76832
|
transformPackageJson: async (original, ctx) => {
|
|
76819
76833
|
let scripts = {
|
|
76820
|
-
preview: `${
|
|
76821
|
-
deploy: `${
|
|
76834
|
+
preview: `${npm20} run build && wrangler pages dev`,
|
|
76835
|
+
deploy: `${npm20} run build && wrangler pages deploy`
|
|
76822
76836
|
};
|
|
76823
76837
|
if (usesTypescript(ctx)) {
|
|
76824
76838
|
const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
|
|
@@ -76833,34 +76847,34 @@ var config24 = {
|
|
|
76833
76847
|
deployScript: "deploy",
|
|
76834
76848
|
previewScript: "preview"
|
|
76835
76849
|
};
|
|
76836
|
-
var
|
|
76850
|
+
var c3_default35 = config25;
|
|
76837
76851
|
|
|
76838
76852
|
// templates/vue/c3.ts
|
|
76839
|
-
var { npm:
|
|
76840
|
-
var
|
|
76853
|
+
var { npm: npm21 } = detectPackageManager();
|
|
76854
|
+
var generate26 = async (ctx) => {
|
|
76841
76855
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
76842
76856
|
};
|
|
76843
|
-
var
|
|
76857
|
+
var config26 = {
|
|
76844
76858
|
configVersion: 1,
|
|
76845
76859
|
id: "vue",
|
|
76846
76860
|
frameworkCli: "create-vue",
|
|
76847
76861
|
displayName: "Vue",
|
|
76848
76862
|
platform: "pages",
|
|
76849
|
-
generate:
|
|
76863
|
+
generate: generate26,
|
|
76850
76864
|
transformPackageJson: async () => ({
|
|
76851
76865
|
scripts: {
|
|
76852
|
-
deploy: `${
|
|
76853
|
-
preview: `${
|
|
76866
|
+
deploy: `${npm21} run build && wrangler pages deploy ./dist`,
|
|
76867
|
+
preview: `${npm21} run build && wrangler pages dev ./dist`
|
|
76854
76868
|
}
|
|
76855
76869
|
}),
|
|
76856
76870
|
devScript: "dev",
|
|
76857
76871
|
deployScript: "deploy",
|
|
76858
76872
|
previewScript: "preview"
|
|
76859
76873
|
};
|
|
76860
|
-
var
|
|
76874
|
+
var c3_default36 = config26;
|
|
76861
76875
|
|
|
76862
76876
|
// ../wrangler/package.json
|
|
76863
|
-
var version2 = "3.
|
|
76877
|
+
var version2 = "3.94.0";
|
|
76864
76878
|
|
|
76865
76879
|
// src/git.ts
|
|
76866
76880
|
var offerGit = async (ctx) => {
|
|
@@ -77136,24 +77150,25 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
77136
77150
|
qwik: c3_default11,
|
|
77137
77151
|
remix: c3_default12,
|
|
77138
77152
|
solid: c3_default13,
|
|
77139
|
-
svelte: c3_default14
|
|
77153
|
+
svelte: c3_default14,
|
|
77154
|
+
vue: c3_default15
|
|
77140
77155
|
};
|
|
77141
77156
|
} else {
|
|
77142
77157
|
return {
|
|
77143
|
-
analog:
|
|
77144
|
-
angular:
|
|
77145
|
-
astro:
|
|
77146
|
-
docusaurus:
|
|
77147
|
-
gatsby:
|
|
77148
|
-
hono:
|
|
77149
|
-
next:
|
|
77150
|
-
nuxt:
|
|
77151
|
-
qwik:
|
|
77152
|
-
react:
|
|
77153
|
-
remix:
|
|
77154
|
-
solid:
|
|
77155
|
-
svelte:
|
|
77156
|
-
vue:
|
|
77158
|
+
analog: c3_default16,
|
|
77159
|
+
angular: c3_default17,
|
|
77160
|
+
astro: c3_default18,
|
|
77161
|
+
docusaurus: c3_default20,
|
|
77162
|
+
gatsby: c3_default21,
|
|
77163
|
+
hono: c3_default24,
|
|
77164
|
+
next: c3_default25,
|
|
77165
|
+
nuxt: c3_default26,
|
|
77166
|
+
qwik: c3_default30,
|
|
77167
|
+
react: c3_default31,
|
|
77168
|
+
remix: c3_default32,
|
|
77169
|
+
solid: c3_default34,
|
|
77170
|
+
svelte: c3_default35,
|
|
77171
|
+
vue: c3_default36
|
|
77157
77172
|
};
|
|
77158
77173
|
}
|
|
77159
77174
|
}
|
|
@@ -77166,13 +77181,13 @@ function getTemplateMap({ experimental = false }) {
|
|
|
77166
77181
|
};
|
|
77167
77182
|
} else {
|
|
77168
77183
|
return {
|
|
77169
|
-
"hello-world":
|
|
77170
|
-
common:
|
|
77171
|
-
scheduled:
|
|
77172
|
-
queues:
|
|
77173
|
-
"hello-world-durable-object":
|
|
77174
|
-
openapi:
|
|
77175
|
-
"pre-existing":
|
|
77184
|
+
"hello-world": c3_default23,
|
|
77185
|
+
common: c3_default19,
|
|
77186
|
+
scheduled: c3_default33,
|
|
77187
|
+
queues: c3_default29,
|
|
77188
|
+
"hello-world-durable-object": c3_default22,
|
|
77189
|
+
openapi: c3_default27,
|
|
77190
|
+
"pre-existing": c3_default28
|
|
77176
77191
|
};
|
|
77177
77192
|
}
|
|
77178
77193
|
}
|
|
@@ -77319,8 +77334,8 @@ var createContext = async (args, prevArgs) => {
|
|
|
77319
77334
|
experimental: args.experimental
|
|
77320
77335
|
});
|
|
77321
77336
|
const frameworkOptions = Object.entries(frameworkMap).map(
|
|
77322
|
-
([key,
|
|
77323
|
-
label:
|
|
77337
|
+
([key, config27]) => ({
|
|
77338
|
+
label: config27.displayName,
|
|
77324
77339
|
value: key
|
|
77325
77340
|
})
|
|
77326
77341
|
);
|
|
@@ -77458,28 +77473,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
77458
77473
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
77459
77474
|
}
|
|
77460
77475
|
const path6 = await downloadRemoteTemplate(src);
|
|
77461
|
-
const
|
|
77462
|
-
validateTemplate(path6,
|
|
77476
|
+
const config27 = inferTemplateConfig(path6);
|
|
77477
|
+
validateTemplate(path6, config27);
|
|
77463
77478
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
77464
77479
|
return {
|
|
77465
77480
|
path: path6,
|
|
77466
|
-
...
|
|
77481
|
+
...config27
|
|
77467
77482
|
};
|
|
77468
77483
|
};
|
|
77469
|
-
var validateTemplate = (path6,
|
|
77470
|
-
if (!
|
|
77484
|
+
var validateTemplate = (path6, config27) => {
|
|
77485
|
+
if (!config27.copyFiles) {
|
|
77471
77486
|
return;
|
|
77472
77487
|
}
|
|
77473
|
-
if (isVariantInfo(
|
|
77474
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
77488
|
+
if (isVariantInfo(config27.copyFiles)) {
|
|
77489
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config27.copyFiles.path), config27);
|
|
77475
77490
|
} else {
|
|
77476
|
-
for (const variant of Object.values(
|
|
77477
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path),
|
|
77491
|
+
for (const variant of Object.values(config27.copyFiles.variants)) {
|
|
77492
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config27);
|
|
77478
77493
|
}
|
|
77479
77494
|
}
|
|
77480
77495
|
};
|
|
77481
|
-
var validateTemplateSrcDirectory = (path6,
|
|
77482
|
-
if (
|
|
77496
|
+
var validateTemplateSrcDirectory = (path6, config27) => {
|
|
77497
|
+
if (config27.platform === "workers") {
|
|
77483
77498
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
77484
77499
|
if (!(0, import_fs11.existsSync)(wranglerTomlPath)) {
|
|
77485
77500
|
throw new Error(
|
|
@@ -79214,7 +79229,7 @@ var writeWranglerToml = (ctx, contents) => {
|
|
|
79214
79229
|
|
|
79215
79230
|
// src/deploy.ts
|
|
79216
79231
|
var offerToDeploy = async (ctx) => {
|
|
79217
|
-
const { npm:
|
|
79232
|
+
const { npm: npm23 } = detectPackageManager();
|
|
79218
79233
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
79219
79234
|
if (!await isDeployable(ctx)) {
|
|
79220
79235
|
ctx.args.deploy = false;
|
|
@@ -79225,7 +79240,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
79225
79240
|
);
|
|
79226
79241
|
}
|
|
79227
79242
|
const label = `deploy via \`${quoteShellArgs([
|
|
79228
|
-
|
|
79243
|
+
npm23,
|
|
79229
79244
|
"run",
|
|
79230
79245
|
ctx.template.deployScript ?? "deploy"
|
|
79231
79246
|
])}\``;
|
|
@@ -79255,11 +79270,11 @@ var isDeployable = async (ctx) => {
|
|
|
79255
79270
|
return !hasBinding(wranglerToml);
|
|
79256
79271
|
};
|
|
79257
79272
|
var runDeploy = async (ctx) => {
|
|
79258
|
-
const { npm:
|
|
79273
|
+
const { npm: npm23, name: pm4 } = detectPackageManager();
|
|
79259
79274
|
if (!ctx.account?.id) {
|
|
79260
79275
|
throw new Error("Failed to read Cloudflare account.");
|
|
79261
79276
|
}
|
|
79262
|
-
const baseDeployCmd = [
|
|
79277
|
+
const baseDeployCmd = [npm23, "run", ctx.template.deployScript ?? "deploy"];
|
|
79263
79278
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
79264
79279
|
const deployCmd = [
|
|
79265
79280
|
...baseDeployCmd,
|
|
@@ -79369,14 +79384,14 @@ var printSummary = (ctx) => {
|
|
|
79369
79384
|
const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
|
|
79370
79385
|
const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
|
|
79371
79386
|
const cdCommand = relativePath ? `cd ${relativePath}` : null;
|
|
79372
|
-
const { npm:
|
|
79387
|
+
const { npm: npm23 } = detectPackageManager();
|
|
79373
79388
|
const devServerCommand = quoteShellArgs([
|
|
79374
|
-
|
|
79389
|
+
npm23,
|
|
79375
79390
|
"run",
|
|
79376
79391
|
ctx.template.devScript ?? "start"
|
|
79377
79392
|
]);
|
|
79378
79393
|
const deployCommand = quoteShellArgs([
|
|
79379
|
-
|
|
79394
|
+
npm23,
|
|
79380
79395
|
"run",
|
|
79381
79396
|
ctx.template.deployScript ?? "deploy"
|
|
79382
79397
|
]);
|
|
@@ -79744,8 +79759,8 @@ var renderValues = (values) => {
|
|
|
79744
79759
|
};
|
|
79745
79760
|
|
|
79746
79761
|
// src/helpers/retry.ts
|
|
79747
|
-
var retry = async (
|
|
79748
|
-
let { times } =
|
|
79762
|
+
var retry = async (config27, fn) => {
|
|
79763
|
+
let { times } = config27;
|
|
79749
79764
|
let error2 = null;
|
|
79750
79765
|
while (times > 0) {
|
|
79751
79766
|
try {
|
|
@@ -79753,10 +79768,10 @@ var retry = async (config26, fn) => {
|
|
|
79753
79768
|
} catch (e) {
|
|
79754
79769
|
error2 = e;
|
|
79755
79770
|
times--;
|
|
79756
|
-
if (
|
|
79771
|
+
if (config27.exitCondition?.(e)) {
|
|
79757
79772
|
break;
|
|
79758
79773
|
}
|
|
79759
|
-
await sleep(
|
|
79774
|
+
await sleep(config27.sleepMs ?? 1e3);
|
|
79760
79775
|
}
|
|
79761
79776
|
}
|
|
79762
79777
|
throw error2;
|
|
@@ -81153,14 +81168,14 @@ function applyEdits(text, edits) {
|
|
|
81153
81168
|
|
|
81154
81169
|
// src/workers.ts
|
|
81155
81170
|
async function installWorkersTypes(ctx) {
|
|
81156
|
-
const { npm:
|
|
81171
|
+
const { npm: npm23 } = detectPackageManager();
|
|
81157
81172
|
if (!usesTypescript(ctx)) {
|
|
81158
81173
|
return;
|
|
81159
81174
|
}
|
|
81160
81175
|
await installPackages(["@cloudflare/workers-types"], {
|
|
81161
81176
|
dev: true,
|
|
81162
81177
|
startText: "Installing @cloudflare/workers-types",
|
|
81163
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
81178
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm23}`)}`
|
|
81164
81179
|
});
|
|
81165
81180
|
await addWorkersTypesToTsConfig(ctx);
|
|
81166
81181
|
}
|
|
@@ -81183,8 +81198,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81183
81198
|
}
|
|
81184
81199
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81185
81200
|
try {
|
|
81186
|
-
const
|
|
81187
|
-
const currentTypes =
|
|
81201
|
+
const config27 = parse3(tsconfig);
|
|
81202
|
+
const currentTypes = config27.compilerOptions?.types ?? [];
|
|
81188
81203
|
const explicitEntrypoint = currentTypes.some(
|
|
81189
81204
|
(t) => t.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81190
81205
|
);
|
|
@@ -81214,7 +81229,7 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81214
81229
|
}
|
|
81215
81230
|
|
|
81216
81231
|
// src/cli.ts
|
|
81217
|
-
var { npm:
|
|
81232
|
+
var { npm: npm22 } = detectPackageManager();
|
|
81218
81233
|
var main = async (argv) => {
|
|
81219
81234
|
const result = await parseArgs(argv);
|
|
81220
81235
|
if (result.type === "unknown") {
|
|
@@ -81250,10 +81265,10 @@ ${result.errorMessage}`);
|
|
|
81250
81265
|
};
|
|
81251
81266
|
var runLatest = async () => {
|
|
81252
81267
|
const args = process.argv.slice(2);
|
|
81253
|
-
if (
|
|
81268
|
+
if (npm22 === "npm") {
|
|
81254
81269
|
args.unshift("--");
|
|
81255
81270
|
}
|
|
81256
|
-
await runCommand([
|
|
81271
|
+
await runCommand([npm22, "create", "cloudflare@latest", ...args]);
|
|
81257
81272
|
};
|
|
81258
81273
|
var runCli = async (args) => {
|
|
81259
81274
|
printBanner();
|