create-cloudflare 0.0.0-dfbf03f87 → 0.0.0-dfea523ea
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 +490 -463
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/templates/angular/pages/c3.ts +1 -0
- package/templates/astro/pages/c3.ts +1 -0
- package/templates/astro/workers/templates/ts/wrangler.jsonc +1 -1
- package/templates/common/c3.ts +5 -1
- package/templates/docusaurus/pages/c3.ts +1 -0
- package/templates/gatsby/pages/c3.ts +1 -0
- 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-assets-only/c3.ts +2 -2
- package/templates/hello-world-durable-object/c3.ts +4 -1
- package/templates/hello-world-with-assets/c3.ts +7 -3
- 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 +0 -6
- 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/hono/pages/c3.ts +3 -1
- package/templates/hono/pages/templates/wrangler.jsonc +1 -2
- package/templates/next/c3.ts +7 -221
- package/templates/next/pages/c3.ts +225 -0
- package/{templates-experimental/next → templates/next/workers}/c3.ts +6 -7
- package/templates/next/workers/templates/open-next.config.ts +9 -0
- package/{templates-experimental/next → templates/next/workers}/templates/wrangler.jsonc +1 -1
- package/templates/nuxt/pages/c3.ts +1 -0
- package/templates/openapi/c3.ts +5 -1
- package/templates/pre-existing/c3.ts +6 -2
- package/templates/queues/c3.ts +5 -1
- package/templates/qwik/pages/c3.ts +1 -0
- package/templates/react/pages/c3.ts +1 -0
- package/templates/react/workers/js/src/App.jsx +1 -1
- package/templates/react/workers/js/{api → worker}/index.js +1 -1
- package/templates/react/workers/js/wrangler.jsonc +2 -2
- package/templates/react/workers/ts/src/App.tsx +1 -1
- package/templates/react/workers/ts/tsconfig.worker.json +1 -1
- package/templates/react/workers/ts/{api → worker}/index.ts +2 -3
- package/templates/react/workers/ts/wrangler.jsonc +2 -2
- package/templates/remix/pages/c3.ts +1 -0
- package/templates/scheduled/c3.ts +5 -1
- package/templates/scheduled/ts/src/index.ts +7 -0
- package/templates/svelte/pages/c3.ts +1 -0
- package/templates/vue/pages/c3.ts +1 -0
- package/templates/vue/workers/js/server/index.js +2 -2
- package/templates/vue/workers/js/wrangler.jsonc +0 -1
- package/templates/vue/workers/ts/server/index.ts +2 -3
- package/templates/vue/workers/ts/wrangler.jsonc +0 -1
- package/templates-experimental/next/templates/open-next.config.ts +0 -6
- /package/templates/next/{README.md → pages/README.md} +0 -0
- /package/templates/next/{app → pages/app}/js/app/api/hello/route.js +0 -0
- /package/templates/next/{app → pages/app}/js/app/not-found.js +0 -0
- /package/templates/next/{app → pages/app}/ts/app/api/hello/route.ts +0 -0
- /package/templates/next/{app → pages/app}/ts/app/not-found.tsx +0 -0
- /package/templates/next/{env.d.ts → pages/env.d.ts} +0 -0
- /package/templates/next/pages/{js → pages/js}/pages/api/hello.js +0 -0
- /package/templates/next/pages/{ts → pages/ts}/pages/api/hello.ts +0 -0
- /package/templates/next/{wrangler.jsonc → pages/wrangler.jsonc} +0 -0
- /package/{templates-experimental/next → templates/next/workers}/templates/.dev.vars +0 -0
- /package/{templates-experimental/next → templates/next/workers}/templates/__dot__gitignore +0 -0
- /package/{templates-experimental/next → templates/next/workers}/templates/cloudflare-env.d.ts +0 -0
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 config48(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 config48 = 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: config48, 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 config48 = 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: config48, 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 config48 = 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: config48, 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 config48 = (0, _lodash["default"])(options, this.config);
|
|
31513
|
+
if (config48.tokenHex === true) {
|
|
31514
|
+
config48.tokenChars = "0123456789abcdef";
|
|
31515
31515
|
}
|
|
31516
31516
|
var adjective = this._randomElement(this.adjectives);
|
|
31517
31517
|
var noun = this._randomElement(this.nouns);
|
|
31518
|
-
if (!
|
|
31518
|
+
if (!config48.tokenLength) config48.tokenLength = 0;
|
|
31519
31519
|
var token = "";
|
|
31520
|
-
for (var i = 0; i <
|
|
31521
|
-
token += this._randomElement(
|
|
31520
|
+
for (var i = 0; i < config48.tokenLength; i++) {
|
|
31521
|
+
token += this._randomElement(config48.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(config48.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, config48) {
|
|
40040
40040
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
40041
|
-
this.errorHandler.tolerant =
|
|
40041
|
+
this.errorHandler.tolerant = config48 ? typeof config48.tolerant === "boolean" && config48.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 = config48 ? typeof config48.comment === "boolean" && config48.comment : false;
|
|
40044
|
+
this.trackRange = config48 ? typeof config48.range === "boolean" && config48.range : false;
|
|
40045
|
+
this.trackLoc = config48 ? typeof config48.loc === "boolean" && config48.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(config48) {
|
|
49807
49807
|
assert_1.default.ok(this instanceof Printer2);
|
|
49808
|
-
var explicitTabWidth =
|
|
49809
|
-
|
|
49810
|
-
|
|
49808
|
+
var explicitTabWidth = config48 && config48.tabWidth;
|
|
49809
|
+
config48 = options_1.normalize(config48);
|
|
49810
|
+
config48.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 = config48.tabWidth;
|
|
49826
49826
|
if (!explicitTabWidth) {
|
|
49827
49827
|
var loc = path6.getNode().loc;
|
|
49828
49828
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
49829
|
-
|
|
49829
|
+
config48.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, config48, options, makePrintFunctionWith(options, {
|
|
49844
49844
|
includeComments: true,
|
|
49845
49845
|
avoidRootParens: false
|
|
49846
49846
|
}));
|
|
49847
|
-
|
|
49847
|
+
config48.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(config48), util.composeSourceMaps(config48.inputSourceMap, lines.getSourceMap(config48.sourceMapName, config48.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, config48, {
|
|
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 = config48.reuseWhitespace;
|
|
49874
|
+
config48.reuseWhitespace = false;
|
|
49875
|
+
var pr = new PrintResult(printGenerically(path6).toString(config48));
|
|
49876
|
+
config48.reuseWhitespace = oldReuseWhitespace;
|
|
49877
49877
|
return pr;
|
|
49878
49878
|
};
|
|
49879
49879
|
};
|
|
49880
49880
|
exports2.Printer = Printer;
|
|
49881
|
-
function genericPrint(path6,
|
|
49881
|
+
function genericPrint(path6, config48, 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, config48, 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 = (config48, value) => {
|
|
69384
|
+
const { question, label } = config48;
|
|
69385
|
+
if (config48.type !== "confirm" && !value) {
|
|
69386
69386
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
69387
69387
|
}
|
|
69388
|
-
const content =
|
|
69388
|
+
const content = config48.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 = (config48) => {
|
|
69392
|
+
switch (config48.type) {
|
|
69393
69393
|
case "select":
|
|
69394
|
-
return getSelectRenderers(
|
|
69394
|
+
return getSelectRenderers(config48);
|
|
69395
69395
|
case "confirm":
|
|
69396
|
-
return getConfirmRenderers(
|
|
69396
|
+
return getConfirmRenderers(config48);
|
|
69397
69397
|
case "text":
|
|
69398
|
-
return getTextRenderers(
|
|
69398
|
+
return getTextRenderers(config48);
|
|
69399
69399
|
case "multiselect":
|
|
69400
|
-
return getSelectRenderers(
|
|
69400
|
+
return getSelectRenderers(config48);
|
|
69401
69401
|
case "list":
|
|
69402
|
-
return getSelectListRenderers(
|
|
69402
|
+
return getSelectListRenderers(config48);
|
|
69403
69403
|
}
|
|
69404
69404
|
};
|
|
69405
|
-
var getTextRenderers = (
|
|
69406
|
-
const { question } =
|
|
69407
|
-
const helpText =
|
|
69408
|
-
const format5 =
|
|
69409
|
-
const defaultValue =
|
|
69405
|
+
var getTextRenderers = (config48) => {
|
|
69406
|
+
const { question } = config48;
|
|
69407
|
+
const helpText = config48.helpText ?? "";
|
|
69408
|
+
const format5 = config48.format ?? ((val) => String(val));
|
|
69409
|
+
const defaultValue = config48.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(config48, format5(value ?? "")),
|
|
69433
69433
|
cancel: activeRenderer
|
|
69434
69434
|
};
|
|
69435
69435
|
};
|
|
69436
|
-
var getSelectRenderers = (
|
|
69437
|
-
const { options, question, helpText: _helpText } =
|
|
69436
|
+
var getSelectRenderers = (config48) => {
|
|
69437
|
+
const { options, question, helpText: _helpText } = config48;
|
|
69438
69438
|
const helpText = _helpText ?? "";
|
|
69439
|
-
const maxItemsPerPage =
|
|
69439
|
+
const maxItemsPerPage = config48.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
|
+
config48,
|
|
69515
69515
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
69516
69516
|
);
|
|
69517
69517
|
}
|
|
69518
69518
|
return renderSubmit(
|
|
69519
|
-
|
|
69519
|
+
config48,
|
|
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 = (config48) => {
|
|
69527
|
+
const { question, helpText: _helpText } = config48;
|
|
69528
|
+
let options = config48.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
|
+
config48,
|
|
69610
69610
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
69611
69611
|
);
|
|
69612
69612
|
}
|
|
69613
69613
|
return renderSubmit(
|
|
69614
|
-
|
|
69614
|
+
config48,
|
|
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 = (config48) => {
|
|
69622
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config48;
|
|
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(config48, 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 config48 = 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
|
+
config48 = resolveConfig(resolvedConfigPath);
|
|
70613
70613
|
} catch (e) {
|
|
70614
|
-
|
|
70614
|
+
config48 = e;
|
|
70615
70615
|
}
|
|
70616
|
-
if (
|
|
70617
|
-
error2 =
|
|
70616
|
+
if (config48 instanceof Error) {
|
|
70617
|
+
error2 = config48;
|
|
70618
70618
|
return;
|
|
70619
70619
|
}
|
|
70620
70620
|
} else {
|
|
70621
|
-
|
|
70621
|
+
config48 = mixin2.require(resolvedConfigPath);
|
|
70622
70622
|
}
|
|
70623
|
-
setConfigObject(
|
|
70623
|
+
setConfigObject(config48);
|
|
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(config48, prev) {
|
|
70634
|
+
Object.keys(config48).forEach(function(key) {
|
|
70635
|
+
const value = config48[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 config48 = 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: config48
|
|
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(config48, 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(config48, "extends")) {
|
|
73018
|
+
if (typeof config48.extends !== "string")
|
|
73019
73019
|
return defaultConfig;
|
|
73020
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
73020
|
+
const isPath = /\.json|\..*rc$/.test(config48.extends);
|
|
73021
73021
|
let pathToDefault = null;
|
|
73022
73022
|
if (!isPath) {
|
|
73023
73023
|
try {
|
|
73024
|
-
pathToDefault = require.resolve(
|
|
73024
|
+
pathToDefault = require.resolve(config48.extends);
|
|
73025
73025
|
} catch (_err) {
|
|
73026
|
-
return
|
|
73026
|
+
return config48;
|
|
73027
73027
|
}
|
|
73028
73028
|
} else {
|
|
73029
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
73029
|
+
pathToDefault = getPathToDefaultConfig(cwd, config48.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(config48.extends);
|
|
73034
|
+
delete config48.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, config48) : Object.assign({}, defaultConfig, config48);
|
|
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(config48) {
|
|
73815
|
+
argsert("<object>", [config48], arguments.length);
|
|
73816
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config48, "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(config48) {
|
|
73989
|
+
argsert("<object>", [config48], arguments.length);
|
|
73990
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config48, "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 config48 = 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, ...config48 }
|
|
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 = "0.0.0-
|
|
74563
|
+
var version = "0.0.0-dfea523ea";
|
|
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(config48) {
|
|
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
|
+
config48,
|
|
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 config48 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
74621
74621
|
return JSON.parse(
|
|
74622
|
-
|
|
74622
|
+
config48,
|
|
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(config48) {
|
|
74633
|
+
const deviceId = config48.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
74634
|
+
if (config48.deviceId === void 0) {
|
|
74635
|
+
writeMetricsConfig({ ...config48, deviceId });
|
|
74636
74636
|
}
|
|
74637
74637
|
return deviceId;
|
|
74638
74638
|
}
|
|
@@ -74853,7 +74853,7 @@ var detectPmMismatch = (ctx) => {
|
|
|
74853
74853
|
|
|
74854
74854
|
// src/helpers/sparrow.ts
|
|
74855
74855
|
var import_undici = __toESM(require_undici());
|
|
74856
|
-
var SPARROW_SOURCE_KEY = "
|
|
74856
|
+
var SPARROW_SOURCE_KEY = "";
|
|
74857
74857
|
var SPARROW_URL = "https://sparrow.cloudflare.com";
|
|
74858
74858
|
function hasSparrowSourceKey() {
|
|
74859
74859
|
return SPARROW_SOURCE_KEY !== "";
|
|
@@ -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 config48 = readMetricsConfig() ?? {};
|
|
74911
|
+
const isFirstUsage = config48.c3permission === void 0;
|
|
74912
74912
|
const isEnabled = isTelemetryEnabled();
|
|
74913
|
-
const deviceId = getDeviceId(
|
|
74913
|
+
const deviceId = getDeviceId(config48);
|
|
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(config48).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(config48 = readMetricsConfig() ?? {}) {
|
|
75053
|
+
if (!config48.c3permission) {
|
|
75054
|
+
config48.c3permission = initializeC3Permission();
|
|
75055
|
+
writeMetricsConfig(config48);
|
|
75056
75056
|
}
|
|
75057
|
-
return
|
|
75057
|
+
return config48.c3permission;
|
|
75058
75058
|
}
|
|
75059
75059
|
function updateC3Pemission(enabled) {
|
|
75060
|
-
const
|
|
75061
|
-
if (
|
|
75060
|
+
const config48 = readMetricsConfig();
|
|
75061
|
+
if (config48.c3permission?.enabled === enabled) {
|
|
75062
75062
|
return;
|
|
75063
75063
|
}
|
|
75064
|
-
|
|
75065
|
-
writeMetricsConfig(
|
|
75064
|
+
config48.c3permission = initializeC3Permission(enabled);
|
|
75065
|
+
writeMetricsConfig(config48);
|
|
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, config48 = {}) => {
|
|
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 = config48.dev ? "-D" : "";
|
|
75118
75118
|
break;
|
|
75119
75119
|
case "bun":
|
|
75120
75120
|
cmd = "add";
|
|
75121
|
-
saveFlag =
|
|
75121
|
+
saveFlag = config48.dev ? "-d" : "";
|
|
75122
75122
|
break;
|
|
75123
75123
|
case "npm":
|
|
75124
75124
|
case "pnpm":
|
|
75125
75125
|
default:
|
|
75126
75126
|
cmd = "install";
|
|
75127
|
-
saveFlag =
|
|
75127
|
+
saveFlag = config48.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
|
+
...config48,
|
|
75143
75143
|
silent: true
|
|
75144
75144
|
}
|
|
75145
75145
|
);
|
|
@@ -75335,21 +75335,21 @@ 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
|
-
"@angular/create": "19.
|
|
75340
|
+
"@angular/create": "19.2.6",
|
|
75341
75341
|
"create-docusaurus": "3.7.0",
|
|
75342
|
-
"create-hono": "0.
|
|
75342
|
+
"create-hono": "0.17.0",
|
|
75343
75343
|
"create-next-app": "15.2.1",
|
|
75344
|
-
"create-qwik": "1.
|
|
75345
|
-
"create-vite": "6.
|
|
75344
|
+
"create-qwik": "1.13.0",
|
|
75345
|
+
"create-vite": "6.3.1",
|
|
75346
75346
|
"create-remix": "2.15.3",
|
|
75347
|
-
"create-react-router": "7.
|
|
75348
|
-
"create-solid": "0.6.
|
|
75349
|
-
"create-vue": "3.
|
|
75347
|
+
"create-react-router": "7.5.0",
|
|
75348
|
+
"create-solid": "0.6.2",
|
|
75349
|
+
"create-vue": "3.16.4",
|
|
75350
75350
|
gatsby: "5.14.1",
|
|
75351
|
-
sv: "0.
|
|
75352
|
-
nuxi: "3.
|
|
75351
|
+
sv: "0.8.0",
|
|
75352
|
+
nuxi: "3.24.1"
|
|
75353
75353
|
}
|
|
75354
75354
|
};
|
|
75355
75355
|
|
|
@@ -75379,63 +75379,6 @@ var runFrameworkGenerator = async (ctx, args) => {
|
|
|
75379
75379
|
await runCommand(cmd, { env: env3 });
|
|
75380
75380
|
};
|
|
75381
75381
|
|
|
75382
|
-
// templates-experimental/next/c3.ts
|
|
75383
|
-
var generate = async (ctx) => {
|
|
75384
|
-
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
75385
|
-
};
|
|
75386
|
-
var configure = async (ctx) => {
|
|
75387
|
-
const packages = [
|
|
75388
|
-
"@opennextjs/cloudflare@0.5.x",
|
|
75389
|
-
"@cloudflare/workers-types"
|
|
75390
|
-
];
|
|
75391
|
-
await installPackages(packages, {
|
|
75392
|
-
dev: true,
|
|
75393
|
-
startText: "Adding the Cloudflare adapter",
|
|
75394
|
-
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
75395
|
-
});
|
|
75396
|
-
const usesTs = usesTypescript(ctx);
|
|
75397
|
-
updateNextConfig(usesTs);
|
|
75398
|
-
};
|
|
75399
|
-
var updateNextConfig = (usesTs) => {
|
|
75400
|
-
const s = spinner();
|
|
75401
|
-
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
75402
|
-
s.start(`Updating \`${configFile}\``);
|
|
75403
|
-
const configContent = readFile(configFile);
|
|
75404
|
-
const updatedConfigFile = configContent + `
|
|
75405
|
-
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
75406
|
-
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
75407
|
-
initOpenNextCloudflareForDev();
|
|
75408
|
-
`.replace(/\n\t*/g, "\n");
|
|
75409
|
-
writeFile2(configFile, updatedConfigFile);
|
|
75410
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75411
|
-
};
|
|
75412
|
-
var c3_default = {
|
|
75413
|
-
configVersion: 1,
|
|
75414
|
-
id: "next",
|
|
75415
|
-
frameworkCli: "create-next-app",
|
|
75416
|
-
// TODO: Stop using a pinned version when the template graduates.
|
|
75417
|
-
frameworkCliPinnedVersion: "~15.2.2",
|
|
75418
|
-
platform: "workers",
|
|
75419
|
-
displayName: "Next.js (using Node.js compat + Workers Assets)",
|
|
75420
|
-
path: "templates-experimental/next",
|
|
75421
|
-
copyFiles: {
|
|
75422
|
-
path: "./templates"
|
|
75423
|
-
},
|
|
75424
|
-
generate,
|
|
75425
|
-
configure,
|
|
75426
|
-
transformPackageJson: async () => ({
|
|
75427
|
-
scripts: {
|
|
75428
|
-
deploy: `opennextjs-cloudflare && wrangler deploy`,
|
|
75429
|
-
preview: `opennextjs-cloudflare && wrangler dev`,
|
|
75430
|
-
"cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
|
|
75431
|
-
}
|
|
75432
|
-
}),
|
|
75433
|
-
devScript: "dev",
|
|
75434
|
-
previewScript: "preview",
|
|
75435
|
-
deployScript: "deploy",
|
|
75436
|
-
compatibilityFlags: ["nodejs_compat"]
|
|
75437
|
-
};
|
|
75438
|
-
|
|
75439
75382
|
// src/helpers/codemod.ts
|
|
75440
75383
|
var import_fs8 = require("fs");
|
|
75441
75384
|
var import_path8 = __toESM(require("path"));
|
|
@@ -75566,11 +75509,11 @@ function getLatestTypesEntrypoint(ctx) {
|
|
|
75566
75509
|
// templates-experimental/solid/c3.ts
|
|
75567
75510
|
var recast2 = __toESM(require_main3());
|
|
75568
75511
|
var { npm } = detectPackageManager();
|
|
75569
|
-
var
|
|
75512
|
+
var generate = async (ctx) => {
|
|
75570
75513
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
75571
75514
|
logRaw("");
|
|
75572
75515
|
};
|
|
75573
|
-
var
|
|
75516
|
+
var configure = async (ctx) => {
|
|
75574
75517
|
const packages = ["nitropack"];
|
|
75575
75518
|
await installPackages(packages, {
|
|
75576
75519
|
dev: true,
|
|
@@ -75621,8 +75564,8 @@ var config = {
|
|
|
75621
75564
|
path: "./templates"
|
|
75622
75565
|
},
|
|
75623
75566
|
path: "templates-experimental/solid",
|
|
75624
|
-
generate
|
|
75625
|
-
configure
|
|
75567
|
+
generate,
|
|
75568
|
+
configure,
|
|
75626
75569
|
transformPackageJson: async () => ({
|
|
75627
75570
|
scripts: {
|
|
75628
75571
|
preview: `${npm} run build && npx wrangler dev`,
|
|
@@ -75634,12 +75577,12 @@ var config = {
|
|
|
75634
75577
|
deployScript: "deploy",
|
|
75635
75578
|
previewScript: "preview"
|
|
75636
75579
|
};
|
|
75637
|
-
var
|
|
75580
|
+
var c3_default = config;
|
|
75638
75581
|
|
|
75639
75582
|
// templates/analog/c3.ts
|
|
75640
75583
|
var recast3 = __toESM(require_main3());
|
|
75641
75584
|
var { npm: npm2, name: pm } = detectPackageManager();
|
|
75642
|
-
var
|
|
75585
|
+
var generate2 = async (ctx) => {
|
|
75643
75586
|
await runFrameworkGenerator(ctx, [
|
|
75644
75587
|
ctx.project.name,
|
|
75645
75588
|
"--template",
|
|
@@ -75647,7 +75590,7 @@ var generate3 = async (ctx) => {
|
|
|
75647
75590
|
]);
|
|
75648
75591
|
logRaw("");
|
|
75649
75592
|
};
|
|
75650
|
-
var
|
|
75593
|
+
var configure2 = async (ctx) => {
|
|
75651
75594
|
if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
|
|
75652
75595
|
const packages = [];
|
|
75653
75596
|
packages.push("nitropack");
|
|
@@ -75724,8 +75667,8 @@ var config2 = {
|
|
|
75724
75667
|
copyFiles: {
|
|
75725
75668
|
path: "./templates"
|
|
75726
75669
|
},
|
|
75727
|
-
generate:
|
|
75728
|
-
configure:
|
|
75670
|
+
generate: generate2,
|
|
75671
|
+
configure: configure2,
|
|
75729
75672
|
transformPackageJson: async () => ({
|
|
75730
75673
|
scripts: {
|
|
75731
75674
|
preview: `${npm2} run build && wrangler pages dev`,
|
|
@@ -75737,12 +75680,12 @@ var config2 = {
|
|
|
75737
75680
|
deployScript: "deploy",
|
|
75738
75681
|
previewScript: "preview"
|
|
75739
75682
|
};
|
|
75740
|
-
var
|
|
75683
|
+
var c3_default2 = config2;
|
|
75741
75684
|
|
|
75742
75685
|
// templates/angular/pages/c3.ts
|
|
75743
75686
|
var import_node_path3 = require("node:path");
|
|
75744
75687
|
var { npm: npm3 } = detectPackageManager();
|
|
75745
|
-
var
|
|
75688
|
+
var generate3 = async (ctx) => {
|
|
75746
75689
|
await runFrameworkGenerator(ctx, [
|
|
75747
75690
|
ctx.project.name,
|
|
75748
75691
|
"--ssr",
|
|
@@ -75750,7 +75693,7 @@ var generate4 = async (ctx) => {
|
|
|
75750
75693
|
]);
|
|
75751
75694
|
logRaw("");
|
|
75752
75695
|
};
|
|
75753
|
-
var
|
|
75696
|
+
var configure3 = async (ctx) => {
|
|
75754
75697
|
updateAngularJson(ctx);
|
|
75755
75698
|
await updateAppCode();
|
|
75756
75699
|
await installCFWorker();
|
|
@@ -75807,6 +75750,7 @@ var config3 = {
|
|
|
75807
75750
|
frameworkCli: "@angular/create",
|
|
75808
75751
|
displayName: "Angular",
|
|
75809
75752
|
platform: "pages",
|
|
75753
|
+
hidden: true,
|
|
75810
75754
|
copyFiles: {
|
|
75811
75755
|
path: "./templates"
|
|
75812
75756
|
},
|
|
@@ -75814,8 +75758,8 @@ var config3 = {
|
|
|
75814
75758
|
devScript: "start",
|
|
75815
75759
|
deployScript: "deploy",
|
|
75816
75760
|
previewScript: "start",
|
|
75817
|
-
generate:
|
|
75818
|
-
configure:
|
|
75761
|
+
generate: generate3,
|
|
75762
|
+
configure: configure3,
|
|
75819
75763
|
transformPackageJson: async () => ({
|
|
75820
75764
|
scripts: {
|
|
75821
75765
|
start: `${npm3} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
@@ -75825,12 +75769,12 @@ var config3 = {
|
|
|
75825
75769
|
}
|
|
75826
75770
|
})
|
|
75827
75771
|
};
|
|
75828
|
-
var
|
|
75772
|
+
var c3_default3 = config3;
|
|
75829
75773
|
|
|
75830
75774
|
// templates/angular/workers/c3.ts
|
|
75831
75775
|
var import_node_path4 = require("node:path");
|
|
75832
75776
|
var { npm: npm4 } = detectPackageManager();
|
|
75833
|
-
var
|
|
75777
|
+
var generate4 = async (ctx) => {
|
|
75834
75778
|
await runFrameworkGenerator(ctx, [
|
|
75835
75779
|
ctx.project.name,
|
|
75836
75780
|
"--ssr",
|
|
@@ -75838,7 +75782,7 @@ var generate5 = async (ctx) => {
|
|
|
75838
75782
|
]);
|
|
75839
75783
|
logRaw("");
|
|
75840
75784
|
};
|
|
75841
|
-
var
|
|
75785
|
+
var configure4 = async (ctx) => {
|
|
75842
75786
|
updateAngularJson2(ctx);
|
|
75843
75787
|
await updateAppCode2();
|
|
75844
75788
|
await installCFWorker2();
|
|
@@ -75901,8 +75845,8 @@ var config4 = {
|
|
|
75901
75845
|
devScript: "start",
|
|
75902
75846
|
deployScript: "deploy",
|
|
75903
75847
|
previewScript: "start",
|
|
75904
|
-
generate:
|
|
75905
|
-
configure:
|
|
75848
|
+
generate: generate4,
|
|
75849
|
+
configure: configure4,
|
|
75906
75850
|
transformPackageJson: async () => ({
|
|
75907
75851
|
scripts: {
|
|
75908
75852
|
start: `${npm4} run build && wrangler dev`,
|
|
@@ -75911,23 +75855,23 @@ var config4 = {
|
|
|
75911
75855
|
}
|
|
75912
75856
|
})
|
|
75913
75857
|
};
|
|
75914
|
-
var
|
|
75858
|
+
var c3_default4 = config4;
|
|
75915
75859
|
|
|
75916
75860
|
// templates/angular/c3.ts
|
|
75917
75861
|
var config5 = {
|
|
75918
75862
|
displayName: "Angular",
|
|
75919
|
-
platformVariants: { pages:
|
|
75863
|
+
platformVariants: { pages: c3_default3, workers: c3_default4 }
|
|
75920
75864
|
};
|
|
75921
|
-
var
|
|
75865
|
+
var c3_default5 = config5;
|
|
75922
75866
|
|
|
75923
75867
|
// templates/astro/pages/c3.ts
|
|
75924
75868
|
var recast4 = __toESM(require_main3());
|
|
75925
75869
|
var { npx } = detectPackageManager();
|
|
75926
|
-
var
|
|
75870
|
+
var generate5 = async (ctx) => {
|
|
75927
75871
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
75928
75872
|
logRaw("");
|
|
75929
75873
|
};
|
|
75930
|
-
var
|
|
75874
|
+
var configure5 = async () => {
|
|
75931
75875
|
await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
|
|
75932
75876
|
silent: true,
|
|
75933
75877
|
startText: "Installing adapter",
|
|
@@ -75966,6 +75910,7 @@ var config6 = {
|
|
|
75966
75910
|
id: "astro",
|
|
75967
75911
|
frameworkCli: "create-astro",
|
|
75968
75912
|
platform: "pages",
|
|
75913
|
+
hidden: true,
|
|
75969
75914
|
displayName: "Astro",
|
|
75970
75915
|
path: "templates/astro/pages",
|
|
75971
75916
|
copyFiles: {
|
|
@@ -75984,8 +75929,8 @@ var config6 = {
|
|
|
75984
75929
|
devScript: "dev",
|
|
75985
75930
|
deployScript: "deploy",
|
|
75986
75931
|
previewScript: "preview",
|
|
75987
|
-
generate:
|
|
75988
|
-
configure:
|
|
75932
|
+
generate: generate5,
|
|
75933
|
+
configure: configure5,
|
|
75989
75934
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
75990
75935
|
scripts: {
|
|
75991
75936
|
deploy: `astro build && wrangler pages deploy`,
|
|
@@ -75994,16 +75939,16 @@ var config6 = {
|
|
|
75994
75939
|
}
|
|
75995
75940
|
})
|
|
75996
75941
|
};
|
|
75997
|
-
var
|
|
75942
|
+
var c3_default6 = config6;
|
|
75998
75943
|
|
|
75999
75944
|
// templates/astro/workers/c3.ts
|
|
76000
75945
|
var recast5 = __toESM(require_main3());
|
|
76001
75946
|
var { npx: npx2 } = detectPackageManager();
|
|
76002
|
-
var
|
|
75947
|
+
var generate6 = async (ctx) => {
|
|
76003
75948
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76004
75949
|
logRaw("");
|
|
76005
75950
|
};
|
|
76006
|
-
var
|
|
75951
|
+
var configure6 = async () => {
|
|
76007
75952
|
await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
|
|
76008
75953
|
silent: true,
|
|
76009
75954
|
startText: "Installing adapter",
|
|
@@ -76060,8 +76005,8 @@ var config7 = {
|
|
|
76060
76005
|
deployScript: "deploy",
|
|
76061
76006
|
previewScript: "preview",
|
|
76062
76007
|
path: "templates/astro/workers",
|
|
76063
|
-
generate:
|
|
76064
|
-
configure:
|
|
76008
|
+
generate: generate6,
|
|
76009
|
+
configure: configure6,
|
|
76065
76010
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76066
76011
|
scripts: {
|
|
76067
76012
|
deploy: `astro build && wrangler deploy`,
|
|
@@ -76070,17 +76015,17 @@ var config7 = {
|
|
|
76070
76015
|
}
|
|
76071
76016
|
})
|
|
76072
76017
|
};
|
|
76073
|
-
var
|
|
76018
|
+
var c3_default7 = config7;
|
|
76074
76019
|
|
|
76075
76020
|
// templates/astro/c3.ts
|
|
76076
76021
|
var config8 = {
|
|
76077
76022
|
displayName: "Astro",
|
|
76078
|
-
platformVariants: { pages:
|
|
76023
|
+
platformVariants: { pages: c3_default6, workers: c3_default7 }
|
|
76079
76024
|
};
|
|
76080
|
-
var
|
|
76025
|
+
var c3_default8 = config8;
|
|
76081
76026
|
|
|
76082
76027
|
// templates/common/c3.ts
|
|
76083
|
-
var
|
|
76028
|
+
var config9 = {
|
|
76084
76029
|
configVersion: 1,
|
|
76085
76030
|
id: "common",
|
|
76086
76031
|
displayName: "Example router & proxy Worker",
|
|
@@ -76098,20 +76043,22 @@ var c3_default10 = {
|
|
|
76098
76043
|
}
|
|
76099
76044
|
}
|
|
76100
76045
|
};
|
|
76046
|
+
var c3_default9 = config9;
|
|
76101
76047
|
|
|
76102
76048
|
// templates/docusaurus/pages/c3.ts
|
|
76103
76049
|
var { npm: npm5 } = detectPackageManager();
|
|
76104
|
-
var
|
|
76050
|
+
var generate7 = async (ctx) => {
|
|
76105
76051
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76106
76052
|
};
|
|
76107
|
-
var
|
|
76053
|
+
var config10 = {
|
|
76108
76054
|
configVersion: 1,
|
|
76109
76055
|
id: "docusaurus",
|
|
76110
76056
|
frameworkCli: "create-docusaurus",
|
|
76111
76057
|
platform: "pages",
|
|
76058
|
+
hidden: true,
|
|
76112
76059
|
displayName: "Docusaurus",
|
|
76113
76060
|
path: "templates/docusaurus/pages",
|
|
76114
|
-
generate:
|
|
76061
|
+
generate: generate7,
|
|
76115
76062
|
transformPackageJson: async () => ({
|
|
76116
76063
|
scripts: {
|
|
76117
76064
|
preview: `${npm5} run build && wrangler pages dev ./build`,
|
|
@@ -76122,14 +76069,14 @@ var config9 = {
|
|
|
76122
76069
|
deployScript: "deploy",
|
|
76123
76070
|
previewScript: "preview"
|
|
76124
76071
|
};
|
|
76125
|
-
var
|
|
76072
|
+
var c3_default10 = config10;
|
|
76126
76073
|
|
|
76127
76074
|
// templates/docusaurus/workers/c3.ts
|
|
76128
76075
|
var { npm: npm6 } = detectPackageManager();
|
|
76129
|
-
var
|
|
76076
|
+
var generate8 = async (ctx) => {
|
|
76130
76077
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76131
76078
|
};
|
|
76132
|
-
var
|
|
76079
|
+
var config11 = {
|
|
76133
76080
|
configVersion: 1,
|
|
76134
76081
|
id: "docusaurus",
|
|
76135
76082
|
frameworkCli: "create-docusaurus",
|
|
@@ -76139,7 +76086,7 @@ var config10 = {
|
|
|
76139
76086
|
path: "./templates"
|
|
76140
76087
|
},
|
|
76141
76088
|
path: "templates/docusaurus/workers",
|
|
76142
|
-
generate:
|
|
76089
|
+
generate: generate8,
|
|
76143
76090
|
transformPackageJson: async () => ({
|
|
76144
76091
|
scripts: {
|
|
76145
76092
|
deploy: `${npm6} run build && wrangler deploy`,
|
|
@@ -76150,18 +76097,18 @@ var config10 = {
|
|
|
76150
76097
|
deployScript: "deploy",
|
|
76151
76098
|
previewScript: "preview"
|
|
76152
76099
|
};
|
|
76153
|
-
var
|
|
76100
|
+
var c3_default11 = config11;
|
|
76154
76101
|
|
|
76155
76102
|
// templates/docusaurus/c3.ts
|
|
76156
|
-
var
|
|
76103
|
+
var config12 = {
|
|
76157
76104
|
displayName: "Docusaurus",
|
|
76158
|
-
platformVariants: { pages:
|
|
76105
|
+
platformVariants: { pages: c3_default10, workers: c3_default11 }
|
|
76159
76106
|
};
|
|
76160
|
-
var
|
|
76107
|
+
var c3_default12 = config12;
|
|
76161
76108
|
|
|
76162
76109
|
// templates/gatsby/pages/c3.ts
|
|
76163
76110
|
var { npm: npm7 } = detectPackageManager();
|
|
76164
|
-
var
|
|
76111
|
+
var generate9 = async (ctx) => {
|
|
76165
76112
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76166
76113
|
const useTemplate = await inputPrompt({
|
|
76167
76114
|
type: "confirm",
|
|
@@ -76180,14 +76127,15 @@ var generate10 = async (ctx) => {
|
|
|
76180
76127
|
}
|
|
76181
76128
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76182
76129
|
};
|
|
76183
|
-
var
|
|
76130
|
+
var config13 = {
|
|
76184
76131
|
configVersion: 1,
|
|
76185
76132
|
id: "gatsby",
|
|
76186
76133
|
frameworkCli: "gatsby",
|
|
76187
76134
|
platform: "pages",
|
|
76135
|
+
hidden: true,
|
|
76188
76136
|
displayName: "Gatsby",
|
|
76189
76137
|
path: "templates/gatsby/pages",
|
|
76190
|
-
generate:
|
|
76138
|
+
generate: generate9,
|
|
76191
76139
|
transformPackageJson: async () => ({
|
|
76192
76140
|
scripts: {
|
|
76193
76141
|
deploy: `${npm7} run build && wrangler pages deploy ./public`,
|
|
@@ -76198,11 +76146,11 @@ var config12 = {
|
|
|
76198
76146
|
deployScript: "deploy",
|
|
76199
76147
|
previewScript: "preview"
|
|
76200
76148
|
};
|
|
76201
|
-
var
|
|
76149
|
+
var c3_default13 = config13;
|
|
76202
76150
|
|
|
76203
76151
|
// templates/gatsby/workers/c3.ts
|
|
76204
76152
|
var { npm: npm8 } = detectPackageManager();
|
|
76205
|
-
var
|
|
76153
|
+
var generate10 = async (ctx) => {
|
|
76206
76154
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76207
76155
|
const useTemplate = await inputPrompt({
|
|
76208
76156
|
type: "confirm",
|
|
@@ -76221,7 +76169,7 @@ var generate11 = async (ctx) => {
|
|
|
76221
76169
|
}
|
|
76222
76170
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76223
76171
|
};
|
|
76224
|
-
var
|
|
76172
|
+
var config14 = {
|
|
76225
76173
|
configVersion: 1,
|
|
76226
76174
|
id: "gatsby",
|
|
76227
76175
|
frameworkCli: "gatsby",
|
|
@@ -76231,7 +76179,7 @@ var config13 = {
|
|
|
76231
76179
|
path: "./templates"
|
|
76232
76180
|
},
|
|
76233
76181
|
path: "templates/gatsby/workers",
|
|
76234
|
-
generate:
|
|
76182
|
+
generate: generate10,
|
|
76235
76183
|
transformPackageJson: async () => ({
|
|
76236
76184
|
scripts: {
|
|
76237
76185
|
deploy: `${npm8} run build && wrangler deploy`,
|
|
@@ -76242,31 +76190,31 @@ var config13 = {
|
|
|
76242
76190
|
deployScript: "deploy",
|
|
76243
76191
|
previewScript: "preview"
|
|
76244
76192
|
};
|
|
76245
|
-
var
|
|
76193
|
+
var c3_default14 = config14;
|
|
76246
76194
|
|
|
76247
76195
|
// templates/gatsby/c3.ts
|
|
76248
|
-
var
|
|
76196
|
+
var config15 = {
|
|
76249
76197
|
displayName: "Gatsby",
|
|
76250
|
-
platformVariants: { pages:
|
|
76198
|
+
platformVariants: { pages: c3_default13, workers: c3_default14 }
|
|
76251
76199
|
};
|
|
76252
|
-
var
|
|
76200
|
+
var c3_default15 = config15;
|
|
76253
76201
|
|
|
76254
76202
|
// templates/hello-world-assets-only/c3.ts
|
|
76255
|
-
var
|
|
76203
|
+
var config16 = {
|
|
76256
76204
|
configVersion: 1,
|
|
76257
76205
|
id: "hello-world-assets-only",
|
|
76258
76206
|
path: "templates/hello-world-assets-only",
|
|
76259
|
-
displayName: "
|
|
76260
|
-
description: "For static sites
|
|
76207
|
+
displayName: "Static site",
|
|
76208
|
+
description: "For static sites or when using your own backend. Uses Workers Static Assets.",
|
|
76261
76209
|
platform: "workers",
|
|
76262
76210
|
copyFiles: {
|
|
76263
76211
|
path: "./templates"
|
|
76264
76212
|
}
|
|
76265
76213
|
};
|
|
76266
|
-
var
|
|
76214
|
+
var c3_default16 = config16;
|
|
76267
76215
|
|
|
76268
76216
|
// templates/hello-world-durable-object-with-assets/c3.ts
|
|
76269
|
-
var
|
|
76217
|
+
var config17 = {
|
|
76270
76218
|
configVersion: 1,
|
|
76271
76219
|
id: "hello-world-durable-object-with-assets",
|
|
76272
76220
|
path: "templates/hello-world-durable-object-with-assets",
|
|
@@ -76284,10 +76232,10 @@ var config16 = {
|
|
|
76284
76232
|
}
|
|
76285
76233
|
}
|
|
76286
76234
|
};
|
|
76287
|
-
var
|
|
76235
|
+
var c3_default17 = config17;
|
|
76288
76236
|
|
|
76289
76237
|
// templates/hello-world-durable-object/c3.ts
|
|
76290
|
-
var
|
|
76238
|
+
var config18 = {
|
|
76291
76239
|
configVersion: 1,
|
|
76292
76240
|
id: "hello-world-durable-object",
|
|
76293
76241
|
displayName: "Worker + Durable Objects",
|
|
@@ -76304,14 +76252,15 @@ var c3_default19 = {
|
|
|
76304
76252
|
}
|
|
76305
76253
|
}
|
|
76306
76254
|
};
|
|
76255
|
+
var c3_default18 = config18;
|
|
76307
76256
|
|
|
76308
76257
|
// templates/hello-world-with-assets/c3.ts
|
|
76309
|
-
var
|
|
76258
|
+
var config19 = {
|
|
76310
76259
|
configVersion: 1,
|
|
76311
76260
|
id: "hello-world-with-assets",
|
|
76312
76261
|
path: "templates/hello-world-with-assets",
|
|
76313
|
-
displayName: "
|
|
76314
|
-
description: "For
|
|
76262
|
+
displayName: "SSR / full-stack app",
|
|
76263
|
+
description: "For sites with a backend API, or server-side rendering (SSR). Uses Static Assets with a Worker.",
|
|
76315
76264
|
platform: "workers",
|
|
76316
76265
|
copyFiles: {
|
|
76317
76266
|
variants: {
|
|
@@ -76327,11 +76276,12 @@ var c3_default20 = {
|
|
|
76327
76276
|
}
|
|
76328
76277
|
}
|
|
76329
76278
|
};
|
|
76279
|
+
var c3_default19 = config19;
|
|
76330
76280
|
|
|
76331
76281
|
// templates/hello-world/c3.ts
|
|
76332
76282
|
var import_promises2 = require("node:fs/promises");
|
|
76333
76283
|
var import_node_path5 = require("node:path");
|
|
76334
|
-
var
|
|
76284
|
+
var c3_default20 = {
|
|
76335
76285
|
configVersion: 1,
|
|
76336
76286
|
id: "hello-world",
|
|
76337
76287
|
displayName: "Worker only",
|
|
@@ -76365,7 +76315,7 @@ var c3_default21 = {
|
|
|
76365
76315
|
};
|
|
76366
76316
|
|
|
76367
76317
|
// templates/hono/pages/c3.ts
|
|
76368
|
-
var
|
|
76318
|
+
var generate11 = async (ctx) => {
|
|
76369
76319
|
const { name: pm4 } = detectPackageManager();
|
|
76370
76320
|
await runFrameworkGenerator(ctx, [
|
|
76371
76321
|
ctx.project.name,
|
|
@@ -76377,7 +76327,7 @@ var generate12 = async (ctx) => {
|
|
|
76377
76327
|
]);
|
|
76378
76328
|
logRaw("");
|
|
76379
76329
|
};
|
|
76380
|
-
var
|
|
76330
|
+
var config20 = {
|
|
76381
76331
|
configVersion: 1,
|
|
76382
76332
|
id: "hono",
|
|
76383
76333
|
frameworkCli: "create-hono",
|
|
@@ -76387,20 +76337,22 @@ var config17 = {
|
|
|
76387
76337
|
},
|
|
76388
76338
|
path: "templates/hono/pages",
|
|
76389
76339
|
platform: "pages",
|
|
76390
|
-
|
|
76340
|
+
hidden: true,
|
|
76341
|
+
generate: generate11,
|
|
76391
76342
|
transformPackageJson: async () => ({
|
|
76392
76343
|
scripts: {
|
|
76393
|
-
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
76344
|
+
"cf-typegen": "wrangler types --env-interface CloudflareBindings",
|
|
76345
|
+
preview: "vite build && wrangler pages dev"
|
|
76394
76346
|
}
|
|
76395
76347
|
}),
|
|
76396
76348
|
devScript: "dev",
|
|
76397
76349
|
deployScript: "deploy",
|
|
76398
|
-
previewScript: "
|
|
76350
|
+
previewScript: "preview"
|
|
76399
76351
|
};
|
|
76400
|
-
var
|
|
76352
|
+
var c3_default21 = config20;
|
|
76401
76353
|
|
|
76402
76354
|
// templates/hono/workers/c3.ts
|
|
76403
|
-
var
|
|
76355
|
+
var generate12 = async (ctx) => {
|
|
76404
76356
|
const { name: pm4 } = detectPackageManager();
|
|
76405
76357
|
await runFrameworkGenerator(ctx, [
|
|
76406
76358
|
ctx.project.name,
|
|
@@ -76412,7 +76364,7 @@ var generate13 = async (ctx) => {
|
|
|
76412
76364
|
]);
|
|
76413
76365
|
logRaw("");
|
|
76414
76366
|
};
|
|
76415
|
-
var
|
|
76367
|
+
var config21 = {
|
|
76416
76368
|
configVersion: 1,
|
|
76417
76369
|
id: "hono",
|
|
76418
76370
|
frameworkCli: "create-hono",
|
|
@@ -76422,7 +76374,7 @@ var config18 = {
|
|
|
76422
76374
|
},
|
|
76423
76375
|
platform: "workers",
|
|
76424
76376
|
path: "templates/hono/workers",
|
|
76425
|
-
generate:
|
|
76377
|
+
generate: generate12,
|
|
76426
76378
|
transformPackageJson: async () => ({
|
|
76427
76379
|
scripts: {
|
|
76428
76380
|
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
@@ -76432,26 +76384,26 @@ var config18 = {
|
|
|
76432
76384
|
deployScript: "deploy",
|
|
76433
76385
|
previewScript: "dev"
|
|
76434
76386
|
};
|
|
76435
|
-
var
|
|
76387
|
+
var c3_default22 = config21;
|
|
76436
76388
|
|
|
76437
76389
|
// templates/hono/c3.ts
|
|
76438
|
-
var
|
|
76390
|
+
var config22 = {
|
|
76439
76391
|
displayName: "Hono",
|
|
76440
|
-
platformVariants: { pages:
|
|
76392
|
+
platformVariants: { pages: c3_default21, workers: c3_default22 }
|
|
76441
76393
|
};
|
|
76442
|
-
var
|
|
76394
|
+
var c3_default23 = config22;
|
|
76443
76395
|
|
|
76444
|
-
// templates/next/c3.ts
|
|
76396
|
+
// templates/next/pages/c3.ts
|
|
76445
76397
|
var import_path10 = require("path");
|
|
76446
76398
|
var { npm: npm9, npx: npx3 } = detectPackageManager();
|
|
76447
|
-
var
|
|
76399
|
+
var generate13 = async (ctx) => {
|
|
76448
76400
|
const projectName = ctx.project.name;
|
|
76449
76401
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
76450
76402
|
const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
|
|
76451
76403
|
writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.jsonc"), wranglerConfig);
|
|
76452
76404
|
updateStatus("Created wrangler.jsonc file");
|
|
76453
76405
|
};
|
|
76454
|
-
var
|
|
76406
|
+
var updateNextConfig = (usesTs) => {
|
|
76455
76407
|
const s = spinner();
|
|
76456
76408
|
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
76457
76409
|
s.start(`Updating \`${configFile}\``);
|
|
@@ -76469,7 +76421,7 @@ var updateNextConfig2 = (usesTs) => {
|
|
|
76469
76421
|
writeFile2(configFile, updatedConfigFile);
|
|
76470
76422
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76471
76423
|
};
|
|
76472
|
-
var
|
|
76424
|
+
var configure7 = async (ctx) => {
|
|
76473
76425
|
const projectPath = ctx.project.path;
|
|
76474
76426
|
const path6 = probePaths([
|
|
76475
76427
|
`${projectPath}/pages/api`,
|
|
@@ -76494,7 +76446,7 @@ var configure8 = async (ctx) => {
|
|
|
76494
76446
|
if (installEslintPlugin) {
|
|
76495
76447
|
await writeEslintrc(ctx);
|
|
76496
76448
|
}
|
|
76497
|
-
|
|
76449
|
+
updateNextConfig(usesTs);
|
|
76498
76450
|
copyFile(
|
|
76499
76451
|
(0, import_path10.join)(getTemplatePath(ctx), "README.md"),
|
|
76500
76452
|
(0, import_path10.join)(projectPath, "README.md")
|
|
@@ -76544,14 +76496,16 @@ var addDevDependencies = async (installEslintPlugin) => {
|
|
|
76544
76496
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
76545
76497
|
});
|
|
76546
76498
|
};
|
|
76547
|
-
var
|
|
76499
|
+
var c3_default24 = {
|
|
76548
76500
|
configVersion: 1,
|
|
76549
76501
|
id: "next",
|
|
76550
76502
|
frameworkCli: "create-next-app",
|
|
76551
76503
|
platform: "pages",
|
|
76504
|
+
hidden: true,
|
|
76552
76505
|
displayName: "Next.js",
|
|
76553
|
-
|
|
76554
|
-
|
|
76506
|
+
path: "templates/next/pages",
|
|
76507
|
+
generate: generate13,
|
|
76508
|
+
configure: configure7,
|
|
76555
76509
|
copyFiles: {
|
|
76556
76510
|
async selectVariant(ctx) {
|
|
76557
76511
|
const isApp = probePaths([
|
|
@@ -76606,6 +76560,69 @@ var c3_default25 = {
|
|
|
76606
76560
|
compatibilityFlags: ["nodejs_compat"]
|
|
76607
76561
|
};
|
|
76608
76562
|
|
|
76563
|
+
// templates/next/workers/c3.ts
|
|
76564
|
+
var generate14 = async (ctx) => {
|
|
76565
|
+
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
76566
|
+
};
|
|
76567
|
+
var configure8 = async (ctx) => {
|
|
76568
|
+
const packages = [
|
|
76569
|
+
"@opennextjs/cloudflare@~1.0.0-beta.0 || ^1.0.0",
|
|
76570
|
+
"@cloudflare/workers-types"
|
|
76571
|
+
];
|
|
76572
|
+
await installPackages(packages, {
|
|
76573
|
+
dev: true,
|
|
76574
|
+
startText: "Adding the Cloudflare adapter",
|
|
76575
|
+
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
76576
|
+
});
|
|
76577
|
+
const usesTs = usesTypescript(ctx);
|
|
76578
|
+
updateNextConfig2(usesTs);
|
|
76579
|
+
};
|
|
76580
|
+
var updateNextConfig2 = (usesTs) => {
|
|
76581
|
+
const s = spinner();
|
|
76582
|
+
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
76583
|
+
s.start(`Updating \`${configFile}\``);
|
|
76584
|
+
const configContent = readFile(configFile);
|
|
76585
|
+
const updatedConfigFile = configContent + `
|
|
76586
|
+
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
76587
|
+
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
76588
|
+
initOpenNextCloudflareForDev();
|
|
76589
|
+
`.replace(/\n\t*/g, "\n");
|
|
76590
|
+
writeFile2(configFile, updatedConfigFile);
|
|
76591
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76592
|
+
};
|
|
76593
|
+
var c3_default25 = {
|
|
76594
|
+
configVersion: 1,
|
|
76595
|
+
id: "next",
|
|
76596
|
+
frameworkCli: "create-next-app",
|
|
76597
|
+
frameworkCliPinnedVersion: "~15.2.4",
|
|
76598
|
+
platform: "workers",
|
|
76599
|
+
displayName: "Next.js (using Node.js compat + Workers Assets)",
|
|
76600
|
+
path: "templates/next/workers",
|
|
76601
|
+
copyFiles: {
|
|
76602
|
+
path: "./templates"
|
|
76603
|
+
},
|
|
76604
|
+
generate: generate14,
|
|
76605
|
+
configure: configure8,
|
|
76606
|
+
transformPackageJson: async () => ({
|
|
76607
|
+
scripts: {
|
|
76608
|
+
deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
|
|
76609
|
+
preview: `opennextjs-cloudflare build && opennextjs-cloudflare preview`,
|
|
76610
|
+
"cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
|
|
76611
|
+
}
|
|
76612
|
+
}),
|
|
76613
|
+
devScript: "dev",
|
|
76614
|
+
previewScript: "preview",
|
|
76615
|
+
deployScript: "deploy",
|
|
76616
|
+
compatibilityFlags: ["nodejs_compat"]
|
|
76617
|
+
};
|
|
76618
|
+
|
|
76619
|
+
// templates/next/c3.ts
|
|
76620
|
+
var config23 = {
|
|
76621
|
+
displayName: "Next.js",
|
|
76622
|
+
platformVariants: { pages: c3_default24, workers: c3_default25 }
|
|
76623
|
+
};
|
|
76624
|
+
var c3_default26 = config23;
|
|
76625
|
+
|
|
76609
76626
|
// templates/nuxt/pages/c3.ts
|
|
76610
76627
|
var recast6 = __toESM(require_main3());
|
|
76611
76628
|
var { npm: npm10, name: pm2 } = detectPackageManager();
|
|
@@ -76691,11 +76708,12 @@ var updateNuxtConfig = () => {
|
|
|
76691
76708
|
});
|
|
76692
76709
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76693
76710
|
};
|
|
76694
|
-
var
|
|
76711
|
+
var config24 = {
|
|
76695
76712
|
configVersion: 1,
|
|
76696
76713
|
id: "nuxt",
|
|
76697
76714
|
frameworkCli: "nuxi",
|
|
76698
76715
|
platform: "pages",
|
|
76716
|
+
hidden: true,
|
|
76699
76717
|
displayName: "Nuxt",
|
|
76700
76718
|
copyFiles: {
|
|
76701
76719
|
path: "./templates"
|
|
@@ -76714,7 +76732,7 @@ var config20 = {
|
|
|
76714
76732
|
deployScript: "deploy",
|
|
76715
76733
|
previewScript: "preview"
|
|
76716
76734
|
};
|
|
76717
|
-
var
|
|
76735
|
+
var c3_default27 = config24;
|
|
76718
76736
|
|
|
76719
76737
|
// templates/nuxt/workers/c3.ts
|
|
76720
76738
|
var recast7 = __toESM(require_main3());
|
|
@@ -76801,7 +76819,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76801
76819
|
});
|
|
76802
76820
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76803
76821
|
};
|
|
76804
|
-
var
|
|
76822
|
+
var config25 = {
|
|
76805
76823
|
configVersion: 1,
|
|
76806
76824
|
id: "nuxt",
|
|
76807
76825
|
frameworkCli: "nuxi",
|
|
@@ -76824,17 +76842,17 @@ var config21 = {
|
|
|
76824
76842
|
deployScript: "deploy",
|
|
76825
76843
|
previewScript: "preview"
|
|
76826
76844
|
};
|
|
76827
|
-
var
|
|
76845
|
+
var c3_default28 = config25;
|
|
76828
76846
|
|
|
76829
76847
|
// templates/nuxt/c3.ts
|
|
76830
|
-
var
|
|
76848
|
+
var config26 = {
|
|
76831
76849
|
displayName: "Nuxt",
|
|
76832
|
-
platformVariants: { pages:
|
|
76850
|
+
platformVariants: { pages: c3_default27, workers: c3_default28 }
|
|
76833
76851
|
};
|
|
76834
|
-
var
|
|
76852
|
+
var c3_default29 = config26;
|
|
76835
76853
|
|
|
76836
76854
|
// templates/openapi/c3.ts
|
|
76837
|
-
var
|
|
76855
|
+
var config27 = {
|
|
76838
76856
|
configVersion: 1,
|
|
76839
76857
|
id: "openapi",
|
|
76840
76858
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -76844,6 +76862,7 @@ var c3_default29 = {
|
|
|
76844
76862
|
path: "./ts"
|
|
76845
76863
|
}
|
|
76846
76864
|
};
|
|
76865
|
+
var c3_default30 = config27;
|
|
76847
76866
|
|
|
76848
76867
|
// templates/pre-existing/c3.ts
|
|
76849
76868
|
var import_promises3 = require("fs/promises");
|
|
@@ -76965,7 +76984,7 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
76965
76984
|
await runCommand(
|
|
76966
76985
|
[
|
|
76967
76986
|
...dlx,
|
|
76968
|
-
"wrangler@
|
|
76987
|
+
"wrangler@latest",
|
|
76969
76988
|
"init",
|
|
76970
76989
|
"--from-dash",
|
|
76971
76990
|
ctx.args.existingScript,
|
|
@@ -76993,10 +77012,11 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
76993
77012
|
(0, import_path11.join)(ctx.project.path, "wrangler.toml")
|
|
76994
77013
|
);
|
|
76995
77014
|
}
|
|
76996
|
-
var
|
|
77015
|
+
var config28 = {
|
|
76997
77016
|
configVersion: 1,
|
|
76998
77017
|
id: "pre-existing",
|
|
76999
77018
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
77019
|
+
description: "Fetch a Worker initialized from the Cloudflare dashboard.",
|
|
77000
77020
|
platform: "workers",
|
|
77001
77021
|
hidden: true,
|
|
77002
77022
|
copyFiles: {
|
|
@@ -77008,6 +77028,7 @@ var c3_default30 = {
|
|
|
77008
77028
|
copyFiles: copyExistingWorkerFiles
|
|
77009
77029
|
})
|
|
77010
77030
|
};
|
|
77031
|
+
var c3_default31 = config28;
|
|
77011
77032
|
function buildConfigure(params) {
|
|
77012
77033
|
return async function configure21(ctx) {
|
|
77013
77034
|
const loginSuccess = await params.login(ctx);
|
|
@@ -77021,7 +77042,7 @@ function buildConfigure(params) {
|
|
|
77021
77042
|
}
|
|
77022
77043
|
|
|
77023
77044
|
// templates/queues/c3.ts
|
|
77024
|
-
var
|
|
77045
|
+
var config29 = {
|
|
77025
77046
|
configVersion: 1,
|
|
77026
77047
|
id: "queues",
|
|
77027
77048
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -77048,6 +77069,7 @@ var c3_default31 = {
|
|
|
77048
77069
|
]
|
|
77049
77070
|
}
|
|
77050
77071
|
};
|
|
77072
|
+
var c3_default32 = config29;
|
|
77051
77073
|
|
|
77052
77074
|
// templates/qwik/pages/c3.ts
|
|
77053
77075
|
var recast8 = __toESM(require_main3());
|
|
@@ -77132,12 +77154,13 @@ var populateCloudflareEnv = () => {
|
|
|
77132
77154
|
});
|
|
77133
77155
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77134
77156
|
};
|
|
77135
|
-
var
|
|
77157
|
+
var config30 = {
|
|
77136
77158
|
configVersion: 1,
|
|
77137
77159
|
id: "qwik",
|
|
77138
77160
|
frameworkCli: "create-qwik",
|
|
77139
77161
|
displayName: "Qwik",
|
|
77140
77162
|
platform: "pages",
|
|
77163
|
+
hidden: true,
|
|
77141
77164
|
copyFiles: {
|
|
77142
77165
|
path: "./templates"
|
|
77143
77166
|
},
|
|
@@ -77155,7 +77178,7 @@ var config23 = {
|
|
|
77155
77178
|
deployScript: "deploy",
|
|
77156
77179
|
previewScript: "preview"
|
|
77157
77180
|
};
|
|
77158
|
-
var
|
|
77181
|
+
var c3_default33 = config30;
|
|
77159
77182
|
|
|
77160
77183
|
// templates/qwik/workers/c3.ts
|
|
77161
77184
|
var recast9 = __toESM(require_main3());
|
|
@@ -77243,7 +77266,7 @@ var populateCloudflareEnv2 = () => {
|
|
|
77243
77266
|
});
|
|
77244
77267
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77245
77268
|
};
|
|
77246
|
-
var
|
|
77269
|
+
var config31 = {
|
|
77247
77270
|
configVersion: 1,
|
|
77248
77271
|
id: "qwik",
|
|
77249
77272
|
frameworkCli: "create-qwik",
|
|
@@ -77266,14 +77289,14 @@ var config24 = {
|
|
|
77266
77289
|
deployScript: "deploy",
|
|
77267
77290
|
previewScript: "preview"
|
|
77268
77291
|
};
|
|
77269
|
-
var
|
|
77292
|
+
var c3_default34 = config31;
|
|
77270
77293
|
|
|
77271
77294
|
// templates/qwik/c3.ts
|
|
77272
|
-
var
|
|
77295
|
+
var config32 = {
|
|
77273
77296
|
displayName: "Qwik",
|
|
77274
|
-
platformVariants: { pages:
|
|
77297
|
+
platformVariants: { pages: c3_default33, workers: c3_default34 }
|
|
77275
77298
|
};
|
|
77276
|
-
var
|
|
77299
|
+
var c3_default35 = config32;
|
|
77277
77300
|
|
|
77278
77301
|
// templates/react-router/c3.ts
|
|
77279
77302
|
var { npm: npm14 } = detectPackageManager();
|
|
@@ -77288,7 +77311,7 @@ var generate19 = async (ctx) => {
|
|
|
77288
77311
|
]);
|
|
77289
77312
|
logRaw("");
|
|
77290
77313
|
};
|
|
77291
|
-
var
|
|
77314
|
+
var config33 = {
|
|
77292
77315
|
configVersion: 1,
|
|
77293
77316
|
id: "react-router",
|
|
77294
77317
|
platform: "workers",
|
|
@@ -77310,7 +77333,7 @@ var config26 = {
|
|
|
77310
77333
|
deployScript: "deploy",
|
|
77311
77334
|
previewScript: "preview"
|
|
77312
77335
|
};
|
|
77313
|
-
var
|
|
77336
|
+
var c3_default36 = config33;
|
|
77314
77337
|
|
|
77315
77338
|
// templates/react/pages/c3.ts
|
|
77316
77339
|
var { npm: npm15 } = detectPackageManager();
|
|
@@ -77343,13 +77366,14 @@ var variantsOptions = [
|
|
|
77343
77366
|
label: "JavaScript + SWC"
|
|
77344
77367
|
}
|
|
77345
77368
|
];
|
|
77346
|
-
var
|
|
77369
|
+
var config34 = {
|
|
77347
77370
|
configVersion: 1,
|
|
77348
77371
|
id: "react",
|
|
77349
77372
|
// React's documentation now recommends using create-vite.
|
|
77350
77373
|
frameworkCli: "create-vite",
|
|
77351
77374
|
displayName: "React",
|
|
77352
77375
|
platform: "pages",
|
|
77376
|
+
hidden: true,
|
|
77353
77377
|
path: "templates/react/pages",
|
|
77354
77378
|
generate: generate20,
|
|
77355
77379
|
transformPackageJson: async () => ({
|
|
@@ -77362,7 +77386,7 @@ var config27 = {
|
|
|
77362
77386
|
deployScript: "deploy",
|
|
77363
77387
|
previewScript: "preview"
|
|
77364
77388
|
};
|
|
77365
|
-
var
|
|
77389
|
+
var c3_default37 = config34;
|
|
77366
77390
|
|
|
77367
77391
|
// templates/react/workers/c3.ts
|
|
77368
77392
|
var import_assert2 = __toESM(require("assert"));
|
|
@@ -77411,9 +77435,9 @@ function transformViteConfig(ctx) {
|
|
|
77411
77435
|
if (callee.name !== "defineConfig") {
|
|
77412
77436
|
return this.traverse(n);
|
|
77413
77437
|
}
|
|
77414
|
-
const
|
|
77415
|
-
(0, import_assert2.default)(t.ObjectExpression.check(
|
|
77416
|
-
const pluginsProp =
|
|
77438
|
+
const config48 = n.node.arguments[0];
|
|
77439
|
+
(0, import_assert2.default)(t.ObjectExpression.check(config48));
|
|
77440
|
+
const pluginsProp = config48.properties.find((prop) => isPluginsProp(prop));
|
|
77417
77441
|
(0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
77418
77442
|
pluginsProp.value.elements.push(
|
|
77419
77443
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -77470,7 +77494,7 @@ async function getVariant() {
|
|
|
77470
77494
|
(0, import_assert2.default)(selected, "Expected a variant to be selected");
|
|
77471
77495
|
return selected;
|
|
77472
77496
|
}
|
|
77473
|
-
var
|
|
77497
|
+
var config35 = {
|
|
77474
77498
|
configVersion: 1,
|
|
77475
77499
|
id: "react",
|
|
77476
77500
|
frameworkCli: "create-vite",
|
|
@@ -77500,14 +77524,14 @@ var config28 = {
|
|
|
77500
77524
|
deployScript: "deploy",
|
|
77501
77525
|
previewScript: "preview"
|
|
77502
77526
|
};
|
|
77503
|
-
var
|
|
77527
|
+
var c3_default38 = config35;
|
|
77504
77528
|
|
|
77505
77529
|
// templates/react/c3.ts
|
|
77506
|
-
var
|
|
77530
|
+
var config36 = {
|
|
77507
77531
|
displayName: "React",
|
|
77508
|
-
platformVariants: { pages:
|
|
77532
|
+
platformVariants: { pages: c3_default37, workers: c3_default38 }
|
|
77509
77533
|
};
|
|
77510
|
-
var
|
|
77534
|
+
var c3_default39 = config36;
|
|
77511
77535
|
|
|
77512
77536
|
// templates/remix/pages/c3.ts
|
|
77513
77537
|
var { npm: npm17 } = detectPackageManager();
|
|
@@ -77534,11 +77558,12 @@ var configure14 = async () => {
|
|
|
77534
77558
|
});
|
|
77535
77559
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
77536
77560
|
};
|
|
77537
|
-
var
|
|
77561
|
+
var config37 = {
|
|
77538
77562
|
configVersion: 1,
|
|
77539
77563
|
id: "remix",
|
|
77540
77564
|
frameworkCli: "create-remix",
|
|
77541
77565
|
platform: "pages",
|
|
77566
|
+
hidden: true,
|
|
77542
77567
|
displayName: "Remix",
|
|
77543
77568
|
copyFiles: {
|
|
77544
77569
|
path: "./templates"
|
|
@@ -77557,7 +77582,7 @@ var config30 = {
|
|
|
77557
77582
|
deployScript: "deploy",
|
|
77558
77583
|
previewScript: "preview"
|
|
77559
77584
|
};
|
|
77560
|
-
var
|
|
77585
|
+
var c3_default40 = config37;
|
|
77561
77586
|
|
|
77562
77587
|
// templates/remix/workers/c3.ts
|
|
77563
77588
|
var { npm: npm18 } = detectPackageManager();
|
|
@@ -77576,7 +77601,7 @@ var configure15 = async () => {
|
|
|
77576
77601
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
77577
77602
|
});
|
|
77578
77603
|
};
|
|
77579
|
-
var
|
|
77604
|
+
var config38 = {
|
|
77580
77605
|
configVersion: 1,
|
|
77581
77606
|
id: "remix",
|
|
77582
77607
|
frameworkCli: "create-remix",
|
|
@@ -77599,18 +77624,18 @@ var config31 = {
|
|
|
77599
77624
|
deployScript: "deploy",
|
|
77600
77625
|
previewScript: "preview"
|
|
77601
77626
|
};
|
|
77602
|
-
var
|
|
77627
|
+
var c3_default41 = config38;
|
|
77603
77628
|
|
|
77604
77629
|
// templates/remix/c3.ts
|
|
77605
|
-
var
|
|
77630
|
+
var config39 = {
|
|
77606
77631
|
displayName: "Remix",
|
|
77607
|
-
platformVariants: { pages:
|
|
77632
|
+
platformVariants: { pages: c3_default40, workers: c3_default41 },
|
|
77608
77633
|
hidden: true
|
|
77609
77634
|
};
|
|
77610
|
-
var
|
|
77635
|
+
var c3_default42 = config39;
|
|
77611
77636
|
|
|
77612
77637
|
// templates/scheduled/c3.ts
|
|
77613
|
-
var
|
|
77638
|
+
var config40 = {
|
|
77614
77639
|
configVersion: 1,
|
|
77615
77640
|
id: "scheduled",
|
|
77616
77641
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -77627,6 +77652,7 @@ var c3_default42 = {
|
|
|
77627
77652
|
}
|
|
77628
77653
|
}
|
|
77629
77654
|
};
|
|
77655
|
+
var c3_default43 = config40;
|
|
77630
77656
|
|
|
77631
77657
|
// templates/solid/c3.ts
|
|
77632
77658
|
var recast11 = __toESM(require_main3());
|
|
@@ -77673,7 +77699,7 @@ var configure16 = async (ctx) => {
|
|
|
77673
77699
|
}
|
|
77674
77700
|
});
|
|
77675
77701
|
};
|
|
77676
|
-
var
|
|
77702
|
+
var config41 = {
|
|
77677
77703
|
configVersion: 1,
|
|
77678
77704
|
id: "solid",
|
|
77679
77705
|
frameworkCli: "create-solid",
|
|
@@ -77695,7 +77721,7 @@ var config33 = {
|
|
|
77695
77721
|
deployScript: "deploy",
|
|
77696
77722
|
previewScript: "preview"
|
|
77697
77723
|
};
|
|
77698
|
-
var
|
|
77724
|
+
var c3_default44 = config41;
|
|
77699
77725
|
|
|
77700
77726
|
// templates/svelte/pages/c3.ts
|
|
77701
77727
|
var import_node_fs3 = require("node:fs");
|
|
@@ -77788,12 +77814,13 @@ var updateTypeDefinitions = (ctx) => {
|
|
|
77788
77814
|
}
|
|
77789
77815
|
});
|
|
77790
77816
|
};
|
|
77791
|
-
var
|
|
77817
|
+
var config42 = {
|
|
77792
77818
|
configVersion: 1,
|
|
77793
77819
|
id: "svelte",
|
|
77794
77820
|
frameworkCli: "sv",
|
|
77795
77821
|
displayName: "SvelteKit",
|
|
77796
77822
|
platform: "pages",
|
|
77823
|
+
hidden: true,
|
|
77797
77824
|
copyFiles: {
|
|
77798
77825
|
path: "./templates"
|
|
77799
77826
|
},
|
|
@@ -77818,7 +77845,7 @@ var config34 = {
|
|
|
77818
77845
|
deployScript: "deploy",
|
|
77819
77846
|
previewScript: "preview"
|
|
77820
77847
|
};
|
|
77821
|
-
var
|
|
77848
|
+
var c3_default45 = config42;
|
|
77822
77849
|
|
|
77823
77850
|
// templates/svelte/workers/c3.ts
|
|
77824
77851
|
var import_node_os4 = require("node:os");
|
|
@@ -77887,7 +77914,7 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
77887
77914
|
}
|
|
77888
77915
|
});
|
|
77889
77916
|
};
|
|
77890
|
-
var
|
|
77917
|
+
var config43 = {
|
|
77891
77918
|
configVersion: 1,
|
|
77892
77919
|
id: "svelte",
|
|
77893
77920
|
frameworkCli: "sv",
|
|
@@ -77917,26 +77944,27 @@ var config35 = {
|
|
|
77917
77944
|
deployScript: "deploy",
|
|
77918
77945
|
previewScript: "preview"
|
|
77919
77946
|
};
|
|
77920
|
-
var
|
|
77947
|
+
var c3_default46 = config43;
|
|
77921
77948
|
|
|
77922
77949
|
// templates/svelte/c3.ts
|
|
77923
|
-
var
|
|
77950
|
+
var config44 = {
|
|
77924
77951
|
displayName: "SvelteKit",
|
|
77925
|
-
platformVariants: { pages:
|
|
77952
|
+
platformVariants: { pages: c3_default45, workers: c3_default46 }
|
|
77926
77953
|
};
|
|
77927
|
-
var
|
|
77954
|
+
var c3_default47 = config44;
|
|
77928
77955
|
|
|
77929
77956
|
// templates/vue/pages/c3.ts
|
|
77930
77957
|
var { npm: npm22 } = detectPackageManager();
|
|
77931
77958
|
var generate27 = async (ctx) => {
|
|
77932
77959
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
77933
77960
|
};
|
|
77934
|
-
var
|
|
77961
|
+
var config45 = {
|
|
77935
77962
|
configVersion: 1,
|
|
77936
77963
|
id: "vue",
|
|
77937
77964
|
frameworkCli: "create-vue",
|
|
77938
77965
|
displayName: "Vue",
|
|
77939
77966
|
platform: "pages",
|
|
77967
|
+
hidden: true,
|
|
77940
77968
|
path: "templates/pages/vue",
|
|
77941
77969
|
generate: generate27,
|
|
77942
77970
|
transformPackageJson: async () => ({
|
|
@@ -77949,7 +77977,7 @@ var config37 = {
|
|
|
77949
77977
|
deployScript: "deploy",
|
|
77950
77978
|
previewScript: "preview"
|
|
77951
77979
|
};
|
|
77952
|
-
var
|
|
77980
|
+
var c3_default48 = config45;
|
|
77953
77981
|
|
|
77954
77982
|
// templates/vue/workers/c3.ts
|
|
77955
77983
|
var { npm: npm23 } = detectPackageManager();
|
|
@@ -77991,7 +78019,7 @@ function updateTsconfigJson2() {
|
|
|
77991
78019
|
writeJSON("tsconfig.json", tsconfig);
|
|
77992
78020
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
77993
78021
|
}
|
|
77994
|
-
var
|
|
78022
|
+
var config46 = {
|
|
77995
78023
|
configVersion: 1,
|
|
77996
78024
|
id: "vue",
|
|
77997
78025
|
frameworkCli: "create-vue",
|
|
@@ -78024,20 +78052,20 @@ var config38 = {
|
|
|
78024
78052
|
deployScript: "deploy",
|
|
78025
78053
|
previewScript: "preview"
|
|
78026
78054
|
};
|
|
78027
|
-
var
|
|
78055
|
+
var c3_default49 = config46;
|
|
78028
78056
|
|
|
78029
78057
|
// templates/vue/c3.ts
|
|
78030
|
-
var
|
|
78058
|
+
var config47 = {
|
|
78031
78059
|
displayName: "Vue",
|
|
78032
|
-
platformVariants: { pages:
|
|
78060
|
+
platformVariants: { pages: c3_default48, workers: c3_default49 }
|
|
78033
78061
|
};
|
|
78034
|
-
var
|
|
78062
|
+
var c3_default50 = config47;
|
|
78035
78063
|
|
|
78036
78064
|
// src/git.ts
|
|
78037
78065
|
var import_node_assert = __toESM(require("node:assert"));
|
|
78038
78066
|
|
|
78039
78067
|
// ../wrangler/package.json
|
|
78040
|
-
var version2 = "0.0.0-
|
|
78068
|
+
var version2 = "0.0.0-dfea523ea";
|
|
78041
78069
|
|
|
78042
78070
|
// src/git.ts
|
|
78043
78071
|
var offerGit = async (ctx) => {
|
|
@@ -78298,44 +78326,60 @@ var defaultSelectVariant = async (ctx) => {
|
|
|
78298
78326
|
function getFrameworkMap({ experimental = false }) {
|
|
78299
78327
|
if (experimental) {
|
|
78300
78328
|
return {
|
|
78301
|
-
|
|
78302
|
-
solid: c3_default2
|
|
78329
|
+
solid: c3_default
|
|
78303
78330
|
};
|
|
78304
78331
|
} else {
|
|
78305
78332
|
return {
|
|
78306
|
-
analog:
|
|
78307
|
-
angular:
|
|
78308
|
-
astro:
|
|
78309
|
-
docusaurus:
|
|
78310
|
-
gatsby:
|
|
78311
|
-
hono:
|
|
78312
|
-
next:
|
|
78313
|
-
nuxt:
|
|
78314
|
-
qwik:
|
|
78315
|
-
react:
|
|
78316
|
-
"react-router":
|
|
78317
|
-
remix:
|
|
78318
|
-
solid:
|
|
78319
|
-
svelte:
|
|
78320
|
-
vue:
|
|
78333
|
+
analog: c3_default2,
|
|
78334
|
+
angular: c3_default5,
|
|
78335
|
+
astro: c3_default8,
|
|
78336
|
+
docusaurus: c3_default12,
|
|
78337
|
+
gatsby: c3_default15,
|
|
78338
|
+
hono: c3_default23,
|
|
78339
|
+
next: c3_default26,
|
|
78340
|
+
nuxt: c3_default29,
|
|
78341
|
+
qwik: c3_default35,
|
|
78342
|
+
react: c3_default39,
|
|
78343
|
+
"react-router": c3_default36,
|
|
78344
|
+
remix: c3_default42,
|
|
78345
|
+
solid: c3_default44,
|
|
78346
|
+
svelte: c3_default47,
|
|
78347
|
+
vue: c3_default50
|
|
78321
78348
|
};
|
|
78322
78349
|
}
|
|
78323
78350
|
}
|
|
78324
|
-
function
|
|
78351
|
+
function getOtherTemplateMap({
|
|
78352
|
+
experimental = false
|
|
78353
|
+
}) {
|
|
78325
78354
|
if (experimental) {
|
|
78326
78355
|
return {};
|
|
78327
78356
|
} else {
|
|
78328
78357
|
return {
|
|
78329
|
-
|
|
78330
|
-
|
|
78331
|
-
|
|
78332
|
-
|
|
78333
|
-
"
|
|
78334
|
-
|
|
78335
|
-
|
|
78336
|
-
|
|
78337
|
-
|
|
78338
|
-
|
|
78358
|
+
common: c3_default9,
|
|
78359
|
+
scheduled: c3_default43,
|
|
78360
|
+
queues: c3_default32,
|
|
78361
|
+
openapi: c3_default30,
|
|
78362
|
+
"pre-existing": c3_default31
|
|
78363
|
+
};
|
|
78364
|
+
}
|
|
78365
|
+
}
|
|
78366
|
+
function getHelloWorldTemplateMap({
|
|
78367
|
+
experimental = false
|
|
78368
|
+
}) {
|
|
78369
|
+
if (experimental) {
|
|
78370
|
+
return {};
|
|
78371
|
+
} else {
|
|
78372
|
+
return {
|
|
78373
|
+
"hello-world": c3_default20,
|
|
78374
|
+
"hello-world-assets-only": c3_default16,
|
|
78375
|
+
"hello-world-with-assets": c3_default19,
|
|
78376
|
+
"hello-world-durable-object": c3_default18,
|
|
78377
|
+
"hello-world-durable-object-with-assets": c3_default17,
|
|
78378
|
+
common: c3_default9,
|
|
78379
|
+
scheduled: c3_default43,
|
|
78380
|
+
queues: c3_default32,
|
|
78381
|
+
openapi: c3_default30,
|
|
78382
|
+
"pre-existing": c3_default31
|
|
78339
78383
|
};
|
|
78340
78384
|
}
|
|
78341
78385
|
}
|
|
@@ -78395,6 +78439,12 @@ var deriveCorrelatedArgs = (args) => {
|
|
|
78395
78439
|
};
|
|
78396
78440
|
var createContext = async (args, prevArgs) => {
|
|
78397
78441
|
deriveCorrelatedArgs(args);
|
|
78442
|
+
const experimental = args.experimental;
|
|
78443
|
+
const frameworkMap = getFrameworkMap({ experimental });
|
|
78444
|
+
const helloWorldTemplateMap = await getHelloWorldTemplateMap({
|
|
78445
|
+
experimental
|
|
78446
|
+
});
|
|
78447
|
+
const otherTemplateMap = await getOtherTemplateMap({ experimental });
|
|
78398
78448
|
let linesPrinted = 0;
|
|
78399
78449
|
const goBack = async (from) => {
|
|
78400
78450
|
const currentArgs = { ...args };
|
|
@@ -78441,22 +78491,29 @@ var createContext = async (args, prevArgs) => {
|
|
|
78441
78491
|
validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
|
|
78442
78492
|
format: (val) => `./${val}`
|
|
78443
78493
|
});
|
|
78444
|
-
const categoryOptions = [
|
|
78445
|
-
|
|
78446
|
-
|
|
78494
|
+
const categoryOptions = [];
|
|
78495
|
+
if (Object.keys(helloWorldTemplateMap).length) {
|
|
78496
|
+
categoryOptions.push({
|
|
78497
|
+
label: "Hello World example",
|
|
78447
78498
|
value: "hello-world",
|
|
78448
|
-
description: "Select from
|
|
78449
|
-
}
|
|
78450
|
-
|
|
78499
|
+
description: "Select from barebones examples to get started with Workers"
|
|
78500
|
+
});
|
|
78501
|
+
}
|
|
78502
|
+
if (Object.keys(frameworkMap).length) {
|
|
78503
|
+
categoryOptions.push({
|
|
78451
78504
|
label: "Framework Starter",
|
|
78452
78505
|
value: "web-framework",
|
|
78453
78506
|
description: "Select from the most popular full-stack web frameworks"
|
|
78454
|
-
}
|
|
78455
|
-
|
|
78507
|
+
});
|
|
78508
|
+
}
|
|
78509
|
+
if (Object.keys(otherTemplateMap).length) {
|
|
78510
|
+
categoryOptions.push({
|
|
78456
78511
|
label: "Application Starter",
|
|
78457
78512
|
value: "demo",
|
|
78458
78513
|
description: "Select from a range of starter applications using various Cloudflare products"
|
|
78459
|
-
}
|
|
78514
|
+
});
|
|
78515
|
+
}
|
|
78516
|
+
categoryOptions.push(
|
|
78460
78517
|
{
|
|
78461
78518
|
label: "Template from a GitHub repo",
|
|
78462
78519
|
value: "remote-template",
|
|
@@ -78465,7 +78522,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
78465
78522
|
// This is used only if the type is `pre-existing`
|
|
78466
78523
|
{ label: "Others", value: "others", hidden: true },
|
|
78467
78524
|
backOption
|
|
78468
|
-
|
|
78525
|
+
);
|
|
78469
78526
|
const category = await processArgument(args, "category", {
|
|
78470
78527
|
type: "select",
|
|
78471
78528
|
question: "What would you like to start with?",
|
|
@@ -78479,14 +78536,11 @@ var createContext = async (args, prevArgs) => {
|
|
|
78479
78536
|
}
|
|
78480
78537
|
let template;
|
|
78481
78538
|
if (category === "web-framework") {
|
|
78482
|
-
const frameworkMap = getFrameworkMap({
|
|
78483
|
-
experimental: args.experimental
|
|
78484
|
-
});
|
|
78485
78539
|
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
78486
|
-
(acc, [key,
|
|
78487
|
-
if (!
|
|
78540
|
+
(acc, [key, config48]) => {
|
|
78541
|
+
if (!config48.hidden || args.framework) {
|
|
78488
78542
|
acc.push({
|
|
78489
|
-
label:
|
|
78543
|
+
label: config48.displayName,
|
|
78490
78544
|
value: key
|
|
78491
78545
|
});
|
|
78492
78546
|
}
|
|
@@ -78510,21 +78564,31 @@ var createContext = async (args, prevArgs) => {
|
|
|
78510
78564
|
throw new Error(`Unsupported framework: ${framework}`);
|
|
78511
78565
|
}
|
|
78512
78566
|
if ("platformVariants" in frameworkConfig) {
|
|
78567
|
+
const availableVariants = Object.entries(
|
|
78568
|
+
frameworkConfig.platformVariants
|
|
78569
|
+
).filter(([, config48]) => !config48.hidden);
|
|
78570
|
+
if (availableVariants.length === 1) {
|
|
78571
|
+
args.platform ??= availableVariants[0][0];
|
|
78572
|
+
}
|
|
78513
78573
|
const platform3 = await processArgument(args, "platform", {
|
|
78514
78574
|
type: "select",
|
|
78515
78575
|
label: "platform",
|
|
78516
78576
|
question: "Select your deployment platform",
|
|
78517
78577
|
options: [
|
|
78518
|
-
|
|
78519
|
-
|
|
78520
|
-
|
|
78521
|
-
|
|
78522
|
-
|
|
78523
|
-
|
|
78524
|
-
|
|
78525
|
-
|
|
78526
|
-
|
|
78527
|
-
|
|
78578
|
+
...args.platform === "workers" || !frameworkConfig.platformVariants.workers.hidden ? [
|
|
78579
|
+
{
|
|
78580
|
+
label: "Workers with Assets",
|
|
78581
|
+
value: "workers",
|
|
78582
|
+
description: "Take advantage of the full Developer Platform, including R2, Queues, Durable Objects and more."
|
|
78583
|
+
}
|
|
78584
|
+
] : [],
|
|
78585
|
+
...args.platform === "pages" || !frameworkConfig.platformVariants.pages.hidden ? [
|
|
78586
|
+
{
|
|
78587
|
+
label: "Pages",
|
|
78588
|
+
value: "pages",
|
|
78589
|
+
description: "Great for simple websites and applications."
|
|
78590
|
+
}
|
|
78591
|
+
] : [],
|
|
78528
78592
|
backOption
|
|
78529
78593
|
],
|
|
78530
78594
|
defaultValue: "workers"
|
|
@@ -78543,18 +78607,14 @@ var createContext = async (args, prevArgs) => {
|
|
|
78543
78607
|
} else if (category === "remote-template") {
|
|
78544
78608
|
template = await processRemoteTemplate(args);
|
|
78545
78609
|
} else {
|
|
78546
|
-
const templateMap =
|
|
78547
|
-
experimental: args.experimental
|
|
78548
|
-
});
|
|
78610
|
+
const templateMap = category === "hello-world" ? helloWorldTemplateMap : otherTemplateMap;
|
|
78549
78611
|
const templateOptions = Object.entries(templateMap).map(
|
|
78550
78612
|
([value, { displayName, description, hidden: hidden2 }]) => {
|
|
78551
|
-
const isHelloWorldExample = value.startsWith("hello-world");
|
|
78552
|
-
const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
|
|
78553
78613
|
return {
|
|
78554
78614
|
value,
|
|
78555
78615
|
label: displayName,
|
|
78556
78616
|
description,
|
|
78557
|
-
hidden: hidden2
|
|
78617
|
+
hidden: hidden2
|
|
78558
78618
|
};
|
|
78559
78619
|
}
|
|
78560
78620
|
);
|
|
@@ -78657,28 +78717,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
78657
78717
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
78658
78718
|
}
|
|
78659
78719
|
const path6 = await downloadRemoteTemplate(src);
|
|
78660
|
-
const
|
|
78661
|
-
validateTemplate(path6,
|
|
78720
|
+
const config48 = inferTemplateConfig(path6);
|
|
78721
|
+
validateTemplate(path6, config48);
|
|
78662
78722
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
78663
78723
|
return {
|
|
78664
78724
|
path: path6,
|
|
78665
|
-
...
|
|
78725
|
+
...config48
|
|
78666
78726
|
};
|
|
78667
78727
|
};
|
|
78668
|
-
var validateTemplate = (path6,
|
|
78669
|
-
if (!
|
|
78728
|
+
var validateTemplate = (path6, config48) => {
|
|
78729
|
+
if (!config48.copyFiles) {
|
|
78670
78730
|
return;
|
|
78671
78731
|
}
|
|
78672
|
-
if (isVariantInfo(
|
|
78673
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
78732
|
+
if (isVariantInfo(config48.copyFiles)) {
|
|
78733
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config48.copyFiles.path), config48);
|
|
78674
78734
|
} else {
|
|
78675
|
-
for (const variant of Object.values(
|
|
78676
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path),
|
|
78735
|
+
for (const variant of Object.values(config48.copyFiles.variants)) {
|
|
78736
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config48);
|
|
78677
78737
|
}
|
|
78678
78738
|
}
|
|
78679
78739
|
};
|
|
78680
|
-
var validateTemplateSrcDirectory = (path6,
|
|
78681
|
-
if (
|
|
78740
|
+
var validateTemplateSrcDirectory = (path6, config48) => {
|
|
78741
|
+
if (config48.platform === "workers") {
|
|
78682
78742
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
78683
78743
|
const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
|
|
78684
78744
|
const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -78851,10 +78911,7 @@ var cliDefinition = {
|
|
|
78851
78911
|
values(args) {
|
|
78852
78912
|
const experimental = Boolean(args?.["experimental"]);
|
|
78853
78913
|
if (experimental) {
|
|
78854
|
-
return [
|
|
78855
|
-
{ name: "hello-world", description: "Hello World Starter" },
|
|
78856
|
-
{ name: "web-framework", description: "Framework Starter" }
|
|
78857
|
-
];
|
|
78914
|
+
return [{ name: "web-framework", description: "Framework Starter" }];
|
|
78858
78915
|
} else {
|
|
78859
78916
|
return [
|
|
78860
78917
|
{ name: "hello-world", description: "Hello World Starter" },
|
|
@@ -78880,40 +78937,10 @@ var cliDefinition = {
|
|
|
78880
78937
|
`,
|
|
78881
78938
|
values(args) {
|
|
78882
78939
|
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
|
-
}
|
|
78940
|
+
return getNamesAndDescriptions({
|
|
78941
|
+
...getHelloWorldTemplateMap({ experimental }),
|
|
78942
|
+
...getOtherTemplateMap({ experimental })
|
|
78943
|
+
});
|
|
78917
78944
|
}
|
|
78918
78945
|
},
|
|
78919
78946
|
{
|
|
@@ -78928,7 +78955,7 @@ var cliDefinition = {
|
|
|
78928
78955
|
You may specify additional arguments to be passed directly to these underlying tools by adding them after a "--" argument, like so:
|
|
78929
78956
|
|
|
78930
78957
|
npm create cloudflare -- --framework next -- --ts
|
|
78931
|
-
pnpm create
|
|
78958
|
+
pnpm create cloudflare --framework next -- --ts
|
|
78932
78959
|
`,
|
|
78933
78960
|
values: (args) => getNamesAndDescriptions(
|
|
78934
78961
|
getFrameworkMap({
|
|
@@ -78942,12 +78969,12 @@ var cliDefinition = {
|
|
|
78942
78969
|
description: `Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.`,
|
|
78943
78970
|
values: [
|
|
78944
78971
|
{
|
|
78945
|
-
name: "
|
|
78946
|
-
description: "Create a web application that can be deployed to
|
|
78972
|
+
name: "workers",
|
|
78973
|
+
description: "Create a web application that can be deployed to Workers."
|
|
78947
78974
|
},
|
|
78948
78975
|
{
|
|
78949
|
-
name: "
|
|
78950
|
-
description: "Create a web application that can be deployed to
|
|
78976
|
+
name: "pages",
|
|
78977
|
+
description: "Create a web application that can be deployed to Pages."
|
|
78951
78978
|
}
|
|
78952
78979
|
],
|
|
78953
78980
|
requiresArg: true
|
|
@@ -80589,20 +80616,20 @@ function applyEdits(text, edits) {
|
|
|
80589
80616
|
var import_fs12 = require("fs");
|
|
80590
80617
|
var import_path14 = require("path");
|
|
80591
80618
|
var import_toml2 = __toESM(require_toml());
|
|
80592
|
-
function ensureNameExists(
|
|
80593
|
-
|
|
80594
|
-
return
|
|
80619
|
+
function ensureNameExists(config48, projectName) {
|
|
80620
|
+
config48["name"] = projectName;
|
|
80621
|
+
return config48;
|
|
80595
80622
|
}
|
|
80596
|
-
async function ensureCompatDateExists(
|
|
80597
|
-
if (typeof
|
|
80623
|
+
async function ensureCompatDateExists(config48) {
|
|
80624
|
+
if (typeof config48["compatibility_date"] === "string") {
|
|
80598
80625
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
|
|
80599
|
-
if (!
|
|
80600
|
-
|
|
80626
|
+
if (!config48["compatibility_date"].match(validCompatDateRe)) {
|
|
80627
|
+
config48["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80601
80628
|
}
|
|
80602
80629
|
} else {
|
|
80603
|
-
|
|
80630
|
+
config48["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80604
80631
|
}
|
|
80605
|
-
return
|
|
80632
|
+
return config48;
|
|
80606
80633
|
}
|
|
80607
80634
|
var updateWranglerConfig = async (ctx) => {
|
|
80608
80635
|
if (wranglerJsonExists(ctx)) {
|
|
@@ -81319,8 +81346,8 @@ var renderValues = (values) => {
|
|
|
81319
81346
|
};
|
|
81320
81347
|
|
|
81321
81348
|
// src/helpers/retry.ts
|
|
81322
|
-
var retry = async (
|
|
81323
|
-
let { times } =
|
|
81349
|
+
var retry = async (config48, fn) => {
|
|
81350
|
+
let { times } = config48;
|
|
81324
81351
|
let error2 = null;
|
|
81325
81352
|
while (times > 0) {
|
|
81326
81353
|
try {
|
|
@@ -81328,10 +81355,10 @@ var retry = async (config40, fn) => {
|
|
|
81328
81355
|
} catch (e) {
|
|
81329
81356
|
error2 = e;
|
|
81330
81357
|
times--;
|
|
81331
|
-
if (
|
|
81358
|
+
if (config48.exitCondition?.(e)) {
|
|
81332
81359
|
break;
|
|
81333
81360
|
}
|
|
81334
|
-
await sleep(
|
|
81361
|
+
await sleep(config48.sleepMs ?? 1e3);
|
|
81335
81362
|
}
|
|
81336
81363
|
}
|
|
81337
81364
|
throw error2;
|
|
@@ -81451,8 +81478,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81451
81478
|
}
|
|
81452
81479
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81453
81480
|
try {
|
|
81454
|
-
const
|
|
81455
|
-
const currentTypes =
|
|
81481
|
+
const config48 = parse4(tsconfig);
|
|
81482
|
+
const currentTypes = config48.compilerOptions?.types ?? [];
|
|
81456
81483
|
const explicitEntrypoint = currentTypes.some(
|
|
81457
81484
|
(t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81458
81485
|
);
|