create-cloudflare 2.55.0 → 2.56.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 +298 -269
- package/package.json +5 -5
- package/templates/redwood/c3.ts +33 -0
- package/templates/tanstack-start/c3.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -568,7 +568,7 @@ var require_XDGAppPaths = __commonJS({
|
|
|
568
568
|
XDGAppPaths.cache = function cache(dirOptions) {
|
|
569
569
|
return path6.join(xdg.cache(), finalPathSegment(dirOptions));
|
|
570
570
|
};
|
|
571
|
-
XDGAppPaths.config = function
|
|
571
|
+
XDGAppPaths.config = function config46(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 config46 = 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: config46, 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 config46 = 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: config46, 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 config46 = 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: config46, data, runtime, state };
|
|
683
683
|
};
|
|
684
684
|
var XDG_ = /* @__PURE__ */ function() {
|
|
685
685
|
function XDG_2() {
|
|
@@ -36179,21 +36179,21 @@ var require_dist_web = __commonJS({
|
|
|
36179
36179
|
_createClass(Haikunator3, [{
|
|
36180
36180
|
key: "haikunate",
|
|
36181
36181
|
value: function haikunate(options) {
|
|
36182
|
-
var
|
|
36183
|
-
if (
|
|
36184
|
-
|
|
36182
|
+
var config46 = (0, _lodash["default"])(options, this.config);
|
|
36183
|
+
if (config46.tokenHex === true) {
|
|
36184
|
+
config46.tokenChars = "0123456789abcdef";
|
|
36185
36185
|
}
|
|
36186
36186
|
var adjective = this._randomElement(this.adjectives);
|
|
36187
36187
|
var noun = this._randomElement(this.nouns);
|
|
36188
|
-
if (!
|
|
36188
|
+
if (!config46.tokenLength) config46.tokenLength = 0;
|
|
36189
36189
|
var token = "";
|
|
36190
|
-
for (var i = 0; i <
|
|
36191
|
-
token += this._randomElement(
|
|
36190
|
+
for (var i = 0; i < config46.tokenLength; i++) {
|
|
36191
|
+
token += this._randomElement(config46.tokenChars);
|
|
36192
36192
|
}
|
|
36193
36193
|
var sections = [adjective, noun, token];
|
|
36194
36194
|
return sections.filter(function(e) {
|
|
36195
36195
|
return !!e;
|
|
36196
|
-
}).join(
|
|
36196
|
+
}).join(config46.delimiter);
|
|
36197
36197
|
}
|
|
36198
36198
|
/**
|
|
36199
36199
|
* Get a random element from an array/string
|
|
@@ -42368,13 +42368,13 @@ var require_esprima = __commonJS({
|
|
|
42368
42368
|
return Reader2;
|
|
42369
42369
|
}();
|
|
42370
42370
|
var Tokenizer = function() {
|
|
42371
|
-
function Tokenizer2(code,
|
|
42371
|
+
function Tokenizer2(code, config46) {
|
|
42372
42372
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
42373
|
-
this.errorHandler.tolerant =
|
|
42373
|
+
this.errorHandler.tolerant = config46 ? typeof config46.tolerant === "boolean" && config46.tolerant : false;
|
|
42374
42374
|
this.scanner = new scanner_1.Scanner(code, this.errorHandler);
|
|
42375
|
-
this.scanner.trackComment =
|
|
42376
|
-
this.trackRange =
|
|
42377
|
-
this.trackLoc =
|
|
42375
|
+
this.scanner.trackComment = config46 ? typeof config46.comment === "boolean" && config46.comment : false;
|
|
42376
|
+
this.trackRange = config46 ? typeof config46.range === "boolean" && config46.range : false;
|
|
42377
|
+
this.trackLoc = config46 ? typeof config46.loc === "boolean" && config46.loc : false;
|
|
42378
42378
|
this.buffer = [];
|
|
42379
42379
|
this.reader = new Reader();
|
|
42380
42380
|
}
|
|
@@ -52460,11 +52460,11 @@ var require_printer = __commonJS({
|
|
|
52460
52460
|
return this.code;
|
|
52461
52461
|
};
|
|
52462
52462
|
var emptyPrintResult = new PrintResult("");
|
|
52463
|
-
var Printer = function Printer2(
|
|
52463
|
+
var Printer = function Printer2(config46) {
|
|
52464
52464
|
assert_1.default.ok(this instanceof Printer2);
|
|
52465
|
-
var explicitTabWidth =
|
|
52466
|
-
|
|
52467
|
-
|
|
52465
|
+
var explicitTabWidth = config46 && config46.tabWidth;
|
|
52466
|
+
config46 = options_1.normalize(config46);
|
|
52467
|
+
config46.sourceFileName = null;
|
|
52468
52468
|
function makePrintFunctionWith(options, overrides) {
|
|
52469
52469
|
options = Object.assign({}, options, overrides);
|
|
52470
52470
|
return function(path6) {
|
|
@@ -52479,11 +52479,11 @@ var require_printer = __commonJS({
|
|
|
52479
52479
|
includeComments: false
|
|
52480
52480
|
}));
|
|
52481
52481
|
}
|
|
52482
|
-
var oldTabWidth =
|
|
52482
|
+
var oldTabWidth = config46.tabWidth;
|
|
52483
52483
|
if (!explicitTabWidth) {
|
|
52484
52484
|
var loc = path6.getNode().loc;
|
|
52485
52485
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
52486
|
-
|
|
52486
|
+
config46.tabWidth = loc.lines.guessTabWidth();
|
|
52487
52487
|
}
|
|
52488
52488
|
}
|
|
52489
52489
|
var reprinter = patcher_1.getReprinter(path6);
|
|
@@ -52497,11 +52497,11 @@ var require_printer = __commonJS({
|
|
|
52497
52497
|
// right choice because it gives us the opportunity to reprint
|
|
52498
52498
|
// such nodes using their original source.
|
|
52499
52499
|
reprinter(print2)
|
|
52500
|
-
) : genericPrint(path6,
|
|
52500
|
+
) : genericPrint(path6, config46, options, makePrintFunctionWith(options, {
|
|
52501
52501
|
includeComments: true,
|
|
52502
52502
|
avoidRootParens: false
|
|
52503
52503
|
}));
|
|
52504
|
-
|
|
52504
|
+
config46.tabWidth = oldTabWidth;
|
|
52505
52505
|
return lines;
|
|
52506
52506
|
}
|
|
52507
52507
|
this.print = function(ast) {
|
|
@@ -52512,7 +52512,7 @@ var require_printer = __commonJS({
|
|
|
52512
52512
|
includeComments: true,
|
|
52513
52513
|
avoidRootParens: false
|
|
52514
52514
|
});
|
|
52515
|
-
return new PrintResult(lines.toString(
|
|
52515
|
+
return new PrintResult(lines.toString(config46), util.composeSourceMaps(config46.inputSourceMap, lines.getSourceMap(config46.sourceMapName, config46.sourceRoot)));
|
|
52516
52516
|
};
|
|
52517
52517
|
this.printGenerically = function(ast) {
|
|
52518
52518
|
if (!ast) {
|
|
@@ -52520,26 +52520,26 @@ var require_printer = __commonJS({
|
|
|
52520
52520
|
}
|
|
52521
52521
|
function printGenerically(path7) {
|
|
52522
52522
|
return comments_1.printComments(path7, function(path8) {
|
|
52523
|
-
return genericPrint(path8,
|
|
52523
|
+
return genericPrint(path8, config46, {
|
|
52524
52524
|
includeComments: true,
|
|
52525
52525
|
avoidRootParens: false
|
|
52526
52526
|
}, printGenerically);
|
|
52527
52527
|
});
|
|
52528
52528
|
}
|
|
52529
52529
|
var path6 = fast_path_1.default.from(ast);
|
|
52530
|
-
var oldReuseWhitespace =
|
|
52531
|
-
|
|
52532
|
-
var pr = new PrintResult(printGenerically(path6).toString(
|
|
52533
|
-
|
|
52530
|
+
var oldReuseWhitespace = config46.reuseWhitespace;
|
|
52531
|
+
config46.reuseWhitespace = false;
|
|
52532
|
+
var pr = new PrintResult(printGenerically(path6).toString(config46));
|
|
52533
|
+
config46.reuseWhitespace = oldReuseWhitespace;
|
|
52534
52534
|
return pr;
|
|
52535
52535
|
};
|
|
52536
52536
|
};
|
|
52537
52537
|
exports2.Printer = Printer;
|
|
52538
|
-
function genericPrint(path6,
|
|
52538
|
+
function genericPrint(path6, config46, options, printPath) {
|
|
52539
52539
|
assert_1.default.ok(path6 instanceof fast_path_1.default);
|
|
52540
52540
|
var node = path6.getValue();
|
|
52541
52541
|
var parts = [];
|
|
52542
|
-
var linesWithoutParens = genericPrintNoParens(path6,
|
|
52542
|
+
var linesWithoutParens = genericPrintNoParens(path6, config46, printPath);
|
|
52543
52543
|
if (!node || linesWithoutParens.isEmpty()) {
|
|
52544
52544
|
return linesWithoutParens;
|
|
52545
52545
|
}
|
|
@@ -72119,33 +72119,33 @@ var inputPrompt = async (promptConfig) => {
|
|
|
72119
72119
|
}
|
|
72120
72120
|
return input;
|
|
72121
72121
|
};
|
|
72122
|
-
var renderSubmit = (
|
|
72123
|
-
const { question, label } =
|
|
72124
|
-
if (
|
|
72122
|
+
var renderSubmit = (config46, value) => {
|
|
72123
|
+
const { question, label } = config46;
|
|
72124
|
+
if (config46.type !== "confirm" && !value) {
|
|
72125
72125
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
72126
72126
|
}
|
|
72127
|
-
const content =
|
|
72127
|
+
const content = config46.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
|
|
72128
72128
|
return [`${leftT} ${question}`, content, `${grayBar}`];
|
|
72129
72129
|
};
|
|
72130
|
-
var getRenderers = (
|
|
72131
|
-
switch (
|
|
72130
|
+
var getRenderers = (config46) => {
|
|
72131
|
+
switch (config46.type) {
|
|
72132
72132
|
case "select":
|
|
72133
|
-
return getSelectRenderers(
|
|
72133
|
+
return getSelectRenderers(config46);
|
|
72134
72134
|
case "confirm":
|
|
72135
|
-
return getConfirmRenderers(
|
|
72135
|
+
return getConfirmRenderers(config46);
|
|
72136
72136
|
case "text":
|
|
72137
|
-
return getTextRenderers(
|
|
72137
|
+
return getTextRenderers(config46);
|
|
72138
72138
|
case "multiselect":
|
|
72139
|
-
return getSelectRenderers(
|
|
72139
|
+
return getSelectRenderers(config46);
|
|
72140
72140
|
case "list":
|
|
72141
|
-
return getSelectListRenderers(
|
|
72141
|
+
return getSelectListRenderers(config46);
|
|
72142
72142
|
}
|
|
72143
72143
|
};
|
|
72144
|
-
var getTextRenderers = (
|
|
72145
|
-
const { question } =
|
|
72146
|
-
const helpText =
|
|
72147
|
-
const format5 =
|
|
72148
|
-
const defaultValue =
|
|
72144
|
+
var getTextRenderers = (config46) => {
|
|
72145
|
+
const { question } = config46;
|
|
72146
|
+
const helpText = config46.helpText ?? "";
|
|
72147
|
+
const format5 = config46.format ?? ((val) => String(val));
|
|
72148
|
+
const defaultValue = config46.defaultValue?.toString() ?? "";
|
|
72149
72149
|
const activeRenderer = (props) => {
|
|
72150
72150
|
const { valueWithCursor } = props;
|
|
72151
72151
|
return [
|
|
@@ -72171,14 +72171,14 @@ var getTextRenderers = (config45) => {
|
|
|
72171
72171
|
``
|
|
72172
72172
|
// extra line for readability
|
|
72173
72173
|
],
|
|
72174
|
-
submit: ({ value }) => renderSubmit(
|
|
72174
|
+
submit: ({ value }) => renderSubmit(config46, format5(value ?? "")),
|
|
72175
72175
|
cancel: activeRenderer
|
|
72176
72176
|
};
|
|
72177
72177
|
};
|
|
72178
|
-
var getSelectRenderers = (
|
|
72179
|
-
const { options, question, helpText: _helpText } =
|
|
72178
|
+
var getSelectRenderers = (config46) => {
|
|
72179
|
+
const { options, question, helpText: _helpText } = config46;
|
|
72180
72180
|
const helpText = _helpText ?? "";
|
|
72181
|
-
const maxItemsPerPage =
|
|
72181
|
+
const maxItemsPerPage = config46.maxItemsPerPage ?? 32;
|
|
72182
72182
|
const defaultRenderer = ({ cursor = 0, value }) => {
|
|
72183
72183
|
const renderOption = (opt, i) => {
|
|
72184
72184
|
const { label: optionLabel, value: optionValue } = opt;
|
|
@@ -72253,21 +72253,21 @@ ${space(2)}${dim("...")}` : ""}`,
|
|
|
72253
72253
|
submit: ({ value }) => {
|
|
72254
72254
|
if (Array.isArray(value)) {
|
|
72255
72255
|
return renderSubmit(
|
|
72256
|
-
|
|
72256
|
+
config46,
|
|
72257
72257
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
72258
72258
|
);
|
|
72259
72259
|
}
|
|
72260
72260
|
return renderSubmit(
|
|
72261
|
-
|
|
72261
|
+
config46,
|
|
72262
72262
|
options.find((o) => o.value === value)?.label
|
|
72263
72263
|
);
|
|
72264
72264
|
},
|
|
72265
72265
|
cancel: defaultRenderer
|
|
72266
72266
|
};
|
|
72267
72267
|
};
|
|
72268
|
-
var getSelectListRenderers = (
|
|
72269
|
-
const { question, helpText: _helpText } =
|
|
72270
|
-
let options =
|
|
72268
|
+
var getSelectListRenderers = (config46) => {
|
|
72269
|
+
const { question, helpText: _helpText } = config46;
|
|
72270
|
+
let options = config46.options;
|
|
72271
72271
|
const helpText = _helpText ?? "";
|
|
72272
72272
|
const { rows } = stdout;
|
|
72273
72273
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -72348,20 +72348,20 @@ var getSelectListRenderers = (config45) => {
|
|
|
72348
72348
|
submit: ({ value }) => {
|
|
72349
72349
|
if (Array.isArray(value)) {
|
|
72350
72350
|
return renderSubmit(
|
|
72351
|
-
|
|
72351
|
+
config46,
|
|
72352
72352
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
72353
72353
|
);
|
|
72354
72354
|
}
|
|
72355
72355
|
return renderSubmit(
|
|
72356
|
-
|
|
72356
|
+
config46,
|
|
72357
72357
|
options.find((o) => o.value === value)?.value
|
|
72358
72358
|
);
|
|
72359
72359
|
},
|
|
72360
72360
|
cancel: defaultRenderer
|
|
72361
72361
|
};
|
|
72362
72362
|
};
|
|
72363
|
-
var getConfirmRenderers = (
|
|
72364
|
-
const { activeText, inactiveText, question, helpText: _helpText } =
|
|
72363
|
+
var getConfirmRenderers = (config46) => {
|
|
72364
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config46;
|
|
72365
72365
|
const helpText = _helpText ?? "";
|
|
72366
72366
|
const active = activeText || "Yes";
|
|
72367
72367
|
const inactive = inactiveText || "No";
|
|
@@ -72378,7 +72378,7 @@ var getConfirmRenderers = (config45) => {
|
|
|
72378
72378
|
active: defaultRenderer,
|
|
72379
72379
|
confirm: defaultRenderer,
|
|
72380
72380
|
error: defaultRenderer,
|
|
72381
|
-
submit: ({ value }) => renderSubmit(
|
|
72381
|
+
submit: ({ value }) => renderSubmit(config46, value ? "yes" : "no"),
|
|
72382
72382
|
cancel: defaultRenderer
|
|
72383
72383
|
};
|
|
72384
72384
|
};
|
|
@@ -73346,23 +73346,23 @@ var YargsParser = class {
|
|
|
73346
73346
|
const configPath = argv2[configKey] || configLookup[configKey];
|
|
73347
73347
|
if (configPath) {
|
|
73348
73348
|
try {
|
|
73349
|
-
let
|
|
73349
|
+
let config46 = null;
|
|
73350
73350
|
const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
|
|
73351
73351
|
const resolveConfig = flags.configs[configKey];
|
|
73352
73352
|
if (typeof resolveConfig === "function") {
|
|
73353
73353
|
try {
|
|
73354
|
-
|
|
73354
|
+
config46 = resolveConfig(resolvedConfigPath);
|
|
73355
73355
|
} catch (e) {
|
|
73356
|
-
|
|
73356
|
+
config46 = e;
|
|
73357
73357
|
}
|
|
73358
|
-
if (
|
|
73359
|
-
error2 =
|
|
73358
|
+
if (config46 instanceof Error) {
|
|
73359
|
+
error2 = config46;
|
|
73360
73360
|
return;
|
|
73361
73361
|
}
|
|
73362
73362
|
} else {
|
|
73363
|
-
|
|
73363
|
+
config46 = mixin2.require(resolvedConfigPath);
|
|
73364
73364
|
}
|
|
73365
|
-
setConfigObject(
|
|
73365
|
+
setConfigObject(config46);
|
|
73366
73366
|
} catch (ex) {
|
|
73367
73367
|
if (ex.name === "PermissionDenied")
|
|
73368
73368
|
error2 = ex;
|
|
@@ -73372,9 +73372,9 @@ var YargsParser = class {
|
|
|
73372
73372
|
}
|
|
73373
73373
|
});
|
|
73374
73374
|
}
|
|
73375
|
-
function setConfigObject(
|
|
73376
|
-
Object.keys(
|
|
73377
|
-
const value =
|
|
73375
|
+
function setConfigObject(config46, prev) {
|
|
73376
|
+
Object.keys(config46).forEach(function(key) {
|
|
73377
|
+
const value = config46[key];
|
|
73378
73378
|
const fullKey = prev ? prev + "." + key : key;
|
|
73379
73379
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
|
|
73380
73380
|
setConfigObject(value, fullKey);
|
|
@@ -74526,11 +74526,11 @@ var CommandInstance = class {
|
|
|
74526
74526
|
});
|
|
74527
74527
|
if (!unparsed.length)
|
|
74528
74528
|
return;
|
|
74529
|
-
const
|
|
74529
|
+
const config46 = Object.assign({}, options.configuration, {
|
|
74530
74530
|
"populate--": false
|
|
74531
74531
|
});
|
|
74532
74532
|
const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
|
|
74533
|
-
configuration:
|
|
74533
|
+
configuration: config46
|
|
74534
74534
|
}));
|
|
74535
74535
|
if (parsed.error) {
|
|
74536
74536
|
yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
|
|
@@ -75753,31 +75753,31 @@ ${customMsgs.join("\n")}` : "";
|
|
|
75753
75753
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
|
|
75754
75754
|
var previouslyVisitedConfigs = [];
|
|
75755
75755
|
var shim2;
|
|
75756
|
-
function applyExtends(
|
|
75756
|
+
function applyExtends(config46, cwd, mergeExtends, _shim) {
|
|
75757
75757
|
shim2 = _shim;
|
|
75758
75758
|
let defaultConfig = {};
|
|
75759
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
75760
|
-
if (typeof
|
|
75759
|
+
if (Object.prototype.hasOwnProperty.call(config46, "extends")) {
|
|
75760
|
+
if (typeof config46.extends !== "string")
|
|
75761
75761
|
return defaultConfig;
|
|
75762
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
75762
|
+
const isPath = /\.json|\..*rc$/.test(config46.extends);
|
|
75763
75763
|
let pathToDefault = null;
|
|
75764
75764
|
if (!isPath) {
|
|
75765
75765
|
try {
|
|
75766
|
-
pathToDefault = require.resolve(
|
|
75766
|
+
pathToDefault = require.resolve(config46.extends);
|
|
75767
75767
|
} catch (_err) {
|
|
75768
|
-
return
|
|
75768
|
+
return config46;
|
|
75769
75769
|
}
|
|
75770
75770
|
} else {
|
|
75771
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
75771
|
+
pathToDefault = getPathToDefaultConfig(cwd, config46.extends);
|
|
75772
75772
|
}
|
|
75773
75773
|
checkForCircularExtends(pathToDefault);
|
|
75774
75774
|
previouslyVisitedConfigs.push(pathToDefault);
|
|
75775
|
-
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(
|
|
75776
|
-
delete
|
|
75775
|
+
defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config46.extends);
|
|
75776
|
+
delete config46.extends;
|
|
75777
75777
|
defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
|
|
75778
75778
|
}
|
|
75779
75779
|
previouslyVisitedConfigs = [];
|
|
75780
|
-
return mergeExtends ? mergeDeep(defaultConfig,
|
|
75780
|
+
return mergeExtends ? mergeDeep(defaultConfig, config46) : Object.assign({}, defaultConfig, config46);
|
|
75781
75781
|
}
|
|
75782
75782
|
function checkForCircularExtends(cfgPath) {
|
|
75783
75783
|
if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
|
|
@@ -76553,9 +76553,9 @@ var YargsInstance = class {
|
|
|
76553
76553
|
}
|
|
76554
76554
|
return maybePromise;
|
|
76555
76555
|
}
|
|
76556
|
-
parserConfiguration(
|
|
76557
|
-
argsert("<object>", [
|
|
76558
|
-
__classPrivateFieldSet(this, _YargsInstance_parserConfig,
|
|
76556
|
+
parserConfiguration(config46) {
|
|
76557
|
+
argsert("<object>", [config46], arguments.length);
|
|
76558
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config46, "f");
|
|
76559
76559
|
return this;
|
|
76560
76560
|
}
|
|
76561
76561
|
pkgConf(key, rootPath) {
|
|
@@ -76727,9 +76727,9 @@ var YargsInstance = class {
|
|
|
76727
76727
|
return this;
|
|
76728
76728
|
}
|
|
76729
76729
|
}
|
|
76730
|
-
usageConfiguration(
|
|
76731
|
-
argsert("<object>", [
|
|
76732
|
-
__classPrivateFieldSet(this, _YargsInstance_usageConfig,
|
|
76730
|
+
usageConfiguration(config46) {
|
|
76731
|
+
argsert("<object>", [config46], arguments.length);
|
|
76732
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config46, "f");
|
|
76733
76733
|
return this;
|
|
76734
76734
|
}
|
|
76735
76735
|
version(opt, msg, ver) {
|
|
@@ -77135,11 +77135,11 @@ var YargsInstance = class {
|
|
|
77135
77135
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
|
|
77136
77136
|
__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
|
|
77137
77137
|
const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
|
|
77138
|
-
const
|
|
77138
|
+
const config46 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
|
|
77139
77139
|
"populate--": true
|
|
77140
77140
|
});
|
|
77141
77141
|
const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
|
|
77142
|
-
configuration: { "parse-positional-numbers": false, ...
|
|
77142
|
+
configuration: { "parse-positional-numbers": false, ...config46 }
|
|
77143
77143
|
}));
|
|
77144
77144
|
const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
|
|
77145
77145
|
let argvPromise = void 0;
|
|
@@ -77302,7 +77302,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
77302
77302
|
var yargs_default = Yargs;
|
|
77303
77303
|
|
|
77304
77304
|
// package.json
|
|
77305
|
-
var version = "2.
|
|
77305
|
+
var version = "2.56.0";
|
|
77306
77306
|
|
|
77307
77307
|
// src/metrics.ts
|
|
77308
77308
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -77346,12 +77346,12 @@ function getGlobalWranglerConfigPath() {
|
|
|
77346
77346
|
}
|
|
77347
77347
|
|
|
77348
77348
|
// src/helpers/metrics-config.ts
|
|
77349
|
-
function writeMetricsConfig(
|
|
77349
|
+
function writeMetricsConfig(config46) {
|
|
77350
77350
|
(0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
|
|
77351
77351
|
(0, import_node_fs2.writeFileSync)(
|
|
77352
77352
|
getMetricsConfigPath(),
|
|
77353
77353
|
JSON.stringify(
|
|
77354
|
-
|
|
77354
|
+
config46,
|
|
77355
77355
|
(_key, value) => value instanceof Date ? value.toISOString() : value,
|
|
77356
77356
|
" "
|
|
77357
77357
|
)
|
|
@@ -77359,9 +77359,9 @@ function writeMetricsConfig(config45) {
|
|
|
77359
77359
|
}
|
|
77360
77360
|
function readMetricsConfig() {
|
|
77361
77361
|
try {
|
|
77362
|
-
const
|
|
77362
|
+
const config46 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
77363
77363
|
return JSON.parse(
|
|
77364
|
-
|
|
77364
|
+
config46,
|
|
77365
77365
|
(key, value) => key === "date" ? new Date(value) : value
|
|
77366
77366
|
);
|
|
77367
77367
|
} catch {
|
|
@@ -77371,10 +77371,10 @@ function readMetricsConfig() {
|
|
|
77371
77371
|
function getMetricsConfigPath() {
|
|
77372
77372
|
return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
|
|
77373
77373
|
}
|
|
77374
|
-
function getDeviceId(
|
|
77375
|
-
const deviceId =
|
|
77376
|
-
if (
|
|
77377
|
-
writeMetricsConfig({ ...
|
|
77374
|
+
function getDeviceId(config46) {
|
|
77375
|
+
const deviceId = config46.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
77376
|
+
if (config46.deviceId === void 0) {
|
|
77377
|
+
writeMetricsConfig({ ...config46, deviceId });
|
|
77378
77378
|
}
|
|
77379
77379
|
return deviceId;
|
|
77380
77380
|
}
|
|
@@ -77588,7 +77588,7 @@ var detectPackageManager = () => {
|
|
|
77588
77588
|
}
|
|
77589
77589
|
};
|
|
77590
77590
|
var rectifyPmMismatch = async (ctx) => {
|
|
77591
|
-
const { npm:
|
|
77591
|
+
const { npm: npm24 } = detectPackageManager();
|
|
77592
77592
|
if (!detectPmMismatch(ctx)) {
|
|
77593
77593
|
return;
|
|
77594
77594
|
}
|
|
@@ -77600,17 +77600,17 @@ var rectifyPmMismatch = async (ctx) => {
|
|
|
77600
77600
|
if ((0, import_fs5.existsSync)(lockfilePath)) {
|
|
77601
77601
|
(0, import_fs5.rmSync)(lockfilePath);
|
|
77602
77602
|
}
|
|
77603
|
-
await runCommand([
|
|
77603
|
+
await runCommand([npm24, "install"], {
|
|
77604
77604
|
silent: true,
|
|
77605
77605
|
cwd: ctx.project.path,
|
|
77606
77606
|
startText: "Installing dependencies",
|
|
77607
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
77607
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
|
|
77608
77608
|
});
|
|
77609
77609
|
};
|
|
77610
77610
|
var detectPmMismatch = (ctx) => {
|
|
77611
|
-
const { npm:
|
|
77611
|
+
const { npm: npm24 } = detectPackageManager();
|
|
77612
77612
|
const projectPath = ctx.project.path;
|
|
77613
|
-
switch (
|
|
77613
|
+
switch (npm24) {
|
|
77614
77614
|
case "npm":
|
|
77615
77615
|
return false;
|
|
77616
77616
|
case "yarn":
|
|
@@ -77678,10 +77678,10 @@ function getPlatform() {
|
|
|
77678
77678
|
function createReporter() {
|
|
77679
77679
|
const events = [];
|
|
77680
77680
|
const als = new import_node_async_hooks.AsyncLocalStorage();
|
|
77681
|
-
const
|
|
77682
|
-
const isFirstUsage =
|
|
77681
|
+
const config46 = readMetricsConfig() ?? {};
|
|
77682
|
+
const isFirstUsage = config46.c3permission === void 0;
|
|
77683
77683
|
const isEnabled = isTelemetryEnabled();
|
|
77684
|
-
const deviceId = getDeviceId(
|
|
77684
|
+
const deviceId = getDeviceId(config46);
|
|
77685
77685
|
const packageManager = detectPackageManager();
|
|
77686
77686
|
const platform = getPlatform();
|
|
77687
77687
|
const amplitude_session_id = Date.now();
|
|
@@ -77714,7 +77714,7 @@ function createReporter() {
|
|
|
77714
77714
|
if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
|
|
77715
77715
|
return false;
|
|
77716
77716
|
}
|
|
77717
|
-
return hasSparrowSourceKey() && getC3Permission(
|
|
77717
|
+
return hasSparrowSourceKey() && getC3Permission(config46).enabled;
|
|
77718
77718
|
}
|
|
77719
77719
|
async function waitForAllEventsSettled() {
|
|
77720
77720
|
await Promise.allSettled(events);
|
|
@@ -77820,20 +77820,20 @@ function initializeC3Permission(enabled = true) {
|
|
|
77820
77820
|
date: /* @__PURE__ */ new Date()
|
|
77821
77821
|
};
|
|
77822
77822
|
}
|
|
77823
|
-
function getC3Permission(
|
|
77824
|
-
if (!
|
|
77825
|
-
|
|
77826
|
-
writeMetricsConfig(
|
|
77823
|
+
function getC3Permission(config46 = readMetricsConfig() ?? {}) {
|
|
77824
|
+
if (!config46.c3permission) {
|
|
77825
|
+
config46.c3permission = initializeC3Permission();
|
|
77826
|
+
writeMetricsConfig(config46);
|
|
77827
77827
|
}
|
|
77828
|
-
return
|
|
77828
|
+
return config46.c3permission;
|
|
77829
77829
|
}
|
|
77830
77830
|
function updateC3Pemission(enabled) {
|
|
77831
|
-
const
|
|
77832
|
-
if (
|
|
77831
|
+
const config46 = readMetricsConfig();
|
|
77832
|
+
if (config46.c3permission?.enabled === enabled) {
|
|
77833
77833
|
return;
|
|
77834
77834
|
}
|
|
77835
|
-
|
|
77836
|
-
writeMetricsConfig(
|
|
77835
|
+
config46.c3permission = initializeC3Permission(enabled);
|
|
77836
|
+
writeMetricsConfig(config46);
|
|
77837
77837
|
}
|
|
77838
77838
|
var runTelemetryCommand = (action) => {
|
|
77839
77839
|
const logTelemetryStatus = (enabled) => {
|
|
@@ -78785,49 +78785,49 @@ var hasTsConfig = (path6) => {
|
|
|
78785
78785
|
};
|
|
78786
78786
|
|
|
78787
78787
|
// src/helpers/packages.ts
|
|
78788
|
-
var installPackages = async (packages,
|
|
78788
|
+
var installPackages = async (packages, config46 = {}) => {
|
|
78789
78789
|
if (packages.length === 0) {
|
|
78790
78790
|
return;
|
|
78791
78791
|
}
|
|
78792
|
-
const { npm:
|
|
78792
|
+
const { npm: npm24 } = detectPackageManager();
|
|
78793
78793
|
let saveFlag;
|
|
78794
78794
|
let cmd;
|
|
78795
|
-
switch (
|
|
78795
|
+
switch (npm24) {
|
|
78796
78796
|
case "yarn":
|
|
78797
78797
|
cmd = "add";
|
|
78798
|
-
saveFlag =
|
|
78798
|
+
saveFlag = config46.dev ? "-D" : "";
|
|
78799
78799
|
break;
|
|
78800
78800
|
case "bun":
|
|
78801
78801
|
cmd = "add";
|
|
78802
|
-
saveFlag =
|
|
78802
|
+
saveFlag = config46.dev ? "-d" : "";
|
|
78803
78803
|
break;
|
|
78804
78804
|
case "npm":
|
|
78805
78805
|
case "pnpm":
|
|
78806
78806
|
default:
|
|
78807
78807
|
cmd = "install";
|
|
78808
|
-
saveFlag =
|
|
78808
|
+
saveFlag = config46.dev ? "--save-dev" : "";
|
|
78809
78809
|
break;
|
|
78810
78810
|
}
|
|
78811
78811
|
await runCommand(
|
|
78812
78812
|
[
|
|
78813
|
-
|
|
78813
|
+
npm24,
|
|
78814
78814
|
cmd,
|
|
78815
78815
|
...saveFlag ? [saveFlag] : [],
|
|
78816
78816
|
...packages,
|
|
78817
78817
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
78818
78818
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
78819
78819
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
78820
|
-
...
|
|
78820
|
+
...npm24 === "npm" ? ["--legacy-peer-deps"] : []
|
|
78821
78821
|
],
|
|
78822
78822
|
{
|
|
78823
|
-
...
|
|
78823
|
+
...config46,
|
|
78824
78824
|
silent: true
|
|
78825
78825
|
}
|
|
78826
78826
|
);
|
|
78827
|
-
if (
|
|
78827
|
+
if (npm24 === "npm") {
|
|
78828
78828
|
const pkgJsonPath = import_path7.default.join(process.cwd(), "package.json");
|
|
78829
78829
|
const pkgJson = readJSON(pkgJsonPath);
|
|
78830
|
-
const deps =
|
|
78830
|
+
const deps = config46.dev ? pkgJson.devDependencies : pkgJson.dependencies;
|
|
78831
78831
|
(0, import_assert2.default)(deps, "dependencies should be defined");
|
|
78832
78832
|
for (const pkg of packages) {
|
|
78833
78833
|
const versionMarker = pkg.lastIndexOf("@");
|
|
@@ -78847,16 +78847,16 @@ var npmInstall = async (ctx) => {
|
|
|
78847
78847
|
if ((0, import_fs7.existsSync)(nodeModulesPath)) {
|
|
78848
78848
|
return;
|
|
78849
78849
|
}
|
|
78850
|
-
const { npm:
|
|
78850
|
+
const { npm: npm24 } = detectPackageManager();
|
|
78851
78851
|
await runCommand(
|
|
78852
78852
|
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
78853
78853
|
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
78854
78854
|
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
78855
|
-
[
|
|
78855
|
+
[npm24, "install", ...npm24 === "npm" ? ["--legacy-peer-deps"] : []],
|
|
78856
78856
|
{
|
|
78857
78857
|
silent: true,
|
|
78858
78858
|
startText: "Installing dependencies",
|
|
78859
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
78859
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
|
|
78860
78860
|
}
|
|
78861
78861
|
);
|
|
78862
78862
|
};
|
|
@@ -78866,14 +78866,14 @@ async function getLatestPackageVersion(packageSpecifier) {
|
|
|
78866
78866
|
return npmInfo["dist-tags"].latest;
|
|
78867
78867
|
}
|
|
78868
78868
|
var installWrangler = async () => {
|
|
78869
|
-
const { npm:
|
|
78869
|
+
const { npm: npm24 } = detectPackageManager();
|
|
78870
78870
|
await installPackages([`wrangler@latest`], {
|
|
78871
78871
|
dev: true,
|
|
78872
78872
|
startText: `Installing wrangler ${dim(
|
|
78873
78873
|
"A command line tool for building Cloudflare Workers"
|
|
78874
78874
|
)}`,
|
|
78875
78875
|
doneText: `${brandColor("installed")} ${dim(
|
|
78876
|
-
`via \`${
|
|
78876
|
+
`via \`${npm24} install wrangler --save-dev\``
|
|
78877
78877
|
)}`
|
|
78878
78878
|
});
|
|
78879
78879
|
};
|
|
@@ -78933,17 +78933,18 @@ var package_default = {
|
|
|
78933
78933
|
dependencies: {
|
|
78934
78934
|
"create-astro": "4.13.2",
|
|
78935
78935
|
"create-analog": "1.8.1",
|
|
78936
|
-
"@angular/create": "
|
|
78936
|
+
"@angular/create": "21.0.0",
|
|
78937
78937
|
"create-docusaurus": "3.9.2",
|
|
78938
78938
|
"create-hono": "0.19.3",
|
|
78939
78939
|
"create-next-app": "15.5.6",
|
|
78940
78940
|
"create-qwik": "1.17.2",
|
|
78941
78941
|
"create-vite": "7.1.1",
|
|
78942
|
+
"create-rwsdk": "3.1.0",
|
|
78942
78943
|
"create-react-router": "7.9.6",
|
|
78943
78944
|
"create-solid": "0.6.11",
|
|
78944
78945
|
"create-vue": "3.18.2",
|
|
78945
|
-
"create-waku": "0.12.5-0.27.
|
|
78946
|
-
"@tanstack/create-start": "0.
|
|
78946
|
+
"create-waku": "0.12.5-0.27.1-0",
|
|
78947
|
+
"@tanstack/create-start": "0.36.2",
|
|
78947
78948
|
gatsby: "5.15.0",
|
|
78948
78949
|
sv: "0.9.14",
|
|
78949
78950
|
nuxi: "3.30.0"
|
|
@@ -78961,9 +78962,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
|
|
|
78961
78962
|
};
|
|
78962
78963
|
var runFrameworkGenerator = async (ctx, args) => {
|
|
78963
78964
|
const cli = getFrameworkCli(ctx, true);
|
|
78964
|
-
const { npm:
|
|
78965
|
-
const cmd = [...
|
|
78966
|
-
const env3 =
|
|
78965
|
+
const { npm: npm24, dlx } = detectPackageManager();
|
|
78966
|
+
const cmd = [...npm24 === "yarn" ? ["npx"] : dlx, cli, ...args];
|
|
78967
|
+
const env3 = npm24 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
|
|
78967
78968
|
if (ctx.args.additionalArgs?.length) {
|
|
78968
78969
|
cmd.push(...ctx.args.additionalArgs);
|
|
78969
78970
|
}
|
|
@@ -80724,9 +80725,9 @@ function transformViteConfig(ctx) {
|
|
|
80724
80725
|
if (callee.name !== "defineConfig") {
|
|
80725
80726
|
return this.traverse(n);
|
|
80726
80727
|
}
|
|
80727
|
-
const
|
|
80728
|
-
(0, import_assert3.default)(t.ObjectExpression.check(
|
|
80729
|
-
const pluginsProp =
|
|
80728
|
+
const config46 = n.node.arguments[0];
|
|
80729
|
+
(0, import_assert3.default)(t.ObjectExpression.check(config46));
|
|
80730
|
+
const pluginsProp = config46.properties.find((prop) => isPluginsProp(prop));
|
|
80730
80731
|
(0, import_assert3.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
80731
80732
|
pluginsProp.value.elements.push(
|
|
80732
80733
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -80822,8 +80823,34 @@ var config34 = {
|
|
|
80822
80823
|
};
|
|
80823
80824
|
var c3_default37 = config34;
|
|
80824
80825
|
|
|
80825
|
-
// templates/
|
|
80826
|
+
// templates/redwood/c3.ts
|
|
80827
|
+
var { npm: npm15 } = detectPackageManager();
|
|
80828
|
+
var generate20 = async (ctx) => {
|
|
80829
|
+
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
80830
|
+
logRaw("");
|
|
80831
|
+
};
|
|
80826
80832
|
var config35 = {
|
|
80833
|
+
configVersion: 1,
|
|
80834
|
+
id: "redwood",
|
|
80835
|
+
platform: "workers",
|
|
80836
|
+
frameworkCli: "create-rwsdk",
|
|
80837
|
+
displayName: "RedwoodSDK",
|
|
80838
|
+
generate: generate20,
|
|
80839
|
+
transformPackageJson: async () => ({
|
|
80840
|
+
scripts: {
|
|
80841
|
+
deploy: `${npm15} run release`,
|
|
80842
|
+
preview: `${npm15} run build && wrangler dev`,
|
|
80843
|
+
"cf-typegen": `wrangler types`
|
|
80844
|
+
}
|
|
80845
|
+
}),
|
|
80846
|
+
devScript: "dev",
|
|
80847
|
+
deployScript: "release",
|
|
80848
|
+
previewScript: "preview"
|
|
80849
|
+
};
|
|
80850
|
+
var c3_default38 = config35;
|
|
80851
|
+
|
|
80852
|
+
// templates/scheduled/c3.ts
|
|
80853
|
+
var config36 = {
|
|
80827
80854
|
configVersion: 1,
|
|
80828
80855
|
id: "scheduled",
|
|
80829
80856
|
displayName: "Scheduled Worker (Cron Trigger)",
|
|
@@ -80840,7 +80867,7 @@ var config35 = {
|
|
|
80840
80867
|
}
|
|
80841
80868
|
}
|
|
80842
80869
|
};
|
|
80843
|
-
var
|
|
80870
|
+
var c3_default39 = config36;
|
|
80844
80871
|
|
|
80845
80872
|
// src/helpers/compatDate.ts
|
|
80846
80873
|
var import_fs10 = require("fs");
|
|
@@ -80892,8 +80919,8 @@ function getLatestTypesEntrypoint(ctx) {
|
|
|
80892
80919
|
|
|
80893
80920
|
// templates/solid/c3.ts
|
|
80894
80921
|
var recast10 = __toESM(require_main2());
|
|
80895
|
-
var { npm:
|
|
80896
|
-
var
|
|
80922
|
+
var { npm: npm16 } = detectPackageManager();
|
|
80923
|
+
var generate21 = async (ctx) => {
|
|
80897
80924
|
await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
|
|
80898
80925
|
logRaw("");
|
|
80899
80926
|
};
|
|
@@ -80902,7 +80929,7 @@ var configure11 = async (ctx) => {
|
|
|
80902
80929
|
await installPackages(packages, {
|
|
80903
80930
|
dev: true,
|
|
80904
80931
|
startText: "Installing nitro module `nitropack`",
|
|
80905
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${
|
|
80932
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm16} install\``)}`
|
|
80906
80933
|
});
|
|
80907
80934
|
usesTypescript(ctx);
|
|
80908
80935
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
@@ -80938,7 +80965,7 @@ var configure11 = async (ctx) => {
|
|
|
80938
80965
|
}
|
|
80939
80966
|
});
|
|
80940
80967
|
};
|
|
80941
|
-
var
|
|
80968
|
+
var config37 = {
|
|
80942
80969
|
configVersion: 1,
|
|
80943
80970
|
id: "solid",
|
|
80944
80971
|
frameworkCli: "create-solid",
|
|
@@ -80948,12 +80975,12 @@ var config36 = {
|
|
|
80948
80975
|
path: "./templates"
|
|
80949
80976
|
},
|
|
80950
80977
|
path: "templates/solid",
|
|
80951
|
-
generate:
|
|
80978
|
+
generate: generate21,
|
|
80952
80979
|
configure: configure11,
|
|
80953
80980
|
transformPackageJson: async () => ({
|
|
80954
80981
|
scripts: {
|
|
80955
|
-
preview: `${
|
|
80956
|
-
deploy: `${
|
|
80982
|
+
preview: `${npm16} run build && npx wrangler dev`,
|
|
80983
|
+
deploy: `${npm16} run build && wrangler deploy`,
|
|
80957
80984
|
"cf-typegen": `wrangler types`
|
|
80958
80985
|
}
|
|
80959
80986
|
}),
|
|
@@ -80961,13 +80988,13 @@ var config36 = {
|
|
|
80961
80988
|
deployScript: "deploy",
|
|
80962
80989
|
previewScript: "preview"
|
|
80963
80990
|
};
|
|
80964
|
-
var
|
|
80991
|
+
var c3_default40 = config37;
|
|
80965
80992
|
|
|
80966
80993
|
// templates/svelte/pages/c3.ts
|
|
80967
80994
|
var import_node_fs3 = require("node:fs");
|
|
80968
80995
|
var recast11 = __toESM(require_main2());
|
|
80969
|
-
var { npm:
|
|
80970
|
-
var
|
|
80996
|
+
var { npm: npm17 } = detectPackageManager();
|
|
80997
|
+
var generate22 = async (ctx) => {
|
|
80971
80998
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
80972
80999
|
logRaw("");
|
|
80973
81000
|
};
|
|
@@ -81054,7 +81081,7 @@ var updateTypeDefinitions = (ctx) => {
|
|
|
81054
81081
|
});
|
|
81055
81082
|
};
|
|
81056
81083
|
var typesPath2 = "src/worker-configuration.d.ts";
|
|
81057
|
-
var
|
|
81084
|
+
var config38 = {
|
|
81058
81085
|
configVersion: 1,
|
|
81059
81086
|
id: "svelte",
|
|
81060
81087
|
frameworkCli: "sv",
|
|
@@ -81065,12 +81092,12 @@ var config37 = {
|
|
|
81065
81092
|
path: "./templates"
|
|
81066
81093
|
},
|
|
81067
81094
|
path: "templates/svelte/pages",
|
|
81068
|
-
generate:
|
|
81095
|
+
generate: generate22,
|
|
81069
81096
|
configure: configure12,
|
|
81070
81097
|
transformPackageJson: async (original, ctx) => {
|
|
81071
81098
|
let scripts = {
|
|
81072
|
-
preview: `${
|
|
81073
|
-
deploy: `${
|
|
81099
|
+
preview: `${npm17} run build && wrangler pages dev`,
|
|
81100
|
+
deploy: `${npm17} run build && wrangler pages deploy`
|
|
81074
81101
|
};
|
|
81075
81102
|
if (usesTypescript(ctx)) {
|
|
81076
81103
|
scripts = {
|
|
@@ -81085,12 +81112,12 @@ var config37 = {
|
|
|
81085
81112
|
previewScript: "preview",
|
|
81086
81113
|
typesPath: typesPath2
|
|
81087
81114
|
};
|
|
81088
|
-
var
|
|
81115
|
+
var c3_default41 = config38;
|
|
81089
81116
|
|
|
81090
81117
|
// templates/svelte/workers/c3.ts
|
|
81091
81118
|
var recast12 = __toESM(require_main2());
|
|
81092
|
-
var { npm:
|
|
81093
|
-
var
|
|
81119
|
+
var { npm: npm18 } = detectPackageManager();
|
|
81120
|
+
var generate23 = async (ctx) => {
|
|
81094
81121
|
await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
|
|
81095
81122
|
logRaw("");
|
|
81096
81123
|
};
|
|
@@ -81154,7 +81181,7 @@ var updateTypeDefinitions2 = (ctx) => {
|
|
|
81154
81181
|
});
|
|
81155
81182
|
};
|
|
81156
81183
|
var typesPath3 = "./src/worker-configuration.d.ts";
|
|
81157
|
-
var
|
|
81184
|
+
var config39 = {
|
|
81158
81185
|
configVersion: 1,
|
|
81159
81186
|
id: "svelte",
|
|
81160
81187
|
frameworkCli: "sv",
|
|
@@ -81164,12 +81191,12 @@ var config38 = {
|
|
|
81164
81191
|
path: "./templates"
|
|
81165
81192
|
},
|
|
81166
81193
|
path: "templates/svelte/workers",
|
|
81167
|
-
generate:
|
|
81194
|
+
generate: generate23,
|
|
81168
81195
|
configure: configure13,
|
|
81169
81196
|
transformPackageJson: async (original, ctx) => {
|
|
81170
81197
|
let scripts = {
|
|
81171
|
-
preview: `${
|
|
81172
|
-
deploy: `${
|
|
81198
|
+
preview: `${npm18} run build && wrangler dev`,
|
|
81199
|
+
deploy: `${npm18} run build && wrangler deploy`
|
|
81173
81200
|
};
|
|
81174
81201
|
if (usesTypescript(ctx)) {
|
|
81175
81202
|
scripts = {
|
|
@@ -81184,21 +81211,21 @@ var config38 = {
|
|
|
81184
81211
|
previewScript: "preview",
|
|
81185
81212
|
typesPath: typesPath3
|
|
81186
81213
|
};
|
|
81187
|
-
var
|
|
81214
|
+
var c3_default42 = config39;
|
|
81188
81215
|
|
|
81189
81216
|
// templates/svelte/c3.ts
|
|
81190
|
-
var
|
|
81217
|
+
var config40 = {
|
|
81191
81218
|
displayName: "SvelteKit",
|
|
81192
|
-
platformVariants: { pages:
|
|
81219
|
+
platformVariants: { pages: c3_default41, workers: c3_default42 }
|
|
81193
81220
|
};
|
|
81194
|
-
var
|
|
81221
|
+
var c3_default43 = config40;
|
|
81195
81222
|
|
|
81196
81223
|
// templates/tanstack-start/c3.ts
|
|
81197
|
-
var { npm:
|
|
81198
|
-
var
|
|
81224
|
+
var { npm: npm19 } = detectPackageManager();
|
|
81225
|
+
var generate24 = async (ctx) => {
|
|
81199
81226
|
await runFrameworkGenerator(ctx, [
|
|
81200
81227
|
ctx.project.name,
|
|
81201
|
-
"--
|
|
81228
|
+
"--deployment",
|
|
81202
81229
|
"cloudflare",
|
|
81203
81230
|
"--framework",
|
|
81204
81231
|
"react",
|
|
@@ -81207,17 +81234,17 @@ var generate23 = async (ctx) => {
|
|
|
81207
81234
|
]);
|
|
81208
81235
|
logRaw("");
|
|
81209
81236
|
};
|
|
81210
|
-
var
|
|
81237
|
+
var config41 = {
|
|
81211
81238
|
configVersion: 1,
|
|
81212
81239
|
id: "tanstack-start",
|
|
81213
81240
|
platform: "workers",
|
|
81214
81241
|
frameworkCli: "@tanstack/create-start",
|
|
81215
81242
|
displayName: "TanStack Start",
|
|
81216
|
-
generate:
|
|
81243
|
+
generate: generate24,
|
|
81217
81244
|
transformPackageJson: async () => ({
|
|
81218
81245
|
scripts: {
|
|
81219
|
-
deploy: `${
|
|
81220
|
-
preview: `${
|
|
81246
|
+
deploy: `${npm19} run build && wrangler deploy`,
|
|
81247
|
+
preview: `${npm19} run build && vite preview`,
|
|
81221
81248
|
"cf-typegen": `wrangler types`
|
|
81222
81249
|
}
|
|
81223
81250
|
}),
|
|
@@ -81225,14 +81252,14 @@ var config40 = {
|
|
|
81225
81252
|
deployScript: "deploy",
|
|
81226
81253
|
previewScript: "preview"
|
|
81227
81254
|
};
|
|
81228
|
-
var
|
|
81255
|
+
var c3_default44 = config41;
|
|
81229
81256
|
|
|
81230
81257
|
// templates/vue/pages/c3.ts
|
|
81231
|
-
var { npm:
|
|
81232
|
-
var
|
|
81258
|
+
var { npm: npm20 } = detectPackageManager();
|
|
81259
|
+
var generate25 = async (ctx) => {
|
|
81233
81260
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
81234
81261
|
};
|
|
81235
|
-
var
|
|
81262
|
+
var config42 = {
|
|
81236
81263
|
configVersion: 1,
|
|
81237
81264
|
id: "vue",
|
|
81238
81265
|
frameworkCli: "create-vue",
|
|
@@ -81241,11 +81268,11 @@ var config41 = {
|
|
|
81241
81268
|
hidden: true,
|
|
81242
81269
|
path: "templates/vue/pages",
|
|
81243
81270
|
copyFiles: { path: "./templates" },
|
|
81244
|
-
generate:
|
|
81271
|
+
generate: generate25,
|
|
81245
81272
|
transformPackageJson: async () => ({
|
|
81246
81273
|
scripts: {
|
|
81247
|
-
deploy: `${
|
|
81248
|
-
preview: `${
|
|
81274
|
+
deploy: `${npm20} run build && wrangler pages deploy`,
|
|
81275
|
+
preview: `${npm20} run build && wrangler pages dev`,
|
|
81249
81276
|
"cf-typegen": `wrangler types`
|
|
81250
81277
|
}
|
|
81251
81278
|
}),
|
|
@@ -81253,11 +81280,11 @@ var config41 = {
|
|
|
81253
81280
|
deployScript: "deploy",
|
|
81254
81281
|
previewScript: "preview"
|
|
81255
81282
|
};
|
|
81256
|
-
var
|
|
81283
|
+
var c3_default45 = config42;
|
|
81257
81284
|
|
|
81258
81285
|
// templates/vue/workers/c3.ts
|
|
81259
|
-
var { npm:
|
|
81260
|
-
var
|
|
81286
|
+
var { npm: npm21 } = detectPackageManager();
|
|
81287
|
+
var generate26 = async (ctx) => {
|
|
81261
81288
|
const lang = ctx.args.lang ?? await inputPrompt({
|
|
81262
81289
|
type: "select",
|
|
81263
81290
|
question: "Would you like to use TypeScript?",
|
|
@@ -81295,7 +81322,7 @@ function updateTsconfigJson2() {
|
|
|
81295
81322
|
writeJSON("tsconfig.json", tsconfig);
|
|
81296
81323
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
81297
81324
|
}
|
|
81298
|
-
var
|
|
81325
|
+
var config43 = {
|
|
81299
81326
|
configVersion: 1,
|
|
81300
81327
|
id: "vue",
|
|
81301
81328
|
frameworkCli: "create-vue",
|
|
@@ -81316,11 +81343,11 @@ var config42 = {
|
|
|
81316
81343
|
}
|
|
81317
81344
|
},
|
|
81318
81345
|
configure: configure14,
|
|
81319
|
-
generate:
|
|
81346
|
+
generate: generate26,
|
|
81320
81347
|
transformPackageJson: async (_3, ctx) => ({
|
|
81321
81348
|
scripts: {
|
|
81322
|
-
deploy: `${
|
|
81323
|
-
preview: `${
|
|
81349
|
+
deploy: `${npm21} run build && wrangler deploy`,
|
|
81350
|
+
preview: `${npm21} run build && wrangler dev`,
|
|
81324
81351
|
...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
|
|
81325
81352
|
}
|
|
81326
81353
|
}),
|
|
@@ -81328,18 +81355,18 @@ var config42 = {
|
|
|
81328
81355
|
deployScript: "deploy",
|
|
81329
81356
|
previewScript: "preview"
|
|
81330
81357
|
};
|
|
81331
|
-
var
|
|
81358
|
+
var c3_default46 = config43;
|
|
81332
81359
|
|
|
81333
81360
|
// templates/vue/c3.ts
|
|
81334
|
-
var
|
|
81361
|
+
var config44 = {
|
|
81335
81362
|
displayName: "Vue",
|
|
81336
|
-
platformVariants: { pages:
|
|
81363
|
+
platformVariants: { pages: c3_default45, workers: c3_default46 }
|
|
81337
81364
|
};
|
|
81338
|
-
var
|
|
81365
|
+
var c3_default47 = config44;
|
|
81339
81366
|
|
|
81340
81367
|
// templates/waku/c3.ts
|
|
81341
|
-
var { npm:
|
|
81342
|
-
var
|
|
81368
|
+
var { npm: npm22 } = detectPackageManager();
|
|
81369
|
+
var generate27 = async (ctx) => {
|
|
81343
81370
|
await runFrameworkGenerator(ctx, [
|
|
81344
81371
|
"--project-name",
|
|
81345
81372
|
ctx.project.name,
|
|
@@ -81347,31 +81374,31 @@ var generate26 = async (ctx) => {
|
|
|
81347
81374
|
"07_cloudflare"
|
|
81348
81375
|
]);
|
|
81349
81376
|
};
|
|
81350
|
-
var
|
|
81377
|
+
var config45 = {
|
|
81351
81378
|
configVersion: 1,
|
|
81352
81379
|
id: "waku",
|
|
81353
81380
|
frameworkCli: "create-waku",
|
|
81354
81381
|
platform: "workers",
|
|
81355
81382
|
displayName: "Waku",
|
|
81356
81383
|
path: "templates/waku",
|
|
81357
|
-
generate:
|
|
81384
|
+
generate: generate27,
|
|
81358
81385
|
transformPackageJson: async () => ({
|
|
81359
81386
|
scripts: {
|
|
81360
|
-
deploy: `${
|
|
81361
|
-
preview: `NODE_ENV=production ${
|
|
81387
|
+
deploy: `${npm22} run build && wrangler deploy`,
|
|
81388
|
+
preview: `NODE_ENV=production ${npm22} run build && wrangler dev`
|
|
81362
81389
|
}
|
|
81363
81390
|
}),
|
|
81364
81391
|
devScript: "dev",
|
|
81365
81392
|
deployScript: "deploy",
|
|
81366
81393
|
previewScript: "preview"
|
|
81367
81394
|
};
|
|
81368
|
-
var
|
|
81395
|
+
var c3_default48 = config45;
|
|
81369
81396
|
|
|
81370
81397
|
// src/git.ts
|
|
81371
81398
|
var import_node_assert2 = __toESM(require("node:assert"));
|
|
81372
81399
|
|
|
81373
81400
|
// ../wrangler/package.json
|
|
81374
|
-
var version2 = "4.
|
|
81401
|
+
var version2 = "4.51.0";
|
|
81375
81402
|
|
|
81376
81403
|
// src/git.ts
|
|
81377
81404
|
var offerGit = async (ctx) => {
|
|
@@ -81629,8 +81656,8 @@ var isAllowedExistingFile = (file) => {
|
|
|
81629
81656
|
var defaultSelectVariant = async (ctx) => {
|
|
81630
81657
|
return ctx.args.lang;
|
|
81631
81658
|
};
|
|
81632
|
-
var templateSupportsLanguage = (
|
|
81633
|
-
const { copyFiles } =
|
|
81659
|
+
var templateSupportsLanguage = (config46, lang) => {
|
|
81660
|
+
const { copyFiles } = config46;
|
|
81634
81661
|
if (!copyFiles || isVariantInfo(copyFiles)) {
|
|
81635
81662
|
return false;
|
|
81636
81663
|
}
|
|
@@ -81644,11 +81671,11 @@ var filterTemplatesByLanguage = (templates, lang) => {
|
|
|
81644
81671
|
return templates;
|
|
81645
81672
|
}
|
|
81646
81673
|
return Object.fromEntries(
|
|
81647
|
-
Object.entries(templates).filter(([,
|
|
81648
|
-
if ("platformVariants" in
|
|
81649
|
-
return templateSupportsLanguage(
|
|
81674
|
+
Object.entries(templates).filter(([, config46]) => {
|
|
81675
|
+
if ("platformVariants" in config46) {
|
|
81676
|
+
return templateSupportsLanguage(config46.platformVariants.pages, lang) || templateSupportsLanguage(config46.platformVariants.workers, lang);
|
|
81650
81677
|
}
|
|
81651
|
-
return templateSupportsLanguage(
|
|
81678
|
+
return templateSupportsLanguage(config46, lang);
|
|
81652
81679
|
})
|
|
81653
81680
|
);
|
|
81654
81681
|
};
|
|
@@ -81656,8 +81683,9 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
81656
81683
|
if (experimental) {
|
|
81657
81684
|
return {
|
|
81658
81685
|
gatsby: c3_default14,
|
|
81659
|
-
svelte:
|
|
81660
|
-
docusaurus: c3_default11
|
|
81686
|
+
svelte: c3_default43,
|
|
81687
|
+
docusaurus: c3_default11,
|
|
81688
|
+
astro: c3_default7
|
|
81661
81689
|
};
|
|
81662
81690
|
} else {
|
|
81663
81691
|
return {
|
|
@@ -81672,11 +81700,12 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
81672
81700
|
qwik: c3_default33,
|
|
81673
81701
|
react: c3_default37,
|
|
81674
81702
|
"react-router": c3_default34,
|
|
81675
|
-
|
|
81676
|
-
|
|
81677
|
-
|
|
81678
|
-
|
|
81679
|
-
|
|
81703
|
+
redwood: c3_default38,
|
|
81704
|
+
solid: c3_default40,
|
|
81705
|
+
svelte: c3_default43,
|
|
81706
|
+
"tanstack-start": c3_default44,
|
|
81707
|
+
vue: c3_default47,
|
|
81708
|
+
waku: c3_default48
|
|
81680
81709
|
};
|
|
81681
81710
|
}
|
|
81682
81711
|
}
|
|
@@ -81688,7 +81717,7 @@ function getOtherTemplateMap({
|
|
|
81688
81717
|
} else {
|
|
81689
81718
|
return {
|
|
81690
81719
|
common: c3_default8,
|
|
81691
|
-
scheduled:
|
|
81720
|
+
scheduled: c3_default39,
|
|
81692
81721
|
queues: c3_default30,
|
|
81693
81722
|
openapi: c3_default28,
|
|
81694
81723
|
"pre-existing": c3_default29
|
|
@@ -81709,7 +81738,7 @@ function getHelloWorldTemplateMap({
|
|
|
81709
81738
|
"hello-world-durable-object-with-assets": c3_default16,
|
|
81710
81739
|
"hello-world-workflows": c3_default19,
|
|
81711
81740
|
common: c3_default8,
|
|
81712
|
-
scheduled:
|
|
81741
|
+
scheduled: c3_default39,
|
|
81713
81742
|
queues: c3_default30,
|
|
81714
81743
|
openapi: c3_default28,
|
|
81715
81744
|
"pre-existing": c3_default29
|
|
@@ -81880,10 +81909,10 @@ var createContext = async (args, prevArgs) => {
|
|
|
81880
81909
|
let template;
|
|
81881
81910
|
if (category === "web-framework") {
|
|
81882
81911
|
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
81883
|
-
(acc, [key,
|
|
81884
|
-
if (!
|
|
81912
|
+
(acc, [key, config46]) => {
|
|
81913
|
+
if (!config46.hidden || args.framework) {
|
|
81885
81914
|
acc.push({
|
|
81886
|
-
label:
|
|
81915
|
+
label: config46.displayName,
|
|
81887
81916
|
value: key
|
|
81888
81917
|
});
|
|
81889
81918
|
}
|
|
@@ -81909,7 +81938,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
81909
81938
|
if ("platformVariants" in frameworkConfig) {
|
|
81910
81939
|
const availableVariants = Object.entries(
|
|
81911
81940
|
frameworkConfig.platformVariants
|
|
81912
|
-
).filter(([,
|
|
81941
|
+
).filter(([, config46]) => !config46.hidden);
|
|
81913
81942
|
if (availableVariants.length === 1) {
|
|
81914
81943
|
args.platform ??= availableVariants[0][0];
|
|
81915
81944
|
}
|
|
@@ -82075,28 +82104,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
82075
82104
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
82076
82105
|
}
|
|
82077
82106
|
const path6 = await downloadRemoteTemplate(src, args.templateMode);
|
|
82078
|
-
const
|
|
82079
|
-
validateTemplate(path6,
|
|
82107
|
+
const config46 = inferTemplateConfig(path6);
|
|
82108
|
+
validateTemplate(path6, config46);
|
|
82080
82109
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
82081
82110
|
return {
|
|
82082
82111
|
path: path6,
|
|
82083
|
-
...
|
|
82112
|
+
...config46
|
|
82084
82113
|
};
|
|
82085
82114
|
};
|
|
82086
|
-
var validateTemplate = (path6,
|
|
82087
|
-
if (!
|
|
82115
|
+
var validateTemplate = (path6, config46) => {
|
|
82116
|
+
if (!config46.copyFiles) {
|
|
82088
82117
|
return;
|
|
82089
82118
|
}
|
|
82090
|
-
if (isVariantInfo(
|
|
82091
|
-
validateTemplateSrcDirectory((0, import_path12.resolve)(path6,
|
|
82119
|
+
if (isVariantInfo(config46.copyFiles)) {
|
|
82120
|
+
validateTemplateSrcDirectory((0, import_path12.resolve)(path6, config46.copyFiles.path), config46);
|
|
82092
82121
|
} else {
|
|
82093
|
-
for (const variant of Object.values(
|
|
82094
|
-
validateTemplateSrcDirectory((0, import_path12.resolve)(path6, variant.path),
|
|
82122
|
+
for (const variant of Object.values(config46.copyFiles.variants)) {
|
|
82123
|
+
validateTemplateSrcDirectory((0, import_path12.resolve)(path6, variant.path), config46);
|
|
82095
82124
|
}
|
|
82096
82125
|
}
|
|
82097
82126
|
};
|
|
82098
|
-
var validateTemplateSrcDirectory = (path6,
|
|
82099
|
-
if (
|
|
82127
|
+
var validateTemplateSrcDirectory = (path6, config46) => {
|
|
82128
|
+
if (config46.platform === "workers") {
|
|
82100
82129
|
const wranglerTomlPath = (0, import_path12.resolve)(path6, "wrangler.toml");
|
|
82101
82130
|
const wranglerJsonPath = (0, import_path12.resolve)(path6, "wrangler.json");
|
|
82102
82131
|
const wranglerJsoncPath = (0, import_path12.resolve)(path6, "wrangler.jsonc");
|
|
@@ -82879,13 +82908,13 @@ var writeWranglerToml = (ctx, contents) => {
|
|
|
82879
82908
|
const wranglerTomlPath = getWranglerTomlPath(ctx);
|
|
82880
82909
|
return writeFile2(wranglerTomlPath, contents);
|
|
82881
82910
|
};
|
|
82882
|
-
var writeWranglerJson = (ctx,
|
|
82911
|
+
var writeWranglerJson = (ctx, config46) => {
|
|
82883
82912
|
const wranglerJsonPath = getWranglerJsonPath(ctx);
|
|
82884
82913
|
if ((0, import_fs13.existsSync)(wranglerJsonPath)) {
|
|
82885
|
-
return writeJSONWithComments(wranglerJsonPath,
|
|
82914
|
+
return writeJSONWithComments(wranglerJsonPath, config46);
|
|
82886
82915
|
}
|
|
82887
82916
|
const wranglerJsoncPath = getWranglerJsoncPath(ctx);
|
|
82888
|
-
return writeJSONWithComments(wranglerJsoncPath,
|
|
82917
|
+
return writeJSONWithComments(wranglerJsoncPath, config46);
|
|
82889
82918
|
};
|
|
82890
82919
|
var addVscodeConfig = (ctx) => {
|
|
82891
82920
|
const settingsPath = `${ctx.project.path}/.vscode/settings.json`;
|
|
@@ -82899,17 +82928,17 @@ var addVscodeConfig = (ctx) => {
|
|
|
82899
82928
|
}
|
|
82900
82929
|
});
|
|
82901
82930
|
};
|
|
82902
|
-
async function getCompatibilityDate(
|
|
82931
|
+
async function getCompatibilityDate(config46) {
|
|
82903
82932
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}$/m;
|
|
82904
|
-
if (typeof
|
|
82905
|
-
return
|
|
82933
|
+
if (typeof config46["compatibility_date"] === "string" && config46["compatibility_date"].match(validCompatDateRe)) {
|
|
82934
|
+
return config46["compatibility_date"];
|
|
82906
82935
|
}
|
|
82907
82936
|
return await getWorkerdCompatibilityDate();
|
|
82908
82937
|
}
|
|
82909
82938
|
|
|
82910
82939
|
// src/deploy.ts
|
|
82911
82940
|
var offerToDeploy = async (ctx) => {
|
|
82912
|
-
const { npm:
|
|
82941
|
+
const { npm: npm24 } = detectPackageManager();
|
|
82913
82942
|
startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
|
|
82914
82943
|
if (!await isDeployable(ctx)) {
|
|
82915
82944
|
ctx.args.deploy = false;
|
|
@@ -82920,7 +82949,7 @@ var offerToDeploy = async (ctx) => {
|
|
|
82920
82949
|
);
|
|
82921
82950
|
}
|
|
82922
82951
|
const label = `deploy via \`${quoteShellArgs([
|
|
82923
|
-
|
|
82952
|
+
npm24,
|
|
82924
82953
|
"run",
|
|
82925
82954
|
ctx.template.deployScript ?? "deploy"
|
|
82926
82955
|
])}\``;
|
|
@@ -82956,11 +82985,11 @@ var readWranglerConfig = (ctx) => {
|
|
|
82956
82985
|
return dist_default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
|
|
82957
82986
|
};
|
|
82958
82987
|
var runDeploy = async (ctx) => {
|
|
82959
|
-
const { npm:
|
|
82988
|
+
const { npm: npm24, name: pm4 } = detectPackageManager();
|
|
82960
82989
|
if (!ctx.account?.id) {
|
|
82961
82990
|
throw new Error("Failed to read Cloudflare account.");
|
|
82962
82991
|
}
|
|
82963
|
-
const baseDeployCmd = [
|
|
82992
|
+
const baseDeployCmd = [npm24, "run", ctx.template.deployScript ?? "deploy"];
|
|
82964
82993
|
const insideGitRepo = await isInsideGitRepo(ctx.project.path);
|
|
82965
82994
|
const deployCmd = [
|
|
82966
82995
|
...baseDeployCmd,
|
|
@@ -83076,9 +83105,9 @@ var printSummary = (ctx) => {
|
|
|
83076
83105
|
const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
|
|
83077
83106
|
const relativePath = (0, import_path14.relative)(ctx.originalCWD, ctx.project.path);
|
|
83078
83107
|
const cdCommand = relativePath ? `cd ${relativePath}` : null;
|
|
83079
|
-
const { npm:
|
|
83108
|
+
const { npm: npm24 } = detectPackageManager();
|
|
83080
83109
|
const deployCommand = quoteShellArgs([
|
|
83081
|
-
|
|
83110
|
+
npm24,
|
|
83082
83111
|
"run",
|
|
83083
83112
|
ctx.template.deployScript ?? "deploy"
|
|
83084
83113
|
]);
|
|
@@ -83446,8 +83475,8 @@ var renderValues = (values) => {
|
|
|
83446
83475
|
|
|
83447
83476
|
// src/helpers/retry.ts
|
|
83448
83477
|
var import_promises7 = require("node:timers/promises");
|
|
83449
|
-
var retry = async (
|
|
83450
|
-
let { times } =
|
|
83478
|
+
var retry = async (config46, fn) => {
|
|
83479
|
+
let { times } = config46;
|
|
83451
83480
|
let error2 = null;
|
|
83452
83481
|
while (times > 0) {
|
|
83453
83482
|
try {
|
|
@@ -83455,10 +83484,10 @@ var retry = async (config45, fn) => {
|
|
|
83455
83484
|
} catch (e) {
|
|
83456
83485
|
error2 = e;
|
|
83457
83486
|
times--;
|
|
83458
|
-
if (
|
|
83487
|
+
if (config46.exitCondition?.(e)) {
|
|
83459
83488
|
break;
|
|
83460
83489
|
}
|
|
83461
|
-
await (0, import_promises7.setTimeout)(
|
|
83490
|
+
await (0, import_promises7.setTimeout)(config46.sleepMs ?? 1e3);
|
|
83462
83491
|
}
|
|
83463
83492
|
}
|
|
83464
83493
|
throw error2;
|
|
@@ -84866,16 +84895,16 @@ async function addTypes(ctx) {
|
|
|
84866
84895
|
if (!usesTypescript(ctx) || ctx.template.workersTypes === "none") {
|
|
84867
84896
|
return;
|
|
84868
84897
|
}
|
|
84869
|
-
const { npm:
|
|
84898
|
+
const { npm: npm24 } = detectPackageManager();
|
|
84870
84899
|
if (ctx.template.workersTypes === "installed") {
|
|
84871
|
-
await installWorkersTypes(
|
|
84900
|
+
await installWorkersTypes(npm24);
|
|
84872
84901
|
} else if (ctx.template.workersTypes === "generated") {
|
|
84873
|
-
await generateWorkersTypes(ctx,
|
|
84902
|
+
await generateWorkersTypes(ctx, npm24);
|
|
84874
84903
|
}
|
|
84875
|
-
const usesNodeCompat = await maybeInstallNodeTypes(ctx,
|
|
84904
|
+
const usesNodeCompat = await maybeInstallNodeTypes(ctx, npm24);
|
|
84876
84905
|
await updateTsConfig(ctx, { usesNodeCompat });
|
|
84877
84906
|
}
|
|
84878
|
-
async function generateWorkersTypes(ctx,
|
|
84907
|
+
async function generateWorkersTypes(ctx, npm24) {
|
|
84879
84908
|
const packageJsonPath = (0, import_path15.join)(ctx.project.path, "package.json");
|
|
84880
84909
|
if (!(0, import_fs14.existsSync)(packageJsonPath)) {
|
|
84881
84910
|
return;
|
|
@@ -84884,7 +84913,7 @@ async function generateWorkersTypes(ctx, npm23) {
|
|
|
84884
84913
|
if (!packageManifest.scripts?.["cf-typegen"]) {
|
|
84885
84914
|
return;
|
|
84886
84915
|
}
|
|
84887
|
-
const typesCmd = [
|
|
84916
|
+
const typesCmd = [npm24, "run", "cf-typegen"];
|
|
84888
84917
|
await runCommand(typesCmd, {
|
|
84889
84918
|
cwd: ctx.project.path,
|
|
84890
84919
|
silent: true,
|
|
@@ -84896,7 +84925,7 @@ async function generateWorkersTypes(ctx, npm23) {
|
|
|
84896
84925
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
84897
84926
|
}
|
|
84898
84927
|
}
|
|
84899
|
-
var maybeInstallNodeTypes = async (ctx,
|
|
84928
|
+
var maybeInstallNodeTypes = async (ctx, npm24) => {
|
|
84900
84929
|
let parsedConfig = {};
|
|
84901
84930
|
if (wranglerJsonExists(ctx)) {
|
|
84902
84931
|
parsedConfig = readWranglerJson(ctx);
|
|
@@ -84909,7 +84938,7 @@ var maybeInstallNodeTypes = async (ctx, npm23) => {
|
|
|
84909
84938
|
await installPackages(["@types/node"], {
|
|
84910
84939
|
dev: true,
|
|
84911
84940
|
startText: "Installing @types/node",
|
|
84912
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
84941
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm24}`)}`
|
|
84913
84942
|
});
|
|
84914
84943
|
return true;
|
|
84915
84944
|
}
|
|
@@ -84922,8 +84951,8 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
|
|
|
84922
84951
|
}
|
|
84923
84952
|
const tsconfig = readFile(tsconfigPath);
|
|
84924
84953
|
try {
|
|
84925
|
-
const
|
|
84926
|
-
const currentTypes =
|
|
84954
|
+
const config46 = parse6(tsconfig);
|
|
84955
|
+
const currentTypes = config46.compilerOptions?.types ?? [];
|
|
84927
84956
|
let newTypes = [...currentTypes];
|
|
84928
84957
|
if (ctx.template.workersTypes === "installed") {
|
|
84929
84958
|
const entrypointVersion = getLatestTypesEntrypoint(ctx);
|
|
@@ -84974,16 +85003,16 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
|
|
|
84974
85003
|
warn("Failed to update `tsconfig.json`.");
|
|
84975
85004
|
}
|
|
84976
85005
|
}
|
|
84977
|
-
async function installWorkersTypes(
|
|
85006
|
+
async function installWorkersTypes(npm24) {
|
|
84978
85007
|
await installPackages(["@cloudflare/workers-types"], {
|
|
84979
85008
|
dev: true,
|
|
84980
85009
|
startText: "Installing @cloudflare/workers-types",
|
|
84981
|
-
doneText: `${brandColor("installed")} ${dim(`via ${
|
|
85010
|
+
doneText: `${brandColor("installed")} ${dim(`via ${npm24}`)}`
|
|
84982
85011
|
});
|
|
84983
85012
|
}
|
|
84984
85013
|
|
|
84985
85014
|
// src/cli.ts
|
|
84986
|
-
var { npm:
|
|
85015
|
+
var { npm: npm23 } = detectPackageManager();
|
|
84987
85016
|
var main = async (argv) => {
|
|
84988
85017
|
const result = await parseArgs(argv);
|
|
84989
85018
|
if (result.type === "unknown") {
|
|
@@ -85019,10 +85048,10 @@ ${result.errorMessage}`);
|
|
|
85019
85048
|
};
|
|
85020
85049
|
var runLatest = async () => {
|
|
85021
85050
|
const args = process.argv.slice(2);
|
|
85022
|
-
if (
|
|
85051
|
+
if (npm23 === "npm") {
|
|
85023
85052
|
args.unshift("--");
|
|
85024
85053
|
}
|
|
85025
|
-
await runCommand([
|
|
85054
|
+
await runCommand([npm23, "create", "cloudflare@latest", ...args]);
|
|
85026
85055
|
};
|
|
85027
85056
|
var runCli = async (args) => {
|
|
85028
85057
|
printBanner(args);
|
|
@@ -85061,7 +85090,7 @@ var create = async (ctx) => {
|
|
|
85061
85090
|
};
|
|
85062
85091
|
var configure15 = async (ctx) => {
|
|
85063
85092
|
startSection(
|
|
85064
|
-
|
|
85093
|
+
`Configuring your application for Cloudflare${ctx.args.experimental ? ` via \`wrangler setup\`` : ""}`,
|
|
85065
85094
|
"Step 2 of 3"
|
|
85066
85095
|
);
|
|
85067
85096
|
await installWrangler();
|