create-cloudflare 2.42.1 → 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 +419 -370
- package/package.json +4 -4
- package/templates/common/c3.ts +5 -1
- package/templates/hello-world/ts/test/env.d.ts +3 -0
- package/templates/hello-world/ts/worker-configuration.d.ts +6 -2
- package/templates/hello-world-durable-object/c3.ts +4 -1
- package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +6 -4
- package/templates/hello-world-durable-object-with-assets/js/src/index.js +11 -10
- package/templates/hello-world-durable-object-with-assets/js/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object-with-assets/ts/src/index.ts +10 -9
- package/templates/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +7 -4
- package/templates/hello-world-durable-object-with-assets/ts/wrangler.jsonc +1 -1
- package/templates/hello-world-with-assets/c3.ts +4 -1
- package/templates/hello-world-with-assets/js/public/index.html +2 -2
- package/templates/hello-world-with-assets/py/public/index.html +2 -2
- package/templates/hello-world-with-assets/ts/public/index.html +2 -2
- package/templates/hello-world-with-assets/ts/test/env.d.ts +3 -0
- package/templates/hello-world-with-assets/ts/test/tsconfig.json +1 -1
- package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +6 -3
- package/templates/nuxt/pages/c3.ts +1 -0
- package/templates/nuxt/workers/c3.ts +1 -0
- package/templates/openapi/c3.ts +5 -1
- package/templates/pre-existing/c3.ts +5 -1
- package/templates/queues/c3.ts +5 -1
- package/templates/react-router/c3.ts +53 -0
- package/templates/react-router/templates/worker-configuration.d.ts +8 -0
- package/templates/remix/c3.ts +1 -0
- 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 = (config39) => {
|
|
|
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 = (config39) => {
|
|
|
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 = (config39) => {
|
|
|
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.
|
|
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(config39) {
|
|
|
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
|
}
|
|
@@ -74817,7 +74817,7 @@ var detectPackageManager = () => {
|
|
|
74817
74817
|
}
|
|
74818
74818
|
};
|
|
74819
74819
|
var rectifyPmMismatch = async (ctx) => {
|
|
74820
|
-
const { npm:
|
|
74820
|
+
const { npm: npm25 } = detectPackageManager();
|
|
74821
74821
|
if (!detectPmMismatch(ctx)) {
|
|
74822
74822
|
return;
|
|
74823
74823
|
}
|
|
@@ -74829,17 +74829,17 @@ var rectifyPmMismatch = async (ctx) => {
|
|
|
74829
74829
|
if ((0, import_fs5.existsSync)(lockfilePath)) {
|
|
74830
74830
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
74831
74831
|
}
|
|
74832
|
-
await runCommand([
|
|
74832
|
+
await runCommand([npm25, "install"], {
|
|
74833
74833
|
silent: true,
|
|
74834
74834
|
cwd: ctx.project.path,
|
|
74835
74835
|
startText: "Installing dependencies",
|
|
74836
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
74836
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
|
|
74837
74837
|
});
|
|
74838
74838
|
};
|
|
74839
74839
|
var detectPmMismatch = (ctx) => {
|
|
74840
|
-
const { npm:
|
|
74840
|
+
const { npm: npm25 } = detectPackageManager();
|
|
74841
74841
|
const projectPath = ctx.project.path;
|
|
74842
|
-
switch (
|
|
74842
|
+
switch (npm25) {
|
|
74843
74843
|
case "npm":
|
|
74844
74844
|
return false;
|
|
74845
74845
|
case "yarn":
|
|
@@ -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,39 +75107,39 @@ 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,
|
|
75111
|
-
const { npm:
|
|
75110
|
+
var installPackages = async (packages, config47 = {}) => {
|
|
75111
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75112
75112
|
let saveFlag;
|
|
75113
75113
|
let cmd;
|
|
75114
|
-
switch (
|
|
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(
|
|
75131
75131
|
[
|
|
75132
|
-
|
|
75132
|
+
npm25,
|
|
75133
75133
|
cmd,
|
|
75134
75134
|
...saveFlag ? [saveFlag] : [],
|
|
75135
75135
|
...packages,
|
|
75136
75136
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
75137
75137
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
75138
75138
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
75139
|
-
...
|
|
75139
|
+
...npm25 === "npm" ? ["--legacy-peer-deps"] : []
|
|
75140
75140
|
],
|
|
75141
75141
|
{
|
|
75142
|
-
...
|
|
75142
|
+
...config47,
|
|
75143
75143
|
silent: true
|
|
75144
75144
|
}
|
|
75145
75145
|
);
|
|
@@ -75149,16 +75149,16 @@ var npmInstall = async (ctx) => {
|
|
|
75149
75149
|
if ((0, import_fs6.existsSync)(nodeModulesPath)) {
|
|
75150
75150
|
return;
|
|
75151
75151
|
}
|
|
75152
|
-
const { npm:
|
|
75152
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75153
75153
|
await runCommand(
|
|
75154
75154
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
75155
75155
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
75156
75156
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
75157
|
-
[
|
|
75157
|
+
[npm25, "install", ...npm25 === "npm" ? ["--legacy-peer-deps"] : []],
|
|
75158
75158
|
{
|
|
75159
75159
|
silent: true,
|
|
75160
75160
|
startText: "Installing dependencies",
|
|
75161
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75161
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
|
|
75162
75162
|
}
|
|
75163
75163
|
);
|
|
75164
75164
|
};
|
|
@@ -75168,14 +75168,14 @@ async function getLatestPackageVersion(packageSpecifier) {
|
|
|
75168
75168
|
return npmInfo["dist-tags"].latest;
|
|
75169
75169
|
}
|
|
75170
75170
|
var installWrangler = async () => {
|
|
75171
|
-
const { npm:
|
|
75171
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75172
75172
|
await installPackages([`wrangler@latest`], {
|
|
75173
75173
|
dev: true,
|
|
75174
75174
|
startText: `Installing wrangler ${dim(
|
|
75175
75175
|
"A command line tool for building Cloudflare Workers"
|
|
75176
75176
|
)}`,
|
|
75177
75177
|
doneText: `${brandColor("installed")} ${dim(
|
|
75178
|
-
`via \`${
|
|
75178
|
+
`via \`${npm25} install wrangler --save-dev\``
|
|
75179
75179
|
)}`
|
|
75180
75180
|
});
|
|
75181
75181
|
};
|
|
@@ -75335,7 +75335,7 @@ var package_default = {
|
|
|
75335
75335
|
"so that we can use dependabot to update these dependencies automatically."
|
|
75336
75336
|
],
|
|
75337
75337
|
dependencies: {
|
|
75338
|
-
"create-astro": "4.11.
|
|
75338
|
+
"create-astro": "4.11.1",
|
|
75339
75339
|
"create-analog": "1.8.1",
|
|
75340
75340
|
"@angular/create": "19.1.6",
|
|
75341
75341
|
"create-docusaurus": "3.7.0",
|
|
@@ -75344,8 +75344,9 @@ var package_default = {
|
|
|
75344
75344
|
"create-qwik": "1.12.0",
|
|
75345
75345
|
"create-vite": "6.1.1",
|
|
75346
75346
|
"create-remix": "2.15.3",
|
|
75347
|
+
"create-react-router": "7.4.0",
|
|
75347
75348
|
"create-solid": "0.6.1",
|
|
75348
|
-
"create-vue": "3.
|
|
75349
|
+
"create-vue": "3.15.1",
|
|
75349
75350
|
gatsby: "5.14.1",
|
|
75350
75351
|
sv: "0.6.23",
|
|
75351
75352
|
nuxi: "3.21.1"
|
|
@@ -75363,9 +75364,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
|
|
|
75363
75364
|
};
|
|
75364
75365
|
var runFrameworkGenerator = async (ctx, args) => {
|
|
75365
75366
|
const cli = getFrameworkCli(ctx, true);
|
|
75366
|
-
const { npm:
|
|
75367
|
-
const cmd = [...
|
|
75368
|
-
const env3 =
|
|
75367
|
+
const { npm: npm25, dlx } = detectPackageManager();
|
|
75368
|
+
const cmd = [...npm25 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
75369
|
+
const env3 = npm25 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
|
|
75369
75370
|
if (ctx.args.additionalArgs?.length) {
|
|
75370
75371
|
cmd.push(...ctx.args.additionalArgs);
|
|
75371
75372
|
}
|
|
@@ -76079,7 +76080,7 @@ var config8 = {
|
|
|
76079
76080
|
var c3_default9 = config8;
|
|
76080
76081
|
|
|
76081
76082
|
// templates/common/c3.ts
|
|
76082
|
-
var
|
|
76083
|
+
var config9 = {
|
|
76083
76084
|
configVersion: 1,
|
|
76084
76085
|
id: "common",
|
|
76085
76086
|
displayName: "Example router & proxy Worker",
|
|
@@ -76097,13 +76098,14 @@ var c3_default10 = {
|
|
|
76097
76098
|
}
|
|
76098
76099
|
}
|
|
76099
76100
|
};
|
|
76101
|
+
var c3_default10 = config9;
|
|
76100
76102
|
|
|
76101
76103
|
// templates/docusaurus/pages/c3.ts
|
|
76102
76104
|
var { npm: npm5 } = detectPackageManager();
|
|
76103
76105
|
var generate8 = async (ctx) => {
|
|
76104
76106
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76105
76107
|
};
|
|
76106
|
-
var
|
|
76108
|
+
var config10 = {
|
|
76107
76109
|
configVersion: 1,
|
|
76108
76110
|
id: "docusaurus",
|
|
76109
76111
|
frameworkCli: "create-docusaurus",
|
|
@@ -76121,14 +76123,14 @@ var config9 = {
|
|
|
76121
76123
|
deployScript: "deploy",
|
|
76122
76124
|
previewScript: "preview"
|
|
76123
76125
|
};
|
|
76124
|
-
var c3_default11 =
|
|
76126
|
+
var c3_default11 = config10;
|
|
76125
76127
|
|
|
76126
76128
|
// templates/docusaurus/workers/c3.ts
|
|
76127
76129
|
var { npm: npm6 } = detectPackageManager();
|
|
76128
76130
|
var generate9 = async (ctx) => {
|
|
76129
76131
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76130
76132
|
};
|
|
76131
|
-
var
|
|
76133
|
+
var config11 = {
|
|
76132
76134
|
configVersion: 1,
|
|
76133
76135
|
id: "docusaurus",
|
|
76134
76136
|
frameworkCli: "create-docusaurus",
|
|
@@ -76149,14 +76151,14 @@ var config10 = {
|
|
|
76149
76151
|
deployScript: "deploy",
|
|
76150
76152
|
previewScript: "preview"
|
|
76151
76153
|
};
|
|
76152
|
-
var c3_default12 =
|
|
76154
|
+
var c3_default12 = config11;
|
|
76153
76155
|
|
|
76154
76156
|
// templates/docusaurus/c3.ts
|
|
76155
|
-
var
|
|
76157
|
+
var config12 = {
|
|
76156
76158
|
displayName: "Docusaurus",
|
|
76157
76159
|
platformVariants: { pages: c3_default11, workers: c3_default12 }
|
|
76158
76160
|
};
|
|
76159
|
-
var c3_default13 =
|
|
76161
|
+
var c3_default13 = config12;
|
|
76160
76162
|
|
|
76161
76163
|
// templates/gatsby/pages/c3.ts
|
|
76162
76164
|
var { npm: npm7 } = detectPackageManager();
|
|
@@ -76179,7 +76181,7 @@ var generate10 = async (ctx) => {
|
|
|
76179
76181
|
}
|
|
76180
76182
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76181
76183
|
};
|
|
76182
|
-
var
|
|
76184
|
+
var config13 = {
|
|
76183
76185
|
configVersion: 1,
|
|
76184
76186
|
id: "gatsby",
|
|
76185
76187
|
frameworkCli: "gatsby",
|
|
@@ -76197,7 +76199,7 @@ var config12 = {
|
|
|
76197
76199
|
deployScript: "deploy",
|
|
76198
76200
|
previewScript: "preview"
|
|
76199
76201
|
};
|
|
76200
|
-
var c3_default14 =
|
|
76202
|
+
var c3_default14 = config13;
|
|
76201
76203
|
|
|
76202
76204
|
// templates/gatsby/workers/c3.ts
|
|
76203
76205
|
var { npm: npm8 } = detectPackageManager();
|
|
@@ -76220,7 +76222,7 @@ var generate11 = async (ctx) => {
|
|
|
76220
76222
|
}
|
|
76221
76223
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76222
76224
|
};
|
|
76223
|
-
var
|
|
76225
|
+
var config14 = {
|
|
76224
76226
|
configVersion: 1,
|
|
76225
76227
|
id: "gatsby",
|
|
76226
76228
|
frameworkCli: "gatsby",
|
|
@@ -76241,17 +76243,17 @@ var config13 = {
|
|
|
76241
76243
|
deployScript: "deploy",
|
|
76242
76244
|
previewScript: "preview"
|
|
76243
76245
|
};
|
|
76244
|
-
var c3_default15 =
|
|
76246
|
+
var c3_default15 = config14;
|
|
76245
76247
|
|
|
76246
76248
|
// templates/gatsby/c3.ts
|
|
76247
|
-
var
|
|
76249
|
+
var config15 = {
|
|
76248
76250
|
displayName: "Gatsby",
|
|
76249
76251
|
platformVariants: { pages: c3_default14, workers: c3_default15 }
|
|
76250
76252
|
};
|
|
76251
|
-
var c3_default16 =
|
|
76253
|
+
var c3_default16 = config15;
|
|
76252
76254
|
|
|
76253
76255
|
// templates/hello-world-assets-only/c3.ts
|
|
76254
|
-
var
|
|
76256
|
+
var config16 = {
|
|
76255
76257
|
configVersion: 1,
|
|
76256
76258
|
id: "hello-world-assets-only",
|
|
76257
76259
|
path: "templates/hello-world-assets-only",
|
|
@@ -76262,10 +76264,10 @@ var config15 = {
|
|
|
76262
76264
|
path: "./templates"
|
|
76263
76265
|
}
|
|
76264
76266
|
};
|
|
76265
|
-
var c3_default17 =
|
|
76267
|
+
var c3_default17 = config16;
|
|
76266
76268
|
|
|
76267
76269
|
// templates/hello-world-durable-object-with-assets/c3.ts
|
|
76268
|
-
var
|
|
76270
|
+
var config17 = {
|
|
76269
76271
|
configVersion: 1,
|
|
76270
76272
|
id: "hello-world-durable-object-with-assets",
|
|
76271
76273
|
path: "templates/hello-world-durable-object-with-assets",
|
|
@@ -76283,10 +76285,10 @@ var config16 = {
|
|
|
76283
76285
|
}
|
|
76284
76286
|
}
|
|
76285
76287
|
};
|
|
76286
|
-
var c3_default18 =
|
|
76288
|
+
var c3_default18 = config17;
|
|
76287
76289
|
|
|
76288
76290
|
// templates/hello-world-durable-object/c3.ts
|
|
76289
|
-
var
|
|
76291
|
+
var config18 = {
|
|
76290
76292
|
configVersion: 1,
|
|
76291
76293
|
id: "hello-world-durable-object",
|
|
76292
76294
|
displayName: "Worker + Durable Objects",
|
|
@@ -76303,9 +76305,10 @@ var c3_default19 = {
|
|
|
76303
76305
|
}
|
|
76304
76306
|
}
|
|
76305
76307
|
};
|
|
76308
|
+
var c3_default19 = config18;
|
|
76306
76309
|
|
|
76307
76310
|
// templates/hello-world-with-assets/c3.ts
|
|
76308
|
-
var
|
|
76311
|
+
var config19 = {
|
|
76309
76312
|
configVersion: 1,
|
|
76310
76313
|
id: "hello-world-with-assets",
|
|
76311
76314
|
path: "templates/hello-world-with-assets",
|
|
@@ -76326,6 +76329,7 @@ var c3_default20 = {
|
|
|
76326
76329
|
}
|
|
76327
76330
|
}
|
|
76328
76331
|
};
|
|
76332
|
+
var c3_default20 = config19;
|
|
76329
76333
|
|
|
76330
76334
|
// templates/hello-world/c3.ts
|
|
76331
76335
|
var import_promises2 = require("node:fs/promises");
|
|
@@ -76376,7 +76380,7 @@ var generate12 = async (ctx) => {
|
|
|
76376
76380
|
]);
|
|
76377
76381
|
logRaw("");
|
|
76378
76382
|
};
|
|
76379
|
-
var
|
|
76383
|
+
var config20 = {
|
|
76380
76384
|
configVersion: 1,
|
|
76381
76385
|
id: "hono",
|
|
76382
76386
|
frameworkCli: "create-hono",
|
|
@@ -76396,7 +76400,7 @@ var config17 = {
|
|
|
76396
76400
|
deployScript: "deploy",
|
|
76397
76401
|
previewScript: "dev"
|
|
76398
76402
|
};
|
|
76399
|
-
var c3_default22 =
|
|
76403
|
+
var c3_default22 = config20;
|
|
76400
76404
|
|
|
76401
76405
|
// templates/hono/workers/c3.ts
|
|
76402
76406
|
var generate13 = async (ctx) => {
|
|
@@ -76411,7 +76415,7 @@ var generate13 = async (ctx) => {
|
|
|
76411
76415
|
]);
|
|
76412
76416
|
logRaw("");
|
|
76413
76417
|
};
|
|
76414
|
-
var
|
|
76418
|
+
var config21 = {
|
|
76415
76419
|
configVersion: 1,
|
|
76416
76420
|
id: "hono",
|
|
76417
76421
|
frameworkCli: "create-hono",
|
|
@@ -76431,14 +76435,14 @@ var config18 = {
|
|
|
76431
76435
|
deployScript: "deploy",
|
|
76432
76436
|
previewScript: "dev"
|
|
76433
76437
|
};
|
|
76434
|
-
var c3_default23 =
|
|
76438
|
+
var c3_default23 = config21;
|
|
76435
76439
|
|
|
76436
76440
|
// templates/hono/c3.ts
|
|
76437
|
-
var
|
|
76441
|
+
var config22 = {
|
|
76438
76442
|
displayName: "Hono",
|
|
76439
76443
|
platformVariants: { pages: c3_default22, workers: c3_default23 }
|
|
76440
76444
|
};
|
|
76441
|
-
var c3_default24 =
|
|
76445
|
+
var c3_default24 = config22;
|
|
76442
76446
|
|
|
76443
76447
|
// templates/next/c3.ts
|
|
76444
76448
|
var import_path10 = require("path");
|
|
@@ -76615,6 +76619,7 @@ var generate15 = async (ctx) => {
|
|
|
76615
76619
|
ctx.project.name,
|
|
76616
76620
|
"--packageManager",
|
|
76617
76621
|
npm10,
|
|
76622
|
+
"--no-install",
|
|
76618
76623
|
gitFlag
|
|
76619
76624
|
]);
|
|
76620
76625
|
writeFile2("./.node-version", "18");
|
|
@@ -76689,7 +76694,7 @@ var updateNuxtConfig = () => {
|
|
|
76689
76694
|
});
|
|
76690
76695
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76691
76696
|
};
|
|
76692
|
-
var
|
|
76697
|
+
var config23 = {
|
|
76693
76698
|
configVersion: 1,
|
|
76694
76699
|
id: "nuxt",
|
|
76695
76700
|
frameworkCli: "nuxi",
|
|
@@ -76712,7 +76717,7 @@ var config20 = {
|
|
|
76712
76717
|
deployScript: "deploy",
|
|
76713
76718
|
previewScript: "preview"
|
|
76714
76719
|
};
|
|
76715
|
-
var c3_default26 =
|
|
76720
|
+
var c3_default26 = config23;
|
|
76716
76721
|
|
|
76717
76722
|
// templates/nuxt/workers/c3.ts
|
|
76718
76723
|
var recast7 = __toESM(require_main3());
|
|
@@ -76724,6 +76729,7 @@ var generate16 = async (ctx) => {
|
|
|
76724
76729
|
ctx.project.name,
|
|
76725
76730
|
"--packageManager",
|
|
76726
76731
|
npm11,
|
|
76732
|
+
"--no-install",
|
|
76727
76733
|
gitFlag
|
|
76728
76734
|
]);
|
|
76729
76735
|
writeFile2("./.node-version", "18");
|
|
@@ -76798,7 +76804,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76798
76804
|
});
|
|
76799
76805
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76800
76806
|
};
|
|
76801
|
-
var
|
|
76807
|
+
var config24 = {
|
|
76802
76808
|
configVersion: 1,
|
|
76803
76809
|
id: "nuxt",
|
|
76804
76810
|
frameworkCli: "nuxi",
|
|
@@ -76821,17 +76827,17 @@ var config21 = {
|
|
|
76821
76827
|
deployScript: "deploy",
|
|
76822
76828
|
previewScript: "preview"
|
|
76823
76829
|
};
|
|
76824
|
-
var c3_default27 =
|
|
76830
|
+
var c3_default27 = config24;
|
|
76825
76831
|
|
|
76826
76832
|
// templates/nuxt/c3.ts
|
|
76827
|
-
var
|
|
76833
|
+
var config25 = {
|
|
76828
76834
|
displayName: "Nuxt",
|
|
76829
76835
|
platformVariants: { pages: c3_default26, workers: c3_default27 }
|
|
76830
76836
|
};
|
|
76831
|
-
var c3_default28 =
|
|
76837
|
+
var c3_default28 = config25;
|
|
76832
76838
|
|
|
76833
76839
|
// templates/openapi/c3.ts
|
|
76834
|
-
var
|
|
76840
|
+
var config26 = {
|
|
76835
76841
|
configVersion: 1,
|
|
76836
76842
|
id: "openapi",
|
|
76837
76843
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -76841,6 +76847,7 @@ var c3_default29 = {
|
|
|
76841
76847
|
path: "./ts"
|
|
76842
76848
|
}
|
|
76843
76849
|
};
|
|
76850
|
+
var c3_default29 = config26;
|
|
76844
76851
|
|
|
76845
76852
|
// templates/pre-existing/c3.ts
|
|
76846
76853
|
var import_promises3 = require("fs/promises");
|
|
@@ -76990,10 +76997,11 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
76990
76997
|
(0, import_path11.join)(ctx.project.path, "wrangler.toml")
|
|
76991
76998
|
);
|
|
76992
76999
|
}
|
|
76993
|
-
var
|
|
77000
|
+
var config27 = {
|
|
76994
77001
|
configVersion: 1,
|
|
76995
77002
|
id: "pre-existing",
|
|
76996
77003
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
77004
|
+
description: "Fetch a Worker initialized from the Cloudflare dashboard.",
|
|
76997
77005
|
platform: "workers",
|
|
76998
77006
|
hidden: true,
|
|
76999
77007
|
copyFiles: {
|
|
@@ -77005,6 +77013,7 @@ var c3_default30 = {
|
|
|
77005
77013
|
copyFiles: copyExistingWorkerFiles
|
|
77006
77014
|
})
|
|
77007
77015
|
};
|
|
77016
|
+
var c3_default30 = config27;
|
|
77008
77017
|
function buildConfigure(params) {
|
|
77009
77018
|
return async function configure21(ctx) {
|
|
77010
77019
|
const loginSuccess = await params.login(ctx);
|
|
@@ -77018,7 +77027,7 @@ function buildConfigure(params) {
|
|
|
77018
77027
|
}
|
|
77019
77028
|
|
|
77020
77029
|
// templates/queues/c3.ts
|
|
77021
|
-
var
|
|
77030
|
+
var config28 = {
|
|
77022
77031
|
configVersion: 1,
|
|
77023
77032
|
id: "queues",
|
|
77024
77033
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -77045,6 +77054,7 @@ var c3_default31 = {
|
|
|
77045
77054
|
]
|
|
77046
77055
|
}
|
|
77047
77056
|
};
|
|
77057
|
+
var c3_default31 = config28;
|
|
77048
77058
|
|
|
77049
77059
|
// templates/qwik/pages/c3.ts
|
|
77050
77060
|
var recast8 = __toESM(require_main3());
|
|
@@ -77129,7 +77139,7 @@ var populateCloudflareEnv = () => {
|
|
|
77129
77139
|
});
|
|
77130
77140
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77131
77141
|
};
|
|
77132
|
-
var
|
|
77142
|
+
var config29 = {
|
|
77133
77143
|
configVersion: 1,
|
|
77134
77144
|
id: "qwik",
|
|
77135
77145
|
frameworkCli: "create-qwik",
|
|
@@ -77152,7 +77162,7 @@ var config23 = {
|
|
|
77152
77162
|
deployScript: "deploy",
|
|
77153
77163
|
previewScript: "preview"
|
|
77154
77164
|
};
|
|
77155
|
-
var c3_default32 =
|
|
77165
|
+
var c3_default32 = config29;
|
|
77156
77166
|
|
|
77157
77167
|
// templates/qwik/workers/c3.ts
|
|
77158
77168
|
var recast9 = __toESM(require_main3());
|
|
@@ -77240,7 +77250,7 @@ var populateCloudflareEnv2 = () => {
|
|
|
77240
77250
|
});
|
|
77241
77251
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77242
77252
|
};
|
|
77243
|
-
var
|
|
77253
|
+
var config30 = {
|
|
77244
77254
|
configVersion: 1,
|
|
77245
77255
|
id: "qwik",
|
|
77246
77256
|
frameworkCli: "create-qwik",
|
|
@@ -77263,18 +77273,55 @@ var config24 = {
|
|
|
77263
77273
|
deployScript: "deploy",
|
|
77264
77274
|
previewScript: "preview"
|
|
77265
77275
|
};
|
|
77266
|
-
var c3_default33 =
|
|
77276
|
+
var c3_default33 = config30;
|
|
77267
77277
|
|
|
77268
77278
|
// templates/qwik/c3.ts
|
|
77269
|
-
var
|
|
77279
|
+
var config31 = {
|
|
77270
77280
|
displayName: "Qwik",
|
|
77271
77281
|
platformVariants: { pages: c3_default32, workers: c3_default33 }
|
|
77272
77282
|
};
|
|
77273
|
-
var c3_default34 =
|
|
77283
|
+
var c3_default34 = config31;
|
|
77274
77284
|
|
|
77275
|
-
// templates/react/
|
|
77285
|
+
// templates/react-router/c3.ts
|
|
77276
77286
|
var { npm: npm14 } = detectPackageManager();
|
|
77277
77287
|
var generate19 = async (ctx) => {
|
|
77288
|
+
await runFrameworkGenerator(ctx, [
|
|
77289
|
+
ctx.project.name,
|
|
77290
|
+
"--template",
|
|
77291
|
+
"https://github.com/remix-run/react-router-templates/tree/main/cloudflare",
|
|
77292
|
+
// to prevent asking about git twice, just let c3 do it
|
|
77293
|
+
"--no-git-init",
|
|
77294
|
+
"--no-install"
|
|
77295
|
+
]);
|
|
77296
|
+
logRaw("");
|
|
77297
|
+
};
|
|
77298
|
+
var config32 = {
|
|
77299
|
+
configVersion: 1,
|
|
77300
|
+
id: "react-router",
|
|
77301
|
+
platform: "workers",
|
|
77302
|
+
frameworkCli: "create-react-router",
|
|
77303
|
+
displayName: "React Router (formerly Remix)",
|
|
77304
|
+
copyFiles: {
|
|
77305
|
+
path: "./templates"
|
|
77306
|
+
},
|
|
77307
|
+
generate: generate19,
|
|
77308
|
+
// configure,
|
|
77309
|
+
transformPackageJson: async () => ({
|
|
77310
|
+
scripts: {
|
|
77311
|
+
deploy: `${npm14} run build && wrangler deploy`,
|
|
77312
|
+
preview: `${npm14} run build && vite preview`,
|
|
77313
|
+
"cf-typegen": `wrangler types`
|
|
77314
|
+
}
|
|
77315
|
+
}),
|
|
77316
|
+
devScript: "dev",
|
|
77317
|
+
deployScript: "deploy",
|
|
77318
|
+
previewScript: "preview"
|
|
77319
|
+
};
|
|
77320
|
+
var c3_default35 = config32;
|
|
77321
|
+
|
|
77322
|
+
// templates/react/pages/c3.ts
|
|
77323
|
+
var { npm: npm15 } = detectPackageManager();
|
|
77324
|
+
var generate20 = async (ctx) => {
|
|
77278
77325
|
const variant = await inputPrompt({
|
|
77279
77326
|
type: "select",
|
|
77280
77327
|
question: "Select a variant:",
|
|
@@ -77303,7 +77350,7 @@ var variantsOptions = [
|
|
|
77303
77350
|
label: "JavaScript + SWC"
|
|
77304
77351
|
}
|
|
77305
77352
|
];
|
|
77306
|
-
var
|
|
77353
|
+
var config33 = {
|
|
77307
77354
|
configVersion: 1,
|
|
77308
77355
|
id: "react",
|
|
77309
77356
|
// React's documentation now recommends using create-vite.
|
|
@@ -77311,26 +77358,26 @@ var config26 = {
|
|
|
77311
77358
|
displayName: "React",
|
|
77312
77359
|
platform: "pages",
|
|
77313
77360
|
path: "templates/react/pages",
|
|
77314
|
-
generate:
|
|
77361
|
+
generate: generate20,
|
|
77315
77362
|
transformPackageJson: async () => ({
|
|
77316
77363
|
scripts: {
|
|
77317
|
-
deploy: `${
|
|
77318
|
-
preview: `${
|
|
77364
|
+
deploy: `${npm15} run build && wrangler pages deploy ./dist`,
|
|
77365
|
+
preview: `${npm15} run build && wrangler pages dev ./dist`
|
|
77319
77366
|
}
|
|
77320
77367
|
}),
|
|
77321
77368
|
devScript: "dev",
|
|
77322
77369
|
deployScript: "deploy",
|
|
77323
77370
|
previewScript: "preview"
|
|
77324
77371
|
};
|
|
77325
|
-
var
|
|
77372
|
+
var c3_default36 = config33;
|
|
77326
77373
|
|
|
77327
77374
|
// templates/react/workers/c3.ts
|
|
77328
77375
|
var import_assert2 = __toESM(require("assert"));
|
|
77329
77376
|
var recast10 = __toESM(require_main3());
|
|
77330
77377
|
var b2 = recast10.types.builders;
|
|
77331
77378
|
var t = recast10.types.namedTypes;
|
|
77332
|
-
var { npm:
|
|
77333
|
-
var
|
|
77379
|
+
var { npm: npm16 } = detectPackageManager();
|
|
77380
|
+
var generate21 = async (ctx) => {
|
|
77334
77381
|
const variant = await getVariant();
|
|
77335
77382
|
ctx.args.lang = variant.lang;
|
|
77336
77383
|
await runFrameworkGenerator(ctx, [
|
|
@@ -77371,9 +77418,9 @@ function transformViteConfig(ctx) {
|
|
|
77371
77418
|
if (callee.name !== "defineConfig") {
|
|
77372
77419
|
return this.traverse(n);
|
|
77373
77420
|
}
|
|
77374
|
-
const
|
|
77375
|
-
(0, import_assert2.default)(t.ObjectExpression.check(
|
|
77376
|
-
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));
|
|
77377
77424
|
(0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
77378
77425
|
pluginsProp.value.elements.push(
|
|
77379
77426
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -77430,7 +77477,7 @@ async function getVariant() {
|
|
|
77430
77477
|
(0, import_assert2.default)(selected, "Expected a variant to be selected");
|
|
77431
77478
|
return selected;
|
|
77432
77479
|
}
|
|
77433
|
-
var
|
|
77480
|
+
var config34 = {
|
|
77434
77481
|
configVersion: 1,
|
|
77435
77482
|
id: "react",
|
|
77436
77483
|
frameworkCli: "create-vite",
|
|
@@ -77447,12 +77494,12 @@ var config27 = {
|
|
|
77447
77494
|
}
|
|
77448
77495
|
}
|
|
77449
77496
|
},
|
|
77450
|
-
generate:
|
|
77497
|
+
generate: generate21,
|
|
77451
77498
|
configure: configure13,
|
|
77452
77499
|
transformPackageJson: async (_3, ctx) => ({
|
|
77453
77500
|
scripts: {
|
|
77454
|
-
deploy: `${
|
|
77455
|
-
preview: `${
|
|
77501
|
+
deploy: `${npm16} run build && wrangler deploy`,
|
|
77502
|
+
preview: `${npm16} run build && vite preview`,
|
|
77456
77503
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
77457
77504
|
}
|
|
77458
77505
|
}),
|
|
@@ -77460,18 +77507,18 @@ var config27 = {
|
|
|
77460
77507
|
deployScript: "deploy",
|
|
77461
77508
|
previewScript: "preview"
|
|
77462
77509
|
};
|
|
77463
|
-
var
|
|
77510
|
+
var c3_default37 = config34;
|
|
77464
77511
|
|
|
77465
77512
|
// templates/react/c3.ts
|
|
77466
|
-
var
|
|
77513
|
+
var config35 = {
|
|
77467
77514
|
displayName: "React",
|
|
77468
|
-
platformVariants: { pages:
|
|
77515
|
+
platformVariants: { pages: c3_default36, workers: c3_default37 }
|
|
77469
77516
|
};
|
|
77470
|
-
var
|
|
77517
|
+
var c3_default38 = config35;
|
|
77471
77518
|
|
|
77472
77519
|
// templates/remix/pages/c3.ts
|
|
77473
|
-
var { npm:
|
|
77474
|
-
var
|
|
77520
|
+
var { npm: npm17 } = detectPackageManager();
|
|
77521
|
+
var generate22 = async (ctx) => {
|
|
77475
77522
|
await runFrameworkGenerator(ctx, [
|
|
77476
77523
|
ctx.project.name,
|
|
77477
77524
|
"--template",
|
|
@@ -77494,7 +77541,7 @@ var configure14 = async () => {
|
|
|
77494
77541
|
});
|
|
77495
77542
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
77496
77543
|
};
|
|
77497
|
-
var
|
|
77544
|
+
var config36 = {
|
|
77498
77545
|
configVersion: 1,
|
|
77499
77546
|
id: "remix",
|
|
77500
77547
|
frameworkCli: "create-remix",
|
|
@@ -77504,12 +77551,12 @@ var config29 = {
|
|
|
77504
77551
|
path: "./templates"
|
|
77505
77552
|
},
|
|
77506
77553
|
path: "templates/remix/pages",
|
|
77507
|
-
generate:
|
|
77554
|
+
generate: generate22,
|
|
77508
77555
|
configure: configure14,
|
|
77509
77556
|
transformPackageJson: async () => ({
|
|
77510
77557
|
scripts: {
|
|
77511
|
-
deploy: `${
|
|
77512
|
-
preview: `${
|
|
77558
|
+
deploy: `${npm17} run build && wrangler pages deploy`,
|
|
77559
|
+
preview: `${npm17} run build && wrangler pages dev`,
|
|
77513
77560
|
"cf-typegen": `wrangler types`
|
|
77514
77561
|
}
|
|
77515
77562
|
}),
|
|
@@ -77517,11 +77564,11 @@ var config29 = {
|
|
|
77517
77564
|
deployScript: "deploy",
|
|
77518
77565
|
previewScript: "preview"
|
|
77519
77566
|
};
|
|
77520
|
-
var
|
|
77567
|
+
var c3_default39 = config36;
|
|
77521
77568
|
|
|
77522
77569
|
// templates/remix/workers/c3.ts
|
|
77523
|
-
var { npm:
|
|
77524
|
-
var
|
|
77570
|
+
var { npm: npm18 } = detectPackageManager();
|
|
77571
|
+
var generate23 = async (ctx) => {
|
|
77525
77572
|
await runFrameworkGenerator(ctx, [
|
|
77526
77573
|
ctx.project.name,
|
|
77527
77574
|
"--template",
|
|
@@ -77536,7 +77583,7 @@ var configure15 = async () => {
|
|
|
77536
77583
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
77537
77584
|
});
|
|
77538
77585
|
};
|
|
77539
|
-
var
|
|
77586
|
+
var config37 = {
|
|
77540
77587
|
configVersion: 1,
|
|
77541
77588
|
id: "remix",
|
|
77542
77589
|
frameworkCli: "create-remix",
|
|
@@ -77546,12 +77593,12 @@ var config30 = {
|
|
|
77546
77593
|
path: "./templates"
|
|
77547
77594
|
},
|
|
77548
77595
|
path: "templates/remix/workers",
|
|
77549
|
-
generate:
|
|
77596
|
+
generate: generate23,
|
|
77550
77597
|
configure: configure15,
|
|
77551
77598
|
transformPackageJson: async () => ({
|
|
77552
77599
|
scripts: {
|
|
77553
|
-
deploy: `${
|
|
77554
|
-
preview: `${
|
|
77600
|
+
deploy: `${npm18} run build && wrangler deploy`,
|
|
77601
|
+
preview: `${npm18} run build && wrangler dev`,
|
|
77555
77602
|
"cf-typegen": `wrangler types`
|
|
77556
77603
|
}
|
|
77557
77604
|
}),
|
|
@@ -77559,17 +77606,18 @@ var config30 = {
|
|
|
77559
77606
|
deployScript: "deploy",
|
|
77560
77607
|
previewScript: "preview"
|
|
77561
77608
|
};
|
|
77562
|
-
var
|
|
77609
|
+
var c3_default40 = config37;
|
|
77563
77610
|
|
|
77564
77611
|
// templates/remix/c3.ts
|
|
77565
|
-
var
|
|
77612
|
+
var config38 = {
|
|
77566
77613
|
displayName: "Remix",
|
|
77567
|
-
platformVariants: { pages:
|
|
77614
|
+
platformVariants: { pages: c3_default39, workers: c3_default40 },
|
|
77615
|
+
hidden: true
|
|
77568
77616
|
};
|
|
77569
|
-
var
|
|
77617
|
+
var c3_default41 = config38;
|
|
77570
77618
|
|
|
77571
77619
|
// templates/scheduled/c3.ts
|
|
77572
|
-
var
|
|
77620
|
+
var config39 = {
|
|
77573
77621
|
configVersion: 1,
|
|
77574
77622
|
id: "scheduled",
|
|
77575
77623
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -77586,11 +77634,12 @@ var c3_default41 = {
|
|
|
77586
77634
|
}
|
|
77587
77635
|
}
|
|
77588
77636
|
};
|
|
77637
|
+
var c3_default42 = config39;
|
|
77589
77638
|
|
|
77590
77639
|
// templates/solid/c3.ts
|
|
77591
77640
|
var recast11 = __toESM(require_main3());
|
|
77592
|
-
var { npm:
|
|
77593
|
-
var
|
|
77641
|
+
var { npm: npm19 } = detectPackageManager();
|
|
77642
|
+
var generate24 = async (ctx) => {
|
|
77594
77643
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
77595
77644
|
logRaw("");
|
|
77596
77645
|
};
|
|
@@ -77632,7 +77681,7 @@ var configure16 = async (ctx) => {
|
|
|
77632
77681
|
}
|
|
77633
77682
|
});
|
|
77634
77683
|
};
|
|
77635
|
-
var
|
|
77684
|
+
var config40 = {
|
|
77636
77685
|
configVersion: 1,
|
|
77637
77686
|
id: "solid",
|
|
77638
77687
|
frameworkCli: "create-solid",
|
|
@@ -77641,12 +77690,12 @@ var config32 = {
|
|
|
77641
77690
|
copyFiles: {
|
|
77642
77691
|
path: "./templates"
|
|
77643
77692
|
},
|
|
77644
|
-
generate:
|
|
77693
|
+
generate: generate24,
|
|
77645
77694
|
configure: configure16,
|
|
77646
77695
|
transformPackageJson: async () => ({
|
|
77647
77696
|
scripts: {
|
|
77648
|
-
preview: `${
|
|
77649
|
-
deploy: `${
|
|
77697
|
+
preview: `${npm19} run build && npx wrangler pages dev`,
|
|
77698
|
+
deploy: `${npm19} run build && wrangler pages deploy`
|
|
77650
77699
|
}
|
|
77651
77700
|
}),
|
|
77652
77701
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -77654,14 +77703,14 @@ var config32 = {
|
|
|
77654
77703
|
deployScript: "deploy",
|
|
77655
77704
|
previewScript: "preview"
|
|
77656
77705
|
};
|
|
77657
|
-
var
|
|
77706
|
+
var c3_default43 = config40;
|
|
77658
77707
|
|
|
77659
77708
|
// templates/svelte/pages/c3.ts
|
|
77660
77709
|
var import_node_fs3 = require("node:fs");
|
|
77661
77710
|
var import_node_os3 = require("node:os");
|
|
77662
77711
|
var recast12 = __toESM(require_main3());
|
|
77663
|
-
var { npm:
|
|
77664
|
-
var
|
|
77712
|
+
var { npm: npm20 } = detectPackageManager();
|
|
77713
|
+
var generate25 = async (ctx) => {
|
|
77665
77714
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77666
77715
|
logRaw("");
|
|
77667
77716
|
};
|
|
@@ -77747,7 +77796,7 @@ var updateTypeDefinitions = (ctx) => {
|
|
|
77747
77796
|
}
|
|
77748
77797
|
});
|
|
77749
77798
|
};
|
|
77750
|
-
var
|
|
77799
|
+
var config41 = {
|
|
77751
77800
|
configVersion: 1,
|
|
77752
77801
|
id: "svelte",
|
|
77753
77802
|
frameworkCli: "sv",
|
|
@@ -77757,12 +77806,12 @@ var config33 = {
|
|
|
77757
77806
|
path: "./templates"
|
|
77758
77807
|
},
|
|
77759
77808
|
path: "templates/svelte/pages",
|
|
77760
|
-
generate:
|
|
77809
|
+
generate: generate25,
|
|
77761
77810
|
configure: configure17,
|
|
77762
77811
|
transformPackageJson: async (original, ctx) => {
|
|
77763
77812
|
let scripts = {
|
|
77764
|
-
preview: `${
|
|
77765
|
-
deploy: `${
|
|
77813
|
+
preview: `${npm20} run build && wrangler pages dev`,
|
|
77814
|
+
deploy: `${npm20} run build && wrangler pages deploy`
|
|
77766
77815
|
};
|
|
77767
77816
|
if (usesTypescript(ctx)) {
|
|
77768
77817
|
const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
|
|
@@ -77777,13 +77826,13 @@ var config33 = {
|
|
|
77777
77826
|
deployScript: "deploy",
|
|
77778
77827
|
previewScript: "preview"
|
|
77779
77828
|
};
|
|
77780
|
-
var
|
|
77829
|
+
var c3_default44 = config41;
|
|
77781
77830
|
|
|
77782
77831
|
// templates/svelte/workers/c3.ts
|
|
77783
77832
|
var import_node_os4 = require("node:os");
|
|
77784
77833
|
var recast13 = __toESM(require_main3());
|
|
77785
|
-
var { npm:
|
|
77786
|
-
var
|
|
77834
|
+
var { npm: npm21 } = detectPackageManager();
|
|
77835
|
+
var generate26 = async (ctx) => {
|
|
77787
77836
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77788
77837
|
logRaw("");
|
|
77789
77838
|
};
|
|
@@ -77846,7 +77895,7 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
77846
77895
|
}
|
|
77847
77896
|
});
|
|
77848
77897
|
};
|
|
77849
|
-
var
|
|
77898
|
+
var config42 = {
|
|
77850
77899
|
configVersion: 1,
|
|
77851
77900
|
id: "svelte",
|
|
77852
77901
|
frameworkCli: "sv",
|
|
@@ -77856,12 +77905,12 @@ var config34 = {
|
|
|
77856
77905
|
path: "./templates"
|
|
77857
77906
|
},
|
|
77858
77907
|
path: "templates/svelte/workers",
|
|
77859
|
-
generate:
|
|
77908
|
+
generate: generate26,
|
|
77860
77909
|
configure: configure18,
|
|
77861
77910
|
transformPackageJson: async (original, ctx) => {
|
|
77862
77911
|
let scripts = {
|
|
77863
|
-
preview: `${
|
|
77864
|
-
deploy: `${
|
|
77912
|
+
preview: `${npm21} run build && wrangler dev`,
|
|
77913
|
+
deploy: `${npm21} run build && wrangler deploy`
|
|
77865
77914
|
};
|
|
77866
77915
|
if (usesTypescript(ctx)) {
|
|
77867
77916
|
const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
|
|
@@ -77876,43 +77925,43 @@ var config34 = {
|
|
|
77876
77925
|
deployScript: "deploy",
|
|
77877
77926
|
previewScript: "preview"
|
|
77878
77927
|
};
|
|
77879
|
-
var
|
|
77928
|
+
var c3_default45 = config42;
|
|
77880
77929
|
|
|
77881
77930
|
// templates/svelte/c3.ts
|
|
77882
|
-
var
|
|
77931
|
+
var config43 = {
|
|
77883
77932
|
displayName: "SvelteKit",
|
|
77884
|
-
platformVariants: { pages:
|
|
77933
|
+
platformVariants: { pages: c3_default44, workers: c3_default45 }
|
|
77885
77934
|
};
|
|
77886
|
-
var
|
|
77935
|
+
var c3_default46 = config43;
|
|
77887
77936
|
|
|
77888
77937
|
// templates/vue/pages/c3.ts
|
|
77889
|
-
var { npm:
|
|
77890
|
-
var
|
|
77938
|
+
var { npm: npm22 } = detectPackageManager();
|
|
77939
|
+
var generate27 = async (ctx) => {
|
|
77891
77940
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
77892
77941
|
};
|
|
77893
|
-
var
|
|
77942
|
+
var config44 = {
|
|
77894
77943
|
configVersion: 1,
|
|
77895
77944
|
id: "vue",
|
|
77896
77945
|
frameworkCli: "create-vue",
|
|
77897
77946
|
displayName: "Vue",
|
|
77898
77947
|
platform: "pages",
|
|
77899
77948
|
path: "templates/pages/vue",
|
|
77900
|
-
generate:
|
|
77949
|
+
generate: generate27,
|
|
77901
77950
|
transformPackageJson: async () => ({
|
|
77902
77951
|
scripts: {
|
|
77903
|
-
deploy: `${
|
|
77904
|
-
preview: `${
|
|
77952
|
+
deploy: `${npm22} run build && wrangler pages deploy ./dist`,
|
|
77953
|
+
preview: `${npm22} run build && wrangler pages dev ./dist`
|
|
77905
77954
|
}
|
|
77906
77955
|
}),
|
|
77907
77956
|
devScript: "dev",
|
|
77908
77957
|
deployScript: "deploy",
|
|
77909
77958
|
previewScript: "preview"
|
|
77910
77959
|
};
|
|
77911
|
-
var
|
|
77960
|
+
var c3_default47 = config44;
|
|
77912
77961
|
|
|
77913
77962
|
// templates/vue/workers/c3.ts
|
|
77914
|
-
var { npm:
|
|
77915
|
-
var
|
|
77963
|
+
var { npm: npm23 } = detectPackageManager();
|
|
77964
|
+
var generate28 = async (ctx) => {
|
|
77916
77965
|
const lang = ctx.args.lang ?? await inputPrompt({
|
|
77917
77966
|
type: "select",
|
|
77918
77967
|
question: "Would you like to use TypeScript?",
|
|
@@ -77950,7 +77999,7 @@ function updateTsconfigJson2() {
|
|
|
77950
77999
|
writeJSON("tsconfig.json", tsconfig);
|
|
77951
78000
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
77952
78001
|
}
|
|
77953
|
-
var
|
|
78002
|
+
var config45 = {
|
|
77954
78003
|
configVersion: 1,
|
|
77955
78004
|
id: "vue",
|
|
77956
78005
|
frameworkCli: "create-vue",
|
|
@@ -77971,11 +78020,11 @@ var config37 = {
|
|
|
77971
78020
|
}
|
|
77972
78021
|
},
|
|
77973
78022
|
configure: configure19,
|
|
77974
|
-
generate:
|
|
78023
|
+
generate: generate28,
|
|
77975
78024
|
transformPackageJson: async (_3, ctx) => ({
|
|
77976
78025
|
scripts: {
|
|
77977
|
-
deploy: `${
|
|
77978
|
-
preview: `${
|
|
78026
|
+
deploy: `${npm23} run build && wrangler deploy`,
|
|
78027
|
+
preview: `${npm23} run build && wrangler dev`,
|
|
77979
78028
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
77980
78029
|
}
|
|
77981
78030
|
}),
|
|
@@ -77983,20 +78032,20 @@ var config37 = {
|
|
|
77983
78032
|
deployScript: "deploy",
|
|
77984
78033
|
previewScript: "preview"
|
|
77985
78034
|
};
|
|
77986
|
-
var
|
|
78035
|
+
var c3_default48 = config45;
|
|
77987
78036
|
|
|
77988
78037
|
// templates/vue/c3.ts
|
|
77989
|
-
var
|
|
78038
|
+
var config46 = {
|
|
77990
78039
|
displayName: "Vue",
|
|
77991
|
-
platformVariants: { pages:
|
|
78040
|
+
platformVariants: { pages: c3_default47, workers: c3_default48 }
|
|
77992
78041
|
};
|
|
77993
|
-
var
|
|
78042
|
+
var c3_default49 = config46;
|
|
77994
78043
|
|
|
77995
78044
|
// src/git.ts
|
|
77996
78045
|
var import_node_assert = __toESM(require("node:assert"));
|
|
77997
78046
|
|
|
77998
78047
|
// ../wrangler/package.json
|
|
77999
|
-
var version2 = "4.
|
|
78048
|
+
var version2 = "4.6.0";
|
|
78000
78049
|
|
|
78001
78050
|
// src/git.ts
|
|
78002
78051
|
var offerGit = async (ctx) => {
|
|
@@ -78271,15 +78320,33 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
78271
78320
|
next: c3_default25,
|
|
78272
78321
|
nuxt: c3_default28,
|
|
78273
78322
|
qwik: c3_default34,
|
|
78274
|
-
react:
|
|
78275
|
-
|
|
78276
|
-
|
|
78277
|
-
|
|
78278
|
-
|
|
78323
|
+
react: c3_default38,
|
|
78324
|
+
"react-router": c3_default35,
|
|
78325
|
+
remix: c3_default41,
|
|
78326
|
+
solid: c3_default43,
|
|
78327
|
+
svelte: c3_default46,
|
|
78328
|
+
vue: c3_default49
|
|
78329
|
+
};
|
|
78330
|
+
}
|
|
78331
|
+
}
|
|
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
|
|
78279
78344
|
};
|
|
78280
78345
|
}
|
|
78281
78346
|
}
|
|
78282
|
-
function
|
|
78347
|
+
function getHelloWorldTemplateMap({
|
|
78348
|
+
experimental = false
|
|
78349
|
+
}) {
|
|
78283
78350
|
if (experimental) {
|
|
78284
78351
|
return {};
|
|
78285
78352
|
} else {
|
|
@@ -78290,7 +78357,7 @@ function getTemplateMap({ experimental = false }) {
|
|
|
78290
78357
|
"hello-world-durable-object": c3_default19,
|
|
78291
78358
|
"hello-world-durable-object-with-assets": c3_default18,
|
|
78292
78359
|
common: c3_default10,
|
|
78293
|
-
scheduled:
|
|
78360
|
+
scheduled: c3_default42,
|
|
78294
78361
|
queues: c3_default31,
|
|
78295
78362
|
openapi: c3_default29,
|
|
78296
78363
|
"pre-existing": c3_default30
|
|
@@ -78353,6 +78420,12 @@ var deriveCorrelatedArgs = (args) => {
|
|
|
78353
78420
|
};
|
|
78354
78421
|
var createContext = async (args, prevArgs) => {
|
|
78355
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 });
|
|
78356
78429
|
let linesPrinted = 0;
|
|
78357
78430
|
const goBack = async (from) => {
|
|
78358
78431
|
const currentArgs = { ...args };
|
|
@@ -78399,22 +78472,29 @@ var createContext = async (args, prevArgs) => {
|
|
|
78399
78472
|
validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
|
|
78400
78473
|
format: (val) => `./${val}`
|
|
78401
78474
|
});
|
|
78402
|
-
const categoryOptions = [
|
|
78403
|
-
|
|
78404
|
-
|
|
78475
|
+
const categoryOptions = [];
|
|
78476
|
+
if (Object.keys(helloWorldTemplateMap).length) {
|
|
78477
|
+
categoryOptions.push({
|
|
78478
|
+
label: "Hello World example",
|
|
78405
78479
|
value: "hello-world",
|
|
78406
|
-
description: "Select from
|
|
78407
|
-
}
|
|
78408
|
-
|
|
78480
|
+
description: "Select from barebones examples to get started with Workers"
|
|
78481
|
+
});
|
|
78482
|
+
}
|
|
78483
|
+
if (Object.keys(frameworkMap).length) {
|
|
78484
|
+
categoryOptions.push({
|
|
78409
78485
|
label: "Framework Starter",
|
|
78410
78486
|
value: "web-framework",
|
|
78411
78487
|
description: "Select from the most popular full-stack web frameworks"
|
|
78412
|
-
}
|
|
78413
|
-
|
|
78488
|
+
});
|
|
78489
|
+
}
|
|
78490
|
+
if (Object.keys(otherTemplateMap).length) {
|
|
78491
|
+
categoryOptions.push({
|
|
78414
78492
|
label: "Application Starter",
|
|
78415
78493
|
value: "demo",
|
|
78416
78494
|
description: "Select from a range of starter applications using various Cloudflare products"
|
|
78417
|
-
}
|
|
78495
|
+
});
|
|
78496
|
+
}
|
|
78497
|
+
categoryOptions.push(
|
|
78418
78498
|
{
|
|
78419
78499
|
label: "Template from a GitHub repo",
|
|
78420
78500
|
value: "remote-template",
|
|
@@ -78423,7 +78503,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
78423
78503
|
// This is used only if the type is `pre-existing`
|
|
78424
78504
|
{ label: "Others", value: "others", hidden: true },
|
|
78425
78505
|
backOption
|
|
78426
|
-
|
|
78506
|
+
);
|
|
78427
78507
|
const category = await processArgument(args, "category", {
|
|
78428
78508
|
type: "select",
|
|
78429
78509
|
question: "What would you like to start with?",
|
|
@@ -78437,14 +78517,17 @@ var createContext = async (args, prevArgs) => {
|
|
|
78437
78517
|
}
|
|
78438
78518
|
let template;
|
|
78439
78519
|
if (category === "web-framework") {
|
|
78440
|
-
const
|
|
78441
|
-
|
|
78442
|
-
|
|
78443
|
-
|
|
78444
|
-
|
|
78445
|
-
|
|
78446
|
-
|
|
78447
|
-
|
|
78520
|
+
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
78521
|
+
(acc, [key, config47]) => {
|
|
78522
|
+
if (!config47.hidden || args.framework) {
|
|
78523
|
+
acc.push({
|
|
78524
|
+
label: config47.displayName,
|
|
78525
|
+
value: key
|
|
78526
|
+
});
|
|
78527
|
+
}
|
|
78528
|
+
return acc;
|
|
78529
|
+
},
|
|
78530
|
+
[]
|
|
78448
78531
|
);
|
|
78449
78532
|
const framework = await processArgument(args, "framework", {
|
|
78450
78533
|
type: "select",
|
|
@@ -78495,18 +78578,14 @@ var createContext = async (args, prevArgs) => {
|
|
|
78495
78578
|
} else if (category === "remote-template") {
|
|
78496
78579
|
template = await processRemoteTemplate(args);
|
|
78497
78580
|
} else {
|
|
78498
|
-
const templateMap =
|
|
78499
|
-
experimental: args.experimental
|
|
78500
|
-
});
|
|
78581
|
+
const templateMap = category === "hello-world" ? helloWorldTemplateMap : otherTemplateMap;
|
|
78501
78582
|
const templateOptions = Object.entries(templateMap).map(
|
|
78502
78583
|
([value, { displayName, description, hidden: hidden2 }]) => {
|
|
78503
|
-
const isHelloWorldExample = value.startsWith("hello-world");
|
|
78504
|
-
const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
|
|
78505
78584
|
return {
|
|
78506
78585
|
value,
|
|
78507
78586
|
label: displayName,
|
|
78508
78587
|
description,
|
|
78509
|
-
hidden: hidden2
|
|
78588
|
+
hidden: hidden2
|
|
78510
78589
|
};
|
|
78511
78590
|
}
|
|
78512
78591
|
);
|
|
@@ -78609,28 +78688,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
78609
78688
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
78610
78689
|
}
|
|
78611
78690
|
const path6 = await downloadRemoteTemplate(src);
|
|
78612
|
-
const
|
|
78613
|
-
validateTemplate(path6,
|
|
78691
|
+
const config47 = inferTemplateConfig(path6);
|
|
78692
|
+
validateTemplate(path6, config47);
|
|
78614
78693
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
78615
78694
|
return {
|
|
78616
78695
|
path: path6,
|
|
78617
|
-
...
|
|
78696
|
+
...config47
|
|
78618
78697
|
};
|
|
78619
78698
|
};
|
|
78620
|
-
var validateTemplate = (path6,
|
|
78621
|
-
if (!
|
|
78699
|
+
var validateTemplate = (path6, config47) => {
|
|
78700
|
+
if (!config47.copyFiles) {
|
|
78622
78701
|
return;
|
|
78623
78702
|
}
|
|
78624
|
-
if (isVariantInfo(
|
|
78625
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
78703
|
+
if (isVariantInfo(config47.copyFiles)) {
|
|
78704
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config47.copyFiles.path), config47);
|
|
78626
78705
|
} else {
|
|
78627
|
-
for (const variant of Object.values(
|
|
78628
|
-
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);
|
|
78629
78708
|
}
|
|
78630
78709
|
}
|
|
78631
78710
|
};
|
|
78632
|
-
var validateTemplateSrcDirectory = (path6,
|
|
78633
|
-
if (
|
|
78711
|
+
var validateTemplateSrcDirectory = (path6, config47) => {
|
|
78712
|
+
if (config47.platform === "workers") {
|
|
78634
78713
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
78635
78714
|
const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
|
|
78636
78715
|
const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -78803,10 +78882,7 @@ var cliDefinition = {
|
|
|
78803
78882
|
values(args) {
|
|
78804
78883
|
const experimental = Boolean(args?.["experimental"]);
|
|
78805
78884
|
if (experimental) {
|
|
78806
|
-
return [
|
|
78807
|
-
{ name: "hello-world", description: "Hello World Starter" },
|
|
78808
|
-
{ name: "web-framework", description: "Framework Starter" }
|
|
78809
|
-
];
|
|
78885
|
+
return [{ name: "web-framework", description: "Framework Starter" }];
|
|
78810
78886
|
} else {
|
|
78811
78887
|
return [
|
|
78812
78888
|
{ name: "hello-world", description: "Hello World Starter" },
|
|
@@ -78832,40 +78908,10 @@ var cliDefinition = {
|
|
|
78832
78908
|
`,
|
|
78833
78909
|
values(args) {
|
|
78834
78910
|
const experimental = Boolean(args?.["experimental"]);
|
|
78835
|
-
|
|
78836
|
-
|
|
78837
|
-
|
|
78838
|
-
|
|
78839
|
-
{
|
|
78840
|
-
name: "hello-world",
|
|
78841
|
-
description: "A basic \u201CHello World\u201D Cloudflare Worker."
|
|
78842
|
-
},
|
|
78843
|
-
{
|
|
78844
|
-
name: "hello-world-durable-object",
|
|
78845
|
-
description: "A basic \u201CHello World\u201D Cloudflare Worker with a Durable Worker."
|
|
78846
|
-
},
|
|
78847
|
-
{
|
|
78848
|
-
name: "common",
|
|
78849
|
-
description: "A Cloudflare Worker which implements a common example of routing/proxying functionalities."
|
|
78850
|
-
},
|
|
78851
|
-
{
|
|
78852
|
-
name: "scheduled",
|
|
78853
|
-
description: "A scheduled Cloudflare Worker (triggered via Cron Triggers)."
|
|
78854
|
-
},
|
|
78855
|
-
{
|
|
78856
|
-
name: "queues",
|
|
78857
|
-
description: "A Cloudflare Worker which is both a consumer and produced of Queues."
|
|
78858
|
-
},
|
|
78859
|
-
{
|
|
78860
|
-
name: "openapi",
|
|
78861
|
-
description: "A Worker implementing an OpenAPI REST endpoint."
|
|
78862
|
-
},
|
|
78863
|
-
{
|
|
78864
|
-
name: "pre-existing",
|
|
78865
|
-
description: "Fetch a Worker initialized from the Cloudflare dashboard."
|
|
78866
|
-
}
|
|
78867
|
-
];
|
|
78868
|
-
}
|
|
78911
|
+
return getNamesAndDescriptions({
|
|
78912
|
+
...getHelloWorldTemplateMap({ experimental }),
|
|
78913
|
+
...getOtherTemplateMap({ experimental })
|
|
78914
|
+
});
|
|
78869
78915
|
}
|
|
78870
78916
|
},
|
|
78871
78917
|
{
|
|
@@ -78880,7 +78926,7 @@ var cliDefinition = {
|
|
|
78880
78926
|
You may specify additional arguments to be passed directly to these underlying tools by adding them after a "--" argument, like so:
|
|
78881
78927
|
|
|
78882
78928
|
npm create cloudflare -- --framework next -- --ts
|
|
78883
|
-
pnpm create
|
|
78929
|
+
pnpm create cloudflare --framework next -- --ts
|
|
78884
78930
|
`,
|
|
78885
78931
|
values: (args) => getNamesAndDescriptions(
|
|
78886
78932
|
getFrameworkMap({
|
|
@@ -80541,20 +80587,20 @@ function applyEdits(text, edits) {
|
|
|
80541
80587
|
var import_fs12 = require("fs");
|
|
80542
80588
|
var import_path14 = require("path");
|
|
80543
80589
|
var import_toml2 = __toESM(require_toml());
|
|
80544
|
-
function ensureNameExists(
|
|
80545
|
-
|
|
80546
|
-
return
|
|
80590
|
+
function ensureNameExists(config47, projectName) {
|
|
80591
|
+
config47["name"] = projectName;
|
|
80592
|
+
return config47;
|
|
80547
80593
|
}
|
|
80548
|
-
async function ensureCompatDateExists(
|
|
80549
|
-
if (typeof
|
|
80594
|
+
async function ensureCompatDateExists(config47) {
|
|
80595
|
+
if (typeof config47["compatibility_date"] === "string") {
|
|
80550
80596
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
|
|
80551
|
-
if (!
|
|
80552
|
-
|
|
80597
|
+
if (!config47["compatibility_date"].match(validCompatDateRe)) {
|
|
80598
|
+
config47["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80553
80599
|
}
|
|
80554
80600
|
} else {
|
|
80555
|
-
|
|
80601
|
+
config47["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80556
80602
|
}
|
|
80557
|
-
return
|
|
80603
|
+
return config47;
|
|
80558
80604
|
}
|
|
80559
80605
|
var updateWranglerConfig = async (ctx) => {
|
|
80560
80606
|
if (wranglerJsonExists(ctx)) {
|
|
@@ -80565,12 +80611,15 @@ var updateWranglerConfig = async (ctx) => {
|
|
|
80565
80611
|
const modified = await ensureCompatDateExists(
|
|
80566
80612
|
ensureNameExists(parsed, ctx.project.name)
|
|
80567
80613
|
);
|
|
80568
|
-
|
|
80614
|
+
let comment = `/**
|
|
80569
80615
|
* For more details on how to configure Wrangler, refer to:
|
|
80570
80616
|
* https://developers.cloudflare.com/workers/wrangler/configuration/
|
|
80571
80617
|
*/
|
|
80572
|
-
{
|
|
80618
|
+
{`;
|
|
80619
|
+
if (!modified["$schema"]) {
|
|
80620
|
+
comment += `
|
|
80573
80621
|
"$schema": "node_modules/wrangler/config-schema.json",`;
|
|
80622
|
+
}
|
|
80574
80623
|
if (!modified["observability"]) {
|
|
80575
80624
|
modified["observability"] = { enabled: true };
|
|
80576
80625
|
}
|
|
@@ -80725,7 +80774,7 @@ var addVscodeConfig = (ctx) => {
|
|
|
80725
80774
|
|
|
80726
80775
|
// src/deploy.ts
|
|
80727
80776
|
var offerToDeploy = async (ctx) => {
|
|
80728
|
-
const { npm:
|
|
80777
|
+
const { npm: npm25 } = detectPackageManager();
|
|
80729
80778
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
80730
80779
|
if (!await isDeployable(ctx)) {
|
|
80731
80780
|
ctx.args.deploy = false;
|
|
@@ -80736,7 +80785,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
80736
80785
|
);
|
|
80737
80786
|
}
|
|
80738
80787
|
const label = `deploy via \`${quoteShellArgs([
|
|
80739
|
-
|
|
80788
|
+
npm25,
|
|
80740
80789
|
"run",
|
|
80741
80790
|
ctx.template.deployScript ?? "deploy"
|
|
80742
80791
|
])}\``;
|
|
@@ -80773,11 +80822,11 @@ var readWranglerConfig = (ctx) => {
|
|
|
80773
80822
|
return import_toml3.default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
|
|
80774
80823
|
};
|
|
80775
80824
|
var runDeploy = async (ctx) => {
|
|
80776
|
-
const { npm:
|
|
80825
|
+
const { npm: npm25, name: pm4 } = detectPackageManager();
|
|
80777
80826
|
if (!ctx.account?.id) {
|
|
80778
80827
|
throw new Error("Failed to read Cloudflare account.");
|
|
80779
80828
|
}
|
|
80780
|
-
const baseDeployCmd = [
|
|
80829
|
+
const baseDeployCmd = [npm25, "run", ctx.template.deployScript ?? "deploy"];
|
|
80781
80830
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
80782
80831
|
const deployCmd = [
|
|
80783
80832
|
...baseDeployCmd,
|
|
@@ -80893,14 +80942,14 @@ var printSummary = (ctx) => {
|
|
|
80893
80942
|
const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
|
|
80894
80943
|
const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
|
|
80895
80944
|
const cdCommand = relativePath ? `cd ${relativePath}` : null;
|
|
80896
|
-
const { npm:
|
|
80945
|
+
const { npm: npm25 } = detectPackageManager();
|
|
80897
80946
|
const devServerCommand = quoteShellArgs([
|
|
80898
|
-
|
|
80947
|
+
npm25,
|
|
80899
80948
|
"run",
|
|
80900
80949
|
ctx.template.devScript ?? "start"
|
|
80901
80950
|
]);
|
|
80902
80951
|
const deployCommand = quoteShellArgs([
|
|
80903
|
-
|
|
80952
|
+
npm25,
|
|
80904
80953
|
"run",
|
|
80905
80954
|
ctx.template.deployScript ?? "deploy"
|
|
80906
80955
|
]);
|
|
@@ -81268,8 +81317,8 @@ var renderValues = (values) => {
|
|
|
81268
81317
|
};
|
|
81269
81318
|
|
|
81270
81319
|
// src/helpers/retry.ts
|
|
81271
|
-
var retry = async (
|
|
81272
|
-
let { times } =
|
|
81320
|
+
var retry = async (config47, fn) => {
|
|
81321
|
+
let { times } = config47;
|
|
81273
81322
|
let error2 = null;
|
|
81274
81323
|
while (times > 0) {
|
|
81275
81324
|
try {
|
|
@@ -81277,10 +81326,10 @@ var retry = async (config39, fn) => {
|
|
|
81277
81326
|
} catch (e) {
|
|
81278
81327
|
error2 = e;
|
|
81279
81328
|
times--;
|
|
81280
|
-
if (
|
|
81329
|
+
if (config47.exitCondition?.(e)) {
|
|
81281
81330
|
break;
|
|
81282
81331
|
}
|
|
81283
|
-
await sleep(
|
|
81332
|
+
await sleep(config47.sleepMs ?? 1e3);
|
|
81284
81333
|
}
|
|
81285
81334
|
}
|
|
81286
81335
|
throw error2;
|
|
@@ -81370,14 +81419,14 @@ var createProject = async (ctx) => {
|
|
|
81370
81419
|
var import_fs13 = require("fs");
|
|
81371
81420
|
var import_path16 = require("path");
|
|
81372
81421
|
async function installWorkersTypes(ctx) {
|
|
81373
|
-
const { npm:
|
|
81422
|
+
const { npm: npm25 } = detectPackageManager();
|
|
81374
81423
|
if (!usesTypescript(ctx)) {
|
|
81375
81424
|
return;
|
|
81376
81425
|
}
|
|
81377
81426
|
await installPackages(["@cloudflare/workers-types"], {
|
|
81378
81427
|
dev: true,
|
|
81379
81428
|
startText: "Installing @cloudflare/workers-types",
|
|
81380
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
81429
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm25}`)}`
|
|
81381
81430
|
});
|
|
81382
81431
|
await addWorkersTypesToTsConfig(ctx);
|
|
81383
81432
|
}
|
|
@@ -81400,8 +81449,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81400
81449
|
}
|
|
81401
81450
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81402
81451
|
try {
|
|
81403
|
-
const
|
|
81404
|
-
const currentTypes =
|
|
81452
|
+
const config47 = parse4(tsconfig);
|
|
81453
|
+
const currentTypes = config47.compilerOptions?.types ?? [];
|
|
81405
81454
|
const explicitEntrypoint = currentTypes.some(
|
|
81406
81455
|
(t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81407
81456
|
);
|
|
@@ -81431,7 +81480,7 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81431
81480
|
}
|
|
81432
81481
|
|
|
81433
81482
|
// src/cli.ts
|
|
81434
|
-
var { npm:
|
|
81483
|
+
var { npm: npm24 } = detectPackageManager();
|
|
81435
81484
|
var main = async (argv) => {
|
|
81436
81485
|
const result = await parseArgs(argv);
|
|
81437
81486
|
if (result.type === "unknown") {
|
|
@@ -81467,10 +81516,10 @@ ${result.errorMessage}`);
|
|
|
81467
81516
|
};
|
|
81468
81517
|
var runLatest = async () => {
|
|
81469
81518
|
const args = process.argv.slice(2);
|
|
81470
|
-
if (
|
|
81519
|
+
if (npm24 === "npm") {
|
|
81471
81520
|
args.unshift("--");
|
|
81472
81521
|
}
|
|
81473
|
-
await runCommand([
|
|
81522
|
+
await runCommand([npm24, "create", "cloudflare@latest", ...args]);
|
|
81474
81523
|
};
|
|
81475
81524
|
var runCli = async (args) => {
|
|
81476
81525
|
printBanner(args);
|