create-cloudflare 2.42.0 → 2.43.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 +632 -574
- package/package.json +5 -5
- package/templates/hello-world/ts/test/env.d.ts +3 -0
- package/templates/hello-world/ts/worker-configuration.d.ts +6 -2
- package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +6 -4
- package/templates/hello-world-durable-object-with-assets/js/src/index.js +11 -10
- package/templates/hello-world-durable-object-with-assets/js/wrangler.jsonc +2 -2
- package/templates/hello-world-durable-object-with-assets/ts/src/index.ts +10 -9
- package/templates/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +7 -4
- package/templates/hello-world-durable-object-with-assets/ts/wrangler.jsonc +1 -1
- package/templates/hello-world-with-assets/js/public/index.html +2 -2
- package/templates/hello-world-with-assets/py/public/index.html +2 -2
- package/templates/hello-world-with-assets/ts/public/index.html +2 -2
- package/templates/hello-world-with-assets/ts/test/env.d.ts +3 -0
- package/templates/hello-world-with-assets/ts/test/tsconfig.json +1 -1
- package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +6 -3
- package/templates/nuxt/pages/c3.ts +1 -0
- package/templates/nuxt/workers/c3.ts +1 -0
- package/templates/qwik/c3.ts +5 -144
- package/templates/qwik/pages/c3.ts +149 -0
- package/{templates-experimental/qwik → templates/qwik/workers}/c3.ts +2 -2
- package/templates/react-router/c3.ts +53 -0
- package/templates/react-router/templates/worker-configuration.d.ts +8 -0
- package/templates/remix/c3.ts +1 -0
- /package/{templates-experimental/qwik → templates/qwik/pages}/snippets/getPlatformProxy.ts +0 -0
- /package/{templates-experimental/qwik → templates/qwik/pages}/templates/worker-configuration.d.ts +0 -0
- /package/templates/qwik/{templates → pages/templates}/wrangler.jsonc +0 -0
- /package/templates/qwik/{snippets → workers/snippets}/getPlatformProxy.ts +0 -0
- /package/{templates-experimental/qwik → templates/qwik/workers}/templates/public/.assetsignore +0 -0
- /package/templates/qwik/{templates → workers/templates}/worker-configuration.d.ts +0 -0
- /package/{templates-experimental/qwik → templates/qwik/workers}/templates/wrangler.jsonc +0 -0
package/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 config40(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 config40 = 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: config40, 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 config40 = 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: config40, 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 config40 = 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: config40, 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 config40 = (0, _lodash["default"])(options, this.config);
|
|
31513
|
+
if (config40.tokenHex === true) {
|
|
31514
|
+
config40.tokenChars = "0123456789abcdef";
|
|
31515
31515
|
}
|
|
31516
31516
|
var adjective = this._randomElement(this.adjectives);
|
|
31517
31517
|
var noun = this._randomElement(this.nouns);
|
|
31518
|
-
if (!
|
|
31518
|
+
if (!config40.tokenLength) config40.tokenLength = 0;
|
|
31519
31519
|
var token = "";
|
|
31520
|
-
for (var i = 0; i <
|
|
31521
|
-
token += this._randomElement(
|
|
31520
|
+
for (var i = 0; i < config40.tokenLength; i++) {
|
|
31521
|
+
token += this._randomElement(config40.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(config40.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, config40) {
|
|
40040
40040
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
40041
|
-
this.errorHandler.tolerant =
|
|
40041
|
+
this.errorHandler.tolerant = config40 ? typeof config40.tolerant === "boolean" && config40.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 = config40 ? typeof config40.comment === "boolean" && config40.comment : false;
|
|
40044
|
+
this.trackRange = config40 ? typeof config40.range === "boolean" && config40.range : false;
|
|
40045
|
+
this.trackLoc = config40 ? typeof config40.loc === "boolean" && config40.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(config40) {
|
|
49807
49807
|
assert_1.default.ok(this instanceof Printer2);
|
|
49808
|
-
var explicitTabWidth =
|
|
49809
|
-
|
|
49810
|
-
|
|
49808
|
+
var explicitTabWidth = config40 && config40.tabWidth;
|
|
49809
|
+
config40 = options_1.normalize(config40);
|
|
49810
|
+
config40.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 = config40.tabWidth;
|
|
49826
49826
|
if (!explicitTabWidth) {
|
|
49827
49827
|
var loc = path6.getNode().loc;
|
|
49828
49828
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
49829
|
-
|
|
49829
|
+
config40.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, config40, options, makePrintFunctionWith(options, {
|
|
49844
49844
|
includeComments: true,
|
|
49845
49845
|
avoidRootParens: false
|
|
49846
49846
|
}));
|
|
49847
|
-
|
|
49847
|
+
config40.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(config40), util.composeSourceMaps(config40.inputSourceMap, lines.getSourceMap(config40.sourceMapName, config40.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, config40, {
|
|
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 = config40.reuseWhitespace;
|
|
49874
|
+
config40.reuseWhitespace = false;
|
|
49875
|
+
var pr = new PrintResult(printGenerically(path6).toString(config40));
|
|
49876
|
+
config40.reuseWhitespace = oldReuseWhitespace;
|
|
49877
49877
|
return pr;
|
|
49878
49878
|
};
|
|
49879
49879
|
};
|
|
49880
49880
|
exports2.Printer = Printer;
|
|
49881
|
-
function genericPrint(path6,
|
|
49881
|
+
function genericPrint(path6, config40, 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, config40, 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 = (config40, value) => {
|
|
69384
|
+
const { question, label } = config40;
|
|
69385
|
+
if (config40.type !== "confirm" && !value) {
|
|
69386
69386
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
69387
69387
|
}
|
|
69388
|
-
const content =
|
|
69388
|
+
const content = config40.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 = (config40) => {
|
|
69392
|
+
switch (config40.type) {
|
|
69393
69393
|
case "select":
|
|
69394
|
-
return getSelectRenderers(
|
|
69394
|
+
return getSelectRenderers(config40);
|
|
69395
69395
|
case "confirm":
|
|
69396
|
-
return getConfirmRenderers(
|
|
69396
|
+
return getConfirmRenderers(config40);
|
|
69397
69397
|
case "text":
|
|
69398
|
-
return getTextRenderers(
|
|
69398
|
+
return getTextRenderers(config40);
|
|
69399
69399
|
case "multiselect":
|
|
69400
|
-
return getSelectRenderers(
|
|
69400
|
+
return getSelectRenderers(config40);
|
|
69401
69401
|
case "list":
|
|
69402
|
-
return getSelectListRenderers(
|
|
69402
|
+
return getSelectListRenderers(config40);
|
|
69403
69403
|
}
|
|
69404
69404
|
};
|
|
69405
|
-
var getTextRenderers = (
|
|
69406
|
-
const { question } =
|
|
69407
|
-
const helpText =
|
|
69408
|
-
const format5 =
|
|
69409
|
-
const defaultValue =
|
|
69405
|
+
var getTextRenderers = (config40) => {
|
|
69406
|
+
const { question } = config40;
|
|
69407
|
+
const helpText = config40.helpText ?? "";
|
|
69408
|
+
const format5 = config40.format ?? ((val) => String(val));
|
|
69409
|
+
const defaultValue = config40.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 = (config38) => {
|
|
|
69429
69429
|
``
|
|
69430
69430
|
// extra line for readability
|
|
69431
69431
|
],
|
|
69432
|
-
submit: ({ value }) => renderSubmit(
|
|
69432
|
+
submit: ({ value }) => renderSubmit(config40, format5(value ?? "")),
|
|
69433
69433
|
cancel: activeRenderer
|
|
69434
69434
|
};
|
|
69435
69435
|
};
|
|
69436
|
-
var getSelectRenderers = (
|
|
69437
|
-
const { options, question, helpText: _helpText } =
|
|
69436
|
+
var getSelectRenderers = (config40) => {
|
|
69437
|
+
const { options, question, helpText: _helpText } = config40;
|
|
69438
69438
|
const helpText = _helpText ?? "";
|
|
69439
|
-
const maxItemsPerPage =
|
|
69439
|
+
const maxItemsPerPage = config40.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
|
+
config40,
|
|
69515
69515
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
69516
69516
|
);
|
|
69517
69517
|
}
|
|
69518
69518
|
return renderSubmit(
|
|
69519
|
-
|
|
69519
|
+
config40,
|
|
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 = (config40) => {
|
|
69527
|
+
const { question, helpText: _helpText } = config40;
|
|
69528
|
+
let options = config40.options;
|
|
69529
69529
|
const helpText = _helpText ?? "";
|
|
69530
69530
|
const { rows } = stdout;
|
|
69531
69531
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -69606,20 +69606,20 @@ var getSelectListRenderers = (config38) => {
|
|
|
69606
69606
|
submit: ({ value }) => {
|
|
69607
69607
|
if (Array.isArray(value)) {
|
|
69608
69608
|
return renderSubmit(
|
|
69609
|
-
|
|
69609
|
+
config40,
|
|
69610
69610
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
69611
69611
|
);
|
|
69612
69612
|
}
|
|
69613
69613
|
return renderSubmit(
|
|
69614
|
-
|
|
69614
|
+
config40,
|
|
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 = (config40) => {
|
|
69622
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config40;
|
|
69623
69623
|
const helpText = _helpText ?? "";
|
|
69624
69624
|
const active = activeText || "Yes";
|
|
69625
69625
|
const inactive = inactiveText || "No";
|
|
@@ -69636,7 +69636,7 @@ var getConfirmRenderers = (config38) => {
|
|
|
69636
69636
|
active: defaultRenderer,
|
|
69637
69637
|
confirm: defaultRenderer,
|
|
69638
69638
|
error: defaultRenderer,
|
|
69639
|
-
submit: ({ value }) => renderSubmit(
|
|
69639
|
+
submit: ({ value }) => renderSubmit(config40, 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 config40 = 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
|
+
config40 = resolveConfig(resolvedConfigPath);
|
|
70613
70613
|
} catch (e) {
|
|
70614
|
-
|
|
70614
|
+
config40 = e;
|
|
70615
70615
|
}
|
|
70616
|
-
if (
|
|
70617
|
-
error2 =
|
|
70616
|
+
if (config40 instanceof Error) {
|
|
70617
|
+
error2 = config40;
|
|
70618
70618
|
return;
|
|
70619
70619
|
}
|
|
70620
70620
|
} else {
|
|
70621
|
-
|
|
70621
|
+
config40 = mixin2.require(resolvedConfigPath);
|
|
70622
70622
|
}
|
|
70623
|
-
setConfigObject(
|
|
70623
|
+
setConfigObject(config40);
|
|
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(config40, prev) {
|
|
70634
|
+
Object.keys(config40).forEach(function(key) {
|
|
70635
|
+
const value = config40[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 config40 = 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: config40
|
|
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(config40, 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(config40, "extends")) {
|
|
73018
|
+
if (typeof config40.extends !== "string")
|
|
73019
73019
|
return defaultConfig;
|
|
73020
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
73020
|
+
const isPath = /\.json|\..*rc$/.test(config40.extends);
|
|
73021
73021
|
let pathToDefault = null;
|
|
73022
73022
|
if (!isPath) {
|
|
73023
73023
|
try {
|
|
73024
|
-
pathToDefault = require.resolve(
|
|
73024
|
+
pathToDefault = require.resolve(config40.extends);
|
|
73025
73025
|
} catch (_err) {
|
|
73026
|
-
return
|
|
73026
|
+
return config40;
|
|
73027
73027
|
}
|
|
73028
73028
|
} else {
|
|
73029
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
73029
|
+
pathToDefault = getPathToDefaultConfig(cwd, config40.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(config40.extends);
|
|
73034
|
+
delete config40.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, config40) : Object.assign({}, defaultConfig, config40);
|
|
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(config40) {
|
|
73815
|
+
argsert("<object>", [config40], arguments.length);
|
|
73816
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config40, "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(config40) {
|
|
73989
|
+
argsert("<object>", [config40], arguments.length);
|
|
73990
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config40, "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 config40 = 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, ...config40 }
|
|
74401
74401
|
}));
|
|
74402
74402
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
74403
74403
|
let argvPromise = void 0;
|
|
@@ -74560,7 +74560,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
74560
74560
|
var yargs_default = Yargs;
|
|
74561
74561
|
|
|
74562
74562
|
// package.json
|
|
74563
|
-
var version = "2.
|
|
74563
|
+
var version = "2.43.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(config40) {
|
|
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
|
+
config40,
|
|
74613
74613
|
(_key, value) => value instanceof Date ? value.toISOString() : value,
|
|
74614
74614
|
" "
|
|
74615
74615
|
)
|
|
@@ -74617,9 +74617,9 @@ function writeMetricsConfig(config38) {
|
|
|
74617
74617
|
}
|
|
74618
74618
|
function readMetricsConfig() {
|
|
74619
74619
|
try {
|
|
74620
|
-
const
|
|
74620
|
+
const config40 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
74621
74621
|
return JSON.parse(
|
|
74622
|
-
|
|
74622
|
+
config40,
|
|
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(config40) {
|
|
74633
|
+
const deviceId = config40.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
74634
|
+
if (config40.deviceId === void 0) {
|
|
74635
|
+
writeMetricsConfig({ ...config40, deviceId });
|
|
74636
74636
|
}
|
|
74637
74637
|
return deviceId;
|
|
74638
74638
|
}
|
|
@@ -74817,7 +74817,7 @@ var detectPackageManager = () => {
|
|
|
74817
74817
|
}
|
|
74818
74818
|
};
|
|
74819
74819
|
var rectifyPmMismatch = async (ctx) => {
|
|
74820
|
-
const { npm:
|
|
74820
|
+
const { npm: npm25 } = detectPackageManager();
|
|
74821
74821
|
if (!detectPmMismatch(ctx)) {
|
|
74822
74822
|
return;
|
|
74823
74823
|
}
|
|
@@ -74829,17 +74829,17 @@ var rectifyPmMismatch = async (ctx) => {
|
|
|
74829
74829
|
if ((0, import_fs5.existsSync)(lockfilePath)) {
|
|
74830
74830
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
74831
74831
|
}
|
|
74832
|
-
await runCommand([
|
|
74832
|
+
await runCommand([npm25, "install"], {
|
|
74833
74833
|
silent: true,
|
|
74834
74834
|
cwd: ctx.project.path,
|
|
74835
74835
|
startText: "Installing dependencies",
|
|
74836
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
74836
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
|
|
74837
74837
|
});
|
|
74838
74838
|
};
|
|
74839
74839
|
var detectPmMismatch = (ctx) => {
|
|
74840
|
-
const { npm:
|
|
74840
|
+
const { npm: npm25 } = detectPackageManager();
|
|
74841
74841
|
const projectPath = ctx.project.path;
|
|
74842
|
-
switch (
|
|
74842
|
+
switch (npm25) {
|
|
74843
74843
|
case "npm":
|
|
74844
74844
|
return false;
|
|
74845
74845
|
case "yarn":
|
|
@@ -74907,10 +74907,10 @@ function getPlatform() {
|
|
|
74907
74907
|
function createReporter() {
|
|
74908
74908
|
const events = [];
|
|
74909
74909
|
const als = new import_node_async_hooks.AsyncLocalStorage();
|
|
74910
|
-
const
|
|
74911
|
-
const isFirstUsage =
|
|
74910
|
+
const config40 = readMetricsConfig() ?? {};
|
|
74911
|
+
const isFirstUsage = config40.c3permission === void 0;
|
|
74912
74912
|
const isEnabled = isTelemetryEnabled();
|
|
74913
|
-
const deviceId = getDeviceId(
|
|
74913
|
+
const deviceId = getDeviceId(config40);
|
|
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(config40).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(config40 = readMetricsConfig() ?? {}) {
|
|
75053
|
+
if (!config40.c3permission) {
|
|
75054
|
+
config40.c3permission = initializeC3Permission();
|
|
75055
|
+
writeMetricsConfig(config40);
|
|
75056
75056
|
}
|
|
75057
|
-
return
|
|
75057
|
+
return config40.c3permission;
|
|
75058
75058
|
}
|
|
75059
75059
|
function updateC3Pemission(enabled) {
|
|
75060
|
-
const
|
|
75061
|
-
if (
|
|
75060
|
+
const config40 = readMetricsConfig();
|
|
75061
|
+
if (config40.c3permission?.enabled === enabled) {
|
|
75062
75062
|
return;
|
|
75063
75063
|
}
|
|
75064
|
-
|
|
75065
|
-
writeMetricsConfig(
|
|
75064
|
+
config40.c3permission = initializeC3Permission(enabled);
|
|
75065
|
+
writeMetricsConfig(config40);
|
|
75066
75066
|
}
|
|
75067
75067
|
var runTelemetryCommand = (action) => {
|
|
75068
75068
|
const logTelemetryStatus = (enabled) => {
|
|
@@ -75107,39 +75107,39 @@ var import_haikunator = __toESM(require_dist_web());
|
|
|
75107
75107
|
var import_fs6 = require("fs");
|
|
75108
75108
|
var import_path6 = __toESM(require("path"));
|
|
75109
75109
|
var import_undici2 = __toESM(require_undici());
|
|
75110
|
-
var installPackages = async (packages,
|
|
75111
|
-
const { npm:
|
|
75110
|
+
var installPackages = async (packages, config40 = {}) => {
|
|
75111
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75112
75112
|
let saveFlag;
|
|
75113
75113
|
let cmd;
|
|
75114
|
-
switch (
|
|
75114
|
+
switch (npm25) {
|
|
75115
75115
|
case "yarn":
|
|
75116
75116
|
cmd = "add";
|
|
75117
|
-
saveFlag =
|
|
75117
|
+
saveFlag = config40.dev ? "-D" : "";
|
|
75118
75118
|
break;
|
|
75119
75119
|
case "bun":
|
|
75120
75120
|
cmd = "add";
|
|
75121
|
-
saveFlag =
|
|
75121
|
+
saveFlag = config40.dev ? "-d" : "";
|
|
75122
75122
|
break;
|
|
75123
75123
|
case "npm":
|
|
75124
75124
|
case "pnpm":
|
|
75125
75125
|
default:
|
|
75126
75126
|
cmd = "install";
|
|
75127
|
-
saveFlag =
|
|
75127
|
+
saveFlag = config40.dev ? "--save-dev" : "";
|
|
75128
75128
|
break;
|
|
75129
75129
|
}
|
|
75130
75130
|
await runCommand(
|
|
75131
75131
|
[
|
|
75132
|
-
|
|
75132
|
+
npm25,
|
|
75133
75133
|
cmd,
|
|
75134
75134
|
...saveFlag ? [saveFlag] : [],
|
|
75135
75135
|
...packages,
|
|
75136
75136
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
75137
75137
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
75138
75138
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
75139
|
-
...
|
|
75139
|
+
...npm25 === "npm" ? ["--legacy-peer-deps"] : []
|
|
75140
75140
|
],
|
|
75141
75141
|
{
|
|
75142
|
-
...
|
|
75142
|
+
...config40,
|
|
75143
75143
|
silent: true
|
|
75144
75144
|
}
|
|
75145
75145
|
);
|
|
@@ -75149,16 +75149,16 @@ var npmInstall = async (ctx) => {
|
|
|
75149
75149
|
if ((0, import_fs6.existsSync)(nodeModulesPath)) {
|
|
75150
75150
|
return;
|
|
75151
75151
|
}
|
|
75152
|
-
const { npm:
|
|
75152
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75153
75153
|
await runCommand(
|
|
75154
75154
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
75155
75155
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
75156
75156
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
75157
|
-
[
|
|
75157
|
+
[npm25, "install", ...npm25 === "npm" ? ["--legacy-peer-deps"] : []],
|
|
75158
75158
|
{
|
|
75159
75159
|
silent: true,
|
|
75160
75160
|
startText: "Installing dependencies",
|
|
75161
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75161
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
|
|
75162
75162
|
}
|
|
75163
75163
|
);
|
|
75164
75164
|
};
|
|
@@ -75168,14 +75168,14 @@ async function getLatestPackageVersion(packageSpecifier) {
|
|
|
75168
75168
|
return npmInfo["dist-tags"].latest;
|
|
75169
75169
|
}
|
|
75170
75170
|
var installWrangler = async () => {
|
|
75171
|
-
const { npm:
|
|
75171
|
+
const { npm: npm25 } = detectPackageManager();
|
|
75172
75172
|
await installPackages([`wrangler@latest`], {
|
|
75173
75173
|
dev: true,
|
|
75174
75174
|
startText: `Installing wrangler ${dim(
|
|
75175
75175
|
"A command line tool for building Cloudflare Workers"
|
|
75176
75176
|
)}`,
|
|
75177
75177
|
doneText: `${brandColor("installed")} ${dim(
|
|
75178
|
-
`via \`${
|
|
75178
|
+
`via \`${npm25} install wrangler --save-dev\``
|
|
75179
75179
|
)}`
|
|
75180
75180
|
});
|
|
75181
75181
|
};
|
|
@@ -75335,7 +75335,7 @@ var package_default = {
|
|
|
75335
75335
|
"so that we can use dependabot to update these dependencies automatically."
|
|
75336
75336
|
],
|
|
75337
75337
|
dependencies: {
|
|
75338
|
-
"create-astro": "4.11.
|
|
75338
|
+
"create-astro": "4.11.1",
|
|
75339
75339
|
"create-analog": "1.8.1",
|
|
75340
75340
|
"@angular/create": "19.1.6",
|
|
75341
75341
|
"create-docusaurus": "3.7.0",
|
|
@@ -75344,8 +75344,9 @@ var package_default = {
|
|
|
75344
75344
|
"create-qwik": "1.12.0",
|
|
75345
75345
|
"create-vite": "6.1.1",
|
|
75346
75346
|
"create-remix": "2.15.3",
|
|
75347
|
+
"create-react-router": "7.4.0",
|
|
75347
75348
|
"create-solid": "0.6.1",
|
|
75348
|
-
"create-vue": "3.
|
|
75349
|
+
"create-vue": "3.15.1",
|
|
75349
75350
|
gatsby: "5.14.1",
|
|
75350
75351
|
sv: "0.6.23",
|
|
75351
75352
|
nuxi: "3.21.1"
|
|
@@ -75363,9 +75364,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
|
|
|
75363
75364
|
};
|
|
75364
75365
|
var runFrameworkGenerator = async (ctx, args) => {
|
|
75365
75366
|
const cli = getFrameworkCli(ctx, true);
|
|
75366
|
-
const { npm:
|
|
75367
|
-
const cmd = [...
|
|
75368
|
-
const env3 =
|
|
75367
|
+
const { npm: npm25, dlx } = detectPackageManager();
|
|
75368
|
+
const cmd = [...npm25 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
75369
|
+
const env3 = npm25 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
|
|
75369
75370
|
if (ctx.args.additionalArgs?.length) {
|
|
75370
75371
|
cmd.push(...ctx.args.additionalArgs);
|
|
75371
75372
|
}
|
|
@@ -75510,117 +75511,6 @@ var getPropertyName = (newProp) => {
|
|
|
75510
75511
|
return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
|
|
75511
75512
|
};
|
|
75512
75513
|
|
|
75513
|
-
// templates-experimental/qwik/c3.ts
|
|
75514
|
-
var recast2 = __toESM(require_main3());
|
|
75515
|
-
var { npm, npx, name } = detectPackageManager();
|
|
75516
|
-
var generate2 = async (ctx) => {
|
|
75517
|
-
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
75518
|
-
};
|
|
75519
|
-
var configure2 = async (ctx) => {
|
|
75520
|
-
const cmd = [name === "pnpm" ? npm : npx, "qwik", "add", "cloudflare-pages"];
|
|
75521
|
-
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
75522
|
-
await runCommand(cmd);
|
|
75523
|
-
removeFile("./public/_headers");
|
|
75524
|
-
removeFile("./public/_redirects");
|
|
75525
|
-
removeFile("./public/_routes.json");
|
|
75526
|
-
addBindingsProxy(ctx);
|
|
75527
|
-
populateCloudflareEnv();
|
|
75528
|
-
};
|
|
75529
|
-
var addBindingsProxy = (ctx) => {
|
|
75530
|
-
if (!usesTypescript(ctx)) {
|
|
75531
|
-
return;
|
|
75532
|
-
}
|
|
75533
|
-
const s = spinner();
|
|
75534
|
-
s.start("Updating `vite.config.ts`");
|
|
75535
|
-
const snippets = loadTemplateSnippets(ctx);
|
|
75536
|
-
const b3 = recast2.types.builders;
|
|
75537
|
-
transformFile("vite.config.ts", {
|
|
75538
|
-
// Insert the env declaration after the last import (but before the rest of the body)
|
|
75539
|
-
visitProgram: function(n) {
|
|
75540
|
-
const lastImportIndex = n.node.body.findLastIndex(
|
|
75541
|
-
(t2) => t2.type === "ImportDeclaration"
|
|
75542
|
-
);
|
|
75543
|
-
const lastImport = n.get("body", lastImportIndex);
|
|
75544
|
-
lastImport.insertAfter(...snippets.getPlatformProxyTs);
|
|
75545
|
-
return this.traverse(n);
|
|
75546
|
-
},
|
|
75547
|
-
// Pass the `platform` object from the declaration to the `qwikCity` plugin
|
|
75548
|
-
visitCallExpression: function(n) {
|
|
75549
|
-
const callee = n.node.callee;
|
|
75550
|
-
if (callee.name !== "qwikCity") {
|
|
75551
|
-
return this.traverse(n);
|
|
75552
|
-
}
|
|
75553
|
-
const configArgument = n.node.arguments[0];
|
|
75554
|
-
const platformPropery = b3.objectProperty.from({
|
|
75555
|
-
key: b3.identifier("platform"),
|
|
75556
|
-
value: b3.identifier("platform"),
|
|
75557
|
-
shorthand: true
|
|
75558
|
-
});
|
|
75559
|
-
if (!configArgument) {
|
|
75560
|
-
n.node.arguments = [b3.objectExpression([platformPropery])];
|
|
75561
|
-
return false;
|
|
75562
|
-
}
|
|
75563
|
-
if (configArgument.type !== "ObjectExpression") {
|
|
75564
|
-
crash("Failed to update `vite.config.ts`");
|
|
75565
|
-
}
|
|
75566
|
-
configArgument.properties.push(platformPropery);
|
|
75567
|
-
return false;
|
|
75568
|
-
}
|
|
75569
|
-
});
|
|
75570
|
-
s.stop(`${brandColor("updated")} \`vite.config.ts\``);
|
|
75571
|
-
};
|
|
75572
|
-
var populateCloudflareEnv = () => {
|
|
75573
|
-
const entrypointPath = "src/entry.cloudflare-pages.tsx";
|
|
75574
|
-
const s = spinner();
|
|
75575
|
-
s.start(`Updating \`${entrypointPath}\``);
|
|
75576
|
-
transformFile(entrypointPath, {
|
|
75577
|
-
visitTSInterfaceDeclaration: function(n) {
|
|
75578
|
-
const b3 = recast2.types.builders;
|
|
75579
|
-
const id = n.node.id;
|
|
75580
|
-
if (id.name !== "QwikCityPlatform") {
|
|
75581
|
-
this.traverse(n);
|
|
75582
|
-
}
|
|
75583
|
-
const newBody = [
|
|
75584
|
-
["env", "Env"]
|
|
75585
|
-
// Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
|
|
75586
|
-
// ["cf", "CfProperties"],
|
|
75587
|
-
].map(
|
|
75588
|
-
([varName, type]) => b3.tsPropertySignature(
|
|
75589
|
-
b3.identifier(varName),
|
|
75590
|
-
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
|
|
75591
|
-
)
|
|
75592
|
-
);
|
|
75593
|
-
n.node.body.body = newBody;
|
|
75594
|
-
return false;
|
|
75595
|
-
}
|
|
75596
|
-
});
|
|
75597
|
-
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
75598
|
-
};
|
|
75599
|
-
var config = {
|
|
75600
|
-
configVersion: 1,
|
|
75601
|
-
id: "qwik",
|
|
75602
|
-
frameworkCli: "create-qwik",
|
|
75603
|
-
displayName: "Qwik",
|
|
75604
|
-
platform: "workers",
|
|
75605
|
-
copyFiles: {
|
|
75606
|
-
path: "./templates"
|
|
75607
|
-
},
|
|
75608
|
-
path: "templates-experimental/qwik",
|
|
75609
|
-
generate: generate2,
|
|
75610
|
-
configure: configure2,
|
|
75611
|
-
transformPackageJson: async () => ({
|
|
75612
|
-
scripts: {
|
|
75613
|
-
deploy: `${npm} run build && wrangler deploy`,
|
|
75614
|
-
preview: `${npm} run build && wrangler dev`,
|
|
75615
|
-
"cf-typegen": `wrangler types`
|
|
75616
|
-
}
|
|
75617
|
-
}),
|
|
75618
|
-
devScript: "dev",
|
|
75619
|
-
deployScript: "deploy",
|
|
75620
|
-
previewScript: "preview"
|
|
75621
|
-
};
|
|
75622
|
-
var c3_default2 = config;
|
|
75623
|
-
|
|
75624
75514
|
// src/helpers/compatDate.ts
|
|
75625
75515
|
var import_fs9 = require("fs");
|
|
75626
75516
|
var import_path9 = require("path");
|
|
@@ -75674,18 +75564,18 @@ function getLatestTypesEntrypoint(ctx) {
|
|
|
75674
75564
|
}
|
|
75675
75565
|
|
|
75676
75566
|
// templates-experimental/solid/c3.ts
|
|
75677
|
-
var
|
|
75678
|
-
var { npm
|
|
75679
|
-
var
|
|
75567
|
+
var recast2 = __toESM(require_main3());
|
|
75568
|
+
var { npm } = detectPackageManager();
|
|
75569
|
+
var generate2 = async (ctx) => {
|
|
75680
75570
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
75681
75571
|
logRaw("");
|
|
75682
75572
|
};
|
|
75683
|
-
var
|
|
75573
|
+
var configure2 = async (ctx) => {
|
|
75684
75574
|
const packages = ["nitropack"];
|
|
75685
75575
|
await installPackages(packages, {
|
|
75686
75576
|
dev: true,
|
|
75687
75577
|
startText: "Installing nitro module `nitropack`",
|
|
75688
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75578
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
75689
75579
|
});
|
|
75690
75580
|
usesTypescript(ctx);
|
|
75691
75581
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
@@ -75697,7 +75587,7 @@ var configure3 = async (ctx) => {
|
|
|
75697
75587
|
if (callee.name !== "defineConfig") {
|
|
75698
75588
|
return this.traverse(n);
|
|
75699
75589
|
}
|
|
75700
|
-
const b3 =
|
|
75590
|
+
const b3 = recast2.types.builders;
|
|
75701
75591
|
mergeObjectProperties(
|
|
75702
75592
|
n.node.arguments[0],
|
|
75703
75593
|
[
|
|
@@ -75721,7 +75611,7 @@ var configure3 = async (ctx) => {
|
|
|
75721
75611
|
}
|
|
75722
75612
|
});
|
|
75723
75613
|
};
|
|
75724
|
-
var
|
|
75614
|
+
var config = {
|
|
75725
75615
|
configVersion: 1,
|
|
75726
75616
|
id: "solid",
|
|
75727
75617
|
frameworkCli: "create-solid",
|
|
@@ -75731,12 +75621,12 @@ var config2 = {
|
|
|
75731
75621
|
path: "./templates"
|
|
75732
75622
|
},
|
|
75733
75623
|
path: "templates-experimental/solid",
|
|
75734
|
-
generate:
|
|
75735
|
-
configure:
|
|
75624
|
+
generate: generate2,
|
|
75625
|
+
configure: configure2,
|
|
75736
75626
|
transformPackageJson: async () => ({
|
|
75737
75627
|
scripts: {
|
|
75738
|
-
preview: `${
|
|
75739
|
-
deploy: `${
|
|
75628
|
+
preview: `${npm} run build && npx wrangler dev`,
|
|
75629
|
+
deploy: `${npm} run build && wrangler deploy`
|
|
75740
75630
|
}
|
|
75741
75631
|
}),
|
|
75742
75632
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -75744,12 +75634,12 @@ var config2 = {
|
|
|
75744
75634
|
deployScript: "deploy",
|
|
75745
75635
|
previewScript: "preview"
|
|
75746
75636
|
};
|
|
75747
|
-
var
|
|
75637
|
+
var c3_default2 = config;
|
|
75748
75638
|
|
|
75749
75639
|
// templates/analog/c3.ts
|
|
75750
|
-
var
|
|
75751
|
-
var { npm:
|
|
75752
|
-
var
|
|
75640
|
+
var recast3 = __toESM(require_main3());
|
|
75641
|
+
var { npm: npm2, name: pm } = detectPackageManager();
|
|
75642
|
+
var generate3 = async (ctx) => {
|
|
75753
75643
|
await runFrameworkGenerator(ctx, [
|
|
75754
75644
|
ctx.project.name,
|
|
75755
75645
|
"--template",
|
|
@@ -75757,7 +75647,7 @@ var generate4 = async (ctx) => {
|
|
|
75757
75647
|
]);
|
|
75758
75648
|
logRaw("");
|
|
75759
75649
|
};
|
|
75760
|
-
var
|
|
75650
|
+
var configure3 = async (ctx) => {
|
|
75761
75651
|
if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
|
|
75762
75652
|
const packages = [];
|
|
75763
75653
|
packages.push("nitropack");
|
|
@@ -75767,7 +75657,7 @@ var configure4 = async (ctx) => {
|
|
|
75767
75657
|
await installPackages(packages, {
|
|
75768
75658
|
dev: true,
|
|
75769
75659
|
startText: `Installing ${packages.join(", ")}`,
|
|
75770
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75660
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
|
|
75771
75661
|
});
|
|
75772
75662
|
}
|
|
75773
75663
|
updateViteConfig(ctx);
|
|
@@ -75788,7 +75678,7 @@ var updateEnvTypes = (ctx) => {
|
|
|
75788
75678
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
|
|
75789
75679
|
};
|
|
75790
75680
|
var updateViteConfig = (ctx) => {
|
|
75791
|
-
const b3 =
|
|
75681
|
+
const b3 = recast3.types.builders;
|
|
75792
75682
|
const s = spinner();
|
|
75793
75683
|
const configFile = "vite.config.ts";
|
|
75794
75684
|
s.start(`Updating \`${configFile}\``);
|
|
@@ -75825,7 +75715,7 @@ var updateViteConfig = (ctx) => {
|
|
|
75825
75715
|
});
|
|
75826
75716
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75827
75717
|
};
|
|
75828
|
-
var
|
|
75718
|
+
var config2 = {
|
|
75829
75719
|
configVersion: 1,
|
|
75830
75720
|
id: "analog",
|
|
75831
75721
|
frameworkCli: "create-analog",
|
|
@@ -75834,12 +75724,12 @@ var config3 = {
|
|
|
75834
75724
|
copyFiles: {
|
|
75835
75725
|
path: "./templates"
|
|
75836
75726
|
},
|
|
75837
|
-
generate:
|
|
75838
|
-
configure:
|
|
75727
|
+
generate: generate3,
|
|
75728
|
+
configure: configure3,
|
|
75839
75729
|
transformPackageJson: async () => ({
|
|
75840
75730
|
scripts: {
|
|
75841
|
-
preview: `${
|
|
75842
|
-
deploy: `${
|
|
75731
|
+
preview: `${npm2} run build && wrangler pages dev`,
|
|
75732
|
+
deploy: `${npm2} run build && wrangler pages deploy`,
|
|
75843
75733
|
"cf-typegen": `wrangler types`
|
|
75844
75734
|
}
|
|
75845
75735
|
}),
|
|
@@ -75847,12 +75737,12 @@ var config3 = {
|
|
|
75847
75737
|
deployScript: "deploy",
|
|
75848
75738
|
previewScript: "preview"
|
|
75849
75739
|
};
|
|
75850
|
-
var
|
|
75740
|
+
var c3_default3 = config2;
|
|
75851
75741
|
|
|
75852
75742
|
// templates/angular/pages/c3.ts
|
|
75853
75743
|
var import_node_path3 = require("node:path");
|
|
75854
|
-
var { npm:
|
|
75855
|
-
var
|
|
75744
|
+
var { npm: npm3 } = detectPackageManager();
|
|
75745
|
+
var generate4 = async (ctx) => {
|
|
75856
75746
|
await runFrameworkGenerator(ctx, [
|
|
75857
75747
|
ctx.project.name,
|
|
75858
75748
|
"--ssr",
|
|
@@ -75860,7 +75750,7 @@ var generate5 = async (ctx) => {
|
|
|
75860
75750
|
]);
|
|
75861
75751
|
logRaw("");
|
|
75862
75752
|
};
|
|
75863
|
-
var
|
|
75753
|
+
var configure4 = async (ctx) => {
|
|
75864
75754
|
updateAngularJson(ctx);
|
|
75865
75755
|
await updateAppCode();
|
|
75866
75756
|
await installCFWorker();
|
|
@@ -75869,7 +75759,7 @@ async function installCFWorker() {
|
|
|
75869
75759
|
await installPackages(["xhr2"], {
|
|
75870
75760
|
dev: true,
|
|
75871
75761
|
startText: "Installing additional dependencies",
|
|
75872
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75762
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
|
|
75873
75763
|
});
|
|
75874
75764
|
}
|
|
75875
75765
|
async function updateAppCode() {
|
|
@@ -75911,7 +75801,7 @@ function updateAngularJson(ctx) {
|
|
|
75911
75801
|
writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
75912
75802
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
75913
75803
|
}
|
|
75914
|
-
var
|
|
75804
|
+
var config3 = {
|
|
75915
75805
|
configVersion: 1,
|
|
75916
75806
|
id: "angular",
|
|
75917
75807
|
frameworkCli: "@angular/create",
|
|
@@ -75924,23 +75814,23 @@ var config4 = {
|
|
|
75924
75814
|
devScript: "start",
|
|
75925
75815
|
deployScript: "deploy",
|
|
75926
75816
|
previewScript: "start",
|
|
75927
|
-
generate:
|
|
75928
|
-
configure:
|
|
75817
|
+
generate: generate4,
|
|
75818
|
+
configure: configure4,
|
|
75929
75819
|
transformPackageJson: async () => ({
|
|
75930
75820
|
scripts: {
|
|
75931
|
-
start: `${
|
|
75932
|
-
build: `ng build && ${
|
|
75821
|
+
start: `${npm3} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
75822
|
+
build: `ng build && ${npm3} run process`,
|
|
75933
75823
|
process: "node ./tools/copy-files.mjs",
|
|
75934
|
-
deploy: `${
|
|
75824
|
+
deploy: `${npm3} run build && wrangler pages deploy dist/cloudflare`
|
|
75935
75825
|
}
|
|
75936
75826
|
})
|
|
75937
75827
|
};
|
|
75938
|
-
var
|
|
75828
|
+
var c3_default4 = config3;
|
|
75939
75829
|
|
|
75940
75830
|
// templates/angular/workers/c3.ts
|
|
75941
75831
|
var import_node_path4 = require("node:path");
|
|
75942
|
-
var { npm:
|
|
75943
|
-
var
|
|
75832
|
+
var { npm: npm4 } = detectPackageManager();
|
|
75833
|
+
var generate5 = async (ctx) => {
|
|
75944
75834
|
await runFrameworkGenerator(ctx, [
|
|
75945
75835
|
ctx.project.name,
|
|
75946
75836
|
"--ssr",
|
|
@@ -75948,7 +75838,7 @@ var generate6 = async (ctx) => {
|
|
|
75948
75838
|
]);
|
|
75949
75839
|
logRaw("");
|
|
75950
75840
|
};
|
|
75951
|
-
var
|
|
75841
|
+
var configure5 = async (ctx) => {
|
|
75952
75842
|
updateAngularJson2(ctx);
|
|
75953
75843
|
await updateAppCode2();
|
|
75954
75844
|
await installCFWorker2();
|
|
@@ -75957,7 +75847,7 @@ async function installCFWorker2() {
|
|
|
75957
75847
|
await installPackages(["xhr2"], {
|
|
75958
75848
|
dev: true,
|
|
75959
75849
|
startText: "Installing additional dependencies",
|
|
75960
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
75850
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm4} install\``)}`
|
|
75961
75851
|
});
|
|
75962
75852
|
}
|
|
75963
75853
|
async function updateAppCode2() {
|
|
@@ -75998,7 +75888,7 @@ function updateAngularJson2(ctx) {
|
|
|
75998
75888
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
75999
75889
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
76000
75890
|
}
|
|
76001
|
-
var
|
|
75891
|
+
var config4 = {
|
|
76002
75892
|
configVersion: 1,
|
|
76003
75893
|
id: "angular",
|
|
76004
75894
|
frameworkCli: "@angular/create",
|
|
@@ -76011,38 +75901,38 @@ var config5 = {
|
|
|
76011
75901
|
devScript: "start",
|
|
76012
75902
|
deployScript: "deploy",
|
|
76013
75903
|
previewScript: "start",
|
|
76014
|
-
generate:
|
|
76015
|
-
configure:
|
|
75904
|
+
generate: generate5,
|
|
75905
|
+
configure: configure5,
|
|
76016
75906
|
transformPackageJson: async () => ({
|
|
76017
75907
|
scripts: {
|
|
76018
|
-
start: `${
|
|
75908
|
+
start: `${npm4} run build && wrangler dev`,
|
|
76019
75909
|
build: `ng build`,
|
|
76020
|
-
deploy: `${
|
|
75910
|
+
deploy: `${npm4} run build && wrangler deploy`
|
|
76021
75911
|
}
|
|
76022
75912
|
})
|
|
76023
75913
|
};
|
|
76024
|
-
var
|
|
75914
|
+
var c3_default5 = config4;
|
|
76025
75915
|
|
|
76026
75916
|
// templates/angular/c3.ts
|
|
76027
|
-
var
|
|
75917
|
+
var config5 = {
|
|
76028
75918
|
displayName: "Angular",
|
|
76029
|
-
platformVariants: { pages:
|
|
75919
|
+
platformVariants: { pages: c3_default4, workers: c3_default5 }
|
|
76030
75920
|
};
|
|
76031
|
-
var
|
|
75921
|
+
var c3_default6 = config5;
|
|
76032
75922
|
|
|
76033
75923
|
// templates/astro/pages/c3.ts
|
|
76034
|
-
var
|
|
76035
|
-
var { npx
|
|
76036
|
-
var
|
|
75924
|
+
var recast4 = __toESM(require_main3());
|
|
75925
|
+
var { npx } = detectPackageManager();
|
|
75926
|
+
var generate6 = async (ctx) => {
|
|
76037
75927
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76038
75928
|
logRaw("");
|
|
76039
75929
|
};
|
|
76040
|
-
var
|
|
76041
|
-
await runCommand([
|
|
75930
|
+
var configure6 = async () => {
|
|
75931
|
+
await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
|
|
76042
75932
|
silent: true,
|
|
76043
75933
|
startText: "Installing adapter",
|
|
76044
75934
|
doneText: `${brandColor("installed")} ${dim(
|
|
76045
|
-
`via \`${
|
|
75935
|
+
`via \`${npx} astro add cloudflare\``
|
|
76046
75936
|
)}`
|
|
76047
75937
|
});
|
|
76048
75938
|
updateAstroConfig();
|
|
@@ -76056,7 +75946,7 @@ var updateAstroConfig = () => {
|
|
|
76056
75946
|
if (callee.name !== "cloudflare") {
|
|
76057
75947
|
return this.traverse(n);
|
|
76058
75948
|
}
|
|
76059
|
-
const b3 =
|
|
75949
|
+
const b3 = recast4.types.builders;
|
|
76060
75950
|
n.node.arguments = [
|
|
76061
75951
|
b3.objectExpression([
|
|
76062
75952
|
b3.objectProperty(
|
|
@@ -76071,7 +75961,7 @@ var updateAstroConfig = () => {
|
|
|
76071
75961
|
}
|
|
76072
75962
|
});
|
|
76073
75963
|
};
|
|
76074
|
-
var
|
|
75964
|
+
var config6 = {
|
|
76075
75965
|
configVersion: 1,
|
|
76076
75966
|
id: "astro",
|
|
76077
75967
|
frameworkCli: "create-astro",
|
|
@@ -76094,8 +75984,8 @@ var config7 = {
|
|
|
76094
75984
|
devScript: "dev",
|
|
76095
75985
|
deployScript: "deploy",
|
|
76096
75986
|
previewScript: "preview",
|
|
76097
|
-
generate:
|
|
76098
|
-
configure:
|
|
75987
|
+
generate: generate6,
|
|
75988
|
+
configure: configure6,
|
|
76099
75989
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76100
75990
|
scripts: {
|
|
76101
75991
|
deploy: `astro build && wrangler pages deploy`,
|
|
@@ -76104,21 +75994,21 @@ var config7 = {
|
|
|
76104
75994
|
}
|
|
76105
75995
|
})
|
|
76106
75996
|
};
|
|
76107
|
-
var
|
|
75997
|
+
var c3_default7 = config6;
|
|
76108
75998
|
|
|
76109
75999
|
// templates/astro/workers/c3.ts
|
|
76110
|
-
var
|
|
76111
|
-
var { npx:
|
|
76112
|
-
var
|
|
76000
|
+
var recast5 = __toESM(require_main3());
|
|
76001
|
+
var { npx: npx2 } = detectPackageManager();
|
|
76002
|
+
var generate7 = async (ctx) => {
|
|
76113
76003
|
await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
|
|
76114
76004
|
logRaw("");
|
|
76115
76005
|
};
|
|
76116
|
-
var
|
|
76117
|
-
await runCommand([
|
|
76006
|
+
var configure7 = async () => {
|
|
76007
|
+
await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
|
|
76118
76008
|
silent: true,
|
|
76119
76009
|
startText: "Installing adapter",
|
|
76120
76010
|
doneText: `${brandColor("installed")} ${dim(
|
|
76121
|
-
`via \`${
|
|
76011
|
+
`via \`${npx2} astro add cloudflare\``
|
|
76122
76012
|
)}`
|
|
76123
76013
|
});
|
|
76124
76014
|
updateAstroConfig2();
|
|
@@ -76132,7 +76022,7 @@ var updateAstroConfig2 = () => {
|
|
|
76132
76022
|
if (callee.name !== "cloudflare") {
|
|
76133
76023
|
return this.traverse(n);
|
|
76134
76024
|
}
|
|
76135
|
-
const b3 =
|
|
76025
|
+
const b3 = recast5.types.builders;
|
|
76136
76026
|
n.node.arguments = [
|
|
76137
76027
|
b3.objectExpression([
|
|
76138
76028
|
b3.objectProperty(
|
|
@@ -76147,7 +76037,7 @@ var updateAstroConfig2 = () => {
|
|
|
76147
76037
|
}
|
|
76148
76038
|
});
|
|
76149
76039
|
};
|
|
76150
|
-
var
|
|
76040
|
+
var config7 = {
|
|
76151
76041
|
configVersion: 1,
|
|
76152
76042
|
id: "astro",
|
|
76153
76043
|
frameworkCli: "create-astro",
|
|
@@ -76170,8 +76060,8 @@ var config8 = {
|
|
|
76170
76060
|
deployScript: "deploy",
|
|
76171
76061
|
previewScript: "preview",
|
|
76172
76062
|
path: "templates/astro/workers",
|
|
76173
|
-
generate:
|
|
76174
|
-
configure:
|
|
76063
|
+
generate: generate7,
|
|
76064
|
+
configure: configure7,
|
|
76175
76065
|
transformPackageJson: async (pkgJson, ctx) => ({
|
|
76176
76066
|
scripts: {
|
|
76177
76067
|
deploy: `astro build && wrangler deploy`,
|
|
@@ -76180,17 +76070,17 @@ var config8 = {
|
|
|
76180
76070
|
}
|
|
76181
76071
|
})
|
|
76182
76072
|
};
|
|
76183
|
-
var
|
|
76073
|
+
var c3_default8 = config7;
|
|
76184
76074
|
|
|
76185
76075
|
// templates/astro/c3.ts
|
|
76186
|
-
var
|
|
76076
|
+
var config8 = {
|
|
76187
76077
|
displayName: "Astro",
|
|
76188
|
-
platformVariants: { pages:
|
|
76078
|
+
platformVariants: { pages: c3_default7, workers: c3_default8 }
|
|
76189
76079
|
};
|
|
76190
|
-
var
|
|
76080
|
+
var c3_default9 = config8;
|
|
76191
76081
|
|
|
76192
76082
|
// templates/common/c3.ts
|
|
76193
|
-
var
|
|
76083
|
+
var c3_default10 = {
|
|
76194
76084
|
configVersion: 1,
|
|
76195
76085
|
id: "common",
|
|
76196
76086
|
displayName: "Example router & proxy Worker",
|
|
@@ -76210,36 +76100,36 @@ var c3_default11 = {
|
|
|
76210
76100
|
};
|
|
76211
76101
|
|
|
76212
76102
|
// templates/docusaurus/pages/c3.ts
|
|
76213
|
-
var { npm:
|
|
76214
|
-
var
|
|
76103
|
+
var { npm: npm5 } = detectPackageManager();
|
|
76104
|
+
var generate8 = async (ctx) => {
|
|
76215
76105
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76216
76106
|
};
|
|
76217
|
-
var
|
|
76107
|
+
var config9 = {
|
|
76218
76108
|
configVersion: 1,
|
|
76219
76109
|
id: "docusaurus",
|
|
76220
76110
|
frameworkCli: "create-docusaurus",
|
|
76221
76111
|
platform: "pages",
|
|
76222
76112
|
displayName: "Docusaurus",
|
|
76223
76113
|
path: "templates/docusaurus/pages",
|
|
76224
|
-
generate:
|
|
76114
|
+
generate: generate8,
|
|
76225
76115
|
transformPackageJson: async () => ({
|
|
76226
76116
|
scripts: {
|
|
76227
|
-
preview: `${
|
|
76228
|
-
deploy: `${
|
|
76117
|
+
preview: `${npm5} run build && wrangler pages dev ./build`,
|
|
76118
|
+
deploy: `${npm5} run build && wrangler pages deploy ./build`
|
|
76229
76119
|
}
|
|
76230
76120
|
}),
|
|
76231
76121
|
devScript: "preview",
|
|
76232
76122
|
deployScript: "deploy",
|
|
76233
76123
|
previewScript: "preview"
|
|
76234
76124
|
};
|
|
76235
|
-
var
|
|
76125
|
+
var c3_default11 = config9;
|
|
76236
76126
|
|
|
76237
76127
|
// templates/docusaurus/workers/c3.ts
|
|
76238
|
-
var { npm:
|
|
76239
|
-
var
|
|
76128
|
+
var { npm: npm6 } = detectPackageManager();
|
|
76129
|
+
var generate9 = async (ctx) => {
|
|
76240
76130
|
await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
|
|
76241
76131
|
};
|
|
76242
|
-
var
|
|
76132
|
+
var config10 = {
|
|
76243
76133
|
configVersion: 1,
|
|
76244
76134
|
id: "docusaurus",
|
|
76245
76135
|
frameworkCli: "create-docusaurus",
|
|
@@ -76249,29 +76139,29 @@ var config11 = {
|
|
|
76249
76139
|
path: "./templates"
|
|
76250
76140
|
},
|
|
76251
76141
|
path: "templates/docusaurus/workers",
|
|
76252
|
-
generate:
|
|
76142
|
+
generate: generate9,
|
|
76253
76143
|
transformPackageJson: async () => ({
|
|
76254
76144
|
scripts: {
|
|
76255
|
-
deploy: `${
|
|
76256
|
-
preview: `${
|
|
76145
|
+
deploy: `${npm6} run build && wrangler deploy`,
|
|
76146
|
+
preview: `${npm6} run build && wrangler dev`
|
|
76257
76147
|
}
|
|
76258
76148
|
}),
|
|
76259
76149
|
devScript: "start",
|
|
76260
76150
|
deployScript: "deploy",
|
|
76261
76151
|
previewScript: "preview"
|
|
76262
76152
|
};
|
|
76263
|
-
var
|
|
76153
|
+
var c3_default12 = config10;
|
|
76264
76154
|
|
|
76265
76155
|
// templates/docusaurus/c3.ts
|
|
76266
|
-
var
|
|
76156
|
+
var config11 = {
|
|
76267
76157
|
displayName: "Docusaurus",
|
|
76268
|
-
platformVariants: { pages:
|
|
76158
|
+
platformVariants: { pages: c3_default11, workers: c3_default12 }
|
|
76269
76159
|
};
|
|
76270
|
-
var
|
|
76160
|
+
var c3_default13 = config11;
|
|
76271
76161
|
|
|
76272
76162
|
// templates/gatsby/pages/c3.ts
|
|
76273
|
-
var { npm:
|
|
76274
|
-
var
|
|
76163
|
+
var { npm: npm7 } = detectPackageManager();
|
|
76164
|
+
var generate10 = async (ctx) => {
|
|
76275
76165
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76276
76166
|
const useTemplate = await inputPrompt({
|
|
76277
76167
|
type: "confirm",
|
|
@@ -76290,29 +76180,29 @@ var generate11 = async (ctx) => {
|
|
|
76290
76180
|
}
|
|
76291
76181
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76292
76182
|
};
|
|
76293
|
-
var
|
|
76183
|
+
var config12 = {
|
|
76294
76184
|
configVersion: 1,
|
|
76295
76185
|
id: "gatsby",
|
|
76296
76186
|
frameworkCli: "gatsby",
|
|
76297
76187
|
platform: "pages",
|
|
76298
76188
|
displayName: "Gatsby",
|
|
76299
76189
|
path: "templates/gatsby/pages",
|
|
76300
|
-
generate:
|
|
76190
|
+
generate: generate10,
|
|
76301
76191
|
transformPackageJson: async () => ({
|
|
76302
76192
|
scripts: {
|
|
76303
|
-
deploy: `${
|
|
76304
|
-
preview: `${
|
|
76193
|
+
deploy: `${npm7} run build && wrangler pages deploy ./public`,
|
|
76194
|
+
preview: `${npm7} run build && wrangler pages dev ./public`
|
|
76305
76195
|
}
|
|
76306
76196
|
}),
|
|
76307
76197
|
devScript: "develop",
|
|
76308
76198
|
deployScript: "deploy",
|
|
76309
76199
|
previewScript: "preview"
|
|
76310
76200
|
};
|
|
76311
|
-
var
|
|
76201
|
+
var c3_default14 = config12;
|
|
76312
76202
|
|
|
76313
76203
|
// templates/gatsby/workers/c3.ts
|
|
76314
|
-
var { npm:
|
|
76315
|
-
var
|
|
76204
|
+
var { npm: npm8 } = detectPackageManager();
|
|
76205
|
+
var generate11 = async (ctx) => {
|
|
76316
76206
|
const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
|
|
76317
76207
|
const useTemplate = await inputPrompt({
|
|
76318
76208
|
type: "confirm",
|
|
@@ -76331,7 +76221,7 @@ var generate12 = async (ctx) => {
|
|
|
76331
76221
|
}
|
|
76332
76222
|
await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
|
|
76333
76223
|
};
|
|
76334
|
-
var
|
|
76224
|
+
var config13 = {
|
|
76335
76225
|
configVersion: 1,
|
|
76336
76226
|
id: "gatsby",
|
|
76337
76227
|
frameworkCli: "gatsby",
|
|
@@ -76341,28 +76231,28 @@ var config14 = {
|
|
|
76341
76231
|
path: "./templates"
|
|
76342
76232
|
},
|
|
76343
76233
|
path: "templates/gatsby/workers",
|
|
76344
|
-
generate:
|
|
76234
|
+
generate: generate11,
|
|
76345
76235
|
transformPackageJson: async () => ({
|
|
76346
76236
|
scripts: {
|
|
76347
|
-
deploy: `${
|
|
76348
|
-
preview: `${
|
|
76237
|
+
deploy: `${npm8} run build && wrangler deploy`,
|
|
76238
|
+
preview: `${npm8} run build && wrangler dev`
|
|
76349
76239
|
}
|
|
76350
76240
|
}),
|
|
76351
76241
|
devScript: "develop",
|
|
76352
76242
|
deployScript: "deploy",
|
|
76353
76243
|
previewScript: "preview"
|
|
76354
76244
|
};
|
|
76355
|
-
var
|
|
76245
|
+
var c3_default15 = config13;
|
|
76356
76246
|
|
|
76357
76247
|
// templates/gatsby/c3.ts
|
|
76358
|
-
var
|
|
76248
|
+
var config14 = {
|
|
76359
76249
|
displayName: "Gatsby",
|
|
76360
|
-
platformVariants: { pages:
|
|
76250
|
+
platformVariants: { pages: c3_default14, workers: c3_default15 }
|
|
76361
76251
|
};
|
|
76362
|
-
var
|
|
76252
|
+
var c3_default16 = config14;
|
|
76363
76253
|
|
|
76364
76254
|
// templates/hello-world-assets-only/c3.ts
|
|
76365
|
-
var
|
|
76255
|
+
var config15 = {
|
|
76366
76256
|
configVersion: 1,
|
|
76367
76257
|
id: "hello-world-assets-only",
|
|
76368
76258
|
path: "templates/hello-world-assets-only",
|
|
@@ -76373,10 +76263,10 @@ var config16 = {
|
|
|
76373
76263
|
path: "./templates"
|
|
76374
76264
|
}
|
|
76375
76265
|
};
|
|
76376
|
-
var
|
|
76266
|
+
var c3_default17 = config15;
|
|
76377
76267
|
|
|
76378
76268
|
// templates/hello-world-durable-object-with-assets/c3.ts
|
|
76379
|
-
var
|
|
76269
|
+
var config16 = {
|
|
76380
76270
|
configVersion: 1,
|
|
76381
76271
|
id: "hello-world-durable-object-with-assets",
|
|
76382
76272
|
path: "templates/hello-world-durable-object-with-assets",
|
|
@@ -76394,10 +76284,10 @@ var config17 = {
|
|
|
76394
76284
|
}
|
|
76395
76285
|
}
|
|
76396
76286
|
};
|
|
76397
|
-
var
|
|
76287
|
+
var c3_default18 = config16;
|
|
76398
76288
|
|
|
76399
76289
|
// templates/hello-world-durable-object/c3.ts
|
|
76400
|
-
var
|
|
76290
|
+
var c3_default19 = {
|
|
76401
76291
|
configVersion: 1,
|
|
76402
76292
|
id: "hello-world-durable-object",
|
|
76403
76293
|
displayName: "Worker + Durable Objects",
|
|
@@ -76416,7 +76306,7 @@ var c3_default20 = {
|
|
|
76416
76306
|
};
|
|
76417
76307
|
|
|
76418
76308
|
// templates/hello-world-with-assets/c3.ts
|
|
76419
|
-
var
|
|
76309
|
+
var c3_default20 = {
|
|
76420
76310
|
configVersion: 1,
|
|
76421
76311
|
id: "hello-world-with-assets",
|
|
76422
76312
|
path: "templates/hello-world-with-assets",
|
|
@@ -76441,7 +76331,7 @@ var c3_default21 = {
|
|
|
76441
76331
|
// templates/hello-world/c3.ts
|
|
76442
76332
|
var import_promises2 = require("node:fs/promises");
|
|
76443
76333
|
var import_node_path5 = require("node:path");
|
|
76444
|
-
var
|
|
76334
|
+
var c3_default21 = {
|
|
76445
76335
|
configVersion: 1,
|
|
76446
76336
|
id: "hello-world",
|
|
76447
76337
|
displayName: "Worker only",
|
|
@@ -76475,7 +76365,7 @@ var c3_default22 = {
|
|
|
76475
76365
|
};
|
|
76476
76366
|
|
|
76477
76367
|
// templates/hono/pages/c3.ts
|
|
76478
|
-
var
|
|
76368
|
+
var generate12 = async (ctx) => {
|
|
76479
76369
|
const { name: pm4 } = detectPackageManager();
|
|
76480
76370
|
await runFrameworkGenerator(ctx, [
|
|
76481
76371
|
ctx.project.name,
|
|
@@ -76487,7 +76377,7 @@ var generate13 = async (ctx) => {
|
|
|
76487
76377
|
]);
|
|
76488
76378
|
logRaw("");
|
|
76489
76379
|
};
|
|
76490
|
-
var
|
|
76380
|
+
var config17 = {
|
|
76491
76381
|
configVersion: 1,
|
|
76492
76382
|
id: "hono",
|
|
76493
76383
|
frameworkCli: "create-hono",
|
|
@@ -76497,7 +76387,7 @@ var config18 = {
|
|
|
76497
76387
|
},
|
|
76498
76388
|
path: "templates/hono/pages",
|
|
76499
76389
|
platform: "pages",
|
|
76500
|
-
generate:
|
|
76390
|
+
generate: generate12,
|
|
76501
76391
|
transformPackageJson: async () => ({
|
|
76502
76392
|
scripts: {
|
|
76503
76393
|
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
@@ -76507,10 +76397,10 @@ var config18 = {
|
|
|
76507
76397
|
deployScript: "deploy",
|
|
76508
76398
|
previewScript: "dev"
|
|
76509
76399
|
};
|
|
76510
|
-
var
|
|
76400
|
+
var c3_default22 = config17;
|
|
76511
76401
|
|
|
76512
76402
|
// templates/hono/workers/c3.ts
|
|
76513
|
-
var
|
|
76403
|
+
var generate13 = async (ctx) => {
|
|
76514
76404
|
const { name: pm4 } = detectPackageManager();
|
|
76515
76405
|
await runFrameworkGenerator(ctx, [
|
|
76516
76406
|
ctx.project.name,
|
|
@@ -76522,7 +76412,7 @@ var generate14 = async (ctx) => {
|
|
|
76522
76412
|
]);
|
|
76523
76413
|
logRaw("");
|
|
76524
76414
|
};
|
|
76525
|
-
var
|
|
76415
|
+
var config18 = {
|
|
76526
76416
|
configVersion: 1,
|
|
76527
76417
|
id: "hono",
|
|
76528
76418
|
frameworkCli: "create-hono",
|
|
@@ -76532,7 +76422,7 @@ var config19 = {
|
|
|
76532
76422
|
},
|
|
76533
76423
|
platform: "workers",
|
|
76534
76424
|
path: "templates/hono/workers",
|
|
76535
|
-
generate:
|
|
76425
|
+
generate: generate13,
|
|
76536
76426
|
transformPackageJson: async () => ({
|
|
76537
76427
|
scripts: {
|
|
76538
76428
|
"cf-typegen": "wrangler types --env-interface CloudflareBindings"
|
|
@@ -76542,19 +76432,19 @@ var config19 = {
|
|
|
76542
76432
|
deployScript: "deploy",
|
|
76543
76433
|
previewScript: "dev"
|
|
76544
76434
|
};
|
|
76545
|
-
var
|
|
76435
|
+
var c3_default23 = config18;
|
|
76546
76436
|
|
|
76547
76437
|
// templates/hono/c3.ts
|
|
76548
|
-
var
|
|
76438
|
+
var config19 = {
|
|
76549
76439
|
displayName: "Hono",
|
|
76550
|
-
platformVariants: { pages:
|
|
76440
|
+
platformVariants: { pages: c3_default22, workers: c3_default23 }
|
|
76551
76441
|
};
|
|
76552
|
-
var
|
|
76442
|
+
var c3_default24 = config19;
|
|
76553
76443
|
|
|
76554
76444
|
// templates/next/c3.ts
|
|
76555
76445
|
var import_path10 = require("path");
|
|
76556
|
-
var { npm:
|
|
76557
|
-
var
|
|
76446
|
+
var { npm: npm9, npx: npx3 } = detectPackageManager();
|
|
76447
|
+
var generate14 = async (ctx) => {
|
|
76558
76448
|
const projectName = ctx.project.name;
|
|
76559
76449
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
76560
76450
|
const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
|
|
@@ -76579,7 +76469,7 @@ var updateNextConfig2 = (usesTs) => {
|
|
|
76579
76469
|
writeFile2(configFile, updatedConfigFile);
|
|
76580
76470
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76581
76471
|
};
|
|
76582
|
-
var
|
|
76472
|
+
var configure8 = async (ctx) => {
|
|
76583
76473
|
const projectPath = ctx.project.path;
|
|
76584
76474
|
const path6 = probePaths([
|
|
76585
76475
|
`${projectPath}/pages/api`,
|
|
@@ -76654,14 +76544,14 @@ var addDevDependencies = async (installEslintPlugin) => {
|
|
|
76654
76544
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
76655
76545
|
});
|
|
76656
76546
|
};
|
|
76657
|
-
var
|
|
76547
|
+
var c3_default25 = {
|
|
76658
76548
|
configVersion: 1,
|
|
76659
76549
|
id: "next",
|
|
76660
76550
|
frameworkCli: "create-next-app",
|
|
76661
76551
|
platform: "pages",
|
|
76662
76552
|
displayName: "Next.js",
|
|
76663
|
-
generate:
|
|
76664
|
-
configure:
|
|
76553
|
+
generate: generate14,
|
|
76554
|
+
configure: configure8,
|
|
76665
76555
|
copyFiles: {
|
|
76666
76556
|
async selectVariant(ctx) {
|
|
76667
76557
|
const isApp = probePaths([
|
|
@@ -76692,12 +76582,12 @@ var c3_default26 = {
|
|
|
76692
76582
|
}
|
|
76693
76583
|
},
|
|
76694
76584
|
transformPackageJson: async (_3, ctx) => {
|
|
76695
|
-
const isNpm =
|
|
76696
|
-
const isBun =
|
|
76585
|
+
const isNpm = npm9 === "npm";
|
|
76586
|
+
const isBun = npm9 === "bun";
|
|
76697
76587
|
const isNpmOrBun = isNpm || isBun;
|
|
76698
76588
|
const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
|
|
76699
76589
|
const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
|
|
76700
|
-
const pmCommand = isNpmOrBun ?
|
|
76590
|
+
const pmCommand = isNpmOrBun ? npx3 : npm9;
|
|
76701
76591
|
const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
|
|
76702
76592
|
return {
|
|
76703
76593
|
scripts: {
|
|
@@ -76717,21 +76607,22 @@ var c3_default26 = {
|
|
|
76717
76607
|
};
|
|
76718
76608
|
|
|
76719
76609
|
// templates/nuxt/pages/c3.ts
|
|
76720
|
-
var
|
|
76721
|
-
var { npm:
|
|
76722
|
-
var
|
|
76610
|
+
var recast6 = __toESM(require_main3());
|
|
76611
|
+
var { npm: npm10, name: pm2 } = detectPackageManager();
|
|
76612
|
+
var generate15 = async (ctx) => {
|
|
76723
76613
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76724
76614
|
await runFrameworkGenerator(ctx, [
|
|
76725
76615
|
"init",
|
|
76726
76616
|
ctx.project.name,
|
|
76727
76617
|
"--packageManager",
|
|
76728
|
-
|
|
76618
|
+
npm10,
|
|
76619
|
+
"--no-install",
|
|
76729
76620
|
gitFlag
|
|
76730
76621
|
]);
|
|
76731
76622
|
writeFile2("./.node-version", "18");
|
|
76732
76623
|
logRaw("");
|
|
76733
76624
|
};
|
|
76734
|
-
var
|
|
76625
|
+
var configure9 = async (ctx) => {
|
|
76735
76626
|
const packages = ["nitro-cloudflare-dev"];
|
|
76736
76627
|
if (pm2 === "pnpm") {
|
|
76737
76628
|
packages.push("h3");
|
|
@@ -76739,7 +76630,7 @@ var configure10 = async (ctx) => {
|
|
|
76739
76630
|
await installPackages(packages, {
|
|
76740
76631
|
dev: true,
|
|
76741
76632
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76742
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76633
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
76743
76634
|
});
|
|
76744
76635
|
updateNuxtConfig();
|
|
76745
76636
|
updateEnvTypes2(ctx);
|
|
@@ -76762,7 +76653,7 @@ var updateNuxtConfig = () => {
|
|
|
76762
76653
|
const s = spinner();
|
|
76763
76654
|
const configFile = "nuxt.config.ts";
|
|
76764
76655
|
s.start(`Updating \`${configFile}\``);
|
|
76765
|
-
const b3 =
|
|
76656
|
+
const b3 = recast6.types.builders;
|
|
76766
76657
|
const presetDef = b3.objectProperty(
|
|
76767
76658
|
b3.identifier("nitro"),
|
|
76768
76659
|
b3.objectExpression([
|
|
@@ -76800,7 +76691,7 @@ var updateNuxtConfig = () => {
|
|
|
76800
76691
|
});
|
|
76801
76692
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76802
76693
|
};
|
|
76803
|
-
var
|
|
76694
|
+
var config20 = {
|
|
76804
76695
|
configVersion: 1,
|
|
76805
76696
|
id: "nuxt",
|
|
76806
76697
|
frameworkCli: "nuxi",
|
|
@@ -76810,12 +76701,12 @@ var config21 = {
|
|
|
76810
76701
|
path: "./templates"
|
|
76811
76702
|
},
|
|
76812
76703
|
path: "templates/nuxt/pages",
|
|
76813
|
-
generate:
|
|
76814
|
-
configure:
|
|
76704
|
+
generate: generate15,
|
|
76705
|
+
configure: configure9,
|
|
76815
76706
|
transformPackageJson: async () => ({
|
|
76816
76707
|
scripts: {
|
|
76817
|
-
deploy: `${
|
|
76818
|
-
preview: `${
|
|
76708
|
+
deploy: `${npm10} run build && wrangler pages deploy`,
|
|
76709
|
+
preview: `${npm10} run build && wrangler pages dev`,
|
|
76819
76710
|
"cf-typegen": `wrangler types`
|
|
76820
76711
|
}
|
|
76821
76712
|
}),
|
|
@@ -76823,24 +76714,25 @@ var config21 = {
|
|
|
76823
76714
|
deployScript: "deploy",
|
|
76824
76715
|
previewScript: "preview"
|
|
76825
76716
|
};
|
|
76826
|
-
var
|
|
76717
|
+
var c3_default26 = config20;
|
|
76827
76718
|
|
|
76828
76719
|
// templates/nuxt/workers/c3.ts
|
|
76829
|
-
var
|
|
76830
|
-
var { npm:
|
|
76831
|
-
var
|
|
76720
|
+
var recast7 = __toESM(require_main3());
|
|
76721
|
+
var { npm: npm11, name: pm3 } = detectPackageManager();
|
|
76722
|
+
var generate16 = async (ctx) => {
|
|
76832
76723
|
const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
|
|
76833
76724
|
await runFrameworkGenerator(ctx, [
|
|
76834
76725
|
"init",
|
|
76835
76726
|
ctx.project.name,
|
|
76836
76727
|
"--packageManager",
|
|
76837
|
-
|
|
76728
|
+
npm11,
|
|
76729
|
+
"--no-install",
|
|
76838
76730
|
gitFlag
|
|
76839
76731
|
]);
|
|
76840
76732
|
writeFile2("./.node-version", "18");
|
|
76841
76733
|
logRaw("");
|
|
76842
76734
|
};
|
|
76843
|
-
var
|
|
76735
|
+
var configure10 = async (ctx) => {
|
|
76844
76736
|
const packages = ["nitro-cloudflare-dev", "nitropack"];
|
|
76845
76737
|
if (pm3 === "pnpm") {
|
|
76846
76738
|
packages.push("h3");
|
|
@@ -76848,7 +76740,7 @@ var configure11 = async (ctx) => {
|
|
|
76848
76740
|
await installPackages(packages, {
|
|
76849
76741
|
dev: true,
|
|
76850
76742
|
startText: "Installing nitro module `nitro-cloudflare-dev`",
|
|
76851
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
76743
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
|
|
76852
76744
|
});
|
|
76853
76745
|
updateNuxtConfig2();
|
|
76854
76746
|
updateEnvTypes3(ctx);
|
|
@@ -76871,7 +76763,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76871
76763
|
const s = spinner();
|
|
76872
76764
|
const configFile = "nuxt.config.ts";
|
|
76873
76765
|
s.start(`Updating \`${configFile}\``);
|
|
76874
|
-
const b3 =
|
|
76766
|
+
const b3 = recast7.types.builders;
|
|
76875
76767
|
const presetDef = b3.objectProperty(
|
|
76876
76768
|
b3.identifier("nitro"),
|
|
76877
76769
|
b3.objectExpression([
|
|
@@ -76909,7 +76801,7 @@ var updateNuxtConfig2 = () => {
|
|
|
76909
76801
|
});
|
|
76910
76802
|
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
76911
76803
|
};
|
|
76912
|
-
var
|
|
76804
|
+
var config21 = {
|
|
76913
76805
|
configVersion: 1,
|
|
76914
76806
|
id: "nuxt",
|
|
76915
76807
|
frameworkCli: "nuxi",
|
|
@@ -76919,12 +76811,12 @@ var config22 = {
|
|
|
76919
76811
|
path: "./templates"
|
|
76920
76812
|
},
|
|
76921
76813
|
path: "templates/nuxt/workers",
|
|
76922
|
-
generate:
|
|
76923
|
-
configure:
|
|
76814
|
+
generate: generate16,
|
|
76815
|
+
configure: configure10,
|
|
76924
76816
|
transformPackageJson: async () => ({
|
|
76925
76817
|
scripts: {
|
|
76926
|
-
deploy: `${
|
|
76927
|
-
preview: `${
|
|
76818
|
+
deploy: `${npm11} run build && wrangler deploy`,
|
|
76819
|
+
preview: `${npm11} run build && wrangler dev`,
|
|
76928
76820
|
"cf-typegen": `wrangler types`
|
|
76929
76821
|
}
|
|
76930
76822
|
}),
|
|
@@ -76932,17 +76824,17 @@ var config22 = {
|
|
|
76932
76824
|
deployScript: "deploy",
|
|
76933
76825
|
previewScript: "preview"
|
|
76934
76826
|
};
|
|
76935
|
-
var
|
|
76827
|
+
var c3_default27 = config21;
|
|
76936
76828
|
|
|
76937
76829
|
// templates/nuxt/c3.ts
|
|
76938
|
-
var
|
|
76830
|
+
var config22 = {
|
|
76939
76831
|
displayName: "Nuxt",
|
|
76940
|
-
platformVariants: { pages:
|
|
76832
|
+
platformVariants: { pages: c3_default26, workers: c3_default27 }
|
|
76941
76833
|
};
|
|
76942
|
-
var
|
|
76834
|
+
var c3_default28 = config22;
|
|
76943
76835
|
|
|
76944
76836
|
// templates/openapi/c3.ts
|
|
76945
|
-
var
|
|
76837
|
+
var c3_default29 = {
|
|
76946
76838
|
configVersion: 1,
|
|
76947
76839
|
id: "openapi",
|
|
76948
76840
|
displayName: "API starter (OpenAPI compliant)",
|
|
@@ -77101,7 +76993,7 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
77101
76993
|
(0, import_path11.join)(ctx.project.path, "wrangler.toml")
|
|
77102
76994
|
);
|
|
77103
76995
|
}
|
|
77104
|
-
var
|
|
76996
|
+
var c3_default30 = {
|
|
77105
76997
|
configVersion: 1,
|
|
77106
76998
|
id: "pre-existing",
|
|
77107
76999
|
displayName: "Pre-existing Worker (from Dashboard)",
|
|
@@ -77129,7 +77021,7 @@ function buildConfigure(params) {
|
|
|
77129
77021
|
}
|
|
77130
77022
|
|
|
77131
77023
|
// templates/queues/c3.ts
|
|
77132
|
-
var
|
|
77024
|
+
var c3_default31 = {
|
|
77133
77025
|
configVersion: 1,
|
|
77134
77026
|
id: "queues",
|
|
77135
77027
|
displayName: "Queue consumer & producer Worker",
|
|
@@ -77157,7 +77049,115 @@ var c3_default32 = {
|
|
|
77157
77049
|
}
|
|
77158
77050
|
};
|
|
77159
77051
|
|
|
77160
|
-
// templates/qwik/c3.ts
|
|
77052
|
+
// templates/qwik/pages/c3.ts
|
|
77053
|
+
var recast8 = __toESM(require_main3());
|
|
77054
|
+
var { npm: npm12, npx: npx4, name } = detectPackageManager();
|
|
77055
|
+
var generate17 = async (ctx) => {
|
|
77056
|
+
await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
|
|
77057
|
+
};
|
|
77058
|
+
var configure11 = async (ctx) => {
|
|
77059
|
+
const cmd = [name === "pnpm" ? npm12 : npx4, "qwik", "add", "cloudflare-pages"];
|
|
77060
|
+
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
77061
|
+
await runCommand(cmd);
|
|
77062
|
+
addBindingsProxy(ctx);
|
|
77063
|
+
populateCloudflareEnv();
|
|
77064
|
+
};
|
|
77065
|
+
var addBindingsProxy = (ctx) => {
|
|
77066
|
+
if (!usesTypescript(ctx)) {
|
|
77067
|
+
return;
|
|
77068
|
+
}
|
|
77069
|
+
const s = spinner();
|
|
77070
|
+
s.start("Updating `vite.config.ts`");
|
|
77071
|
+
const snippets = loadTemplateSnippets(ctx);
|
|
77072
|
+
const b3 = recast8.types.builders;
|
|
77073
|
+
transformFile("vite.config.ts", {
|
|
77074
|
+
// Insert the env declaration after the last import (but before the rest of the body)
|
|
77075
|
+
visitProgram: function(n) {
|
|
77076
|
+
const lastImportIndex = n.node.body.findLastIndex(
|
|
77077
|
+
(t2) => t2.type === "ImportDeclaration"
|
|
77078
|
+
);
|
|
77079
|
+
const lastImport = n.get("body", lastImportIndex);
|
|
77080
|
+
lastImport.insertAfter(...snippets.getPlatformProxyTs);
|
|
77081
|
+
return this.traverse(n);
|
|
77082
|
+
},
|
|
77083
|
+
// Pass the `platform` object from the declaration to the `qwikCity` plugin
|
|
77084
|
+
visitCallExpression: function(n) {
|
|
77085
|
+
const callee = n.node.callee;
|
|
77086
|
+
if (callee.name !== "qwikCity") {
|
|
77087
|
+
return this.traverse(n);
|
|
77088
|
+
}
|
|
77089
|
+
const configArgument = n.node.arguments[0];
|
|
77090
|
+
const platformPropery = b3.objectProperty.from({
|
|
77091
|
+
key: b3.identifier("platform"),
|
|
77092
|
+
value: b3.identifier("platform"),
|
|
77093
|
+
shorthand: true
|
|
77094
|
+
});
|
|
77095
|
+
if (!configArgument) {
|
|
77096
|
+
n.node.arguments = [b3.objectExpression([platformPropery])];
|
|
77097
|
+
return false;
|
|
77098
|
+
}
|
|
77099
|
+
if (configArgument.type !== "ObjectExpression") {
|
|
77100
|
+
throw new Error("Failed to update `vite.config.ts`");
|
|
77101
|
+
}
|
|
77102
|
+
configArgument.properties.push(platformPropery);
|
|
77103
|
+
return false;
|
|
77104
|
+
}
|
|
77105
|
+
});
|
|
77106
|
+
s.stop(`${brandColor("updated")} \`vite.config.ts\``);
|
|
77107
|
+
};
|
|
77108
|
+
var populateCloudflareEnv = () => {
|
|
77109
|
+
const entrypointPath = "src/entry.cloudflare-pages.tsx";
|
|
77110
|
+
const s = spinner();
|
|
77111
|
+
s.start(`Updating \`${entrypointPath}\``);
|
|
77112
|
+
transformFile(entrypointPath, {
|
|
77113
|
+
visitTSInterfaceDeclaration: function(n) {
|
|
77114
|
+
const b3 = recast8.types.builders;
|
|
77115
|
+
const id = n.node.id;
|
|
77116
|
+
if (id.name !== "QwikCityPlatform") {
|
|
77117
|
+
this.traverse(n);
|
|
77118
|
+
}
|
|
77119
|
+
const newBody = [
|
|
77120
|
+
["env", "Env"]
|
|
77121
|
+
// Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
|
|
77122
|
+
// ["cf", "CfProperties"],
|
|
77123
|
+
].map(
|
|
77124
|
+
([varName, type]) => b3.tsPropertySignature(
|
|
77125
|
+
b3.identifier(varName),
|
|
77126
|
+
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
|
|
77127
|
+
)
|
|
77128
|
+
);
|
|
77129
|
+
n.node.body.body = newBody;
|
|
77130
|
+
return false;
|
|
77131
|
+
}
|
|
77132
|
+
});
|
|
77133
|
+
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
77134
|
+
};
|
|
77135
|
+
var config23 = {
|
|
77136
|
+
configVersion: 1,
|
|
77137
|
+
id: "qwik",
|
|
77138
|
+
frameworkCli: "create-qwik",
|
|
77139
|
+
displayName: "Qwik",
|
|
77140
|
+
platform: "pages",
|
|
77141
|
+
copyFiles: {
|
|
77142
|
+
path: "./templates"
|
|
77143
|
+
},
|
|
77144
|
+
path: "templates/qwik/pages",
|
|
77145
|
+
generate: generate17,
|
|
77146
|
+
configure: configure11,
|
|
77147
|
+
transformPackageJson: async () => ({
|
|
77148
|
+
scripts: {
|
|
77149
|
+
deploy: `${npm12} run build && wrangler pages deploy`,
|
|
77150
|
+
preview: `${npm12} run build && wrangler pages dev`,
|
|
77151
|
+
"cf-typegen": `wrangler types`
|
|
77152
|
+
}
|
|
77153
|
+
}),
|
|
77154
|
+
devScript: "dev",
|
|
77155
|
+
deployScript: "deploy",
|
|
77156
|
+
previewScript: "preview"
|
|
77157
|
+
};
|
|
77158
|
+
var c3_default32 = config23;
|
|
77159
|
+
|
|
77160
|
+
// templates/qwik/workers/c3.ts
|
|
77161
77161
|
var recast9 = __toESM(require_main3());
|
|
77162
77162
|
var { npm: npm13, npx: npx5, name: name2 } = detectPackageManager();
|
|
77163
77163
|
var generate18 = async (ctx) => {
|
|
@@ -77167,6 +77167,9 @@ var configure12 = async (ctx) => {
|
|
|
77167
77167
|
const cmd = [name2 === "pnpm" ? npm13 : npx5, "qwik", "add", "cloudflare-pages"];
|
|
77168
77168
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
77169
77169
|
await runCommand(cmd);
|
|
77170
|
+
removeFile("./public/_headers");
|
|
77171
|
+
removeFile("./public/_redirects");
|
|
77172
|
+
removeFile("./public/_routes.json");
|
|
77170
77173
|
addBindingsProxy2(ctx);
|
|
77171
77174
|
populateCloudflareEnv2();
|
|
77172
77175
|
};
|
|
@@ -77205,7 +77208,7 @@ var addBindingsProxy2 = (ctx) => {
|
|
|
77205
77208
|
return false;
|
|
77206
77209
|
}
|
|
77207
77210
|
if (configArgument.type !== "ObjectExpression") {
|
|
77208
|
-
|
|
77211
|
+
crash("Failed to update `vite.config.ts`");
|
|
77209
77212
|
}
|
|
77210
77213
|
configArgument.properties.push(platformPropery);
|
|
77211
77214
|
return false;
|
|
@@ -77245,16 +77248,17 @@ var config24 = {
|
|
|
77245
77248
|
id: "qwik",
|
|
77246
77249
|
frameworkCli: "create-qwik",
|
|
77247
77250
|
displayName: "Qwik",
|
|
77248
|
-
platform: "
|
|
77251
|
+
platform: "workers",
|
|
77249
77252
|
copyFiles: {
|
|
77250
77253
|
path: "./templates"
|
|
77251
77254
|
},
|
|
77255
|
+
path: "templates/qwik/workers",
|
|
77252
77256
|
generate: generate18,
|
|
77253
77257
|
configure: configure12,
|
|
77254
77258
|
transformPackageJson: async () => ({
|
|
77255
77259
|
scripts: {
|
|
77256
|
-
deploy: `${npm13} run build && wrangler
|
|
77257
|
-
preview: `${npm13} run build && wrangler
|
|
77260
|
+
deploy: `${npm13} run build && wrangler deploy`,
|
|
77261
|
+
preview: `${npm13} run build && wrangler dev`,
|
|
77258
77262
|
"cf-typegen": `wrangler types`
|
|
77259
77263
|
}
|
|
77260
77264
|
}),
|
|
@@ -77264,9 +77268,53 @@ var config24 = {
|
|
|
77264
77268
|
};
|
|
77265
77269
|
var c3_default33 = config24;
|
|
77266
77270
|
|
|
77267
|
-
// templates/
|
|
77271
|
+
// templates/qwik/c3.ts
|
|
77272
|
+
var config25 = {
|
|
77273
|
+
displayName: "Qwik",
|
|
77274
|
+
platformVariants: { pages: c3_default32, workers: c3_default33 }
|
|
77275
|
+
};
|
|
77276
|
+
var c3_default34 = config25;
|
|
77277
|
+
|
|
77278
|
+
// templates/react-router/c3.ts
|
|
77268
77279
|
var { npm: npm14 } = detectPackageManager();
|
|
77269
77280
|
var generate19 = async (ctx) => {
|
|
77281
|
+
await runFrameworkGenerator(ctx, [
|
|
77282
|
+
ctx.project.name,
|
|
77283
|
+
"--template",
|
|
77284
|
+
"https://github.com/remix-run/react-router-templates/tree/main/cloudflare",
|
|
77285
|
+
// to prevent asking about git twice, just let c3 do it
|
|
77286
|
+
"--no-git-init",
|
|
77287
|
+
"--no-install"
|
|
77288
|
+
]);
|
|
77289
|
+
logRaw("");
|
|
77290
|
+
};
|
|
77291
|
+
var config26 = {
|
|
77292
|
+
configVersion: 1,
|
|
77293
|
+
id: "react-router",
|
|
77294
|
+
platform: "workers",
|
|
77295
|
+
frameworkCli: "create-react-router",
|
|
77296
|
+
displayName: "React Router (formerly Remix)",
|
|
77297
|
+
copyFiles: {
|
|
77298
|
+
path: "./templates"
|
|
77299
|
+
},
|
|
77300
|
+
generate: generate19,
|
|
77301
|
+
// configure,
|
|
77302
|
+
transformPackageJson: async () => ({
|
|
77303
|
+
scripts: {
|
|
77304
|
+
deploy: `${npm14} run build && wrangler deploy`,
|
|
77305
|
+
preview: `${npm14} run build && vite preview`,
|
|
77306
|
+
"cf-typegen": `wrangler types`
|
|
77307
|
+
}
|
|
77308
|
+
}),
|
|
77309
|
+
devScript: "dev",
|
|
77310
|
+
deployScript: "deploy",
|
|
77311
|
+
previewScript: "preview"
|
|
77312
|
+
};
|
|
77313
|
+
var c3_default35 = config26;
|
|
77314
|
+
|
|
77315
|
+
// templates/react/pages/c3.ts
|
|
77316
|
+
var { npm: npm15 } = detectPackageManager();
|
|
77317
|
+
var generate20 = async (ctx) => {
|
|
77270
77318
|
const variant = await inputPrompt({
|
|
77271
77319
|
type: "select",
|
|
77272
77320
|
question: "Select a variant:",
|
|
@@ -77295,7 +77343,7 @@ var variantsOptions = [
|
|
|
77295
77343
|
label: "JavaScript + SWC"
|
|
77296
77344
|
}
|
|
77297
77345
|
];
|
|
77298
|
-
var
|
|
77346
|
+
var config27 = {
|
|
77299
77347
|
configVersion: 1,
|
|
77300
77348
|
id: "react",
|
|
77301
77349
|
// React's documentation now recommends using create-vite.
|
|
@@ -77303,26 +77351,26 @@ var config25 = {
|
|
|
77303
77351
|
displayName: "React",
|
|
77304
77352
|
platform: "pages",
|
|
77305
77353
|
path: "templates/react/pages",
|
|
77306
|
-
generate:
|
|
77354
|
+
generate: generate20,
|
|
77307
77355
|
transformPackageJson: async () => ({
|
|
77308
77356
|
scripts: {
|
|
77309
|
-
deploy: `${
|
|
77310
|
-
preview: `${
|
|
77357
|
+
deploy: `${npm15} run build && wrangler pages deploy ./dist`,
|
|
77358
|
+
preview: `${npm15} run build && wrangler pages dev ./dist`
|
|
77311
77359
|
}
|
|
77312
77360
|
}),
|
|
77313
77361
|
devScript: "dev",
|
|
77314
77362
|
deployScript: "deploy",
|
|
77315
77363
|
previewScript: "preview"
|
|
77316
77364
|
};
|
|
77317
|
-
var
|
|
77365
|
+
var c3_default36 = config27;
|
|
77318
77366
|
|
|
77319
77367
|
// templates/react/workers/c3.ts
|
|
77320
77368
|
var import_assert2 = __toESM(require("assert"));
|
|
77321
77369
|
var recast10 = __toESM(require_main3());
|
|
77322
77370
|
var b2 = recast10.types.builders;
|
|
77323
77371
|
var t = recast10.types.namedTypes;
|
|
77324
|
-
var { npm:
|
|
77325
|
-
var
|
|
77372
|
+
var { npm: npm16 } = detectPackageManager();
|
|
77373
|
+
var generate21 = async (ctx) => {
|
|
77326
77374
|
const variant = await getVariant();
|
|
77327
77375
|
ctx.args.lang = variant.lang;
|
|
77328
77376
|
await runFrameworkGenerator(ctx, [
|
|
@@ -77363,9 +77411,9 @@ function transformViteConfig(ctx) {
|
|
|
77363
77411
|
if (callee.name !== "defineConfig") {
|
|
77364
77412
|
return this.traverse(n);
|
|
77365
77413
|
}
|
|
77366
|
-
const
|
|
77367
|
-
(0, import_assert2.default)(t.ObjectExpression.check(
|
|
77368
|
-
const pluginsProp =
|
|
77414
|
+
const config40 = n.node.arguments[0];
|
|
77415
|
+
(0, import_assert2.default)(t.ObjectExpression.check(config40));
|
|
77416
|
+
const pluginsProp = config40.properties.find((prop) => isPluginsProp(prop));
|
|
77369
77417
|
(0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
77370
77418
|
pluginsProp.value.elements.push(
|
|
77371
77419
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -77422,7 +77470,7 @@ async function getVariant() {
|
|
|
77422
77470
|
(0, import_assert2.default)(selected, "Expected a variant to be selected");
|
|
77423
77471
|
return selected;
|
|
77424
77472
|
}
|
|
77425
|
-
var
|
|
77473
|
+
var config28 = {
|
|
77426
77474
|
configVersion: 1,
|
|
77427
77475
|
id: "react",
|
|
77428
77476
|
frameworkCli: "create-vite",
|
|
@@ -77439,12 +77487,12 @@ var config26 = {
|
|
|
77439
77487
|
}
|
|
77440
77488
|
}
|
|
77441
77489
|
},
|
|
77442
|
-
generate:
|
|
77490
|
+
generate: generate21,
|
|
77443
77491
|
configure: configure13,
|
|
77444
77492
|
transformPackageJson: async (_3, ctx) => ({
|
|
77445
77493
|
scripts: {
|
|
77446
|
-
deploy: `${
|
|
77447
|
-
preview: `${
|
|
77494
|
+
deploy: `${npm16} run build && wrangler deploy`,
|
|
77495
|
+
preview: `${npm16} run build && vite preview`,
|
|
77448
77496
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
77449
77497
|
}
|
|
77450
77498
|
}),
|
|
@@ -77452,18 +77500,18 @@ var config26 = {
|
|
|
77452
77500
|
deployScript: "deploy",
|
|
77453
77501
|
previewScript: "preview"
|
|
77454
77502
|
};
|
|
77455
|
-
var
|
|
77503
|
+
var c3_default37 = config28;
|
|
77456
77504
|
|
|
77457
77505
|
// templates/react/c3.ts
|
|
77458
|
-
var
|
|
77506
|
+
var config29 = {
|
|
77459
77507
|
displayName: "React",
|
|
77460
|
-
platformVariants: { pages:
|
|
77508
|
+
platformVariants: { pages: c3_default36, workers: c3_default37 }
|
|
77461
77509
|
};
|
|
77462
|
-
var
|
|
77510
|
+
var c3_default38 = config29;
|
|
77463
77511
|
|
|
77464
77512
|
// templates/remix/pages/c3.ts
|
|
77465
|
-
var { npm:
|
|
77466
|
-
var
|
|
77513
|
+
var { npm: npm17 } = detectPackageManager();
|
|
77514
|
+
var generate22 = async (ctx) => {
|
|
77467
77515
|
await runFrameworkGenerator(ctx, [
|
|
77468
77516
|
ctx.project.name,
|
|
77469
77517
|
"--template",
|
|
@@ -77486,7 +77534,7 @@ var configure14 = async () => {
|
|
|
77486
77534
|
});
|
|
77487
77535
|
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
77488
77536
|
};
|
|
77489
|
-
var
|
|
77537
|
+
var config30 = {
|
|
77490
77538
|
configVersion: 1,
|
|
77491
77539
|
id: "remix",
|
|
77492
77540
|
frameworkCli: "create-remix",
|
|
@@ -77496,12 +77544,12 @@ var config28 = {
|
|
|
77496
77544
|
path: "./templates"
|
|
77497
77545
|
},
|
|
77498
77546
|
path: "templates/remix/pages",
|
|
77499
|
-
generate:
|
|
77547
|
+
generate: generate22,
|
|
77500
77548
|
configure: configure14,
|
|
77501
77549
|
transformPackageJson: async () => ({
|
|
77502
77550
|
scripts: {
|
|
77503
|
-
deploy: `${
|
|
77504
|
-
preview: `${
|
|
77551
|
+
deploy: `${npm17} run build && wrangler pages deploy`,
|
|
77552
|
+
preview: `${npm17} run build && wrangler pages dev`,
|
|
77505
77553
|
"cf-typegen": `wrangler types`
|
|
77506
77554
|
}
|
|
77507
77555
|
}),
|
|
@@ -77509,11 +77557,11 @@ var config28 = {
|
|
|
77509
77557
|
deployScript: "deploy",
|
|
77510
77558
|
previewScript: "preview"
|
|
77511
77559
|
};
|
|
77512
|
-
var
|
|
77560
|
+
var c3_default39 = config30;
|
|
77513
77561
|
|
|
77514
77562
|
// templates/remix/workers/c3.ts
|
|
77515
|
-
var { npm:
|
|
77516
|
-
var
|
|
77563
|
+
var { npm: npm18 } = detectPackageManager();
|
|
77564
|
+
var generate23 = async (ctx) => {
|
|
77517
77565
|
await runFrameworkGenerator(ctx, [
|
|
77518
77566
|
ctx.project.name,
|
|
77519
77567
|
"--template",
|
|
@@ -77528,7 +77576,7 @@ var configure15 = async () => {
|
|
|
77528
77576
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
77529
77577
|
});
|
|
77530
77578
|
};
|
|
77531
|
-
var
|
|
77579
|
+
var config31 = {
|
|
77532
77580
|
configVersion: 1,
|
|
77533
77581
|
id: "remix",
|
|
77534
77582
|
frameworkCli: "create-remix",
|
|
@@ -77538,12 +77586,12 @@ var config29 = {
|
|
|
77538
77586
|
path: "./templates"
|
|
77539
77587
|
},
|
|
77540
77588
|
path: "templates/remix/workers",
|
|
77541
|
-
generate:
|
|
77589
|
+
generate: generate23,
|
|
77542
77590
|
configure: configure15,
|
|
77543
77591
|
transformPackageJson: async () => ({
|
|
77544
77592
|
scripts: {
|
|
77545
|
-
deploy: `${
|
|
77546
|
-
preview: `${
|
|
77593
|
+
deploy: `${npm18} run build && wrangler deploy`,
|
|
77594
|
+
preview: `${npm18} run build && wrangler dev`,
|
|
77547
77595
|
"cf-typegen": `wrangler types`
|
|
77548
77596
|
}
|
|
77549
77597
|
}),
|
|
@@ -77551,17 +77599,18 @@ var config29 = {
|
|
|
77551
77599
|
deployScript: "deploy",
|
|
77552
77600
|
previewScript: "preview"
|
|
77553
77601
|
};
|
|
77554
|
-
var
|
|
77602
|
+
var c3_default40 = config31;
|
|
77555
77603
|
|
|
77556
77604
|
// templates/remix/c3.ts
|
|
77557
|
-
var
|
|
77605
|
+
var config32 = {
|
|
77558
77606
|
displayName: "Remix",
|
|
77559
|
-
platformVariants: { pages:
|
|
77607
|
+
platformVariants: { pages: c3_default39, workers: c3_default40 },
|
|
77608
|
+
hidden: true
|
|
77560
77609
|
};
|
|
77561
|
-
var
|
|
77610
|
+
var c3_default41 = config32;
|
|
77562
77611
|
|
|
77563
77612
|
// templates/scheduled/c3.ts
|
|
77564
|
-
var
|
|
77613
|
+
var c3_default42 = {
|
|
77565
77614
|
configVersion: 1,
|
|
77566
77615
|
id: "scheduled",
|
|
77567
77616
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -77581,8 +77630,8 @@ var c3_default40 = {
|
|
|
77581
77630
|
|
|
77582
77631
|
// templates/solid/c3.ts
|
|
77583
77632
|
var recast11 = __toESM(require_main3());
|
|
77584
|
-
var { npm:
|
|
77585
|
-
var
|
|
77633
|
+
var { npm: npm19 } = detectPackageManager();
|
|
77634
|
+
var generate24 = async (ctx) => {
|
|
77586
77635
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
77587
77636
|
logRaw("");
|
|
77588
77637
|
};
|
|
@@ -77624,7 +77673,7 @@ var configure16 = async (ctx) => {
|
|
|
77624
77673
|
}
|
|
77625
77674
|
});
|
|
77626
77675
|
};
|
|
77627
|
-
var
|
|
77676
|
+
var config33 = {
|
|
77628
77677
|
configVersion: 1,
|
|
77629
77678
|
id: "solid",
|
|
77630
77679
|
frameworkCli: "create-solid",
|
|
@@ -77633,12 +77682,12 @@ var config31 = {
|
|
|
77633
77682
|
copyFiles: {
|
|
77634
77683
|
path: "./templates"
|
|
77635
77684
|
},
|
|
77636
|
-
generate:
|
|
77685
|
+
generate: generate24,
|
|
77637
77686
|
configure: configure16,
|
|
77638
77687
|
transformPackageJson: async () => ({
|
|
77639
77688
|
scripts: {
|
|
77640
|
-
preview: `${
|
|
77641
|
-
deploy: `${
|
|
77689
|
+
preview: `${npm19} run build && npx wrangler pages dev`,
|
|
77690
|
+
deploy: `${npm19} run build && wrangler pages deploy`
|
|
77642
77691
|
}
|
|
77643
77692
|
}),
|
|
77644
77693
|
compatibilityFlags: ["nodejs_compat"],
|
|
@@ -77646,14 +77695,14 @@ var config31 = {
|
|
|
77646
77695
|
deployScript: "deploy",
|
|
77647
77696
|
previewScript: "preview"
|
|
77648
77697
|
};
|
|
77649
|
-
var
|
|
77698
|
+
var c3_default43 = config33;
|
|
77650
77699
|
|
|
77651
77700
|
// templates/svelte/pages/c3.ts
|
|
77652
77701
|
var import_node_fs3 = require("node:fs");
|
|
77653
77702
|
var import_node_os3 = require("node:os");
|
|
77654
77703
|
var recast12 = __toESM(require_main3());
|
|
77655
|
-
var { npm:
|
|
77656
|
-
var
|
|
77704
|
+
var { npm: npm20 } = detectPackageManager();
|
|
77705
|
+
var generate25 = async (ctx) => {
|
|
77657
77706
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77658
77707
|
logRaw("");
|
|
77659
77708
|
};
|
|
@@ -77739,7 +77788,7 @@ var updateTypeDefinitions = (ctx) => {
|
|
|
77739
77788
|
}
|
|
77740
77789
|
});
|
|
77741
77790
|
};
|
|
77742
|
-
var
|
|
77791
|
+
var config34 = {
|
|
77743
77792
|
configVersion: 1,
|
|
77744
77793
|
id: "svelte",
|
|
77745
77794
|
frameworkCli: "sv",
|
|
@@ -77749,12 +77798,12 @@ var config32 = {
|
|
|
77749
77798
|
path: "./templates"
|
|
77750
77799
|
},
|
|
77751
77800
|
path: "templates/svelte/pages",
|
|
77752
|
-
generate:
|
|
77801
|
+
generate: generate25,
|
|
77753
77802
|
configure: configure17,
|
|
77754
77803
|
transformPackageJson: async (original, ctx) => {
|
|
77755
77804
|
let scripts = {
|
|
77756
|
-
preview: `${
|
|
77757
|
-
deploy: `${
|
|
77805
|
+
preview: `${npm20} run build && wrangler pages dev`,
|
|
77806
|
+
deploy: `${npm20} run build && wrangler pages deploy`
|
|
77758
77807
|
};
|
|
77759
77808
|
if (usesTypescript(ctx)) {
|
|
77760
77809
|
const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
|
|
@@ -77769,13 +77818,13 @@ var config32 = {
|
|
|
77769
77818
|
deployScript: "deploy",
|
|
77770
77819
|
previewScript: "preview"
|
|
77771
77820
|
};
|
|
77772
|
-
var
|
|
77821
|
+
var c3_default44 = config34;
|
|
77773
77822
|
|
|
77774
77823
|
// templates/svelte/workers/c3.ts
|
|
77775
77824
|
var import_node_os4 = require("node:os");
|
|
77776
77825
|
var recast13 = __toESM(require_main3());
|
|
77777
|
-
var { npm:
|
|
77778
|
-
var
|
|
77826
|
+
var { npm: npm21 } = detectPackageManager();
|
|
77827
|
+
var generate26 = async (ctx) => {
|
|
77779
77828
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
77780
77829
|
logRaw("");
|
|
77781
77830
|
};
|
|
@@ -77838,7 +77887,7 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
77838
77887
|
}
|
|
77839
77888
|
});
|
|
77840
77889
|
};
|
|
77841
|
-
var
|
|
77890
|
+
var config35 = {
|
|
77842
77891
|
configVersion: 1,
|
|
77843
77892
|
id: "svelte",
|
|
77844
77893
|
frameworkCli: "sv",
|
|
@@ -77848,12 +77897,12 @@ var config33 = {
|
|
|
77848
77897
|
path: "./templates"
|
|
77849
77898
|
},
|
|
77850
77899
|
path: "templates/svelte/workers",
|
|
77851
|
-
generate:
|
|
77900
|
+
generate: generate26,
|
|
77852
77901
|
configure: configure18,
|
|
77853
77902
|
transformPackageJson: async (original, ctx) => {
|
|
77854
77903
|
let scripts = {
|
|
77855
|
-
preview: `${
|
|
77856
|
-
deploy: `${
|
|
77904
|
+
preview: `${npm21} run build && wrangler dev`,
|
|
77905
|
+
deploy: `${npm21} run build && wrangler deploy`
|
|
77857
77906
|
};
|
|
77858
77907
|
if (usesTypescript(ctx)) {
|
|
77859
77908
|
const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
|
|
@@ -77868,43 +77917,43 @@ var config33 = {
|
|
|
77868
77917
|
deployScript: "deploy",
|
|
77869
77918
|
previewScript: "preview"
|
|
77870
77919
|
};
|
|
77871
|
-
var
|
|
77920
|
+
var c3_default45 = config35;
|
|
77872
77921
|
|
|
77873
77922
|
// templates/svelte/c3.ts
|
|
77874
|
-
var
|
|
77923
|
+
var config36 = {
|
|
77875
77924
|
displayName: "SvelteKit",
|
|
77876
|
-
platformVariants: { pages:
|
|
77925
|
+
platformVariants: { pages: c3_default44, workers: c3_default45 }
|
|
77877
77926
|
};
|
|
77878
|
-
var
|
|
77927
|
+
var c3_default46 = config36;
|
|
77879
77928
|
|
|
77880
77929
|
// templates/vue/pages/c3.ts
|
|
77881
|
-
var { npm:
|
|
77882
|
-
var
|
|
77930
|
+
var { npm: npm22 } = detectPackageManager();
|
|
77931
|
+
var generate27 = async (ctx) => {
|
|
77883
77932
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
77884
77933
|
};
|
|
77885
|
-
var
|
|
77934
|
+
var config37 = {
|
|
77886
77935
|
configVersion: 1,
|
|
77887
77936
|
id: "vue",
|
|
77888
77937
|
frameworkCli: "create-vue",
|
|
77889
77938
|
displayName: "Vue",
|
|
77890
77939
|
platform: "pages",
|
|
77891
77940
|
path: "templates/pages/vue",
|
|
77892
|
-
generate:
|
|
77941
|
+
generate: generate27,
|
|
77893
77942
|
transformPackageJson: async () => ({
|
|
77894
77943
|
scripts: {
|
|
77895
|
-
deploy: `${
|
|
77896
|
-
preview: `${
|
|
77944
|
+
deploy: `${npm22} run build && wrangler pages deploy ./dist`,
|
|
77945
|
+
preview: `${npm22} run build && wrangler pages dev ./dist`
|
|
77897
77946
|
}
|
|
77898
77947
|
}),
|
|
77899
77948
|
devScript: "dev",
|
|
77900
77949
|
deployScript: "deploy",
|
|
77901
77950
|
previewScript: "preview"
|
|
77902
77951
|
};
|
|
77903
|
-
var
|
|
77952
|
+
var c3_default47 = config37;
|
|
77904
77953
|
|
|
77905
77954
|
// templates/vue/workers/c3.ts
|
|
77906
|
-
var { npm:
|
|
77907
|
-
var
|
|
77955
|
+
var { npm: npm23 } = detectPackageManager();
|
|
77956
|
+
var generate28 = async (ctx) => {
|
|
77908
77957
|
const lang = ctx.args.lang ?? await inputPrompt({
|
|
77909
77958
|
type: "select",
|
|
77910
77959
|
question: "Would you like to use TypeScript?",
|
|
@@ -77942,7 +77991,7 @@ function updateTsconfigJson2() {
|
|
|
77942
77991
|
writeJSON("tsconfig.json", tsconfig);
|
|
77943
77992
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
77944
77993
|
}
|
|
77945
|
-
var
|
|
77994
|
+
var config38 = {
|
|
77946
77995
|
configVersion: 1,
|
|
77947
77996
|
id: "vue",
|
|
77948
77997
|
frameworkCli: "create-vue",
|
|
@@ -77963,11 +78012,11 @@ var config36 = {
|
|
|
77963
78012
|
}
|
|
77964
78013
|
},
|
|
77965
78014
|
configure: configure19,
|
|
77966
|
-
generate:
|
|
78015
|
+
generate: generate28,
|
|
77967
78016
|
transformPackageJson: async (_3, ctx) => ({
|
|
77968
78017
|
scripts: {
|
|
77969
|
-
deploy: `${
|
|
77970
|
-
preview: `${
|
|
78018
|
+
deploy: `${npm23} run build && wrangler deploy`,
|
|
78019
|
+
preview: `${npm23} run build && wrangler dev`,
|
|
77971
78020
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
77972
78021
|
}
|
|
77973
78022
|
}),
|
|
@@ -77975,20 +78024,20 @@ var config36 = {
|
|
|
77975
78024
|
deployScript: "deploy",
|
|
77976
78025
|
previewScript: "preview"
|
|
77977
78026
|
};
|
|
77978
|
-
var
|
|
78027
|
+
var c3_default48 = config38;
|
|
77979
78028
|
|
|
77980
78029
|
// templates/vue/c3.ts
|
|
77981
|
-
var
|
|
78030
|
+
var config39 = {
|
|
77982
78031
|
displayName: "Vue",
|
|
77983
|
-
platformVariants: { pages:
|
|
78032
|
+
platformVariants: { pages: c3_default47, workers: c3_default48 }
|
|
77984
78033
|
};
|
|
77985
|
-
var
|
|
78034
|
+
var c3_default49 = config39;
|
|
77986
78035
|
|
|
77987
78036
|
// src/git.ts
|
|
77988
78037
|
var import_node_assert = __toESM(require("node:assert"));
|
|
77989
78038
|
|
|
77990
78039
|
// ../wrangler/package.json
|
|
77991
|
-
var version2 = "4.
|
|
78040
|
+
var version2 = "4.4.1";
|
|
77992
78041
|
|
|
77993
78042
|
// src/git.ts
|
|
77994
78043
|
var offerGit = async (ctx) => {
|
|
@@ -78250,25 +78299,25 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
78250
78299
|
if (experimental) {
|
|
78251
78300
|
return {
|
|
78252
78301
|
next: c3_default,
|
|
78253
|
-
|
|
78254
|
-
solid: c3_default3
|
|
78302
|
+
solid: c3_default2
|
|
78255
78303
|
};
|
|
78256
78304
|
} else {
|
|
78257
78305
|
return {
|
|
78258
|
-
analog:
|
|
78259
|
-
angular:
|
|
78260
|
-
astro:
|
|
78261
|
-
docusaurus:
|
|
78262
|
-
gatsby:
|
|
78263
|
-
hono:
|
|
78264
|
-
next:
|
|
78265
|
-
nuxt:
|
|
78266
|
-
qwik:
|
|
78267
|
-
react:
|
|
78268
|
-
|
|
78269
|
-
|
|
78270
|
-
|
|
78271
|
-
|
|
78306
|
+
analog: c3_default3,
|
|
78307
|
+
angular: c3_default6,
|
|
78308
|
+
astro: c3_default9,
|
|
78309
|
+
docusaurus: c3_default13,
|
|
78310
|
+
gatsby: c3_default16,
|
|
78311
|
+
hono: c3_default24,
|
|
78312
|
+
next: c3_default25,
|
|
78313
|
+
nuxt: c3_default28,
|
|
78314
|
+
qwik: c3_default34,
|
|
78315
|
+
react: c3_default38,
|
|
78316
|
+
"react-router": c3_default35,
|
|
78317
|
+
remix: c3_default41,
|
|
78318
|
+
solid: c3_default43,
|
|
78319
|
+
svelte: c3_default46,
|
|
78320
|
+
vue: c3_default49
|
|
78272
78321
|
};
|
|
78273
78322
|
}
|
|
78274
78323
|
}
|
|
@@ -78277,16 +78326,16 @@ function getTemplateMap({ experimental = false }) {
|
|
|
78277
78326
|
return {};
|
|
78278
78327
|
} else {
|
|
78279
78328
|
return {
|
|
78280
|
-
"hello-world":
|
|
78281
|
-
"hello-world-assets-only":
|
|
78282
|
-
"hello-world-with-assets":
|
|
78283
|
-
"hello-world-durable-object":
|
|
78284
|
-
"hello-world-durable-object-with-assets":
|
|
78285
|
-
common:
|
|
78286
|
-
scheduled:
|
|
78287
|
-
queues:
|
|
78288
|
-
openapi:
|
|
78289
|
-
"pre-existing":
|
|
78329
|
+
"hello-world": c3_default21,
|
|
78330
|
+
"hello-world-assets-only": c3_default17,
|
|
78331
|
+
"hello-world-with-assets": c3_default20,
|
|
78332
|
+
"hello-world-durable-object": c3_default19,
|
|
78333
|
+
"hello-world-durable-object-with-assets": c3_default18,
|
|
78334
|
+
common: c3_default10,
|
|
78335
|
+
scheduled: c3_default42,
|
|
78336
|
+
queues: c3_default31,
|
|
78337
|
+
openapi: c3_default29,
|
|
78338
|
+
"pre-existing": c3_default30
|
|
78290
78339
|
};
|
|
78291
78340
|
}
|
|
78292
78341
|
}
|
|
@@ -78433,11 +78482,17 @@ var createContext = async (args, prevArgs) => {
|
|
|
78433
78482
|
const frameworkMap = getFrameworkMap({
|
|
78434
78483
|
experimental: args.experimental
|
|
78435
78484
|
});
|
|
78436
|
-
const frameworkOptions = Object.entries(frameworkMap).
|
|
78437
|
-
([key,
|
|
78438
|
-
|
|
78439
|
-
|
|
78440
|
-
|
|
78485
|
+
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
78486
|
+
(acc, [key, config40]) => {
|
|
78487
|
+
if (!config40.hidden || args.framework) {
|
|
78488
|
+
acc.push({
|
|
78489
|
+
label: config40.displayName,
|
|
78490
|
+
value: key
|
|
78491
|
+
});
|
|
78492
|
+
}
|
|
78493
|
+
return acc;
|
|
78494
|
+
},
|
|
78495
|
+
[]
|
|
78441
78496
|
);
|
|
78442
78497
|
const framework = await processArgument(args, "framework", {
|
|
78443
78498
|
type: "select",
|
|
@@ -78602,28 +78657,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
78602
78657
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
78603
78658
|
}
|
|
78604
78659
|
const path6 = await downloadRemoteTemplate(src);
|
|
78605
|
-
const
|
|
78606
|
-
validateTemplate(path6,
|
|
78660
|
+
const config40 = inferTemplateConfig(path6);
|
|
78661
|
+
validateTemplate(path6, config40);
|
|
78607
78662
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
78608
78663
|
return {
|
|
78609
78664
|
path: path6,
|
|
78610
|
-
...
|
|
78665
|
+
...config40
|
|
78611
78666
|
};
|
|
78612
78667
|
};
|
|
78613
|
-
var validateTemplate = (path6,
|
|
78614
|
-
if (!
|
|
78668
|
+
var validateTemplate = (path6, config40) => {
|
|
78669
|
+
if (!config40.copyFiles) {
|
|
78615
78670
|
return;
|
|
78616
78671
|
}
|
|
78617
|
-
if (isVariantInfo(
|
|
78618
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6,
|
|
78672
|
+
if (isVariantInfo(config40.copyFiles)) {
|
|
78673
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config40.copyFiles.path), config40);
|
|
78619
78674
|
} else {
|
|
78620
|
-
for (const variant of Object.values(
|
|
78621
|
-
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path),
|
|
78675
|
+
for (const variant of Object.values(config40.copyFiles.variants)) {
|
|
78676
|
+
validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config40);
|
|
78622
78677
|
}
|
|
78623
78678
|
}
|
|
78624
78679
|
};
|
|
78625
|
-
var validateTemplateSrcDirectory = (path6,
|
|
78626
|
-
if (
|
|
78680
|
+
var validateTemplateSrcDirectory = (path6, config40) => {
|
|
78681
|
+
if (config40.platform === "workers") {
|
|
78627
78682
|
const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
|
|
78628
78683
|
const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
|
|
78629
78684
|
const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -80534,20 +80589,20 @@ function applyEdits(text, edits) {
|
|
|
80534
80589
|
var import_fs12 = require("fs");
|
|
80535
80590
|
var import_path14 = require("path");
|
|
80536
80591
|
var import_toml2 = __toESM(require_toml());
|
|
80537
|
-
function ensureNameExists(
|
|
80538
|
-
|
|
80539
|
-
return
|
|
80592
|
+
function ensureNameExists(config40, projectName) {
|
|
80593
|
+
config40["name"] = projectName;
|
|
80594
|
+
return config40;
|
|
80540
80595
|
}
|
|
80541
|
-
async function ensureCompatDateExists(
|
|
80542
|
-
if (typeof
|
|
80596
|
+
async function ensureCompatDateExists(config40) {
|
|
80597
|
+
if (typeof config40["compatibility_date"] === "string") {
|
|
80543
80598
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
|
|
80544
|
-
if (!
|
|
80545
|
-
|
|
80599
|
+
if (!config40["compatibility_date"].match(validCompatDateRe)) {
|
|
80600
|
+
config40["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80546
80601
|
}
|
|
80547
80602
|
} else {
|
|
80548
|
-
|
|
80603
|
+
config40["compatibility_date"] = await getWorkerdCompatibilityDate();
|
|
80549
80604
|
}
|
|
80550
|
-
return
|
|
80605
|
+
return config40;
|
|
80551
80606
|
}
|
|
80552
80607
|
var updateWranglerConfig = async (ctx) => {
|
|
80553
80608
|
if (wranglerJsonExists(ctx)) {
|
|
@@ -80558,12 +80613,15 @@ var updateWranglerConfig = async (ctx) => {
|
|
|
80558
80613
|
const modified = await ensureCompatDateExists(
|
|
80559
80614
|
ensureNameExists(parsed, ctx.project.name)
|
|
80560
80615
|
);
|
|
80561
|
-
|
|
80616
|
+
let comment = `/**
|
|
80562
80617
|
* For more details on how to configure Wrangler, refer to:
|
|
80563
80618
|
* https://developers.cloudflare.com/workers/wrangler/configuration/
|
|
80564
80619
|
*/
|
|
80565
|
-
{
|
|
80620
|
+
{`;
|
|
80621
|
+
if (!modified["$schema"]) {
|
|
80622
|
+
comment += `
|
|
80566
80623
|
"$schema": "node_modules/wrangler/config-schema.json",`;
|
|
80624
|
+
}
|
|
80567
80625
|
if (!modified["observability"]) {
|
|
80568
80626
|
modified["observability"] = { enabled: true };
|
|
80569
80627
|
}
|
|
@@ -80718,7 +80776,7 @@ var addVscodeConfig = (ctx) => {
|
|
|
80718
80776
|
|
|
80719
80777
|
// src/deploy.ts
|
|
80720
80778
|
var offerToDeploy = async (ctx) => {
|
|
80721
|
-
const { npm:
|
|
80779
|
+
const { npm: npm25 } = detectPackageManager();
|
|
80722
80780
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
80723
80781
|
if (!await isDeployable(ctx)) {
|
|
80724
80782
|
ctx.args.deploy = false;
|
|
@@ -80729,7 +80787,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
80729
80787
|
);
|
|
80730
80788
|
}
|
|
80731
80789
|
const label = `deploy via \`${quoteShellArgs([
|
|
80732
|
-
|
|
80790
|
+
npm25,
|
|
80733
80791
|
"run",
|
|
80734
80792
|
ctx.template.deployScript ?? "deploy"
|
|
80735
80793
|
])}\``;
|
|
@@ -80766,11 +80824,11 @@ var readWranglerConfig = (ctx) => {
|
|
|
80766
80824
|
return import_toml3.default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
|
|
80767
80825
|
};
|
|
80768
80826
|
var runDeploy = async (ctx) => {
|
|
80769
|
-
const { npm:
|
|
80827
|
+
const { npm: npm25, name: pm4 } = detectPackageManager();
|
|
80770
80828
|
if (!ctx.account?.id) {
|
|
80771
80829
|
throw new Error("Failed to read Cloudflare account.");
|
|
80772
80830
|
}
|
|
80773
|
-
const baseDeployCmd = [
|
|
80831
|
+
const baseDeployCmd = [npm25, "run", ctx.template.deployScript ?? "deploy"];
|
|
80774
80832
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
80775
80833
|
const deployCmd = [
|
|
80776
80834
|
...baseDeployCmd,
|
|
@@ -80886,14 +80944,14 @@ var printSummary = (ctx) => {
|
|
|
80886
80944
|
const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
|
|
80887
80945
|
const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
|
|
80888
80946
|
const cdCommand = relativePath ? `cd ${relativePath}` : null;
|
|
80889
|
-
const { npm:
|
|
80947
|
+
const { npm: npm25 } = detectPackageManager();
|
|
80890
80948
|
const devServerCommand = quoteShellArgs([
|
|
80891
|
-
|
|
80949
|
+
npm25,
|
|
80892
80950
|
"run",
|
|
80893
80951
|
ctx.template.devScript ?? "start"
|
|
80894
80952
|
]);
|
|
80895
80953
|
const deployCommand = quoteShellArgs([
|
|
80896
|
-
|
|
80954
|
+
npm25,
|
|
80897
80955
|
"run",
|
|
80898
80956
|
ctx.template.deployScript ?? "deploy"
|
|
80899
80957
|
]);
|
|
@@ -81261,8 +81319,8 @@ var renderValues = (values) => {
|
|
|
81261
81319
|
};
|
|
81262
81320
|
|
|
81263
81321
|
// src/helpers/retry.ts
|
|
81264
|
-
var retry = async (
|
|
81265
|
-
let { times } =
|
|
81322
|
+
var retry = async (config40, fn) => {
|
|
81323
|
+
let { times } = config40;
|
|
81266
81324
|
let error2 = null;
|
|
81267
81325
|
while (times > 0) {
|
|
81268
81326
|
try {
|
|
@@ -81270,10 +81328,10 @@ var retry = async (config38, fn) => {
|
|
|
81270
81328
|
} catch (e) {
|
|
81271
81329
|
error2 = e;
|
|
81272
81330
|
times--;
|
|
81273
|
-
if (
|
|
81331
|
+
if (config40.exitCondition?.(e)) {
|
|
81274
81332
|
break;
|
|
81275
81333
|
}
|
|
81276
|
-
await sleep(
|
|
81334
|
+
await sleep(config40.sleepMs ?? 1e3);
|
|
81277
81335
|
}
|
|
81278
81336
|
}
|
|
81279
81337
|
throw error2;
|
|
@@ -81363,14 +81421,14 @@ var createProject = async (ctx) => {
|
|
|
81363
81421
|
var import_fs13 = require("fs");
|
|
81364
81422
|
var import_path16 = require("path");
|
|
81365
81423
|
async function installWorkersTypes(ctx) {
|
|
81366
|
-
const { npm:
|
|
81424
|
+
const { npm: npm25 } = detectPackageManager();
|
|
81367
81425
|
if (!usesTypescript(ctx)) {
|
|
81368
81426
|
return;
|
|
81369
81427
|
}
|
|
81370
81428
|
await installPackages(["@cloudflare/workers-types"], {
|
|
81371
81429
|
dev: true,
|
|
81372
81430
|
startText: "Installing @cloudflare/workers-types",
|
|
81373
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
81431
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm25}`)}`
|
|
81374
81432
|
});
|
|
81375
81433
|
await addWorkersTypesToTsConfig(ctx);
|
|
81376
81434
|
}
|
|
@@ -81393,8 +81451,8 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81393
81451
|
}
|
|
81394
81452
|
const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
|
|
81395
81453
|
try {
|
|
81396
|
-
const
|
|
81397
|
-
const currentTypes =
|
|
81454
|
+
const config40 = parse4(tsconfig);
|
|
81455
|
+
const currentTypes = config40.compilerOptions?.types ?? [];
|
|
81398
81456
|
const explicitEntrypoint = currentTypes.some(
|
|
81399
81457
|
(t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
|
|
81400
81458
|
);
|
|
@@ -81424,7 +81482,7 @@ async function addWorkersTypesToTsConfig(ctx) {
|
|
|
81424
81482
|
}
|
|
81425
81483
|
|
|
81426
81484
|
// src/cli.ts
|
|
81427
|
-
var { npm:
|
|
81485
|
+
var { npm: npm24 } = detectPackageManager();
|
|
81428
81486
|
var main = async (argv) => {
|
|
81429
81487
|
const result = await parseArgs(argv);
|
|
81430
81488
|
if (result.type === "unknown") {
|
|
@@ -81460,10 +81518,10 @@ ${result.errorMessage}`);
|
|
|
81460
81518
|
};
|
|
81461
81519
|
var runLatest = async () => {
|
|
81462
81520
|
const args = process.argv.slice(2);
|
|
81463
|
-
if (
|
|
81521
|
+
if (npm24 === "npm") {
|
|
81464
81522
|
args.unshift("--");
|
|
81465
81523
|
}
|
|
81466
|
-
await runCommand([
|
|
81524
|
+
await runCommand([npm24, "create", "cloudflare@latest", ...args]);
|
|
81467
81525
|
};
|
|
81468
81526
|
var runCli = async (args) => {
|
|
81469
81527
|
printBanner(args);
|