create-cloudflare 2.41.2 → 2.42.0
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 +732 -724
- package/package.json +7 -7
- package/templates/astro/c3.ts +5 -93
- package/templates/astro/pages/c3.ts +98 -0
- package/{templates-experimental/astro → templates/astro/workers}/c3.ts +2 -2
- package/templates/astro/workers/templates/js/public/.assetsignore +2 -0
- package/templates/astro/workers/templates/ts/public/.assetsignore +2 -0
- package/templates/hello-world-durable-object/js/src/index.js +10 -9
- package/templates/hello-world-durable-object/js/wrangler.jsonc +1 -1
- package/templates/hello-world-durable-object/ts/src/index.ts +10 -9
- package/templates/hello-world-durable-object/ts/wrangler.jsonc +1 -1
- package/templates/hono/c3.ts +5 -66
- package/templates/hono/pages/c3.ts +42 -0
- package/templates/hono/pages/templates/src/index.tsx +12 -0
- package/templates/hono/{templates → pages/templates}/wrangler.jsonc +2 -1
- package/{templates-experimental/hono → templates/hono/workers}/c3.ts +2 -4
- package/templates/remix/c3.ts +5 -63
- package/templates/remix/pages/c3.ts +68 -0
- package/{templates-experimental/remix → templates/remix/workers}/c3.ts +2 -2
- package/templates/svelte/c3.ts +5 -154
- package/templates/svelte/pages/c3.ts +159 -0
- package/{templates-experimental/svelte → templates/svelte/workers}/c3.ts +3 -3
- package/templates/svelte/workers/templates/static/.assetsignore +2 -0
- package/templates/hono/snippets/appDeclaration.ts +0 -1
- package/templates-experimental/astro/templates/js/public/.assetsignore +0 -4
- package/templates-experimental/astro/templates/ts/public/.assetsignore +0 -4
- package/templates-experimental/svelte/templates/static/.assetsignore +0 -4
- /package/templates/astro/{templates → pages/templates}/js/wrangler.jsonc +0 -0
- /package/{templates-experimental/astro → templates/astro/pages}/templates/ts/src/env.d.ts +0 -0
- /package/{templates-experimental/astro → templates/astro/pages}/templates/ts/worker-configuration.d.ts +0 -0
- /package/templates/astro/{templates → pages/templates}/ts/wrangler.jsonc +0 -0
- /package/{templates-experimental/astro → templates/astro/workers}/templates/js/wrangler.jsonc +0 -0
- /package/templates/astro/{templates → workers/templates}/ts/src/env.d.ts +0 -0
- /package/templates/astro/{templates → workers/templates}/ts/worker-configuration.d.ts +0 -0
- /package/{templates-experimental/astro → templates/astro/workers}/templates/ts/wrangler.jsonc +0 -0
- /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/remix/{templates → pages/templates}/worker-configuration.d.ts +0 -0
- /package/templates/remix/{templates → pages/templates}/wrangler.jsonc +0 -0
- /package/{templates-experimental/remix → templates/remix/workers}/templates/public/.assetsignore +0 -0
- /package/{templates-experimental/remix → templates/remix/workers}/templates/worker-configuration.d.ts +0 -0
- /package/{templates-experimental/remix → templates/remix/workers}/templates/wrangler.toml +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 config38(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 config38 = 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: config38, 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 config38 = 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: config38, 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 config38 = 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: config38, 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 config38 = (0, _lodash["default"])(options, this.config);
|
|
31513
|
+
if (config38.tokenHex === true) {
|
|
31514
|
+
config38.tokenChars = "0123456789abcdef";
|
|
31515
31515
|
}
|
|
31516
31516
|
var adjective = this._randomElement(this.adjectives);
|
|
31517
31517
|
var noun = this._randomElement(this.nouns);
|
|
31518
|
-
if (!
|
|
31518
|
+
if (!config38.tokenLength) config38.tokenLength = 0;
|
|
31519
31519
|
var token = "";
|
|
31520
|
-
for (var i = 0; i <
|
|
31521
|
-
token += this._randomElement(
|
|
31520
|
+
for (var i = 0; i < config38.tokenLength; i++) {
|
|
31521
|
+
token += this._randomElement(config38.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(config38.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, config38) {
|
|
40040
40040
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
40041
|
-
this.errorHandler.tolerant =
|
|
40041
|
+
this.errorHandler.tolerant = config38 ? typeof config38.tolerant === "boolean" && config38.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 = config38 ? typeof config38.comment === "boolean" && config38.comment : false;
|
|
40044
|
+
this.trackRange = config38 ? typeof config38.range === "boolean" && config38.range : false;
|
|
40045
|
+
this.trackLoc = config38 ? typeof config38.loc === "boolean" && config38.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(config38) {
|
|
49807
49807
|
assert_1.default.ok(this instanceof Printer2);
|
|
49808
|
-
var explicitTabWidth =
|
|
49809
|
-
|
|
49810
|
-
|
|
49808
|
+
var explicitTabWidth = config38 && config38.tabWidth;
|
|
49809
|
+
config38 = options_1.normalize(config38);
|
|
49810
|
+
config38.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 = config38.tabWidth;
|
|
49826
49826
|
if (!explicitTabWidth) {
|
|
49827
49827
|
var loc = path6.getNode().loc;
|
|
49828
49828
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
49829
|
-
|
|
49829
|
+
config38.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, config38, options, makePrintFunctionWith(options, {
|
|
49844
49844
|
includeComments: true,
|
|
49845
49845
|
avoidRootParens: false
|
|
49846
49846
|
}));
|
|
49847
|
-
|
|
49847
|
+
config38.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(config38), util.composeSourceMaps(config38.inputSourceMap, lines.getSourceMap(config38.sourceMapName, config38.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, config38, {
|
|
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 = config38.reuseWhitespace;
|
|
49874
|
+
config38.reuseWhitespace = false;
|
|
49875
|
+
var pr = new PrintResult(printGenerically(path6).toString(config38));
|
|
49876
|
+
config38.reuseWhitespace = oldReuseWhitespace;
|
|
49877
49877
|
return pr;
|
|
49878
49878
|
};
|
|
49879
49879
|
};
|
|
49880
49880
|
exports2.Printer = Printer;
|
|
49881
|
-
function genericPrint(path6,
|
|
49881
|
+
function genericPrint(path6, config38, 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, config38, 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 = (config38, value) => {
|
|
69384
|
+
const { question, label } = config38;
|
|
69385
|
+
if (config38.type !== "confirm" && !value) {
|
|
69386
69386
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
69387
69387
|
}
|
|
69388
|
-
const content =
|
|
69388
|
+
const content = config38.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 = (config38) => {
|
|
69392
|
+
switch (config38.type) {
|
|
69393
69393
|
case "select":
|
|
69394
|
-
return getSelectRenderers(
|
|
69394
|
+
return getSelectRenderers(config38);
|
|
69395
69395
|
case "confirm":
|
|
69396
|
-
return getConfirmRenderers(
|
|
69396
|
+
return getConfirmRenderers(config38);
|
|
69397
69397
|
case "text":
|
|
69398
|
-
return getTextRenderers(
|
|
69398
|
+
return getTextRenderers(config38);
|
|
69399
69399
|
case "multiselect":
|
|
69400
|
-
return getSelectRenderers(
|
|
69400
|
+
return getSelectRenderers(config38);
|
|
69401
69401
|
case "list":
|
|
69402
|
-
return getSelectListRenderers(
|
|
69402
|
+
return getSelectListRenderers(config38);
|
|
69403
69403
|
}
|
|
69404
69404
|
};
|
|
69405
|
-
var getTextRenderers = (
|
|
69406
|
-
const { question } =
|
|
69407
|
-
const helpText =
|
|
69408
|
-
const format5 =
|
|
69409
|
-
const defaultValue =
|
|
69405
|
+
var getTextRenderers = (config38) => {
|
|
69406
|
+
const { question } = config38;
|
|
69407
|
+
const helpText = config38.helpText ?? "";
|
|
69408
|
+
const format5 = config38.format ?? ((val) => String(val));
|
|
69409
|
+
const defaultValue = config38.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 = (config34) => {
|
|
|
69429
69429
|
``
|
|
69430
69430
|
// extra line for readability
|
|
69431
69431
|
],
|
|
69432
|
-
submit: ({ value }) => renderSubmit(
|
|
69432
|
+
submit: ({ value }) => renderSubmit(config38, format5(value ?? "")),
|
|
69433
69433
|
cancel: activeRenderer
|
|
69434
69434
|
};
|
|
69435
69435
|
};
|
|
69436
|
-
var getSelectRenderers = (
|
|
69437
|
-
const { options, question, helpText: _helpText } =
|
|
69436
|
+
var getSelectRenderers = (config38) => {
|
|
69437
|
+
const { options, question, helpText: _helpText } = config38;
|
|
69438
69438
|
const helpText = _helpText ?? "";
|
|
69439
|
-
const maxItemsPerPage =
|
|
69439
|
+
const maxItemsPerPage = config38.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
|
+
config38,
|
|
69515
69515
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
69516
69516
|
);
|
|
69517
69517
|
}
|
|
69518
69518
|
return renderSubmit(
|
|
69519
|
-
|
|
69519
|
+
config38,
|
|
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 = (config38) => {
|
|
69527
|
+
const { question, helpText: _helpText } = config38;
|
|
69528
|
+
let options = config38.options;
|
|
69529
69529
|
const helpText = _helpText ?? "";
|
|
69530
69530
|
const { rows } = stdout;
|
|
69531
69531
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -69606,20 +69606,20 @@ var getSelectListRenderers = (config34) => {
|
|
|
69606
69606
|
submit: ({ value }) => {
|
|
69607
69607
|
if (Array.isArray(value)) {
|
|
69608
69608
|
return renderSubmit(
|
|
69609
|
-
|
|
69609
|
+
config38,
|
|
69610
69610
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
69611
69611
|
);
|
|
69612
69612
|
}
|
|
69613
69613
|
return renderSubmit(
|
|
69614
|
-
|
|
69614
|
+
config38,
|
|
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 = (config38) => {
|
|
69622
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config38;
|
|
69623
69623
|
const helpText = _helpText ?? "";
|
|
69624
69624
|
const active = activeText || "Yes";
|
|
69625
69625
|
const inactive = inactiveText || "No";
|
|
@@ -69636,7 +69636,7 @@ var getConfirmRenderers = (config34) => {
|
|
|
69636
69636
|
active: defaultRenderer,
|
|
69637
69637
|
confirm: defaultRenderer,
|
|
69638
69638
|
error: defaultRenderer,
|
|
69639
|
-
submit: ({ value }) => renderSubmit(
|
|
69639
|
+
submit: ({ value }) => renderSubmit(config38, 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 config38 = 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
|
+
config38 = resolveConfig(resolvedConfigPath);
|
|
70613
70613
|
} catch (e) {
|
|
70614
|
-
|
|
70614
|
+
config38 = e;
|
|
70615
70615
|
}
|
|
70616
|
-
if (
|
|
70617
|
-
error2 =
|
|
70616
|
+
if (config38 instanceof Error) {
|
|
70617
|
+
error2 = config38;
|
|
70618
70618
|
return;
|
|
70619
70619
|
}
|
|
70620
70620
|
} else {
|
|
70621
|
-
|
|
70621
|
+
config38 = mixin2.require(resolvedConfigPath);
|
|
70622
70622
|
}
|
|
70623
|
-
setConfigObject(
|
|
70623
|
+
setConfigObject(config38);
|
|
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(config38, prev) {
|
|
70634
|
+
Object.keys(config38).forEach(function(key) {
|
|
70635
|
+
const value = config38[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 config38 = 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: config38
|
|
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(config38, 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(config38, "extends")) {
|
|
73018
|
+
if (typeof config38.extends !== "string")
|
|
73019
73019
|
return defaultConfig;
|
|
73020
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
73020
|
+
const isPath = /\.json|\..*rc$/.test(config38.extends);
|
|
73021
73021
|
let pathToDefault = null;
|
|
73022
73022
|
if (!isPath) {
|
|
73023
73023
|
try {
|
|
73024
|
-
pathToDefault = require.resolve(
|
|
73024
|
+
pathToDefault = require.resolve(config38.extends);
|
|
73025
73025
|
} catch (_err) {
|
|
73026
|
-
return
|
|
73026
|
+
return config38;
|
|
73027
73027
|
}
|
|
73028
73028
|
} else {
|
|
73029
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
73029
|
+
pathToDefault = getPathToDefaultConfig(cwd, config38.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(config38.extends);
|
|
73034
|
+
delete config38.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, config38) : Object.assign({}, defaultConfig, config38);
|
|
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(config38) {
|
|
73815
|
+
argsert("<object>", [config38], arguments.length);
|
|
73816
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config38, "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(config38) {
|
|
73989
|
+
argsert("<object>", [config38], arguments.length);
|
|
73990
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config38, "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 config38 = 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, ...config38 }
|
|
74401
74401
|
}));
|
|
74402
74402
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
74403
74403
|
let argvPromise = void 0;
|
|
@@ -74560,7 +74560,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
74560
74560
|
var yargs_default = Yargs;
|
|
74561
74561
|
|
|
74562
74562
|
// package.json
|
|
74563
|
-
var version = "2.
|
|
74563
|
+
var version = "2.42.0";
|
|
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(config38) {
|
|
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
|
+
config38,
|
|
74613
74613
|
(_key, value) => value instanceof Date ? value.toISOString() : value,
|
|
74614
74614
|
" "
|
|
74615
74615
|
)
|
|
@@ -74617,9 +74617,9 @@ function writeMetricsConfig(config34) {
|
|
|
74617
74617
|
}
|
|
74618
74618
|
function readMetricsConfig() {
|
|
74619
74619
|
try {
|
|
74620
|
-
const
|
|
74620
|
+
const config38 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
74621
74621
|
return JSON.parse(
|
|
74622
|
-
|
|
74622
|
+
config38,
|
|
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(config38) {
|
|
74633
|
+
const deviceId = config38.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
74634
|
+
if (config38.deviceId === void 0) {
|
|
74635
|
+
writeMetricsConfig({ ...config38, deviceId });
|
|
74636
74636
|
}
|
|
74637
74637
|
return deviceId;
|
|
74638
74638
|
}
|
|
@@ -74907,10 +74907,10 @@ function getPlatform() {
|
|
|
74907
74907
|
function createReporter() {
|
|
74908
74908
|
const events = [];
|
|
74909
74909
|
const als = new import_node_async_hooks.AsyncLocalStorage();
|
|
74910
|
-
const
|
|
74911
|
-
const isFirstUsage =
|
|
74910
|
+
const config38 = readMetricsConfig() ?? {};
|
|
74911
|
+
const isFirstUsage = config38.c3permission === void 0;
|
|
74912
74912
|
const isEnabled = isTelemetryEnabled();
|
|
74913
|
-
const deviceId = getDeviceId(
|
|
74913
|
+
const deviceId = getDeviceId(config38);
|
|
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(config38).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(config38 = readMetricsConfig() ?? {}) {
|
|
75053
|
+
if (!config38.c3permission) {
|
|
75054
|
+
config38.c3permission = initializeC3Permission();
|
|
75055
|
+
writeMetricsConfig(config38);
|
|
75056
75056
|
}
|
|
75057
|
-
return
|
|
75057
|
+
return config38.c3permission;
|
|
75058
75058
|
}
|
|
75059
75059
|
function updateC3Pemission(enabled) {
|
|
75060
|
-
const
|
|
75061
|
-
if (
|
|
75060
|
+
const config38 = readMetricsConfig();
|
|
75061
|
+
if (config38.c3permission?.enabled === enabled) {
|
|
75062
75062
|
return;
|
|
75063
75063
|
}
|
|
75064
|
-
|
|
75065
|
-
writeMetricsConfig(
|
|
75064
|
+
config38.c3permission = initializeC3Permission(enabled);
|
|
75065
|
+
writeMetricsConfig(config38);
|
|
75066
75066
|
}
|
|
75067
75067
|
var runTelemetryCommand = (action) => {
|
|
75068
75068
|
const logTelemetryStatus = (enabled) => {
|
|
@@ -75107,24 +75107,24 @@ var import_haikunator = __toESM(require_dist_web());
|
|
|
75107
75107
|
var import_fs6 = require("fs");
|
|
75108
75108
|
var import_path6 = __toESM(require("path"));
|
|
75109
75109
|
var import_undici2 = __toESM(require_undici());
|
|
75110
|
-
var installPackages = async (packages,
|
|
75110
|
+
var installPackages = async (packages, config38 = {}) => {
|
|
75111
75111
|
const { npm: npm24 } = detectPackageManager();
|
|
75112
75112
|
let saveFlag;
|
|
75113
75113
|
let cmd;
|
|
75114
75114
|
switch (npm24) {
|
|
75115
75115
|
case "yarn":
|
|
75116
75116
|
cmd = "add";
|
|
75117
|
-
saveFlag =
|
|
75117
|
+
saveFlag = config38.dev ? "-D" : "";
|
|
75118
75118
|
break;
|
|
75119
75119
|
case "bun":
|
|
75120
75120
|
cmd = "add";
|
|
75121
|
-
saveFlag =
|
|
75121
|
+
saveFlag = config38.dev ? "-d" : "";
|
|
75122
75122
|
break;
|
|
75123
75123
|
case "npm":
|
|
75124
75124
|
case "pnpm":
|
|
75125
75125
|
default:
|
|
75126
75126
|
cmd = "install";
|
|
75127
|
-
saveFlag =
|
|
75127
|
+
saveFlag = config38.dev ? "--save-dev" : "";
|
|
75128
75128
|
break;
|
|
75129
75129
|
}
|
|
75130
75130
|
await runCommand(
|
|
@@ -75139,7 +75139,7 @@ var installPackages = async (packages, config34 = {}) => {
|
|
|
75139
75139
|
...npm24 === "npm" ? ["--legacy-peer-deps"] : []
|
|
75140
75140
|
],
|
|
75141
75141
|
{
|
|
75142
|
-
...
|
|
75142
|
+
...config38,
|
|
75143
75143
|
silent: true
|
|
75144
75144
|
}
|
|
75145
75145
|
);
|
|
@@ -75378,6 +75378,63 @@ var runFrameworkGenerator = async (ctx, args) => {
|
|
|
75378
75378
|
await runCommand(cmd, { env: env3 });
|
|
75379
75379
|
};
|
|
75380
75380
|
|
|
75381
|
+
// templates-experimental/next/c3.ts
|
|
75382
|
+
var generate = async (ctx) => {
|
|
75383
|
+
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
75384
|
+
};
|
|
75385
|
+
var configure = async (ctx) => {
|
|
75386
|
+
const packages = [
|
|
75387
|
+
"@opennextjs/cloudflare@0.5.x",
|
|
75388
|
+
"@cloudflare/workers-types"
|
|
75389
|
+
];
|
|
75390
|
+
await installPackages(packages, {
|
|
75391
|
+
dev: true,
|
|
75392
|
+
startText: "Adding the Cloudflare adapter",
|
|
75393
|
+
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
75394
|
+
});
|
|
75395
|
+
const usesTs = usesTypescript(ctx);
|
|
75396
|
+
updateNextConfig(usesTs);
|
|
75397
|
+
};
|
|
75398
|
+
var updateNextConfig = (usesTs) => {
|
|
75399
|
+
const s = spinner();
|
|
75400
|
+
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
75401
|
+
s.start(`Updating \`${configFile}\``);
|
|
75402
|
+
const configContent = readFile(configFile);
|
|
75403
|
+
const updatedConfigFile = configContent + `
|
|
75404
|
+
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
75405
|
+
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
75406
|
+
initOpenNextCloudflareForDev();
|
|
75407
|
+
`.replace(/\n\t*/g, "\n");
|
|
75408
|
+
writeFile2(configFile, updatedConfigFile);
|
|
75409
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75410
|
+
};
|
|
75411
|
+
var c3_default = {
|
|
75412
|
+
configVersion: 1,
|
|
75413
|
+
id: "next",
|
|
75414
|
+
frameworkCli: "create-next-app",
|
|
75415
|
+
// TODO: Stop using a pinned version when the template graduates.
|
|
75416
|
+
frameworkCliPinnedVersion: "~15.2.2",
|
|
75417
|
+
platform: "workers",
|
|
75418
|
+
displayName: "Next.js (using Node.js compat + Workers Assets)",
|
|
75419
|
+
path: "templates-experimental/next",
|
|
75420
|
+
copyFiles: {
|
|
75421
|
+
path: "./templates"
|
|
75422
|
+
},
|
|
75423
|
+
generate,
|
|
75424
|
+
configure,
|
|
75425
|
+
transformPackageJson: async () => ({
|
|
75426
|
+
scripts: {
|
|
75427
|
+
deploy: `opennextjs-cloudflare && wrangler deploy`,
|
|
75428
|
+
preview: `opennextjs-cloudflare && wrangler dev`,
|
|
75429
|
+
"cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
|
|
75430
|
+
}
|
|
75431
|
+
}),
|
|
75432
|
+
devScript: "dev",
|
|
75433
|
+
previewScript: "preview",
|
|
75434
|
+
deployScript: "deploy",
|
|
75435
|
+
compatibilityFlags: ["nodejs_compat"]
|
|
75436
|
+
};
|
|
75437
|
+
|
|
75381
75438
|
// src/helpers/codemod.ts
|
|
75382
75439
|
var import_fs8 = require("fs");
|
|
75383
75440
|
var import_path8 = __toESM(require("path"));
|
|
@@ -75453,184 +75510,14 @@ var getPropertyName = (newProp) => {
|
|
|
75453
75510
|
return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
|
|
75454
75511
|
};
|
|
75455
75512
|
|
|
75456
|
-
// templates-experimental/
|
|
75513
|
+
// templates-experimental/qwik/c3.ts
|
|
75457
75514
|
var recast2 = __toESM(require_main3());
|
|
75458
|
-
var { npx } = detectPackageManager();
|
|
75459
|
-
var generate = async (ctx) => {
|
|
75460
|
-
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
75461
|
-
logRaw("");
|
|
75462
|
-
};
|
|
75463
|
-
var configure = async () => {
|
|
75464
|
-
await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
|
|
75465
|
-
silent: true,
|
|
75466
|
-
startText: "Installing adapter",
|
|
75467
|
-
doneText: `${brandColor("installed")} ${dim(
|
|
75468
|
-
`via \`${npx} astro add cloudflare\``
|
|
75469
|
-
)}`
|
|
75470
|
-
});
|
|
75471
|
-
updateAstroConfig();
|
|
75472
|
-
};
|
|
75473
|
-
var updateAstroConfig = () => {
|
|
75474
|
-
const filePath = "astro.config.mjs";
|
|
75475
|
-
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
75476
|
-
transformFile(filePath, {
|
|
75477
|
-
visitCallExpression: function(n) {
|
|
75478
|
-
const callee = n.node.callee;
|
|
75479
|
-
if (callee.name !== "cloudflare") {
|
|
75480
|
-
return this.traverse(n);
|
|
75481
|
-
}
|
|
75482
|
-
const b3 = recast2.types.builders;
|
|
75483
|
-
n.node.arguments = [
|
|
75484
|
-
b3.objectExpression([
|
|
75485
|
-
b3.objectProperty(
|
|
75486
|
-
b3.identifier("platformProxy"),
|
|
75487
|
-
b3.objectExpression([
|
|
75488
|
-
b3.objectProperty(b3.identifier("enabled"), b3.booleanLiteral(true))
|
|
75489
|
-
])
|
|
75490
|
-
)
|
|
75491
|
-
])
|
|
75492
|
-
];
|
|
75493
|
-
return false;
|
|
75494
|
-
}
|
|
75495
|
-
});
|
|
75496
|
-
};
|
|
75497
|
-
var config = {
|
|
75498
|
-
configVersion: 1,
|
|
75499
|
-
id: "astro",
|
|
75500
|
-
frameworkCli: "create-astro",
|
|
75501
|
-
platform: "workers",
|
|
75502
|
-
displayName: "Astro",
|
|
75503
|
-
copyFiles: {
|
|
75504
|
-
async selectVariant(ctx) {
|
|
75505
|
-
return usesTypescript(ctx) ? "ts" : "js";
|
|
75506
|
-
},
|
|
75507
|
-
variants: {
|
|
75508
|
-
js: {
|
|
75509
|
-
path: "./templates/js"
|
|
75510
|
-
},
|
|
75511
|
-
ts: {
|
|
75512
|
-
path: "./templates/ts"
|
|
75513
|
-
}
|
|
75514
|
-
}
|
|
75515
|
-
},
|
|
75516
|
-
devScript: "dev",
|
|
75517
|
-
deployScript: "deploy",
|
|
75518
|
-
previewScript: "preview",
|
|
75519
|
-
path: "templates-experimental/astro",
|
|
75520
|
-
generate,
|
|
75521
|
-
configure,
|
|
75522
|
-
transformPackageJson: async (pkgJson, ctx) => ({
|
|
75523
|
-
scripts: {
|
|
75524
|
-
deploy: `astro build && wrangler deploy`,
|
|
75525
|
-
preview: `astro build && wrangler dev`,
|
|
75526
|
-
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
75527
|
-
}
|
|
75528
|
-
})
|
|
75529
|
-
};
|
|
75530
|
-
var c3_default = config;
|
|
75531
|
-
|
|
75532
|
-
// templates-experimental/hono/c3.ts
|
|
75515
|
+
var { npm, npx, name } = detectPackageManager();
|
|
75533
75516
|
var generate2 = async (ctx) => {
|
|
75534
|
-
const { name: pm4 } = detectPackageManager();
|
|
75535
|
-
await runFrameworkGenerator(ctx, [
|
|
75536
|
-
ctx.project.name,
|
|
75537
|
-
"--template",
|
|
75538
|
-
"cloudflare-workers",
|
|
75539
|
-
"--install",
|
|
75540
|
-
"--pm",
|
|
75541
|
-
pm4
|
|
75542
|
-
]);
|
|
75543
|
-
logRaw("");
|
|
75544
|
-
};
|
|
75545
|
-
var config2 = {
|
|
75546
|
-
configVersion: 1,
|
|
75547
|
-
id: "hono",
|
|
75548
|
-
frameworkCli: "create-hono",
|
|
75549
|
-
displayName: "Hono",
|
|
75550
|
-
copyFiles: {
|
|
75551
|
-
path: "./templates"
|
|
75552
|
-
},
|
|
75553
|
-
platform: "workers",
|
|
75554
|
-
path: "templates-experimental/hono",
|
|
75555
|
-
generate: generate2,
|
|
75556
|
-
transformPackageJson: async () => ({
|
|
75557
|
-
scripts: {
|
|
75558
|
-
dev: "wrangler dev",
|
|
75559
|
-
deploy: "wrangler deploy --minify",
|
|
75560
|
-
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
75561
|
-
}
|
|
75562
|
-
}),
|
|
75563
|
-
devScript: "dev",
|
|
75564
|
-
deployScript: "deploy",
|
|
75565
|
-
previewScript: "dev"
|
|
75566
|
-
};
|
|
75567
|
-
var c3_default2 = config2;
|
|
75568
|
-
|
|
75569
|
-
// templates-experimental/next/c3.ts
|
|
75570
|
-
var generate3 = async (ctx) => {
|
|
75571
|
-
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
75572
|
-
};
|
|
75573
|
-
var configure2 = async (ctx) => {
|
|
75574
|
-
const packages = [
|
|
75575
|
-
"@opennextjs/cloudflare@0.5.x",
|
|
75576
|
-
"@cloudflare/workers-types"
|
|
75577
|
-
];
|
|
75578
|
-
await installPackages(packages, {
|
|
75579
|
-
dev: true,
|
|
75580
|
-
startText: "Adding the Cloudflare adapter",
|
|
75581
|
-
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
75582
|
-
});
|
|
75583
|
-
const usesTs = usesTypescript(ctx);
|
|
75584
|
-
updateNextConfig(usesTs);
|
|
75585
|
-
};
|
|
75586
|
-
var updateNextConfig = (usesTs) => {
|
|
75587
|
-
const s = spinner();
|
|
75588
|
-
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
75589
|
-
s.start(`Updating \`${configFile}\``);
|
|
75590
|
-
const configContent = readFile(configFile);
|
|
75591
|
-
const updatedConfigFile = configContent + `
|
|
75592
|
-
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
75593
|
-
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
75594
|
-
initOpenNextCloudflareForDev();
|
|
75595
|
-
`.replace(/\n\t*/g, "\n");
|
|
75596
|
-
writeFile2(configFile, updatedConfigFile);
|
|
75597
|
-
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75598
|
-
};
|
|
75599
|
-
var c3_default3 = {
|
|
75600
|
-
configVersion: 1,
|
|
75601
|
-
id: "next",
|
|
75602
|
-
frameworkCli: "create-next-app",
|
|
75603
|
-
// TODO: Stop using a pinned version when the template graduates.
|
|
75604
|
-
frameworkCliPinnedVersion: "~15.2.2",
|
|
75605
|
-
platform: "workers",
|
|
75606
|
-
displayName: "Next.js (using Node.js compat + Workers Assets)",
|
|
75607
|
-
path: "templates-experimental/next",
|
|
75608
|
-
copyFiles: {
|
|
75609
|
-
path: "./templates"
|
|
75610
|
-
},
|
|
75611
|
-
generate: generate3,
|
|
75612
|
-
configure: configure2,
|
|
75613
|
-
transformPackageJson: async () => ({
|
|
75614
|
-
scripts: {
|
|
75615
|
-
deploy: `opennextjs-cloudflare && wrangler deploy`,
|
|
75616
|
-
preview: `opennextjs-cloudflare && wrangler dev`,
|
|
75617
|
-
"cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
|
|
75618
|
-
}
|
|
75619
|
-
}),
|
|
75620
|
-
devScript: "dev",
|
|
75621
|
-
previewScript: "preview",
|
|
75622
|
-
deployScript: "deploy",
|
|
75623
|
-
compatibilityFlags: ["nodejs_compat"]
|
|
75624
|
-
};
|
|
75625
|
-
|
|
75626
|
-
// templates-experimental/qwik/c3.ts
|
|
75627
|
-
var recast3 = __toESM(require_main3());
|
|
75628
|
-
var { npm, npx: npx2, name } = detectPackageManager();
|
|
75629
|
-
var generate4 = async (ctx) => {
|
|
75630
75517
|
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
75631
75518
|
};
|
|
75632
|
-
var
|
|
75633
|
-
const cmd = [name === "pnpm" ? npm :
|
|
75519
|
+
var configure2 = async (ctx) => {
|
|
75520
|
+
const cmd = [name === "pnpm" ? npm : npx, "qwik", "add", "cloudflare-pages"];
|
|
75634
75521
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
75635
75522
|
await runCommand(cmd);
|
|
75636
75523
|
removeFile("./public/_headers");
|
|
@@ -75646,7 +75533,7 @@ var addBindingsProxy = (ctx) => {
|
|
|
75646
75533
|
const s = spinner();
|
|
75647
75534
|
s.start("Updating `vite.config.ts`");
|
|
75648
75535
|
const snippets = loadTemplateSnippets(ctx);
|
|
75649
|
-
const b3 =
|
|
75536
|
+
const b3 = recast2.types.builders;
|
|
75650
75537
|
transformFile("vite.config.ts", {
|
|
75651
75538
|
// Insert the env declaration after the last import (but before the rest of the body)
|
|
75652
75539
|
visitProgram: function(n) {
|
|
@@ -75688,7 +75575,7 @@ var populateCloudflareEnv = () => {
|
|
|
75688
75575
|
s.start(`Updating \`${entrypointPath}\``);
|
|
75689
75576
|
transformFile(entrypointPath, {
|
|
75690
75577
|
visitTSInterfaceDeclaration: function(n) {
|
|
75691
|
-
const b3 =
|
|
75578
|
+
const b3 = recast2.types.builders;
|
|
75692
75579
|
const id = n.node.id;
|
|
75693
75580
|
if (id.name !== "QwikCityPlatform") {
|
|
75694
75581
|
this.traverse(n);
|
|
@@ -75709,7 +75596,7 @@ var populateCloudflareEnv = () => {
|
|
|
75709
75596
|
});
|
|
75710
75597
|
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
75711
75598
|
};
|
|
75712
|
-
var
|
|
75599
|
+
var config = {
|
|
75713
75600
|
configVersion: 1,
|
|
75714
75601
|
id: "qwik",
|
|
75715
75602
|
frameworkCli: "create-qwik",
|
|
@@ -75719,8 +75606,8 @@ var config3 = {
|
|
|
75719
75606
|
path: "./templates"
|
|
75720
75607
|
},
|
|
75721
75608
|
path: "templates-experimental/qwik",
|
|
75722
|
-
generate:
|
|
75723
|
-
configure:
|
|
75609
|
+
generate: generate2,
|
|
75610
|
+
configure: configure2,
|
|
75724
75611
|
transformPackageJson: async () => ({
|
|
75725
75612
|
scripts: {
|
|
75726
75613
|
deploy: `${npm} run build && wrangler deploy`,
|
|
@@ -75732,49 +75619,7 @@ var config3 = {
|
|
|
75732
75619
|
deployScript: "deploy",
|
|
75733
75620
|
previewScript: "preview"
|
|
75734
75621
|
};
|
|
75735
|
-
var
|
|
75736
|
-
|
|
75737
|
-
// templates-experimental/remix/c3.ts
|
|
75738
|
-
var { npm: npm2 } = detectPackageManager();
|
|
75739
|
-
var generate5 = async (ctx) => {
|
|
75740
|
-
await runFrameworkGenerator(ctx, [
|
|
75741
|
-
ctx.project.name,
|
|
75742
|
-
"--template",
|
|
75743
|
-
"https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
|
|
75744
|
-
]);
|
|
75745
|
-
logRaw("");
|
|
75746
|
-
};
|
|
75747
|
-
var configure4 = async () => {
|
|
75748
|
-
await installPackages(["wrangler@latest"], {
|
|
75749
|
-
dev: true,
|
|
75750
|
-
startText: "Updating the Wrangler version",
|
|
75751
|
-
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
75752
|
-
});
|
|
75753
|
-
};
|
|
75754
|
-
var config4 = {
|
|
75755
|
-
configVersion: 1,
|
|
75756
|
-
id: "remix",
|
|
75757
|
-
frameworkCli: "create-remix",
|
|
75758
|
-
platform: "workers",
|
|
75759
|
-
displayName: "Remix",
|
|
75760
|
-
copyFiles: {
|
|
75761
|
-
path: "./templates"
|
|
75762
|
-
},
|
|
75763
|
-
path: "templates-experimental/remix",
|
|
75764
|
-
generate: generate5,
|
|
75765
|
-
configure: configure4,
|
|
75766
|
-
transformPackageJson: async () => ({
|
|
75767
|
-
scripts: {
|
|
75768
|
-
deploy: `${npm2} run build && wrangler deploy`,
|
|
75769
|
-
preview: `${npm2} run build && wrangler dev`,
|
|
75770
|
-
"cf-typegen": `wrangler types`
|
|
75771
|
-
}
|
|
75772
|
-
}),
|
|
75773
|
-
devScript: "dev",
|
|
75774
|
-
deployScript: "deploy",
|
|
75775
|
-
previewScript: "preview"
|
|
75776
|
-
};
|
|
75777
|
-
var c3_default5 = config4;
|
|
75622
|
+
var c3_default2 = config;
|
|
75778
75623
|
|
|
75779
75624
|
// src/helpers/compatDate.ts
|
|
75780
75625
|
var import_fs9 = require("fs");
|
|
@@ -75829,18 +75674,18 @@ function getLatestTypesEntrypoint(ctx) {
|
|
|
75829
75674
|
}
|
|
75830
75675
|
|
|
75831
75676
|
// templates-experimental/solid/c3.ts
|
|
75832
|
-
var
|
|
75833
|
-
var { npm:
|
|
75834
|
-
var
|
|
75677
|
+
var recast3 = __toESM(require_main3());
|
|
75678
|
+
var { npm: npm2 } = detectPackageManager();
|
|
75679
|
+
var generate3 = async (ctx) => {
|
|
75835
75680
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
75836
75681
|
logRaw("");
|
|
75837
75682
|
};
|
|
75838
|
-
var
|
|
75683
|
+
var configure3 = async (ctx) => {
|
|
75839
75684
|
const packages = ["nitropack"];
|
|
75840
75685
|
await installPackages(packages, {
|
|
75841
75686
|
dev: true,
|
|
75842
75687
|
startText: "Installing nitro module `nitropack`",
|
|
75843
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75688
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
|
|
75844
75689
|
});
|
|
75845
75690
|
usesTypescript(ctx);
|
|
75846
75691
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
@@ -75852,7 +75697,7 @@ var configure5 = async (ctx) => {
|
|
|
75852
75697
|
if (callee.name !== "defineConfig") {
|
|
75853
75698
|
return this.traverse(n);
|
|
75854
75699
|
}
|
|
75855
|
-
const b3 =
|
|
75700
|
+
const b3 = recast3.types.builders;
|
|
75856
75701
|
mergeObjectProperties(
|
|
75857
75702
|
n.node.arguments[0],
|
|
75858
75703
|
[
|
|
@@ -75876,7 +75721,7 @@ var configure5 = async (ctx) => {
|
|
|
75876
75721
|
}
|
|
75877
75722
|
});
|
|
75878
75723
|
};
|
|
75879
|
-
var
|
|
75724
|
+
var config2 = {
|
|
75880
75725
|
configVersion: 1,
|
|
75881
75726
|
id: "solid",
|
|
75882
75727
|
frameworkCli: "create-solid",
|
|
@@ -75886,12 +75731,12 @@ var config5 = {
|
|
|
75886
75731
|
path: "./templates"
|
|
75887
75732
|
},
|
|
75888
75733
|
path: "templates-experimental/solid",
|
|
75889
|
-
generate:
|
|
75890
|
-
configure:
|
|
75734
|
+
generate: generate3,
|
|
75735
|
+
configure: configure3,
|
|
75891
75736
|
transformPackageJson: async () => ({
|
|
75892
75737
|
scripts: {
|
|
75893
|
-
preview: `${
|
|
75894
|
-
deploy: `${
|
|
75738
|
+
preview: `${npm2} run build && npx wrangler dev`,
|
|
75739
|
+
deploy: `${npm2} run build && wrangler deploy`
|
|
75895
75740
|
}
|
|
75896
75741
|
}),
|
|
75897
75742
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -75899,111 +75744,12 @@ var config5 = {
|
|
|
75899
75744
|
deployScript: "deploy",
|
|
75900
75745
|
previewScript: "preview"
|
|
75901
75746
|
};
|
|
75902
|
-
var
|
|
75903
|
-
|
|
75904
|
-
// templates-experimental/svelte/c3.ts
|
|
75905
|
-
var import_node_os3 = require("node:os");
|
|
75906
|
-
var recast5 = __toESM(require_main3());
|
|
75907
|
-
var { npm: npm4 } = detectPackageManager();
|
|
75908
|
-
var generate7 = async (ctx) => {
|
|
75909
|
-
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
75910
|
-
logRaw("");
|
|
75911
|
-
};
|
|
75912
|
-
var configure6 = async (ctx) => {
|
|
75913
|
-
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
75914
|
-
await installPackages([pkg], {
|
|
75915
|
-
dev: true,
|
|
75916
|
-
startText: "Adding the Cloudflare Pages adapter",
|
|
75917
|
-
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
75918
|
-
});
|
|
75919
|
-
updateSvelteConfig();
|
|
75920
|
-
updateTypeDefinitions(ctx);
|
|
75921
|
-
};
|
|
75922
|
-
var updateSvelteConfig = () => {
|
|
75923
|
-
updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
|
|
75924
|
-
transformFile("svelte.config.js", {
|
|
75925
|
-
visitImportDeclaration: function(n) {
|
|
75926
|
-
const importSource = n.value.source;
|
|
75927
|
-
if (importSource.value === "@sveltejs/adapter-auto") {
|
|
75928
|
-
importSource.value = "@sveltejs/adapter-cloudflare";
|
|
75929
|
-
}
|
|
75930
|
-
return false;
|
|
75931
|
-
}
|
|
75932
|
-
});
|
|
75933
|
-
};
|
|
75934
|
-
var updateTypeDefinitions = (ctx) => {
|
|
75935
|
-
if (!usesTypescript(ctx)) {
|
|
75936
|
-
return;
|
|
75937
|
-
}
|
|
75938
|
-
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
75939
|
-
const b3 = recast5.types.builders;
|
|
75940
|
-
transformFile("src/app.d.ts", {
|
|
75941
|
-
visitTSModuleDeclaration(n) {
|
|
75942
|
-
if (n.value.id.name === "App" && n.node.body) {
|
|
75943
|
-
const moduleBlock = n.node.body;
|
|
75944
|
-
const platformInterface = b3.tsInterfaceDeclaration(
|
|
75945
|
-
b3.identifier("Platform"),
|
|
75946
|
-
b3.tsInterfaceBody([
|
|
75947
|
-
b3.tsPropertySignature(
|
|
75948
|
-
b3.identifier("env"),
|
|
75949
|
-
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier("Env")))
|
|
75950
|
-
),
|
|
75951
|
-
b3.tsPropertySignature(
|
|
75952
|
-
b3.identifier("cf"),
|
|
75953
|
-
b3.tsTypeAnnotation(
|
|
75954
|
-
b3.tsTypeReference(b3.identifier("CfProperties"))
|
|
75955
|
-
)
|
|
75956
|
-
),
|
|
75957
|
-
b3.tsPropertySignature(
|
|
75958
|
-
b3.identifier("ctx"),
|
|
75959
|
-
b3.tsTypeAnnotation(
|
|
75960
|
-
b3.tsTypeReference(b3.identifier("ExecutionContext"))
|
|
75961
|
-
)
|
|
75962
|
-
)
|
|
75963
|
-
])
|
|
75964
|
-
);
|
|
75965
|
-
moduleBlock.body.unshift(platformInterface);
|
|
75966
|
-
}
|
|
75967
|
-
this.traverse(n);
|
|
75968
|
-
}
|
|
75969
|
-
});
|
|
75970
|
-
};
|
|
75971
|
-
var config6 = {
|
|
75972
|
-
configVersion: 1,
|
|
75973
|
-
id: "svelte",
|
|
75974
|
-
frameworkCli: "sv",
|
|
75975
|
-
displayName: "SvelteKit",
|
|
75976
|
-
platform: "workers",
|
|
75977
|
-
copyFiles: {
|
|
75978
|
-
path: "./templates"
|
|
75979
|
-
},
|
|
75980
|
-
path: "templates-experimental/svelte",
|
|
75981
|
-
generate: generate7,
|
|
75982
|
-
configure: configure6,
|
|
75983
|
-
transformPackageJson: async (original, ctx) => {
|
|
75984
|
-
let scripts = {
|
|
75985
|
-
preview: `${npm4} run build && wrangler dev`,
|
|
75986
|
-
deploy: `${npm4} run build && wrangler deploy`
|
|
75987
|
-
};
|
|
75988
|
-
if (usesTypescript(ctx)) {
|
|
75989
|
-
const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
|
|
75990
|
-
scripts = {
|
|
75991
|
-
...scripts,
|
|
75992
|
-
"cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
|
|
75993
|
-
};
|
|
75994
|
-
}
|
|
75995
|
-
return { scripts };
|
|
75996
|
-
},
|
|
75997
|
-
devScript: "dev",
|
|
75998
|
-
deployScript: "deploy",
|
|
75999
|
-
previewScript: "preview"
|
|
76000
|
-
};
|
|
76001
|
-
var c3_default7 = config6;
|
|
75747
|
+
var c3_default3 = config2;
|
|
76002
75748
|
|
|
76003
75749
|
// templates/analog/c3.ts
|
|
76004
|
-
var
|
|
76005
|
-
var { npm:
|
|
76006
|
-
var
|
|
75750
|
+
var recast4 = __toESM(require_main3());
|
|
75751
|
+
var { npm: npm3, name: pm } = detectPackageManager();
|
|
75752
|
+
var generate4 = async (ctx) => {
|
|
76007
75753
|
await runFrameworkGenerator(ctx, [
|
|
76008
75754
|
ctx.project.name,
|
|
76009
75755
|
"--template",
|
|
@@ -76011,7 +75757,7 @@ var generate8 = async (ctx) => {
|
|
|
76011
75757
|
]);
|
|
76012
75758
|
logRaw("");
|
|
76013
75759
|
};
|
|
76014
|
-
var
|
|
75760
|
+
var configure4 = async (ctx) => {
|
|
76015
75761
|
if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
|
|
76016
75762
|
const packages = [];
|
|
76017
75763
|
packages.push("nitropack");
|
|
@@ -76021,7 +75767,7 @@ var configure7 = async (ctx) => {
|
|
|
76021
75767
|
await installPackages(packages, {
|
|
76022
75768
|
dev: true,
|
|
76023
75769
|
startText: `Installing ${packages.join(", ")}`,
|
|
76024
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75770
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
|
|
76025
75771
|
});
|
|
76026
75772
|
}
|
|
76027
75773
|
updateViteConfig(ctx);
|
|
@@ -76042,7 +75788,7 @@ var updateEnvTypes = (ctx) => {
|
|
|
76042
75788
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
|
|
76043
75789
|
};
|
|
76044
75790
|
var updateViteConfig = (ctx) => {
|
|
76045
|
-
const b3 =
|
|
75791
|
+
const b3 = recast4.types.builders;
|
|
76046
75792
|
const s = spinner();
|
|
76047
75793
|
const configFile = "vite.config.ts";
|
|
76048
75794
|
s.start(`Updating \`${configFile}\``);
|
|
@@ -76079,7 +75825,7 @@ var updateViteConfig = (ctx) => {
|
|
|
76079
75825
|
});
|
|
76080
75826
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76081
75827
|
};
|
|
76082
|
-
var
|
|
75828
|
+
var config3 = {
|
|
76083
75829
|
configVersion: 1,
|
|
76084
75830
|
id: "analog",
|
|
76085
75831
|
frameworkCli: "create-analog",
|
|
@@ -76088,12 +75834,12 @@ var config7 = {
|
|
|
76088
75834
|
copyFiles: {
|
|
76089
75835
|
path: "./templates"
|
|
76090
75836
|
},
|
|
76091
|
-
generate:
|
|
76092
|
-
configure:
|
|
75837
|
+
generate: generate4,
|
|
75838
|
+
configure: configure4,
|
|
76093
75839
|
transformPackageJson: async () => ({
|
|
76094
75840
|
scripts: {
|
|
76095
|
-
preview: `${
|
|
76096
|
-
deploy: `${
|
|
75841
|
+
preview: `${npm3} run build && wrangler pages dev`,
|
|
75842
|
+
deploy: `${npm3} run build && wrangler pages deploy`,
|
|
76097
75843
|
"cf-typegen": `wrangler types`
|
|
76098
75844
|
}
|
|
76099
75845
|
}),
|
|
@@ -76101,12 +75847,12 @@ var config7 = {
|
|
|
76101
75847
|
deployScript: "deploy",
|
|
76102
75848
|
previewScript: "preview"
|
|
76103
75849
|
};
|
|
76104
|
-
var
|
|
75850
|
+
var c3_default4 = config3;
|
|
76105
75851
|
|
|
76106
75852
|
// templates/angular/pages/c3.ts
|
|
76107
75853
|
var import_node_path3 = require("node:path");
|
|
76108
|
-
var { npm:
|
|
76109
|
-
var
|
|
75854
|
+
var { npm: npm4 } = detectPackageManager();
|
|
75855
|
+
var generate5 = async (ctx) => {
|
|
76110
75856
|
await runFrameworkGenerator(ctx, [
|
|
76111
75857
|
ctx.project.name,
|
|
76112
75858
|
"--ssr",
|
|
@@ -76114,7 +75860,7 @@ var generate9 = async (ctx) => {
|
|
|
76114
75860
|
]);
|
|
76115
75861
|
logRaw("");
|
|
76116
75862
|
};
|
|
76117
|
-
var
|
|
75863
|
+
var configure5 = async (ctx) => {
|
|
76118
75864
|
updateAngularJson(ctx);
|
|
76119
75865
|
await updateAppCode();
|
|
76120
75866
|
await installCFWorker();
|
|
@@ -76123,7 +75869,7 @@ async function installCFWorker() {
|
|
|
76123
75869
|
await installPackages(["xhr2"], {
|
|
76124
75870
|
dev: true,
|
|
76125
75871
|
startText: "Installing additional dependencies",
|
|
76126
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75872
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm4} install\``)}`
|
|
76127
75873
|
});
|
|
76128
75874
|
}
|
|
76129
75875
|
async function updateAppCode() {
|
|
@@ -76165,7 +75911,7 @@ function updateAngularJson(ctx) {
|
|
|
76165
75911
|
writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
76166
75912
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
76167
75913
|
}
|
|
76168
|
-
var
|
|
75914
|
+
var config4 = {
|
|
76169
75915
|
configVersion: 1,
|
|
76170
75916
|
id: "angular",
|
|
76171
75917
|
frameworkCli: "@angular/create",
|
|
@@ -76178,23 +75924,23 @@ var config8 = {
|
|
|
76178
75924
|
devScript: "start",
|
|
76179
75925
|
deployScript: "deploy",
|
|
76180
75926
|
previewScript: "start",
|
|
76181
|
-
generate:
|
|
76182
|
-
configure:
|
|
75927
|
+
generate: generate5,
|
|
75928
|
+
configure: configure5,
|
|
76183
75929
|
transformPackageJson: async () => ({
|
|
76184
75930
|
scripts: {
|
|
76185
|
-
start: `${
|
|
76186
|
-
build: `ng build && ${
|
|
75931
|
+
start: `${npm4} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
75932
|
+
build: `ng build && ${npm4} run process`,
|
|
76187
75933
|
process: "node ./tools/copy-files.mjs",
|
|
76188
|
-
deploy: `${
|
|
75934
|
+
deploy: `${npm4} run build && wrangler pages deploy dist/cloudflare`
|
|
76189
75935
|
}
|
|
76190
75936
|
})
|
|
76191
75937
|
};
|
|
76192
|
-
var
|
|
75938
|
+
var c3_default5 = config4;
|
|
76193
75939
|
|
|
76194
75940
|
// templates/angular/workers/c3.ts
|
|
76195
75941
|
var import_node_path4 = require("node:path");
|
|
76196
|
-
var { npm:
|
|
76197
|
-
var
|
|
75942
|
+
var { npm: npm5 } = detectPackageManager();
|
|
75943
|
+
var generate6 = async (ctx) => {
|
|
76198
75944
|
await runFrameworkGenerator(ctx, [
|
|
76199
75945
|
ctx.project.name,
|
|
76200
75946
|
"--ssr",
|
|
@@ -76202,7 +75948,7 @@ var generate10 = async (ctx) => {
|
|
|
76202
75948
|
]);
|
|
76203
75949
|
logRaw("");
|
|
76204
75950
|
};
|
|
76205
|
-
var
|
|
75951
|
+
var configure6 = async (ctx) => {
|
|
76206
75952
|
updateAngularJson2(ctx);
|
|
76207
75953
|
await updateAppCode2();
|
|
76208
75954
|
await installCFWorker2();
|
|
@@ -76211,7 +75957,7 @@ async function installCFWorker2() {
|
|
|
76211
75957
|
await installPackages(["xhr2"], {
|
|
76212
75958
|
dev: true,
|
|
76213
75959
|
startText: "Installing additional dependencies",
|
|
76214
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75960
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm5} install\``)}`
|
|
76215
75961
|
});
|
|
76216
75962
|
}
|
|
76217
75963
|
async function updateAppCode2() {
|
|
@@ -76252,7 +75998,7 @@ function updateAngularJson2(ctx) {
|
|
|
76252
75998
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
76253
75999
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
76254
76000
|
}
|
|
76255
|
-
var
|
|
76001
|
+
var config5 = {
|
|
76256
76002
|
configVersion: 1,
|
|
76257
76003
|
id: "angular",
|
|
76258
76004
|
frameworkCli: "@angular/create",
|
|
@@ -76265,33 +76011,109 @@ var config9 = {
|
|
|
76265
76011
|
devScript: "start",
|
|
76266
76012
|
deployScript: "deploy",
|
|
76267
76013
|
previewScript: "start",
|
|
76268
|
-
generate:
|
|
76269
|
-
configure:
|
|
76014
|
+
generate: generate6,
|
|
76015
|
+
configure: configure6,
|
|
76270
76016
|
transformPackageJson: async () => ({
|
|
76271
76017
|
scripts: {
|
|
76272
|
-
start: `${
|
|
76018
|
+
start: `${npm5} run build && wrangler dev`,
|
|
76273
76019
|
build: `ng build`,
|
|
76274
|
-
deploy: `${
|
|
76020
|
+
deploy: `${npm5} run build && wrangler deploy`
|
|
76275
76021
|
}
|
|
76276
76022
|
})
|
|
76277
76023
|
};
|
|
76278
|
-
var
|
|
76024
|
+
var c3_default6 = config5;
|
|
76279
76025
|
|
|
76280
76026
|
// templates/angular/c3.ts
|
|
76281
|
-
var
|
|
76027
|
+
var config6 = {
|
|
76282
76028
|
displayName: "Angular",
|
|
76283
|
-
platformVariants: { pages:
|
|
76029
|
+
platformVariants: { pages: c3_default5, workers: c3_default6 }
|
|
76284
76030
|
};
|
|
76285
|
-
var
|
|
76031
|
+
var c3_default7 = config6;
|
|
76286
76032
|
|
|
76287
|
-
// templates/astro/c3.ts
|
|
76288
|
-
var
|
|
76033
|
+
// templates/astro/pages/c3.ts
|
|
76034
|
+
var recast5 = __toESM(require_main3());
|
|
76035
|
+
var { npx: npx2 } = detectPackageManager();
|
|
76036
|
+
var generate7 = async (ctx) => {
|
|
76037
|
+
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76038
|
+
logRaw("");
|
|
76039
|
+
};
|
|
76040
|
+
var configure7 = async () => {
|
|
76041
|
+
await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
|
|
76042
|
+
silent: true,
|
|
76043
|
+
startText: "Installing adapter",
|
|
76044
|
+
doneText: `${brandColor("installed")} ${dim(
|
|
76045
|
+
`via \`${npx2} astro add cloudflare\``
|
|
76046
|
+
)}`
|
|
76047
|
+
});
|
|
76048
|
+
updateAstroConfig();
|
|
76049
|
+
};
|
|
76050
|
+
var updateAstroConfig = () => {
|
|
76051
|
+
const filePath = "astro.config.mjs";
|
|
76052
|
+
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
76053
|
+
transformFile(filePath, {
|
|
76054
|
+
visitCallExpression: function(n) {
|
|
76055
|
+
const callee = n.node.callee;
|
|
76056
|
+
if (callee.name !== "cloudflare") {
|
|
76057
|
+
return this.traverse(n);
|
|
76058
|
+
}
|
|
76059
|
+
const b3 = recast5.types.builders;
|
|
76060
|
+
n.node.arguments = [
|
|
76061
|
+
b3.objectExpression([
|
|
76062
|
+
b3.objectProperty(
|
|
76063
|
+
b3.identifier("platformProxy"),
|
|
76064
|
+
b3.objectExpression([
|
|
76065
|
+
b3.objectProperty(b3.identifier("enabled"), b3.booleanLiteral(true))
|
|
76066
|
+
])
|
|
76067
|
+
)
|
|
76068
|
+
])
|
|
76069
|
+
];
|
|
76070
|
+
return false;
|
|
76071
|
+
}
|
|
76072
|
+
});
|
|
76073
|
+
};
|
|
76074
|
+
var config7 = {
|
|
76075
|
+
configVersion: 1,
|
|
76076
|
+
id: "astro",
|
|
76077
|
+
frameworkCli: "create-astro",
|
|
76078
|
+
platform: "pages",
|
|
76079
|
+
displayName: "Astro",
|
|
76080
|
+
path: "templates/astro/pages",
|
|
76081
|
+
copyFiles: {
|
|
76082
|
+
async selectVariant(ctx) {
|
|
76083
|
+
return usesTypescript(ctx) ? "ts" : "js";
|
|
76084
|
+
},
|
|
76085
|
+
variants: {
|
|
76086
|
+
js: {
|
|
76087
|
+
path: "./templates/js"
|
|
76088
|
+
},
|
|
76089
|
+
ts: {
|
|
76090
|
+
path: "./templates/ts"
|
|
76091
|
+
}
|
|
76092
|
+
}
|
|
76093
|
+
},
|
|
76094
|
+
devScript: "dev",
|
|
76095
|
+
deployScript: "deploy",
|
|
76096
|
+
previewScript: "preview",
|
|
76097
|
+
generate: generate7,
|
|
76098
|
+
configure: configure7,
|
|
76099
|
+
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76100
|
+
scripts: {
|
|
76101
|
+
deploy: `astro build && wrangler pages deploy`,
|
|
76102
|
+
preview: `astro build && wrangler pages dev`,
|
|
76103
|
+
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
76104
|
+
}
|
|
76105
|
+
})
|
|
76106
|
+
};
|
|
76107
|
+
var c3_default8 = config7;
|
|
76108
|
+
|
|
76109
|
+
// templates/astro/workers/c3.ts
|
|
76110
|
+
var recast6 = __toESM(require_main3());
|
|
76289
76111
|
var { npx: npx3 } = detectPackageManager();
|
|
76290
|
-
var
|
|
76112
|
+
var generate8 = async (ctx) => {
|
|
76291
76113
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76292
76114
|
logRaw("");
|
|
76293
76115
|
};
|
|
76294
|
-
var
|
|
76116
|
+
var configure8 = async () => {
|
|
76295
76117
|
await runCommand([npx3, "astro", "add", "cloudflare", "-y"], {
|
|
76296
76118
|
silent: true,
|
|
76297
76119
|
startText: "Installing adapter",
|
|
@@ -76310,7 +76132,7 @@ var updateAstroConfig2 = () => {
|
|
|
76310
76132
|
if (callee.name !== "cloudflare") {
|
|
76311
76133
|
return this.traverse(n);
|
|
76312
76134
|
}
|
|
76313
|
-
const b3 =
|
|
76135
|
+
const b3 = recast6.types.builders;
|
|
76314
76136
|
n.node.arguments = [
|
|
76315
76137
|
b3.objectExpression([
|
|
76316
76138
|
b3.objectProperty(
|
|
@@ -76325,11 +76147,11 @@ var updateAstroConfig2 = () => {
|
|
|
76325
76147
|
}
|
|
76326
76148
|
});
|
|
76327
76149
|
};
|
|
76328
|
-
var
|
|
76150
|
+
var config8 = {
|
|
76329
76151
|
configVersion: 1,
|
|
76330
76152
|
id: "astro",
|
|
76331
76153
|
frameworkCli: "create-astro",
|
|
76332
|
-
platform: "
|
|
76154
|
+
platform: "workers",
|
|
76333
76155
|
displayName: "Astro",
|
|
76334
76156
|
copyFiles: {
|
|
76335
76157
|
async selectVariant(ctx) {
|
|
@@ -76347,20 +76169,28 @@ var config11 = {
|
|
|
76347
76169
|
devScript: "dev",
|
|
76348
76170
|
deployScript: "deploy",
|
|
76349
76171
|
previewScript: "preview",
|
|
76350
|
-
|
|
76351
|
-
|
|
76172
|
+
path: "templates/astro/workers",
|
|
76173
|
+
generate: generate8,
|
|
76174
|
+
configure: configure8,
|
|
76352
76175
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76353
76176
|
scripts: {
|
|
76354
|
-
deploy: `astro build && wrangler
|
|
76355
|
-
preview: `astro build && wrangler
|
|
76177
|
+
deploy: `astro build && wrangler deploy`,
|
|
76178
|
+
preview: `astro build && wrangler dev`,
|
|
76356
76179
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
76357
76180
|
}
|
|
76358
76181
|
})
|
|
76359
76182
|
};
|
|
76360
|
-
var
|
|
76183
|
+
var c3_default9 = config8;
|
|
76184
|
+
|
|
76185
|
+
// templates/astro/c3.ts
|
|
76186
|
+
var config9 = {
|
|
76187
|
+
displayName: "Astro",
|
|
76188
|
+
platformVariants: { pages: c3_default8, workers: c3_default9 }
|
|
76189
|
+
};
|
|
76190
|
+
var c3_default10 = config9;
|
|
76361
76191
|
|
|
76362
76192
|
// templates/common/c3.ts
|
|
76363
|
-
var
|
|
76193
|
+
var c3_default11 = {
|
|
76364
76194
|
configVersion: 1,
|
|
76365
76195
|
id: "common",
|
|
76366
76196
|
displayName: "Example router & proxy Worker",
|
|
@@ -76380,36 +76210,36 @@ var c3_default13 = {
|
|
|
76380
76210
|
};
|
|
76381
76211
|
|
|
76382
76212
|
// templates/docusaurus/pages/c3.ts
|
|
76383
|
-
var { npm:
|
|
76384
|
-
var
|
|
76213
|
+
var { npm: npm6 } = detectPackageManager();
|
|
76214
|
+
var generate9 = async (ctx) => {
|
|
76385
76215
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76386
76216
|
};
|
|
76387
|
-
var
|
|
76217
|
+
var config10 = {
|
|
76388
76218
|
configVersion: 1,
|
|
76389
76219
|
id: "docusaurus",
|
|
76390
76220
|
frameworkCli: "create-docusaurus",
|
|
76391
76221
|
platform: "pages",
|
|
76392
76222
|
displayName: "Docusaurus",
|
|
76393
76223
|
path: "templates/docusaurus/pages",
|
|
76394
|
-
generate:
|
|
76224
|
+
generate: generate9,
|
|
76395
76225
|
transformPackageJson: async () => ({
|
|
76396
76226
|
scripts: {
|
|
76397
|
-
preview: `${
|
|
76398
|
-
deploy: `${
|
|
76227
|
+
preview: `${npm6} run build && wrangler pages dev ./build`,
|
|
76228
|
+
deploy: `${npm6} run build && wrangler pages deploy ./build`
|
|
76399
76229
|
}
|
|
76400
76230
|
}),
|
|
76401
76231
|
devScript: "preview",
|
|
76402
76232
|
deployScript: "deploy",
|
|
76403
76233
|
previewScript: "preview"
|
|
76404
76234
|
};
|
|
76405
|
-
var
|
|
76235
|
+
var c3_default12 = config10;
|
|
76406
76236
|
|
|
76407
76237
|
// templates/docusaurus/workers/c3.ts
|
|
76408
|
-
var { npm:
|
|
76409
|
-
var
|
|
76238
|
+
var { npm: npm7 } = detectPackageManager();
|
|
76239
|
+
var generate10 = async (ctx) => {
|
|
76410
76240
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76411
76241
|
};
|
|
76412
|
-
var
|
|
76242
|
+
var config11 = {
|
|
76413
76243
|
configVersion: 1,
|
|
76414
76244
|
id: "docusaurus",
|
|
76415
76245
|
frameworkCli: "create-docusaurus",
|
|
@@ -76419,29 +76249,29 @@ var config13 = {
|
|
|
76419
76249
|
path: "./templates"
|
|
76420
76250
|
},
|
|
76421
76251
|
path: "templates/docusaurus/workers",
|
|
76422
|
-
generate:
|
|
76252
|
+
generate: generate10,
|
|
76423
76253
|
transformPackageJson: async () => ({
|
|
76424
76254
|
scripts: {
|
|
76425
|
-
deploy: `${
|
|
76426
|
-
preview: `${
|
|
76255
|
+
deploy: `${npm7} run build && wrangler deploy`,
|
|
76256
|
+
preview: `${npm7} run build && wrangler dev`
|
|
76427
76257
|
}
|
|
76428
76258
|
}),
|
|
76429
76259
|
devScript: "start",
|
|
76430
76260
|
deployScript: "deploy",
|
|
76431
76261
|
previewScript: "preview"
|
|
76432
76262
|
};
|
|
76433
|
-
var
|
|
76263
|
+
var c3_default13 = config11;
|
|
76434
76264
|
|
|
76435
76265
|
// templates/docusaurus/c3.ts
|
|
76436
|
-
var
|
|
76266
|
+
var config12 = {
|
|
76437
76267
|
displayName: "Docusaurus",
|
|
76438
|
-
platformVariants: { pages:
|
|
76268
|
+
platformVariants: { pages: c3_default12, workers: c3_default13 }
|
|
76439
76269
|
};
|
|
76440
|
-
var
|
|
76270
|
+
var c3_default14 = config12;
|
|
76441
76271
|
|
|
76442
76272
|
// templates/gatsby/pages/c3.ts
|
|
76443
|
-
var { npm:
|
|
76444
|
-
var
|
|
76273
|
+
var { npm: npm8 } = detectPackageManager();
|
|
76274
|
+
var generate11 = async (ctx) => {
|
|
76445
76275
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76446
76276
|
const useTemplate = await inputPrompt({
|
|
76447
76277
|
type: "confirm",
|
|
@@ -76460,29 +76290,29 @@ var generate14 = async (ctx) => {
|
|
|
76460
76290
|
}
|
|
76461
76291
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76462
76292
|
};
|
|
76463
|
-
var
|
|
76293
|
+
var config13 = {
|
|
76464
76294
|
configVersion: 1,
|
|
76465
76295
|
id: "gatsby",
|
|
76466
76296
|
frameworkCli: "gatsby",
|
|
76467
76297
|
platform: "pages",
|
|
76468
76298
|
displayName: "Gatsby",
|
|
76469
76299
|
path: "templates/gatsby/pages",
|
|
76470
|
-
generate:
|
|
76300
|
+
generate: generate11,
|
|
76471
76301
|
transformPackageJson: async () => ({
|
|
76472
76302
|
scripts: {
|
|
76473
|
-
deploy: `${
|
|
76474
|
-
preview: `${
|
|
76303
|
+
deploy: `${npm8} run build && wrangler pages deploy ./public`,
|
|
76304
|
+
preview: `${npm8} run build && wrangler pages dev ./public`
|
|
76475
76305
|
}
|
|
76476
76306
|
}),
|
|
76477
76307
|
devScript: "develop",
|
|
76478
76308
|
deployScript: "deploy",
|
|
76479
76309
|
previewScript: "preview"
|
|
76480
76310
|
};
|
|
76481
|
-
var
|
|
76311
|
+
var c3_default15 = config13;
|
|
76482
76312
|
|
|
76483
76313
|
// templates/gatsby/workers/c3.ts
|
|
76484
|
-
var { npm:
|
|
76485
|
-
var
|
|
76314
|
+
var { npm: npm9 } = detectPackageManager();
|
|
76315
|
+
var generate12 = async (ctx) => {
|
|
76486
76316
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76487
76317
|
const useTemplate = await inputPrompt({
|
|
76488
76318
|
type: "confirm",
|
|
@@ -76501,7 +76331,7 @@ var generate15 = async (ctx) => {
|
|
|
76501
76331
|
}
|
|
76502
76332
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76503
76333
|
};
|
|
76504
|
-
var
|
|
76334
|
+
var config14 = {
|
|
76505
76335
|
configVersion: 1,
|
|
76506
76336
|
id: "gatsby",
|
|
76507
76337
|
frameworkCli: "gatsby",
|
|
@@ -76511,28 +76341,28 @@ var config16 = {
|
|
|
76511
76341
|
path: "./templates"
|
|
76512
76342
|
},
|
|
76513
76343
|
path: "templates/gatsby/workers",
|
|
76514
|
-
generate:
|
|
76344
|
+
generate: generate12,
|
|
76515
76345
|
transformPackageJson: async () => ({
|
|
76516
76346
|
scripts: {
|
|
76517
|
-
deploy: `${
|
|
76518
|
-
preview: `${
|
|
76347
|
+
deploy: `${npm9} run build && wrangler deploy`,
|
|
76348
|
+
preview: `${npm9} run build && wrangler dev`
|
|
76519
76349
|
}
|
|
76520
76350
|
}),
|
|
76521
76351
|
devScript: "develop",
|
|
76522
76352
|
deployScript: "deploy",
|
|
76523
76353
|
previewScript: "preview"
|
|
76524
76354
|
};
|
|
76525
|
-
var
|
|
76355
|
+
var c3_default16 = config14;
|
|
76526
76356
|
|
|
76527
76357
|
// templates/gatsby/c3.ts
|
|
76528
|
-
var
|
|
76358
|
+
var config15 = {
|
|
76529
76359
|
displayName: "Gatsby",
|
|
76530
|
-
platformVariants: { pages:
|
|
76360
|
+
platformVariants: { pages: c3_default15, workers: c3_default16 }
|
|
76531
76361
|
};
|
|
76532
|
-
var
|
|
76362
|
+
var c3_default17 = config15;
|
|
76533
76363
|
|
|
76534
76364
|
// templates/hello-world-assets-only/c3.ts
|
|
76535
|
-
var
|
|
76365
|
+
var config16 = {
|
|
76536
76366
|
configVersion: 1,
|
|
76537
76367
|
id: "hello-world-assets-only",
|
|
76538
76368
|
path: "templates/hello-world-assets-only",
|
|
@@ -76543,10 +76373,10 @@ var config18 = {
|
|
|
76543
76373
|
path: "./templates"
|
|
76544
76374
|
}
|
|
76545
76375
|
};
|
|
76546
|
-
var
|
|
76376
|
+
var c3_default18 = config16;
|
|
76547
76377
|
|
|
76548
76378
|
// templates/hello-world-durable-object-with-assets/c3.ts
|
|
76549
|
-
var
|
|
76379
|
+
var config17 = {
|
|
76550
76380
|
configVersion: 1,
|
|
76551
76381
|
id: "hello-world-durable-object-with-assets",
|
|
76552
76382
|
path: "templates/hello-world-durable-object-with-assets",
|
|
@@ -76564,10 +76394,10 @@ var config19 = {
|
|
|
76564
76394
|
}
|
|
76565
76395
|
}
|
|
76566
76396
|
};
|
|
76567
|
-
var
|
|
76397
|
+
var c3_default19 = config17;
|
|
76568
76398
|
|
|
76569
76399
|
// templates/hello-world-durable-object/c3.ts
|
|
76570
|
-
var
|
|
76400
|
+
var c3_default20 = {
|
|
76571
76401
|
configVersion: 1,
|
|
76572
76402
|
id: "hello-world-durable-object",
|
|
76573
76403
|
displayName: "Worker + Durable Objects",
|
|
@@ -76586,7 +76416,7 @@ var c3_default22 = {
|
|
|
76586
76416
|
};
|
|
76587
76417
|
|
|
76588
76418
|
// templates/hello-world-with-assets/c3.ts
|
|
76589
|
-
var
|
|
76419
|
+
var c3_default21 = {
|
|
76590
76420
|
configVersion: 1,
|
|
76591
76421
|
id: "hello-world-with-assets",
|
|
76592
76422
|
path: "templates/hello-world-with-assets",
|
|
@@ -76611,7 +76441,7 @@ var c3_default23 = {
|
|
|
76611
76441
|
// templates/hello-world/c3.ts
|
|
76612
76442
|
var import_promises2 = require("node:fs/promises");
|
|
76613
76443
|
var import_node_path5 = require("node:path");
|
|
76614
|
-
var
|
|
76444
|
+
var c3_default22 = {
|
|
76615
76445
|
configVersion: 1,
|
|
76616
76446
|
id: "hello-world",
|
|
76617
76447
|
displayName: "Worker only",
|
|
@@ -76644,35 +76474,55 @@ var c3_default24 = {
|
|
|
76644
76474
|
}
|
|
76645
76475
|
};
|
|
76646
76476
|
|
|
76647
|
-
// templates/hono/c3.ts
|
|
76648
|
-
var
|
|
76477
|
+
// templates/hono/pages/c3.ts
|
|
76478
|
+
var generate13 = async (ctx) => {
|
|
76649
76479
|
const { name: pm4 } = detectPackageManager();
|
|
76650
76480
|
await runFrameworkGenerator(ctx, [
|
|
76651
76481
|
ctx.project.name,
|
|
76652
76482
|
"--template",
|
|
76653
|
-
"cloudflare-
|
|
76483
|
+
"cloudflare-pages",
|
|
76654
76484
|
"--install",
|
|
76655
76485
|
"--pm",
|
|
76656
76486
|
pm4
|
|
76657
76487
|
]);
|
|
76658
76488
|
logRaw("");
|
|
76659
76489
|
};
|
|
76660
|
-
var
|
|
76661
|
-
|
|
76662
|
-
|
|
76663
|
-
|
|
76664
|
-
|
|
76665
|
-
|
|
76666
|
-
|
|
76667
|
-
|
|
76668
|
-
|
|
76669
|
-
|
|
76670
|
-
|
|
76490
|
+
var config18 = {
|
|
76491
|
+
configVersion: 1,
|
|
76492
|
+
id: "hono",
|
|
76493
|
+
frameworkCli: "create-hono",
|
|
76494
|
+
displayName: "Hono",
|
|
76495
|
+
copyFiles: {
|
|
76496
|
+
path: "./templates"
|
|
76497
|
+
},
|
|
76498
|
+
path: "templates/hono/pages",
|
|
76499
|
+
platform: "pages",
|
|
76500
|
+
generate: generate13,
|
|
76501
|
+
transformPackageJson: async () => ({
|
|
76502
|
+
scripts: {
|
|
76503
|
+
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
76671
76504
|
}
|
|
76672
|
-
})
|
|
76673
|
-
|
|
76505
|
+
}),
|
|
76506
|
+
devScript: "dev",
|
|
76507
|
+
deployScript: "deploy",
|
|
76508
|
+
previewScript: "dev"
|
|
76674
76509
|
};
|
|
76675
|
-
var
|
|
76510
|
+
var c3_default23 = config18;
|
|
76511
|
+
|
|
76512
|
+
// templates/hono/workers/c3.ts
|
|
76513
|
+
var generate14 = async (ctx) => {
|
|
76514
|
+
const { name: pm4 } = detectPackageManager();
|
|
76515
|
+
await runFrameworkGenerator(ctx, [
|
|
76516
|
+
ctx.project.name,
|
|
76517
|
+
"--template",
|
|
76518
|
+
"cloudflare-workers",
|
|
76519
|
+
"--install",
|
|
76520
|
+
"--pm",
|
|
76521
|
+
pm4
|
|
76522
|
+
]);
|
|
76523
|
+
logRaw("");
|
|
76524
|
+
};
|
|
76525
|
+
var config19 = {
|
|
76676
76526
|
configVersion: 1,
|
|
76677
76527
|
id: "hono",
|
|
76678
76528
|
frameworkCli: "create-hono",
|
|
@@ -76681,12 +76531,10 @@ var config20 = {
|
|
|
76681
76531
|
path: "./templates"
|
|
76682
76532
|
},
|
|
76683
76533
|
platform: "workers",
|
|
76684
|
-
|
|
76685
|
-
|
|
76534
|
+
path: "templates/hono/workers",
|
|
76535
|
+
generate: generate14,
|
|
76686
76536
|
transformPackageJson: async () => ({
|
|
76687
76537
|
scripts: {
|
|
76688
|
-
dev: "wrangler dev",
|
|
76689
|
-
deploy: "wrangler deploy --minify",
|
|
76690
76538
|
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
76691
76539
|
}
|
|
76692
76540
|
}),
|
|
@@ -76694,12 +76542,19 @@ var config20 = {
|
|
|
76694
76542
|
deployScript: "deploy",
|
|
76695
76543
|
previewScript: "dev"
|
|
76696
76544
|
};
|
|
76545
|
+
var c3_default24 = config19;
|
|
76546
|
+
|
|
76547
|
+
// templates/hono/c3.ts
|
|
76548
|
+
var config20 = {
|
|
76549
|
+
displayName: "Hono",
|
|
76550
|
+
platformVariants: { pages: c3_default23, workers: c3_default24 }
|
|
76551
|
+
};
|
|
76697
76552
|
var c3_default25 = config20;
|
|
76698
76553
|
|
|
76699
76554
|
// templates/next/c3.ts
|
|
76700
76555
|
var import_path10 = require("path");
|
|
76701
|
-
var { npm:
|
|
76702
|
-
var
|
|
76556
|
+
var { npm: npm10, npx: npx4 } = detectPackageManager();
|
|
76557
|
+
var generate15 = async (ctx) => {
|
|
76703
76558
|
const projectName = ctx.project.name;
|
|
76704
76559
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
76705
76560
|
const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
|
|
@@ -76724,7 +76579,7 @@ var updateNextConfig2 = (usesTs) => {
|
|
|
76724
76579
|
writeFile2(configFile, updatedConfigFile);
|
|
76725
76580
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76726
76581
|
};
|
|
76727
|
-
var
|
|
76582
|
+
var configure9 = async (ctx) => {
|
|
76728
76583
|
const projectPath = ctx.project.path;
|
|
76729
76584
|
const path6 = probePaths([
|
|
76730
76585
|
`${projectPath}/pages/api`,
|
|
@@ -76805,8 +76660,8 @@ var c3_default26 = {
|
|
|
76805
76660
|
frameworkCli: "create-next-app",
|
|
76806
76661
|
platform: "pages",
|
|
76807
76662
|
displayName: "Next.js",
|
|
76808
|
-
generate:
|
|
76809
|
-
configure:
|
|
76663
|
+
generate: generate15,
|
|
76664
|
+
configure: configure9,
|
|
76810
76665
|
copyFiles: {
|
|
76811
76666
|
async selectVariant(ctx) {
|
|
76812
76667
|
const isApp = probePaths([
|
|
@@ -76837,12 +76692,12 @@ var c3_default26 = {
|
|
|
76837
76692
|
}
|
|
76838
76693
|
},
|
|
76839
76694
|
transformPackageJson: async (_3, ctx) => {
|
|
76840
|
-
const isNpm =
|
|
76841
|
-
const isBun =
|
|
76695
|
+
const isNpm = npm10 === "npm";
|
|
76696
|
+
const isBun = npm10 === "bun";
|
|
76842
76697
|
const isNpmOrBun = isNpm || isBun;
|
|
76843
76698
|
const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
|
|
76844
76699
|
const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
|
|
76845
|
-
const pmCommand = isNpmOrBun ? npx4 :
|
|
76700
|
+
const pmCommand = isNpmOrBun ? npx4 : npm10;
|
|
76846
76701
|
const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
|
|
76847
76702
|
return {
|
|
76848
76703
|
scripts: {
|
|
@@ -76862,21 +76717,21 @@ var c3_default26 = {
|
|
|
76862
76717
|
};
|
|
76863
76718
|
|
|
76864
76719
|
// templates/nuxt/pages/c3.ts
|
|
76865
|
-
var
|
|
76866
|
-
var { npm:
|
|
76867
|
-
var
|
|
76720
|
+
var recast7 = __toESM(require_main3());
|
|
76721
|
+
var { npm: npm11, name: pm2 } = detectPackageManager();
|
|
76722
|
+
var generate16 = async (ctx) => {
|
|
76868
76723
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76869
76724
|
await runFrameworkGenerator(ctx, [
|
|
76870
76725
|
"init",
|
|
76871
76726
|
ctx.project.name,
|
|
76872
76727
|
"--packageManager",
|
|
76873
|
-
|
|
76728
|
+
npm11,
|
|
76874
76729
|
gitFlag
|
|
76875
76730
|
]);
|
|
76876
76731
|
writeFile2("./.node-version", "18");
|
|
76877
76732
|
logRaw("");
|
|
76878
76733
|
};
|
|
76879
|
-
var
|
|
76734
|
+
var configure10 = async (ctx) => {
|
|
76880
76735
|
const packages = ["nitro-cloudflare-dev"];
|
|
76881
76736
|
if (pm2 === "pnpm") {
|
|
76882
76737
|
packages.push("h3");
|
|
@@ -76884,7 +76739,7 @@ var configure13 = async (ctx) => {
|
|
|
76884
76739
|
await installPackages(packages, {
|
|
76885
76740
|
dev: true,
|
|
76886
76741
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76887
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76742
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
|
|
76888
76743
|
});
|
|
76889
76744
|
updateNuxtConfig();
|
|
76890
76745
|
updateEnvTypes2(ctx);
|
|
@@ -76907,7 +76762,7 @@ var updateNuxtConfig = () => {
|
|
|
76907
76762
|
const s = spinner();
|
|
76908
76763
|
const configFile = "nuxt.config.ts";
|
|
76909
76764
|
s.start(`Updating \`${configFile}\``);
|
|
76910
|
-
const b3 =
|
|
76765
|
+
const b3 = recast7.types.builders;
|
|
76911
76766
|
const presetDef = b3.objectProperty(
|
|
76912
76767
|
b3.identifier("nitro"),
|
|
76913
76768
|
b3.objectExpression([
|
|
@@ -76955,12 +76810,12 @@ var config21 = {
|
|
|
76955
76810
|
path: "./templates"
|
|
76956
76811
|
},
|
|
76957
76812
|
path: "templates/nuxt/pages",
|
|
76958
|
-
generate:
|
|
76959
|
-
configure:
|
|
76813
|
+
generate: generate16,
|
|
76814
|
+
configure: configure10,
|
|
76960
76815
|
transformPackageJson: async () => ({
|
|
76961
76816
|
scripts: {
|
|
76962
|
-
deploy: `${
|
|
76963
|
-
preview: `${
|
|
76817
|
+
deploy: `${npm11} run build && wrangler pages deploy`,
|
|
76818
|
+
preview: `${npm11} run build && wrangler pages dev`,
|
|
76964
76819
|
"cf-typegen": `wrangler types`
|
|
76965
76820
|
}
|
|
76966
76821
|
}),
|
|
@@ -76971,21 +76826,21 @@ var config21 = {
|
|
|
76971
76826
|
var c3_default27 = config21;
|
|
76972
76827
|
|
|
76973
76828
|
// templates/nuxt/workers/c3.ts
|
|
76974
|
-
var
|
|
76975
|
-
var { npm:
|
|
76976
|
-
var
|
|
76829
|
+
var recast8 = __toESM(require_main3());
|
|
76830
|
+
var { npm: npm12, name: pm3 } = detectPackageManager();
|
|
76831
|
+
var generate17 = async (ctx) => {
|
|
76977
76832
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76978
76833
|
await runFrameworkGenerator(ctx, [
|
|
76979
76834
|
"init",
|
|
76980
76835
|
ctx.project.name,
|
|
76981
76836
|
"--packageManager",
|
|
76982
|
-
|
|
76837
|
+
npm12,
|
|
76983
76838
|
gitFlag
|
|
76984
76839
|
]);
|
|
76985
76840
|
writeFile2("./.node-version", "18");
|
|
76986
76841
|
logRaw("");
|
|
76987
76842
|
};
|
|
76988
|
-
var
|
|
76843
|
+
var configure11 = async (ctx) => {
|
|
76989
76844
|
const packages = ["nitro-cloudflare-dev", "nitropack"];
|
|
76990
76845
|
if (pm3 === "pnpm") {
|
|
76991
76846
|
packages.push("h3");
|
|
@@ -76993,7 +76848,7 @@ var configure14 = async (ctx) => {
|
|
|
76993
76848
|
await installPackages(packages, {
|
|
76994
76849
|
dev: true,
|
|
76995
76850
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76996
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76851
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm12} install\``)}`
|
|
76997
76852
|
});
|
|
76998
76853
|
updateNuxtConfig2();
|
|
76999
76854
|
updateEnvTypes3(ctx);
|
|
@@ -77016,7 +76871,7 @@ var updateNuxtConfig2 = () => {
|
|
|
77016
76871
|
const s = spinner();
|
|
77017
76872
|
const configFile = "nuxt.config.ts";
|
|
77018
76873
|
s.start(`Updating \`${configFile}\``);
|
|
77019
|
-
const b3 =
|
|
76874
|
+
const b3 = recast8.types.builders;
|
|
77020
76875
|
const presetDef = b3.objectProperty(
|
|
77021
76876
|
b3.identifier("nitro"),
|
|
77022
76877
|
b3.objectExpression([
|
|
@@ -77064,12 +76919,12 @@ var config22 = {
|
|
|
77064
76919
|
path: "./templates"
|
|
77065
76920
|
},
|
|
77066
76921
|
path: "templates/nuxt/workers",
|
|
77067
|
-
generate:
|
|
77068
|
-
configure:
|
|
76922
|
+
generate: generate17,
|
|
76923
|
+
configure: configure11,
|
|
77069
76924
|
transformPackageJson: async () => ({
|
|
77070
76925
|
scripts: {
|
|
77071
|
-
deploy: `${
|
|
77072
|
-
preview: `${
|
|
76926
|
+
deploy: `${npm12} run build && wrangler deploy`,
|
|
76927
|
+
preview: `${npm12} run build && wrangler dev`,
|
|
77073
76928
|
"cf-typegen": `wrangler types`
|
|
77074
76929
|
}
|
|
77075
76930
|
}),
|
|
@@ -77262,7 +77117,7 @@ var c3_default31 = {
|
|
|
77262
77117
|
})
|
|
77263
77118
|
};
|
|
77264
77119
|
function buildConfigure(params) {
|
|
77265
|
-
return async function
|
|
77120
|
+
return async function configure21(ctx) {
|
|
77266
77121
|
const loginSuccess = await params.login(ctx);
|
|
77267
77122
|
if (!loginSuccess) {
|
|
77268
77123
|
throw new Error("Failed to login to Cloudflare");
|
|
@@ -77303,13 +77158,13 @@ var c3_default32 = {
|
|
|
77303
77158
|
};
|
|
77304
77159
|
|
|
77305
77160
|
// templates/qwik/c3.ts
|
|
77306
|
-
var
|
|
77307
|
-
var { npm:
|
|
77308
|
-
var
|
|
77161
|
+
var recast9 = __toESM(require_main3());
|
|
77162
|
+
var { npm: npm13, npx: npx5, name: name2 } = detectPackageManager();
|
|
77163
|
+
var generate18 = async (ctx) => {
|
|
77309
77164
|
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
77310
77165
|
};
|
|
77311
|
-
var
|
|
77312
|
-
const cmd = [name2 === "pnpm" ?
|
|
77166
|
+
var configure12 = async (ctx) => {
|
|
77167
|
+
const cmd = [name2 === "pnpm" ? npm13 : npx5, "qwik", "add", "cloudflare-pages"];
|
|
77313
77168
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
77314
77169
|
await runCommand(cmd);
|
|
77315
77170
|
addBindingsProxy2(ctx);
|
|
@@ -77322,7 +77177,7 @@ var addBindingsProxy2 = (ctx) => {
|
|
|
77322
77177
|
const s = spinner();
|
|
77323
77178
|
s.start("Updating `vite.config.ts`");
|
|
77324
77179
|
const snippets = loadTemplateSnippets(ctx);
|
|
77325
|
-
const b3 =
|
|
77180
|
+
const b3 = recast9.types.builders;
|
|
77326
77181
|
transformFile("vite.config.ts", {
|
|
77327
77182
|
// Insert the env declaration after the last import (but before the rest of the body)
|
|
77328
77183
|
visitProgram: function(n) {
|
|
@@ -77364,7 +77219,7 @@ var populateCloudflareEnv2 = () => {
|
|
|
77364
77219
|
s.start(`Updating \`${entrypointPath}\``);
|
|
77365
77220
|
transformFile(entrypointPath, {
|
|
77366
77221
|
visitTSInterfaceDeclaration: function(n) {
|
|
77367
|
-
const b3 =
|
|
77222
|
+
const b3 = recast9.types.builders;
|
|
77368
77223
|
const id = n.node.id;
|
|
77369
77224
|
if (id.name !== "QwikCityPlatform") {
|
|
77370
77225
|
this.traverse(n);
|
|
@@ -77394,12 +77249,12 @@ var config24 = {
|
|
|
77394
77249
|
copyFiles: {
|
|
77395
77250
|
path: "./templates"
|
|
77396
77251
|
},
|
|
77397
|
-
generate:
|
|
77398
|
-
configure:
|
|
77252
|
+
generate: generate18,
|
|
77253
|
+
configure: configure12,
|
|
77399
77254
|
transformPackageJson: async () => ({
|
|
77400
77255
|
scripts: {
|
|
77401
|
-
deploy: `${
|
|
77402
|
-
preview: `${
|
|
77256
|
+
deploy: `${npm13} run build && wrangler pages deploy`,
|
|
77257
|
+
preview: `${npm13} run build && wrangler pages dev`,
|
|
77403
77258
|
"cf-typegen": `wrangler types`
|
|
77404
77259
|
}
|
|
77405
77260
|
}),
|
|
@@ -77410,8 +77265,8 @@ var config24 = {
|
|
|
77410
77265
|
var c3_default33 = config24;
|
|
77411
77266
|
|
|
77412
77267
|
// templates/react/pages/c3.ts
|
|
77413
|
-
var { npm:
|
|
77414
|
-
var
|
|
77268
|
+
var { npm: npm14 } = detectPackageManager();
|
|
77269
|
+
var generate19 = async (ctx) => {
|
|
77415
77270
|
const variant = await inputPrompt({
|
|
77416
77271
|
type: "select",
|
|
77417
77272
|
question: "Select a variant:",
|
|
@@ -77448,11 +77303,11 @@ var config25 = {
|
|
|
77448
77303
|
displayName: "React",
|
|
77449
77304
|
platform: "pages",
|
|
77450
77305
|
path: "templates/react/pages",
|
|
77451
|
-
generate:
|
|
77306
|
+
generate: generate19,
|
|
77452
77307
|
transformPackageJson: async () => ({
|
|
77453
77308
|
scripts: {
|
|
77454
|
-
deploy: `${
|
|
77455
|
-
preview: `${
|
|
77309
|
+
deploy: `${npm14} run build && wrangler pages deploy ./dist`,
|
|
77310
|
+
preview: `${npm14} run build && wrangler pages dev ./dist`
|
|
77456
77311
|
}
|
|
77457
77312
|
}),
|
|
77458
77313
|
devScript: "dev",
|
|
@@ -77463,11 +77318,11 @@ var c3_default34 = config25;
|
|
|
77463
77318
|
|
|
77464
77319
|
// templates/react/workers/c3.ts
|
|
77465
77320
|
var import_assert2 = __toESM(require("assert"));
|
|
77466
|
-
var
|
|
77467
|
-
var b2 =
|
|
77468
|
-
var t =
|
|
77469
|
-
var { npm:
|
|
77470
|
-
var
|
|
77321
|
+
var recast10 = __toESM(require_main3());
|
|
77322
|
+
var b2 = recast10.types.builders;
|
|
77323
|
+
var t = recast10.types.namedTypes;
|
|
77324
|
+
var { npm: npm15 } = detectPackageManager();
|
|
77325
|
+
var generate20 = async (ctx) => {
|
|
77471
77326
|
const variant = await getVariant();
|
|
77472
77327
|
ctx.args.lang = variant.lang;
|
|
77473
77328
|
await runFrameworkGenerator(ctx, [
|
|
@@ -77477,7 +77332,7 @@ var generate22 = async (ctx) => {
|
|
|
77477
77332
|
]);
|
|
77478
77333
|
logRaw("");
|
|
77479
77334
|
};
|
|
77480
|
-
var
|
|
77335
|
+
var configure13 = async (ctx) => {
|
|
77481
77336
|
await installPackages(["@cloudflare/vite-plugin"], {
|
|
77482
77337
|
dev: true,
|
|
77483
77338
|
startText: "Installing the Cloudflare Vite plugin",
|
|
@@ -77508,9 +77363,9 @@ function transformViteConfig(ctx) {
|
|
|
77508
77363
|
if (callee.name !== "defineConfig") {
|
|
77509
77364
|
return this.traverse(n);
|
|
77510
77365
|
}
|
|
77511
|
-
const
|
|
77512
|
-
(0, import_assert2.default)(t.ObjectExpression.check(
|
|
77513
|
-
const pluginsProp =
|
|
77366
|
+
const config38 = n.node.arguments[0];
|
|
77367
|
+
(0, import_assert2.default)(t.ObjectExpression.check(config38));
|
|
77368
|
+
const pluginsProp = config38.properties.find((prop) => isPluginsProp(prop));
|
|
77514
77369
|
(0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
77515
77370
|
pluginsProp.value.elements.push(
|
|
77516
77371
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -77584,12 +77439,12 @@ var config26 = {
|
|
|
77584
77439
|
}
|
|
77585
77440
|
}
|
|
77586
77441
|
},
|
|
77587
|
-
generate:
|
|
77588
|
-
configure:
|
|
77442
|
+
generate: generate20,
|
|
77443
|
+
configure: configure13,
|
|
77589
77444
|
transformPackageJson: async (_3, ctx) => ({
|
|
77590
77445
|
scripts: {
|
|
77591
|
-
deploy: `${
|
|
77592
|
-
preview: `${
|
|
77446
|
+
deploy: `${npm15} run build && wrangler deploy`,
|
|
77447
|
+
preview: `${npm15} run build && vite preview`,
|
|
77593
77448
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
77594
77449
|
}
|
|
77595
77450
|
}),
|
|
@@ -77606,9 +77461,9 @@ var config27 = {
|
|
|
77606
77461
|
};
|
|
77607
77462
|
var c3_default36 = config27;
|
|
77608
77463
|
|
|
77609
|
-
// templates/remix/c3.ts
|
|
77610
|
-
var { npm:
|
|
77611
|
-
var
|
|
77464
|
+
// templates/remix/pages/c3.ts
|
|
77465
|
+
var { npm: npm16 } = detectPackageManager();
|
|
77466
|
+
var generate21 = async (ctx) => {
|
|
77612
77467
|
await runFrameworkGenerator(ctx, [
|
|
77613
77468
|
ctx.project.name,
|
|
77614
77469
|
"--template",
|
|
@@ -77616,7 +77471,7 @@ var generate23 = async (ctx) => {
|
|
|
77616
77471
|
]);
|
|
77617
77472
|
logRaw("");
|
|
77618
77473
|
};
|
|
77619
|
-
var
|
|
77474
|
+
var configure14 = async () => {
|
|
77620
77475
|
const typeDefsPath = "load-context.ts";
|
|
77621
77476
|
const s = spinner();
|
|
77622
77477
|
s.start(`Updating \`${typeDefsPath}\``);
|
|
@@ -77640,12 +77495,13 @@ var config28 = {
|
|
|
77640
77495
|
copyFiles: {
|
|
77641
77496
|
path: "./templates"
|
|
77642
77497
|
},
|
|
77643
|
-
|
|
77644
|
-
|
|
77498
|
+
path: "templates/remix/pages",
|
|
77499
|
+
generate: generate21,
|
|
77500
|
+
configure: configure14,
|
|
77645
77501
|
transformPackageJson: async () => ({
|
|
77646
77502
|
scripts: {
|
|
77647
|
-
deploy: `${
|
|
77648
|
-
preview: `${
|
|
77503
|
+
deploy: `${npm16} run build && wrangler pages deploy`,
|
|
77504
|
+
preview: `${npm16} run build && wrangler pages dev`,
|
|
77649
77505
|
"cf-typegen": `wrangler types`
|
|
77650
77506
|
}
|
|
77651
77507
|
}),
|
|
@@ -77655,8 +77511,57 @@ var config28 = {
|
|
|
77655
77511
|
};
|
|
77656
77512
|
var c3_default37 = config28;
|
|
77657
77513
|
|
|
77514
|
+
// templates/remix/workers/c3.ts
|
|
77515
|
+
var { npm: npm17 } = detectPackageManager();
|
|
77516
|
+
var generate22 = async (ctx) => {
|
|
77517
|
+
await runFrameworkGenerator(ctx, [
|
|
77518
|
+
ctx.project.name,
|
|
77519
|
+
"--template",
|
|
77520
|
+
"https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
|
|
77521
|
+
]);
|
|
77522
|
+
logRaw("");
|
|
77523
|
+
};
|
|
77524
|
+
var configure15 = async () => {
|
|
77525
|
+
await installPackages(["wrangler@latest"], {
|
|
77526
|
+
dev: true,
|
|
77527
|
+
startText: "Updating the Wrangler version",
|
|
77528
|
+
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
77529
|
+
});
|
|
77530
|
+
};
|
|
77531
|
+
var config29 = {
|
|
77532
|
+
configVersion: 1,
|
|
77533
|
+
id: "remix",
|
|
77534
|
+
frameworkCli: "create-remix",
|
|
77535
|
+
platform: "workers",
|
|
77536
|
+
displayName: "Remix",
|
|
77537
|
+
copyFiles: {
|
|
77538
|
+
path: "./templates"
|
|
77539
|
+
},
|
|
77540
|
+
path: "templates/remix/workers",
|
|
77541
|
+
generate: generate22,
|
|
77542
|
+
configure: configure15,
|
|
77543
|
+
transformPackageJson: async () => ({
|
|
77544
|
+
scripts: {
|
|
77545
|
+
deploy: `${npm17} run build && wrangler deploy`,
|
|
77546
|
+
preview: `${npm17} run build && wrangler dev`,
|
|
77547
|
+
"cf-typegen": `wrangler types`
|
|
77548
|
+
}
|
|
77549
|
+
}),
|
|
77550
|
+
devScript: "dev",
|
|
77551
|
+
deployScript: "deploy",
|
|
77552
|
+
previewScript: "preview"
|
|
77553
|
+
};
|
|
77554
|
+
var c3_default38 = config29;
|
|
77555
|
+
|
|
77556
|
+
// templates/remix/c3.ts
|
|
77557
|
+
var config30 = {
|
|
77558
|
+
displayName: "Remix",
|
|
77559
|
+
platformVariants: { pages: c3_default37, workers: c3_default38 }
|
|
77560
|
+
};
|
|
77561
|
+
var c3_default39 = config30;
|
|
77562
|
+
|
|
77658
77563
|
// templates/scheduled/c3.ts
|
|
77659
|
-
var
|
|
77564
|
+
var c3_default40 = {
|
|
77660
77565
|
configVersion: 1,
|
|
77661
77566
|
id: "scheduled",
|
|
77662
77567
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -77675,13 +77580,13 @@ var c3_default38 = {
|
|
|
77675
77580
|
};
|
|
77676
77581
|
|
|
77677
77582
|
// templates/solid/c3.ts
|
|
77678
|
-
var
|
|
77679
|
-
var { npm:
|
|
77680
|
-
var
|
|
77583
|
+
var recast11 = __toESM(require_main3());
|
|
77584
|
+
var { npm: npm18 } = detectPackageManager();
|
|
77585
|
+
var generate23 = async (ctx) => {
|
|
77681
77586
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
77682
77587
|
logRaw("");
|
|
77683
77588
|
};
|
|
77684
|
-
var
|
|
77589
|
+
var configure16 = async (ctx) => {
|
|
77685
77590
|
usesTypescript(ctx);
|
|
77686
77591
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
77687
77592
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
@@ -77691,7 +77596,7 @@ var configure18 = async (ctx) => {
|
|
|
77691
77596
|
if (callee.name !== "defineConfig") {
|
|
77692
77597
|
return this.traverse(n);
|
|
77693
77598
|
}
|
|
77694
|
-
const b3 =
|
|
77599
|
+
const b3 = recast11.types.builders;
|
|
77695
77600
|
mergeObjectProperties(
|
|
77696
77601
|
n.node.arguments[0],
|
|
77697
77602
|
[
|
|
@@ -77719,7 +77624,7 @@ var configure18 = async (ctx) => {
|
|
|
77719
77624
|
}
|
|
77720
77625
|
});
|
|
77721
77626
|
};
|
|
77722
|
-
var
|
|
77627
|
+
var config31 = {
|
|
77723
77628
|
configVersion: 1,
|
|
77724
77629
|
id: "solid",
|
|
77725
77630
|
frameworkCli: "create-solid",
|
|
@@ -77728,12 +77633,12 @@ var config29 = {
|
|
|
77728
77633
|
copyFiles: {
|
|
77729
77634
|
path: "./templates"
|
|
77730
77635
|
},
|
|
77731
|
-
generate:
|
|
77732
|
-
configure:
|
|
77636
|
+
generate: generate23,
|
|
77637
|
+
configure: configure16,
|
|
77733
77638
|
transformPackageJson: async () => ({
|
|
77734
77639
|
scripts: {
|
|
77735
|
-
preview: `${
|
|
77736
|
-
deploy: `${
|
|
77640
|
+
preview: `${npm18} run build && npx wrangler pages dev`,
|
|
77641
|
+
deploy: `${npm18} run build && wrangler pages deploy`
|
|
77737
77642
|
}
|
|
77738
77643
|
}),
|
|
77739
77644
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -77741,29 +77646,29 @@ var config29 = {
|
|
|
77741
77646
|
deployScript: "deploy",
|
|
77742
77647
|
previewScript: "preview"
|
|
77743
77648
|
};
|
|
77744
|
-
var
|
|
77649
|
+
var c3_default41 = config31;
|
|
77745
77650
|
|
|
77746
|
-
// templates/svelte/c3.ts
|
|
77651
|
+
// templates/svelte/pages/c3.ts
|
|
77747
77652
|
var import_node_fs3 = require("node:fs");
|
|
77748
|
-
var
|
|
77749
|
-
var
|
|
77750
|
-
var { npm:
|
|
77751
|
-
var
|
|
77653
|
+
var import_node_os3 = require("node:os");
|
|
77654
|
+
var recast12 = __toESM(require_main3());
|
|
77655
|
+
var { npm: npm19 } = detectPackageManager();
|
|
77656
|
+
var generate24 = async (ctx) => {
|
|
77752
77657
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77753
77658
|
logRaw("");
|
|
77754
77659
|
};
|
|
77755
|
-
var
|
|
77660
|
+
var configure17 = async (ctx) => {
|
|
77756
77661
|
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
77757
77662
|
await installPackages([pkg], {
|
|
77758
77663
|
dev: true,
|
|
77759
77664
|
startText: "Adding the Cloudflare Pages adapter",
|
|
77760
77665
|
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
77761
77666
|
});
|
|
77762
|
-
|
|
77667
|
+
updateSvelteConfig();
|
|
77763
77668
|
updatePlaywrightConfig(usesTypescript(ctx));
|
|
77764
|
-
|
|
77669
|
+
updateTypeDefinitions(ctx);
|
|
77765
77670
|
};
|
|
77766
|
-
var
|
|
77671
|
+
var updateSvelteConfig = () => {
|
|
77767
77672
|
updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
|
|
77768
77673
|
transformFile("svelte.config.js", {
|
|
77769
77674
|
visitImportDeclaration: function(n) {
|
|
@@ -77797,6 +77702,105 @@ var updatePlaywrightConfig = (shouldUseTypescript) => {
|
|
|
77797
77702
|
}
|
|
77798
77703
|
});
|
|
77799
77704
|
};
|
|
77705
|
+
var updateTypeDefinitions = (ctx) => {
|
|
77706
|
+
if (!usesTypescript(ctx)) {
|
|
77707
|
+
return;
|
|
77708
|
+
}
|
|
77709
|
+
updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
|
|
77710
|
+
const b3 = recast12.types.builders;
|
|
77711
|
+
transformFile("src/app.d.ts", {
|
|
77712
|
+
visitTSModuleDeclaration(n) {
|
|
77713
|
+
if (n.value.id.name === "App" && n.node.body) {
|
|
77714
|
+
const moduleBlock = n.node.body;
|
|
77715
|
+
const platformInterface = b3.tsInterfaceDeclaration(
|
|
77716
|
+
b3.identifier("Platform"),
|
|
77717
|
+
b3.tsInterfaceBody([
|
|
77718
|
+
b3.tsPropertySignature(
|
|
77719
|
+
b3.identifier("env"),
|
|
77720
|
+
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier("Env")))
|
|
77721
|
+
),
|
|
77722
|
+
b3.tsPropertySignature(
|
|
77723
|
+
b3.identifier("cf"),
|
|
77724
|
+
b3.tsTypeAnnotation(
|
|
77725
|
+
b3.tsTypeReference(b3.identifier("CfProperties"))
|
|
77726
|
+
)
|
|
77727
|
+
),
|
|
77728
|
+
b3.tsPropertySignature(
|
|
77729
|
+
b3.identifier("ctx"),
|
|
77730
|
+
b3.tsTypeAnnotation(
|
|
77731
|
+
b3.tsTypeReference(b3.identifier("ExecutionContext"))
|
|
77732
|
+
)
|
|
77733
|
+
)
|
|
77734
|
+
])
|
|
77735
|
+
);
|
|
77736
|
+
moduleBlock.body.unshift(platformInterface);
|
|
77737
|
+
}
|
|
77738
|
+
this.traverse(n);
|
|
77739
|
+
}
|
|
77740
|
+
});
|
|
77741
|
+
};
|
|
77742
|
+
var config32 = {
|
|
77743
|
+
configVersion: 1,
|
|
77744
|
+
id: "svelte",
|
|
77745
|
+
frameworkCli: "sv",
|
|
77746
|
+
displayName: "SvelteKit",
|
|
77747
|
+
platform: "pages",
|
|
77748
|
+
copyFiles: {
|
|
77749
|
+
path: "./templates"
|
|
77750
|
+
},
|
|
77751
|
+
path: "templates/svelte/pages",
|
|
77752
|
+
generate: generate24,
|
|
77753
|
+
configure: configure17,
|
|
77754
|
+
transformPackageJson: async (original, ctx) => {
|
|
77755
|
+
let scripts = {
|
|
77756
|
+
preview: `${npm19} run build && wrangler pages dev`,
|
|
77757
|
+
deploy: `${npm19} run build && wrangler pages deploy`
|
|
77758
|
+
};
|
|
77759
|
+
if (usesTypescript(ctx)) {
|
|
77760
|
+
const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
|
|
77761
|
+
scripts = {
|
|
77762
|
+
...scripts,
|
|
77763
|
+
"cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
|
|
77764
|
+
};
|
|
77765
|
+
}
|
|
77766
|
+
return { scripts };
|
|
77767
|
+
},
|
|
77768
|
+
devScript: "dev",
|
|
77769
|
+
deployScript: "deploy",
|
|
77770
|
+
previewScript: "preview"
|
|
77771
|
+
};
|
|
77772
|
+
var c3_default42 = config32;
|
|
77773
|
+
|
|
77774
|
+
// templates/svelte/workers/c3.ts
|
|
77775
|
+
var import_node_os4 = require("node:os");
|
|
77776
|
+
var recast13 = __toESM(require_main3());
|
|
77777
|
+
var { npm: npm20 } = detectPackageManager();
|
|
77778
|
+
var generate25 = async (ctx) => {
|
|
77779
|
+
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77780
|
+
logRaw("");
|
|
77781
|
+
};
|
|
77782
|
+
var configure18 = async (ctx) => {
|
|
77783
|
+
const pkg = `@sveltejs/adapter-cloudflare`;
|
|
77784
|
+
await installPackages([pkg], {
|
|
77785
|
+
dev: true,
|
|
77786
|
+
startText: "Adding the Cloudflare adapter",
|
|
77787
|
+
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
77788
|
+
});
|
|
77789
|
+
updateSvelteConfig2();
|
|
77790
|
+
updateTypeDefinitions2(ctx);
|
|
77791
|
+
};
|
|
77792
|
+
var updateSvelteConfig2 = () => {
|
|
77793
|
+
updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
|
|
77794
|
+
transformFile("svelte.config.js", {
|
|
77795
|
+
visitImportDeclaration: function(n) {
|
|
77796
|
+
const importSource = n.value.source;
|
|
77797
|
+
if (importSource.value === "@sveltejs/adapter-auto") {
|
|
77798
|
+
importSource.value = "@sveltejs/adapter-cloudflare";
|
|
77799
|
+
}
|
|
77800
|
+
return false;
|
|
77801
|
+
}
|
|
77802
|
+
});
|
|
77803
|
+
};
|
|
77800
77804
|
var updateTypeDefinitions2 = (ctx) => {
|
|
77801
77805
|
if (!usesTypescript(ctx)) {
|
|
77802
77806
|
return;
|
|
@@ -77834,21 +77838,22 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
77834
77838
|
}
|
|
77835
77839
|
});
|
|
77836
77840
|
};
|
|
77837
|
-
var
|
|
77841
|
+
var config33 = {
|
|
77838
77842
|
configVersion: 1,
|
|
77839
77843
|
id: "svelte",
|
|
77840
77844
|
frameworkCli: "sv",
|
|
77841
77845
|
displayName: "SvelteKit",
|
|
77842
|
-
platform: "
|
|
77846
|
+
platform: "workers",
|
|
77843
77847
|
copyFiles: {
|
|
77844
77848
|
path: "./templates"
|
|
77845
77849
|
},
|
|
77850
|
+
path: "templates/svelte/workers",
|
|
77846
77851
|
generate: generate25,
|
|
77847
|
-
configure:
|
|
77852
|
+
configure: configure18,
|
|
77848
77853
|
transformPackageJson: async (original, ctx) => {
|
|
77849
77854
|
let scripts = {
|
|
77850
|
-
preview: `${npm20} run build && wrangler
|
|
77851
|
-
deploy: `${npm20} run build && wrangler
|
|
77855
|
+
preview: `${npm20} run build && wrangler dev`,
|
|
77856
|
+
deploy: `${npm20} run build && wrangler deploy`
|
|
77852
77857
|
};
|
|
77853
77858
|
if (usesTypescript(ctx)) {
|
|
77854
77859
|
const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
|
|
@@ -77863,14 +77868,21 @@ var config30 = {
|
|
|
77863
77868
|
deployScript: "deploy",
|
|
77864
77869
|
previewScript: "preview"
|
|
77865
77870
|
};
|
|
77866
|
-
var
|
|
77871
|
+
var c3_default43 = config33;
|
|
77872
|
+
|
|
77873
|
+
// templates/svelte/c3.ts
|
|
77874
|
+
var config34 = {
|
|
77875
|
+
displayName: "SvelteKit",
|
|
77876
|
+
platformVariants: { pages: c3_default42, workers: c3_default43 }
|
|
77877
|
+
};
|
|
77878
|
+
var c3_default44 = config34;
|
|
77867
77879
|
|
|
77868
77880
|
// templates/vue/pages/c3.ts
|
|
77869
77881
|
var { npm: npm21 } = detectPackageManager();
|
|
77870
77882
|
var generate26 = async (ctx) => {
|
|
77871
77883
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
77872
77884
|
};
|
|
77873
|
-
var
|
|
77885
|
+
var config35 = {
|
|
77874
77886
|
configVersion: 1,
|
|
77875
77887
|
id: "vue",
|
|
77876
77888
|
frameworkCli: "create-vue",
|
|
@@ -77888,7 +77900,7 @@ var config31 = {
|
|
|
77888
77900
|
deployScript: "deploy",
|
|
77889
77901
|
previewScript: "preview"
|
|
77890
77902
|
};
|
|
77891
|
-
var
|
|
77903
|
+
var c3_default45 = config35;
|
|
77892
77904
|
|
|
77893
77905
|
// templates/vue/workers/c3.ts
|
|
77894
77906
|
var { npm: npm22 } = detectPackageManager();
|
|
@@ -77909,7 +77921,7 @@ var generate27 = async (ctx) => {
|
|
|
77909
77921
|
]);
|
|
77910
77922
|
logRaw("");
|
|
77911
77923
|
};
|
|
77912
|
-
var
|
|
77924
|
+
var configure19 = async (ctx) => {
|
|
77913
77925
|
await installPackages(["@cloudflare/vite-plugin"], {
|
|
77914
77926
|
dev: true,
|
|
77915
77927
|
startText: "Installing the Cloudflare Vite plugin",
|
|
@@ -77930,7 +77942,7 @@ function updateTsconfigJson2() {
|
|
|
77930
77942
|
writeJSON("tsconfig.json", tsconfig);
|
|
77931
77943
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
77932
77944
|
}
|
|
77933
|
-
var
|
|
77945
|
+
var config36 = {
|
|
77934
77946
|
configVersion: 1,
|
|
77935
77947
|
id: "vue",
|
|
77936
77948
|
frameworkCli: "create-vue",
|
|
@@ -77950,7 +77962,7 @@ var config32 = {
|
|
|
77950
77962
|
}
|
|
77951
77963
|
}
|
|
77952
77964
|
},
|
|
77953
|
-
configure:
|
|
77965
|
+
configure: configure19,
|
|
77954
77966
|
generate: generate27,
|
|
77955
77967
|
transformPackageJson: async (_3, ctx) => ({
|
|
77956
77968
|
scripts: {
|
|
@@ -77963,20 +77975,20 @@ var config32 = {
|
|
|
77963
77975
|
deployScript: "deploy",
|
|
77964
77976
|
previewScript: "preview"
|
|
77965
77977
|
};
|
|
77966
|
-
var
|
|
77978
|
+
var c3_default46 = config36;
|
|
77967
77979
|
|
|
77968
77980
|
// templates/vue/c3.ts
|
|
77969
|
-
var
|
|
77981
|
+
var config37 = {
|
|
77970
77982
|
displayName: "Vue",
|
|
77971
|
-
platformVariants: { pages:
|
|
77983
|
+
platformVariants: { pages: c3_default45, workers: c3_default46 }
|
|
77972
77984
|
};
|
|
77973
|
-
var
|
|
77985
|
+
var c3_default47 = config37;
|
|
77974
77986
|
|
|
77975
77987
|
// src/git.ts
|
|
77976
77988
|
var import_node_assert = __toESM(require("node:assert"));
|
|
77977
77989
|
|
|
77978
77990
|
// ../wrangler/package.json
|
|
77979
|
-
var version2 = "4.
|
|
77991
|
+
var version2 = "4.3.0";
|
|
77980
77992
|
|
|
77981
77993
|
// src/git.ts
|
|
77982
77994
|
var offerGit = async (ctx) => {
|
|
@@ -78237,30 +78249,26 @@ var defaultSelectVariant = async (ctx) => {
|
|
|
78237
78249
|
function getFrameworkMap({ experimental = false }) {
|
|
78238
78250
|
if (experimental) {
|
|
78239
78251
|
return {
|
|
78240
|
-
|
|
78241
|
-
|
|
78242
|
-
|
|
78243
|
-
qwik: c3_default4,
|
|
78244
|
-
remix: c3_default5,
|
|
78245
|
-
solid: c3_default6,
|
|
78246
|
-
svelte: c3_default7
|
|
78252
|
+
next: c3_default,
|
|
78253
|
+
qwik: c3_default2,
|
|
78254
|
+
solid: c3_default3
|
|
78247
78255
|
};
|
|
78248
78256
|
} else {
|
|
78249
78257
|
return {
|
|
78250
|
-
analog:
|
|
78251
|
-
angular:
|
|
78252
|
-
astro:
|
|
78253
|
-
docusaurus:
|
|
78254
|
-
gatsby:
|
|
78258
|
+
analog: c3_default4,
|
|
78259
|
+
angular: c3_default7,
|
|
78260
|
+
astro: c3_default10,
|
|
78261
|
+
docusaurus: c3_default14,
|
|
78262
|
+
gatsby: c3_default17,
|
|
78255
78263
|
hono: c3_default25,
|
|
78256
78264
|
next: c3_default26,
|
|
78257
78265
|
nuxt: c3_default29,
|
|
78258
78266
|
qwik: c3_default33,
|
|
78259
78267
|
react: c3_default36,
|
|
78260
|
-
remix:
|
|
78261
|
-
solid:
|
|
78262
|
-
svelte:
|
|
78263
|
-
vue:
|
|
78268
|
+
remix: c3_default39,
|
|
78269
|
+
solid: c3_default41,
|
|
78270
|
+
svelte: c3_default44,
|
|
78271
|
+
vue: c3_default47
|
|
78264
78272
|
};
|
|
78265
78273
|
}
|
|
78266
78274
|
}
|
|
@@ -78269,13 +78277,13 @@ function getTemplateMap({ experimental = false }) {
|
|
|
78269
78277
|
return {};
|
|
78270
78278
|
} else {
|
|
78271
78279
|
return {
|
|
78272
|
-
"hello-world":
|
|
78273
|
-
"hello-world-assets-only":
|
|
78274
|
-
"hello-world-with-assets":
|
|
78275
|
-
"hello-world-durable-object":
|
|
78276
|
-
"hello-world-durable-object-with-assets":
|
|
78277
|
-
common:
|
|
78278
|
-
scheduled:
|
|
78280
|
+
"hello-world": c3_default22,
|
|
78281
|
+
"hello-world-assets-only": c3_default18,
|
|
78282
|
+
"hello-world-with-assets": c3_default21,
|
|
78283
|
+
"hello-world-durable-object": c3_default20,
|
|
78284
|
+
"hello-world-durable-object-with-assets": c3_default19,
|
|
78285
|
+
common: c3_default11,
|
|
78286
|
+
scheduled: c3_default40,
|
|
78279
78287
|
queues: c3_default32,
|
|
78280
78288
|
openapi: c3_default30,
|
|
78281
78289
|
"pre-existing": c3_default31
|
|
@@ -78426,8 +78434,8 @@ var createContext = async (args, prevArgs) => {
|
|
|
78426
78434
|
experimental: args.experimental
|
|
78427
78435
|
});
|
|
78428
78436
|
const frameworkOptions = Object.entries(frameworkMap).map(
|
|
78429
|
-
([key,
|
|
78430
|
-
label:
|
|
78437
|
+
([key, config38]) => ({
|
|
78438
|
+
label: config38.displayName,
|
|
78431
78439
|
value: key
|
|
78432
78440
|
})
|
|
78433
78441
|
);
|
|
@@ -78594,28 +78602,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
78594
78602
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
78595
78603
|
}
|
|
78596
78604
|
const path6 = await downloadRemoteTemplate(src);
|
|
78597
|
-
const
|
|
78598
|
-
validateTemplate(path6,
|
|
78605
|
+
const config38 = inferTemplateConfig(path6);
|
|
78606
|
+
validateTemplate(path6, config38);
|
|
78599
78607
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
78600
78608
|
return {
|
|
78601
78609
|
path: path6,
|
|
78602
|
-
...
|
|
78610
|
+
...config38
|
|
78603
78611
|
};
|
|
78604
78612
|
};
|
|
78605
|
-
var validateTemplate = (path6,
|
|
78606
|
-
if (!
|
|
78613
|
+
var validateTemplate = (path6, config38) => {
|
|
78614
|
+
if (!config38.copyFiles) {
|
|
78607
78615
|
return;
|
|
78608
78616
|
}
|
|
78609
|
-
if (isVariantInfo(
|
|
78610
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
78617
|
+
if (isVariantInfo(config38.copyFiles)) {
|
|
78618
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config38.copyFiles.path), config38);
|
|
78611
78619
|
} else {
|
|
78612
|
-
for (const variant of Object.values(
|
|
78613
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path),
|
|
78620
|
+
for (const variant of Object.values(config38.copyFiles.variants)) {
|
|
78621
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config38);
|
|
78614
78622
|
}
|
|
78615
78623
|
}
|
|
78616
78624
|
};
|
|
78617
|
-
var validateTemplateSrcDirectory = (path6,
|
|
78618
|
-
if (
|
|
78625
|
+
var validateTemplateSrcDirectory = (path6, config38) => {
|
|
78626
|
+
if (config38.platform === "workers") {
|
|
78619
78627
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
78620
78628
|
const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
|
|
78621
78629
|
const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -80526,20 +80534,20 @@ function applyEdits(text, edits) {
|
|
|
80526
80534
|
var import_fs12 = require("fs");
|
|
80527
80535
|
var import_path14 = require("path");
|
|
80528
80536
|
var import_toml2 = __toESM(require_toml());
|
|
80529
|
-
function ensureNameExists(
|
|
80530
|
-
|
|
80531
|
-
return
|
|
80537
|
+
function ensureNameExists(config38, projectName) {
|
|
80538
|
+
config38["name"] = projectName;
|
|
80539
|
+
return config38;
|
|
80532
80540
|
}
|
|
80533
|
-
async function ensureCompatDateExists(
|
|
80534
|
-
if (typeof
|
|
80541
|
+
async function ensureCompatDateExists(config38) {
|
|
80542
|
+
if (typeof config38["compatibility_date"] === "string") {
|
|
80535
80543
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
|
|
80536
|
-
if (!
|
|
80537
|
-
|
|
80544
|
+
if (!config38["compatibility_date"].match(validCompatDateRe)) {
|
|
80545
|
+
config38["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80538
80546
|
}
|
|
80539
80547
|
} else {
|
|
80540
|
-
|
|
80548
|
+
config38["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80541
80549
|
}
|
|
80542
|
-
return
|
|
80550
|
+
return config38;
|
|
80543
80551
|
}
|
|
80544
80552
|
var updateWranglerConfig = async (ctx) => {
|
|
80545
80553
|
if (wranglerJsonExists(ctx)) {
|
|
@@ -81253,8 +81261,8 @@ var renderValues = (values) => {
|
|
|
81253
81261
|
};
|
|
81254
81262
|
|
|
81255
81263
|
// src/helpers/retry.ts
|
|
81256
|
-
var retry = async (
|
|
81257
|
-
let { times } =
|
|
81264
|
+
var retry = async (config38, fn) => {
|
|
81265
|
+
let { times } = config38;
|
|
81258
81266
|
let error2 = null;
|
|
81259
81267
|
while (times > 0) {
|
|
81260
81268
|
try {
|
|
@@ -81262,10 +81270,10 @@ var retry = async (config34, fn) => {
|
|
|
81262
81270
|
} catch (e) {
|
|
81263
81271
|
error2 = e;
|
|
81264
81272
|
times--;
|
|
81265
|
-
if (
|
|
81273
|
+
if (config38.exitCondition?.(e)) {
|
|
81266
81274
|
break;
|
|
81267
81275
|
}
|
|
81268
|
-
await sleep(
|
|
81276
|
+
await sleep(config38.sleepMs ?? 1e3);
|
|
81269
81277
|
}
|
|
81270
81278
|
}
|
|
81271
81279
|
throw error2;
|
|
@@ -81385,8 +81393,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81385
81393
|
}
|
|
81386
81394
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81387
81395
|
try {
|
|
81388
|
-
const
|
|
81389
|
-
const currentTypes =
|
|
81396
|
+
const config38 = parse4(tsconfig);
|
|
81397
|
+
const currentTypes = config38.compilerOptions?.types ?? [];
|
|
81390
81398
|
const explicitEntrypoint = currentTypes.some(
|
|
81391
81399
|
(t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81392
81400
|
);
|
|
@@ -81461,7 +81469,7 @@ var runCli = async (args) => {
|
|
|
81461
81469
|
printBanner(args);
|
|
81462
81470
|
const ctx = await createContext(args);
|
|
81463
81471
|
await create(ctx);
|
|
81464
|
-
await
|
|
81472
|
+
await configure20(ctx);
|
|
81465
81473
|
await deploy(ctx);
|
|
81466
81474
|
printSummary(ctx);
|
|
81467
81475
|
logRaw("");
|
|
@@ -81489,7 +81497,7 @@ var create = async (ctx) => {
|
|
|
81489
81497
|
await rectifyPmMismatch(ctx);
|
|
81490
81498
|
endSection(`Application created`);
|
|
81491
81499
|
};
|
|
81492
|
-
var
|
|
81500
|
+
var configure20 = async (ctx) => {
|
|
81493
81501
|
startSection("Configuring your application for Cloudflare", "Step 2 of 3");
|
|
81494
81502
|
await installWrangler();
|
|
81495
81503
|
await installWorkersTypes(ctx);
|