create-cloudflare 0.0.0-99f27df05 → 0.0.0-9a3d52571
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 +42 -32
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -5
- package/templates/analog/templates/worker-configuration.d.ts +1 -1
- package/templates/astro/templates/ts/worker-configuration.d.ts +1 -1
- package/templates/common/ts/src/index.ts +1 -1
- package/templates/common/ts/worker-configuration.d.ts +1 -1
- package/templates/hello-world/js/package.json +2 -2
- package/templates/hello-world/js/test/index.spec.js +1 -1
- package/templates/hello-world/js/vitest.config.js +1 -1
- package/templates/hello-world/ts/package.json +2 -2
- package/templates/hello-world/ts/src/index.ts +1 -1
- package/templates/hello-world/ts/vitest.config.mts +1 -1
- package/templates/hello-world/ts/worker-configuration.d.ts +1 -1
- package/templates/hello-world-durable-object/js/src/index.js +3 -3
- package/templates/hello-world-durable-object/ts/src/index.ts +3 -3
- package/templates/hono/templates/worker-configuration.d.ts +1 -1
- package/templates/next/README.md +2 -3
- package/templates/next/c3.ts +8 -26
- package/templates/nuxt/templates/worker-configuration.d.ts +1 -1
- package/templates/openapi/ts/worker-configuration.d.ts +1 -1
- package/templates/pre-existing/c3.ts +3 -3
- package/templates/queues/ts/src/index.ts +1 -1
- package/templates/queues/ts/worker-configuration.d.ts +1 -1
- package/templates/qwik/templates/worker-configuration.d.ts +1 -1
- package/templates/remix/templates/worker-configuration.d.ts +1 -1
- package/templates/scheduled/js/src/index.js +1 -1
- package/templates/scheduled/ts/src/index.ts +4 -4
- package/templates/scheduled/ts/worker-configuration.d.ts +1 -1
- package/templates-experimental/astro/templates/ts/worker-configuration.d.ts +1 -1
- package/templates-experimental/hello-world-durable-object-with-assets/js/src/index.js +3 -3
- package/templates-experimental/hello-world-durable-object-with-assets/ts/src/index.ts +3 -3
- package/templates-experimental/hello-world-with-assets/js/package.json +2 -2
- package/templates-experimental/hello-world-with-assets/js/vitest.config.js +1 -1
- package/templates-experimental/hello-world-with-assets/ts/package.json +2 -2
- package/templates-experimental/hello-world-with-assets/ts/src/index.ts +1 -1
- package/templates-experimental/hello-world-with-assets/ts/vitest.config.mts +1 -1
- package/templates-experimental/hello-world-with-assets/ts/worker-configuration.d.ts +1 -1
- package/templates-experimental/hono/templates/worker-configuration.d.ts +1 -1
- package/templates-experimental/next/c3.ts +26 -1
- package/templates-experimental/nuxt/templates/worker-configuration.d.ts +1 -1
- package/templates-experimental/qwik/templates/worker-configuration.d.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -73294,7 +73294,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
73294
73294
|
var yargs_default = Yargs;
|
|
73295
73295
|
|
|
73296
73296
|
// package.json
|
|
73297
|
-
var version = "0.0.0-
|
|
73297
|
+
var version = "0.0.0-9a3d52571";
|
|
73298
73298
|
|
|
73299
73299
|
// src/metrics.ts
|
|
73300
73300
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -75362,18 +75362,18 @@ var package_default = {
|
|
|
75362
75362
|
dependencies: {
|
|
75363
75363
|
"create-astro": "4.11.0",
|
|
75364
75364
|
"create-analog": "1.8.1",
|
|
75365
|
-
"@angular/create": "19.
|
|
75365
|
+
"@angular/create": "19.1.6",
|
|
75366
75366
|
"create-docusaurus": "3.7.0",
|
|
75367
|
-
"create-hono": "0.
|
|
75368
|
-
"create-next-app": "15.1.
|
|
75367
|
+
"create-hono": "0.15.3",
|
|
75368
|
+
"create-next-app": "15.1.6",
|
|
75369
75369
|
"create-qwik": "1.12.0",
|
|
75370
75370
|
"create-vite": "6.1.1",
|
|
75371
|
-
"create-remix": "2.15.
|
|
75371
|
+
"create-remix": "2.15.3",
|
|
75372
75372
|
"create-solid": "0.5.14",
|
|
75373
|
-
"create-vue": "3.
|
|
75373
|
+
"create-vue": "3.14.0",
|
|
75374
75374
|
gatsby: "5.14.1",
|
|
75375
|
-
sv: "0.6.
|
|
75376
|
-
nuxi: "3.
|
|
75375
|
+
sv: "0.6.16",
|
|
75376
|
+
nuxi: "3.21.1"
|
|
75377
75377
|
}
|
|
75378
75378
|
};
|
|
75379
75379
|
|
|
@@ -75819,7 +75819,7 @@ var generate6 = async (ctx) => {
|
|
|
75819
75819
|
};
|
|
75820
75820
|
var configure3 = async () => {
|
|
75821
75821
|
const packages = [
|
|
75822
|
-
"@opennextjs/cloudflare@0.
|
|
75822
|
+
"@opennextjs/cloudflare@0.4.x",
|
|
75823
75823
|
"@cloudflare/workers-types"
|
|
75824
75824
|
];
|
|
75825
75825
|
await installPackages(packages, {
|
|
@@ -75827,6 +75827,20 @@ var configure3 = async () => {
|
|
|
75827
75827
|
startText: "Adding the Cloudflare adapter",
|
|
75828
75828
|
doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
|
|
75829
75829
|
});
|
|
75830
|
+
updateNextConfig();
|
|
75831
|
+
};
|
|
75832
|
+
var updateNextConfig = () => {
|
|
75833
|
+
const s = spinner();
|
|
75834
|
+
const configFile = "next.config.mjs";
|
|
75835
|
+
s.start(`Updating \`${configFile}\``);
|
|
75836
|
+
const configContent = readFile(configFile);
|
|
75837
|
+
const updatedConfigFile = configContent + `
|
|
75838
|
+
// added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
|
|
75839
|
+
import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
|
|
75840
|
+
initOpenNextCloudflareForDev();
|
|
75841
|
+
`.replace(/\n\t*/g, "\n");
|
|
75842
|
+
writeFile2(configFile, updatedConfigFile);
|
|
75843
|
+
s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
|
|
75830
75844
|
};
|
|
75831
75845
|
var c3_default9 = {
|
|
75832
75846
|
configVersion: 1,
|
|
@@ -75868,13 +75882,17 @@ async function getWorkerdCompatibilityDate() {
|
|
|
75868
75882
|
const match = latestWorkerdVersion.match(/\d+\.(\d{4})(\d{2})(\d{2})\.\d+/);
|
|
75869
75883
|
if (match) {
|
|
75870
75884
|
const [, year, month, date] = match;
|
|
75871
|
-
|
|
75872
|
-
|
|
75873
|
-
|
|
75885
|
+
let compatDate = /* @__PURE__ */ new Date(`${year}-${month}-${date}`);
|
|
75886
|
+
if (compatDate.getTime() > Date.now()) {
|
|
75887
|
+
compatDate = new Date(Date.now());
|
|
75888
|
+
}
|
|
75889
|
+
const compatDateString = compatDate.toISOString().slice(0, 10);
|
|
75890
|
+
s.stop(`${brandColor("compatibility date")} ${dim(compatDateString)}`);
|
|
75891
|
+
return compatDateString;
|
|
75874
75892
|
}
|
|
75875
75893
|
} catch {
|
|
75876
75894
|
}
|
|
75877
|
-
const fallbackDate = "
|
|
75895
|
+
const fallbackDate = "2024-11-11";
|
|
75878
75896
|
s.stop(
|
|
75879
75897
|
`${brandColor("compatibility date")} ${dim(
|
|
75880
75898
|
` Could not find workerd date, falling back to ${fallbackDate}`
|
|
@@ -76803,31 +76821,23 @@ var { npm: npm14, npx: npx4 } = detectPackageManager();
|
|
|
76803
76821
|
var generate19 = async (ctx) => {
|
|
76804
76822
|
const projectName = ctx.project.name;
|
|
76805
76823
|
await runFrameworkGenerator(ctx, [projectName]);
|
|
76806
|
-
const
|
|
76807
|
-
|
|
76808
|
-
|
|
76809
|
-
($1) => `# KV Example:
|
|
76810
|
-
${$1}`
|
|
76811
|
-
);
|
|
76812
|
-
if (!/# KV Example/.test(newTomlContent)) {
|
|
76813
|
-
throw new Error("Failed to properly generate the wrangler.toml file");
|
|
76814
|
-
}
|
|
76815
|
-
writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.toml"), newTomlContent);
|
|
76816
|
-
updateStatus("Created wrangler.toml file");
|
|
76824
|
+
const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.json"));
|
|
76825
|
+
writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.json"), wranglerConfig);
|
|
76826
|
+
updateStatus("Created wrangler.json file");
|
|
76817
76827
|
};
|
|
76818
|
-
var
|
|
76828
|
+
var updateNextConfig2 = (usesTs) => {
|
|
76819
76829
|
const s = spinner();
|
|
76820
76830
|
const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
|
|
76821
76831
|
s.start(`Updating \`${configFile}\``);
|
|
76822
76832
|
const configContent = readFile(configFile);
|
|
76823
76833
|
const updatedConfigFile = `import { setupDevPlatform } from '@cloudflare/next-on-pages/next-dev';
|
|
76824
76834
|
|
|
76825
|
-
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to
|
|
76826
|
-
// (when running the application with
|
|
76835
|
+
// Here we use the @cloudflare/next-on-pages next-dev module to allow us to
|
|
76836
|
+
// use bindings during local development (when running the application with
|
|
76837
|
+
// \`next dev\`). This function is only necessary during development and
|
|
76838
|
+
// has no impact outside of that. For more information see:
|
|
76827
76839
|
// https://github.com/cloudflare/next-on-pages/blob/main/internal-packages/next-dev/README.md
|
|
76828
|
-
|
|
76829
|
-
await setupDevPlatform();
|
|
76830
|
-
}
|
|
76840
|
+
setupDevPlatform().catch(console.error);
|
|
76831
76841
|
|
|
76832
76842
|
`.replace(/\n\t*/g, "\n") + configContent;
|
|
76833
76843
|
writeFile2(configFile, updatedConfigFile);
|
|
@@ -76858,7 +76868,7 @@ var configure13 = async (ctx) => {
|
|
|
76858
76868
|
if (installEslintPlugin) {
|
|
76859
76869
|
await writeEslintrc(ctx);
|
|
76860
76870
|
}
|
|
76861
|
-
|
|
76871
|
+
updateNextConfig2(usesTs);
|
|
76862
76872
|
copyFile(
|
|
76863
76873
|
(0, import_path10.join)(getTemplatePath(ctx), "README.md"),
|
|
76864
76874
|
(0, import_path10.join)(projectPath, "README.md")
|
|
@@ -77726,7 +77736,7 @@ var config26 = {
|
|
|
77726
77736
|
var c3_default36 = config26;
|
|
77727
77737
|
|
|
77728
77738
|
// ../wrangler/package.json
|
|
77729
|
-
var version2 = "0.0.0-
|
|
77739
|
+
var version2 = "0.0.0-9a3d52571";
|
|
77730
77740
|
|
|
77731
77741
|
// src/git.ts
|
|
77732
77742
|
var offerGit = async (ctx) => {
|