create-cloudflare 2.57.1 → 2.58.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 +224 -266
- package/package.json +3 -3
- package/templates/common/ts/tsconfig.json +2 -2
- package/templates/hello-world/ts/tsconfig.json +2 -2
- package/templates/hello-world-durable-object/ts/tsconfig.json +2 -2
- package/templates/hello-world-durable-object-with-assets/ts/tsconfig.json +2 -2
- package/templates/hello-world-with-assets/ts/tsconfig.json +2 -2
- package/templates/hello-world-workflows/ts/tsconfig.json +2 -2
- package/templates/openapi/ts/tsconfig.json +2 -2
- package/templates/queues/ts/tsconfig.json +2 -2
- package/templates/qwik/pages/c3.ts +0 -35
- package/templates/qwik/workers/c3.ts +0 -35
- package/templates/react-router/c3.ts +7 -3
- package/templates/scheduled/ts/tsconfig.json +2 -2
- package/templates/vike/c3.ts +28 -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 config47(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 config47 = 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: config47, 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 config47 = 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: config47, 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 config47 = 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: config47, 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 config47 = (0, _lodash["default"])(options, this.config);
|
|
36183
|
+
if (config47.tokenHex === true) {
|
|
36184
|
+
config47.tokenChars = "0123456789abcdef";
|
|
36185
36185
|
}
|
|
36186
36186
|
var adjective = this._randomElement(this.adjectives);
|
|
36187
36187
|
var noun = this._randomElement(this.nouns);
|
|
36188
|
-
if (!
|
|
36188
|
+
if (!config47.tokenLength) config47.tokenLength = 0;
|
|
36189
36189
|
var token = "";
|
|
36190
|
-
for (var i = 0; i <
|
|
36191
|
-
token += this._randomElement(
|
|
36190
|
+
for (var i = 0; i < config47.tokenLength; i++) {
|
|
36191
|
+
token += this._randomElement(config47.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(config47.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, config47) {
|
|
42372
42372
|
this.errorHandler = new error_handler_1.ErrorHandler();
|
|
42373
|
-
this.errorHandler.tolerant =
|
|
42373
|
+
this.errorHandler.tolerant = config47 ? typeof config47.tolerant === "boolean" && config47.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 = config47 ? typeof config47.comment === "boolean" && config47.comment : false;
|
|
42376
|
+
this.trackRange = config47 ? typeof config47.range === "boolean" && config47.range : false;
|
|
42377
|
+
this.trackLoc = config47 ? typeof config47.loc === "boolean" && config47.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(config47) {
|
|
52464
52464
|
assert_1.default.ok(this instanceof Printer2);
|
|
52465
|
-
var explicitTabWidth =
|
|
52466
|
-
|
|
52467
|
-
|
|
52465
|
+
var explicitTabWidth = config47 && config47.tabWidth;
|
|
52466
|
+
config47 = options_1.normalize(config47);
|
|
52467
|
+
config47.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 = config47.tabWidth;
|
|
52483
52483
|
if (!explicitTabWidth) {
|
|
52484
52484
|
var loc = path6.getNode().loc;
|
|
52485
52485
|
if (loc && loc.lines && loc.lines.guessTabWidth) {
|
|
52486
|
-
|
|
52486
|
+
config47.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, config47, options, makePrintFunctionWith(options, {
|
|
52501
52501
|
includeComments: true,
|
|
52502
52502
|
avoidRootParens: false
|
|
52503
52503
|
}));
|
|
52504
|
-
|
|
52504
|
+
config47.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(config47), util.composeSourceMaps(config47.inputSourceMap, lines.getSourceMap(config47.sourceMapName, config47.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, config47, {
|
|
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 = config47.reuseWhitespace;
|
|
52531
|
+
config47.reuseWhitespace = false;
|
|
52532
|
+
var pr = new PrintResult(printGenerically(path6).toString(config47));
|
|
52533
|
+
config47.reuseWhitespace = oldReuseWhitespace;
|
|
52534
52534
|
return pr;
|
|
52535
52535
|
};
|
|
52536
52536
|
};
|
|
52537
52537
|
exports2.Printer = Printer;
|
|
52538
|
-
function genericPrint(path6,
|
|
52538
|
+
function genericPrint(path6, config47, 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, config47, 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 = (config47, value) => {
|
|
72123
|
+
const { question, label } = config47;
|
|
72124
|
+
if (config47.type !== "confirm" && !value) {
|
|
72125
72125
|
return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
|
|
72126
72126
|
}
|
|
72127
|
-
const content =
|
|
72127
|
+
const content = config47.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 = (config47) => {
|
|
72131
|
+
switch (config47.type) {
|
|
72132
72132
|
case "select":
|
|
72133
|
-
return getSelectRenderers(
|
|
72133
|
+
return getSelectRenderers(config47);
|
|
72134
72134
|
case "confirm":
|
|
72135
|
-
return getConfirmRenderers(
|
|
72135
|
+
return getConfirmRenderers(config47);
|
|
72136
72136
|
case "text":
|
|
72137
|
-
return getTextRenderers(
|
|
72137
|
+
return getTextRenderers(config47);
|
|
72138
72138
|
case "multiselect":
|
|
72139
|
-
return getSelectRenderers(
|
|
72139
|
+
return getSelectRenderers(config47);
|
|
72140
72140
|
case "list":
|
|
72141
|
-
return getSelectListRenderers(
|
|
72141
|
+
return getSelectListRenderers(config47);
|
|
72142
72142
|
}
|
|
72143
72143
|
};
|
|
72144
|
-
var getTextRenderers = (
|
|
72145
|
-
const { question } =
|
|
72146
|
-
const helpText =
|
|
72147
|
-
const format5 =
|
|
72148
|
-
const defaultValue =
|
|
72144
|
+
var getTextRenderers = (config47) => {
|
|
72145
|
+
const { question } = config47;
|
|
72146
|
+
const helpText = config47.helpText ?? "";
|
|
72147
|
+
const format5 = config47.format ?? ((val) => String(val));
|
|
72148
|
+
const defaultValue = config47.defaultValue?.toString() ?? "";
|
|
72149
72149
|
const activeRenderer = (props) => {
|
|
72150
72150
|
const { valueWithCursor } = props;
|
|
72151
72151
|
return [
|
|
@@ -72171,14 +72171,14 @@ var getTextRenderers = (config46) => {
|
|
|
72171
72171
|
``
|
|
72172
72172
|
// extra line for readability
|
|
72173
72173
|
],
|
|
72174
|
-
submit: ({ value }) => renderSubmit(
|
|
72174
|
+
submit: ({ value }) => renderSubmit(config47, format5(value ?? "")),
|
|
72175
72175
|
cancel: activeRenderer
|
|
72176
72176
|
};
|
|
72177
72177
|
};
|
|
72178
|
-
var getSelectRenderers = (
|
|
72179
|
-
const { options, question, helpText: _helpText } =
|
|
72178
|
+
var getSelectRenderers = (config47) => {
|
|
72179
|
+
const { options, question, helpText: _helpText } = config47;
|
|
72180
72180
|
const helpText = _helpText ?? "";
|
|
72181
|
-
const maxItemsPerPage =
|
|
72181
|
+
const maxItemsPerPage = config47.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
|
+
config47,
|
|
72257
72257
|
options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
|
|
72258
72258
|
);
|
|
72259
72259
|
}
|
|
72260
72260
|
return renderSubmit(
|
|
72261
|
-
|
|
72261
|
+
config47,
|
|
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 = (config47) => {
|
|
72269
|
+
const { question, helpText: _helpText } = config47;
|
|
72270
|
+
let options = config47.options;
|
|
72271
72271
|
const helpText = _helpText ?? "";
|
|
72272
72272
|
const { rows } = stdout;
|
|
72273
72273
|
const defaultRenderer = ({ cursor, value }, prompt) => {
|
|
@@ -72348,20 +72348,20 @@ var getSelectListRenderers = (config46) => {
|
|
|
72348
72348
|
submit: ({ value }) => {
|
|
72349
72349
|
if (Array.isArray(value)) {
|
|
72350
72350
|
return renderSubmit(
|
|
72351
|
-
|
|
72351
|
+
config47,
|
|
72352
72352
|
options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
|
|
72353
72353
|
);
|
|
72354
72354
|
}
|
|
72355
72355
|
return renderSubmit(
|
|
72356
|
-
|
|
72356
|
+
config47,
|
|
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 = (config47) => {
|
|
72364
|
+
const { activeText, inactiveText, question, helpText: _helpText } = config47;
|
|
72365
72365
|
const helpText = _helpText ?? "";
|
|
72366
72366
|
const active = activeText || "Yes";
|
|
72367
72367
|
const inactive = inactiveText || "No";
|
|
@@ -72378,7 +72378,7 @@ var getConfirmRenderers = (config46) => {
|
|
|
72378
72378
|
active: defaultRenderer,
|
|
72379
72379
|
confirm: defaultRenderer,
|
|
72380
72380
|
error: defaultRenderer,
|
|
72381
|
-
submit: ({ value }) => renderSubmit(
|
|
72381
|
+
submit: ({ value }) => renderSubmit(config47, 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 config47 = 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
|
+
config47 = resolveConfig(resolvedConfigPath);
|
|
73355
73355
|
} catch (e) {
|
|
73356
|
-
|
|
73356
|
+
config47 = e;
|
|
73357
73357
|
}
|
|
73358
|
-
if (
|
|
73359
|
-
error2 =
|
|
73358
|
+
if (config47 instanceof Error) {
|
|
73359
|
+
error2 = config47;
|
|
73360
73360
|
return;
|
|
73361
73361
|
}
|
|
73362
73362
|
} else {
|
|
73363
|
-
|
|
73363
|
+
config47 = mixin2.require(resolvedConfigPath);
|
|
73364
73364
|
}
|
|
73365
|
-
setConfigObject(
|
|
73365
|
+
setConfigObject(config47);
|
|
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(config47, prev) {
|
|
73376
|
+
Object.keys(config47).forEach(function(key) {
|
|
73377
|
+
const value = config47[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 config47 = 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: config47
|
|
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(config47, 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(config47, "extends")) {
|
|
75760
|
+
if (typeof config47.extends !== "string")
|
|
75761
75761
|
return defaultConfig;
|
|
75762
|
-
const isPath = /\.json|\..*rc$/.test(
|
|
75762
|
+
const isPath = /\.json|\..*rc$/.test(config47.extends);
|
|
75763
75763
|
let pathToDefault = null;
|
|
75764
75764
|
if (!isPath) {
|
|
75765
75765
|
try {
|
|
75766
|
-
pathToDefault = require.resolve(
|
|
75766
|
+
pathToDefault = require.resolve(config47.extends);
|
|
75767
75767
|
} catch (_err) {
|
|
75768
|
-
return
|
|
75768
|
+
return config47;
|
|
75769
75769
|
}
|
|
75770
75770
|
} else {
|
|
75771
|
-
pathToDefault = getPathToDefaultConfig(cwd,
|
|
75771
|
+
pathToDefault = getPathToDefaultConfig(cwd, config47.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(config47.extends);
|
|
75776
|
+
delete config47.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, config47) : Object.assign({}, defaultConfig, config47);
|
|
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(config47) {
|
|
76557
|
+
argsert("<object>", [config47], arguments.length);
|
|
76558
|
+
__classPrivateFieldSet(this, _YargsInstance_parserConfig, config47, "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(config47) {
|
|
76731
|
+
argsert("<object>", [config47], arguments.length);
|
|
76732
|
+
__classPrivateFieldSet(this, _YargsInstance_usageConfig, config47, "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 config47 = 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, ...config47 }
|
|
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.58.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(config47) {
|
|
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
|
+
config47,
|
|
77355
77355
|
(_key, value) => value instanceof Date ? value.toISOString() : value,
|
|
77356
77356
|
" "
|
|
77357
77357
|
)
|
|
@@ -77359,9 +77359,9 @@ function writeMetricsConfig(config46) {
|
|
|
77359
77359
|
}
|
|
77360
77360
|
function readMetricsConfig() {
|
|
77361
77361
|
try {
|
|
77362
|
-
const
|
|
77362
|
+
const config47 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
|
|
77363
77363
|
return JSON.parse(
|
|
77364
|
-
|
|
77364
|
+
config47,
|
|
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(config47) {
|
|
77375
|
+
const deviceId = config47.deviceId ?? (0, import_node_crypto.randomUUID)();
|
|
77376
|
+
if (config47.deviceId === void 0) {
|
|
77377
|
+
writeMetricsConfig({ ...config47, deviceId });
|
|
77378
77378
|
}
|
|
77379
77379
|
return deviceId;
|
|
77380
77380
|
}
|
|
@@ -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 config47 = readMetricsConfig() ?? {};
|
|
77682
|
+
const isFirstUsage = config47.c3permission === void 0;
|
|
77683
77683
|
const isEnabled = isTelemetryEnabled();
|
|
77684
|
-
const deviceId = getDeviceId(
|
|
77684
|
+
const deviceId = getDeviceId(config47);
|
|
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(config47).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(config47 = readMetricsConfig() ?? {}) {
|
|
77824
|
+
if (!config47.c3permission) {
|
|
77825
|
+
config47.c3permission = initializeC3Permission();
|
|
77826
|
+
writeMetricsConfig(config47);
|
|
77827
77827
|
}
|
|
77828
|
-
return
|
|
77828
|
+
return config47.c3permission;
|
|
77829
77829
|
}
|
|
77830
77830
|
function updateC3Pemission(enabled) {
|
|
77831
|
-
const
|
|
77832
|
-
if (
|
|
77831
|
+
const config47 = readMetricsConfig();
|
|
77832
|
+
if (config47.c3permission?.enabled === enabled) {
|
|
77833
77833
|
return;
|
|
77834
77834
|
}
|
|
77835
|
-
|
|
77836
|
-
writeMetricsConfig(
|
|
77835
|
+
config47.c3permission = initializeC3Permission(enabled);
|
|
77836
|
+
writeMetricsConfig(config47);
|
|
77837
77837
|
}
|
|
77838
77838
|
var runTelemetryCommand = (action) => {
|
|
77839
77839
|
const logTelemetryStatus = (enabled) => {
|
|
@@ -78785,7 +78785,7 @@ var hasTsConfig = (path6) => {
|
|
|
78785
78785
|
};
|
|
78786
78786
|
|
|
78787
78787
|
// src/helpers/packages.ts
|
|
78788
|
-
var installPackages = async (packages,
|
|
78788
|
+
var installPackages = async (packages, config47 = {}) => {
|
|
78789
78789
|
if (packages.length === 0) {
|
|
78790
78790
|
return;
|
|
78791
78791
|
}
|
|
@@ -78795,39 +78795,27 @@ var installPackages = async (packages, config46 = {}) => {
|
|
|
78795
78795
|
switch (npm24) {
|
|
78796
78796
|
case "yarn":
|
|
78797
78797
|
cmd = "add";
|
|
78798
|
-
saveFlag =
|
|
78798
|
+
saveFlag = config47.dev ? "-D" : "";
|
|
78799
78799
|
break;
|
|
78800
78800
|
case "bun":
|
|
78801
78801
|
cmd = "add";
|
|
78802
|
-
saveFlag =
|
|
78802
|
+
saveFlag = config47.dev ? "-d" : "";
|
|
78803
78803
|
break;
|
|
78804
78804
|
case "npm":
|
|
78805
78805
|
case "pnpm":
|
|
78806
78806
|
default:
|
|
78807
78807
|
cmd = "install";
|
|
78808
|
-
saveFlag =
|
|
78808
|
+
saveFlag = config47.dev ? "--save-dev" : "";
|
|
78809
78809
|
break;
|
|
78810
78810
|
}
|
|
78811
|
-
await runCommand(
|
|
78812
|
-
|
|
78813
|
-
|
|
78814
|
-
|
|
78815
|
-
...saveFlag ? [saveFlag] : [],
|
|
78816
|
-
...packages,
|
|
78817
|
-
// Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
|
|
78818
|
-
// frameworks that haven't updated their peer dependency for Wrangler v4
|
|
78819
|
-
// TODO: Remove this once Wrangler v4 has been released and framework templates are updated
|
|
78820
|
-
...npm24 === "npm" ? ["--legacy-peer-deps"] : []
|
|
78821
|
-
],
|
|
78822
|
-
{
|
|
78823
|
-
...config46,
|
|
78824
|
-
silent: true
|
|
78825
|
-
}
|
|
78826
|
-
);
|
|
78811
|
+
await runCommand([npm24, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
|
|
78812
|
+
...config47,
|
|
78813
|
+
silent: true
|
|
78814
|
+
});
|
|
78827
78815
|
if (npm24 === "npm") {
|
|
78828
78816
|
const pkgJsonPath = import_node_path5.default.join(process.cwd(), "package.json");
|
|
78829
78817
|
const pkgJson = readJSON(pkgJsonPath);
|
|
78830
|
-
const deps =
|
|
78818
|
+
const deps = config47.dev ? pkgJson.devDependencies : pkgJson.dependencies;
|
|
78831
78819
|
(0, import_node_assert2.default)(deps, "dependencies should be defined");
|
|
78832
78820
|
for (const pkg of packages) {
|
|
78833
78821
|
const versionMarker = pkg.lastIndexOf("@");
|
|
@@ -78848,17 +78836,11 @@ var npmInstall = async (ctx) => {
|
|
|
78848
78836
|
return;
|
|
78849
78837
|
}
|
|
78850
78838
|
const { npm: npm24 } = detectPackageManager();
|
|
78851
|
-
await runCommand(
|
|
78852
|
-
|
|
78853
|
-
|
|
78854
|
-
|
|
78855
|
-
|
|
78856
|
-
{
|
|
78857
|
-
silent: true,
|
|
78858
|
-
startText: "Installing dependencies",
|
|
78859
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
|
|
78860
|
-
}
|
|
78861
|
-
);
|
|
78839
|
+
await runCommand([npm24, "install"], {
|
|
78840
|
+
silent: true,
|
|
78841
|
+
startText: "Installing dependencies",
|
|
78842
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
|
|
78843
|
+
});
|
|
78862
78844
|
};
|
|
78863
78845
|
async function getLatestPackageVersion(packageSpecifier) {
|
|
78864
78846
|
const resp = await (0, import_undici2.fetch)(`https://registry.npmjs.org/${packageSpecifier}`);
|
|
@@ -78942,6 +78924,7 @@ var package_default = {
|
|
|
78942
78924
|
"create-rwsdk": "3.1.0",
|
|
78943
78925
|
"create-react-router": "7.9.6",
|
|
78944
78926
|
"create-solid": "0.6.11",
|
|
78927
|
+
"create-vike": "0.0.528",
|
|
78945
78928
|
"create-vue": "3.18.3",
|
|
78946
78929
|
"create-waku": "0.12.5-0.27.1-0",
|
|
78947
78930
|
"@tanstack/create-start": "0.40.0",
|
|
@@ -80372,7 +80355,6 @@ var configure8 = async (ctx) => {
|
|
|
80372
80355
|
endSection(`Running ${quoteShellArgs(cmd)}`);
|
|
80373
80356
|
await runCommand(cmd);
|
|
80374
80357
|
addBindingsProxy(ctx);
|
|
80375
|
-
populateCloudflareEnv();
|
|
80376
80358
|
};
|
|
80377
80359
|
var addBindingsProxy = (ctx) => {
|
|
80378
80360
|
if (!usesTypescript(ctx)) {
|
|
@@ -80417,33 +80399,6 @@ var addBindingsProxy = (ctx) => {
|
|
|
80417
80399
|
});
|
|
80418
80400
|
s.stop(`${brandColor("updated")} \`vite.config.ts\``);
|
|
80419
80401
|
};
|
|
80420
|
-
var populateCloudflareEnv = () => {
|
|
80421
|
-
const entrypointPath = "src/entry.cloudflare-pages.tsx";
|
|
80422
|
-
const s = spinner();
|
|
80423
|
-
s.start(`Updating \`${entrypointPath}\``);
|
|
80424
|
-
transformFile(entrypointPath, {
|
|
80425
|
-
visitTSInterfaceDeclaration: function(n) {
|
|
80426
|
-
const b3 = recast7.types.builders;
|
|
80427
|
-
const id = n.node.id;
|
|
80428
|
-
if (id.name !== "QwikCityPlatform") {
|
|
80429
|
-
this.traverse(n);
|
|
80430
|
-
}
|
|
80431
|
-
const newBody = [
|
|
80432
|
-
["env", "Env"]
|
|
80433
|
-
// Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
|
|
80434
|
-
// ["cf", "CfProperties"],
|
|
80435
|
-
].map(
|
|
80436
|
-
([varName, type]) => b3.tsPropertySignature(
|
|
80437
|
-
b3.identifier(varName),
|
|
80438
|
-
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
|
|
80439
|
-
)
|
|
80440
|
-
);
|
|
80441
|
-
n.node.body.body = newBody;
|
|
80442
|
-
return false;
|
|
80443
|
-
}
|
|
80444
|
-
});
|
|
80445
|
-
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
80446
|
-
};
|
|
80447
80402
|
var config28 = {
|
|
80448
80403
|
configVersion: 1,
|
|
80449
80404
|
id: "qwik",
|
|
@@ -80483,7 +80438,6 @@ var configure9 = async (ctx) => {
|
|
|
80483
80438
|
await runCommand(cmd);
|
|
80484
80439
|
removeFile("./public/_routes.json");
|
|
80485
80440
|
addBindingsProxy2(ctx);
|
|
80486
|
-
populateCloudflareEnv2();
|
|
80487
80441
|
};
|
|
80488
80442
|
var addBindingsProxy2 = (ctx) => {
|
|
80489
80443
|
if (!usesTypescript(ctx)) {
|
|
@@ -80528,33 +80482,6 @@ var addBindingsProxy2 = (ctx) => {
|
|
|
80528
80482
|
});
|
|
80529
80483
|
s.stop(`${brandColor("updated")} \`vite.config.ts\``);
|
|
80530
80484
|
};
|
|
80531
|
-
var populateCloudflareEnv2 = () => {
|
|
80532
|
-
const entrypointPath = "src/entry.cloudflare-pages.tsx";
|
|
80533
|
-
const s = spinner();
|
|
80534
|
-
s.start(`Updating \`${entrypointPath}\``);
|
|
80535
|
-
transformFile(entrypointPath, {
|
|
80536
|
-
visitTSInterfaceDeclaration: function(n) {
|
|
80537
|
-
const b3 = recast8.types.builders;
|
|
80538
|
-
const id = n.node.id;
|
|
80539
|
-
if (id.name !== "QwikCityPlatform") {
|
|
80540
|
-
this.traverse(n);
|
|
80541
|
-
}
|
|
80542
|
-
const newBody = [
|
|
80543
|
-
["env", "Env"]
|
|
80544
|
-
// Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
|
|
80545
|
-
// ["cf", "CfProperties"],
|
|
80546
|
-
].map(
|
|
80547
|
-
([varName, type]) => b3.tsPropertySignature(
|
|
80548
|
-
b3.identifier(varName),
|
|
80549
|
-
b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
|
|
80550
|
-
)
|
|
80551
|
-
);
|
|
80552
|
-
n.node.body.body = newBody;
|
|
80553
|
-
return false;
|
|
80554
|
-
}
|
|
80555
|
-
});
|
|
80556
|
-
s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
|
|
80557
|
-
};
|
|
80558
80485
|
var config29 = {
|
|
80559
80486
|
configVersion: 1,
|
|
80560
80487
|
id: "qwik",
|
|
@@ -80593,9 +80520,11 @@ var { npm: npm12 } = detectPackageManager();
|
|
|
80593
80520
|
var generate17 = async (ctx) => {
|
|
80594
80521
|
await runFrameworkGenerator(ctx, [
|
|
80595
80522
|
ctx.project.name,
|
|
80596
|
-
|
|
80597
|
-
|
|
80598
|
-
|
|
80523
|
+
...ctx.args.experimental ? [] : [
|
|
80524
|
+
"--template",
|
|
80525
|
+
// React-router deleted the template here
|
|
80526
|
+
"https://github.com/remix-run/react-router-templates/tree/29ac272b9532fe26463a2d2693fc73ff3c1e884b/cloudflare"
|
|
80527
|
+
],
|
|
80599
80528
|
// to prevent asking about git twice, just let c3 do it
|
|
80600
80529
|
"--no-git-init",
|
|
80601
80530
|
"--no-install"
|
|
@@ -80733,9 +80662,9 @@ function transformViteConfig(ctx) {
|
|
|
80733
80662
|
if (callee.name !== "defineConfig") {
|
|
80734
80663
|
return this.traverse(n);
|
|
80735
80664
|
}
|
|
80736
|
-
const
|
|
80737
|
-
(0, import_node_assert3.default)(t.ObjectExpression.check(
|
|
80738
|
-
const pluginsProp =
|
|
80665
|
+
const config47 = n.node.arguments[0];
|
|
80666
|
+
(0, import_node_assert3.default)(t.ObjectExpression.check(config47));
|
|
80667
|
+
const pluginsProp = config47.properties.find((prop) => isPluginsProp(prop));
|
|
80739
80668
|
(0, import_node_assert3.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
|
|
80740
80669
|
pluginsProp.value.elements.push(
|
|
80741
80670
|
b2.callExpression(b2.identifier("cloudflare"), [])
|
|
@@ -81256,12 +81185,35 @@ var config41 = {
|
|
|
81256
81185
|
};
|
|
81257
81186
|
var c3_default44 = config41;
|
|
81258
81187
|
|
|
81188
|
+
// templates/vike/c3.ts
|
|
81189
|
+
var generate25 = async (ctx) => {
|
|
81190
|
+
await runFrameworkGenerator(ctx, [
|
|
81191
|
+
ctx.project.name,
|
|
81192
|
+
"--cloudflare",
|
|
81193
|
+
// to prevent asking about git twice, just let c3 do it
|
|
81194
|
+
"--no-git"
|
|
81195
|
+
]);
|
|
81196
|
+
logRaw("");
|
|
81197
|
+
};
|
|
81198
|
+
var config42 = {
|
|
81199
|
+
configVersion: 1,
|
|
81200
|
+
id: "vike",
|
|
81201
|
+
platform: "workers",
|
|
81202
|
+
frameworkCli: "create-vike",
|
|
81203
|
+
displayName: "Vike",
|
|
81204
|
+
generate: generate25,
|
|
81205
|
+
devScript: "dev",
|
|
81206
|
+
deployScript: "deploy",
|
|
81207
|
+
previewScript: "preview"
|
|
81208
|
+
};
|
|
81209
|
+
var c3_default45 = config42;
|
|
81210
|
+
|
|
81259
81211
|
// templates/vue/pages/c3.ts
|
|
81260
81212
|
var { npm: npm20 } = detectPackageManager();
|
|
81261
|
-
var
|
|
81213
|
+
var generate26 = async (ctx) => {
|
|
81262
81214
|
await runFrameworkGenerator(ctx, [ctx.project.name]);
|
|
81263
81215
|
};
|
|
81264
|
-
var
|
|
81216
|
+
var config43 = {
|
|
81265
81217
|
configVersion: 1,
|
|
81266
81218
|
id: "vue",
|
|
81267
81219
|
frameworkCli: "create-vue",
|
|
@@ -81270,7 +81222,7 @@ var config42 = {
|
|
|
81270
81222
|
hidden: true,
|
|
81271
81223
|
path: "templates/vue/pages",
|
|
81272
81224
|
copyFiles: { path: "./templates" },
|
|
81273
|
-
generate:
|
|
81225
|
+
generate: generate26,
|
|
81274
81226
|
transformPackageJson: async () => ({
|
|
81275
81227
|
scripts: {
|
|
81276
81228
|
deploy: `${npm20} run build && wrangler pages deploy`,
|
|
@@ -81282,11 +81234,11 @@ var config42 = {
|
|
|
81282
81234
|
deployScript: "deploy",
|
|
81283
81235
|
previewScript: "preview"
|
|
81284
81236
|
};
|
|
81285
|
-
var
|
|
81237
|
+
var c3_default46 = config43;
|
|
81286
81238
|
|
|
81287
81239
|
// templates/vue/workers/c3.ts
|
|
81288
81240
|
var { npm: npm21 } = detectPackageManager();
|
|
81289
|
-
var
|
|
81241
|
+
var generate27 = async (ctx) => {
|
|
81290
81242
|
const lang = ctx.args.lang ?? await inputPrompt({
|
|
81291
81243
|
type: "select",
|
|
81292
81244
|
question: "Would you like to use TypeScript?",
|
|
@@ -81324,7 +81276,7 @@ function updateTsconfigJson2() {
|
|
|
81324
81276
|
writeJSON("tsconfig.json", tsconfig);
|
|
81325
81277
|
s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
|
|
81326
81278
|
}
|
|
81327
|
-
var
|
|
81279
|
+
var config44 = {
|
|
81328
81280
|
configVersion: 1,
|
|
81329
81281
|
id: "vue",
|
|
81330
81282
|
frameworkCli: "create-vue",
|
|
@@ -81345,7 +81297,7 @@ var config43 = {
|
|
|
81345
81297
|
}
|
|
81346
81298
|
},
|
|
81347
81299
|
configure: configure14,
|
|
81348
|
-
generate:
|
|
81300
|
+
generate: generate27,
|
|
81349
81301
|
transformPackageJson: async (_3, ctx) => ({
|
|
81350
81302
|
scripts: {
|
|
81351
81303
|
deploy: `${npm21} run build && wrangler deploy`,
|
|
@@ -81357,18 +81309,18 @@ var config43 = {
|
|
|
81357
81309
|
deployScript: "deploy",
|
|
81358
81310
|
previewScript: "preview"
|
|
81359
81311
|
};
|
|
81360
|
-
var
|
|
81312
|
+
var c3_default47 = config44;
|
|
81361
81313
|
|
|
81362
81314
|
// templates/vue/c3.ts
|
|
81363
|
-
var
|
|
81315
|
+
var config45 = {
|
|
81364
81316
|
displayName: "Vue",
|
|
81365
|
-
platformVariants: { pages:
|
|
81317
|
+
platformVariants: { pages: c3_default46, workers: c3_default47 }
|
|
81366
81318
|
};
|
|
81367
|
-
var
|
|
81319
|
+
var c3_default48 = config45;
|
|
81368
81320
|
|
|
81369
81321
|
// templates/waku/c3.ts
|
|
81370
81322
|
var { npm: npm22 } = detectPackageManager();
|
|
81371
|
-
var
|
|
81323
|
+
var generate28 = async (ctx) => {
|
|
81372
81324
|
await runFrameworkGenerator(ctx, [
|
|
81373
81325
|
"--project-name",
|
|
81374
81326
|
ctx.project.name,
|
|
@@ -81376,14 +81328,14 @@ var generate27 = async (ctx) => {
|
|
|
81376
81328
|
"07_cloudflare"
|
|
81377
81329
|
]);
|
|
81378
81330
|
};
|
|
81379
|
-
var
|
|
81331
|
+
var config46 = {
|
|
81380
81332
|
configVersion: 1,
|
|
81381
81333
|
id: "waku",
|
|
81382
81334
|
frameworkCli: "create-waku",
|
|
81383
81335
|
platform: "workers",
|
|
81384
81336
|
displayName: "Waku",
|
|
81385
81337
|
path: "templates/waku",
|
|
81386
|
-
generate:
|
|
81338
|
+
generate: generate28,
|
|
81387
81339
|
transformPackageJson: async () => ({
|
|
81388
81340
|
scripts: {
|
|
81389
81341
|
deploy: `${npm22} run build && wrangler deploy`,
|
|
@@ -81394,13 +81346,13 @@ var config45 = {
|
|
|
81394
81346
|
deployScript: "deploy",
|
|
81395
81347
|
previewScript: "preview"
|
|
81396
81348
|
};
|
|
81397
|
-
var
|
|
81349
|
+
var c3_default49 = config46;
|
|
81398
81350
|
|
|
81399
81351
|
// src/git.ts
|
|
81400
81352
|
var import_node_assert4 = __toESM(require("node:assert"));
|
|
81401
81353
|
|
|
81402
81354
|
// ../wrangler/package.json
|
|
81403
|
-
var version2 = "4.
|
|
81355
|
+
var version2 = "4.53.0";
|
|
81404
81356
|
|
|
81405
81357
|
// src/git.ts
|
|
81406
81358
|
var offerGit = async (ctx) => {
|
|
@@ -81658,8 +81610,8 @@ var isAllowedExistingFile = (file) => {
|
|
|
81658
81610
|
var defaultSelectVariant = async (ctx) => {
|
|
81659
81611
|
return ctx.args.lang;
|
|
81660
81612
|
};
|
|
81661
|
-
var templateSupportsLanguage = (
|
|
81662
|
-
const { copyFiles } =
|
|
81613
|
+
var templateSupportsLanguage = (config47, lang) => {
|
|
81614
|
+
const { copyFiles } = config47;
|
|
81663
81615
|
if (!copyFiles || isVariantInfo(copyFiles)) {
|
|
81664
81616
|
return false;
|
|
81665
81617
|
}
|
|
@@ -81673,24 +81625,29 @@ var filterTemplatesByLanguage = (templates, lang) => {
|
|
|
81673
81625
|
return templates;
|
|
81674
81626
|
}
|
|
81675
81627
|
return Object.fromEntries(
|
|
81676
|
-
Object.entries(templates).filter(([,
|
|
81677
|
-
if ("platformVariants" in
|
|
81678
|
-
return templateSupportsLanguage(
|
|
81628
|
+
Object.entries(templates).filter(([, config47]) => {
|
|
81629
|
+
if ("platformVariants" in config47) {
|
|
81630
|
+
return templateSupportsLanguage(config47.platformVariants.pages, lang) || templateSupportsLanguage(config47.platformVariants.workers, lang);
|
|
81679
81631
|
}
|
|
81680
|
-
return templateSupportsLanguage(
|
|
81632
|
+
return templateSupportsLanguage(config47, lang);
|
|
81681
81633
|
})
|
|
81682
81634
|
);
|
|
81683
81635
|
};
|
|
81684
81636
|
function getFrameworkMap({ experimental = false }) {
|
|
81685
81637
|
if (experimental) {
|
|
81686
81638
|
return {
|
|
81639
|
+
angular: c3_default4,
|
|
81640
|
+
astro: c3_default7,
|
|
81641
|
+
docusaurus: c3_default11,
|
|
81687
81642
|
gatsby: c3_default14,
|
|
81643
|
+
nuxt: c3_default27,
|
|
81644
|
+
qwik: c3_default33,
|
|
81645
|
+
react: c3_default37,
|
|
81646
|
+
"react-router": c3_default34,
|
|
81647
|
+
solid: c3_default40,
|
|
81688
81648
|
svelte: c3_default43,
|
|
81689
|
-
docusaurus: c3_default11,
|
|
81690
|
-
astro: c3_default7,
|
|
81691
81649
|
"tanstack-start": c3_default44,
|
|
81692
|
-
|
|
81693
|
-
solid: c3_default40
|
|
81650
|
+
vue: c3_default48
|
|
81694
81651
|
};
|
|
81695
81652
|
} else {
|
|
81696
81653
|
return {
|
|
@@ -81709,8 +81666,9 @@ function getFrameworkMap({ experimental = false }) {
|
|
|
81709
81666
|
solid: c3_default40,
|
|
81710
81667
|
svelte: c3_default43,
|
|
81711
81668
|
"tanstack-start": c3_default44,
|
|
81712
|
-
|
|
81713
|
-
|
|
81669
|
+
vike: c3_default45,
|
|
81670
|
+
vue: c3_default48,
|
|
81671
|
+
waku: c3_default49
|
|
81714
81672
|
};
|
|
81715
81673
|
}
|
|
81716
81674
|
}
|
|
@@ -81914,10 +81872,10 @@ var createContext = async (args, prevArgs) => {
|
|
|
81914
81872
|
let template;
|
|
81915
81873
|
if (category === "web-framework") {
|
|
81916
81874
|
const frameworkOptions = Object.entries(frameworkMap).reduce(
|
|
81917
|
-
(acc, [key,
|
|
81918
|
-
if (!
|
|
81875
|
+
(acc, [key, config47]) => {
|
|
81876
|
+
if (!config47.hidden || args.framework) {
|
|
81919
81877
|
acc.push({
|
|
81920
|
-
label:
|
|
81878
|
+
label: config47.displayName,
|
|
81921
81879
|
value: key
|
|
81922
81880
|
});
|
|
81923
81881
|
}
|
|
@@ -81943,7 +81901,7 @@ var createContext = async (args, prevArgs) => {
|
|
|
81943
81901
|
if ("platformVariants" in frameworkConfig) {
|
|
81944
81902
|
const availableVariants = Object.entries(
|
|
81945
81903
|
frameworkConfig.platformVariants
|
|
81946
|
-
).filter(([,
|
|
81904
|
+
).filter(([, config47]) => !config47.hidden);
|
|
81947
81905
|
if (availableVariants.length === 1) {
|
|
81948
81906
|
args.platform ??= availableVariants[0][0];
|
|
81949
81907
|
}
|
|
@@ -82109,28 +82067,28 @@ var processRemoteTemplate = async (args) => {
|
|
|
82109
82067
|
src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
|
|
82110
82068
|
}
|
|
82111
82069
|
const path6 = await downloadRemoteTemplate(src, args.templateMode);
|
|
82112
|
-
const
|
|
82113
|
-
validateTemplate(path6,
|
|
82070
|
+
const config47 = inferTemplateConfig(path6);
|
|
82071
|
+
validateTemplate(path6, config47);
|
|
82114
82072
|
updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
|
|
82115
82073
|
return {
|
|
82116
82074
|
path: path6,
|
|
82117
|
-
...
|
|
82075
|
+
...config47
|
|
82118
82076
|
};
|
|
82119
82077
|
};
|
|
82120
|
-
var validateTemplate = (path6,
|
|
82121
|
-
if (!
|
|
82078
|
+
var validateTemplate = (path6, config47) => {
|
|
82079
|
+
if (!config47.copyFiles) {
|
|
82122
82080
|
return;
|
|
82123
82081
|
}
|
|
82124
|
-
if (isVariantInfo(
|
|
82125
|
-
validateTemplateSrcDirectory((0, import_node_path13.resolve)(path6,
|
|
82082
|
+
if (isVariantInfo(config47.copyFiles)) {
|
|
82083
|
+
validateTemplateSrcDirectory((0, import_node_path13.resolve)(path6, config47.copyFiles.path), config47);
|
|
82126
82084
|
} else {
|
|
82127
|
-
for (const variant of Object.values(
|
|
82128
|
-
validateTemplateSrcDirectory((0, import_node_path13.resolve)(path6, variant.path),
|
|
82085
|
+
for (const variant of Object.values(config47.copyFiles.variants)) {
|
|
82086
|
+
validateTemplateSrcDirectory((0, import_node_path13.resolve)(path6, variant.path), config47);
|
|
82129
82087
|
}
|
|
82130
82088
|
}
|
|
82131
82089
|
};
|
|
82132
|
-
var validateTemplateSrcDirectory = (path6,
|
|
82133
|
-
if (
|
|
82090
|
+
var validateTemplateSrcDirectory = (path6, config47) => {
|
|
82091
|
+
if (config47.platform === "workers") {
|
|
82134
82092
|
const wranglerTomlPath = (0, import_node_path13.resolve)(path6, "wrangler.toml");
|
|
82135
82093
|
const wranglerJsonPath = (0, import_node_path13.resolve)(path6, "wrangler.json");
|
|
82136
82094
|
const wranglerJsoncPath = (0, import_node_path13.resolve)(path6, "wrangler.jsonc");
|
|
@@ -82913,13 +82871,13 @@ var writeWranglerToml = (ctx, contents) => {
|
|
|
82913
82871
|
const wranglerTomlPath = getWranglerTomlPath(ctx);
|
|
82914
82872
|
return writeFile2(wranglerTomlPath, contents);
|
|
82915
82873
|
};
|
|
82916
|
-
var writeWranglerJson = (ctx,
|
|
82874
|
+
var writeWranglerJson = (ctx, config47) => {
|
|
82917
82875
|
const wranglerJsonPath = getWranglerJsonPath(ctx);
|
|
82918
82876
|
if ((0, import_node_fs12.existsSync)(wranglerJsonPath)) {
|
|
82919
|
-
return writeJSONWithComments(wranglerJsonPath,
|
|
82877
|
+
return writeJSONWithComments(wranglerJsonPath, config47);
|
|
82920
82878
|
}
|
|
82921
82879
|
const wranglerJsoncPath = getWranglerJsoncPath(ctx);
|
|
82922
|
-
return writeJSONWithComments(wranglerJsoncPath,
|
|
82880
|
+
return writeJSONWithComments(wranglerJsoncPath, config47);
|
|
82923
82881
|
};
|
|
82924
82882
|
var addVscodeConfig = (ctx) => {
|
|
82925
82883
|
const settingsPath = `${ctx.project.path}/.vscode/settings.json`;
|
|
@@ -82933,10 +82891,10 @@ var addVscodeConfig = (ctx) => {
|
|
|
82933
82891
|
}
|
|
82934
82892
|
});
|
|
82935
82893
|
};
|
|
82936
|
-
async function getCompatibilityDate(
|
|
82894
|
+
async function getCompatibilityDate(config47) {
|
|
82937
82895
|
const validCompatDateRe = /^\d{4}-\d{2}-\d{2}$/m;
|
|
82938
|
-
if (typeof
|
|
82939
|
-
return
|
|
82896
|
+
if (typeof config47["compatibility_date"] === "string" && config47["compatibility_date"].match(validCompatDateRe)) {
|
|
82897
|
+
return config47["compatibility_date"];
|
|
82940
82898
|
}
|
|
82941
82899
|
return await getWorkerdCompatibilityDate();
|
|
82942
82900
|
}
|
|
@@ -83480,8 +83438,8 @@ var renderValues = (values) => {
|
|
|
83480
83438
|
|
|
83481
83439
|
// src/helpers/retry.ts
|
|
83482
83440
|
var import_promises7 = require("node:timers/promises");
|
|
83483
|
-
var retry = async (
|
|
83484
|
-
let { times } =
|
|
83441
|
+
var retry = async (config47, fn) => {
|
|
83442
|
+
let { times } = config47;
|
|
83485
83443
|
let error2 = null;
|
|
83486
83444
|
while (times > 0) {
|
|
83487
83445
|
try {
|
|
@@ -83489,10 +83447,10 @@ var retry = async (config46, fn) => {
|
|
|
83489
83447
|
} catch (e) {
|
|
83490
83448
|
error2 = e;
|
|
83491
83449
|
times--;
|
|
83492
|
-
if (
|
|
83450
|
+
if (config47.exitCondition?.(e)) {
|
|
83493
83451
|
break;
|
|
83494
83452
|
}
|
|
83495
|
-
await (0, import_promises7.setTimeout)(
|
|
83453
|
+
await (0, import_promises7.setTimeout)(config47.sleepMs ?? 1e3);
|
|
83496
83454
|
}
|
|
83497
83455
|
}
|
|
83498
83456
|
throw error2;
|
|
@@ -84956,8 +84914,8 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
|
|
|
84956
84914
|
}
|
|
84957
84915
|
const tsconfig = readFile(tsconfigPath);
|
|
84958
84916
|
try {
|
|
84959
|
-
const
|
|
84960
|
-
const currentTypes =
|
|
84917
|
+
const config47 = parse6(tsconfig);
|
|
84918
|
+
const currentTypes = config47.compilerOptions?.types ?? [];
|
|
84961
84919
|
let newTypes = [...currentTypes];
|
|
84962
84920
|
if (ctx.template.workersTypes === "installed") {
|
|
84963
84921
|
const entrypointVersion = getLatestTypesEntrypoint(ctx);
|