create-cloudflare 0.0.0-62d5471ea → 0.0.0-62df08af3
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 +934 -855
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- 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-durable-object/c3.ts +4 -1
- package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +6 -4
- package/templates/hello-world-durable-object-with-assets/js/src/index.js +11 -10
- package/templates/hello-world-durable-object-with-assets/js/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object-with-assets/ts/src/index.ts +10 -9
- package/templates/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +7 -4
- package/templates/hello-world-durable-object-with-assets/ts/wrangler.jsonc +1 -1
- package/templates/hello-world-with-assets/c3.ts +4 -1
- package/templates/hello-world-with-assets/js/public/index.html +2 -2
- package/templates/hello-world-with-assets/py/public/index.html +2 -2
- package/templates/hello-world-with-assets/ts/public/index.html +2 -2
- package/templates/hello-world-with-assets/ts/test/env.d.ts +3 -0
- package/templates/hello-world-with-assets/ts/test/tsconfig.json +1 -1
- package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +6 -3
- package/templates/hono/c3.ts +5 -66
- package/templates/hono/pages/c3.ts +44 -0
- package/templates/hono/pages/templates/src/index.tsx +12 -0
- package/templates/hono/{templates → pages/templates}/wrangler.jsonc +1 -1
- package/{templates-experimental/hono → templates/hono/workers}/c3.ts +2 -4
- 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 +6 -0
- package/{templates-experimental/next → templates/next/workers}/templates/wrangler.jsonc +1 -1
- package/templates/nuxt/pages/c3.ts +2 -0
- package/templates/nuxt/workers/c3.ts +1 -0
- package/templates/openapi/c3.ts +5 -1
- package/templates/pre-existing/c3.ts +5 -1
- package/templates/queues/c3.ts +5 -1
- package/templates/qwik/c3.ts +5 -144
- package/templates/qwik/pages/c3.ts +150 -0
- package/{templates-experimental/qwik → templates/qwik/workers}/c3.ts +2 -2
- 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/react-router/c3.ts +53 -0
- package/templates/react-router/templates/worker-configuration.d.ts +8 -0
- package/templates/remix/c3.ts +1 -0
- package/templates/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/c3.ts +5 -154
- package/templates/svelte/pages/c3.ts +160 -0
- package/{templates-experimental/svelte → templates/svelte/workers}/c3.ts +3 -3
- package/templates/svelte/workers/templates/static/.assetsignore +2 -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/hono/snippets/appDeclaration.ts +0 -1
- package/templates-experimental/next/templates/open-next.config.ts +0 -6
- package/templates-experimental/svelte/templates/static/.assetsignore +0 -4
- /package/{templates-experimental/hono → templates/hono/pages}/templates/worker-configuration.d.ts +0 -0
- /package/{templates-experimental/hono → templates/hono/workers}/templates/public/index.html +0 -0
- /package/{templates-experimental/hono → templates/hono/workers}/templates/src/index.ts +0 -0
- /package/templates/hono/{templates → workers/templates}/worker-configuration.d.ts +0 -0
- /package/{templates-experimental/hono → templates/hono/workers}/templates/wrangler.jsonc +0 -0
- /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/{templates-experimental/qwik → templates/qwik/pages}/snippets/getPlatformProxy.ts +0 -0
- /package/{templates-experimental/qwik → templates/qwik/pages}/templates/worker-configuration.d.ts +0 -0
- /package/templates/qwik/{templates → pages/templates}/wrangler.jsonc +0 -0
- /package/templates/qwik/{snippets → workers/snippets}/getPlatformProxy.ts +0 -0
- /package/{templates-experimental/qwik → templates/qwik/workers}/templates/public/.assetsignore +0 -0
- /package/templates/qwik/{templates → workers/templates}/worker-configuration.d.ts +0 -0
- /package/{templates-experimental/qwik → templates/qwik/workers}/templates/wrangler.jsonc +0 -0
- /package/templates/svelte/{templates → pages/templates}/wrangler.jsonc +0 -0
- /package/{templates-experimental/svelte → templates/svelte/workers}/templates/wrangler.jsonc +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 = (config36) => {
|
|
|
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 = (config36) => {
|
|
|
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 = (config36) => {
|
|
|
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-62df08af3";
|
|
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(config36) {
|
|
|
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
|
}
|
|
@@ -74817,7 +74817,7 @@ var detectPackageManager = () => {
|
|
|
74817
74817
|
}
|
|
74818
74818
|
};
|
|
74819
74819
|
var rectifyPmMismatch = async (ctx) => {
|
|
74820
|
-
const { npm:
|
|
74820
|
+
const { npm: npm25 } = detectPackageManager();
|
|
74821
74821
|
if (!detectPmMismatch(ctx)) {
|
|
74822
74822
|
return;
|
|
74823
74823
|
}
|
|
@@ -74829,17 +74829,17 @@ var rectifyPmMismatch = async (ctx) => {
|
|
|
74829
74829
|
if ((0, import_fs5.existsSync)(lockfilePath)) {
|
|
74830
74830
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
74831
74831
|
}
|
|
74832
|
-
await runCommand([
|
|
74832
|
+
await runCommand([npm25, "install"], {
|
|
74833
74833
|
silent: true,
|
|
74834
74834
|
cwd: ctx.project.path,
|
|
74835
74835
|
startText: "Installing dependencies",
|
|
74836
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
74836
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
|
|
74837
74837
|
});
|
|
74838
74838
|
};
|
|
74839
74839
|
var detectPmMismatch = (ctx) => {
|
|
74840
|
-
const { npm:
|
|
74840
|
+
const { npm: npm25 } = detectPackageManager();
|
|
74841
74841
|
const projectPath = ctx.project.path;
|
|
74842
|
-
switch (
|
|
74842
|
+
switch (npm25) {
|
|
74843
74843
|
case "npm":
|
|
74844
74844
|
return false;
|
|
74845
74845
|
case "yarn":
|
|
@@ -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,39 +75107,39 @@ var import_haikunator = __toESM(require_dist_web());
|
|
|
75107
75107
|
var import_fs6 = require("fs");
|
|
75108
75108
|
var import_path6 = __toESM(require("path"));
|
|
75109
75109
|
var import_undici2 = __toESM(require_undici());
|
|
75110
|
-
var installPackages = async (packages,
|
|
75111
|
-
const { npm:
|
|
75110
|
+
var installPackages = async (packages, config48 = {}) => {
|
|
75111
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75112
75112
|
let saveFlag;
|
|
75113
75113
|
let cmd;
|
|
75114
|
-
switch (
|
|
75114
|
+
switch (npm25) {
|
|
75115
75115
|
case "yarn":
|
|
75116
75116
|
cmd = "add";
|
|
75117
|
-
saveFlag =
|
|
75117
|
+
saveFlag = 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(
|
|
75131
75131
|
[
|
|
75132
|
-
|
|
75132
|
+
npm25,
|
|
75133
75133
|
cmd,
|
|
75134
75134
|
...saveFlag ? [saveFlag] : [],
|
|
75135
75135
|
...packages,
|
|
75136
75136
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
75137
75137
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
75138
75138
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
75139
|
-
...
|
|
75139
|
+
...npm25 === "npm" ? ["--legacy-peer-deps"] : []
|
|
75140
75140
|
],
|
|
75141
75141
|
{
|
|
75142
|
-
...
|
|
75142
|
+
...config48,
|
|
75143
75143
|
silent: true
|
|
75144
75144
|
}
|
|
75145
75145
|
);
|
|
@@ -75149,16 +75149,16 @@ var npmInstall = async (ctx) => {
|
|
|
75149
75149
|
if ((0, import_fs6.existsSync)(nodeModulesPath)) {
|
|
75150
75150
|
return;
|
|
75151
75151
|
}
|
|
75152
|
-
const { npm:
|
|
75152
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75153
75153
|
await runCommand(
|
|
75154
75154
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
75155
75155
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
75156
75156
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
75157
|
-
[
|
|
75157
|
+
[npm25, "install", ...npm25 === "npm" ? ["--legacy-peer-deps"] : []],
|
|
75158
75158
|
{
|
|
75159
75159
|
silent: true,
|
|
75160
75160
|
startText: "Installing dependencies",
|
|
75161
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75161
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
|
|
75162
75162
|
}
|
|
75163
75163
|
);
|
|
75164
75164
|
};
|
|
@@ -75168,14 +75168,14 @@ async function getLatestPackageVersion(packageSpecifier) {
|
|
|
75168
75168
|
return npmInfo["dist-tags"].latest;
|
|
75169
75169
|
}
|
|
75170
75170
|
var installWrangler = async () => {
|
|
75171
|
-
const { npm:
|
|
75171
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75172
75172
|
await installPackages([`wrangler@latest`], {
|
|
75173
75173
|
dev: true,
|
|
75174
75174
|
startText: `Installing wrangler ${dim(
|
|
75175
75175
|
"A command line tool for building Cloudflare Workers"
|
|
75176
75176
|
)}`,
|
|
75177
75177
|
doneText: `${brandColor("installed")} ${dim(
|
|
75178
|
-
`via \`${
|
|
75178
|
+
`via \`${npm25} install wrangler --save-dev\``
|
|
75179
75179
|
)}`
|
|
75180
75180
|
});
|
|
75181
75181
|
};
|
|
@@ -75335,20 +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.5",
|
|
75341
75341
|
"create-docusaurus": "3.7.0",
|
|
75342
75342
|
"create-hono": "0.15.3",
|
|
75343
75343
|
"create-next-app": "15.2.1",
|
|
75344
75344
|
"create-qwik": "1.12.0",
|
|
75345
|
-
"create-vite": "6.
|
|
75345
|
+
"create-vite": "6.3.1",
|
|
75346
75346
|
"create-remix": "2.15.3",
|
|
75347
|
-
"create-
|
|
75348
|
-
"create-
|
|
75347
|
+
"create-react-router": "7.4.1",
|
|
75348
|
+
"create-solid": "0.6.2",
|
|
75349
|
+
"create-vue": "3.15.1",
|
|
75349
75350
|
gatsby: "5.14.1",
|
|
75350
75351
|
sv: "0.6.23",
|
|
75351
|
-
nuxi: "3.
|
|
75352
|
+
nuxi: "3.24.1"
|
|
75352
75353
|
}
|
|
75353
75354
|
};
|
|
75354
75355
|
|
|
@@ -75363,9 +75364,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
|
|
|
75363
75364
|
};
|
|
75364
75365
|
var runFrameworkGenerator = async (ctx, args) => {
|
|
75365
75366
|
const cli = getFrameworkCli(ctx, true);
|
|
75366
|
-
const { npm:
|
|
75367
|
-
const cmd = [...
|
|
75368
|
-
const env3 =
|
|
75367
|
+
const { npm: npm25, dlx } = detectPackageManager();
|
|
75368
|
+
const cmd = [...npm25 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
75369
|
+
const env3 = npm25 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
|
|
75369
75370
|
if (ctx.args.additionalArgs?.length) {
|
|
75370
75371
|
cmd.push(...ctx.args.additionalArgs);
|
|
75371
75372
|
}
|
|
@@ -75378,100 +75379,6 @@ var runFrameworkGenerator = async (ctx, args) => {
|
|
|
75378
75379
|
await runCommand(cmd, { env: env3 });
|
|
75379
75380
|
};
|
|
75380
75381
|
|
|
75381
|
-
// templates-experimental/hono/c3.ts
|
|
75382
|
-
var generate = async (ctx) => {
|
|
75383
|
-
const { name: pm4 } = detectPackageManager();
|
|
75384
|
-
await runFrameworkGenerator(ctx, [
|
|
75385
|
-
ctx.project.name,
|
|
75386
|
-
"--template",
|
|
75387
|
-
"cloudflare-workers",
|
|
75388
|
-
"--install",
|
|
75389
|
-
"--pm",
|
|
75390
|
-
pm4
|
|
75391
|
-
]);
|
|
75392
|
-
logRaw("");
|
|
75393
|
-
};
|
|
75394
|
-
var config = {
|
|
75395
|
-
configVersion: 1,
|
|
75396
|
-
id: "hono",
|
|
75397
|
-
frameworkCli: "create-hono",
|
|
75398
|
-
displayName: "Hono",
|
|
75399
|
-
copyFiles: {
|
|
75400
|
-
path: "./templates"
|
|
75401
|
-
},
|
|
75402
|
-
platform: "workers",
|
|
75403
|
-
path: "templates-experimental/hono",
|
|
75404
|
-
generate,
|
|
75405
|
-
transformPackageJson: async () => ({
|
|
75406
|
-
scripts: {
|
|
75407
|
-
dev: "wrangler dev",
|
|
75408
|
-
deploy: "wrangler deploy --minify",
|
|
75409
|
-
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
75410
|
-
}
|
|
75411
|
-
}),
|
|
75412
|
-
devScript: "dev",
|
|
75413
|
-
deployScript: "deploy",
|
|
75414
|
-
previewScript: "dev"
|
|
75415
|
-
};
|
|
75416
|
-
var c3_default = config;
|
|
75417
|
-
|
|
75418
|
-
// templates-experimental/next/c3.ts
|
|
75419
|
-
var generate2 = async (ctx) => {
|
|
75420
|
-
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
75421
|
-
};
|
|
75422
|
-
var configure = async (ctx) => {
|
|
75423
|
-
const packages = [
|
|
75424
|
-
"@opennextjs/cloudflare@0.5.x",
|
|
75425
|
-
"@cloudflare/workers-types"
|
|
75426
|
-
];
|
|
75427
|
-
await installPackages(packages, {
|
|
75428
|
-
dev: true,
|
|
75429
|
-
startText: "Adding the Cloudflare adapter",
|
|
75430
|
-
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
75431
|
-
});
|
|
75432
|
-
const usesTs = usesTypescript(ctx);
|
|
75433
|
-
updateNextConfig(usesTs);
|
|
75434
|
-
};
|
|
75435
|
-
var updateNextConfig = (usesTs) => {
|
|
75436
|
-
const s = spinner();
|
|
75437
|
-
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
75438
|
-
s.start(`Updating \`${configFile}\``);
|
|
75439
|
-
const configContent = readFile(configFile);
|
|
75440
|
-
const updatedConfigFile = configContent + `
|
|
75441
|
-
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
75442
|
-
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
75443
|
-
initOpenNextCloudflareForDev();
|
|
75444
|
-
`.replace(/\n\t*/g, "\n");
|
|
75445
|
-
writeFile2(configFile, updatedConfigFile);
|
|
75446
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75447
|
-
};
|
|
75448
|
-
var c3_default2 = {
|
|
75449
|
-
configVersion: 1,
|
|
75450
|
-
id: "next",
|
|
75451
|
-
frameworkCli: "create-next-app",
|
|
75452
|
-
// TODO: Stop using a pinned version when the template graduates.
|
|
75453
|
-
frameworkCliPinnedVersion: "~15.2.2",
|
|
75454
|
-
platform: "workers",
|
|
75455
|
-
displayName: "Next.js (using Node.js compat + Workers Assets)",
|
|
75456
|
-
path: "templates-experimental/next",
|
|
75457
|
-
copyFiles: {
|
|
75458
|
-
path: "./templates"
|
|
75459
|
-
},
|
|
75460
|
-
generate: generate2,
|
|
75461
|
-
configure,
|
|
75462
|
-
transformPackageJson: async () => ({
|
|
75463
|
-
scripts: {
|
|
75464
|
-
deploy: `opennextjs-cloudflare && wrangler deploy`,
|
|
75465
|
-
preview: `opennextjs-cloudflare && wrangler dev`,
|
|
75466
|
-
"cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
|
|
75467
|
-
}
|
|
75468
|
-
}),
|
|
75469
|
-
devScript: "dev",
|
|
75470
|
-
previewScript: "preview",
|
|
75471
|
-
deployScript: "deploy",
|
|
75472
|
-
compatibilityFlags: ["nodejs_compat"]
|
|
75473
|
-
};
|
|
75474
|
-
|
|
75475
75382
|
// src/helpers/codemod.ts
|
|
75476
75383
|
var import_fs8 = require("fs");
|
|
75477
75384
|
var import_path8 = __toESM(require("path"));
|
|
@@ -75547,117 +75454,6 @@ var getPropertyName = (newProp) => {
|
|
|
75547
75454
|
return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
|
|
75548
75455
|
};
|
|
75549
75456
|
|
|
75550
|
-
// templates-experimental/qwik/c3.ts
|
|
75551
|
-
var recast2 = __toESM(require_main3());
|
|
75552
|
-
var { npm, npx, name } = detectPackageManager();
|
|
75553
|
-
var generate3 = async (ctx) => {
|
|
75554
|
-
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
75555
|
-
};
|
|
75556
|
-
var configure2 = async (ctx) => {
|
|
75557
|
-
const cmd = [name === "pnpm" ? npm : npx, "qwik", "add", "cloudflare-pages"];
|
|
75558
|
-
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
75559
|
-
await runCommand(cmd);
|
|
75560
|
-
removeFile("./public/_headers");
|
|
75561
|
-
removeFile("./public/_redirects");
|
|
75562
|
-
removeFile("./public/_routes.json");
|
|
75563
|
-
addBindingsProxy(ctx);
|
|
75564
|
-
populateCloudflareEnv();
|
|
75565
|
-
};
|
|
75566
|
-
var addBindingsProxy = (ctx) => {
|
|
75567
|
-
if (!usesTypescript(ctx)) {
|
|
75568
|
-
return;
|
|
75569
|
-
}
|
|
75570
|
-
const s = spinner();
|
|
75571
|
-
s.start("Updating `vite.config.ts`");
|
|
75572
|
-
const snippets = loadTemplateSnippets(ctx);
|
|
75573
|
-
const b3 = recast2.types.builders;
|
|
75574
|
-
transformFile("vite.config.ts", {
|
|
75575
|
-
// Insert the env declaration after the last import (but before the rest of the body)
|
|
75576
|
-
visitProgram: function(n) {
|
|
75577
|
-
const lastImportIndex = n.node.body.findLastIndex(
|
|
75578
|
-
(t2) => t2.type === "ImportDeclaration"
|
|
75579
|
-
);
|
|
75580
|
-
const lastImport = n.get("body", lastImportIndex);
|
|
75581
|
-
lastImport.insertAfter(...snippets.getPlatformProxyTs);
|
|
75582
|
-
return this.traverse(n);
|
|
75583
|
-
},
|
|
75584
|
-
// Pass the `platform` object from the declaration to the `qwikCity` plugin
|
|
75585
|
-
visitCallExpression: function(n) {
|
|
75586
|
-
const callee = n.node.callee;
|
|
75587
|
-
if (callee.name !== "qwikCity") {
|
|
75588
|
-
return this.traverse(n);
|
|
75589
|
-
}
|
|
75590
|
-
const configArgument = n.node.arguments[0];
|
|
75591
|
-
const platformPropery = b3.objectProperty.from({
|
|
75592
|
-
key: b3.identifier("platform"),
|
|
75593
|
-
value: b3.identifier("platform"),
|
|
75594
|
-
shorthand: true
|
|
75595
|
-
});
|
|
75596
|
-
if (!configArgument) {
|
|
75597
|
-
n.node.arguments = [b3.objectExpression([platformPropery])];
|
|
75598
|
-
return false;
|
|
75599
|
-
}
|
|
75600
|
-
if (configArgument.type !== "ObjectExpression") {
|
|
75601
|
-
crash("Failed to update `vite.config.ts`");
|
|
75602
|
-
}
|
|
75603
|
-
configArgument.properties.push(platformPropery);
|
|
75604
|
-
return false;
|
|
75605
|
-
}
|
|
75606
|
-
});
|
|
75607
|
-
s.stop(`${brandColor("updated")} \`vite.config.ts\``);
|
|
75608
|
-
};
|
|
75609
|
-
var populateCloudflareEnv = () => {
|
|
75610
|
-
const entrypointPath = "src/entry.cloudflare-pages.tsx";
|
|
75611
|
-
const s = spinner();
|
|
75612
|
-
s.start(`Updating \`${entrypointPath}\``);
|
|
75613
|
-
transformFile(entrypointPath, {
|
|
75614
|
-
visitTSInterfaceDeclaration: function(n) {
|
|
75615
|
-
const b3 = recast2.types.builders;
|
|
75616
|
-
const id = n.node.id;
|
|
75617
|
-
if (id.name !== "QwikCityPlatform") {
|
|
75618
|
-
this.traverse(n);
|
|
75619
|
-
}
|
|
75620
|
-
const newBody = [
|
|
75621
|
-
["env", "Env"]
|
|
75622
|
-
// Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
|
|
75623
|
-
// ["cf", "CfProperties"],
|
|
75624
|
-
].map(
|
|
75625
|
-
([varName, type]) => b3.tsPropertySignature(
|
|
75626
|
-
b3.identifier(varName),
|
|
75627
|
-
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
|
|
75628
|
-
)
|
|
75629
|
-
);
|
|
75630
|
-
n.node.body.body = newBody;
|
|
75631
|
-
return false;
|
|
75632
|
-
}
|
|
75633
|
-
});
|
|
75634
|
-
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
75635
|
-
};
|
|
75636
|
-
var config2 = {
|
|
75637
|
-
configVersion: 1,
|
|
75638
|
-
id: "qwik",
|
|
75639
|
-
frameworkCli: "create-qwik",
|
|
75640
|
-
displayName: "Qwik",
|
|
75641
|
-
platform: "workers",
|
|
75642
|
-
copyFiles: {
|
|
75643
|
-
path: "./templates"
|
|
75644
|
-
},
|
|
75645
|
-
path: "templates-experimental/qwik",
|
|
75646
|
-
generate: generate3,
|
|
75647
|
-
configure: configure2,
|
|
75648
|
-
transformPackageJson: async () => ({
|
|
75649
|
-
scripts: {
|
|
75650
|
-
deploy: `${npm} run build && wrangler deploy`,
|
|
75651
|
-
preview: `${npm} run build && wrangler dev`,
|
|
75652
|
-
"cf-typegen": `wrangler types`
|
|
75653
|
-
}
|
|
75654
|
-
}),
|
|
75655
|
-
devScript: "dev",
|
|
75656
|
-
deployScript: "deploy",
|
|
75657
|
-
previewScript: "preview"
|
|
75658
|
-
};
|
|
75659
|
-
var c3_default3 = config2;
|
|
75660
|
-
|
|
75661
75457
|
// src/helpers/compatDate.ts
|
|
75662
75458
|
var import_fs9 = require("fs");
|
|
75663
75459
|
var import_path9 = require("path");
|
|
@@ -75711,18 +75507,18 @@ function getLatestTypesEntrypoint(ctx) {
|
|
|
75711
75507
|
}
|
|
75712
75508
|
|
|
75713
75509
|
// templates-experimental/solid/c3.ts
|
|
75714
|
-
var
|
|
75715
|
-
var { npm
|
|
75716
|
-
var
|
|
75510
|
+
var recast2 = __toESM(require_main3());
|
|
75511
|
+
var { npm } = detectPackageManager();
|
|
75512
|
+
var generate = async (ctx) => {
|
|
75717
75513
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
75718
75514
|
logRaw("");
|
|
75719
75515
|
};
|
|
75720
|
-
var
|
|
75516
|
+
var configure = async (ctx) => {
|
|
75721
75517
|
const packages = ["nitropack"];
|
|
75722
75518
|
await installPackages(packages, {
|
|
75723
75519
|
dev: true,
|
|
75724
75520
|
startText: "Installing nitro module `nitropack`",
|
|
75725
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75521
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
75726
75522
|
});
|
|
75727
75523
|
usesTypescript(ctx);
|
|
75728
75524
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
@@ -75734,7 +75530,7 @@ var configure3 = async (ctx) => {
|
|
|
75734
75530
|
if (callee.name !== "defineConfig") {
|
|
75735
75531
|
return this.traverse(n);
|
|
75736
75532
|
}
|
|
75737
|
-
const b3 =
|
|
75533
|
+
const b3 = recast2.types.builders;
|
|
75738
75534
|
mergeObjectProperties(
|
|
75739
75535
|
n.node.arguments[0],
|
|
75740
75536
|
[
|
|
@@ -75758,7 +75554,7 @@ var configure3 = async (ctx) => {
|
|
|
75758
75554
|
}
|
|
75759
75555
|
});
|
|
75760
75556
|
};
|
|
75761
|
-
var
|
|
75557
|
+
var config = {
|
|
75762
75558
|
configVersion: 1,
|
|
75763
75559
|
id: "solid",
|
|
75764
75560
|
frameworkCli: "create-solid",
|
|
@@ -75768,12 +75564,12 @@ var config3 = {
|
|
|
75768
75564
|
path: "./templates"
|
|
75769
75565
|
},
|
|
75770
75566
|
path: "templates-experimental/solid",
|
|
75771
|
-
generate
|
|
75772
|
-
configure
|
|
75567
|
+
generate,
|
|
75568
|
+
configure,
|
|
75773
75569
|
transformPackageJson: async () => ({
|
|
75774
75570
|
scripts: {
|
|
75775
|
-
preview: `${
|
|
75776
|
-
deploy: `${
|
|
75571
|
+
preview: `${npm} run build && npx wrangler dev`,
|
|
75572
|
+
deploy: `${npm} run build && wrangler deploy`
|
|
75777
75573
|
}
|
|
75778
75574
|
}),
|
|
75779
75575
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -75781,111 +75577,12 @@ var config3 = {
|
|
|
75781
75577
|
deployScript: "deploy",
|
|
75782
75578
|
previewScript: "preview"
|
|
75783
75579
|
};
|
|
75784
|
-
var
|
|
75785
|
-
|
|
75786
|
-
// templates-experimental/svelte/c3.ts
|
|
75787
|
-
var import_node_os3 = require("node:os");
|
|
75788
|
-
var recast4 = __toESM(require_main3());
|
|
75789
|
-
var { npm: npm3 } = detectPackageManager();
|
|
75790
|
-
var generate5 = async (ctx) => {
|
|
75791
|
-
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
75792
|
-
logRaw("");
|
|
75793
|
-
};
|
|
75794
|
-
var configure4 = async (ctx) => {
|
|
75795
|
-
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
75796
|
-
await installPackages([pkg], {
|
|
75797
|
-
dev: true,
|
|
75798
|
-
startText: "Adding the Cloudflare Pages adapter",
|
|
75799
|
-
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
75800
|
-
});
|
|
75801
|
-
updateSvelteConfig();
|
|
75802
|
-
updateTypeDefinitions(ctx);
|
|
75803
|
-
};
|
|
75804
|
-
var updateSvelteConfig = () => {
|
|
75805
|
-
updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
|
|
75806
|
-
transformFile("svelte.config.js", {
|
|
75807
|
-
visitImportDeclaration: function(n) {
|
|
75808
|
-
const importSource = n.value.source;
|
|
75809
|
-
if (importSource.value === "@sveltejs/adapter-auto") {
|
|
75810
|
-
importSource.value = "@sveltejs/adapter-cloudflare";
|
|
75811
|
-
}
|
|
75812
|
-
return false;
|
|
75813
|
-
}
|
|
75814
|
-
});
|
|
75815
|
-
};
|
|
75816
|
-
var updateTypeDefinitions = (ctx) => {
|
|
75817
|
-
if (!usesTypescript(ctx)) {
|
|
75818
|
-
return;
|
|
75819
|
-
}
|
|
75820
|
-
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
75821
|
-
const b3 = recast4.types.builders;
|
|
75822
|
-
transformFile("src/app.d.ts", {
|
|
75823
|
-
visitTSModuleDeclaration(n) {
|
|
75824
|
-
if (n.value.id.name === "App" && n.node.body) {
|
|
75825
|
-
const moduleBlock = n.node.body;
|
|
75826
|
-
const platformInterface = b3.tsInterfaceDeclaration(
|
|
75827
|
-
b3.identifier("Platform"),
|
|
75828
|
-
b3.tsInterfaceBody([
|
|
75829
|
-
b3.tsPropertySignature(
|
|
75830
|
-
b3.identifier("env"),
|
|
75831
|
-
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier("Env")))
|
|
75832
|
-
),
|
|
75833
|
-
b3.tsPropertySignature(
|
|
75834
|
-
b3.identifier("cf"),
|
|
75835
|
-
b3.tsTypeAnnotation(
|
|
75836
|
-
b3.tsTypeReference(b3.identifier("CfProperties"))
|
|
75837
|
-
)
|
|
75838
|
-
),
|
|
75839
|
-
b3.tsPropertySignature(
|
|
75840
|
-
b3.identifier("ctx"),
|
|
75841
|
-
b3.tsTypeAnnotation(
|
|
75842
|
-
b3.tsTypeReference(b3.identifier("ExecutionContext"))
|
|
75843
|
-
)
|
|
75844
|
-
)
|
|
75845
|
-
])
|
|
75846
|
-
);
|
|
75847
|
-
moduleBlock.body.unshift(platformInterface);
|
|
75848
|
-
}
|
|
75849
|
-
this.traverse(n);
|
|
75850
|
-
}
|
|
75851
|
-
});
|
|
75852
|
-
};
|
|
75853
|
-
var config4 = {
|
|
75854
|
-
configVersion: 1,
|
|
75855
|
-
id: "svelte",
|
|
75856
|
-
frameworkCli: "sv",
|
|
75857
|
-
displayName: "SvelteKit",
|
|
75858
|
-
platform: "workers",
|
|
75859
|
-
copyFiles: {
|
|
75860
|
-
path: "./templates"
|
|
75861
|
-
},
|
|
75862
|
-
path: "templates-experimental/svelte",
|
|
75863
|
-
generate: generate5,
|
|
75864
|
-
configure: configure4,
|
|
75865
|
-
transformPackageJson: async (original, ctx) => {
|
|
75866
|
-
let scripts = {
|
|
75867
|
-
preview: `${npm3} run build && wrangler dev`,
|
|
75868
|
-
deploy: `${npm3} run build && wrangler deploy`
|
|
75869
|
-
};
|
|
75870
|
-
if (usesTypescript(ctx)) {
|
|
75871
|
-
const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
|
|
75872
|
-
scripts = {
|
|
75873
|
-
...scripts,
|
|
75874
|
-
"cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
|
|
75875
|
-
};
|
|
75876
|
-
}
|
|
75877
|
-
return { scripts };
|
|
75878
|
-
},
|
|
75879
|
-
devScript: "dev",
|
|
75880
|
-
deployScript: "deploy",
|
|
75881
|
-
previewScript: "preview"
|
|
75882
|
-
};
|
|
75883
|
-
var c3_default5 = config4;
|
|
75580
|
+
var c3_default = config;
|
|
75884
75581
|
|
|
75885
75582
|
// templates/analog/c3.ts
|
|
75886
|
-
var
|
|
75887
|
-
var { npm:
|
|
75888
|
-
var
|
|
75583
|
+
var recast3 = __toESM(require_main3());
|
|
75584
|
+
var { npm: npm2, name: pm } = detectPackageManager();
|
|
75585
|
+
var generate2 = async (ctx) => {
|
|
75889
75586
|
await runFrameworkGenerator(ctx, [
|
|
75890
75587
|
ctx.project.name,
|
|
75891
75588
|
"--template",
|
|
@@ -75893,7 +75590,7 @@ var generate6 = async (ctx) => {
|
|
|
75893
75590
|
]);
|
|
75894
75591
|
logRaw("");
|
|
75895
75592
|
};
|
|
75896
|
-
var
|
|
75593
|
+
var configure2 = async (ctx) => {
|
|
75897
75594
|
if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
|
|
75898
75595
|
const packages = [];
|
|
75899
75596
|
packages.push("nitropack");
|
|
@@ -75903,7 +75600,7 @@ var configure5 = async (ctx) => {
|
|
|
75903
75600
|
await installPackages(packages, {
|
|
75904
75601
|
dev: true,
|
|
75905
75602
|
startText: `Installing ${packages.join(", ")}`,
|
|
75906
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75603
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
|
|
75907
75604
|
});
|
|
75908
75605
|
}
|
|
75909
75606
|
updateViteConfig(ctx);
|
|
@@ -75924,7 +75621,7 @@ var updateEnvTypes = (ctx) => {
|
|
|
75924
75621
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
|
|
75925
75622
|
};
|
|
75926
75623
|
var updateViteConfig = (ctx) => {
|
|
75927
|
-
const b3 =
|
|
75624
|
+
const b3 = recast3.types.builders;
|
|
75928
75625
|
const s = spinner();
|
|
75929
75626
|
const configFile = "vite.config.ts";
|
|
75930
75627
|
s.start(`Updating \`${configFile}\``);
|
|
@@ -75961,7 +75658,7 @@ var updateViteConfig = (ctx) => {
|
|
|
75961
75658
|
});
|
|
75962
75659
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75963
75660
|
};
|
|
75964
|
-
var
|
|
75661
|
+
var config2 = {
|
|
75965
75662
|
configVersion: 1,
|
|
75966
75663
|
id: "analog",
|
|
75967
75664
|
frameworkCli: "create-analog",
|
|
@@ -75970,12 +75667,12 @@ var config5 = {
|
|
|
75970
75667
|
copyFiles: {
|
|
75971
75668
|
path: "./templates"
|
|
75972
75669
|
},
|
|
75973
|
-
generate:
|
|
75974
|
-
configure:
|
|
75670
|
+
generate: generate2,
|
|
75671
|
+
configure: configure2,
|
|
75975
75672
|
transformPackageJson: async () => ({
|
|
75976
75673
|
scripts: {
|
|
75977
|
-
preview: `${
|
|
75978
|
-
deploy: `${
|
|
75674
|
+
preview: `${npm2} run build && wrangler pages dev`,
|
|
75675
|
+
deploy: `${npm2} run build && wrangler pages deploy`,
|
|
75979
75676
|
"cf-typegen": `wrangler types`
|
|
75980
75677
|
}
|
|
75981
75678
|
}),
|
|
@@ -75983,12 +75680,12 @@ var config5 = {
|
|
|
75983
75680
|
deployScript: "deploy",
|
|
75984
75681
|
previewScript: "preview"
|
|
75985
75682
|
};
|
|
75986
|
-
var
|
|
75683
|
+
var c3_default2 = config2;
|
|
75987
75684
|
|
|
75988
75685
|
// templates/angular/pages/c3.ts
|
|
75989
75686
|
var import_node_path3 = require("node:path");
|
|
75990
|
-
var { npm:
|
|
75991
|
-
var
|
|
75687
|
+
var { npm: npm3 } = detectPackageManager();
|
|
75688
|
+
var generate3 = async (ctx) => {
|
|
75992
75689
|
await runFrameworkGenerator(ctx, [
|
|
75993
75690
|
ctx.project.name,
|
|
75994
75691
|
"--ssr",
|
|
@@ -75996,7 +75693,7 @@ var generate7 = async (ctx) => {
|
|
|
75996
75693
|
]);
|
|
75997
75694
|
logRaw("");
|
|
75998
75695
|
};
|
|
75999
|
-
var
|
|
75696
|
+
var configure3 = async (ctx) => {
|
|
76000
75697
|
updateAngularJson(ctx);
|
|
76001
75698
|
await updateAppCode();
|
|
76002
75699
|
await installCFWorker();
|
|
@@ -76005,7 +75702,7 @@ async function installCFWorker() {
|
|
|
76005
75702
|
await installPackages(["xhr2"], {
|
|
76006
75703
|
dev: true,
|
|
76007
75704
|
startText: "Installing additional dependencies",
|
|
76008
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75705
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
|
|
76009
75706
|
});
|
|
76010
75707
|
}
|
|
76011
75708
|
async function updateAppCode() {
|
|
@@ -76047,12 +75744,13 @@ function updateAngularJson(ctx) {
|
|
|
76047
75744
|
writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
76048
75745
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
76049
75746
|
}
|
|
76050
|
-
var
|
|
75747
|
+
var config3 = {
|
|
76051
75748
|
configVersion: 1,
|
|
76052
75749
|
id: "angular",
|
|
76053
75750
|
frameworkCli: "@angular/create",
|
|
76054
75751
|
displayName: "Angular",
|
|
76055
75752
|
platform: "pages",
|
|
75753
|
+
hidden: true,
|
|
76056
75754
|
copyFiles: {
|
|
76057
75755
|
path: "./templates"
|
|
76058
75756
|
},
|
|
@@ -76060,23 +75758,23 @@ var config6 = {
|
|
|
76060
75758
|
devScript: "start",
|
|
76061
75759
|
deployScript: "deploy",
|
|
76062
75760
|
previewScript: "start",
|
|
76063
|
-
generate:
|
|
76064
|
-
configure:
|
|
75761
|
+
generate: generate3,
|
|
75762
|
+
configure: configure3,
|
|
76065
75763
|
transformPackageJson: async () => ({
|
|
76066
75764
|
scripts: {
|
|
76067
|
-
start: `${
|
|
76068
|
-
build: `ng build && ${
|
|
75765
|
+
start: `${npm3} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
75766
|
+
build: `ng build && ${npm3} run process`,
|
|
76069
75767
|
process: "node ./tools/copy-files.mjs",
|
|
76070
|
-
deploy: `${
|
|
75768
|
+
deploy: `${npm3} run build && wrangler pages deploy dist/cloudflare`
|
|
76071
75769
|
}
|
|
76072
75770
|
})
|
|
76073
75771
|
};
|
|
76074
|
-
var
|
|
75772
|
+
var c3_default3 = config3;
|
|
76075
75773
|
|
|
76076
75774
|
// templates/angular/workers/c3.ts
|
|
76077
75775
|
var import_node_path4 = require("node:path");
|
|
76078
|
-
var { npm:
|
|
76079
|
-
var
|
|
75776
|
+
var { npm: npm4 } = detectPackageManager();
|
|
75777
|
+
var generate4 = async (ctx) => {
|
|
76080
75778
|
await runFrameworkGenerator(ctx, [
|
|
76081
75779
|
ctx.project.name,
|
|
76082
75780
|
"--ssr",
|
|
@@ -76084,7 +75782,7 @@ var generate8 = async (ctx) => {
|
|
|
76084
75782
|
]);
|
|
76085
75783
|
logRaw("");
|
|
76086
75784
|
};
|
|
76087
|
-
var
|
|
75785
|
+
var configure4 = async (ctx) => {
|
|
76088
75786
|
updateAngularJson2(ctx);
|
|
76089
75787
|
await updateAppCode2();
|
|
76090
75788
|
await installCFWorker2();
|
|
@@ -76093,7 +75791,7 @@ async function installCFWorker2() {
|
|
|
76093
75791
|
await installPackages(["xhr2"], {
|
|
76094
75792
|
dev: true,
|
|
76095
75793
|
startText: "Installing additional dependencies",
|
|
76096
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75794
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm4} install\``)}`
|
|
76097
75795
|
});
|
|
76098
75796
|
}
|
|
76099
75797
|
async function updateAppCode2() {
|
|
@@ -76134,7 +75832,7 @@ function updateAngularJson2(ctx) {
|
|
|
76134
75832
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
76135
75833
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
76136
75834
|
}
|
|
76137
|
-
var
|
|
75835
|
+
var config4 = {
|
|
76138
75836
|
configVersion: 1,
|
|
76139
75837
|
id: "angular",
|
|
76140
75838
|
frameworkCli: "@angular/create",
|
|
@@ -76147,38 +75845,38 @@ var config7 = {
|
|
|
76147
75845
|
devScript: "start",
|
|
76148
75846
|
deployScript: "deploy",
|
|
76149
75847
|
previewScript: "start",
|
|
76150
|
-
generate:
|
|
76151
|
-
configure:
|
|
75848
|
+
generate: generate4,
|
|
75849
|
+
configure: configure4,
|
|
76152
75850
|
transformPackageJson: async () => ({
|
|
76153
75851
|
scripts: {
|
|
76154
|
-
start: `${
|
|
75852
|
+
start: `${npm4} run build && wrangler dev`,
|
|
76155
75853
|
build: `ng build`,
|
|
76156
|
-
deploy: `${
|
|
75854
|
+
deploy: `${npm4} run build && wrangler deploy`
|
|
76157
75855
|
}
|
|
76158
75856
|
})
|
|
76159
75857
|
};
|
|
76160
|
-
var
|
|
75858
|
+
var c3_default4 = config4;
|
|
76161
75859
|
|
|
76162
75860
|
// templates/angular/c3.ts
|
|
76163
|
-
var
|
|
75861
|
+
var config5 = {
|
|
76164
75862
|
displayName: "Angular",
|
|
76165
|
-
platformVariants: { pages:
|
|
75863
|
+
platformVariants: { pages: c3_default3, workers: c3_default4 }
|
|
76166
75864
|
};
|
|
76167
|
-
var
|
|
75865
|
+
var c3_default5 = config5;
|
|
76168
75866
|
|
|
76169
75867
|
// templates/astro/pages/c3.ts
|
|
76170
|
-
var
|
|
76171
|
-
var { npx
|
|
76172
|
-
var
|
|
75868
|
+
var recast4 = __toESM(require_main3());
|
|
75869
|
+
var { npx } = detectPackageManager();
|
|
75870
|
+
var generate5 = async (ctx) => {
|
|
76173
75871
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76174
75872
|
logRaw("");
|
|
76175
75873
|
};
|
|
76176
|
-
var
|
|
76177
|
-
await runCommand([
|
|
75874
|
+
var configure5 = async () => {
|
|
75875
|
+
await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
|
|
76178
75876
|
silent: true,
|
|
76179
75877
|
startText: "Installing adapter",
|
|
76180
75878
|
doneText: `${brandColor("installed")} ${dim(
|
|
76181
|
-
`via \`${
|
|
75879
|
+
`via \`${npx} astro add cloudflare\``
|
|
76182
75880
|
)}`
|
|
76183
75881
|
});
|
|
76184
75882
|
updateAstroConfig();
|
|
@@ -76192,7 +75890,7 @@ var updateAstroConfig = () => {
|
|
|
76192
75890
|
if (callee.name !== "cloudflare") {
|
|
76193
75891
|
return this.traverse(n);
|
|
76194
75892
|
}
|
|
76195
|
-
const b3 =
|
|
75893
|
+
const b3 = recast4.types.builders;
|
|
76196
75894
|
n.node.arguments = [
|
|
76197
75895
|
b3.objectExpression([
|
|
76198
75896
|
b3.objectProperty(
|
|
@@ -76207,11 +75905,12 @@ var updateAstroConfig = () => {
|
|
|
76207
75905
|
}
|
|
76208
75906
|
});
|
|
76209
75907
|
};
|
|
76210
|
-
var
|
|
75908
|
+
var config6 = {
|
|
76211
75909
|
configVersion: 1,
|
|
76212
75910
|
id: "astro",
|
|
76213
75911
|
frameworkCli: "create-astro",
|
|
76214
75912
|
platform: "pages",
|
|
75913
|
+
hidden: true,
|
|
76215
75914
|
displayName: "Astro",
|
|
76216
75915
|
path: "templates/astro/pages",
|
|
76217
75916
|
copyFiles: {
|
|
@@ -76230,8 +75929,8 @@ var config9 = {
|
|
|
76230
75929
|
devScript: "dev",
|
|
76231
75930
|
deployScript: "deploy",
|
|
76232
75931
|
previewScript: "preview",
|
|
76233
|
-
generate:
|
|
76234
|
-
configure:
|
|
75932
|
+
generate: generate5,
|
|
75933
|
+
configure: configure5,
|
|
76235
75934
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76236
75935
|
scripts: {
|
|
76237
75936
|
deploy: `astro build && wrangler pages deploy`,
|
|
@@ -76240,21 +75939,21 @@ var config9 = {
|
|
|
76240
75939
|
}
|
|
76241
75940
|
})
|
|
76242
75941
|
};
|
|
76243
|
-
var
|
|
75942
|
+
var c3_default6 = config6;
|
|
76244
75943
|
|
|
76245
75944
|
// templates/astro/workers/c3.ts
|
|
76246
|
-
var
|
|
76247
|
-
var { npx:
|
|
76248
|
-
var
|
|
75945
|
+
var recast5 = __toESM(require_main3());
|
|
75946
|
+
var { npx: npx2 } = detectPackageManager();
|
|
75947
|
+
var generate6 = async (ctx) => {
|
|
76249
75948
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76250
75949
|
logRaw("");
|
|
76251
75950
|
};
|
|
76252
|
-
var
|
|
76253
|
-
await runCommand([
|
|
75951
|
+
var configure6 = async () => {
|
|
75952
|
+
await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
|
|
76254
75953
|
silent: true,
|
|
76255
75954
|
startText: "Installing adapter",
|
|
76256
75955
|
doneText: `${brandColor("installed")} ${dim(
|
|
76257
|
-
`via \`${
|
|
75956
|
+
`via \`${npx2} astro add cloudflare\``
|
|
76258
75957
|
)}`
|
|
76259
75958
|
});
|
|
76260
75959
|
updateAstroConfig2();
|
|
@@ -76268,7 +75967,7 @@ var updateAstroConfig2 = () => {
|
|
|
76268
75967
|
if (callee.name !== "cloudflare") {
|
|
76269
75968
|
return this.traverse(n);
|
|
76270
75969
|
}
|
|
76271
|
-
const b3 =
|
|
75970
|
+
const b3 = recast5.types.builders;
|
|
76272
75971
|
n.node.arguments = [
|
|
76273
75972
|
b3.objectExpression([
|
|
76274
75973
|
b3.objectProperty(
|
|
@@ -76283,7 +75982,7 @@ var updateAstroConfig2 = () => {
|
|
|
76283
75982
|
}
|
|
76284
75983
|
});
|
|
76285
75984
|
};
|
|
76286
|
-
var
|
|
75985
|
+
var config7 = {
|
|
76287
75986
|
configVersion: 1,
|
|
76288
75987
|
id: "astro",
|
|
76289
75988
|
frameworkCli: "create-astro",
|
|
@@ -76306,8 +76005,8 @@ var config10 = {
|
|
|
76306
76005
|
deployScript: "deploy",
|
|
76307
76006
|
previewScript: "preview",
|
|
76308
76007
|
path: "templates/astro/workers",
|
|
76309
|
-
generate:
|
|
76310
|
-
configure:
|
|
76008
|
+
generate: generate6,
|
|
76009
|
+
configure: configure6,
|
|
76311
76010
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76312
76011
|
scripts: {
|
|
76313
76012
|
deploy: `astro build && wrangler deploy`,
|
|
@@ -76316,17 +76015,17 @@ var config10 = {
|
|
|
76316
76015
|
}
|
|
76317
76016
|
})
|
|
76318
76017
|
};
|
|
76319
|
-
var
|
|
76018
|
+
var c3_default7 = config7;
|
|
76320
76019
|
|
|
76321
76020
|
// templates/astro/c3.ts
|
|
76322
|
-
var
|
|
76021
|
+
var config8 = {
|
|
76323
76022
|
displayName: "Astro",
|
|
76324
|
-
platformVariants: { pages:
|
|
76023
|
+
platformVariants: { pages: c3_default6, workers: c3_default7 }
|
|
76325
76024
|
};
|
|
76326
|
-
var
|
|
76025
|
+
var c3_default8 = config8;
|
|
76327
76026
|
|
|
76328
76027
|
// templates/common/c3.ts
|
|
76329
|
-
var
|
|
76028
|
+
var config9 = {
|
|
76330
76029
|
configVersion: 1,
|
|
76331
76030
|
id: "common",
|
|
76332
76031
|
displayName: "Example router & proxy Worker",
|
|
@@ -76344,38 +76043,40 @@ var c3_default13 = {
|
|
|
76344
76043
|
}
|
|
76345
76044
|
}
|
|
76346
76045
|
};
|
|
76046
|
+
var c3_default9 = config9;
|
|
76347
76047
|
|
|
76348
76048
|
// templates/docusaurus/pages/c3.ts
|
|
76349
|
-
var { npm:
|
|
76350
|
-
var
|
|
76049
|
+
var { npm: npm5 } = detectPackageManager();
|
|
76050
|
+
var generate7 = async (ctx) => {
|
|
76351
76051
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76352
76052
|
};
|
|
76353
|
-
var
|
|
76053
|
+
var config10 = {
|
|
76354
76054
|
configVersion: 1,
|
|
76355
76055
|
id: "docusaurus",
|
|
76356
76056
|
frameworkCli: "create-docusaurus",
|
|
76357
76057
|
platform: "pages",
|
|
76058
|
+
hidden: true,
|
|
76358
76059
|
displayName: "Docusaurus",
|
|
76359
76060
|
path: "templates/docusaurus/pages",
|
|
76360
|
-
generate:
|
|
76061
|
+
generate: generate7,
|
|
76361
76062
|
transformPackageJson: async () => ({
|
|
76362
76063
|
scripts: {
|
|
76363
|
-
preview: `${
|
|
76364
|
-
deploy: `${
|
|
76064
|
+
preview: `${npm5} run build && wrangler pages dev ./build`,
|
|
76065
|
+
deploy: `${npm5} run build && wrangler pages deploy ./build`
|
|
76365
76066
|
}
|
|
76366
76067
|
}),
|
|
76367
76068
|
devScript: "preview",
|
|
76368
76069
|
deployScript: "deploy",
|
|
76369
76070
|
previewScript: "preview"
|
|
76370
76071
|
};
|
|
76371
|
-
var
|
|
76072
|
+
var c3_default10 = config10;
|
|
76372
76073
|
|
|
76373
76074
|
// templates/docusaurus/workers/c3.ts
|
|
76374
|
-
var { npm:
|
|
76375
|
-
var
|
|
76075
|
+
var { npm: npm6 } = detectPackageManager();
|
|
76076
|
+
var generate8 = async (ctx) => {
|
|
76376
76077
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76377
76078
|
};
|
|
76378
|
-
var
|
|
76079
|
+
var config11 = {
|
|
76379
76080
|
configVersion: 1,
|
|
76380
76081
|
id: "docusaurus",
|
|
76381
76082
|
frameworkCli: "create-docusaurus",
|
|
@@ -76385,29 +76086,29 @@ var config13 = {
|
|
|
76385
76086
|
path: "./templates"
|
|
76386
76087
|
},
|
|
76387
76088
|
path: "templates/docusaurus/workers",
|
|
76388
|
-
generate:
|
|
76089
|
+
generate: generate8,
|
|
76389
76090
|
transformPackageJson: async () => ({
|
|
76390
76091
|
scripts: {
|
|
76391
|
-
deploy: `${
|
|
76392
|
-
preview: `${
|
|
76092
|
+
deploy: `${npm6} run build && wrangler deploy`,
|
|
76093
|
+
preview: `${npm6} run build && wrangler dev`
|
|
76393
76094
|
}
|
|
76394
76095
|
}),
|
|
76395
76096
|
devScript: "start",
|
|
76396
76097
|
deployScript: "deploy",
|
|
76397
76098
|
previewScript: "preview"
|
|
76398
76099
|
};
|
|
76399
|
-
var
|
|
76100
|
+
var c3_default11 = config11;
|
|
76400
76101
|
|
|
76401
76102
|
// templates/docusaurus/c3.ts
|
|
76402
|
-
var
|
|
76103
|
+
var config12 = {
|
|
76403
76104
|
displayName: "Docusaurus",
|
|
76404
|
-
platformVariants: { pages:
|
|
76105
|
+
platformVariants: { pages: c3_default10, workers: c3_default11 }
|
|
76405
76106
|
};
|
|
76406
|
-
var
|
|
76107
|
+
var c3_default12 = config12;
|
|
76407
76108
|
|
|
76408
76109
|
// templates/gatsby/pages/c3.ts
|
|
76409
|
-
var { npm:
|
|
76410
|
-
var
|
|
76110
|
+
var { npm: npm7 } = detectPackageManager();
|
|
76111
|
+
var generate9 = async (ctx) => {
|
|
76411
76112
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76412
76113
|
const useTemplate = await inputPrompt({
|
|
76413
76114
|
type: "confirm",
|
|
@@ -76426,29 +76127,30 @@ var generate13 = async (ctx) => {
|
|
|
76426
76127
|
}
|
|
76427
76128
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76428
76129
|
};
|
|
76429
|
-
var
|
|
76130
|
+
var config13 = {
|
|
76430
76131
|
configVersion: 1,
|
|
76431
76132
|
id: "gatsby",
|
|
76432
76133
|
frameworkCli: "gatsby",
|
|
76433
76134
|
platform: "pages",
|
|
76135
|
+
hidden: true,
|
|
76434
76136
|
displayName: "Gatsby",
|
|
76435
76137
|
path: "templates/gatsby/pages",
|
|
76436
|
-
generate:
|
|
76138
|
+
generate: generate9,
|
|
76437
76139
|
transformPackageJson: async () => ({
|
|
76438
76140
|
scripts: {
|
|
76439
|
-
deploy: `${
|
|
76440
|
-
preview: `${
|
|
76141
|
+
deploy: `${npm7} run build && wrangler pages deploy ./public`,
|
|
76142
|
+
preview: `${npm7} run build && wrangler pages dev ./public`
|
|
76441
76143
|
}
|
|
76442
76144
|
}),
|
|
76443
76145
|
devScript: "develop",
|
|
76444
76146
|
deployScript: "deploy",
|
|
76445
76147
|
previewScript: "preview"
|
|
76446
76148
|
};
|
|
76447
|
-
var
|
|
76149
|
+
var c3_default13 = config13;
|
|
76448
76150
|
|
|
76449
76151
|
// templates/gatsby/workers/c3.ts
|
|
76450
|
-
var { npm:
|
|
76451
|
-
var
|
|
76152
|
+
var { npm: npm8 } = detectPackageManager();
|
|
76153
|
+
var generate10 = async (ctx) => {
|
|
76452
76154
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76453
76155
|
const useTemplate = await inputPrompt({
|
|
76454
76156
|
type: "confirm",
|
|
@@ -76467,7 +76169,7 @@ var generate14 = async (ctx) => {
|
|
|
76467
76169
|
}
|
|
76468
76170
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76469
76171
|
};
|
|
76470
|
-
var
|
|
76172
|
+
var config14 = {
|
|
76471
76173
|
configVersion: 1,
|
|
76472
76174
|
id: "gatsby",
|
|
76473
76175
|
frameworkCli: "gatsby",
|
|
@@ -76477,28 +76179,28 @@ var config16 = {
|
|
|
76477
76179
|
path: "./templates"
|
|
76478
76180
|
},
|
|
76479
76181
|
path: "templates/gatsby/workers",
|
|
76480
|
-
generate:
|
|
76182
|
+
generate: generate10,
|
|
76481
76183
|
transformPackageJson: async () => ({
|
|
76482
76184
|
scripts: {
|
|
76483
|
-
deploy: `${
|
|
76484
|
-
preview: `${
|
|
76185
|
+
deploy: `${npm8} run build && wrangler deploy`,
|
|
76186
|
+
preview: `${npm8} run build && wrangler dev`
|
|
76485
76187
|
}
|
|
76486
76188
|
}),
|
|
76487
76189
|
devScript: "develop",
|
|
76488
76190
|
deployScript: "deploy",
|
|
76489
76191
|
previewScript: "preview"
|
|
76490
76192
|
};
|
|
76491
|
-
var
|
|
76193
|
+
var c3_default14 = config14;
|
|
76492
76194
|
|
|
76493
76195
|
// templates/gatsby/c3.ts
|
|
76494
|
-
var
|
|
76196
|
+
var config15 = {
|
|
76495
76197
|
displayName: "Gatsby",
|
|
76496
|
-
platformVariants: { pages:
|
|
76198
|
+
platformVariants: { pages: c3_default13, workers: c3_default14 }
|
|
76497
76199
|
};
|
|
76498
|
-
var
|
|
76200
|
+
var c3_default15 = config15;
|
|
76499
76201
|
|
|
76500
76202
|
// templates/hello-world-assets-only/c3.ts
|
|
76501
|
-
var
|
|
76203
|
+
var config16 = {
|
|
76502
76204
|
configVersion: 1,
|
|
76503
76205
|
id: "hello-world-assets-only",
|
|
76504
76206
|
path: "templates/hello-world-assets-only",
|
|
@@ -76509,10 +76211,10 @@ var config18 = {
|
|
|
76509
76211
|
path: "./templates"
|
|
76510
76212
|
}
|
|
76511
76213
|
};
|
|
76512
|
-
var
|
|
76214
|
+
var c3_default16 = config16;
|
|
76513
76215
|
|
|
76514
76216
|
// templates/hello-world-durable-object-with-assets/c3.ts
|
|
76515
|
-
var
|
|
76217
|
+
var config17 = {
|
|
76516
76218
|
configVersion: 1,
|
|
76517
76219
|
id: "hello-world-durable-object-with-assets",
|
|
76518
76220
|
path: "templates/hello-world-durable-object-with-assets",
|
|
@@ -76530,10 +76232,10 @@ var config19 = {
|
|
|
76530
76232
|
}
|
|
76531
76233
|
}
|
|
76532
76234
|
};
|
|
76533
|
-
var
|
|
76235
|
+
var c3_default17 = config17;
|
|
76534
76236
|
|
|
76535
76237
|
// templates/hello-world-durable-object/c3.ts
|
|
76536
|
-
var
|
|
76238
|
+
var config18 = {
|
|
76537
76239
|
configVersion: 1,
|
|
76538
76240
|
id: "hello-world-durable-object",
|
|
76539
76241
|
displayName: "Worker + Durable Objects",
|
|
@@ -76550,9 +76252,10 @@ var c3_default22 = {
|
|
|
76550
76252
|
}
|
|
76551
76253
|
}
|
|
76552
76254
|
};
|
|
76255
|
+
var c3_default18 = config18;
|
|
76553
76256
|
|
|
76554
76257
|
// templates/hello-world-with-assets/c3.ts
|
|
76555
|
-
var
|
|
76258
|
+
var config19 = {
|
|
76556
76259
|
configVersion: 1,
|
|
76557
76260
|
id: "hello-world-with-assets",
|
|
76558
76261
|
path: "templates/hello-world-with-assets",
|
|
@@ -76573,11 +76276,12 @@ var c3_default23 = {
|
|
|
76573
76276
|
}
|
|
76574
76277
|
}
|
|
76575
76278
|
};
|
|
76279
|
+
var c3_default19 = config19;
|
|
76576
76280
|
|
|
76577
76281
|
// templates/hello-world/c3.ts
|
|
76578
76282
|
var import_promises2 = require("node:fs/promises");
|
|
76579
76283
|
var import_node_path5 = require("node:path");
|
|
76580
|
-
var
|
|
76284
|
+
var c3_default20 = {
|
|
76581
76285
|
configVersion: 1,
|
|
76582
76286
|
id: "hello-world",
|
|
76583
76287
|
displayName: "Worker only",
|
|
@@ -76610,35 +76314,57 @@ var c3_default24 = {
|
|
|
76610
76314
|
}
|
|
76611
76315
|
};
|
|
76612
76316
|
|
|
76613
|
-
// templates/hono/c3.ts
|
|
76614
|
-
var
|
|
76317
|
+
// templates/hono/pages/c3.ts
|
|
76318
|
+
var generate11 = async (ctx) => {
|
|
76615
76319
|
const { name: pm4 } = detectPackageManager();
|
|
76616
76320
|
await runFrameworkGenerator(ctx, [
|
|
76617
76321
|
ctx.project.name,
|
|
76618
76322
|
"--template",
|
|
76619
|
-
"cloudflare-
|
|
76323
|
+
"cloudflare-pages",
|
|
76620
76324
|
"--install",
|
|
76621
76325
|
"--pm",
|
|
76622
76326
|
pm4
|
|
76623
76327
|
]);
|
|
76624
76328
|
logRaw("");
|
|
76625
76329
|
};
|
|
76626
|
-
var
|
|
76627
|
-
|
|
76628
|
-
|
|
76629
|
-
|
|
76630
|
-
|
|
76631
|
-
|
|
76632
|
-
|
|
76633
|
-
|
|
76634
|
-
|
|
76635
|
-
|
|
76636
|
-
|
|
76330
|
+
var config20 = {
|
|
76331
|
+
configVersion: 1,
|
|
76332
|
+
id: "hono",
|
|
76333
|
+
frameworkCli: "create-hono",
|
|
76334
|
+
displayName: "Hono",
|
|
76335
|
+
copyFiles: {
|
|
76336
|
+
path: "./templates"
|
|
76337
|
+
},
|
|
76338
|
+
path: "templates/hono/pages",
|
|
76339
|
+
platform: "pages",
|
|
76340
|
+
hidden: true,
|
|
76341
|
+
generate: generate11,
|
|
76342
|
+
transformPackageJson: async () => ({
|
|
76343
|
+
scripts: {
|
|
76344
|
+
"cf-typegen": "wrangler types --env-interface CloudflareBindings",
|
|
76345
|
+
preview: "vite build && wrangler pages dev"
|
|
76637
76346
|
}
|
|
76638
|
-
})
|
|
76639
|
-
|
|
76347
|
+
}),
|
|
76348
|
+
devScript: "dev",
|
|
76349
|
+
deployScript: "deploy",
|
|
76350
|
+
previewScript: "preview"
|
|
76640
76351
|
};
|
|
76641
|
-
var
|
|
76352
|
+
var c3_default21 = config20;
|
|
76353
|
+
|
|
76354
|
+
// templates/hono/workers/c3.ts
|
|
76355
|
+
var generate12 = async (ctx) => {
|
|
76356
|
+
const { name: pm4 } = detectPackageManager();
|
|
76357
|
+
await runFrameworkGenerator(ctx, [
|
|
76358
|
+
ctx.project.name,
|
|
76359
|
+
"--template",
|
|
76360
|
+
"cloudflare-workers",
|
|
76361
|
+
"--install",
|
|
76362
|
+
"--pm",
|
|
76363
|
+
pm4
|
|
76364
|
+
]);
|
|
76365
|
+
logRaw("");
|
|
76366
|
+
};
|
|
76367
|
+
var config21 = {
|
|
76642
76368
|
configVersion: 1,
|
|
76643
76369
|
id: "hono",
|
|
76644
76370
|
frameworkCli: "create-hono",
|
|
@@ -76647,12 +76373,10 @@ var config20 = {
|
|
|
76647
76373
|
path: "./templates"
|
|
76648
76374
|
},
|
|
76649
76375
|
platform: "workers",
|
|
76650
|
-
|
|
76651
|
-
|
|
76376
|
+
path: "templates/hono/workers",
|
|
76377
|
+
generate: generate12,
|
|
76652
76378
|
transformPackageJson: async () => ({
|
|
76653
76379
|
scripts: {
|
|
76654
|
-
dev: "wrangler dev",
|
|
76655
|
-
deploy: "wrangler deploy --minify",
|
|
76656
76380
|
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
76657
76381
|
}
|
|
76658
76382
|
}),
|
|
@@ -76660,19 +76384,26 @@ var config20 = {
|
|
|
76660
76384
|
deployScript: "deploy",
|
|
76661
76385
|
previewScript: "dev"
|
|
76662
76386
|
};
|
|
76663
|
-
var
|
|
76387
|
+
var c3_default22 = config21;
|
|
76664
76388
|
|
|
76665
|
-
// templates/
|
|
76389
|
+
// templates/hono/c3.ts
|
|
76390
|
+
var config22 = {
|
|
76391
|
+
displayName: "Hono",
|
|
76392
|
+
platformVariants: { pages: c3_default21, workers: c3_default22 }
|
|
76393
|
+
};
|
|
76394
|
+
var c3_default23 = config22;
|
|
76395
|
+
|
|
76396
|
+
// templates/next/pages/c3.ts
|
|
76666
76397
|
var import_path10 = require("path");
|
|
76667
|
-
var { npm:
|
|
76668
|
-
var
|
|
76398
|
+
var { npm: npm9, npx: npx3 } = detectPackageManager();
|
|
76399
|
+
var generate13 = async (ctx) => {
|
|
76669
76400
|
const projectName = ctx.project.name;
|
|
76670
76401
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
76671
76402
|
const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
|
|
76672
76403
|
writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.jsonc"), wranglerConfig);
|
|
76673
76404
|
updateStatus("Created wrangler.jsonc file");
|
|
76674
76405
|
};
|
|
76675
|
-
var
|
|
76406
|
+
var updateNextConfig = (usesTs) => {
|
|
76676
76407
|
const s = spinner();
|
|
76677
76408
|
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
76678
76409
|
s.start(`Updating \`${configFile}\``);
|
|
@@ -76690,7 +76421,7 @@ var updateNextConfig2 = (usesTs) => {
|
|
|
76690
76421
|
writeFile2(configFile, updatedConfigFile);
|
|
76691
76422
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76692
76423
|
};
|
|
76693
|
-
var
|
|
76424
|
+
var configure7 = async (ctx) => {
|
|
76694
76425
|
const projectPath = ctx.project.path;
|
|
76695
76426
|
const path6 = probePaths([
|
|
76696
76427
|
`${projectPath}/pages/api`,
|
|
@@ -76715,7 +76446,7 @@ var configure11 = async (ctx) => {
|
|
|
76715
76446
|
if (installEslintPlugin) {
|
|
76716
76447
|
await writeEslintrc(ctx);
|
|
76717
76448
|
}
|
|
76718
|
-
|
|
76449
|
+
updateNextConfig(usesTs);
|
|
76719
76450
|
copyFile(
|
|
76720
76451
|
(0, import_path10.join)(getTemplatePath(ctx), "README.md"),
|
|
76721
76452
|
(0, import_path10.join)(projectPath, "README.md")
|
|
@@ -76765,14 +76496,16 @@ var addDevDependencies = async (installEslintPlugin) => {
|
|
|
76765
76496
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
76766
76497
|
});
|
|
76767
76498
|
};
|
|
76768
|
-
var
|
|
76499
|
+
var c3_default24 = {
|
|
76769
76500
|
configVersion: 1,
|
|
76770
76501
|
id: "next",
|
|
76771
76502
|
frameworkCli: "create-next-app",
|
|
76772
76503
|
platform: "pages",
|
|
76504
|
+
hidden: true,
|
|
76773
76505
|
displayName: "Next.js",
|
|
76774
|
-
|
|
76775
|
-
|
|
76506
|
+
path: "templates/next/pages",
|
|
76507
|
+
generate: generate13,
|
|
76508
|
+
configure: configure7,
|
|
76776
76509
|
copyFiles: {
|
|
76777
76510
|
async selectVariant(ctx) {
|
|
76778
76511
|
const isApp = probePaths([
|
|
@@ -76803,12 +76536,12 @@ var c3_default26 = {
|
|
|
76803
76536
|
}
|
|
76804
76537
|
},
|
|
76805
76538
|
transformPackageJson: async (_3, ctx) => {
|
|
76806
|
-
const isNpm =
|
|
76807
|
-
const isBun =
|
|
76539
|
+
const isNpm = npm9 === "npm";
|
|
76540
|
+
const isBun = npm9 === "bun";
|
|
76808
76541
|
const isNpmOrBun = isNpm || isBun;
|
|
76809
76542
|
const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
|
|
76810
76543
|
const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
|
|
76811
|
-
const pmCommand = isNpmOrBun ?
|
|
76544
|
+
const pmCommand = isNpmOrBun ? npx3 : npm9;
|
|
76812
76545
|
const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
|
|
76813
76546
|
return {
|
|
76814
76547
|
scripts: {
|
|
@@ -76827,22 +76560,86 @@ var c3_default26 = {
|
|
|
76827
76560
|
compatibilityFlags: ["nodejs_compat"]
|
|
76828
76561
|
};
|
|
76829
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
|
+
|
|
76830
76626
|
// templates/nuxt/pages/c3.ts
|
|
76831
|
-
var
|
|
76832
|
-
var { npm:
|
|
76833
|
-
var
|
|
76627
|
+
var recast6 = __toESM(require_main3());
|
|
76628
|
+
var { npm: npm10, name: pm2 } = detectPackageManager();
|
|
76629
|
+
var generate15 = async (ctx) => {
|
|
76834
76630
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76835
76631
|
await runFrameworkGenerator(ctx, [
|
|
76836
76632
|
"init",
|
|
76837
76633
|
ctx.project.name,
|
|
76838
76634
|
"--packageManager",
|
|
76839
|
-
|
|
76635
|
+
npm10,
|
|
76636
|
+
"--no-install",
|
|
76840
76637
|
gitFlag
|
|
76841
76638
|
]);
|
|
76842
76639
|
writeFile2("./.node-version", "18");
|
|
76843
76640
|
logRaw("");
|
|
76844
76641
|
};
|
|
76845
|
-
var
|
|
76642
|
+
var configure9 = async (ctx) => {
|
|
76846
76643
|
const packages = ["nitro-cloudflare-dev"];
|
|
76847
76644
|
if (pm2 === "pnpm") {
|
|
76848
76645
|
packages.push("h3");
|
|
@@ -76850,7 +76647,7 @@ var configure12 = async (ctx) => {
|
|
|
76850
76647
|
await installPackages(packages, {
|
|
76851
76648
|
dev: true,
|
|
76852
76649
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76853
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76650
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
76854
76651
|
});
|
|
76855
76652
|
updateNuxtConfig();
|
|
76856
76653
|
updateEnvTypes2(ctx);
|
|
@@ -76873,7 +76670,7 @@ var updateNuxtConfig = () => {
|
|
|
76873
76670
|
const s = spinner();
|
|
76874
76671
|
const configFile = "nuxt.config.ts";
|
|
76875
76672
|
s.start(`Updating \`${configFile}\``);
|
|
76876
|
-
const b3 =
|
|
76673
|
+
const b3 = recast6.types.builders;
|
|
76877
76674
|
const presetDef = b3.objectProperty(
|
|
76878
76675
|
b3.identifier("nitro"),
|
|
76879
76676
|
b3.objectExpression([
|
|
@@ -76911,22 +76708,23 @@ var updateNuxtConfig = () => {
|
|
|
76911
76708
|
});
|
|
76912
76709
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76913
76710
|
};
|
|
76914
|
-
var
|
|
76711
|
+
var config24 = {
|
|
76915
76712
|
configVersion: 1,
|
|
76916
76713
|
id: "nuxt",
|
|
76917
76714
|
frameworkCli: "nuxi",
|
|
76918
76715
|
platform: "pages",
|
|
76716
|
+
hidden: true,
|
|
76919
76717
|
displayName: "Nuxt",
|
|
76920
76718
|
copyFiles: {
|
|
76921
76719
|
path: "./templates"
|
|
76922
76720
|
},
|
|
76923
76721
|
path: "templates/nuxt/pages",
|
|
76924
|
-
generate:
|
|
76925
|
-
configure:
|
|
76722
|
+
generate: generate15,
|
|
76723
|
+
configure: configure9,
|
|
76926
76724
|
transformPackageJson: async () => ({
|
|
76927
76725
|
scripts: {
|
|
76928
|
-
deploy: `${
|
|
76929
|
-
preview: `${
|
|
76726
|
+
deploy: `${npm10} run build && wrangler pages deploy`,
|
|
76727
|
+
preview: `${npm10} run build && wrangler pages dev`,
|
|
76930
76728
|
"cf-typegen": `wrangler types`
|
|
76931
76729
|
}
|
|
76932
76730
|
}),
|
|
@@ -76934,24 +76732,25 @@ var config21 = {
|
|
|
76934
76732
|
deployScript: "deploy",
|
|
76935
76733
|
previewScript: "preview"
|
|
76936
76734
|
};
|
|
76937
|
-
var c3_default27 =
|
|
76735
|
+
var c3_default27 = config24;
|
|
76938
76736
|
|
|
76939
76737
|
// templates/nuxt/workers/c3.ts
|
|
76940
|
-
var
|
|
76941
|
-
var { npm:
|
|
76942
|
-
var
|
|
76738
|
+
var recast7 = __toESM(require_main3());
|
|
76739
|
+
var { npm: npm11, name: pm3 } = detectPackageManager();
|
|
76740
|
+
var generate16 = async (ctx) => {
|
|
76943
76741
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76944
76742
|
await runFrameworkGenerator(ctx, [
|
|
76945
76743
|
"init",
|
|
76946
76744
|
ctx.project.name,
|
|
76947
76745
|
"--packageManager",
|
|
76948
|
-
|
|
76746
|
+
npm11,
|
|
76747
|
+
"--no-install",
|
|
76949
76748
|
gitFlag
|
|
76950
76749
|
]);
|
|
76951
76750
|
writeFile2("./.node-version", "18");
|
|
76952
76751
|
logRaw("");
|
|
76953
76752
|
};
|
|
76954
|
-
var
|
|
76753
|
+
var configure10 = async (ctx) => {
|
|
76955
76754
|
const packages = ["nitro-cloudflare-dev", "nitropack"];
|
|
76956
76755
|
if (pm3 === "pnpm") {
|
|
76957
76756
|
packages.push("h3");
|
|
@@ -76959,7 +76758,7 @@ var configure13 = async (ctx) => {
|
|
|
76959
76758
|
await installPackages(packages, {
|
|
76960
76759
|
dev: true,
|
|
76961
76760
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76962
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76761
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
|
|
76963
76762
|
});
|
|
76964
76763
|
updateNuxtConfig2();
|
|
76965
76764
|
updateEnvTypes3(ctx);
|
|
@@ -76982,7 +76781,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76982
76781
|
const s = spinner();
|
|
76983
76782
|
const configFile = "nuxt.config.ts";
|
|
76984
76783
|
s.start(`Updating \`${configFile}\``);
|
|
76985
|
-
const b3 =
|
|
76784
|
+
const b3 = recast7.types.builders;
|
|
76986
76785
|
const presetDef = b3.objectProperty(
|
|
76987
76786
|
b3.identifier("nitro"),
|
|
76988
76787
|
b3.objectExpression([
|
|
@@ -77020,7 +76819,7 @@ var updateNuxtConfig2 = () => {
|
|
|
77020
76819
|
});
|
|
77021
76820
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
77022
76821
|
};
|
|
77023
|
-
var
|
|
76822
|
+
var config25 = {
|
|
77024
76823
|
configVersion: 1,
|
|
77025
76824
|
id: "nuxt",
|
|
77026
76825
|
frameworkCli: "nuxi",
|
|
@@ -77030,12 +76829,12 @@ var config22 = {
|
|
|
77030
76829
|
path: "./templates"
|
|
77031
76830
|
},
|
|
77032
76831
|
path: "templates/nuxt/workers",
|
|
77033
|
-
generate:
|
|
77034
|
-
configure:
|
|
76832
|
+
generate: generate16,
|
|
76833
|
+
configure: configure10,
|
|
77035
76834
|
transformPackageJson: async () => ({
|
|
77036
76835
|
scripts: {
|
|
77037
|
-
deploy: `${
|
|
77038
|
-
preview: `${
|
|
76836
|
+
deploy: `${npm11} run build && wrangler deploy`,
|
|
76837
|
+
preview: `${npm11} run build && wrangler dev`,
|
|
77039
76838
|
"cf-typegen": `wrangler types`
|
|
77040
76839
|
}
|
|
77041
76840
|
}),
|
|
@@ -77043,17 +76842,17 @@ var config22 = {
|
|
|
77043
76842
|
deployScript: "deploy",
|
|
77044
76843
|
previewScript: "preview"
|
|
77045
76844
|
};
|
|
77046
|
-
var c3_default28 =
|
|
76845
|
+
var c3_default28 = config25;
|
|
77047
76846
|
|
|
77048
76847
|
// templates/nuxt/c3.ts
|
|
77049
|
-
var
|
|
76848
|
+
var config26 = {
|
|
77050
76849
|
displayName: "Nuxt",
|
|
77051
76850
|
platformVariants: { pages: c3_default27, workers: c3_default28 }
|
|
77052
76851
|
};
|
|
77053
|
-
var c3_default29 =
|
|
76852
|
+
var c3_default29 = config26;
|
|
77054
76853
|
|
|
77055
76854
|
// templates/openapi/c3.ts
|
|
77056
|
-
var
|
|
76855
|
+
var config27 = {
|
|
77057
76856
|
configVersion: 1,
|
|
77058
76857
|
id: "openapi",
|
|
77059
76858
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -77063,6 +76862,7 @@ var c3_default30 = {
|
|
|
77063
76862
|
path: "./ts"
|
|
77064
76863
|
}
|
|
77065
76864
|
};
|
|
76865
|
+
var c3_default30 = config27;
|
|
77066
76866
|
|
|
77067
76867
|
// templates/pre-existing/c3.ts
|
|
77068
76868
|
var import_promises3 = require("fs/promises");
|
|
@@ -77212,10 +77012,11 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
77212
77012
|
(0, import_path11.join)(ctx.project.path, "wrangler.toml")
|
|
77213
77013
|
);
|
|
77214
77014
|
}
|
|
77215
|
-
var
|
|
77015
|
+
var config28 = {
|
|
77216
77016
|
configVersion: 1,
|
|
77217
77017
|
id: "pre-existing",
|
|
77218
77018
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
77019
|
+
description: "Fetch a Worker initialized from the Cloudflare dashboard.",
|
|
77219
77020
|
platform: "workers",
|
|
77220
77021
|
hidden: true,
|
|
77221
77022
|
copyFiles: {
|
|
@@ -77227,8 +77028,9 @@ var c3_default31 = {
|
|
|
77227
77028
|
copyFiles: copyExistingWorkerFiles
|
|
77228
77029
|
})
|
|
77229
77030
|
};
|
|
77031
|
+
var c3_default31 = config28;
|
|
77230
77032
|
function buildConfigure(params) {
|
|
77231
|
-
return async function
|
|
77033
|
+
return async function configure21(ctx) {
|
|
77232
77034
|
const loginSuccess = await params.login(ctx);
|
|
77233
77035
|
if (!loginSuccess) {
|
|
77234
77036
|
throw new Error("Failed to login to Cloudflare");
|
|
@@ -77240,7 +77042,7 @@ function buildConfigure(params) {
|
|
|
77240
77042
|
}
|
|
77241
77043
|
|
|
77242
77044
|
// templates/queues/c3.ts
|
|
77243
|
-
var
|
|
77045
|
+
var config29 = {
|
|
77244
77046
|
configVersion: 1,
|
|
77245
77047
|
id: "queues",
|
|
77246
77048
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -77267,17 +77069,130 @@ var c3_default32 = {
|
|
|
77267
77069
|
]
|
|
77268
77070
|
}
|
|
77269
77071
|
};
|
|
77072
|
+
var c3_default32 = config29;
|
|
77270
77073
|
|
|
77271
|
-
// templates/qwik/c3.ts
|
|
77272
|
-
var
|
|
77273
|
-
var { npm:
|
|
77274
|
-
var
|
|
77074
|
+
// templates/qwik/pages/c3.ts
|
|
77075
|
+
var recast8 = __toESM(require_main3());
|
|
77076
|
+
var { npm: npm12, npx: npx4, name } = detectPackageManager();
|
|
77077
|
+
var generate17 = async (ctx) => {
|
|
77078
|
+
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
77079
|
+
};
|
|
77080
|
+
var configure11 = async (ctx) => {
|
|
77081
|
+
const cmd = [name === "pnpm" ? npm12 : npx4, "qwik", "add", "cloudflare-pages"];
|
|
77082
|
+
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
77083
|
+
await runCommand(cmd);
|
|
77084
|
+
addBindingsProxy(ctx);
|
|
77085
|
+
populateCloudflareEnv();
|
|
77086
|
+
};
|
|
77087
|
+
var addBindingsProxy = (ctx) => {
|
|
77088
|
+
if (!usesTypescript(ctx)) {
|
|
77089
|
+
return;
|
|
77090
|
+
}
|
|
77091
|
+
const s = spinner();
|
|
77092
|
+
s.start("Updating `vite.config.ts`");
|
|
77093
|
+
const snippets = loadTemplateSnippets(ctx);
|
|
77094
|
+
const b3 = recast8.types.builders;
|
|
77095
|
+
transformFile("vite.config.ts", {
|
|
77096
|
+
// Insert the env declaration after the last import (but before the rest of the body)
|
|
77097
|
+
visitProgram: function(n) {
|
|
77098
|
+
const lastImportIndex = n.node.body.findLastIndex(
|
|
77099
|
+
(t2) => t2.type === "ImportDeclaration"
|
|
77100
|
+
);
|
|
77101
|
+
const lastImport = n.get("body", lastImportIndex);
|
|
77102
|
+
lastImport.insertAfter(...snippets.getPlatformProxyTs);
|
|
77103
|
+
return this.traverse(n);
|
|
77104
|
+
},
|
|
77105
|
+
// Pass the `platform` object from the declaration to the `qwikCity` plugin
|
|
77106
|
+
visitCallExpression: function(n) {
|
|
77107
|
+
const callee = n.node.callee;
|
|
77108
|
+
if (callee.name !== "qwikCity") {
|
|
77109
|
+
return this.traverse(n);
|
|
77110
|
+
}
|
|
77111
|
+
const configArgument = n.node.arguments[0];
|
|
77112
|
+
const platformPropery = b3.objectProperty.from({
|
|
77113
|
+
key: b3.identifier("platform"),
|
|
77114
|
+
value: b3.identifier("platform"),
|
|
77115
|
+
shorthand: true
|
|
77116
|
+
});
|
|
77117
|
+
if (!configArgument) {
|
|
77118
|
+
n.node.arguments = [b3.objectExpression([platformPropery])];
|
|
77119
|
+
return false;
|
|
77120
|
+
}
|
|
77121
|
+
if (configArgument.type !== "ObjectExpression") {
|
|
77122
|
+
throw new Error("Failed to update `vite.config.ts`");
|
|
77123
|
+
}
|
|
77124
|
+
configArgument.properties.push(platformPropery);
|
|
77125
|
+
return false;
|
|
77126
|
+
}
|
|
77127
|
+
});
|
|
77128
|
+
s.stop(`${brandColor("updated")} \`vite.config.ts\``);
|
|
77129
|
+
};
|
|
77130
|
+
var populateCloudflareEnv = () => {
|
|
77131
|
+
const entrypointPath = "src/entry.cloudflare-pages.tsx";
|
|
77132
|
+
const s = spinner();
|
|
77133
|
+
s.start(`Updating \`${entrypointPath}\``);
|
|
77134
|
+
transformFile(entrypointPath, {
|
|
77135
|
+
visitTSInterfaceDeclaration: function(n) {
|
|
77136
|
+
const b3 = recast8.types.builders;
|
|
77137
|
+
const id = n.node.id;
|
|
77138
|
+
if (id.name !== "QwikCityPlatform") {
|
|
77139
|
+
this.traverse(n);
|
|
77140
|
+
}
|
|
77141
|
+
const newBody = [
|
|
77142
|
+
["env", "Env"]
|
|
77143
|
+
// Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
|
|
77144
|
+
// ["cf", "CfProperties"],
|
|
77145
|
+
].map(
|
|
77146
|
+
([varName, type]) => b3.tsPropertySignature(
|
|
77147
|
+
b3.identifier(varName),
|
|
77148
|
+
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
|
|
77149
|
+
)
|
|
77150
|
+
);
|
|
77151
|
+
n.node.body.body = newBody;
|
|
77152
|
+
return false;
|
|
77153
|
+
}
|
|
77154
|
+
});
|
|
77155
|
+
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77156
|
+
};
|
|
77157
|
+
var config30 = {
|
|
77158
|
+
configVersion: 1,
|
|
77159
|
+
id: "qwik",
|
|
77160
|
+
frameworkCli: "create-qwik",
|
|
77161
|
+
displayName: "Qwik",
|
|
77162
|
+
platform: "pages",
|
|
77163
|
+
hidden: true,
|
|
77164
|
+
copyFiles: {
|
|
77165
|
+
path: "./templates"
|
|
77166
|
+
},
|
|
77167
|
+
path: "templates/qwik/pages",
|
|
77168
|
+
generate: generate17,
|
|
77169
|
+
configure: configure11,
|
|
77170
|
+
transformPackageJson: async () => ({
|
|
77171
|
+
scripts: {
|
|
77172
|
+
deploy: `${npm12} run build && wrangler pages deploy`,
|
|
77173
|
+
preview: `${npm12} run build && wrangler pages dev`,
|
|
77174
|
+
"cf-typegen": `wrangler types`
|
|
77175
|
+
}
|
|
77176
|
+
}),
|
|
77177
|
+
devScript: "dev",
|
|
77178
|
+
deployScript: "deploy",
|
|
77179
|
+
previewScript: "preview"
|
|
77180
|
+
};
|
|
77181
|
+
var c3_default33 = config30;
|
|
77182
|
+
|
|
77183
|
+
// templates/qwik/workers/c3.ts
|
|
77184
|
+
var recast9 = __toESM(require_main3());
|
|
77185
|
+
var { npm: npm13, npx: npx5, name: name2 } = detectPackageManager();
|
|
77186
|
+
var generate18 = async (ctx) => {
|
|
77275
77187
|
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
77276
77188
|
};
|
|
77277
|
-
var
|
|
77278
|
-
const cmd = [name2 === "pnpm" ?
|
|
77189
|
+
var configure12 = async (ctx) => {
|
|
77190
|
+
const cmd = [name2 === "pnpm" ? npm13 : npx5, "qwik", "add", "cloudflare-pages"];
|
|
77279
77191
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
77280
77192
|
await runCommand(cmd);
|
|
77193
|
+
removeFile("./public/_headers");
|
|
77194
|
+
removeFile("./public/_redirects");
|
|
77195
|
+
removeFile("./public/_routes.json");
|
|
77281
77196
|
addBindingsProxy2(ctx);
|
|
77282
77197
|
populateCloudflareEnv2();
|
|
77283
77198
|
};
|
|
@@ -77288,7 +77203,7 @@ var addBindingsProxy2 = (ctx) => {
|
|
|
77288
77203
|
const s = spinner();
|
|
77289
77204
|
s.start("Updating `vite.config.ts`");
|
|
77290
77205
|
const snippets = loadTemplateSnippets(ctx);
|
|
77291
|
-
const b3 =
|
|
77206
|
+
const b3 = recast9.types.builders;
|
|
77292
77207
|
transformFile("vite.config.ts", {
|
|
77293
77208
|
// Insert the env declaration after the last import (but before the rest of the body)
|
|
77294
77209
|
visitProgram: function(n) {
|
|
@@ -77316,7 +77231,7 @@ var addBindingsProxy2 = (ctx) => {
|
|
|
77316
77231
|
return false;
|
|
77317
77232
|
}
|
|
77318
77233
|
if (configArgument.type !== "ObjectExpression") {
|
|
77319
|
-
|
|
77234
|
+
crash("Failed to update `vite.config.ts`");
|
|
77320
77235
|
}
|
|
77321
77236
|
configArgument.properties.push(platformPropery);
|
|
77322
77237
|
return false;
|
|
@@ -77330,7 +77245,7 @@ var populateCloudflareEnv2 = () => {
|
|
|
77330
77245
|
s.start(`Updating \`${entrypointPath}\``);
|
|
77331
77246
|
transformFile(entrypointPath, {
|
|
77332
77247
|
visitTSInterfaceDeclaration: function(n) {
|
|
77333
|
-
const b3 =
|
|
77248
|
+
const b3 = recast9.types.builders;
|
|
77334
77249
|
const id = n.node.id;
|
|
77335
77250
|
if (id.name !== "QwikCityPlatform") {
|
|
77336
77251
|
this.traverse(n);
|
|
@@ -77351,21 +77266,66 @@ var populateCloudflareEnv2 = () => {
|
|
|
77351
77266
|
});
|
|
77352
77267
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77353
77268
|
};
|
|
77354
|
-
var
|
|
77269
|
+
var config31 = {
|
|
77355
77270
|
configVersion: 1,
|
|
77356
77271
|
id: "qwik",
|
|
77357
77272
|
frameworkCli: "create-qwik",
|
|
77358
77273
|
displayName: "Qwik",
|
|
77359
|
-
platform: "
|
|
77274
|
+
platform: "workers",
|
|
77275
|
+
copyFiles: {
|
|
77276
|
+
path: "./templates"
|
|
77277
|
+
},
|
|
77278
|
+
path: "templates/qwik/workers",
|
|
77279
|
+
generate: generate18,
|
|
77280
|
+
configure: configure12,
|
|
77281
|
+
transformPackageJson: async () => ({
|
|
77282
|
+
scripts: {
|
|
77283
|
+
deploy: `${npm13} run build && wrangler deploy`,
|
|
77284
|
+
preview: `${npm13} run build && wrangler dev`,
|
|
77285
|
+
"cf-typegen": `wrangler types`
|
|
77286
|
+
}
|
|
77287
|
+
}),
|
|
77288
|
+
devScript: "dev",
|
|
77289
|
+
deployScript: "deploy",
|
|
77290
|
+
previewScript: "preview"
|
|
77291
|
+
};
|
|
77292
|
+
var c3_default34 = config31;
|
|
77293
|
+
|
|
77294
|
+
// templates/qwik/c3.ts
|
|
77295
|
+
var config32 = {
|
|
77296
|
+
displayName: "Qwik",
|
|
77297
|
+
platformVariants: { pages: c3_default33, workers: c3_default34 }
|
|
77298
|
+
};
|
|
77299
|
+
var c3_default35 = config32;
|
|
77300
|
+
|
|
77301
|
+
// templates/react-router/c3.ts
|
|
77302
|
+
var { npm: npm14 } = detectPackageManager();
|
|
77303
|
+
var generate19 = async (ctx) => {
|
|
77304
|
+
await runFrameworkGenerator(ctx, [
|
|
77305
|
+
ctx.project.name,
|
|
77306
|
+
"--template",
|
|
77307
|
+
"https://github.com/remix-run/react-router-templates/tree/main/cloudflare",
|
|
77308
|
+
// to prevent asking about git twice, just let c3 do it
|
|
77309
|
+
"--no-git-init",
|
|
77310
|
+
"--no-install"
|
|
77311
|
+
]);
|
|
77312
|
+
logRaw("");
|
|
77313
|
+
};
|
|
77314
|
+
var config33 = {
|
|
77315
|
+
configVersion: 1,
|
|
77316
|
+
id: "react-router",
|
|
77317
|
+
platform: "workers",
|
|
77318
|
+
frameworkCli: "create-react-router",
|
|
77319
|
+
displayName: "React Router (formerly Remix)",
|
|
77360
77320
|
copyFiles: {
|
|
77361
77321
|
path: "./templates"
|
|
77362
77322
|
},
|
|
77363
77323
|
generate: generate19,
|
|
77364
|
-
configure
|
|
77324
|
+
// configure,
|
|
77365
77325
|
transformPackageJson: async () => ({
|
|
77366
77326
|
scripts: {
|
|
77367
|
-
deploy: `${npm14} run build && wrangler
|
|
77368
|
-
preview: `${npm14} run build &&
|
|
77327
|
+
deploy: `${npm14} run build && wrangler deploy`,
|
|
77328
|
+
preview: `${npm14} run build && vite preview`,
|
|
77369
77329
|
"cf-typegen": `wrangler types`
|
|
77370
77330
|
}
|
|
77371
77331
|
}),
|
|
@@ -77373,7 +77333,7 @@ var config24 = {
|
|
|
77373
77333
|
deployScript: "deploy",
|
|
77374
77334
|
previewScript: "preview"
|
|
77375
77335
|
};
|
|
77376
|
-
var
|
|
77336
|
+
var c3_default36 = config33;
|
|
77377
77337
|
|
|
77378
77338
|
// templates/react/pages/c3.ts
|
|
77379
77339
|
var { npm: npm15 } = detectPackageManager();
|
|
@@ -77406,13 +77366,14 @@ var variantsOptions = [
|
|
|
77406
77366
|
label: "JavaScript + SWC"
|
|
77407
77367
|
}
|
|
77408
77368
|
];
|
|
77409
|
-
var
|
|
77369
|
+
var config34 = {
|
|
77410
77370
|
configVersion: 1,
|
|
77411
77371
|
id: "react",
|
|
77412
77372
|
// React's documentation now recommends using create-vite.
|
|
77413
77373
|
frameworkCli: "create-vite",
|
|
77414
77374
|
displayName: "React",
|
|
77415
77375
|
platform: "pages",
|
|
77376
|
+
hidden: true,
|
|
77416
77377
|
path: "templates/react/pages",
|
|
77417
77378
|
generate: generate20,
|
|
77418
77379
|
transformPackageJson: async () => ({
|
|
@@ -77425,13 +77386,13 @@ var config25 = {
|
|
|
77425
77386
|
deployScript: "deploy",
|
|
77426
77387
|
previewScript: "preview"
|
|
77427
77388
|
};
|
|
77428
|
-
var
|
|
77389
|
+
var c3_default37 = config34;
|
|
77429
77390
|
|
|
77430
77391
|
// templates/react/workers/c3.ts
|
|
77431
77392
|
var import_assert2 = __toESM(require("assert"));
|
|
77432
|
-
var
|
|
77433
|
-
var b2 =
|
|
77434
|
-
var t =
|
|
77393
|
+
var recast10 = __toESM(require_main3());
|
|
77394
|
+
var b2 = recast10.types.builders;
|
|
77395
|
+
var t = recast10.types.namedTypes;
|
|
77435
77396
|
var { npm: npm16 } = detectPackageManager();
|
|
77436
77397
|
var generate21 = async (ctx) => {
|
|
77437
77398
|
const variant = await getVariant();
|
|
@@ -77443,7 +77404,7 @@ var generate21 = async (ctx) => {
|
|
|
77443
77404
|
]);
|
|
77444
77405
|
logRaw("");
|
|
77445
77406
|
};
|
|
77446
|
-
var
|
|
77407
|
+
var configure13 = async (ctx) => {
|
|
77447
77408
|
await installPackages(["@cloudflare/vite-plugin"], {
|
|
77448
77409
|
dev: true,
|
|
77449
77410
|
startText: "Installing the Cloudflare Vite plugin",
|
|
@@ -77474,9 +77435,9 @@ function transformViteConfig(ctx) {
|
|
|
77474
77435
|
if (callee.name !== "defineConfig") {
|
|
77475
77436
|
return this.traverse(n);
|
|
77476
77437
|
}
|
|
77477
|
-
const
|
|
77478
|
-
(0, import_assert2.default)(t.ObjectExpression.check(
|
|
77479
|
-
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));
|
|
77480
77441
|
(0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
77481
77442
|
pluginsProp.value.elements.push(
|
|
77482
77443
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -77533,7 +77494,7 @@ async function getVariant() {
|
|
|
77533
77494
|
(0, import_assert2.default)(selected, "Expected a variant to be selected");
|
|
77534
77495
|
return selected;
|
|
77535
77496
|
}
|
|
77536
|
-
var
|
|
77497
|
+
var config35 = {
|
|
77537
77498
|
configVersion: 1,
|
|
77538
77499
|
id: "react",
|
|
77539
77500
|
frameworkCli: "create-vite",
|
|
@@ -77551,7 +77512,7 @@ var config26 = {
|
|
|
77551
77512
|
}
|
|
77552
77513
|
},
|
|
77553
77514
|
generate: generate21,
|
|
77554
|
-
configure:
|
|
77515
|
+
configure: configure13,
|
|
77555
77516
|
transformPackageJson: async (_3, ctx) => ({
|
|
77556
77517
|
scripts: {
|
|
77557
77518
|
deploy: `${npm16} run build && wrangler deploy`,
|
|
@@ -77563,14 +77524,14 @@ var config26 = {
|
|
|
77563
77524
|
deployScript: "deploy",
|
|
77564
77525
|
previewScript: "preview"
|
|
77565
77526
|
};
|
|
77566
|
-
var
|
|
77527
|
+
var c3_default38 = config35;
|
|
77567
77528
|
|
|
77568
77529
|
// templates/react/c3.ts
|
|
77569
|
-
var
|
|
77530
|
+
var config36 = {
|
|
77570
77531
|
displayName: "React",
|
|
77571
|
-
platformVariants: { pages:
|
|
77532
|
+
platformVariants: { pages: c3_default37, workers: c3_default38 }
|
|
77572
77533
|
};
|
|
77573
|
-
var
|
|
77534
|
+
var c3_default39 = config36;
|
|
77574
77535
|
|
|
77575
77536
|
// templates/remix/pages/c3.ts
|
|
77576
77537
|
var { npm: npm17 } = detectPackageManager();
|
|
@@ -77582,7 +77543,7 @@ var generate22 = async (ctx) => {
|
|
|
77582
77543
|
]);
|
|
77583
77544
|
logRaw("");
|
|
77584
77545
|
};
|
|
77585
|
-
var
|
|
77546
|
+
var configure14 = async () => {
|
|
77586
77547
|
const typeDefsPath = "load-context.ts";
|
|
77587
77548
|
const s = spinner();
|
|
77588
77549
|
s.start(`Updating \`${typeDefsPath}\``);
|
|
@@ -77597,18 +77558,19 @@ var configure16 = async () => {
|
|
|
77597
77558
|
});
|
|
77598
77559
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
77599
77560
|
};
|
|
77600
|
-
var
|
|
77561
|
+
var config37 = {
|
|
77601
77562
|
configVersion: 1,
|
|
77602
77563
|
id: "remix",
|
|
77603
77564
|
frameworkCli: "create-remix",
|
|
77604
77565
|
platform: "pages",
|
|
77566
|
+
hidden: true,
|
|
77605
77567
|
displayName: "Remix",
|
|
77606
77568
|
copyFiles: {
|
|
77607
77569
|
path: "./templates"
|
|
77608
77570
|
},
|
|
77609
77571
|
path: "templates/remix/pages",
|
|
77610
77572
|
generate: generate22,
|
|
77611
|
-
configure:
|
|
77573
|
+
configure: configure14,
|
|
77612
77574
|
transformPackageJson: async () => ({
|
|
77613
77575
|
scripts: {
|
|
77614
77576
|
deploy: `${npm17} run build && wrangler pages deploy`,
|
|
@@ -77620,7 +77582,7 @@ var config28 = {
|
|
|
77620
77582
|
deployScript: "deploy",
|
|
77621
77583
|
previewScript: "preview"
|
|
77622
77584
|
};
|
|
77623
|
-
var
|
|
77585
|
+
var c3_default40 = config37;
|
|
77624
77586
|
|
|
77625
77587
|
// templates/remix/workers/c3.ts
|
|
77626
77588
|
var { npm: npm18 } = detectPackageManager();
|
|
@@ -77632,14 +77594,14 @@ var generate23 = async (ctx) => {
|
|
|
77632
77594
|
]);
|
|
77633
77595
|
logRaw("");
|
|
77634
77596
|
};
|
|
77635
|
-
var
|
|
77597
|
+
var configure15 = async () => {
|
|
77636
77598
|
await installPackages(["wrangler@latest"], {
|
|
77637
77599
|
dev: true,
|
|
77638
77600
|
startText: "Updating the Wrangler version",
|
|
77639
77601
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
77640
77602
|
});
|
|
77641
77603
|
};
|
|
77642
|
-
var
|
|
77604
|
+
var config38 = {
|
|
77643
77605
|
configVersion: 1,
|
|
77644
77606
|
id: "remix",
|
|
77645
77607
|
frameworkCli: "create-remix",
|
|
@@ -77650,7 +77612,7 @@ var config29 = {
|
|
|
77650
77612
|
},
|
|
77651
77613
|
path: "templates/remix/workers",
|
|
77652
77614
|
generate: generate23,
|
|
77653
|
-
configure:
|
|
77615
|
+
configure: configure15,
|
|
77654
77616
|
transformPackageJson: async () => ({
|
|
77655
77617
|
scripts: {
|
|
77656
77618
|
deploy: `${npm18} run build && wrangler deploy`,
|
|
@@ -77662,17 +77624,18 @@ var config29 = {
|
|
|
77662
77624
|
deployScript: "deploy",
|
|
77663
77625
|
previewScript: "preview"
|
|
77664
77626
|
};
|
|
77665
|
-
var
|
|
77627
|
+
var c3_default41 = config38;
|
|
77666
77628
|
|
|
77667
77629
|
// templates/remix/c3.ts
|
|
77668
|
-
var
|
|
77630
|
+
var config39 = {
|
|
77669
77631
|
displayName: "Remix",
|
|
77670
|
-
platformVariants: { pages:
|
|
77632
|
+
platformVariants: { pages: c3_default40, workers: c3_default41 },
|
|
77633
|
+
hidden: true
|
|
77671
77634
|
};
|
|
77672
|
-
var
|
|
77635
|
+
var c3_default42 = config39;
|
|
77673
77636
|
|
|
77674
77637
|
// templates/scheduled/c3.ts
|
|
77675
|
-
var
|
|
77638
|
+
var config40 = {
|
|
77676
77639
|
configVersion: 1,
|
|
77677
77640
|
id: "scheduled",
|
|
77678
77641
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -77689,15 +77652,16 @@ var c3_default40 = {
|
|
|
77689
77652
|
}
|
|
77690
77653
|
}
|
|
77691
77654
|
};
|
|
77655
|
+
var c3_default43 = config40;
|
|
77692
77656
|
|
|
77693
77657
|
// templates/solid/c3.ts
|
|
77694
|
-
var
|
|
77658
|
+
var recast11 = __toESM(require_main3());
|
|
77695
77659
|
var { npm: npm19 } = detectPackageManager();
|
|
77696
77660
|
var generate24 = async (ctx) => {
|
|
77697
77661
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
77698
77662
|
logRaw("");
|
|
77699
77663
|
};
|
|
77700
|
-
var
|
|
77664
|
+
var configure16 = async (ctx) => {
|
|
77701
77665
|
usesTypescript(ctx);
|
|
77702
77666
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
77703
77667
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
@@ -77707,7 +77671,7 @@ var configure18 = async (ctx) => {
|
|
|
77707
77671
|
if (callee.name !== "defineConfig") {
|
|
77708
77672
|
return this.traverse(n);
|
|
77709
77673
|
}
|
|
77710
|
-
const b3 =
|
|
77674
|
+
const b3 = recast11.types.builders;
|
|
77711
77675
|
mergeObjectProperties(
|
|
77712
77676
|
n.node.arguments[0],
|
|
77713
77677
|
[
|
|
@@ -77735,7 +77699,7 @@ var configure18 = async (ctx) => {
|
|
|
77735
77699
|
}
|
|
77736
77700
|
});
|
|
77737
77701
|
};
|
|
77738
|
-
var
|
|
77702
|
+
var config41 = {
|
|
77739
77703
|
configVersion: 1,
|
|
77740
77704
|
id: "solid",
|
|
77741
77705
|
frameworkCli: "create-solid",
|
|
@@ -77745,7 +77709,7 @@ var config31 = {
|
|
|
77745
77709
|
path: "./templates"
|
|
77746
77710
|
},
|
|
77747
77711
|
generate: generate24,
|
|
77748
|
-
configure:
|
|
77712
|
+
configure: configure16,
|
|
77749
77713
|
transformPackageJson: async () => ({
|
|
77750
77714
|
scripts: {
|
|
77751
77715
|
preview: `${npm19} run build && npx wrangler pages dev`,
|
|
@@ -77757,29 +77721,29 @@ var config31 = {
|
|
|
77757
77721
|
deployScript: "deploy",
|
|
77758
77722
|
previewScript: "preview"
|
|
77759
77723
|
};
|
|
77760
|
-
var
|
|
77724
|
+
var c3_default44 = config41;
|
|
77761
77725
|
|
|
77762
|
-
// templates/svelte/c3.ts
|
|
77726
|
+
// templates/svelte/pages/c3.ts
|
|
77763
77727
|
var import_node_fs3 = require("node:fs");
|
|
77764
|
-
var
|
|
77765
|
-
var
|
|
77728
|
+
var import_node_os3 = require("node:os");
|
|
77729
|
+
var recast12 = __toESM(require_main3());
|
|
77766
77730
|
var { npm: npm20 } = detectPackageManager();
|
|
77767
77731
|
var generate25 = async (ctx) => {
|
|
77768
77732
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77769
77733
|
logRaw("");
|
|
77770
77734
|
};
|
|
77771
|
-
var
|
|
77735
|
+
var configure17 = async (ctx) => {
|
|
77772
77736
|
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
77773
77737
|
await installPackages([pkg], {
|
|
77774
77738
|
dev: true,
|
|
77775
77739
|
startText: "Adding the Cloudflare Pages adapter",
|
|
77776
77740
|
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
77777
77741
|
});
|
|
77778
|
-
|
|
77742
|
+
updateSvelteConfig();
|
|
77779
77743
|
updatePlaywrightConfig(usesTypescript(ctx));
|
|
77780
|
-
|
|
77744
|
+
updateTypeDefinitions(ctx);
|
|
77781
77745
|
};
|
|
77782
|
-
var
|
|
77746
|
+
var updateSvelteConfig = () => {
|
|
77783
77747
|
updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
|
|
77784
77748
|
transformFile("svelte.config.js", {
|
|
77785
77749
|
visitImportDeclaration: function(n) {
|
|
@@ -77813,12 +77777,12 @@ var updatePlaywrightConfig = (shouldUseTypescript) => {
|
|
|
77813
77777
|
}
|
|
77814
77778
|
});
|
|
77815
77779
|
};
|
|
77816
|
-
var
|
|
77780
|
+
var updateTypeDefinitions = (ctx) => {
|
|
77817
77781
|
if (!usesTypescript(ctx)) {
|
|
77818
77782
|
return;
|
|
77819
77783
|
}
|
|
77820
77784
|
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
77821
|
-
const b3 =
|
|
77785
|
+
const b3 = recast12.types.builders;
|
|
77822
77786
|
transformFile("src/app.d.ts", {
|
|
77823
77787
|
visitTSModuleDeclaration(n) {
|
|
77824
77788
|
if (n.value.id.name === "App" && n.node.body) {
|
|
@@ -77850,24 +77814,26 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
77850
77814
|
}
|
|
77851
77815
|
});
|
|
77852
77816
|
};
|
|
77853
|
-
var
|
|
77817
|
+
var config42 = {
|
|
77854
77818
|
configVersion: 1,
|
|
77855
77819
|
id: "svelte",
|
|
77856
77820
|
frameworkCli: "sv",
|
|
77857
77821
|
displayName: "SvelteKit",
|
|
77858
77822
|
platform: "pages",
|
|
77823
|
+
hidden: true,
|
|
77859
77824
|
copyFiles: {
|
|
77860
77825
|
path: "./templates"
|
|
77861
77826
|
},
|
|
77827
|
+
path: "templates/svelte/pages",
|
|
77862
77828
|
generate: generate25,
|
|
77863
|
-
configure:
|
|
77829
|
+
configure: configure17,
|
|
77864
77830
|
transformPackageJson: async (original, ctx) => {
|
|
77865
77831
|
let scripts = {
|
|
77866
77832
|
preview: `${npm20} run build && wrangler pages dev`,
|
|
77867
77833
|
deploy: `${npm20} run build && wrangler pages deploy`
|
|
77868
77834
|
};
|
|
77869
77835
|
if (usesTypescript(ctx)) {
|
|
77870
|
-
const mv = (0,
|
|
77836
|
+
const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
|
|
77871
77837
|
scripts = {
|
|
77872
77838
|
...scripts,
|
|
77873
77839
|
"cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
|
|
@@ -77879,36 +77845,143 @@ var config32 = {
|
|
|
77879
77845
|
deployScript: "deploy",
|
|
77880
77846
|
previewScript: "preview"
|
|
77881
77847
|
};
|
|
77882
|
-
var
|
|
77848
|
+
var c3_default45 = config42;
|
|
77883
77849
|
|
|
77884
|
-
// templates/
|
|
77850
|
+
// templates/svelte/workers/c3.ts
|
|
77851
|
+
var import_node_os4 = require("node:os");
|
|
77852
|
+
var recast13 = __toESM(require_main3());
|
|
77885
77853
|
var { npm: npm21 } = detectPackageManager();
|
|
77886
77854
|
var generate26 = async (ctx) => {
|
|
77855
|
+
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77856
|
+
logRaw("");
|
|
77857
|
+
};
|
|
77858
|
+
var configure18 = async (ctx) => {
|
|
77859
|
+
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
77860
|
+
await installPackages([pkg], {
|
|
77861
|
+
dev: true,
|
|
77862
|
+
startText: "Adding the Cloudflare adapter",
|
|
77863
|
+
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
77864
|
+
});
|
|
77865
|
+
updateSvelteConfig2();
|
|
77866
|
+
updateTypeDefinitions2(ctx);
|
|
77867
|
+
};
|
|
77868
|
+
var updateSvelteConfig2 = () => {
|
|
77869
|
+
updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
|
|
77870
|
+
transformFile("svelte.config.js", {
|
|
77871
|
+
visitImportDeclaration: function(n) {
|
|
77872
|
+
const importSource = n.value.source;
|
|
77873
|
+
if (importSource.value === "@sveltejs/adapter-auto") {
|
|
77874
|
+
importSource.value = "@sveltejs/adapter-cloudflare";
|
|
77875
|
+
}
|
|
77876
|
+
return false;
|
|
77877
|
+
}
|
|
77878
|
+
});
|
|
77879
|
+
};
|
|
77880
|
+
var updateTypeDefinitions2 = (ctx) => {
|
|
77881
|
+
if (!usesTypescript(ctx)) {
|
|
77882
|
+
return;
|
|
77883
|
+
}
|
|
77884
|
+
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
77885
|
+
const b3 = recast13.types.builders;
|
|
77886
|
+
transformFile("src/app.d.ts", {
|
|
77887
|
+
visitTSModuleDeclaration(n) {
|
|
77888
|
+
if (n.value.id.name === "App" && n.node.body) {
|
|
77889
|
+
const moduleBlock = n.node.body;
|
|
77890
|
+
const platformInterface = b3.tsInterfaceDeclaration(
|
|
77891
|
+
b3.identifier("Platform"),
|
|
77892
|
+
b3.tsInterfaceBody([
|
|
77893
|
+
b3.tsPropertySignature(
|
|
77894
|
+
b3.identifier("env"),
|
|
77895
|
+
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier("Env")))
|
|
77896
|
+
),
|
|
77897
|
+
b3.tsPropertySignature(
|
|
77898
|
+
b3.identifier("cf"),
|
|
77899
|
+
b3.tsTypeAnnotation(
|
|
77900
|
+
b3.tsTypeReference(b3.identifier("CfProperties"))
|
|
77901
|
+
)
|
|
77902
|
+
),
|
|
77903
|
+
b3.tsPropertySignature(
|
|
77904
|
+
b3.identifier("ctx"),
|
|
77905
|
+
b3.tsTypeAnnotation(
|
|
77906
|
+
b3.tsTypeReference(b3.identifier("ExecutionContext"))
|
|
77907
|
+
)
|
|
77908
|
+
)
|
|
77909
|
+
])
|
|
77910
|
+
);
|
|
77911
|
+
moduleBlock.body.unshift(platformInterface);
|
|
77912
|
+
}
|
|
77913
|
+
this.traverse(n);
|
|
77914
|
+
}
|
|
77915
|
+
});
|
|
77916
|
+
};
|
|
77917
|
+
var config43 = {
|
|
77918
|
+
configVersion: 1,
|
|
77919
|
+
id: "svelte",
|
|
77920
|
+
frameworkCli: "sv",
|
|
77921
|
+
displayName: "SvelteKit",
|
|
77922
|
+
platform: "workers",
|
|
77923
|
+
copyFiles: {
|
|
77924
|
+
path: "./templates"
|
|
77925
|
+
},
|
|
77926
|
+
path: "templates/svelte/workers",
|
|
77927
|
+
generate: generate26,
|
|
77928
|
+
configure: configure18,
|
|
77929
|
+
transformPackageJson: async (original, ctx) => {
|
|
77930
|
+
let scripts = {
|
|
77931
|
+
preview: `${npm21} run build && wrangler dev`,
|
|
77932
|
+
deploy: `${npm21} run build && wrangler deploy`
|
|
77933
|
+
};
|
|
77934
|
+
if (usesTypescript(ctx)) {
|
|
77935
|
+
const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
|
|
77936
|
+
scripts = {
|
|
77937
|
+
...scripts,
|
|
77938
|
+
"cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
|
|
77939
|
+
};
|
|
77940
|
+
}
|
|
77941
|
+
return { scripts };
|
|
77942
|
+
},
|
|
77943
|
+
devScript: "dev",
|
|
77944
|
+
deployScript: "deploy",
|
|
77945
|
+
previewScript: "preview"
|
|
77946
|
+
};
|
|
77947
|
+
var c3_default46 = config43;
|
|
77948
|
+
|
|
77949
|
+
// templates/svelte/c3.ts
|
|
77950
|
+
var config44 = {
|
|
77951
|
+
displayName: "SvelteKit",
|
|
77952
|
+
platformVariants: { pages: c3_default45, workers: c3_default46 }
|
|
77953
|
+
};
|
|
77954
|
+
var c3_default47 = config44;
|
|
77955
|
+
|
|
77956
|
+
// templates/vue/pages/c3.ts
|
|
77957
|
+
var { npm: npm22 } = detectPackageManager();
|
|
77958
|
+
var generate27 = async (ctx) => {
|
|
77887
77959
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
77888
77960
|
};
|
|
77889
|
-
var
|
|
77961
|
+
var config45 = {
|
|
77890
77962
|
configVersion: 1,
|
|
77891
77963
|
id: "vue",
|
|
77892
77964
|
frameworkCli: "create-vue",
|
|
77893
77965
|
displayName: "Vue",
|
|
77894
77966
|
platform: "pages",
|
|
77967
|
+
hidden: true,
|
|
77895
77968
|
path: "templates/pages/vue",
|
|
77896
|
-
generate:
|
|
77969
|
+
generate: generate27,
|
|
77897
77970
|
transformPackageJson: async () => ({
|
|
77898
77971
|
scripts: {
|
|
77899
|
-
deploy: `${
|
|
77900
|
-
preview: `${
|
|
77972
|
+
deploy: `${npm22} run build && wrangler pages deploy ./dist`,
|
|
77973
|
+
preview: `${npm22} run build && wrangler pages dev ./dist`
|
|
77901
77974
|
}
|
|
77902
77975
|
}),
|
|
77903
77976
|
devScript: "dev",
|
|
77904
77977
|
deployScript: "deploy",
|
|
77905
77978
|
previewScript: "preview"
|
|
77906
77979
|
};
|
|
77907
|
-
var
|
|
77980
|
+
var c3_default48 = config45;
|
|
77908
77981
|
|
|
77909
77982
|
// templates/vue/workers/c3.ts
|
|
77910
|
-
var { npm:
|
|
77911
|
-
var
|
|
77983
|
+
var { npm: npm23 } = detectPackageManager();
|
|
77984
|
+
var generate28 = async (ctx) => {
|
|
77912
77985
|
const lang = ctx.args.lang ?? await inputPrompt({
|
|
77913
77986
|
type: "select",
|
|
77914
77987
|
question: "Would you like to use TypeScript?",
|
|
@@ -77925,7 +77998,7 @@ var generate27 = async (ctx) => {
|
|
|
77925
77998
|
]);
|
|
77926
77999
|
logRaw("");
|
|
77927
78000
|
};
|
|
77928
|
-
var
|
|
78001
|
+
var configure19 = async (ctx) => {
|
|
77929
78002
|
await installPackages(["@cloudflare/vite-plugin"], {
|
|
77930
78003
|
dev: true,
|
|
77931
78004
|
startText: "Installing the Cloudflare Vite plugin",
|
|
@@ -77946,7 +78019,7 @@ function updateTsconfigJson2() {
|
|
|
77946
78019
|
writeJSON("tsconfig.json", tsconfig);
|
|
77947
78020
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
77948
78021
|
}
|
|
77949
|
-
var
|
|
78022
|
+
var config46 = {
|
|
77950
78023
|
configVersion: 1,
|
|
77951
78024
|
id: "vue",
|
|
77952
78025
|
frameworkCli: "create-vue",
|
|
@@ -77966,12 +78039,12 @@ var config34 = {
|
|
|
77966
78039
|
}
|
|
77967
78040
|
}
|
|
77968
78041
|
},
|
|
77969
|
-
configure:
|
|
77970
|
-
generate:
|
|
78042
|
+
configure: configure19,
|
|
78043
|
+
generate: generate28,
|
|
77971
78044
|
transformPackageJson: async (_3, ctx) => ({
|
|
77972
78045
|
scripts: {
|
|
77973
|
-
deploy: `${
|
|
77974
|
-
preview: `${
|
|
78046
|
+
deploy: `${npm23} run build && wrangler deploy`,
|
|
78047
|
+
preview: `${npm23} run build && wrangler dev`,
|
|
77975
78048
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
77976
78049
|
}
|
|
77977
78050
|
}),
|
|
@@ -77979,20 +78052,20 @@ var config34 = {
|
|
|
77979
78052
|
deployScript: "deploy",
|
|
77980
78053
|
previewScript: "preview"
|
|
77981
78054
|
};
|
|
77982
|
-
var
|
|
78055
|
+
var c3_default49 = config46;
|
|
77983
78056
|
|
|
77984
78057
|
// templates/vue/c3.ts
|
|
77985
|
-
var
|
|
78058
|
+
var config47 = {
|
|
77986
78059
|
displayName: "Vue",
|
|
77987
|
-
platformVariants: { pages:
|
|
78060
|
+
platformVariants: { pages: c3_default48, workers: c3_default49 }
|
|
77988
78061
|
};
|
|
77989
|
-
var
|
|
78062
|
+
var c3_default50 = config47;
|
|
77990
78063
|
|
|
77991
78064
|
// src/git.ts
|
|
77992
78065
|
var import_node_assert = __toESM(require("node:assert"));
|
|
77993
78066
|
|
|
77994
78067
|
// ../wrangler/package.json
|
|
77995
|
-
var version2 = "0.0.0-
|
|
78068
|
+
var version2 = "0.0.0-62df08af3";
|
|
77996
78069
|
|
|
77997
78070
|
// src/git.ts
|
|
77998
78071
|
var offerGit = async (ctx) => {
|
|
@@ -78253,43 +78326,57 @@ var defaultSelectVariant = async (ctx) => {
|
|
|
78253
78326
|
function getFrameworkMap({ experimental = false }) {
|
|
78254
78327
|
if (experimental) {
|
|
78255
78328
|
return {
|
|
78256
|
-
|
|
78257
|
-
next: c3_default2,
|
|
78258
|
-
qwik: c3_default3,
|
|
78259
|
-
solid: c3_default4,
|
|
78260
|
-
svelte: c3_default5
|
|
78329
|
+
solid: c3_default
|
|
78261
78330
|
};
|
|
78262
78331
|
} else {
|
|
78263
78332
|
return {
|
|
78264
|
-
analog:
|
|
78265
|
-
angular:
|
|
78266
|
-
astro:
|
|
78267
|
-
docusaurus:
|
|
78268
|
-
gatsby:
|
|
78269
|
-
hono:
|
|
78333
|
+
analog: c3_default2,
|
|
78334
|
+
angular: c3_default5,
|
|
78335
|
+
astro: c3_default8,
|
|
78336
|
+
docusaurus: c3_default12,
|
|
78337
|
+
gatsby: c3_default15,
|
|
78338
|
+
hono: c3_default23,
|
|
78270
78339
|
next: c3_default26,
|
|
78271
78340
|
nuxt: c3_default29,
|
|
78272
|
-
qwik:
|
|
78273
|
-
react:
|
|
78274
|
-
|
|
78275
|
-
|
|
78276
|
-
|
|
78277
|
-
|
|
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
|
|
78348
|
+
};
|
|
78349
|
+
}
|
|
78350
|
+
}
|
|
78351
|
+
function getOtherTemplateMap({
|
|
78352
|
+
experimental = false
|
|
78353
|
+
}) {
|
|
78354
|
+
if (experimental) {
|
|
78355
|
+
return {};
|
|
78356
|
+
} else {
|
|
78357
|
+
return {
|
|
78358
|
+
common: c3_default9,
|
|
78359
|
+
scheduled: c3_default43,
|
|
78360
|
+
queues: c3_default32,
|
|
78361
|
+
openapi: c3_default30,
|
|
78362
|
+
"pre-existing": c3_default31
|
|
78278
78363
|
};
|
|
78279
78364
|
}
|
|
78280
78365
|
}
|
|
78281
|
-
function
|
|
78366
|
+
function getHelloWorldTemplateMap({
|
|
78367
|
+
experimental = false
|
|
78368
|
+
}) {
|
|
78282
78369
|
if (experimental) {
|
|
78283
78370
|
return {};
|
|
78284
78371
|
} else {
|
|
78285
78372
|
return {
|
|
78286
|
-
"hello-world":
|
|
78287
|
-
"hello-world-assets-only":
|
|
78288
|
-
"hello-world-with-assets":
|
|
78289
|
-
"hello-world-durable-object":
|
|
78290
|
-
"hello-world-durable-object-with-assets":
|
|
78291
|
-
common:
|
|
78292
|
-
scheduled:
|
|
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,
|
|
78293
78380
|
queues: c3_default32,
|
|
78294
78381
|
openapi: c3_default30,
|
|
78295
78382
|
"pre-existing": c3_default31
|
|
@@ -78352,6 +78439,12 @@ var deriveCorrelatedArgs = (args) => {
|
|
|
78352
78439
|
};
|
|
78353
78440
|
var createContext = async (args, prevArgs) => {
|
|
78354
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 });
|
|
78355
78448
|
let linesPrinted = 0;
|
|
78356
78449
|
const goBack = async (from) => {
|
|
78357
78450
|
const currentArgs = { ...args };
|
|
@@ -78398,22 +78491,29 @@ var createContext = async (args, prevArgs) => {
|
|
|
78398
78491
|
validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
|
|
78399
78492
|
format: (val) => `./${val}`
|
|
78400
78493
|
});
|
|
78401
|
-
const categoryOptions = [
|
|
78402
|
-
|
|
78403
|
-
|
|
78494
|
+
const categoryOptions = [];
|
|
78495
|
+
if (Object.keys(helloWorldTemplateMap).length) {
|
|
78496
|
+
categoryOptions.push({
|
|
78497
|
+
label: "Hello World example",
|
|
78404
78498
|
value: "hello-world",
|
|
78405
|
-
description: "Select from
|
|
78406
|
-
}
|
|
78407
|
-
|
|
78499
|
+
description: "Select from barebones examples to get started with Workers"
|
|
78500
|
+
});
|
|
78501
|
+
}
|
|
78502
|
+
if (Object.keys(frameworkMap).length) {
|
|
78503
|
+
categoryOptions.push({
|
|
78408
78504
|
label: "Framework Starter",
|
|
78409
78505
|
value: "web-framework",
|
|
78410
78506
|
description: "Select from the most popular full-stack web frameworks"
|
|
78411
|
-
}
|
|
78412
|
-
|
|
78507
|
+
});
|
|
78508
|
+
}
|
|
78509
|
+
if (Object.keys(otherTemplateMap).length) {
|
|
78510
|
+
categoryOptions.push({
|
|
78413
78511
|
label: "Application Starter",
|
|
78414
78512
|
value: "demo",
|
|
78415
78513
|
description: "Select from a range of starter applications using various Cloudflare products"
|
|
78416
|
-
}
|
|
78514
|
+
});
|
|
78515
|
+
}
|
|
78516
|
+
categoryOptions.push(
|
|
78417
78517
|
{
|
|
78418
78518
|
label: "Template from a GitHub repo",
|
|
78419
78519
|
value: "remote-template",
|
|
@@ -78422,7 +78522,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
78422
78522
|
// This is used only if the type is `pre-existing`
|
|
78423
78523
|
{ label: "Others", value: "others", hidden: true },
|
|
78424
78524
|
backOption
|
|
78425
|
-
|
|
78525
|
+
);
|
|
78426
78526
|
const category = await processArgument(args, "category", {
|
|
78427
78527
|
type: "select",
|
|
78428
78528
|
question: "What would you like to start with?",
|
|
@@ -78436,14 +78536,17 @@ var createContext = async (args, prevArgs) => {
|
|
|
78436
78536
|
}
|
|
78437
78537
|
let template;
|
|
78438
78538
|
if (category === "web-framework") {
|
|
78439
|
-
const
|
|
78440
|
-
|
|
78441
|
-
|
|
78442
|
-
|
|
78443
|
-
|
|
78444
|
-
|
|
78445
|
-
|
|
78446
|
-
|
|
78539
|
+
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
78540
|
+
(acc, [key, config48]) => {
|
|
78541
|
+
if (!config48.hidden || args.framework) {
|
|
78542
|
+
acc.push({
|
|
78543
|
+
label: config48.displayName,
|
|
78544
|
+
value: key
|
|
78545
|
+
});
|
|
78546
|
+
}
|
|
78547
|
+
return acc;
|
|
78548
|
+
},
|
|
78549
|
+
[]
|
|
78447
78550
|
);
|
|
78448
78551
|
const framework = await processArgument(args, "framework", {
|
|
78449
78552
|
type: "select",
|
|
@@ -78461,21 +78564,31 @@ var createContext = async (args, prevArgs) => {
|
|
|
78461
78564
|
throw new Error(`Unsupported framework: ${framework}`);
|
|
78462
78565
|
}
|
|
78463
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
|
+
}
|
|
78464
78573
|
const platform3 = await processArgument(args, "platform", {
|
|
78465
78574
|
type: "select",
|
|
78466
78575
|
label: "platform",
|
|
78467
78576
|
question: "Select your deployment platform",
|
|
78468
78577
|
options: [
|
|
78469
|
-
|
|
78470
|
-
|
|
78471
|
-
|
|
78472
|
-
|
|
78473
|
-
|
|
78474
|
-
|
|
78475
|
-
|
|
78476
|
-
|
|
78477
|
-
|
|
78478
|
-
|
|
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
|
+
] : [],
|
|
78479
78592
|
backOption
|
|
78480
78593
|
],
|
|
78481
78594
|
defaultValue: "workers"
|
|
@@ -78494,18 +78607,14 @@ var createContext = async (args, prevArgs) => {
|
|
|
78494
78607
|
} else if (category === "remote-template") {
|
|
78495
78608
|
template = await processRemoteTemplate(args);
|
|
78496
78609
|
} else {
|
|
78497
|
-
const templateMap =
|
|
78498
|
-
experimental: args.experimental
|
|
78499
|
-
});
|
|
78610
|
+
const templateMap = category === "hello-world" ? helloWorldTemplateMap : otherTemplateMap;
|
|
78500
78611
|
const templateOptions = Object.entries(templateMap).map(
|
|
78501
78612
|
([value, { displayName, description, hidden: hidden2 }]) => {
|
|
78502
|
-
const isHelloWorldExample = value.startsWith("hello-world");
|
|
78503
|
-
const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
|
|
78504
78613
|
return {
|
|
78505
78614
|
value,
|
|
78506
78615
|
label: displayName,
|
|
78507
78616
|
description,
|
|
78508
|
-
hidden: hidden2
|
|
78617
|
+
hidden: hidden2
|
|
78509
78618
|
};
|
|
78510
78619
|
}
|
|
78511
78620
|
);
|
|
@@ -78608,28 +78717,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
78608
78717
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
78609
78718
|
}
|
|
78610
78719
|
const path6 = await downloadRemoteTemplate(src);
|
|
78611
|
-
const
|
|
78612
|
-
validateTemplate(path6,
|
|
78720
|
+
const config48 = inferTemplateConfig(path6);
|
|
78721
|
+
validateTemplate(path6, config48);
|
|
78613
78722
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
78614
78723
|
return {
|
|
78615
78724
|
path: path6,
|
|
78616
|
-
...
|
|
78725
|
+
...config48
|
|
78617
78726
|
};
|
|
78618
78727
|
};
|
|
78619
|
-
var validateTemplate = (path6,
|
|
78620
|
-
if (!
|
|
78728
|
+
var validateTemplate = (path6, config48) => {
|
|
78729
|
+
if (!config48.copyFiles) {
|
|
78621
78730
|
return;
|
|
78622
78731
|
}
|
|
78623
|
-
if (isVariantInfo(
|
|
78624
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
78732
|
+
if (isVariantInfo(config48.copyFiles)) {
|
|
78733
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config48.copyFiles.path), config48);
|
|
78625
78734
|
} else {
|
|
78626
|
-
for (const variant of Object.values(
|
|
78627
|
-
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);
|
|
78628
78737
|
}
|
|
78629
78738
|
}
|
|
78630
78739
|
};
|
|
78631
|
-
var validateTemplateSrcDirectory = (path6,
|
|
78632
|
-
if (
|
|
78740
|
+
var validateTemplateSrcDirectory = (path6, config48) => {
|
|
78741
|
+
if (config48.platform === "workers") {
|
|
78633
78742
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
78634
78743
|
const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
|
|
78635
78744
|
const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -78802,10 +78911,7 @@ var cliDefinition = {
|
|
|
78802
78911
|
values(args) {
|
|
78803
78912
|
const experimental = Boolean(args?.["experimental"]);
|
|
78804
78913
|
if (experimental) {
|
|
78805
|
-
return [
|
|
78806
|
-
{ name: "hello-world", description: "Hello World Starter" },
|
|
78807
|
-
{ name: "web-framework", description: "Framework Starter" }
|
|
78808
|
-
];
|
|
78914
|
+
return [{ name: "web-framework", description: "Framework Starter" }];
|
|
78809
78915
|
} else {
|
|
78810
78916
|
return [
|
|
78811
78917
|
{ name: "hello-world", description: "Hello World Starter" },
|
|
@@ -78831,40 +78937,10 @@ var cliDefinition = {
|
|
|
78831
78937
|
`,
|
|
78832
78938
|
values(args) {
|
|
78833
78939
|
const experimental = Boolean(args?.["experimental"]);
|
|
78834
|
-
|
|
78835
|
-
|
|
78836
|
-
|
|
78837
|
-
|
|
78838
|
-
{
|
|
78839
|
-
name: "hello-world",
|
|
78840
|
-
description: "A basic \u201CHello World\u201D Cloudflare Worker."
|
|
78841
|
-
},
|
|
78842
|
-
{
|
|
78843
|
-
name: "hello-world-durable-object",
|
|
78844
|
-
description: "A basic \u201CHello World\u201D Cloudflare Worker with a Durable Worker."
|
|
78845
|
-
},
|
|
78846
|
-
{
|
|
78847
|
-
name: "common",
|
|
78848
|
-
description: "A Cloudflare Worker which implements a common example of routing/proxying functionalities."
|
|
78849
|
-
},
|
|
78850
|
-
{
|
|
78851
|
-
name: "scheduled",
|
|
78852
|
-
description: "A scheduled Cloudflare Worker (triggered via Cron Triggers)."
|
|
78853
|
-
},
|
|
78854
|
-
{
|
|
78855
|
-
name: "queues",
|
|
78856
|
-
description: "A Cloudflare Worker which is both a consumer and produced of Queues."
|
|
78857
|
-
},
|
|
78858
|
-
{
|
|
78859
|
-
name: "openapi",
|
|
78860
|
-
description: "A Worker implementing an OpenAPI REST endpoint."
|
|
78861
|
-
},
|
|
78862
|
-
{
|
|
78863
|
-
name: "pre-existing",
|
|
78864
|
-
description: "Fetch a Worker initialized from the Cloudflare dashboard."
|
|
78865
|
-
}
|
|
78866
|
-
];
|
|
78867
|
-
}
|
|
78940
|
+
return getNamesAndDescriptions({
|
|
78941
|
+
...getHelloWorldTemplateMap({ experimental }),
|
|
78942
|
+
...getOtherTemplateMap({ experimental })
|
|
78943
|
+
});
|
|
78868
78944
|
}
|
|
78869
78945
|
},
|
|
78870
78946
|
{
|
|
@@ -78879,7 +78955,7 @@ var cliDefinition = {
|
|
|
78879
78955
|
You may specify additional arguments to be passed directly to these underlying tools by adding them after a "--" argument, like so:
|
|
78880
78956
|
|
|
78881
78957
|
npm create cloudflare -- --framework next -- --ts
|
|
78882
|
-
pnpm create
|
|
78958
|
+
pnpm create cloudflare --framework next -- --ts
|
|
78883
78959
|
`,
|
|
78884
78960
|
values: (args) => getNamesAndDescriptions(
|
|
78885
78961
|
getFrameworkMap({
|
|
@@ -78893,12 +78969,12 @@ var cliDefinition = {
|
|
|
78893
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.`,
|
|
78894
78970
|
values: [
|
|
78895
78971
|
{
|
|
78896
|
-
name: "
|
|
78897
|
-
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."
|
|
78898
78974
|
},
|
|
78899
78975
|
{
|
|
78900
|
-
name: "
|
|
78901
|
-
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."
|
|
78902
78978
|
}
|
|
78903
78979
|
],
|
|
78904
78980
|
requiresArg: true
|
|
@@ -80540,20 +80616,20 @@ function applyEdits(text, edits) {
|
|
|
80540
80616
|
var import_fs12 = require("fs");
|
|
80541
80617
|
var import_path14 = require("path");
|
|
80542
80618
|
var import_toml2 = __toESM(require_toml());
|
|
80543
|
-
function ensureNameExists(
|
|
80544
|
-
|
|
80545
|
-
return
|
|
80619
|
+
function ensureNameExists(config48, projectName) {
|
|
80620
|
+
config48["name"] = projectName;
|
|
80621
|
+
return config48;
|
|
80546
80622
|
}
|
|
80547
|
-
async function ensureCompatDateExists(
|
|
80548
|
-
if (typeof
|
|
80623
|
+
async function ensureCompatDateExists(config48) {
|
|
80624
|
+
if (typeof config48["compatibility_date"] === "string") {
|
|
80549
80625
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
|
|
80550
|
-
if (!
|
|
80551
|
-
|
|
80626
|
+
if (!config48["compatibility_date"].match(validCompatDateRe)) {
|
|
80627
|
+
config48["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80552
80628
|
}
|
|
80553
80629
|
} else {
|
|
80554
|
-
|
|
80630
|
+
config48["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80555
80631
|
}
|
|
80556
|
-
return
|
|
80632
|
+
return config48;
|
|
80557
80633
|
}
|
|
80558
80634
|
var updateWranglerConfig = async (ctx) => {
|
|
80559
80635
|
if (wranglerJsonExists(ctx)) {
|
|
@@ -80564,12 +80640,15 @@ var updateWranglerConfig = async (ctx) => {
|
|
|
80564
80640
|
const modified = await ensureCompatDateExists(
|
|
80565
80641
|
ensureNameExists(parsed, ctx.project.name)
|
|
80566
80642
|
);
|
|
80567
|
-
|
|
80643
|
+
let comment = `/**
|
|
80568
80644
|
* For more details on how to configure Wrangler, refer to:
|
|
80569
80645
|
* https://developers.cloudflare.com/workers/wrangler/configuration/
|
|
80570
80646
|
*/
|
|
80571
|
-
{
|
|
80647
|
+
{`;
|
|
80648
|
+
if (!modified["$schema"]) {
|
|
80649
|
+
comment += `
|
|
80572
80650
|
"$schema": "node_modules/wrangler/config-schema.json",`;
|
|
80651
|
+
}
|
|
80573
80652
|
if (!modified["observability"]) {
|
|
80574
80653
|
modified["observability"] = { enabled: true };
|
|
80575
80654
|
}
|
|
@@ -80724,7 +80803,7 @@ var addVscodeConfig = (ctx) => {
|
|
|
80724
80803
|
|
|
80725
80804
|
// src/deploy.ts
|
|
80726
80805
|
var offerToDeploy = async (ctx) => {
|
|
80727
|
-
const { npm:
|
|
80806
|
+
const { npm: npm25 } = detectPackageManager();
|
|
80728
80807
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
80729
80808
|
if (!await isDeployable(ctx)) {
|
|
80730
80809
|
ctx.args.deploy = false;
|
|
@@ -80735,7 +80814,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
80735
80814
|
);
|
|
80736
80815
|
}
|
|
80737
80816
|
const label = `deploy via \`${quoteShellArgs([
|
|
80738
|
-
|
|
80817
|
+
npm25,
|
|
80739
80818
|
"run",
|
|
80740
80819
|
ctx.template.deployScript ?? "deploy"
|
|
80741
80820
|
])}\``;
|
|
@@ -80772,11 +80851,11 @@ var readWranglerConfig = (ctx) => {
|
|
|
80772
80851
|
return import_toml3.default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
|
|
80773
80852
|
};
|
|
80774
80853
|
var runDeploy = async (ctx) => {
|
|
80775
|
-
const { npm:
|
|
80854
|
+
const { npm: npm25, name: pm4 } = detectPackageManager();
|
|
80776
80855
|
if (!ctx.account?.id) {
|
|
80777
80856
|
throw new Error("Failed to read Cloudflare account.");
|
|
80778
80857
|
}
|
|
80779
|
-
const baseDeployCmd = [
|
|
80858
|
+
const baseDeployCmd = [npm25, "run", ctx.template.deployScript ?? "deploy"];
|
|
80780
80859
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
80781
80860
|
const deployCmd = [
|
|
80782
80861
|
...baseDeployCmd,
|
|
@@ -80892,14 +80971,14 @@ var printSummary = (ctx) => {
|
|
|
80892
80971
|
const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
|
|
80893
80972
|
const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
|
|
80894
80973
|
const cdCommand = relativePath ? `cd ${relativePath}` : null;
|
|
80895
|
-
const { npm:
|
|
80974
|
+
const { npm: npm25 } = detectPackageManager();
|
|
80896
80975
|
const devServerCommand = quoteShellArgs([
|
|
80897
|
-
|
|
80976
|
+
npm25,
|
|
80898
80977
|
"run",
|
|
80899
80978
|
ctx.template.devScript ?? "start"
|
|
80900
80979
|
]);
|
|
80901
80980
|
const deployCommand = quoteShellArgs([
|
|
80902
|
-
|
|
80981
|
+
npm25,
|
|
80903
80982
|
"run",
|
|
80904
80983
|
ctx.template.deployScript ?? "deploy"
|
|
80905
80984
|
]);
|
|
@@ -81267,8 +81346,8 @@ var renderValues = (values) => {
|
|
|
81267
81346
|
};
|
|
81268
81347
|
|
|
81269
81348
|
// src/helpers/retry.ts
|
|
81270
|
-
var retry = async (
|
|
81271
|
-
let { times } =
|
|
81349
|
+
var retry = async (config48, fn) => {
|
|
81350
|
+
let { times } = config48;
|
|
81272
81351
|
let error2 = null;
|
|
81273
81352
|
while (times > 0) {
|
|
81274
81353
|
try {
|
|
@@ -81276,10 +81355,10 @@ var retry = async (config36, fn) => {
|
|
|
81276
81355
|
} catch (e) {
|
|
81277
81356
|
error2 = e;
|
|
81278
81357
|
times--;
|
|
81279
|
-
if (
|
|
81358
|
+
if (config48.exitCondition?.(e)) {
|
|
81280
81359
|
break;
|
|
81281
81360
|
}
|
|
81282
|
-
await sleep(
|
|
81361
|
+
await sleep(config48.sleepMs ?? 1e3);
|
|
81283
81362
|
}
|
|
81284
81363
|
}
|
|
81285
81364
|
throw error2;
|
|
@@ -81369,14 +81448,14 @@ var createProject = async (ctx) => {
|
|
|
81369
81448
|
var import_fs13 = require("fs");
|
|
81370
81449
|
var import_path16 = require("path");
|
|
81371
81450
|
async function installWorkersTypes(ctx) {
|
|
81372
|
-
const { npm:
|
|
81451
|
+
const { npm: npm25 } = detectPackageManager();
|
|
81373
81452
|
if (!usesTypescript(ctx)) {
|
|
81374
81453
|
return;
|
|
81375
81454
|
}
|
|
81376
81455
|
await installPackages(["@cloudflare/workers-types"], {
|
|
81377
81456
|
dev: true,
|
|
81378
81457
|
startText: "Installing @cloudflare/workers-types",
|
|
81379
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
81458
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm25}`)}`
|
|
81380
81459
|
});
|
|
81381
81460
|
await addWorkersTypesToTsConfig(ctx);
|
|
81382
81461
|
}
|
|
@@ -81399,8 +81478,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81399
81478
|
}
|
|
81400
81479
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81401
81480
|
try {
|
|
81402
|
-
const
|
|
81403
|
-
const currentTypes =
|
|
81481
|
+
const config48 = parse4(tsconfig);
|
|
81482
|
+
const currentTypes = config48.compilerOptions?.types ?? [];
|
|
81404
81483
|
const explicitEntrypoint = currentTypes.some(
|
|
81405
81484
|
(t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81406
81485
|
);
|
|
@@ -81430,7 +81509,7 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81430
81509
|
}
|
|
81431
81510
|
|
|
81432
81511
|
// src/cli.ts
|
|
81433
|
-
var { npm:
|
|
81512
|
+
var { npm: npm24 } = detectPackageManager();
|
|
81434
81513
|
var main = async (argv) => {
|
|
81435
81514
|
const result = await parseArgs(argv);
|
|
81436
81515
|
if (result.type === "unknown") {
|
|
@@ -81466,16 +81545,16 @@ ${result.errorMessage}`);
|
|
|
81466
81545
|
};
|
|
81467
81546
|
var runLatest = async () => {
|
|
81468
81547
|
const args = process.argv.slice(2);
|
|
81469
|
-
if (
|
|
81548
|
+
if (npm24 === "npm") {
|
|
81470
81549
|
args.unshift("--");
|
|
81471
81550
|
}
|
|
81472
|
-
await runCommand([
|
|
81551
|
+
await runCommand([npm24, "create", "cloudflare@latest", ...args]);
|
|
81473
81552
|
};
|
|
81474
81553
|
var runCli = async (args) => {
|
|
81475
81554
|
printBanner(args);
|
|
81476
81555
|
const ctx = await createContext(args);
|
|
81477
81556
|
await create(ctx);
|
|
81478
|
-
await
|
|
81557
|
+
await configure20(ctx);
|
|
81479
81558
|
await deploy(ctx);
|
|
81480
81559
|
printSummary(ctx);
|
|
81481
81560
|
logRaw("");
|
|
@@ -81503,7 +81582,7 @@ var create = async (ctx) => {
|
|
|
81503
81582
|
await rectifyPmMismatch(ctx);
|
|
81504
81583
|
endSection(`Application created`);
|
|
81505
81584
|
};
|
|
81506
|
-
var
|
|
81585
|
+
var configure20 = async (ctx) => {
|
|
81507
81586
|
startSection("Configuring your application for Cloudflare", "Step 2 of 3");
|
|
81508
81587
|
await installWrangler();
|
|
81509
81588
|
await installWorkersTypes(ctx);
|