create-cloudflare 0.0.0-9098a3b03 → 0.0.0-90fa58b5b
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 +128 -99
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/templates/angular/c3.ts +25 -13
- package/templates/angular/templates/src/server.ts +15 -0
- package/templates/angular/templates/tools/copy-files.mjs +8 -2
- package/templates/hello-world/js/package.json +1 -1
- package/templates/hello-world/ts/package.json +1 -1
- package/templates/hello-world/ts/test/tsconfig.json +1 -1
- package/templates/svelte/c3.ts +30 -0
- package/templates-experimental/angular/c3.ts +21 -7
- package/templates-experimental/angular/templates/src/server.ts +15 -0
- package/templates-experimental/hello-world-with-assets/js/package.json +1 -1
- package/templates-experimental/hello-world-with-assets/ts/package.json +1 -1
- package/templates-experimental/nuxt/c3.ts +1 -1
- package/templates-experimental/nuxt/templates/wrangler.toml +2 -2
- package/templates-experimental/solid/c3.ts +7 -50
- package/templates-experimental/solid/templates/wrangler.toml +2 -2
- package/templates/angular/templates/server.ts +0 -34
- package/templates/angular/templates/tools/alter-polyfills.mjs +0 -27
- package/templates/angular/templates/tools/paths.mjs +0 -9
- package/templates-experimental/angular/templates/server.ts +0 -34
- package/templates-experimental/angular/templates/tools/alter-polyfills.mjs +0 -32
- package/templates-experimental/nuxt/templates/cloudflare-preset/nitro.config.ts +0 -27
package/dist/cli.js
CHANGED
|
@@ -24815,8 +24815,8 @@ var require_index_688c5d50 = __commonJS({
|
|
|
24815
24815
|
var pathReservations = () => {
|
|
24816
24816
|
const queues = /* @__PURE__ */ new Map();
|
|
24817
24817
|
const reservations = /* @__PURE__ */ new Map();
|
|
24818
|
-
const { join:
|
|
24819
|
-
const getDirs = (path7) =>
|
|
24818
|
+
const { join: join8 } = path__default["default"];
|
|
24819
|
+
const getDirs = (path7) => join8(path7).split(/[\\/]/).slice(0, -1).reduce((set, path8) => set.length ? set.concat(join8(set[set.length - 1], path8)) : [path8], []);
|
|
24820
24820
|
const running = /* @__PURE__ */ new Set();
|
|
24821
24821
|
const getQueues = (fn) => {
|
|
24822
24822
|
const res = reservations.get(fn);
|
|
@@ -38609,7 +38609,7 @@ var require_util8 = __commonJS({
|
|
|
38609
38609
|
return path6;
|
|
38610
38610
|
}
|
|
38611
38611
|
exports2.normalize = normalize2;
|
|
38612
|
-
function
|
|
38612
|
+
function join8(aRoot, aPath) {
|
|
38613
38613
|
if (aRoot === "") {
|
|
38614
38614
|
aRoot = ".";
|
|
38615
38615
|
}
|
|
@@ -38641,7 +38641,7 @@ var require_util8 = __commonJS({
|
|
|
38641
38641
|
}
|
|
38642
38642
|
return joined;
|
|
38643
38643
|
}
|
|
38644
|
-
exports2.join =
|
|
38644
|
+
exports2.join = join8;
|
|
38645
38645
|
exports2.isAbsolute = function(aPath) {
|
|
38646
38646
|
return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
|
|
38647
38647
|
};
|
|
@@ -38814,7 +38814,7 @@ var require_util8 = __commonJS({
|
|
|
38814
38814
|
parsed.path = parsed.path.substring(0, index + 1);
|
|
38815
38815
|
}
|
|
38816
38816
|
}
|
|
38817
|
-
sourceURL =
|
|
38817
|
+
sourceURL = join8(urlGenerate(parsed), sourceURL);
|
|
38818
38818
|
}
|
|
38819
38819
|
return normalize2(sourceURL);
|
|
38820
38820
|
}
|
|
@@ -67118,7 +67118,7 @@ var logRaw = (msg) => {
|
|
|
67118
67118
|
`);
|
|
67119
67119
|
};
|
|
67120
67120
|
var log = (msg) => {
|
|
67121
|
-
const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}
|
|
67121
|
+
const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}${ln.length > 0 ? " " + white(ln) : ""}`);
|
|
67122
67122
|
logRaw(lines.join("\n"));
|
|
67123
67123
|
};
|
|
67124
67124
|
var newline = () => {
|
|
@@ -68818,7 +68818,10 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
|
|
|
68818
68818
|
start(msg, helpText) {
|
|
68819
68819
|
helpText ||= ``;
|
|
68820
68820
|
currentMsg = msg;
|
|
68821
|
-
startMsg =
|
|
68821
|
+
startMsg = currentMsg;
|
|
68822
|
+
if (helpText !== void 0 && helpText.length > 0) {
|
|
68823
|
+
startMsg += ` ${dim(helpText)}`;
|
|
68824
|
+
}
|
|
68822
68825
|
if (isInteractive()) {
|
|
68823
68826
|
let index = 0;
|
|
68824
68827
|
clearLoop();
|
|
@@ -68831,7 +68834,7 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
|
|
|
68831
68834
|
}
|
|
68832
68835
|
}, frameRate);
|
|
68833
68836
|
} else {
|
|
68834
|
-
|
|
68837
|
+
logRaw(`${leftT} ${startMsg}`);
|
|
68835
68838
|
}
|
|
68836
68839
|
},
|
|
68837
68840
|
update(msg) {
|
|
@@ -68849,17 +68852,20 @@ ${grayBar} ${msg}`);
|
|
|
68849
68852
|
clearLoop();
|
|
68850
68853
|
} else {
|
|
68851
68854
|
if (msg !== void 0) {
|
|
68852
|
-
|
|
68853
|
-
${grayBar} ${msg}`);
|
|
68855
|
+
logRaw(`${grayBar} ${msg}`);
|
|
68854
68856
|
}
|
|
68855
68857
|
newline();
|
|
68856
68858
|
}
|
|
68857
68859
|
}
|
|
68858
68860
|
};
|
|
68859
68861
|
};
|
|
68860
|
-
|
|
68861
|
-
|
|
68862
|
-
|
|
68862
|
+
function isInteractive() {
|
|
68863
|
+
try {
|
|
68864
|
+
return Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
68865
|
+
} catch {
|
|
68866
|
+
return false;
|
|
68867
|
+
}
|
|
68868
|
+
}
|
|
68863
68869
|
|
|
68864
68870
|
// ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
|
|
68865
68871
|
var import_assert = require("assert");
|
|
@@ -73719,7 +73725,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
73719
73725
|
var yargs_default = Yargs;
|
|
73720
73726
|
|
|
73721
73727
|
// package.json
|
|
73722
|
-
var version = "0.0.0-
|
|
73728
|
+
var version = "0.0.0-90fa58b5b";
|
|
73723
73729
|
|
|
73724
73730
|
// src/metrics.ts
|
|
73725
73731
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -73811,6 +73817,13 @@ var runCommand = async (command2, opts = {}) => {
|
|
|
73811
73817
|
doneText: opts.doneText,
|
|
73812
73818
|
promise() {
|
|
73813
73819
|
const [executable, ...args] = command2;
|
|
73820
|
+
if (args[0] === "wrangler") {
|
|
73821
|
+
const metrics = readMetricsConfig();
|
|
73822
|
+
if (metrics.c3permission?.enabled === false) {
|
|
73823
|
+
opts.env ??= {};
|
|
73824
|
+
opts.env["WRANGLER_SEND_METRICS"] = "false";
|
|
73825
|
+
}
|
|
73826
|
+
}
|
|
73814
73827
|
const abortController = new AbortController();
|
|
73815
73828
|
const cmd = (0, import_cross_spawn.spawn)(executable, [...args], {
|
|
73816
73829
|
// TODO: ideally inherit stderr, but npm install uses this for warnings
|
|
@@ -73999,7 +74012,7 @@ var detectPmMismatch = (ctx) => {
|
|
|
73999
74012
|
case "pnpm":
|
|
74000
74013
|
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "pnpm-lock.yaml"));
|
|
74001
74014
|
case "bun":
|
|
74002
|
-
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb"));
|
|
74015
|
+
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb")) && !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lock"));
|
|
74003
74016
|
}
|
|
74004
74017
|
};
|
|
74005
74018
|
|
|
@@ -74476,15 +74489,15 @@ var package_default = {
|
|
|
74476
74489
|
dependencies: {
|
|
74477
74490
|
"create-astro": "4.10.0",
|
|
74478
74491
|
"create-analog": "1.8.1",
|
|
74479
|
-
"@angular/create": "
|
|
74480
|
-
"create-docusaurus": "3.6.
|
|
74492
|
+
"@angular/create": "19.0.0",
|
|
74493
|
+
"create-docusaurus": "3.6.1",
|
|
74481
74494
|
"create-hono": "0.14.2",
|
|
74482
74495
|
"create-next-app": "14.2.5",
|
|
74483
|
-
"create-qwik": "1.
|
|
74496
|
+
"create-qwik": "1.11.0",
|
|
74484
74497
|
"create-vite": "5.5.5",
|
|
74485
|
-
"create-remix": "2.
|
|
74498
|
+
"create-remix": "2.15.0",
|
|
74486
74499
|
"create-solid": "0.5.13",
|
|
74487
|
-
"create-vue": "3.12.
|
|
74500
|
+
"create-vue": "3.12.1",
|
|
74488
74501
|
gatsby: "5.14.0",
|
|
74489
74502
|
nuxi: "3.15.0",
|
|
74490
74503
|
sv: "0.6.1"
|
|
@@ -74520,7 +74533,11 @@ var runFrameworkGenerator = async (ctx, args) => {
|
|
|
74520
74533
|
// templates-experimental/angular/c3.ts
|
|
74521
74534
|
var { npm } = detectPackageManager();
|
|
74522
74535
|
var generate = async (ctx) => {
|
|
74523
|
-
await runFrameworkGenerator(ctx, [
|
|
74536
|
+
await runFrameworkGenerator(ctx, [
|
|
74537
|
+
ctx.project.name,
|
|
74538
|
+
"--ssr",
|
|
74539
|
+
"--server-routing"
|
|
74540
|
+
]);
|
|
74524
74541
|
logRaw("");
|
|
74525
74542
|
};
|
|
74526
74543
|
var configure = async (ctx) => {
|
|
@@ -74529,9 +74546,9 @@ var configure = async (ctx) => {
|
|
|
74529
74546
|
await installCFWorker();
|
|
74530
74547
|
};
|
|
74531
74548
|
async function installCFWorker() {
|
|
74532
|
-
await installPackages(["
|
|
74549
|
+
await installPackages(["xhr2"], {
|
|
74533
74550
|
dev: true,
|
|
74534
|
-
startText: "Installing
|
|
74551
|
+
startText: "Installing additional dependencies",
|
|
74535
74552
|
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
74536
74553
|
});
|
|
74537
74554
|
}
|
|
@@ -74546,10 +74563,17 @@ async function updateAppCode() {
|
|
|
74546
74563
|
);
|
|
74547
74564
|
writeFile2((0, import_node_path3.resolve)(appConfigPath), newAppConfig);
|
|
74548
74565
|
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
74566
|
+
const appServerRoutesPath = "src/app/app.routes.server.ts";
|
|
74567
|
+
const appRoutes = readFile((0, import_node_path3.resolve)(appServerRoutesPath));
|
|
74568
|
+
const newAppRoutes = appRoutes.replace(
|
|
74569
|
+
"RenderMode.Prerender",
|
|
74570
|
+
"RenderMode.Server"
|
|
74571
|
+
);
|
|
74572
|
+
writeFile2((0, import_node_path3.resolve)(appServerRoutesPath), newAppRoutes);
|
|
74573
|
+
s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
|
|
74549
74574
|
s.start(`Updating package.json`);
|
|
74550
74575
|
const packageJsonPath = (0, import_node_path3.resolve)("package.json");
|
|
74551
74576
|
const packageManifest = readJSON(packageJsonPath);
|
|
74552
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
74553
74577
|
delete packageManifest["dependencies"]["express"];
|
|
74554
74578
|
delete packageManifest["devDependencies"]["@types/express"];
|
|
74555
74579
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
@@ -74561,7 +74585,8 @@ function updateAngularJson(ctx) {
|
|
|
74561
74585
|
const angularJson = readJSON((0, import_node_path3.resolve)("angular.json"));
|
|
74562
74586
|
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
74563
74587
|
architectSection.build.options.outputPath = "dist";
|
|
74564
|
-
architectSection.build.options.
|
|
74588
|
+
architectSection.build.options.outputMode = "server";
|
|
74589
|
+
architectSection.build.options.ssr.experimentalPlatform = "neutral";
|
|
74565
74590
|
writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
74566
74591
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
74567
74592
|
}
|
|
@@ -74577,13 +74602,13 @@ var config = {
|
|
|
74577
74602
|
path: "templates-experimental/angular",
|
|
74578
74603
|
devScript: "start",
|
|
74579
74604
|
deployScript: "deploy",
|
|
74605
|
+
previewScript: "start",
|
|
74580
74606
|
generate,
|
|
74581
74607
|
configure,
|
|
74582
74608
|
transformPackageJson: async () => ({
|
|
74583
74609
|
scripts: {
|
|
74584
74610
|
start: `${npm} run build && wrangler dev`,
|
|
74585
|
-
build: `ng build
|
|
74586
|
-
process: "node ./tools/alter-polyfills.mjs",
|
|
74611
|
+
build: `ng build`,
|
|
74587
74612
|
deploy: `${npm} run build && wrangler deploy`
|
|
74588
74613
|
}
|
|
74589
74614
|
})
|
|
@@ -75063,7 +75088,7 @@ var updateNuxtConfig = () => {
|
|
|
75063
75088
|
b2.objectExpression([
|
|
75064
75089
|
b2.objectProperty(
|
|
75065
75090
|
b2.identifier("preset"),
|
|
75066
|
-
b2.stringLiteral("
|
|
75091
|
+
b2.stringLiteral("cloudflare_module")
|
|
75067
75092
|
)
|
|
75068
75093
|
])
|
|
75069
75094
|
);
|
|
@@ -75279,6 +75304,7 @@ var configure7 = async (ctx) => {
|
|
|
75279
75304
|
});
|
|
75280
75305
|
usesTypescript(ctx);
|
|
75281
75306
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
75307
|
+
const compatDate = await getWorkerdCompatibilityDate();
|
|
75282
75308
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
75283
75309
|
transformFile(filePath, {
|
|
75284
75310
|
visitCallExpression: function(n2) {
|
|
@@ -75293,60 +75319,14 @@ var configure7 = async (ctx) => {
|
|
|
75293
75319
|
b2.objectProperty(
|
|
75294
75320
|
b2.identifier("server"),
|
|
75295
75321
|
b2.objectExpression([
|
|
75296
|
-
// preset: "
|
|
75322
|
+
// preset: "cloudflare_module"
|
|
75297
75323
|
b2.objectProperty(
|
|
75298
75324
|
b2.identifier("preset"),
|
|
75299
|
-
b2.stringLiteral("
|
|
75300
|
-
),
|
|
75301
|
-
// output: {
|
|
75302
|
-
// dir: "{{ rootDir }}/dist",
|
|
75303
|
-
// publicDir: "{{ output.dir }}/public",
|
|
75304
|
-
// serverDir: "{{ output.dir }}/worker",
|
|
75305
|
-
// },
|
|
75306
|
-
b2.objectProperty(
|
|
75307
|
-
b2.identifier("output"),
|
|
75308
|
-
b2.objectExpression([
|
|
75309
|
-
b2.objectProperty(
|
|
75310
|
-
b2.identifier("dir"),
|
|
75311
|
-
b2.stringLiteral("{{ rootDir }}/dist")
|
|
75312
|
-
),
|
|
75313
|
-
b2.objectProperty(
|
|
75314
|
-
b2.identifier("publicDir"),
|
|
75315
|
-
b2.stringLiteral("{{ output.dir }}/public")
|
|
75316
|
-
),
|
|
75317
|
-
b2.objectProperty(
|
|
75318
|
-
b2.identifier("serverDir"),
|
|
75319
|
-
b2.stringLiteral("{{ output.dir }}/worker")
|
|
75320
|
-
)
|
|
75321
|
-
])
|
|
75322
|
-
),
|
|
75323
|
-
// rollupConfig: {
|
|
75324
|
-
// external: ["node:async_hooks"],
|
|
75325
|
-
// },
|
|
75326
|
-
b2.objectProperty(
|
|
75327
|
-
b2.identifier("rollupConfig"),
|
|
75328
|
-
b2.objectExpression([
|
|
75329
|
-
b2.objectProperty(
|
|
75330
|
-
b2.identifier("external"),
|
|
75331
|
-
b2.arrayExpression([b2.stringLiteral("node:async_hooks")])
|
|
75332
|
-
)
|
|
75333
|
-
])
|
|
75325
|
+
b2.stringLiteral("cloudflare_module")
|
|
75334
75326
|
),
|
|
75335
|
-
// hooks: {
|
|
75336
|
-
// // Prevent the Pages preset from writing the _routes.json etc.
|
|
75337
|
-
// compiled() {},
|
|
75338
|
-
// },
|
|
75339
75327
|
b2.objectProperty(
|
|
75340
|
-
b2.identifier("
|
|
75341
|
-
b2.
|
|
75342
|
-
b2.objectMethod(
|
|
75343
|
-
"method",
|
|
75344
|
-
b2.identifier("compiled"),
|
|
75345
|
-
[],
|
|
75346
|
-
b2.blockStatement([]),
|
|
75347
|
-
false
|
|
75348
|
-
)
|
|
75349
|
-
])
|
|
75328
|
+
b2.identifier("compatibilityDate"),
|
|
75329
|
+
b2.stringLiteral(compatDate)
|
|
75350
75330
|
)
|
|
75351
75331
|
])
|
|
75352
75332
|
)
|
|
@@ -75590,7 +75570,11 @@ var c3_default15 = config13;
|
|
|
75590
75570
|
var import_node_path4 = require("node:path");
|
|
75591
75571
|
var { npm: npm10 } = detectPackageManager();
|
|
75592
75572
|
var generate13 = async (ctx) => {
|
|
75593
|
-
await runFrameworkGenerator(ctx, [
|
|
75573
|
+
await runFrameworkGenerator(ctx, [
|
|
75574
|
+
ctx.project.name,
|
|
75575
|
+
"--ssr",
|
|
75576
|
+
"--server-routing"
|
|
75577
|
+
]);
|
|
75594
75578
|
logRaw("");
|
|
75595
75579
|
};
|
|
75596
75580
|
var configure10 = async (ctx) => {
|
|
@@ -75599,14 +75583,11 @@ var configure10 = async (ctx) => {
|
|
|
75599
75583
|
await installCFWorker2();
|
|
75600
75584
|
};
|
|
75601
75585
|
async function installCFWorker2() {
|
|
75602
|
-
await installPackages(
|
|
75603
|
-
|
|
75604
|
-
|
|
75605
|
-
|
|
75606
|
-
|
|
75607
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
75608
|
-
}
|
|
75609
|
-
);
|
|
75586
|
+
await installPackages(["xhr2"], {
|
|
75587
|
+
dev: true,
|
|
75588
|
+
startText: "Installing additional dependencies",
|
|
75589
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
75590
|
+
});
|
|
75610
75591
|
}
|
|
75611
75592
|
async function updateAppCode2() {
|
|
75612
75593
|
const s = spinner();
|
|
@@ -75619,10 +75600,17 @@ async function updateAppCode2() {
|
|
|
75619
75600
|
);
|
|
75620
75601
|
writeFile2((0, import_node_path4.resolve)(appConfigPath), newAppConfig);
|
|
75621
75602
|
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
75603
|
+
const appServerRoutesPath = "src/app/app.routes.server.ts";
|
|
75604
|
+
const appRoutes = readFile((0, import_node_path4.resolve)(appServerRoutesPath));
|
|
75605
|
+
const newAppRoutes = appRoutes.replace(
|
|
75606
|
+
"RenderMode.Prerender",
|
|
75607
|
+
"RenderMode.Server"
|
|
75608
|
+
);
|
|
75609
|
+
writeFile2((0, import_node_path4.resolve)(appServerRoutesPath), newAppRoutes);
|
|
75610
|
+
s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
|
|
75622
75611
|
s.start(`Updating package.json`);
|
|
75623
75612
|
const packageJsonPath = (0, import_node_path4.resolve)("package.json");
|
|
75624
75613
|
const packageManifest = readJSON(packageJsonPath);
|
|
75625
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
75626
75614
|
delete packageManifest["dependencies"]["express"];
|
|
75627
75615
|
delete packageManifest["devDependencies"]["@types/express"];
|
|
75628
75616
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
@@ -75634,6 +75622,8 @@ function updateAngularJson2(ctx) {
|
|
|
75634
75622
|
const angularJson = readJSON((0, import_node_path4.resolve)("angular.json"));
|
|
75635
75623
|
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
75636
75624
|
architectSection.build.options.outputPath = "dist";
|
|
75625
|
+
architectSection.build.options.outputMode = "server";
|
|
75626
|
+
architectSection.build.options.ssr.experimentalPlatform = "neutral";
|
|
75637
75627
|
architectSection.build.options.assets.push("src/_routes.json");
|
|
75638
75628
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
75639
75629
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
@@ -75649,13 +75639,14 @@ var config14 = {
|
|
|
75649
75639
|
},
|
|
75650
75640
|
devScript: "start",
|
|
75651
75641
|
deployScript: "deploy",
|
|
75642
|
+
previewScript: "start",
|
|
75652
75643
|
generate: generate13,
|
|
75653
75644
|
configure: configure10,
|
|
75654
75645
|
transformPackageJson: async () => ({
|
|
75655
75646
|
scripts: {
|
|
75656
|
-
start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}
|
|
75647
|
+
start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
75657
75648
|
build: `ng build && ${npm10} run process`,
|
|
75658
|
-
process: "node ./tools/copy-files.mjs
|
|
75649
|
+
process: "node ./tools/copy-files.mjs",
|
|
75659
75650
|
deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
|
|
75660
75651
|
}
|
|
75661
75652
|
})
|
|
@@ -76706,6 +76697,7 @@ var config23 = {
|
|
|
76706
76697
|
var c3_default33 = config23;
|
|
76707
76698
|
|
|
76708
76699
|
// templates/svelte/c3.ts
|
|
76700
|
+
var import_node_fs3 = require("node:fs");
|
|
76709
76701
|
var import_node_os4 = require("node:os");
|
|
76710
76702
|
var recast12 = __toESM(require_main3());
|
|
76711
76703
|
var { npm: npm19 } = detectPackageManager();
|
|
@@ -76721,6 +76713,7 @@ var configure18 = async (ctx) => {
|
|
|
76721
76713
|
doneText: `${brandColor(`installed`)} ${dim(pkg)}`
|
|
76722
76714
|
});
|
|
76723
76715
|
updateSvelteConfig2();
|
|
76716
|
+
updatePlaywrightConfig(usesTypescript(ctx));
|
|
76724
76717
|
updateTypeDefinitions2(ctx);
|
|
76725
76718
|
};
|
|
76726
76719
|
var updateSvelteConfig2 = () => {
|
|
@@ -76735,6 +76728,28 @@ var updateSvelteConfig2 = () => {
|
|
|
76735
76728
|
}
|
|
76736
76729
|
});
|
|
76737
76730
|
};
|
|
76731
|
+
var updatePlaywrightConfig = (shouldUseTypescript) => {
|
|
76732
|
+
const filePath = `playwright.config.${shouldUseTypescript ? "ts" : "js"}`;
|
|
76733
|
+
if (!(0, import_node_fs3.existsSync)(filePath)) {
|
|
76734
|
+
return;
|
|
76735
|
+
}
|
|
76736
|
+
updateStatus(`Changing webServer port in ${blue(filePath)}`);
|
|
76737
|
+
transformFile(filePath, {
|
|
76738
|
+
visitObjectExpression: function(n2) {
|
|
76739
|
+
const portProp = n2.node.properties.find((prop) => {
|
|
76740
|
+
if (!("key" in prop) || !("name" in prop.key)) {
|
|
76741
|
+
return false;
|
|
76742
|
+
}
|
|
76743
|
+
return prop.key.name === "port";
|
|
76744
|
+
});
|
|
76745
|
+
if (!portProp || !("value" in portProp) || !("value" in portProp.value)) {
|
|
76746
|
+
return this.traverse(n2);
|
|
76747
|
+
}
|
|
76748
|
+
portProp.value.value = 8788;
|
|
76749
|
+
return false;
|
|
76750
|
+
}
|
|
76751
|
+
});
|
|
76752
|
+
};
|
|
76738
76753
|
var updateTypeDefinitions2 = (ctx) => {
|
|
76739
76754
|
if (!usesTypescript(ctx)) {
|
|
76740
76755
|
return;
|
|
@@ -76831,7 +76846,7 @@ var config25 = {
|
|
|
76831
76846
|
var c3_default35 = config25;
|
|
76832
76847
|
|
|
76833
76848
|
// ../wrangler/package.json
|
|
76834
|
-
var version2 = "0.0.0-
|
|
76849
|
+
var version2 = "0.0.0-90fa58b5b";
|
|
76835
76850
|
|
|
76836
76851
|
// src/git.ts
|
|
76837
76852
|
var offerGit = async (ctx) => {
|
|
@@ -77920,6 +77935,9 @@ var processArgument = async (args, key, promptConfig) => {
|
|
|
77920
77935
|
};
|
|
77921
77936
|
|
|
77922
77937
|
// src/deploy.ts
|
|
77938
|
+
var import_promises4 = require("node:fs/promises");
|
|
77939
|
+
var import_node_os5 = require("node:os");
|
|
77940
|
+
var import_node_path5 = require("node:path");
|
|
77923
77941
|
var import_toml2 = __toESM(require_toml());
|
|
77924
77942
|
|
|
77925
77943
|
// src/helpers/poll.ts
|
|
@@ -79238,23 +79256,34 @@ var runDeploy = async (ctx) => {
|
|
|
79238
79256
|
JSON.stringify(ctx.commitMessage)
|
|
79239
79257
|
] : []
|
|
79240
79258
|
];
|
|
79241
|
-
const
|
|
79242
|
-
|
|
79259
|
+
const outputFile = (0, import_node_path5.join)(
|
|
79260
|
+
await (0, import_promises4.mkdtemp)((0, import_node_path5.join)((0, import_node_os5.tmpdir)(), "c3-wrangler-deploy-")),
|
|
79261
|
+
"output.json"
|
|
79262
|
+
);
|
|
79263
|
+
await runCommand(deployCmd, {
|
|
79243
79264
|
cwd: ctx.project.path,
|
|
79244
79265
|
env: {
|
|
79245
79266
|
CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
|
|
79246
|
-
NODE_ENV: "production"
|
|
79267
|
+
NODE_ENV: "production",
|
|
79268
|
+
WRANGLER_OUTPUT_FILE_PATH: outputFile
|
|
79247
79269
|
},
|
|
79248
79270
|
startText: "Deploying your application",
|
|
79249
79271
|
doneText: `${brandColor("deployed")} ${dim(
|
|
79250
79272
|
`via \`${quoteShellArgs(baseDeployCmd)}\``
|
|
79251
79273
|
)}`
|
|
79252
79274
|
});
|
|
79253
|
-
|
|
79254
|
-
|
|
79255
|
-
|
|
79256
|
-
|
|
79257
|
-
|
|
79275
|
+
try {
|
|
79276
|
+
const contents = readFile(outputFile);
|
|
79277
|
+
const entries = contents.split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
|
|
79278
|
+
const url = entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
|
|
79279
|
+
const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
|
|
79280
|
+
const deployedUrlMatch = url?.match(deployedUrlRegex);
|
|
79281
|
+
if (deployedUrlMatch) {
|
|
79282
|
+
ctx.deployment.url = deployedUrlMatch[0];
|
|
79283
|
+
} else {
|
|
79284
|
+
throw new Error("Failed to find deployment url.");
|
|
79285
|
+
}
|
|
79286
|
+
} catch {
|
|
79258
79287
|
throw new Error("Failed to find deployment url.");
|
|
79259
79288
|
}
|
|
79260
79289
|
if (ctx.deployment.url?.endsWith(".pages.dev")) {
|