create-cloudflare 0.0.0-a034aa1f6 → 0.0.0-a068672bc
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 +109 -121
- 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/astro/templates/wrangler.toml +1 -0
- package/templates/hello-world/ts/test/tsconfig.json +1 -1
- package/templates/svelte/c3.ts +1 -1
- package/templates-experimental/angular/c3.ts +21 -7
- package/templates-experimental/angular/templates/src/server.ts +15 -0
- package/templates-experimental/nuxt/c3.ts +1 -1
- package/templates-experimental/nuxt/templates/wrangler.toml +2 -2
- package/templates-experimental/remix/c3.ts +1 -26
- package/templates-experimental/remix/templates/public/.assetsignore +0 -4
- package/templates-experimental/remix/templates/wrangler.toml +1 -1
- package/templates-experimental/solid/c3.ts +7 -50
- package/templates-experimental/solid/templates/wrangler.toml +2 -2
- package/templates-experimental/svelte/c3.ts +1 -1
- 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-a068672bc";
|
|
73723
73729
|
|
|
73724
73730
|
// src/metrics.ts
|
|
73725
73731
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -73999,7 +74005,7 @@ var detectPmMismatch = (ctx) => {
|
|
|
73999
74005
|
case "pnpm":
|
|
74000
74006
|
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "pnpm-lock.yaml"));
|
|
74001
74007
|
case "bun":
|
|
74002
|
-
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb"));
|
|
74008
|
+
return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb")) && !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lock"));
|
|
74003
74009
|
}
|
|
74004
74010
|
};
|
|
74005
74011
|
|
|
@@ -74474,20 +74480,20 @@ var package_default = {
|
|
|
74474
74480
|
"so that we can use dependabot to update these dependencies automatically."
|
|
74475
74481
|
],
|
|
74476
74482
|
dependencies: {
|
|
74477
|
-
"create-astro": "4.
|
|
74483
|
+
"create-astro": "4.10.0",
|
|
74478
74484
|
"create-analog": "1.8.1",
|
|
74479
|
-
"@angular/create": "
|
|
74480
|
-
"create-docusaurus": "3.
|
|
74485
|
+
"@angular/create": "19.0.0",
|
|
74486
|
+
"create-docusaurus": "3.6.1",
|
|
74481
74487
|
"create-hono": "0.14.2",
|
|
74482
74488
|
"create-next-app": "14.2.5",
|
|
74483
|
-
"create-qwik": "1.
|
|
74484
|
-
"create-vite": "5.5.
|
|
74485
|
-
"create-remix": "2.
|
|
74489
|
+
"create-qwik": "1.11.0",
|
|
74490
|
+
"create-vite": "5.5.5",
|
|
74491
|
+
"create-remix": "2.14.0",
|
|
74486
74492
|
"create-solid": "0.5.13",
|
|
74487
|
-
"create-vue": "3.
|
|
74488
|
-
gatsby: "5.
|
|
74489
|
-
nuxi: "3.
|
|
74490
|
-
sv: "0.
|
|
74493
|
+
"create-vue": "3.12.1",
|
|
74494
|
+
gatsby: "5.14.0",
|
|
74495
|
+
nuxi: "3.15.0",
|
|
74496
|
+
sv: "0.6.1"
|
|
74491
74497
|
}
|
|
74492
74498
|
};
|
|
74493
74499
|
|
|
@@ -74520,7 +74526,11 @@ var runFrameworkGenerator = async (ctx, args) => {
|
|
|
74520
74526
|
// templates-experimental/angular/c3.ts
|
|
74521
74527
|
var { npm } = detectPackageManager();
|
|
74522
74528
|
var generate = async (ctx) => {
|
|
74523
|
-
await runFrameworkGenerator(ctx, [
|
|
74529
|
+
await runFrameworkGenerator(ctx, [
|
|
74530
|
+
ctx.project.name,
|
|
74531
|
+
"--ssr",
|
|
74532
|
+
"--server-routing"
|
|
74533
|
+
]);
|
|
74524
74534
|
logRaw("");
|
|
74525
74535
|
};
|
|
74526
74536
|
var configure = async (ctx) => {
|
|
@@ -74529,9 +74539,9 @@ var configure = async (ctx) => {
|
|
|
74529
74539
|
await installCFWorker();
|
|
74530
74540
|
};
|
|
74531
74541
|
async function installCFWorker() {
|
|
74532
|
-
await installPackages(["
|
|
74542
|
+
await installPackages(["xhr2"], {
|
|
74533
74543
|
dev: true,
|
|
74534
|
-
startText: "Installing
|
|
74544
|
+
startText: "Installing additional dependencies",
|
|
74535
74545
|
doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
|
|
74536
74546
|
});
|
|
74537
74547
|
}
|
|
@@ -74546,10 +74556,17 @@ async function updateAppCode() {
|
|
|
74546
74556
|
);
|
|
74547
74557
|
writeFile2((0, import_node_path3.resolve)(appConfigPath), newAppConfig);
|
|
74548
74558
|
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
74559
|
+
const appServerRoutesPath = "src/app/app.routes.server.ts";
|
|
74560
|
+
const appRoutes = readFile((0, import_node_path3.resolve)(appServerRoutesPath));
|
|
74561
|
+
const newAppRoutes = appRoutes.replace(
|
|
74562
|
+
"RenderMode.Prerender",
|
|
74563
|
+
"RenderMode.Server"
|
|
74564
|
+
);
|
|
74565
|
+
writeFile2((0, import_node_path3.resolve)(appServerRoutesPath), newAppRoutes);
|
|
74566
|
+
s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
|
|
74549
74567
|
s.start(`Updating package.json`);
|
|
74550
74568
|
const packageJsonPath = (0, import_node_path3.resolve)("package.json");
|
|
74551
74569
|
const packageManifest = readJSON(packageJsonPath);
|
|
74552
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
74553
74570
|
delete packageManifest["dependencies"]["express"];
|
|
74554
74571
|
delete packageManifest["devDependencies"]["@types/express"];
|
|
74555
74572
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
@@ -74561,7 +74578,8 @@ function updateAngularJson(ctx) {
|
|
|
74561
74578
|
const angularJson = readJSON((0, import_node_path3.resolve)("angular.json"));
|
|
74562
74579
|
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
74563
74580
|
architectSection.build.options.outputPath = "dist";
|
|
74564
|
-
architectSection.build.options.
|
|
74581
|
+
architectSection.build.options.outputMode = "server";
|
|
74582
|
+
architectSection.build.options.ssr.experimentalPlatform = "neutral";
|
|
74565
74583
|
writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
74566
74584
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
74567
74585
|
}
|
|
@@ -74577,13 +74595,13 @@ var config = {
|
|
|
74577
74595
|
path: "templates-experimental/angular",
|
|
74578
74596
|
devScript: "start",
|
|
74579
74597
|
deployScript: "deploy",
|
|
74598
|
+
previewScript: "start",
|
|
74580
74599
|
generate,
|
|
74581
74600
|
configure,
|
|
74582
74601
|
transformPackageJson: async () => ({
|
|
74583
74602
|
scripts: {
|
|
74584
74603
|
start: `${npm} run build && wrangler dev`,
|
|
74585
|
-
build: `ng build
|
|
74586
|
-
process: "node ./tools/alter-polyfills.mjs",
|
|
74604
|
+
build: `ng build`,
|
|
74587
74605
|
deploy: `${npm} run build && wrangler deploy`
|
|
74588
74606
|
}
|
|
74589
74607
|
})
|
|
@@ -75063,7 +75081,7 @@ var updateNuxtConfig = () => {
|
|
|
75063
75081
|
b2.objectExpression([
|
|
75064
75082
|
b2.objectProperty(
|
|
75065
75083
|
b2.identifier("preset"),
|
|
75066
|
-
b2.stringLiteral("
|
|
75084
|
+
b2.stringLiteral("cloudflare_module")
|
|
75067
75085
|
)
|
|
75068
75086
|
])
|
|
75069
75087
|
);
|
|
@@ -75227,7 +75245,7 @@ var generate9 = async (ctx) => {
|
|
|
75227
75245
|
await runFrameworkGenerator(ctx, [
|
|
75228
75246
|
ctx.project.name,
|
|
75229
75247
|
"--template",
|
|
75230
|
-
"https://github.com/remix-run/remix/tree/main/templates/cloudflare"
|
|
75248
|
+
"https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
|
|
75231
75249
|
]);
|
|
75232
75250
|
logRaw("");
|
|
75233
75251
|
};
|
|
@@ -75237,19 +75255,6 @@ var configure6 = async () => {
|
|
|
75237
75255
|
startText: "Updating the Wrangler version",
|
|
75238
75256
|
doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
|
|
75239
75257
|
});
|
|
75240
|
-
const typeDefsPath = "load-context.ts";
|
|
75241
|
-
const s = spinner();
|
|
75242
|
-
s.start(`Updating \`${typeDefsPath}\``);
|
|
75243
|
-
transformFile(typeDefsPath, {
|
|
75244
|
-
visitTSInterfaceDeclaration(n2) {
|
|
75245
|
-
if (n2.node.id.type === "Identifier" && n2.node.id.name !== "Env") {
|
|
75246
|
-
return this.traverse(n2);
|
|
75247
|
-
}
|
|
75248
|
-
n2.replace();
|
|
75249
|
-
return false;
|
|
75250
|
-
}
|
|
75251
|
-
});
|
|
75252
|
-
s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
|
|
75253
75258
|
};
|
|
75254
75259
|
var config10 = {
|
|
75255
75260
|
configVersion: 1,
|
|
@@ -75265,7 +75270,6 @@ var config10 = {
|
|
|
75265
75270
|
configure: configure6,
|
|
75266
75271
|
transformPackageJson: async () => ({
|
|
75267
75272
|
scripts: {
|
|
75268
|
-
build: "remix vite:build && wrangler pages functions build --outdir build/worker",
|
|
75269
75273
|
deploy: `${npm6} run build && wrangler deploy`,
|
|
75270
75274
|
preview: `${npm6} run build && wrangler dev`,
|
|
75271
75275
|
"cf-typegen": `wrangler types`
|
|
@@ -75293,6 +75297,7 @@ var configure7 = async (ctx) => {
|
|
|
75293
75297
|
});
|
|
75294
75298
|
usesTypescript(ctx);
|
|
75295
75299
|
const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
|
|
75300
|
+
const compatDate = await getWorkerdCompatibilityDate();
|
|
75296
75301
|
updateStatus(`Updating configuration in ${blue(filePath)}`);
|
|
75297
75302
|
transformFile(filePath, {
|
|
75298
75303
|
visitCallExpression: function(n2) {
|
|
@@ -75307,60 +75312,14 @@ var configure7 = async (ctx) => {
|
|
|
75307
75312
|
b2.objectProperty(
|
|
75308
75313
|
b2.identifier("server"),
|
|
75309
75314
|
b2.objectExpression([
|
|
75310
|
-
// preset: "
|
|
75315
|
+
// preset: "cloudflare_module"
|
|
75311
75316
|
b2.objectProperty(
|
|
75312
75317
|
b2.identifier("preset"),
|
|
75313
|
-
b2.stringLiteral("
|
|
75318
|
+
b2.stringLiteral("cloudflare_module")
|
|
75314
75319
|
),
|
|
75315
|
-
// output: {
|
|
75316
|
-
// dir: "{{ rootDir }}/dist",
|
|
75317
|
-
// publicDir: "{{ output.dir }}/public",
|
|
75318
|
-
// serverDir: "{{ output.dir }}/worker",
|
|
75319
|
-
// },
|
|
75320
75320
|
b2.objectProperty(
|
|
75321
|
-
b2.identifier("
|
|
75322
|
-
b2.
|
|
75323
|
-
b2.objectProperty(
|
|
75324
|
-
b2.identifier("dir"),
|
|
75325
|
-
b2.stringLiteral("{{ rootDir }}/dist")
|
|
75326
|
-
),
|
|
75327
|
-
b2.objectProperty(
|
|
75328
|
-
b2.identifier("publicDir"),
|
|
75329
|
-
b2.stringLiteral("{{ output.dir }}/public")
|
|
75330
|
-
),
|
|
75331
|
-
b2.objectProperty(
|
|
75332
|
-
b2.identifier("serverDir"),
|
|
75333
|
-
b2.stringLiteral("{{ output.dir }}/worker")
|
|
75334
|
-
)
|
|
75335
|
-
])
|
|
75336
|
-
),
|
|
75337
|
-
// rollupConfig: {
|
|
75338
|
-
// external: ["node:async_hooks"],
|
|
75339
|
-
// },
|
|
75340
|
-
b2.objectProperty(
|
|
75341
|
-
b2.identifier("rollupConfig"),
|
|
75342
|
-
b2.objectExpression([
|
|
75343
|
-
b2.objectProperty(
|
|
75344
|
-
b2.identifier("external"),
|
|
75345
|
-
b2.arrayExpression([b2.stringLiteral("node:async_hooks")])
|
|
75346
|
-
)
|
|
75347
|
-
])
|
|
75348
|
-
),
|
|
75349
|
-
// hooks: {
|
|
75350
|
-
// // Prevent the Pages preset from writing the _routes.json etc.
|
|
75351
|
-
// compiled() {},
|
|
75352
|
-
// },
|
|
75353
|
-
b2.objectProperty(
|
|
75354
|
-
b2.identifier("hooks"),
|
|
75355
|
-
b2.objectExpression([
|
|
75356
|
-
b2.objectMethod(
|
|
75357
|
-
"method",
|
|
75358
|
-
b2.identifier("compiled"),
|
|
75359
|
-
[],
|
|
75360
|
-
b2.blockStatement([]),
|
|
75361
|
-
false
|
|
75362
|
-
)
|
|
75363
|
-
])
|
|
75321
|
+
b2.identifier("compatibilityDate"),
|
|
75322
|
+
b2.stringLiteral(compatDate)
|
|
75364
75323
|
)
|
|
75365
75324
|
])
|
|
75366
75325
|
)
|
|
@@ -75466,7 +75425,7 @@ var config12 = {
|
|
|
75466
75425
|
configVersion: 1,
|
|
75467
75426
|
id: "svelte",
|
|
75468
75427
|
frameworkCli: "sv",
|
|
75469
|
-
displayName: "
|
|
75428
|
+
displayName: "SvelteKit",
|
|
75470
75429
|
platform: "workers",
|
|
75471
75430
|
copyFiles: {
|
|
75472
75431
|
variants: {
|
|
@@ -75604,7 +75563,11 @@ var c3_default15 = config13;
|
|
|
75604
75563
|
var import_node_path4 = require("node:path");
|
|
75605
75564
|
var { npm: npm10 } = detectPackageManager();
|
|
75606
75565
|
var generate13 = async (ctx) => {
|
|
75607
|
-
await runFrameworkGenerator(ctx, [
|
|
75566
|
+
await runFrameworkGenerator(ctx, [
|
|
75567
|
+
ctx.project.name,
|
|
75568
|
+
"--ssr",
|
|
75569
|
+
"--server-routing"
|
|
75570
|
+
]);
|
|
75608
75571
|
logRaw("");
|
|
75609
75572
|
};
|
|
75610
75573
|
var configure10 = async (ctx) => {
|
|
@@ -75613,14 +75576,11 @@ var configure10 = async (ctx) => {
|
|
|
75613
75576
|
await installCFWorker2();
|
|
75614
75577
|
};
|
|
75615
75578
|
async function installCFWorker2() {
|
|
75616
|
-
await installPackages(
|
|
75617
|
-
|
|
75618
|
-
|
|
75619
|
-
|
|
75620
|
-
|
|
75621
|
-
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
75622
|
-
}
|
|
75623
|
-
);
|
|
75579
|
+
await installPackages(["xhr2"], {
|
|
75580
|
+
dev: true,
|
|
75581
|
+
startText: "Installing additional dependencies",
|
|
75582
|
+
doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
|
|
75583
|
+
});
|
|
75624
75584
|
}
|
|
75625
75585
|
async function updateAppCode2() {
|
|
75626
75586
|
const s = spinner();
|
|
@@ -75633,10 +75593,17 @@ async function updateAppCode2() {
|
|
|
75633
75593
|
);
|
|
75634
75594
|
writeFile2((0, import_node_path4.resolve)(appConfigPath), newAppConfig);
|
|
75635
75595
|
s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
|
|
75596
|
+
const appServerRoutesPath = "src/app/app.routes.server.ts";
|
|
75597
|
+
const appRoutes = readFile((0, import_node_path4.resolve)(appServerRoutesPath));
|
|
75598
|
+
const newAppRoutes = appRoutes.replace(
|
|
75599
|
+
"RenderMode.Prerender",
|
|
75600
|
+
"RenderMode.Server"
|
|
75601
|
+
);
|
|
75602
|
+
writeFile2((0, import_node_path4.resolve)(appServerRoutesPath), newAppRoutes);
|
|
75603
|
+
s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
|
|
75636
75604
|
s.start(`Updating package.json`);
|
|
75637
75605
|
const packageJsonPath = (0, import_node_path4.resolve)("package.json");
|
|
75638
75606
|
const packageManifest = readJSON(packageJsonPath);
|
|
75639
|
-
delete packageManifest["dependencies"]["@angular/ssr"];
|
|
75640
75607
|
delete packageManifest["dependencies"]["express"];
|
|
75641
75608
|
delete packageManifest["devDependencies"]["@types/express"];
|
|
75642
75609
|
writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
|
|
@@ -75648,6 +75615,8 @@ function updateAngularJson2(ctx) {
|
|
|
75648
75615
|
const angularJson = readJSON((0, import_node_path4.resolve)("angular.json"));
|
|
75649
75616
|
const architectSection = angularJson.projects[ctx.project.name].architect;
|
|
75650
75617
|
architectSection.build.options.outputPath = "dist";
|
|
75618
|
+
architectSection.build.options.outputMode = "server";
|
|
75619
|
+
architectSection.build.options.ssr.experimentalPlatform = "neutral";
|
|
75651
75620
|
architectSection.build.options.assets.push("src/_routes.json");
|
|
75652
75621
|
writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
|
|
75653
75622
|
s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
|
|
@@ -75663,13 +75632,14 @@ var config14 = {
|
|
|
75663
75632
|
},
|
|
75664
75633
|
devScript: "start",
|
|
75665
75634
|
deployScript: "deploy",
|
|
75635
|
+
previewScript: "start",
|
|
75666
75636
|
generate: generate13,
|
|
75667
75637
|
configure: configure10,
|
|
75668
75638
|
transformPackageJson: async () => ({
|
|
75669
75639
|
scripts: {
|
|
75670
|
-
start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}
|
|
75640
|
+
start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
|
|
75671
75641
|
build: `ng build && ${npm10} run process`,
|
|
75672
|
-
process: "node ./tools/copy-files.mjs
|
|
75642
|
+
process: "node ./tools/copy-files.mjs",
|
|
75673
75643
|
deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
|
|
75674
75644
|
}
|
|
75675
75645
|
})
|
|
@@ -76790,7 +76760,7 @@ var config24 = {
|
|
|
76790
76760
|
configVersion: 1,
|
|
76791
76761
|
id: "svelte",
|
|
76792
76762
|
frameworkCli: "sv",
|
|
76793
|
-
displayName: "
|
|
76763
|
+
displayName: "SvelteKit",
|
|
76794
76764
|
platform: "pages",
|
|
76795
76765
|
copyFiles: {
|
|
76796
76766
|
variants: {
|
|
@@ -76845,7 +76815,7 @@ var config25 = {
|
|
|
76845
76815
|
var c3_default35 = config25;
|
|
76846
76816
|
|
|
76847
76817
|
// ../wrangler/package.json
|
|
76848
|
-
var version2 = "0.0.0-
|
|
76818
|
+
var version2 = "0.0.0-a068672bc";
|
|
76849
76819
|
|
|
76850
76820
|
// src/git.ts
|
|
76851
76821
|
var offerGit = async (ctx) => {
|
|
@@ -77934,6 +77904,9 @@ var processArgument = async (args, key, promptConfig) => {
|
|
|
77934
77904
|
};
|
|
77935
77905
|
|
|
77936
77906
|
// src/deploy.ts
|
|
77907
|
+
var import_promises4 = require("node:fs/promises");
|
|
77908
|
+
var import_node_os5 = require("node:os");
|
|
77909
|
+
var import_node_path5 = require("node:path");
|
|
77937
77910
|
var import_toml2 = __toESM(require_toml());
|
|
77938
77911
|
|
|
77939
77912
|
// src/helpers/poll.ts
|
|
@@ -79252,23 +79225,34 @@ var runDeploy = async (ctx) => {
|
|
|
79252
79225
|
JSON.stringify(ctx.commitMessage)
|
|
79253
79226
|
] : []
|
|
79254
79227
|
];
|
|
79255
|
-
const
|
|
79256
|
-
|
|
79228
|
+
const outputFile = (0, import_node_path5.join)(
|
|
79229
|
+
await (0, import_promises4.mkdtemp)((0, import_node_path5.join)((0, import_node_os5.tmpdir)(), "c3-wrangler-deploy-")),
|
|
79230
|
+
"output.json"
|
|
79231
|
+
);
|
|
79232
|
+
await runCommand(deployCmd, {
|
|
79257
79233
|
cwd: ctx.project.path,
|
|
79258
79234
|
env: {
|
|
79259
79235
|
CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
|
|
79260
|
-
NODE_ENV: "production"
|
|
79236
|
+
NODE_ENV: "production",
|
|
79237
|
+
WRANGLER_OUTPUT_FILE_PATH: outputFile
|
|
79261
79238
|
},
|
|
79262
79239
|
startText: "Deploying your application",
|
|
79263
79240
|
doneText: `${brandColor("deployed")} ${dim(
|
|
79264
79241
|
`via \`${quoteShellArgs(baseDeployCmd)}\``
|
|
79265
79242
|
)}`
|
|
79266
79243
|
});
|
|
79267
|
-
|
|
79268
|
-
|
|
79269
|
-
|
|
79270
|
-
|
|
79271
|
-
|
|
79244
|
+
try {
|
|
79245
|
+
const contents = readFile(outputFile);
|
|
79246
|
+
const entries = contents.split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
|
|
79247
|
+
const url = entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
|
|
79248
|
+
const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
|
|
79249
|
+
const deployedUrlMatch = url?.match(deployedUrlRegex);
|
|
79250
|
+
if (deployedUrlMatch) {
|
|
79251
|
+
ctx.deployment.url = deployedUrlMatch[0];
|
|
79252
|
+
} else {
|
|
79253
|
+
throw new Error("Failed to find deployment url.");
|
|
79254
|
+
}
|
|
79255
|
+
} catch {
|
|
79272
79256
|
throw new Error("Failed to find deployment url.");
|
|
79273
79257
|
}
|
|
79274
79258
|
if (ctx.deployment.url?.endsWith(".pages.dev")) {
|
|
@@ -79353,6 +79337,7 @@ var printSummary = (ctx) => {
|
|
|
79353
79337
|
]);
|
|
79354
79338
|
const documentationUrl = `https://developers.cloudflare.com/${ctx.template.platform}`;
|
|
79355
79339
|
const discordUrl = `https://discord.cloudflare.com`;
|
|
79340
|
+
const reportIssueUrl = "https://github.com/cloudflare/workers-sdk/issues/new/choose";
|
|
79356
79341
|
const lines = [
|
|
79357
79342
|
`\u{1F389} ${bgGreen(" SUCCESS ")} Application ${ctx.deployment.url ? "deployed" : "created"} successfully!`,
|
|
79358
79343
|
``
|
|
@@ -79374,6 +79359,9 @@ var printSummary = (ctx) => {
|
|
|
79374
79359
|
`\u{1F4D6} Explore Documentation`,
|
|
79375
79360
|
`${blue.underline(hyperlink(documentationUrl))}`,
|
|
79376
79361
|
``,
|
|
79362
|
+
`\u{1F41B} Report an Issue`,
|
|
79363
|
+
`${blue.underline(hyperlink(reportIssueUrl))}`,
|
|
79364
|
+
``,
|
|
79377
79365
|
`\u{1F4AC} Join our Community`,
|
|
79378
79366
|
`${blue.underline(hyperlink(discordUrl))}`
|
|
79379
79367
|
);
|