create-cloudflare 2.43.0 → 2.43.1
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 +281 -283
- package/package.json +4 -4
- package/templates/common/c3.ts +5 -1
- package/templates/hello-world-durable-object/c3.ts +4 -1
- package/templates/hello-world-with-assets/c3.ts +4 -1
- package/templates/openapi/c3.ts +5 -1
- package/templates/pre-existing/c3.ts +5 -1
- package/templates/queues/c3.ts +5 -1
- package/templates/scheduled/c3.ts +5 -1
package/dist/cli.js
CHANGED
|
@@ -568,7 +568,7 @@ var require_XDGAppPaths = __commonJS({
|
|
|
568
568
|
XDGAppPaths.cache = function cache(dirOptions) {
|
|
569
569
|
return path6.join(xdg.cache(), finalPathSegment(dirOptions));
|
|
570
570
|
};
|
|
571
|
-
XDGAppPaths.config = function
|
|
571
|
+
XDGAppPaths.config = function config47(dirOptions) {
|
|
572
572
|
return path6.join(xdg.config(), finalPathSegment(dirOptions));
|
|
573
573
|
};
|
|
574
574
|
XDGAppPaths.data = function data(dirOptions) {
|
|
@@ -625,7 +625,7 @@ var require_XDG = __commonJS({
|
|
|
625
625
|
var cache = function() {
|
|
626
626
|
return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
|
|
627
627
|
};
|
|
628
|
-
var
|
|
628
|
+
var config47 = function() {
|
|
629
629
|
return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
|
|
630
630
|
};
|
|
631
631
|
var data = function() {
|
|
@@ -637,13 +637,13 @@ var require_XDG = __commonJS({
|
|
|
637
637
|
var state = function() {
|
|
638
638
|
return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
|
|
639
639
|
};
|
|
640
|
-
return { cache, config:
|
|
640
|
+
return { cache, config: config47, data, runtime, state };
|
|
641
641
|
};
|
|
642
642
|
var macos = function() {
|
|
643
643
|
var cache = function() {
|
|
644
644
|
return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
|
|
645
645
|
};
|
|
646
|
-
var
|
|
646
|
+
var config47 = function() {
|
|
647
647
|
return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
|
|
648
648
|
};
|
|
649
649
|
var data = function() {
|
|
@@ -655,7 +655,7 @@ var require_XDG = __commonJS({
|
|
|
655
655
|
var state = function() {
|
|
656
656
|
return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
|
|
657
657
|
};
|
|
658
|
-
return { cache, config:
|
|
658
|
+
return { cache, config: config47, data, runtime, state };
|
|
659
659
|
};
|
|
660
660
|
var windows = function() {
|
|
661
661
|
function appData() {
|
|
@@ -667,7 +667,7 @@ var require_XDG = __commonJS({
|
|
|
667
667
|
var cache = function() {
|
|
668
668
|
return valOrPath(env3.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
|
|
669
669
|
};
|
|
670
|
-
var
|
|
670
|
+
var config47 = function() {
|
|
671
671
|
return valOrPath(env3.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
|
|
672
672
|
};
|
|
673
673
|
var data = function() {
|
|
@@ -679,7 +679,7 @@ var require_XDG = __commonJS({
|
|
|
679
679
|
var state = function() {
|
|
680
680
|
return valOrPath(env3.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
|
|
681
681
|
};
|
|
682
|
-
return { cache, config:
|
|
682
|
+
return { cache, config: config47, data, runtime, state };
|
|
683
683
|
};
|
|
684
684
|
var XDG_ = /* @__PURE__ */ function() {
|
|
685
685
|
function XDG_2() {
|
|
@@ -31509,21 +31509,21 @@ var require_dist_web = __commonJS({
|
|
|
31509
31509
|
_createClass(Haikunator3, [{
|
|
31510
31510
|
key: "haikunate",
|
|
31511
31511
|
value: function haikunate(options) {
|
|
31512
|
-
var
|
|
31513
|
-
if (
|
|
31514
|
-
|
|
31512
|
+
var config47 = (0, _lodash["default"])(options, this.config);
|
|
31513
|
+
if (config47.tokenHex === true) {
|
|
31514
|
+
config47.tokenChars = "0123456789abcdef";
|
|
31515
31515
|
}
|
|
31516
31516
|
var adjective = this._randomElement(this.adjectives);
|
|
31517
31517
|
var noun = this._randomElement(this.nouns);
|
|
31518
|
-
if (!
|
|
31518
|
+
if (!config47.tokenLength) config47.tokenLength = 0;
|
|
31519
31519
|
var token = "";
|
|
31520
|
-
for (var i = 0; i <
|
|
31521
|
-
token += this._randomElement(
|
|
31520
|
+
for (var i = 0; i < config47.tokenLength; i++) {
|
|
31521
|
+
token += this._randomElement(config47.tokenChars);
|
|
31522
31522
|
}
|
|
31523
31523
|
var sections = [adjective, noun, token];
|
|
31524
31524
|
return sections.filter(function(e) {
|
|
31525
31525
|
return !!e;
|
|
31526
|
-
}).join(
|
|
31526
|
+
}).join(config47.delimiter);
|
|
31527
31527
|
}
|
|
31528
31528
|
/**
|
|
31529
31529
|
* Get a random element from an array/string
|
|
@@ -40036,13 +40036,13 @@ var require_esprima = __commonJS({
|
|
|
40036
40036
|
return Reader2;
|
|
40037
40037
|
}();
|
|
40038
40038
|
var Tokenizer = function() {
|
|
40039
|
-
function Tokenizer2(code,
|
|
40039
|
+
function Tokenizer2(code, config47) {
|
|
40040
40040
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
40041
|
-
this.errorHandler.tolerant =
|
|
40041
|
+
this.errorHandler.tolerant = config47 ? typeof config47.tolerant === "boolean" && config47.tolerant : false;
|
|
40042
40042
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
40043
|
-
this.scanner.trackComment =
|
|
40044
|
-
this.trackRange =
|
|
40045
|
-
this.trackLoc =
|
|
40043
|
+
this.scanner.trackComment = config47 ? typeof config47.comment === "boolean" && config47.comment : false;
|
|
40044
|
+
this.trackRange = config47 ? typeof config47.range === "boolean" && config47.range : false;
|
|
40045
|
+
this.trackLoc = config47 ? typeof config47.loc === "boolean" && config47.loc : false;
|
|
40046
40046
|
this.buffer = [];
|
|
40047
40047
|
this.reader = new Reader();
|
|
40048
40048
|
}
|
|
@@ -49803,11 +49803,11 @@ var require_printer = __commonJS({
|
|
|
49803
49803
|
return this.code;
|
|
49804
49804
|
};
|
|
49805
49805
|
var emptyPrintResult = new PrintResult("");
|
|
49806
|
-
var Printer = function Printer2(
|
|
49806
|
+
var Printer = function Printer2(config47) {
|
|
49807
49807
|
assert_1.default.ok(this instanceof Printer2);
|
|
49808
|
-
var explicitTabWidth =
|
|
49809
|
-
|
|
49810
|
-
|
|
49808
|
+
var explicitTabWidth = config47 && config47.tabWidth;
|
|
49809
|
+
config47 = options_1.normalize(config47);
|
|
49810
|
+
config47.sourceFileName = null;
|
|
49811
49811
|
function makePrintFunctionWith(options, overrides) {
|
|
49812
49812
|
options = Object.assign({}, options, overrides);
|
|
49813
49813
|
return function(path6) {
|
|
@@ -49822,11 +49822,11 @@ var require_printer = __commonJS({
|
|
|
49822
49822
|
includeComments: false
|
|
49823
49823
|
}));
|
|
49824
49824
|
}
|
|
49825
|
-
var oldTabWidth =
|
|
49825
|
+
var oldTabWidth = config47.tabWidth;
|
|
49826
49826
|
if (!explicitTabWidth) {
|
|
49827
49827
|
var loc = path6.getNode().loc;
|
|
49828
49828
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
49829
|
-
|
|
49829
|
+
config47.tabWidth = loc.lines.guessTabWidth();
|
|
49830
49830
|
}
|
|
49831
49831
|
}
|
|
49832
49832
|
var reprinter = patcher_1.getReprinter(path6);
|
|
@@ -49840,11 +49840,11 @@ var require_printer = __commonJS({
|
|
|
49840
49840
|
// right choice because it gives us the opportunity to reprint
|
|
49841
49841
|
// such nodes using their original source.
|
|
49842
49842
|
reprinter(print2)
|
|
49843
|
-
) : genericPrint(path6,
|
|
49843
|
+
) : genericPrint(path6, config47, options, makePrintFunctionWith(options, {
|
|
49844
49844
|
includeComments: true,
|
|
49845
49845
|
avoidRootParens: false
|
|
49846
49846
|
}));
|
|
49847
|
-
|
|
49847
|
+
config47.tabWidth = oldTabWidth;
|
|
49848
49848
|
return lines;
|
|
49849
49849
|
}
|
|
49850
49850
|
this.print = function(ast) {
|
|
@@ -49855,7 +49855,7 @@ var require_printer = __commonJS({
|
|
|
49855
49855
|
includeComments: true,
|
|
49856
49856
|
avoidRootParens: false
|
|
49857
49857
|
});
|
|
49858
|
-
return new PrintResult(lines.toString(
|
|
49858
|
+
return new PrintResult(lines.toString(config47), util.composeSourceMaps(config47.inputSourceMap, lines.getSourceMap(config47.sourceMapName, config47.sourceRoot)));
|
|
49859
49859
|
};
|
|
49860
49860
|
this.printGenerically = function(ast) {
|
|
49861
49861
|
if (!ast) {
|
|
@@ -49863,26 +49863,26 @@ var require_printer = __commonJS({
|
|
|
49863
49863
|
}
|
|
49864
49864
|
function printGenerically(path7) {
|
|
49865
49865
|
return comments_1.printComments(path7, function(path8) {
|
|
49866
|
-
return genericPrint(path8,
|
|
49866
|
+
return genericPrint(path8, config47, {
|
|
49867
49867
|
includeComments: true,
|
|
49868
49868
|
avoidRootParens: false
|
|
49869
49869
|
}, printGenerically);
|
|
49870
49870
|
});
|
|
49871
49871
|
}
|
|
49872
49872
|
var path6 = fast_path_1.default.from(ast);
|
|
49873
|
-
var oldReuseWhitespace =
|
|
49874
|
-
|
|
49875
|
-
var pr = new PrintResult(printGenerically(path6).toString(
|
|
49876
|
-
|
|
49873
|
+
var oldReuseWhitespace = config47.reuseWhitespace;
|
|
49874
|
+
config47.reuseWhitespace = false;
|
|
49875
|
+
var pr = new PrintResult(printGenerically(path6).toString(config47));
|
|
49876
|
+
config47.reuseWhitespace = oldReuseWhitespace;
|
|
49877
49877
|
return pr;
|
|
49878
49878
|
};
|
|
49879
49879
|
};
|
|
49880
49880
|
exports2.Printer = Printer;
|
|
49881
|
-
function genericPrint(path6,
|
|
49881
|
+
function genericPrint(path6, config47, options, printPath) {
|
|
49882
49882
|
assert_1.default.ok(path6 instanceof fast_path_1.default);
|
|
49883
49883
|
var node = path6.getValue();
|
|
49884
49884
|
var parts = [];
|
|
49885
|
-
var linesWithoutParens = genericPrintNoParens(path6,
|
|
49885
|
+
var linesWithoutParens = genericPrintNoParens(path6, config47, printPath);
|
|
49886
49886
|
if (!node || linesWithoutParens.isEmpty()) {
|
|
49887
49887
|
return linesWithoutParens;
|
|
49888
49888
|
}
|
|
@@ -69380,33 +69380,33 @@ var inputPrompt = async (promptConfig) => {
|
|
|
69380
69380
|
}
|
|
69381
69381
|
return input;
|
|
69382
69382
|
};
|
|
69383
|
-
var renderSubmit = (
|
|
69384
|
-
const { question, label } =
|
|
69385
|
-
if (
|
|
69383
|
+
var renderSubmit = (config47, value) => {
|
|
69384
|
+
const { question, label } = config47;
|
|
69385
|
+
if (config47.type !== "confirm" && !value) {
|
|
69386
69386
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
69387
69387
|
}
|
|
69388
|
-
const content =
|
|
69388
|
+
const content = config47.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
|
|
69389
69389
|
return [`${leftT} ${question}`, content, `${grayBar}`];
|
|
69390
69390
|
};
|
|
69391
|
-
var getRenderers = (
|
|
69392
|
-
switch (
|
|
69391
|
+
var getRenderers = (config47) => {
|
|
69392
|
+
switch (config47.type) {
|
|
69393
69393
|
case "select":
|
|
69394
|
-
return getSelectRenderers(
|
|
69394
|
+
return getSelectRenderers(config47);
|
|
69395
69395
|
case "confirm":
|
|
69396
|
-
return getConfirmRenderers(
|
|
69396
|
+
return getConfirmRenderers(config47);
|
|
69397
69397
|
case "text":
|
|
69398
|
-
return getTextRenderers(
|
|
69398
|
+
return getTextRenderers(config47);
|
|
69399
69399
|
case "multiselect":
|
|
69400
|
-
return getSelectRenderers(
|
|
69400
|
+
return getSelectRenderers(config47);
|
|
69401
69401
|
case "list":
|
|
69402
|
-
return getSelectListRenderers(
|
|
69402
|
+
return getSelectListRenderers(config47);
|
|
69403
69403
|
}
|
|
69404
69404
|
};
|
|
69405
|
-
var getTextRenderers = (
|
|
69406
|
-
const { question } =
|
|
69407
|
-
const helpText =
|
|
69408
|
-
const format5 =
|
|
69409
|
-
const defaultValue =
|
|
69405
|
+
var getTextRenderers = (config47) => {
|
|
69406
|
+
const { question } = config47;
|
|
69407
|
+
const helpText = config47.helpText ?? "";
|
|
69408
|
+
const format5 = config47.format ?? ((val) => String(val));
|
|
69409
|
+
const defaultValue = config47.defaultValue?.toString() ?? "";
|
|
69410
69410
|
const activeRenderer = ({ value }) => [
|
|
69411
69411
|
`${blCorner} ${bold(question)} ${dim(helpText)}`,
|
|
69412
69412
|
`${space(2)}${format5(value || dim(defaultValue))}`,
|
|
@@ -69429,14 +69429,14 @@ var getTextRenderers = (config40) => {
|
|
|
69429
69429
|
``
|
|
69430
69430
|
// extra line for readability
|
|
69431
69431
|
],
|
|
69432
|
-
submit: ({ value }) => renderSubmit(
|
|
69432
|
+
submit: ({ value }) => renderSubmit(config47, format5(value ?? "")),
|
|
69433
69433
|
cancel: activeRenderer
|
|
69434
69434
|
};
|
|
69435
69435
|
};
|
|
69436
|
-
var getSelectRenderers = (
|
|
69437
|
-
const { options, question, helpText: _helpText } =
|
|
69436
|
+
var getSelectRenderers = (config47) => {
|
|
69437
|
+
const { options, question, helpText: _helpText } = config47;
|
|
69438
69438
|
const helpText = _helpText ?? "";
|
|
69439
|
-
const maxItemsPerPage =
|
|
69439
|
+
const maxItemsPerPage = config47.maxItemsPerPage ?? 32;
|
|
69440
69440
|
const defaultRenderer = ({ cursor = 0, value }) => {
|
|
69441
69441
|
const renderOption = (opt, i) => {
|
|
69442
69442
|
const { label: optionLabel, value: optionValue } = opt;
|
|
@@ -69511,21 +69511,21 @@ ${space(2)}${dim("...")}` : ""}`,
|
|
|
69511
69511
|
submit: ({ value }) => {
|
|
69512
69512
|
if (Array.isArray(value)) {
|
|
69513
69513
|
return renderSubmit(
|
|
69514
|
-
|
|
69514
|
+
config47,
|
|
69515
69515
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
69516
69516
|
);
|
|
69517
69517
|
}
|
|
69518
69518
|
return renderSubmit(
|
|
69519
|
-
|
|
69519
|
+
config47,
|
|
69520
69520
|
options.find((o) => o.value === value)?.label
|
|
69521
69521
|
);
|
|
69522
69522
|
},
|
|
69523
69523
|
cancel: defaultRenderer
|
|
69524
69524
|
};
|
|
69525
69525
|
};
|
|
69526
|
-
var getSelectListRenderers = (
|
|
69527
|
-
const { question, helpText: _helpText } =
|
|
69528
|
-
let options =
|
|
69526
|
+
var getSelectListRenderers = (config47) => {
|
|
69527
|
+
const { question, helpText: _helpText } = config47;
|
|
69528
|
+
let options = config47.options;
|
|
69529
69529
|
const helpText = _helpText ?? "";
|
|
69530
69530
|
const { rows } = stdout;
|
|
69531
69531
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -69606,20 +69606,20 @@ var getSelectListRenderers = (config40) => {
|
|
|
69606
69606
|
submit: ({ value }) => {
|
|
69607
69607
|
if (Array.isArray(value)) {
|
|
69608
69608
|
return renderSubmit(
|
|
69609
|
-
|
|
69609
|
+
config47,
|
|
69610
69610
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
69611
69611
|
);
|
|
69612
69612
|
}
|
|
69613
69613
|
return renderSubmit(
|
|
69614
|
-
|
|
69614
|
+
config47,
|
|
69615
69615
|
options.find((o) => o.value === value)?.value
|
|
69616
69616
|
);
|
|
69617
69617
|
},
|
|
69618
69618
|
cancel: defaultRenderer
|
|
69619
69619
|
};
|
|
69620
69620
|
};
|
|
69621
|
-
var getConfirmRenderers = (
|
|
69622
|
-
const { activeText, inactiveText, question, helpText: _helpText } =
|
|
69621
|
+
var getConfirmRenderers = (config47) => {
|
|
69622
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config47;
|
|
69623
69623
|
const helpText = _helpText ?? "";
|
|
69624
69624
|
const active = activeText || "Yes";
|
|
69625
69625
|
const inactive = inactiveText || "No";
|
|
@@ -69636,7 +69636,7 @@ var getConfirmRenderers = (config40) => {
|
|
|
69636
69636
|
active: defaultRenderer,
|
|
69637
69637
|
confirm: defaultRenderer,
|
|
69638
69638
|
error: defaultRenderer,
|
|
69639
|
-
submit: ({ value }) => renderSubmit(
|
|
69639
|
+
submit: ({ value }) => renderSubmit(config47, value ? "yes" : "no"),
|
|
69640
69640
|
cancel: defaultRenderer
|
|
69641
69641
|
};
|
|
69642
69642
|
};
|
|
@@ -70604,23 +70604,23 @@ var YargsParser = class {
|
|
|
70604
70604
|
const configPath = argv2[configKey] || configLookup[configKey];
|
|
70605
70605
|
if (configPath) {
|
|
70606
70606
|
try {
|
|
70607
|
-
let
|
|
70607
|
+
let config47 = null;
|
|
70608
70608
|
const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
|
|
70609
70609
|
const resolveConfig = flags.configs[configKey];
|
|
70610
70610
|
if (typeof resolveConfig === "function") {
|
|
70611
70611
|
try {
|
|
70612
|
-
|
|
70612
|
+
config47 = resolveConfig(resolvedConfigPath);
|
|
70613
70613
|
} catch (e) {
|
|
70614
|
-
|
|
70614
|
+
config47 = e;
|
|
70615
70615
|
}
|
|
70616
|
-
if (
|
|
70617
|
-
error2 =
|
|
70616
|
+
if (config47 instanceof Error) {
|
|
70617
|
+
error2 = config47;
|
|
70618
70618
|
return;
|
|
70619
70619
|
}
|
|
70620
70620
|
} else {
|
|
70621
|
-
|
|
70621
|
+
config47 = mixin2.require(resolvedConfigPath);
|
|
70622
70622
|
}
|
|
70623
|
-
setConfigObject(
|
|
70623
|
+
setConfigObject(config47);
|
|
70624
70624
|
} catch (ex) {
|
|
70625
70625
|
if (ex.name === "PermissionDenied")
|
|
70626
70626
|
error2 = ex;
|
|
@@ -70630,9 +70630,9 @@ var YargsParser = class {
|
|
|
70630
70630
|
}
|
|
70631
70631
|
});
|
|
70632
70632
|
}
|
|
70633
|
-
function setConfigObject(
|
|
70634
|
-
Object.keys(
|
|
70635
|
-
const value =
|
|
70633
|
+
function setConfigObject(config47, prev) {
|
|
70634
|
+
Object.keys(config47).forEach(function(key) {
|
|
70635
|
+
const value = config47[key];
|
|
70636
70636
|
const fullKey = prev ? prev + "." + key : key;
|
|
70637
70637
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
|
|
70638
70638
|
setConfigObject(value, fullKey);
|
|
@@ -71784,11 +71784,11 @@ var CommandInstance = class {
|
|
|
71784
71784
|
});
|
|
71785
71785
|
if (!unparsed.length)
|
|
71786
71786
|
return;
|
|
71787
|
-
const
|
|
71787
|
+
const config47 = Object.assign({}, options.configuration, {
|
|
71788
71788
|
"populate--": false
|
|
71789
71789
|
});
|
|
71790
71790
|
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
|
|
71791
|
-
configuration:
|
|
71791
|
+
configuration: config47
|
|
71792
71792
|
}));
|
|
71793
71793
|
if (parsed.error) {
|
|
71794
71794
|
yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
|
|
@@ -73011,31 +73011,31 @@ ${customMsgs.join("\n")}` : "";
|
|
|
73011
73011
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
|
|
73012
73012
|
var previouslyVisitedConfigs = [];
|
|
73013
73013
|
var shim2;
|
|
73014
|
-
function applyExtends(
|
|
73014
|
+
function applyExtends(config47, cwd, mergeExtends, _shim) {
|
|
73015
73015
|
shim2 = _shim;
|
|
73016
73016
|
let defaultConfig = {};
|
|
73017
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
73018
|
-
if (typeof
|
|
73017
|
+
if (Object.prototype.hasOwnProperty.call(config47, "extends")) {
|
|
73018
|
+
if (typeof config47.extends !== "string")
|
|
73019
73019
|
return defaultConfig;
|
|
73020
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
73020
|
+
const isPath = /\.json|\..*rc$/.test(config47.extends);
|
|
73021
73021
|
let pathToDefault = null;
|
|
73022
73022
|
if (!isPath) {
|
|
73023
73023
|
try {
|
|
73024
|
-
pathToDefault = require.resolve(
|
|
73024
|
+
pathToDefault = require.resolve(config47.extends);
|
|
73025
73025
|
} catch (_err) {
|
|
73026
|
-
return
|
|
73026
|
+
return config47;
|
|
73027
73027
|
}
|
|
73028
73028
|
} else {
|
|
73029
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
73029
|
+
pathToDefault = getPathToDefaultConfig(cwd, config47.extends);
|
|
73030
73030
|
}
|
|
73031
73031
|
checkForCircularExtends(pathToDefault);
|
|
73032
73032
|
previouslyVisitedConfigs.push(pathToDefault);
|
|
73033
|
-
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(
|
|
73034
|
-
delete
|
|
73033
|
+
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config47.extends);
|
|
73034
|
+
delete config47.extends;
|
|
73035
73035
|
defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
|
|
73036
73036
|
}
|
|
73037
73037
|
previouslyVisitedConfigs = [];
|
|
73038
|
-
return mergeExtends ? mergeDeep(defaultConfig,
|
|
73038
|
+
return mergeExtends ? mergeDeep(defaultConfig, config47) : Object.assign({}, defaultConfig, config47);
|
|
73039
73039
|
}
|
|
73040
73040
|
function checkForCircularExtends(cfgPath) {
|
|
73041
73041
|
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
|
@@ -73811,9 +73811,9 @@ var YargsInstance = class {
|
|
|
73811
73811
|
}
|
|
73812
73812
|
return maybePromise;
|
|
73813
73813
|
}
|
|
73814
|
-
parserConfiguration(
|
|
73815
|
-
argsert("<object>", [
|
|
73816
|
-
__classPrivateFieldSet(this, _YargsInstance_parserConfig,
|
|
73814
|
+
parserConfiguration(config47) {
|
|
73815
|
+
argsert("<object>", [config47], arguments.length);
|
|
73816
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config47, "f");
|
|
73817
73817
|
return this;
|
|
73818
73818
|
}
|
|
73819
73819
|
pkgConf(key, rootPath) {
|
|
@@ -73985,9 +73985,9 @@ var YargsInstance = class {
|
|
|
73985
73985
|
return this;
|
|
73986
73986
|
}
|
|
73987
73987
|
}
|
|
73988
|
-
usageConfiguration(
|
|
73989
|
-
argsert("<object>", [
|
|
73990
|
-
__classPrivateFieldSet(this, _YargsInstance_usageConfig,
|
|
73988
|
+
usageConfiguration(config47) {
|
|
73989
|
+
argsert("<object>", [config47], arguments.length);
|
|
73990
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config47, "f");
|
|
73991
73991
|
return this;
|
|
73992
73992
|
}
|
|
73993
73993
|
version(opt, msg, ver) {
|
|
@@ -74393,11 +74393,11 @@ var YargsInstance = class {
|
|
|
74393
74393
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
|
|
74394
74394
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
|
|
74395
74395
|
const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
|
|
74396
|
-
const
|
|
74396
|
+
const config47 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
|
|
74397
74397
|
"populate--": true
|
|
74398
74398
|
});
|
|
74399
74399
|
const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
|
|
74400
|
-
configuration: { "parse-positional-numbers": false, ...
|
|
74400
|
+
configuration: { "parse-positional-numbers": false, ...config47 }
|
|
74401
74401
|
}));
|
|
74402
74402
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
74403
74403
|
let argvPromise = void 0;
|
|
@@ -74560,7 +74560,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
74560
74560
|
var yargs_default = Yargs;
|
|
74561
74561
|
|
|
74562
74562
|
// package.json
|
|
74563
|
-
var version = "2.43.
|
|
74563
|
+
var version = "2.43.1";
|
|
74564
74564
|
|
|
74565
74565
|
// src/metrics.ts
|
|
74566
74566
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -74604,12 +74604,12 @@ function getGlobalWranglerConfigPath() {
|
|
|
74604
74604
|
}
|
|
74605
74605
|
|
|
74606
74606
|
// src/helpers/metrics-config.ts
|
|
74607
|
-
function writeMetricsConfig(
|
|
74607
|
+
function writeMetricsConfig(config47) {
|
|
74608
74608
|
(0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
|
|
74609
74609
|
(0, import_node_fs2.writeFileSync)(
|
|
74610
74610
|
getMetricsConfigPath(),
|
|
74611
74611
|
JSON.stringify(
|
|
74612
|
-
|
|
74612
|
+
config47,
|
|
74613
74613
|
(_key, value) => value instanceof Date ? value.toISOString() : value,
|
|
74614
74614
|
" "
|
|
74615
74615
|
)
|
|
@@ -74617,9 +74617,9 @@ function writeMetricsConfig(config40) {
|
|
|
74617
74617
|
}
|
|
74618
74618
|
function readMetricsConfig() {
|
|
74619
74619
|
try {
|
|
74620
|
-
const
|
|
74620
|
+
const config47 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
74621
74621
|
return JSON.parse(
|
|
74622
|
-
|
|
74622
|
+
config47,
|
|
74623
74623
|
(key, value) => key === "date" ? new Date(value) : value
|
|
74624
74624
|
);
|
|
74625
74625
|
} catch {
|
|
@@ -74629,10 +74629,10 @@ function readMetricsConfig() {
|
|
|
74629
74629
|
function getMetricsConfigPath() {
|
|
74630
74630
|
return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
|
|
74631
74631
|
}
|
|
74632
|
-
function getDeviceId(
|
|
74633
|
-
const deviceId =
|
|
74634
|
-
if (
|
|
74635
|
-
writeMetricsConfig({ ...
|
|
74632
|
+
function getDeviceId(config47) {
|
|
74633
|
+
const deviceId = config47.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
74634
|
+
if (config47.deviceId === void 0) {
|
|
74635
|
+
writeMetricsConfig({ ...config47, deviceId });
|
|
74636
74636
|
}
|
|
74637
74637
|
return deviceId;
|
|
74638
74638
|
}
|
|
@@ -74907,10 +74907,10 @@ function getPlatform() {
|
|
|
74907
74907
|
function createReporter() {
|
|
74908
74908
|
const events = [];
|
|
74909
74909
|
const als = new import_node_async_hooks.AsyncLocalStorage();
|
|
74910
|
-
const
|
|
74911
|
-
const isFirstUsage =
|
|
74910
|
+
const config47 = readMetricsConfig() ?? {};
|
|
74911
|
+
const isFirstUsage = config47.c3permission === void 0;
|
|
74912
74912
|
const isEnabled = isTelemetryEnabled();
|
|
74913
|
-
const deviceId = getDeviceId(
|
|
74913
|
+
const deviceId = getDeviceId(config47);
|
|
74914
74914
|
const packageManager = detectPackageManager();
|
|
74915
74915
|
const platform3 = getPlatform();
|
|
74916
74916
|
const amplitude_session_id = Date.now();
|
|
@@ -74943,7 +74943,7 @@ function createReporter() {
|
|
|
74943
74943
|
if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
|
|
74944
74944
|
return false;
|
|
74945
74945
|
}
|
|
74946
|
-
return hasSparrowSourceKey() && getC3Permission(
|
|
74946
|
+
return hasSparrowSourceKey() && getC3Permission(config47).enabled;
|
|
74947
74947
|
}
|
|
74948
74948
|
async function waitForAllEventsSettled() {
|
|
74949
74949
|
await Promise.allSettled(events);
|
|
@@ -75049,20 +75049,20 @@ function initializeC3Permission(enabled = true) {
|
|
|
75049
75049
|
date: /* @__PURE__ */ new Date()
|
|
75050
75050
|
};
|
|
75051
75051
|
}
|
|
75052
|
-
function getC3Permission(
|
|
75053
|
-
if (!
|
|
75054
|
-
|
|
75055
|
-
writeMetricsConfig(
|
|
75052
|
+
function getC3Permission(config47 = readMetricsConfig() ?? {}) {
|
|
75053
|
+
if (!config47.c3permission) {
|
|
75054
|
+
config47.c3permission = initializeC3Permission();
|
|
75055
|
+
writeMetricsConfig(config47);
|
|
75056
75056
|
}
|
|
75057
|
-
return
|
|
75057
|
+
return config47.c3permission;
|
|
75058
75058
|
}
|
|
75059
75059
|
function updateC3Pemission(enabled) {
|
|
75060
|
-
const
|
|
75061
|
-
if (
|
|
75060
|
+
const config47 = readMetricsConfig();
|
|
75061
|
+
if (config47.c3permission?.enabled === enabled) {
|
|
75062
75062
|
return;
|
|
75063
75063
|
}
|
|
75064
|
-
|
|
75065
|
-
writeMetricsConfig(
|
|
75064
|
+
config47.c3permission = initializeC3Permission(enabled);
|
|
75065
|
+
writeMetricsConfig(config47);
|
|
75066
75066
|
}
|
|
75067
75067
|
var runTelemetryCommand = (action) => {
|
|
75068
75068
|
const logTelemetryStatus = (enabled) => {
|
|
@@ -75107,24 +75107,24 @@ var import_haikunator = __toESM(require_dist_web());
|
|
|
75107
75107
|
var import_fs6 = require("fs");
|
|
75108
75108
|
var import_path6 = __toESM(require("path"));
|
|
75109
75109
|
var import_undici2 = __toESM(require_undici());
|
|
75110
|
-
var installPackages = async (packages,
|
|
75110
|
+
var installPackages = async (packages, config47 = {}) => {
|
|
75111
75111
|
const { npm: npm25 } = detectPackageManager();
|
|
75112
75112
|
let saveFlag;
|
|
75113
75113
|
let cmd;
|
|
75114
75114
|
switch (npm25) {
|
|
75115
75115
|
case "yarn":
|
|
75116
75116
|
cmd = "add";
|
|
75117
|
-
saveFlag =
|
|
75117
|
+
saveFlag = config47.dev ? "-D" : "";
|
|
75118
75118
|
break;
|
|
75119
75119
|
case "bun":
|
|
75120
75120
|
cmd = "add";
|
|
75121
|
-
saveFlag =
|
|
75121
|
+
saveFlag = config47.dev ? "-d" : "";
|
|
75122
75122
|
break;
|
|
75123
75123
|
case "npm":
|
|
75124
75124
|
case "pnpm":
|
|
75125
75125
|
default:
|
|
75126
75126
|
cmd = "install";
|
|
75127
|
-
saveFlag =
|
|
75127
|
+
saveFlag = config47.dev ? "--save-dev" : "";
|
|
75128
75128
|
break;
|
|
75129
75129
|
}
|
|
75130
75130
|
await runCommand(
|
|
@@ -75139,7 +75139,7 @@ var installPackages = async (packages, config40 = {}) => {
|
|
|
75139
75139
|
...npm25 === "npm" ? ["--legacy-peer-deps"] : []
|
|
75140
75140
|
],
|
|
75141
75141
|
{
|
|
75142
|
-
...
|
|
75142
|
+
...config47,
|
|
75143
75143
|
silent: true
|
|
75144
75144
|
}
|
|
75145
75145
|
);
|
|
@@ -76080,7 +76080,7 @@ var config8 = {
|
|
|
76080
76080
|
var c3_default9 = config8;
|
|
76081
76081
|
|
|
76082
76082
|
// templates/common/c3.ts
|
|
76083
|
-
var
|
|
76083
|
+
var config9 = {
|
|
76084
76084
|
configVersion: 1,
|
|
76085
76085
|
id: "common",
|
|
76086
76086
|
displayName: "Example router & proxy Worker",
|
|
@@ -76098,13 +76098,14 @@ var c3_default10 = {
|
|
|
76098
76098
|
}
|
|
76099
76099
|
}
|
|
76100
76100
|
};
|
|
76101
|
+
var c3_default10 = config9;
|
|
76101
76102
|
|
|
76102
76103
|
// templates/docusaurus/pages/c3.ts
|
|
76103
76104
|
var { npm: npm5 } = detectPackageManager();
|
|
76104
76105
|
var generate8 = async (ctx) => {
|
|
76105
76106
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76106
76107
|
};
|
|
76107
|
-
var
|
|
76108
|
+
var config10 = {
|
|
76108
76109
|
configVersion: 1,
|
|
76109
76110
|
id: "docusaurus",
|
|
76110
76111
|
frameworkCli: "create-docusaurus",
|
|
@@ -76122,14 +76123,14 @@ var config9 = {
|
|
|
76122
76123
|
deployScript: "deploy",
|
|
76123
76124
|
previewScript: "preview"
|
|
76124
76125
|
};
|
|
76125
|
-
var c3_default11 =
|
|
76126
|
+
var c3_default11 = config10;
|
|
76126
76127
|
|
|
76127
76128
|
// templates/docusaurus/workers/c3.ts
|
|
76128
76129
|
var { npm: npm6 } = detectPackageManager();
|
|
76129
76130
|
var generate9 = async (ctx) => {
|
|
76130
76131
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76131
76132
|
};
|
|
76132
|
-
var
|
|
76133
|
+
var config11 = {
|
|
76133
76134
|
configVersion: 1,
|
|
76134
76135
|
id: "docusaurus",
|
|
76135
76136
|
frameworkCli: "create-docusaurus",
|
|
@@ -76150,14 +76151,14 @@ var config10 = {
|
|
|
76150
76151
|
deployScript: "deploy",
|
|
76151
76152
|
previewScript: "preview"
|
|
76152
76153
|
};
|
|
76153
|
-
var c3_default12 =
|
|
76154
|
+
var c3_default12 = config11;
|
|
76154
76155
|
|
|
76155
76156
|
// templates/docusaurus/c3.ts
|
|
76156
|
-
var
|
|
76157
|
+
var config12 = {
|
|
76157
76158
|
displayName: "Docusaurus",
|
|
76158
76159
|
platformVariants: { pages: c3_default11, workers: c3_default12 }
|
|
76159
76160
|
};
|
|
76160
|
-
var c3_default13 =
|
|
76161
|
+
var c3_default13 = config12;
|
|
76161
76162
|
|
|
76162
76163
|
// templates/gatsby/pages/c3.ts
|
|
76163
76164
|
var { npm: npm7 } = detectPackageManager();
|
|
@@ -76180,7 +76181,7 @@ var generate10 = async (ctx) => {
|
|
|
76180
76181
|
}
|
|
76181
76182
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76182
76183
|
};
|
|
76183
|
-
var
|
|
76184
|
+
var config13 = {
|
|
76184
76185
|
configVersion: 1,
|
|
76185
76186
|
id: "gatsby",
|
|
76186
76187
|
frameworkCli: "gatsby",
|
|
@@ -76198,7 +76199,7 @@ var config12 = {
|
|
|
76198
76199
|
deployScript: "deploy",
|
|
76199
76200
|
previewScript: "preview"
|
|
76200
76201
|
};
|
|
76201
|
-
var c3_default14 =
|
|
76202
|
+
var c3_default14 = config13;
|
|
76202
76203
|
|
|
76203
76204
|
// templates/gatsby/workers/c3.ts
|
|
76204
76205
|
var { npm: npm8 } = detectPackageManager();
|
|
@@ -76221,7 +76222,7 @@ var generate11 = async (ctx) => {
|
|
|
76221
76222
|
}
|
|
76222
76223
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76223
76224
|
};
|
|
76224
|
-
var
|
|
76225
|
+
var config14 = {
|
|
76225
76226
|
configVersion: 1,
|
|
76226
76227
|
id: "gatsby",
|
|
76227
76228
|
frameworkCli: "gatsby",
|
|
@@ -76242,17 +76243,17 @@ var config13 = {
|
|
|
76242
76243
|
deployScript: "deploy",
|
|
76243
76244
|
previewScript: "preview"
|
|
76244
76245
|
};
|
|
76245
|
-
var c3_default15 =
|
|
76246
|
+
var c3_default15 = config14;
|
|
76246
76247
|
|
|
76247
76248
|
// templates/gatsby/c3.ts
|
|
76248
|
-
var
|
|
76249
|
+
var config15 = {
|
|
76249
76250
|
displayName: "Gatsby",
|
|
76250
76251
|
platformVariants: { pages: c3_default14, workers: c3_default15 }
|
|
76251
76252
|
};
|
|
76252
|
-
var c3_default16 =
|
|
76253
|
+
var c3_default16 = config15;
|
|
76253
76254
|
|
|
76254
76255
|
// templates/hello-world-assets-only/c3.ts
|
|
76255
|
-
var
|
|
76256
|
+
var config16 = {
|
|
76256
76257
|
configVersion: 1,
|
|
76257
76258
|
id: "hello-world-assets-only",
|
|
76258
76259
|
path: "templates/hello-world-assets-only",
|
|
@@ -76263,10 +76264,10 @@ var config15 = {
|
|
|
76263
76264
|
path: "./templates"
|
|
76264
76265
|
}
|
|
76265
76266
|
};
|
|
76266
|
-
var c3_default17 =
|
|
76267
|
+
var c3_default17 = config16;
|
|
76267
76268
|
|
|
76268
76269
|
// templates/hello-world-durable-object-with-assets/c3.ts
|
|
76269
|
-
var
|
|
76270
|
+
var config17 = {
|
|
76270
76271
|
configVersion: 1,
|
|
76271
76272
|
id: "hello-world-durable-object-with-assets",
|
|
76272
76273
|
path: "templates/hello-world-durable-object-with-assets",
|
|
@@ -76284,10 +76285,10 @@ var config16 = {
|
|
|
76284
76285
|
}
|
|
76285
76286
|
}
|
|
76286
76287
|
};
|
|
76287
|
-
var c3_default18 =
|
|
76288
|
+
var c3_default18 = config17;
|
|
76288
76289
|
|
|
76289
76290
|
// templates/hello-world-durable-object/c3.ts
|
|
76290
|
-
var
|
|
76291
|
+
var config18 = {
|
|
76291
76292
|
configVersion: 1,
|
|
76292
76293
|
id: "hello-world-durable-object",
|
|
76293
76294
|
displayName: "Worker + Durable Objects",
|
|
@@ -76304,9 +76305,10 @@ var c3_default19 = {
|
|
|
76304
76305
|
}
|
|
76305
76306
|
}
|
|
76306
76307
|
};
|
|
76308
|
+
var c3_default19 = config18;
|
|
76307
76309
|
|
|
76308
76310
|
// templates/hello-world-with-assets/c3.ts
|
|
76309
|
-
var
|
|
76311
|
+
var config19 = {
|
|
76310
76312
|
configVersion: 1,
|
|
76311
76313
|
id: "hello-world-with-assets",
|
|
76312
76314
|
path: "templates/hello-world-with-assets",
|
|
@@ -76327,6 +76329,7 @@ var c3_default20 = {
|
|
|
76327
76329
|
}
|
|
76328
76330
|
}
|
|
76329
76331
|
};
|
|
76332
|
+
var c3_default20 = config19;
|
|
76330
76333
|
|
|
76331
76334
|
// templates/hello-world/c3.ts
|
|
76332
76335
|
var import_promises2 = require("node:fs/promises");
|
|
@@ -76377,7 +76380,7 @@ var generate12 = async (ctx) => {
|
|
|
76377
76380
|
]);
|
|
76378
76381
|
logRaw("");
|
|
76379
76382
|
};
|
|
76380
|
-
var
|
|
76383
|
+
var config20 = {
|
|
76381
76384
|
configVersion: 1,
|
|
76382
76385
|
id: "hono",
|
|
76383
76386
|
frameworkCli: "create-hono",
|
|
@@ -76397,7 +76400,7 @@ var config17 = {
|
|
|
76397
76400
|
deployScript: "deploy",
|
|
76398
76401
|
previewScript: "dev"
|
|
76399
76402
|
};
|
|
76400
|
-
var c3_default22 =
|
|
76403
|
+
var c3_default22 = config20;
|
|
76401
76404
|
|
|
76402
76405
|
// templates/hono/workers/c3.ts
|
|
76403
76406
|
var generate13 = async (ctx) => {
|
|
@@ -76412,7 +76415,7 @@ var generate13 = async (ctx) => {
|
|
|
76412
76415
|
]);
|
|
76413
76416
|
logRaw("");
|
|
76414
76417
|
};
|
|
76415
|
-
var
|
|
76418
|
+
var config21 = {
|
|
76416
76419
|
configVersion: 1,
|
|
76417
76420
|
id: "hono",
|
|
76418
76421
|
frameworkCli: "create-hono",
|
|
@@ -76432,14 +76435,14 @@ var config18 = {
|
|
|
76432
76435
|
deployScript: "deploy",
|
|
76433
76436
|
previewScript: "dev"
|
|
76434
76437
|
};
|
|
76435
|
-
var c3_default23 =
|
|
76438
|
+
var c3_default23 = config21;
|
|
76436
76439
|
|
|
76437
76440
|
// templates/hono/c3.ts
|
|
76438
|
-
var
|
|
76441
|
+
var config22 = {
|
|
76439
76442
|
displayName: "Hono",
|
|
76440
76443
|
platformVariants: { pages: c3_default22, workers: c3_default23 }
|
|
76441
76444
|
};
|
|
76442
|
-
var c3_default24 =
|
|
76445
|
+
var c3_default24 = config22;
|
|
76443
76446
|
|
|
76444
76447
|
// templates/next/c3.ts
|
|
76445
76448
|
var import_path10 = require("path");
|
|
@@ -76691,7 +76694,7 @@ var updateNuxtConfig = () => {
|
|
|
76691
76694
|
});
|
|
76692
76695
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76693
76696
|
};
|
|
76694
|
-
var
|
|
76697
|
+
var config23 = {
|
|
76695
76698
|
configVersion: 1,
|
|
76696
76699
|
id: "nuxt",
|
|
76697
76700
|
frameworkCli: "nuxi",
|
|
@@ -76714,7 +76717,7 @@ var config20 = {
|
|
|
76714
76717
|
deployScript: "deploy",
|
|
76715
76718
|
previewScript: "preview"
|
|
76716
76719
|
};
|
|
76717
|
-
var c3_default26 =
|
|
76720
|
+
var c3_default26 = config23;
|
|
76718
76721
|
|
|
76719
76722
|
// templates/nuxt/workers/c3.ts
|
|
76720
76723
|
var recast7 = __toESM(require_main3());
|
|
@@ -76801,7 +76804,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76801
76804
|
});
|
|
76802
76805
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76803
76806
|
};
|
|
76804
|
-
var
|
|
76807
|
+
var config24 = {
|
|
76805
76808
|
configVersion: 1,
|
|
76806
76809
|
id: "nuxt",
|
|
76807
76810
|
frameworkCli: "nuxi",
|
|
@@ -76824,17 +76827,17 @@ var config21 = {
|
|
|
76824
76827
|
deployScript: "deploy",
|
|
76825
76828
|
previewScript: "preview"
|
|
76826
76829
|
};
|
|
76827
|
-
var c3_default27 =
|
|
76830
|
+
var c3_default27 = config24;
|
|
76828
76831
|
|
|
76829
76832
|
// templates/nuxt/c3.ts
|
|
76830
|
-
var
|
|
76833
|
+
var config25 = {
|
|
76831
76834
|
displayName: "Nuxt",
|
|
76832
76835
|
platformVariants: { pages: c3_default26, workers: c3_default27 }
|
|
76833
76836
|
};
|
|
76834
|
-
var c3_default28 =
|
|
76837
|
+
var c3_default28 = config25;
|
|
76835
76838
|
|
|
76836
76839
|
// templates/openapi/c3.ts
|
|
76837
|
-
var
|
|
76840
|
+
var config26 = {
|
|
76838
76841
|
configVersion: 1,
|
|
76839
76842
|
id: "openapi",
|
|
76840
76843
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -76844,6 +76847,7 @@ var c3_default29 = {
|
|
|
76844
76847
|
path: "./ts"
|
|
76845
76848
|
}
|
|
76846
76849
|
};
|
|
76850
|
+
var c3_default29 = config26;
|
|
76847
76851
|
|
|
76848
76852
|
// templates/pre-existing/c3.ts
|
|
76849
76853
|
var import_promises3 = require("fs/promises");
|
|
@@ -76993,10 +76997,11 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
76993
76997
|
(0, import_path11.join)(ctx.project.path, "wrangler.toml")
|
|
76994
76998
|
);
|
|
76995
76999
|
}
|
|
76996
|
-
var
|
|
77000
|
+
var config27 = {
|
|
76997
77001
|
configVersion: 1,
|
|
76998
77002
|
id: "pre-existing",
|
|
76999
77003
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
77004
|
+
description: "Fetch a Worker initialized from the Cloudflare dashboard.",
|
|
77000
77005
|
platform: "workers",
|
|
77001
77006
|
hidden: true,
|
|
77002
77007
|
copyFiles: {
|
|
@@ -77008,6 +77013,7 @@ var c3_default30 = {
|
|
|
77008
77013
|
copyFiles: copyExistingWorkerFiles
|
|
77009
77014
|
})
|
|
77010
77015
|
};
|
|
77016
|
+
var c3_default30 = config27;
|
|
77011
77017
|
function buildConfigure(params) {
|
|
77012
77018
|
return async function configure21(ctx) {
|
|
77013
77019
|
const loginSuccess = await params.login(ctx);
|
|
@@ -77021,7 +77027,7 @@ function buildConfigure(params) {
|
|
|
77021
77027
|
}
|
|
77022
77028
|
|
|
77023
77029
|
// templates/queues/c3.ts
|
|
77024
|
-
var
|
|
77030
|
+
var config28 = {
|
|
77025
77031
|
configVersion: 1,
|
|
77026
77032
|
id: "queues",
|
|
77027
77033
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -77048,6 +77054,7 @@ var c3_default31 = {
|
|
|
77048
77054
|
]
|
|
77049
77055
|
}
|
|
77050
77056
|
};
|
|
77057
|
+
var c3_default31 = config28;
|
|
77051
77058
|
|
|
77052
77059
|
// templates/qwik/pages/c3.ts
|
|
77053
77060
|
var recast8 = __toESM(require_main3());
|
|
@@ -77132,7 +77139,7 @@ var populateCloudflareEnv = () => {
|
|
|
77132
77139
|
});
|
|
77133
77140
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77134
77141
|
};
|
|
77135
|
-
var
|
|
77142
|
+
var config29 = {
|
|
77136
77143
|
configVersion: 1,
|
|
77137
77144
|
id: "qwik",
|
|
77138
77145
|
frameworkCli: "create-qwik",
|
|
@@ -77155,7 +77162,7 @@ var config23 = {
|
|
|
77155
77162
|
deployScript: "deploy",
|
|
77156
77163
|
previewScript: "preview"
|
|
77157
77164
|
};
|
|
77158
|
-
var c3_default32 =
|
|
77165
|
+
var c3_default32 = config29;
|
|
77159
77166
|
|
|
77160
77167
|
// templates/qwik/workers/c3.ts
|
|
77161
77168
|
var recast9 = __toESM(require_main3());
|
|
@@ -77243,7 +77250,7 @@ var populateCloudflareEnv2 = () => {
|
|
|
77243
77250
|
});
|
|
77244
77251
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77245
77252
|
};
|
|
77246
|
-
var
|
|
77253
|
+
var config30 = {
|
|
77247
77254
|
configVersion: 1,
|
|
77248
77255
|
id: "qwik",
|
|
77249
77256
|
frameworkCli: "create-qwik",
|
|
@@ -77266,14 +77273,14 @@ var config24 = {
|
|
|
77266
77273
|
deployScript: "deploy",
|
|
77267
77274
|
previewScript: "preview"
|
|
77268
77275
|
};
|
|
77269
|
-
var c3_default33 =
|
|
77276
|
+
var c3_default33 = config30;
|
|
77270
77277
|
|
|
77271
77278
|
// templates/qwik/c3.ts
|
|
77272
|
-
var
|
|
77279
|
+
var config31 = {
|
|
77273
77280
|
displayName: "Qwik",
|
|
77274
77281
|
platformVariants: { pages: c3_default32, workers: c3_default33 }
|
|
77275
77282
|
};
|
|
77276
|
-
var c3_default34 =
|
|
77283
|
+
var c3_default34 = config31;
|
|
77277
77284
|
|
|
77278
77285
|
// templates/react-router/c3.ts
|
|
77279
77286
|
var { npm: npm14 } = detectPackageManager();
|
|
@@ -77288,7 +77295,7 @@ var generate19 = async (ctx) => {
|
|
|
77288
77295
|
]);
|
|
77289
77296
|
logRaw("");
|
|
77290
77297
|
};
|
|
77291
|
-
var
|
|
77298
|
+
var config32 = {
|
|
77292
77299
|
configVersion: 1,
|
|
77293
77300
|
id: "react-router",
|
|
77294
77301
|
platform: "workers",
|
|
@@ -77310,7 +77317,7 @@ var config26 = {
|
|
|
77310
77317
|
deployScript: "deploy",
|
|
77311
77318
|
previewScript: "preview"
|
|
77312
77319
|
};
|
|
77313
|
-
var c3_default35 =
|
|
77320
|
+
var c3_default35 = config32;
|
|
77314
77321
|
|
|
77315
77322
|
// templates/react/pages/c3.ts
|
|
77316
77323
|
var { npm: npm15 } = detectPackageManager();
|
|
@@ -77343,7 +77350,7 @@ var variantsOptions = [
|
|
|
77343
77350
|
label: "JavaScript + SWC"
|
|
77344
77351
|
}
|
|
77345
77352
|
];
|
|
77346
|
-
var
|
|
77353
|
+
var config33 = {
|
|
77347
77354
|
configVersion: 1,
|
|
77348
77355
|
id: "react",
|
|
77349
77356
|
// React's documentation now recommends using create-vite.
|
|
@@ -77362,7 +77369,7 @@ var config27 = {
|
|
|
77362
77369
|
deployScript: "deploy",
|
|
77363
77370
|
previewScript: "preview"
|
|
77364
77371
|
};
|
|
77365
|
-
var c3_default36 =
|
|
77372
|
+
var c3_default36 = config33;
|
|
77366
77373
|
|
|
77367
77374
|
// templates/react/workers/c3.ts
|
|
77368
77375
|
var import_assert2 = __toESM(require("assert"));
|
|
@@ -77411,9 +77418,9 @@ function transformViteConfig(ctx) {
|
|
|
77411
77418
|
if (callee.name !== "defineConfig") {
|
|
77412
77419
|
return this.traverse(n);
|
|
77413
77420
|
}
|
|
77414
|
-
const
|
|
77415
|
-
(0, import_assert2.default)(t.ObjectExpression.check(
|
|
77416
|
-
const pluginsProp =
|
|
77421
|
+
const config47 = n.node.arguments[0];
|
|
77422
|
+
(0, import_assert2.default)(t.ObjectExpression.check(config47));
|
|
77423
|
+
const pluginsProp = config47.properties.find((prop) => isPluginsProp(prop));
|
|
77417
77424
|
(0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
77418
77425
|
pluginsProp.value.elements.push(
|
|
77419
77426
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -77470,7 +77477,7 @@ async function getVariant() {
|
|
|
77470
77477
|
(0, import_assert2.default)(selected, "Expected a variant to be selected");
|
|
77471
77478
|
return selected;
|
|
77472
77479
|
}
|
|
77473
|
-
var
|
|
77480
|
+
var config34 = {
|
|
77474
77481
|
configVersion: 1,
|
|
77475
77482
|
id: "react",
|
|
77476
77483
|
frameworkCli: "create-vite",
|
|
@@ -77500,14 +77507,14 @@ var config28 = {
|
|
|
77500
77507
|
deployScript: "deploy",
|
|
77501
77508
|
previewScript: "preview"
|
|
77502
77509
|
};
|
|
77503
|
-
var c3_default37 =
|
|
77510
|
+
var c3_default37 = config34;
|
|
77504
77511
|
|
|
77505
77512
|
// templates/react/c3.ts
|
|
77506
|
-
var
|
|
77513
|
+
var config35 = {
|
|
77507
77514
|
displayName: "React",
|
|
77508
77515
|
platformVariants: { pages: c3_default36, workers: c3_default37 }
|
|
77509
77516
|
};
|
|
77510
|
-
var c3_default38 =
|
|
77517
|
+
var c3_default38 = config35;
|
|
77511
77518
|
|
|
77512
77519
|
// templates/remix/pages/c3.ts
|
|
77513
77520
|
var { npm: npm17 } = detectPackageManager();
|
|
@@ -77534,7 +77541,7 @@ var configure14 = async () => {
|
|
|
77534
77541
|
});
|
|
77535
77542
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
77536
77543
|
};
|
|
77537
|
-
var
|
|
77544
|
+
var config36 = {
|
|
77538
77545
|
configVersion: 1,
|
|
77539
77546
|
id: "remix",
|
|
77540
77547
|
frameworkCli: "create-remix",
|
|
@@ -77557,7 +77564,7 @@ var config30 = {
|
|
|
77557
77564
|
deployScript: "deploy",
|
|
77558
77565
|
previewScript: "preview"
|
|
77559
77566
|
};
|
|
77560
|
-
var c3_default39 =
|
|
77567
|
+
var c3_default39 = config36;
|
|
77561
77568
|
|
|
77562
77569
|
// templates/remix/workers/c3.ts
|
|
77563
77570
|
var { npm: npm18 } = detectPackageManager();
|
|
@@ -77576,7 +77583,7 @@ var configure15 = async () => {
|
|
|
77576
77583
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
77577
77584
|
});
|
|
77578
77585
|
};
|
|
77579
|
-
var
|
|
77586
|
+
var config37 = {
|
|
77580
77587
|
configVersion: 1,
|
|
77581
77588
|
id: "remix",
|
|
77582
77589
|
frameworkCli: "create-remix",
|
|
@@ -77599,18 +77606,18 @@ var config31 = {
|
|
|
77599
77606
|
deployScript: "deploy",
|
|
77600
77607
|
previewScript: "preview"
|
|
77601
77608
|
};
|
|
77602
|
-
var c3_default40 =
|
|
77609
|
+
var c3_default40 = config37;
|
|
77603
77610
|
|
|
77604
77611
|
// templates/remix/c3.ts
|
|
77605
|
-
var
|
|
77612
|
+
var config38 = {
|
|
77606
77613
|
displayName: "Remix",
|
|
77607
77614
|
platformVariants: { pages: c3_default39, workers: c3_default40 },
|
|
77608
77615
|
hidden: true
|
|
77609
77616
|
};
|
|
77610
|
-
var c3_default41 =
|
|
77617
|
+
var c3_default41 = config38;
|
|
77611
77618
|
|
|
77612
77619
|
// templates/scheduled/c3.ts
|
|
77613
|
-
var
|
|
77620
|
+
var config39 = {
|
|
77614
77621
|
configVersion: 1,
|
|
77615
77622
|
id: "scheduled",
|
|
77616
77623
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -77627,6 +77634,7 @@ var c3_default42 = {
|
|
|
77627
77634
|
}
|
|
77628
77635
|
}
|
|
77629
77636
|
};
|
|
77637
|
+
var c3_default42 = config39;
|
|
77630
77638
|
|
|
77631
77639
|
// templates/solid/c3.ts
|
|
77632
77640
|
var recast11 = __toESM(require_main3());
|
|
@@ -77673,7 +77681,7 @@ var configure16 = async (ctx) => {
|
|
|
77673
77681
|
}
|
|
77674
77682
|
});
|
|
77675
77683
|
};
|
|
77676
|
-
var
|
|
77684
|
+
var config40 = {
|
|
77677
77685
|
configVersion: 1,
|
|
77678
77686
|
id: "solid",
|
|
77679
77687
|
frameworkCli: "create-solid",
|
|
@@ -77695,7 +77703,7 @@ var config33 = {
|
|
|
77695
77703
|
deployScript: "deploy",
|
|
77696
77704
|
previewScript: "preview"
|
|
77697
77705
|
};
|
|
77698
|
-
var c3_default43 =
|
|
77706
|
+
var c3_default43 = config40;
|
|
77699
77707
|
|
|
77700
77708
|
// templates/svelte/pages/c3.ts
|
|
77701
77709
|
var import_node_fs3 = require("node:fs");
|
|
@@ -77788,7 +77796,7 @@ var updateTypeDefinitions = (ctx) => {
|
|
|
77788
77796
|
}
|
|
77789
77797
|
});
|
|
77790
77798
|
};
|
|
77791
|
-
var
|
|
77799
|
+
var config41 = {
|
|
77792
77800
|
configVersion: 1,
|
|
77793
77801
|
id: "svelte",
|
|
77794
77802
|
frameworkCli: "sv",
|
|
@@ -77818,7 +77826,7 @@ var config34 = {
|
|
|
77818
77826
|
deployScript: "deploy",
|
|
77819
77827
|
previewScript: "preview"
|
|
77820
77828
|
};
|
|
77821
|
-
var c3_default44 =
|
|
77829
|
+
var c3_default44 = config41;
|
|
77822
77830
|
|
|
77823
77831
|
// templates/svelte/workers/c3.ts
|
|
77824
77832
|
var import_node_os4 = require("node:os");
|
|
@@ -77887,7 +77895,7 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
77887
77895
|
}
|
|
77888
77896
|
});
|
|
77889
77897
|
};
|
|
77890
|
-
var
|
|
77898
|
+
var config42 = {
|
|
77891
77899
|
configVersion: 1,
|
|
77892
77900
|
id: "svelte",
|
|
77893
77901
|
frameworkCli: "sv",
|
|
@@ -77917,21 +77925,21 @@ var config35 = {
|
|
|
77917
77925
|
deployScript: "deploy",
|
|
77918
77926
|
previewScript: "preview"
|
|
77919
77927
|
};
|
|
77920
|
-
var c3_default45 =
|
|
77928
|
+
var c3_default45 = config42;
|
|
77921
77929
|
|
|
77922
77930
|
// templates/svelte/c3.ts
|
|
77923
|
-
var
|
|
77931
|
+
var config43 = {
|
|
77924
77932
|
displayName: "SvelteKit",
|
|
77925
77933
|
platformVariants: { pages: c3_default44, workers: c3_default45 }
|
|
77926
77934
|
};
|
|
77927
|
-
var c3_default46 =
|
|
77935
|
+
var c3_default46 = config43;
|
|
77928
77936
|
|
|
77929
77937
|
// templates/vue/pages/c3.ts
|
|
77930
77938
|
var { npm: npm22 } = detectPackageManager();
|
|
77931
77939
|
var generate27 = async (ctx) => {
|
|
77932
77940
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
77933
77941
|
};
|
|
77934
|
-
var
|
|
77942
|
+
var config44 = {
|
|
77935
77943
|
configVersion: 1,
|
|
77936
77944
|
id: "vue",
|
|
77937
77945
|
frameworkCli: "create-vue",
|
|
@@ -77949,7 +77957,7 @@ var config37 = {
|
|
|
77949
77957
|
deployScript: "deploy",
|
|
77950
77958
|
previewScript: "preview"
|
|
77951
77959
|
};
|
|
77952
|
-
var c3_default47 =
|
|
77960
|
+
var c3_default47 = config44;
|
|
77953
77961
|
|
|
77954
77962
|
// templates/vue/workers/c3.ts
|
|
77955
77963
|
var { npm: npm23 } = detectPackageManager();
|
|
@@ -77991,7 +77999,7 @@ function updateTsconfigJson2() {
|
|
|
77991
77999
|
writeJSON("tsconfig.json", tsconfig);
|
|
77992
78000
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
77993
78001
|
}
|
|
77994
|
-
var
|
|
78002
|
+
var config45 = {
|
|
77995
78003
|
configVersion: 1,
|
|
77996
78004
|
id: "vue",
|
|
77997
78005
|
frameworkCli: "create-vue",
|
|
@@ -78024,20 +78032,20 @@ var config38 = {
|
|
|
78024
78032
|
deployScript: "deploy",
|
|
78025
78033
|
previewScript: "preview"
|
|
78026
78034
|
};
|
|
78027
|
-
var c3_default48 =
|
|
78035
|
+
var c3_default48 = config45;
|
|
78028
78036
|
|
|
78029
78037
|
// templates/vue/c3.ts
|
|
78030
|
-
var
|
|
78038
|
+
var config46 = {
|
|
78031
78039
|
displayName: "Vue",
|
|
78032
78040
|
platformVariants: { pages: c3_default47, workers: c3_default48 }
|
|
78033
78041
|
};
|
|
78034
|
-
var c3_default49 =
|
|
78042
|
+
var c3_default49 = config46;
|
|
78035
78043
|
|
|
78036
78044
|
// src/git.ts
|
|
78037
78045
|
var import_node_assert = __toESM(require("node:assert"));
|
|
78038
78046
|
|
|
78039
78047
|
// ../wrangler/package.json
|
|
78040
|
-
var version2 = "4.
|
|
78048
|
+
var version2 = "4.6.0";
|
|
78041
78049
|
|
|
78042
78050
|
// src/git.ts
|
|
78043
78051
|
var offerGit = async (ctx) => {
|
|
@@ -78321,7 +78329,24 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
78321
78329
|
};
|
|
78322
78330
|
}
|
|
78323
78331
|
}
|
|
78324
|
-
function
|
|
78332
|
+
function getOtherTemplateMap({
|
|
78333
|
+
experimental = false
|
|
78334
|
+
}) {
|
|
78335
|
+
if (experimental) {
|
|
78336
|
+
return {};
|
|
78337
|
+
} else {
|
|
78338
|
+
return {
|
|
78339
|
+
common: c3_default10,
|
|
78340
|
+
scheduled: c3_default42,
|
|
78341
|
+
queues: c3_default31,
|
|
78342
|
+
openapi: c3_default29,
|
|
78343
|
+
"pre-existing": c3_default30
|
|
78344
|
+
};
|
|
78345
|
+
}
|
|
78346
|
+
}
|
|
78347
|
+
function getHelloWorldTemplateMap({
|
|
78348
|
+
experimental = false
|
|
78349
|
+
}) {
|
|
78325
78350
|
if (experimental) {
|
|
78326
78351
|
return {};
|
|
78327
78352
|
} else {
|
|
@@ -78395,6 +78420,12 @@ var deriveCorrelatedArgs = (args) => {
|
|
|
78395
78420
|
};
|
|
78396
78421
|
var createContext = async (args, prevArgs) => {
|
|
78397
78422
|
deriveCorrelatedArgs(args);
|
|
78423
|
+
const experimental = args.experimental;
|
|
78424
|
+
const frameworkMap = getFrameworkMap({ experimental });
|
|
78425
|
+
const helloWorldTemplateMap = await getHelloWorldTemplateMap({
|
|
78426
|
+
experimental
|
|
78427
|
+
});
|
|
78428
|
+
const otherTemplateMap = await getOtherTemplateMap({ experimental });
|
|
78398
78429
|
let linesPrinted = 0;
|
|
78399
78430
|
const goBack = async (from) => {
|
|
78400
78431
|
const currentArgs = { ...args };
|
|
@@ -78441,22 +78472,29 @@ var createContext = async (args, prevArgs) => {
|
|
|
78441
78472
|
validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
|
|
78442
78473
|
format: (val) => `./${val}`
|
|
78443
78474
|
});
|
|
78444
|
-
const categoryOptions = [
|
|
78445
|
-
|
|
78446
|
-
|
|
78475
|
+
const categoryOptions = [];
|
|
78476
|
+
if (Object.keys(helloWorldTemplateMap).length) {
|
|
78477
|
+
categoryOptions.push({
|
|
78478
|
+
label: "Hello World example",
|
|
78447
78479
|
value: "hello-world",
|
|
78448
|
-
description: "Select from
|
|
78449
|
-
}
|
|
78450
|
-
|
|
78480
|
+
description: "Select from barebones examples to get started with Workers"
|
|
78481
|
+
});
|
|
78482
|
+
}
|
|
78483
|
+
if (Object.keys(frameworkMap).length) {
|
|
78484
|
+
categoryOptions.push({
|
|
78451
78485
|
label: "Framework Starter",
|
|
78452
78486
|
value: "web-framework",
|
|
78453
78487
|
description: "Select from the most popular full-stack web frameworks"
|
|
78454
|
-
}
|
|
78455
|
-
|
|
78488
|
+
});
|
|
78489
|
+
}
|
|
78490
|
+
if (Object.keys(otherTemplateMap).length) {
|
|
78491
|
+
categoryOptions.push({
|
|
78456
78492
|
label: "Application Starter",
|
|
78457
78493
|
value: "demo",
|
|
78458
78494
|
description: "Select from a range of starter applications using various Cloudflare products"
|
|
78459
|
-
}
|
|
78495
|
+
});
|
|
78496
|
+
}
|
|
78497
|
+
categoryOptions.push(
|
|
78460
78498
|
{
|
|
78461
78499
|
label: "Template from a GitHub repo",
|
|
78462
78500
|
value: "remote-template",
|
|
@@ -78465,7 +78503,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
78465
78503
|
// This is used only if the type is `pre-existing`
|
|
78466
78504
|
{ label: "Others", value: "others", hidden: true },
|
|
78467
78505
|
backOption
|
|
78468
|
-
|
|
78506
|
+
);
|
|
78469
78507
|
const category = await processArgument(args, "category", {
|
|
78470
78508
|
type: "select",
|
|
78471
78509
|
question: "What would you like to start with?",
|
|
@@ -78479,14 +78517,11 @@ var createContext = async (args, prevArgs) => {
|
|
|
78479
78517
|
}
|
|
78480
78518
|
let template;
|
|
78481
78519
|
if (category === "web-framework") {
|
|
78482
|
-
const frameworkMap = getFrameworkMap({
|
|
78483
|
-
experimental: args.experimental
|
|
78484
|
-
});
|
|
78485
78520
|
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
78486
|
-
(acc, [key,
|
|
78487
|
-
if (!
|
|
78521
|
+
(acc, [key, config47]) => {
|
|
78522
|
+
if (!config47.hidden || args.framework) {
|
|
78488
78523
|
acc.push({
|
|
78489
|
-
label:
|
|
78524
|
+
label: config47.displayName,
|
|
78490
78525
|
value: key
|
|
78491
78526
|
});
|
|
78492
78527
|
}
|
|
@@ -78543,18 +78578,14 @@ var createContext = async (args, prevArgs) => {
|
|
|
78543
78578
|
} else if (category === "remote-template") {
|
|
78544
78579
|
template = await processRemoteTemplate(args);
|
|
78545
78580
|
} else {
|
|
78546
|
-
const templateMap =
|
|
78547
|
-
experimental: args.experimental
|
|
78548
|
-
});
|
|
78581
|
+
const templateMap = category === "hello-world" ? helloWorldTemplateMap : otherTemplateMap;
|
|
78549
78582
|
const templateOptions = Object.entries(templateMap).map(
|
|
78550
78583
|
([value, { displayName, description, hidden: hidden2 }]) => {
|
|
78551
|
-
const isHelloWorldExample = value.startsWith("hello-world");
|
|
78552
|
-
const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
|
|
78553
78584
|
return {
|
|
78554
78585
|
value,
|
|
78555
78586
|
label: displayName,
|
|
78556
78587
|
description,
|
|
78557
|
-
hidden: hidden2
|
|
78588
|
+
hidden: hidden2
|
|
78558
78589
|
};
|
|
78559
78590
|
}
|
|
78560
78591
|
);
|
|
@@ -78657,28 +78688,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
78657
78688
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
78658
78689
|
}
|
|
78659
78690
|
const path6 = await downloadRemoteTemplate(src);
|
|
78660
|
-
const
|
|
78661
|
-
validateTemplate(path6,
|
|
78691
|
+
const config47 = inferTemplateConfig(path6);
|
|
78692
|
+
validateTemplate(path6, config47);
|
|
78662
78693
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
78663
78694
|
return {
|
|
78664
78695
|
path: path6,
|
|
78665
|
-
...
|
|
78696
|
+
...config47
|
|
78666
78697
|
};
|
|
78667
78698
|
};
|
|
78668
|
-
var validateTemplate = (path6,
|
|
78669
|
-
if (!
|
|
78699
|
+
var validateTemplate = (path6, config47) => {
|
|
78700
|
+
if (!config47.copyFiles) {
|
|
78670
78701
|
return;
|
|
78671
78702
|
}
|
|
78672
|
-
if (isVariantInfo(
|
|
78673
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
78703
|
+
if (isVariantInfo(config47.copyFiles)) {
|
|
78704
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config47.copyFiles.path), config47);
|
|
78674
78705
|
} else {
|
|
78675
|
-
for (const variant of Object.values(
|
|
78676
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path),
|
|
78706
|
+
for (const variant of Object.values(config47.copyFiles.variants)) {
|
|
78707
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config47);
|
|
78677
78708
|
}
|
|
78678
78709
|
}
|
|
78679
78710
|
};
|
|
78680
|
-
var validateTemplateSrcDirectory = (path6,
|
|
78681
|
-
if (
|
|
78711
|
+
var validateTemplateSrcDirectory = (path6, config47) => {
|
|
78712
|
+
if (config47.platform === "workers") {
|
|
78682
78713
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
78683
78714
|
const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
|
|
78684
78715
|
const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -78851,10 +78882,7 @@ var cliDefinition = {
|
|
|
78851
78882
|
values(args) {
|
|
78852
78883
|
const experimental = Boolean(args?.["experimental"]);
|
|
78853
78884
|
if (experimental) {
|
|
78854
|
-
return [
|
|
78855
|
-
{ name: "hello-world", description: "Hello World Starter" },
|
|
78856
|
-
{ name: "web-framework", description: "Framework Starter" }
|
|
78857
|
-
];
|
|
78885
|
+
return [{ name: "web-framework", description: "Framework Starter" }];
|
|
78858
78886
|
} else {
|
|
78859
78887
|
return [
|
|
78860
78888
|
{ name: "hello-world", description: "Hello World Starter" },
|
|
@@ -78880,40 +78908,10 @@ var cliDefinition = {
|
|
|
78880
78908
|
`,
|
|
78881
78909
|
values(args) {
|
|
78882
78910
|
const experimental = Boolean(args?.["experimental"]);
|
|
78883
|
-
|
|
78884
|
-
|
|
78885
|
-
|
|
78886
|
-
|
|
78887
|
-
{
|
|
78888
|
-
name: "hello-world",
|
|
78889
|
-
description: "A basic \u201CHello World\u201D Cloudflare Worker."
|
|
78890
|
-
},
|
|
78891
|
-
{
|
|
78892
|
-
name: "hello-world-durable-object",
|
|
78893
|
-
description: "A basic \u201CHello World\u201D Cloudflare Worker with a Durable Worker."
|
|
78894
|
-
},
|
|
78895
|
-
{
|
|
78896
|
-
name: "common",
|
|
78897
|
-
description: "A Cloudflare Worker which implements a common example of routing/proxying functionalities."
|
|
78898
|
-
},
|
|
78899
|
-
{
|
|
78900
|
-
name: "scheduled",
|
|
78901
|
-
description: "A scheduled Cloudflare Worker (triggered via Cron Triggers)."
|
|
78902
|
-
},
|
|
78903
|
-
{
|
|
78904
|
-
name: "queues",
|
|
78905
|
-
description: "A Cloudflare Worker which is both a consumer and produced of Queues."
|
|
78906
|
-
},
|
|
78907
|
-
{
|
|
78908
|
-
name: "openapi",
|
|
78909
|
-
description: "A Worker implementing an OpenAPI REST endpoint."
|
|
78910
|
-
},
|
|
78911
|
-
{
|
|
78912
|
-
name: "pre-existing",
|
|
78913
|
-
description: "Fetch a Worker initialized from the Cloudflare dashboard."
|
|
78914
|
-
}
|
|
78915
|
-
];
|
|
78916
|
-
}
|
|
78911
|
+
return getNamesAndDescriptions({
|
|
78912
|
+
...getHelloWorldTemplateMap({ experimental }),
|
|
78913
|
+
...getOtherTemplateMap({ experimental })
|
|
78914
|
+
});
|
|
78917
78915
|
}
|
|
78918
78916
|
},
|
|
78919
78917
|
{
|
|
@@ -78928,7 +78926,7 @@ var cliDefinition = {
|
|
|
78928
78926
|
You may specify additional arguments to be passed directly to these underlying tools by adding them after a "--" argument, like so:
|
|
78929
78927
|
|
|
78930
78928
|
npm create cloudflare -- --framework next -- --ts
|
|
78931
|
-
pnpm create
|
|
78929
|
+
pnpm create cloudflare --framework next -- --ts
|
|
78932
78930
|
`,
|
|
78933
78931
|
values: (args) => getNamesAndDescriptions(
|
|
78934
78932
|
getFrameworkMap({
|
|
@@ -80589,20 +80587,20 @@ function applyEdits(text, edits) {
|
|
|
80589
80587
|
var import_fs12 = require("fs");
|
|
80590
80588
|
var import_path14 = require("path");
|
|
80591
80589
|
var import_toml2 = __toESM(require_toml());
|
|
80592
|
-
function ensureNameExists(
|
|
80593
|
-
|
|
80594
|
-
return
|
|
80590
|
+
function ensureNameExists(config47, projectName) {
|
|
80591
|
+
config47["name"] = projectName;
|
|
80592
|
+
return config47;
|
|
80595
80593
|
}
|
|
80596
|
-
async function ensureCompatDateExists(
|
|
80597
|
-
if (typeof
|
|
80594
|
+
async function ensureCompatDateExists(config47) {
|
|
80595
|
+
if (typeof config47["compatibility_date"] === "string") {
|
|
80598
80596
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
|
|
80599
|
-
if (!
|
|
80600
|
-
|
|
80597
|
+
if (!config47["compatibility_date"].match(validCompatDateRe)) {
|
|
80598
|
+
config47["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80601
80599
|
}
|
|
80602
80600
|
} else {
|
|
80603
|
-
|
|
80601
|
+
config47["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80604
80602
|
}
|
|
80605
|
-
return
|
|
80603
|
+
return config47;
|
|
80606
80604
|
}
|
|
80607
80605
|
var updateWranglerConfig = async (ctx) => {
|
|
80608
80606
|
if (wranglerJsonExists(ctx)) {
|
|
@@ -81319,8 +81317,8 @@ var renderValues = (values) => {
|
|
|
81319
81317
|
};
|
|
81320
81318
|
|
|
81321
81319
|
// src/helpers/retry.ts
|
|
81322
|
-
var retry = async (
|
|
81323
|
-
let { times } =
|
|
81320
|
+
var retry = async (config47, fn) => {
|
|
81321
|
+
let { times } = config47;
|
|
81324
81322
|
let error2 = null;
|
|
81325
81323
|
while (times > 0) {
|
|
81326
81324
|
try {
|
|
@@ -81328,10 +81326,10 @@ var retry = async (config40, fn) => {
|
|
|
81328
81326
|
} catch (e) {
|
|
81329
81327
|
error2 = e;
|
|
81330
81328
|
times--;
|
|
81331
|
-
if (
|
|
81329
|
+
if (config47.exitCondition?.(e)) {
|
|
81332
81330
|
break;
|
|
81333
81331
|
}
|
|
81334
|
-
await sleep(
|
|
81332
|
+
await sleep(config47.sleepMs ?? 1e3);
|
|
81335
81333
|
}
|
|
81336
81334
|
}
|
|
81337
81335
|
throw error2;
|
|
@@ -81451,8 +81449,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81451
81449
|
}
|
|
81452
81450
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81453
81451
|
try {
|
|
81454
|
-
const
|
|
81455
|
-
const currentTypes =
|
|
81452
|
+
const config47 = parse4(tsconfig);
|
|
81453
|
+
const currentTypes = config47.compilerOptions?.types ?? [];
|
|
81456
81454
|
const explicitEntrypoint = currentTypes.some(
|
|
81457
81455
|
(t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81458
81456
|
);
|