create-cloudflare 2.70.8 → 2.70.9
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 +65 -56
- package/package.json +4 -4
- package/templates/openapi/ts/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -73650,7 +73650,7 @@ __export(cli_exports, {
|
|
|
73650
73650
|
setupProjectDirectory: () => setupProjectDirectory
|
|
73651
73651
|
});
|
|
73652
73652
|
module.exports = __toCommonJS(cli_exports);
|
|
73653
|
-
var
|
|
73653
|
+
var import_node_fs23 = require("node:fs");
|
|
73654
73654
|
var import_node_path26 = require("node:path");
|
|
73655
73655
|
var import_node_process14 = require("node:process");
|
|
73656
73656
|
|
|
@@ -97210,7 +97210,7 @@ var Yargs = YargsFactory(esm_default2);
|
|
|
97210
97210
|
var yargs_default = Yargs;
|
|
97211
97211
|
|
|
97212
97212
|
// package.json
|
|
97213
|
-
var version = "2.70.
|
|
97213
|
+
var version = "2.70.9";
|
|
97214
97214
|
|
|
97215
97215
|
// src/metrics.ts
|
|
97216
97216
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -97708,7 +97708,7 @@ var runTelemetryCommand = (action) => {
|
|
|
97708
97708
|
};
|
|
97709
97709
|
|
|
97710
97710
|
// src/templates.ts
|
|
97711
|
-
var
|
|
97711
|
+
var import_node_fs20 = require("node:fs");
|
|
97712
97712
|
var import_promises7 = require("node:fs/promises");
|
|
97713
97713
|
var import_node_os7 = require("node:os");
|
|
97714
97714
|
var import_node_path21 = require("node:path");
|
|
@@ -97719,10 +97719,11 @@ var import_degit = __toESM(require_dist());
|
|
|
97719
97719
|
var import_haikunator = __toESM(require_dist_web());
|
|
97720
97720
|
|
|
97721
97721
|
// src/helpers/packages.ts
|
|
97722
|
-
var
|
|
97722
|
+
var import_node_fs10 = require("node:fs");
|
|
97723
97723
|
var import_node_path10 = __toESM(require("node:path"));
|
|
97724
97724
|
|
|
97725
97725
|
// ../cli/dist/packages.mjs
|
|
97726
|
+
var import_node_fs7 = require("node:fs");
|
|
97726
97727
|
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
97727
97728
|
var import_node_assert4 = __toESM(require("node:assert"), 1);
|
|
97728
97729
|
var import_promises3 = require("node:fs/promises");
|
|
@@ -97814,23 +97815,31 @@ function getWorkspaceInstallRootFlag(packageManager, isWorkspaceRoot) {
|
|
|
97814
97815
|
}
|
|
97815
97816
|
}
|
|
97816
97817
|
async function installWrangler(packageManager, isWorkspaceRoot) {
|
|
97817
|
-
|
|
97818
|
+
const packages = [`wrangler@latest`];
|
|
97819
|
+
if (hasDependency("@cloudflare/workers-types")) packages.push("@cloudflare/workers-types@latest");
|
|
97820
|
+
await installPackages(packageManager, packages, {
|
|
97818
97821
|
dev: true,
|
|
97819
97822
|
isWorkspaceRoot,
|
|
97820
97823
|
startText: `Installing wrangler ${dim("A command line tool for building Cloudflare Workers")}`,
|
|
97821
97824
|
doneText: `${brandColor("installed")} ${dim(`via \`${packageManager} install wrangler --save-dev\``)}`
|
|
97822
97825
|
});
|
|
97823
97826
|
}
|
|
97827
|
+
function hasDependency(packageName) {
|
|
97828
|
+
const pkgJsonPath = import_node_path7.default.join(process.cwd(), "package.json");
|
|
97829
|
+
if (!(0, import_node_fs7.existsSync)(pkgJsonPath)) return false;
|
|
97830
|
+
const pkgJson = parsePackageJSON(readFileSync(pkgJsonPath), pkgJsonPath);
|
|
97831
|
+
return Boolean(pkgJson.dependencies?.[packageName] || pkgJson.devDependencies?.[packageName]);
|
|
97832
|
+
}
|
|
97824
97833
|
|
|
97825
97834
|
// src/helpers/packages.ts
|
|
97826
97835
|
var import_undici3 = __toESM(require_undici());
|
|
97827
97836
|
|
|
97828
97837
|
// src/helpers/pnpmBuildApprovals.ts
|
|
97829
|
-
var
|
|
97838
|
+
var import_node_fs9 = require("node:fs");
|
|
97830
97839
|
var import_node_path9 = require("node:path");
|
|
97831
97840
|
|
|
97832
97841
|
// src/helpers/files.ts
|
|
97833
|
-
var
|
|
97842
|
+
var import_node_fs8 = __toESM(require("node:fs"));
|
|
97834
97843
|
var import_node_path8 = require("node:path");
|
|
97835
97844
|
var import_comment_json = __toESM(require_src3());
|
|
97836
97845
|
|
|
@@ -98682,21 +98691,21 @@ var dist_default4 = { parse: parse4, stringify: stringify2, TomlDate: TomlDate2,
|
|
|
98682
98691
|
// src/helpers/files.ts
|
|
98683
98692
|
var writeFile3 = (path6, content) => {
|
|
98684
98693
|
try {
|
|
98685
|
-
|
|
98694
|
+
import_node_fs8.default.writeFileSync(path6, content);
|
|
98686
98695
|
} catch (error2) {
|
|
98687
98696
|
throw new Error(error2);
|
|
98688
98697
|
}
|
|
98689
98698
|
};
|
|
98690
98699
|
var readFile = (path6) => {
|
|
98691
98700
|
try {
|
|
98692
|
-
return
|
|
98701
|
+
return import_node_fs8.default.readFileSync(path6, "utf-8");
|
|
98693
98702
|
} catch (error2) {
|
|
98694
98703
|
throw new Error(error2);
|
|
98695
98704
|
}
|
|
98696
98705
|
};
|
|
98697
98706
|
var removeFile = (path6) => {
|
|
98698
98707
|
try {
|
|
98699
|
-
|
|
98708
|
+
import_node_fs8.default.rmSync(path6, { force: true });
|
|
98700
98709
|
} catch (error2) {
|
|
98701
98710
|
throw new Error(`Remove file failed: ${path6}`, { cause: error2 });
|
|
98702
98711
|
}
|
|
@@ -98712,7 +98721,7 @@ var usesTypescript = (ctx) => {
|
|
|
98712
98721
|
return hasTsConfig(ctx.project.path);
|
|
98713
98722
|
};
|
|
98714
98723
|
var hasTsConfig = (path6) => {
|
|
98715
|
-
return (0,
|
|
98724
|
+
return (0, import_node_fs8.existsSync)((0, import_node_path8.join)(`${path6}`, `tsconfig.json`));
|
|
98716
98725
|
};
|
|
98717
98726
|
|
|
98718
98727
|
// src/helpers/pnpmBuildApprovals.ts
|
|
@@ -98724,7 +98733,7 @@ var writePnpmBuildApprovals = (projectPath) => {
|
|
|
98724
98733
|
return;
|
|
98725
98734
|
}
|
|
98726
98735
|
const yamlPath = (0, import_node_path9.join)(projectPath, "pnpm-workspace.yaml");
|
|
98727
|
-
if (!(0,
|
|
98736
|
+
if (!(0, import_node_fs9.existsSync)(yamlPath)) {
|
|
98728
98737
|
writeFile3(yamlPath, freshWorkspaceYaml());
|
|
98729
98738
|
return;
|
|
98730
98739
|
}
|
|
@@ -98876,7 +98885,7 @@ async function installWrangler2() {
|
|
|
98876
98885
|
}
|
|
98877
98886
|
var npmInstall = async (ctx) => {
|
|
98878
98887
|
const nodeModulesPath = import_node_path10.default.join(ctx.project.path, "node_modules");
|
|
98879
|
-
if ((0,
|
|
98888
|
+
if ((0, import_node_fs10.existsSync)(nodeModulesPath)) {
|
|
98880
98889
|
return;
|
|
98881
98890
|
}
|
|
98882
98891
|
const { npm: npm24 } = detectPackageManager();
|
|
@@ -98999,17 +99008,17 @@ var import_promises4 = __toESM(require("node:fs/promises"), 1);
|
|
|
98999
99008
|
// ../../node_modules/.pnpm/is-wsl@3.1.0/node_modules/is-wsl/index.js
|
|
99000
99009
|
var import_node_process7 = __toESM(require("node:process"), 1);
|
|
99001
99010
|
var import_node_os5 = __toESM(require("node:os"), 1);
|
|
99002
|
-
var
|
|
99011
|
+
var import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
99003
99012
|
|
|
99004
99013
|
// ../../node_modules/.pnpm/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
|
|
99005
|
-
var
|
|
99014
|
+
var import_node_fs12 = __toESM(require("node:fs"), 1);
|
|
99006
99015
|
|
|
99007
99016
|
// ../../node_modules/.pnpm/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
99008
|
-
var
|
|
99017
|
+
var import_node_fs11 = __toESM(require("node:fs"), 1);
|
|
99009
99018
|
var isDockerCached;
|
|
99010
99019
|
function hasDockerEnv() {
|
|
99011
99020
|
try {
|
|
99012
|
-
|
|
99021
|
+
import_node_fs11.default.statSync("/.dockerenv");
|
|
99013
99022
|
return true;
|
|
99014
99023
|
} catch {
|
|
99015
99024
|
return false;
|
|
@@ -99017,7 +99026,7 @@ function hasDockerEnv() {
|
|
|
99017
99026
|
}
|
|
99018
99027
|
function hasDockerCGroup() {
|
|
99019
99028
|
try {
|
|
99020
|
-
return
|
|
99029
|
+
return import_node_fs11.default.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
99021
99030
|
} catch {
|
|
99022
99031
|
return false;
|
|
99023
99032
|
}
|
|
@@ -99033,7 +99042,7 @@ function isDocker() {
|
|
|
99033
99042
|
var cachedResult;
|
|
99034
99043
|
var hasContainerEnv = () => {
|
|
99035
99044
|
try {
|
|
99036
|
-
|
|
99045
|
+
import_node_fs12.default.statSync("/run/.containerenv");
|
|
99037
99046
|
return true;
|
|
99038
99047
|
} catch {
|
|
99039
99048
|
return false;
|
|
@@ -99058,7 +99067,7 @@ var isWsl = () => {
|
|
|
99058
99067
|
return true;
|
|
99059
99068
|
}
|
|
99060
99069
|
try {
|
|
99061
|
-
return
|
|
99070
|
+
return import_node_fs13.default.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
99062
99071
|
} catch {
|
|
99063
99072
|
return false;
|
|
99064
99073
|
}
|
|
@@ -99657,7 +99666,7 @@ var WRANGLER_DEFAULTS = {
|
|
|
99657
99666
|
};
|
|
99658
99667
|
|
|
99659
99668
|
// ../codemod/dist/index.mjs
|
|
99660
|
-
var
|
|
99669
|
+
var import_node_fs14 = require("node:fs");
|
|
99661
99670
|
var import_node_path12 = __toESM(require("node:path"), 1);
|
|
99662
99671
|
var recast = __toESM(require_main2(), 1);
|
|
99663
99672
|
var esprimaParser = __toESM(require_esprima3(), 1);
|
|
@@ -99686,7 +99695,7 @@ function parseFile(filePath) {
|
|
|
99686
99695
|
const lang = import_node_path12.default.extname(filePath).slice(1);
|
|
99687
99696
|
const parser2 = lang === "js" ? esprimaParser : typescriptParser;
|
|
99688
99697
|
try {
|
|
99689
|
-
const fileContents = (0,
|
|
99698
|
+
const fileContents = (0, import_node_fs14.readFileSync)(import_node_path12.default.resolve(filePath), "utf-8");
|
|
99690
99699
|
if (fileContents) {
|
|
99691
99700
|
return recast.parse(fileContents, { parser: parser2 }).program;
|
|
99692
99701
|
}
|
|
@@ -99700,7 +99709,7 @@ function transformFile(filePath, methods) {
|
|
|
99700
99709
|
const ast = parseFile(filePath);
|
|
99701
99710
|
if (ast) {
|
|
99702
99711
|
recast.visit(ast, methods);
|
|
99703
|
-
(0,
|
|
99712
|
+
(0, import_node_fs14.writeFileSync)(filePath, recast.print(ast).code);
|
|
99704
99713
|
}
|
|
99705
99714
|
}
|
|
99706
99715
|
__name2(transformFile, "transformFile");
|
|
@@ -99790,7 +99799,7 @@ var runFrameworkGenerator = async (ctx, args) => {
|
|
|
99790
99799
|
};
|
|
99791
99800
|
|
|
99792
99801
|
// src/helpers/compatDate.ts
|
|
99793
|
-
var
|
|
99802
|
+
var import_node_fs15 = require("node:fs");
|
|
99794
99803
|
var import_node_path13 = require("node:path");
|
|
99795
99804
|
function getWorkerdCompatibilityDate(_projectPath) {
|
|
99796
99805
|
const s = spinner();
|
|
@@ -99807,7 +99816,7 @@ function getLatestTypesEntrypoint(ctx) {
|
|
|
99807
99816
|
"workers-types"
|
|
99808
99817
|
);
|
|
99809
99818
|
try {
|
|
99810
|
-
const entrypoints = (0,
|
|
99819
|
+
const entrypoints = (0, import_node_fs15.readdirSync)(workersTypesPath);
|
|
99811
99820
|
const sorted = entrypoints.filter((filename) => filename.match(/(\d{4})-(\d{2})-(\d{2})/)).sort().reverse();
|
|
99812
99821
|
if (sorted.length === 0) {
|
|
99813
99822
|
return null;
|
|
@@ -100870,7 +100879,7 @@ var config25 = {
|
|
|
100870
100879
|
var c3_default28 = config25;
|
|
100871
100880
|
|
|
100872
100881
|
// templates/pre-existing/c3.ts
|
|
100873
|
-
var
|
|
100882
|
+
var import_node_fs16 = require("node:fs");
|
|
100874
100883
|
var import_promises6 = require("node:fs/promises");
|
|
100875
100884
|
var import_node_os6 = require("node:os");
|
|
100876
100885
|
var import_node_path16 = require("node:path");
|
|
@@ -101034,7 +101043,7 @@ async function copyExistingWorkerFiles(ctx) {
|
|
|
101034
101043
|
let configFileCopied = false;
|
|
101035
101044
|
for (const configFile of configFiles) {
|
|
101036
101045
|
const sourcePath = (0, import_node_path16.join)(tempdir, ctx.args.existingScript, configFile);
|
|
101037
|
-
if ((0,
|
|
101046
|
+
if ((0, import_node_fs16.existsSync)(sourcePath)) {
|
|
101038
101047
|
await (0, import_promises6.cp)(sourcePath, (0, import_node_path16.join)(ctx.project.path, configFile));
|
|
101039
101048
|
configFileCopied = true;
|
|
101040
101049
|
break;
|
|
@@ -101106,15 +101115,15 @@ var config27 = {
|
|
|
101106
101115
|
var c3_default30 = config27;
|
|
101107
101116
|
|
|
101108
101117
|
// src/helpers/codemod.ts
|
|
101109
|
-
var
|
|
101118
|
+
var import_node_fs17 = require("node:fs");
|
|
101110
101119
|
var import_node_path17 = require("node:path");
|
|
101111
101120
|
var loadSnippets = (parentFolder) => {
|
|
101112
101121
|
const snippetsPath = (0, import_node_path17.join)(parentFolder, "snippets");
|
|
101113
|
-
if (!(0,
|
|
101122
|
+
if (!(0, import_node_fs17.lstatSync)(snippetsPath, { throwIfNoEntry: false })?.isDirectory()) {
|
|
101114
101123
|
return {};
|
|
101115
101124
|
}
|
|
101116
|
-
const files = (0,
|
|
101117
|
-
return files.filter((fileName) => (0,
|
|
101125
|
+
const files = (0, import_node_fs17.readdirSync)(snippetsPath);
|
|
101126
|
+
return files.filter((fileName) => (0, import_node_fs17.lstatSync)((0, import_node_path17.join)(snippetsPath, fileName)).isFile()).filter((fileName) => [".js", ".ts"].includes((0, import_node_path17.extname)(fileName))).reduce((acc, snippetPath) => {
|
|
101118
101127
|
const [file2, ext] = snippetPath.split(".");
|
|
101119
101128
|
const key = `${file2}${ext === "js" ? "Js" : "Ts"}`;
|
|
101120
101129
|
return {
|
|
@@ -101700,7 +101709,7 @@ var config37 = {
|
|
|
101700
101709
|
var c3_default40 = config37;
|
|
101701
101710
|
|
|
101702
101711
|
// templates/svelte/pages/c3.ts
|
|
101703
|
-
var
|
|
101712
|
+
var import_node_fs18 = require("node:fs");
|
|
101704
101713
|
var recast10 = __toESM(require_main2());
|
|
101705
101714
|
var { npm: npm17 } = detectPackageManager();
|
|
101706
101715
|
var generate23 = async (ctx) => {
|
|
@@ -101732,7 +101741,7 @@ var updateSvelteConfig = () => {
|
|
|
101732
101741
|
};
|
|
101733
101742
|
var updatePlaywrightConfig = (shouldUseTypescript) => {
|
|
101734
101743
|
const filePath = `playwright.config.${shouldUseTypescript ? "ts" : "js"}`;
|
|
101735
|
-
if (!(0,
|
|
101744
|
+
if (!(0, import_node_fs18.existsSync)(filePath)) {
|
|
101736
101745
|
return;
|
|
101737
101746
|
}
|
|
101738
101747
|
updateStatus(`Changing webServer port in ${blue(filePath)}`);
|
|
@@ -102255,7 +102264,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
|
|
|
102255
102264
|
var import_node_assert6 = __toESM(require("node:assert"));
|
|
102256
102265
|
|
|
102257
102266
|
// ../wrangler/package.json
|
|
102258
|
-
var version2 = "4.
|
|
102267
|
+
var version2 = "4.108.0";
|
|
102259
102268
|
|
|
102260
102269
|
// src/git.ts
|
|
102261
102270
|
var offerGit = async (ctx) => {
|
|
@@ -102443,7 +102452,7 @@ async function getProductionBranch(cwd) {
|
|
|
102443
102452
|
}
|
|
102444
102453
|
|
|
102445
102454
|
// src/validators.ts
|
|
102446
|
-
var
|
|
102455
|
+
var import_node_fs19 = require("node:fs");
|
|
102447
102456
|
var import_node_path20 = require("node:path");
|
|
102448
102457
|
var TEMPLATE_REGEX = /^(?:(?:https:\/\/)?(?<httpsUrl>[^:/]+\.[^:/]+)\/|git@(?<gitUrl>[^:/]+)[:/]|(?<shorthandUrl>[^/]+):)?(?<user>[^/\s]+)\/(?<repository>[^/\s#]+)(?:(?<subdirectoryPath>(?:\/[^/\s#]+)+))?(?:\/)?(?:#(?<tag>.+))?/;
|
|
102449
102458
|
var validateTemplateUrl = (value) => {
|
|
@@ -102453,9 +102462,9 @@ var validateTemplateUrl = (value) => {
|
|
|
102453
102462
|
};
|
|
102454
102463
|
var validateProjectDirectory = (relativePath, args) => {
|
|
102455
102464
|
const path6 = (0, import_node_path20.resolve)(relativePath);
|
|
102456
|
-
const existsAlready = (0,
|
|
102465
|
+
const existsAlready = (0, import_node_fs19.existsSync)(path6);
|
|
102457
102466
|
if (existsAlready) {
|
|
102458
|
-
for (const file2 of (0,
|
|
102467
|
+
for (const file2 of (0, import_node_fs19.readdirSync)(path6)) {
|
|
102459
102468
|
if (!isAllowedExistingFile(file2)) {
|
|
102460
102469
|
return `Directory \`${relativePath}\` already exists and contains files that might conflict. Please choose a new name.`;
|
|
102461
102470
|
}
|
|
@@ -102981,14 +102990,14 @@ async function copyTemplateFiles(ctx) {
|
|
|
102981
102990
|
s.start(`Copying template files`);
|
|
102982
102991
|
await (0, import_promises7.cp)(srcdir, destdir, { recursive: true, force: true });
|
|
102983
102992
|
const dummyGitIgnorePath = (0, import_node_path21.join)(destdir, "__dot__gitignore");
|
|
102984
|
-
if ((0,
|
|
102993
|
+
if ((0, import_node_fs20.existsSync)(dummyGitIgnorePath)) {
|
|
102985
102994
|
await (0, import_promises7.rename)(dummyGitIgnorePath, (0, import_node_path21.join)(destdir, ".gitignore"));
|
|
102986
102995
|
}
|
|
102987
102996
|
s.stop(`${brandColor("files")} ${dim("copied to project directory")}`);
|
|
102988
102997
|
}
|
|
102989
102998
|
function writeAgentsMd(projectPath) {
|
|
102990
102999
|
const agentsMdPath = (0, import_node_path21.join)(projectPath, "AGENTS.md");
|
|
102991
|
-
if ((0,
|
|
103000
|
+
if ((0, import_node_fs20.existsSync)(agentsMdPath)) {
|
|
102992
103001
|
return;
|
|
102993
103002
|
}
|
|
102994
103003
|
writeFile3(agentsMdPath, getAgentsMd());
|
|
@@ -103029,14 +103038,14 @@ var validateTemplateSrcDirectory = (path6, config49) => {
|
|
|
103029
103038
|
const wranglerTomlPath = (0, import_node_path21.resolve)(path6, "wrangler.toml");
|
|
103030
103039
|
const wranglerJsonPath = (0, import_node_path21.resolve)(path6, "wrangler.json");
|
|
103031
103040
|
const wranglerJsoncPath = (0, import_node_path21.resolve)(path6, "wrangler.jsonc");
|
|
103032
|
-
if (!(0,
|
|
103041
|
+
if (!(0, import_node_fs20.existsSync)(wranglerTomlPath) && !(0, import_node_fs20.existsSync)(wranglerJsonPath) && !(0, import_node_fs20.existsSync)(wranglerJsoncPath)) {
|
|
103033
103042
|
throw new Error(
|
|
103034
103043
|
`create-cloudflare templates must contain a "wrangler.toml" or "wrangler.json(c)" file.`
|
|
103035
103044
|
);
|
|
103036
103045
|
}
|
|
103037
103046
|
}
|
|
103038
103047
|
const pkgJsonPath = (0, import_node_path21.resolve)(path6, "package.json");
|
|
103039
|
-
if (!(0,
|
|
103048
|
+
if (!(0, import_node_fs20.existsSync)(pkgJsonPath)) {
|
|
103040
103049
|
throw new Error(
|
|
103041
103050
|
`create-cloudflare templates must contain a "package.json" file.`
|
|
103042
103051
|
);
|
|
@@ -103053,10 +103062,10 @@ var inferTemplateConfig = (path6) => {
|
|
|
103053
103062
|
};
|
|
103054
103063
|
var inferCopyFilesDefinition = (path6) => {
|
|
103055
103064
|
const variants = {};
|
|
103056
|
-
if ((0,
|
|
103065
|
+
if ((0, import_node_fs20.existsSync)((0, import_node_path21.join)(path6, "js"))) {
|
|
103057
103066
|
variants["js"] = { path: "./js" };
|
|
103058
103067
|
}
|
|
103059
|
-
if ((0,
|
|
103068
|
+
if ((0, import_node_fs20.existsSync)((0, import_node_path21.join)(path6, "ts"))) {
|
|
103060
103069
|
variants["ts"] = { path: "./ts" };
|
|
103061
103070
|
}
|
|
103062
103071
|
const copyFiles = Object.keys(variants).length !== 0 ? { variants } : { path: "." };
|
|
@@ -103101,7 +103110,7 @@ Use the format "github:<owner>/<repo>/sub/directory[#<branch>]" to clone a speci
|
|
|
103101
103110
|
}
|
|
103102
103111
|
function updatePythonPackageName(path6, projectName) {
|
|
103103
103112
|
const pyProjectFile = (0, import_node_path21.resolve)(path6, "pyproject.toml");
|
|
103104
|
-
if (!(0,
|
|
103113
|
+
if (!(0, import_node_fs20.existsSync)(pyProjectFile)) {
|
|
103105
103114
|
return;
|
|
103106
103115
|
}
|
|
103107
103116
|
const s = spinner();
|
|
@@ -103611,7 +103620,7 @@ function secondsSince(start) {
|
|
|
103611
103620
|
}
|
|
103612
103621
|
|
|
103613
103622
|
// src/wrangler/config.ts
|
|
103614
|
-
var
|
|
103623
|
+
var import_node_fs21 = require("node:fs");
|
|
103615
103624
|
var import_node_path22 = require("node:path");
|
|
103616
103625
|
|
|
103617
103626
|
// src/helpers/json.ts
|
|
@@ -103734,12 +103743,12 @@ var getWranglerJsoncPath = (ctx) => {
|
|
|
103734
103743
|
};
|
|
103735
103744
|
var wranglerTomlExists = (ctx) => {
|
|
103736
103745
|
const wranglerTomlPath = getWranglerTomlPath(ctx);
|
|
103737
|
-
return (0,
|
|
103746
|
+
return (0, import_node_fs21.existsSync)(wranglerTomlPath);
|
|
103738
103747
|
};
|
|
103739
103748
|
var wranglerJsonOrJsoncExists = (ctx) => {
|
|
103740
103749
|
const wranglerJsonPath = getWranglerJsonPath(ctx);
|
|
103741
103750
|
const wranglerJsoncPath = getWranglerJsoncPath(ctx);
|
|
103742
|
-
return (0,
|
|
103751
|
+
return (0, import_node_fs21.existsSync)(wranglerJsonPath) || (0, import_node_fs21.existsSync)(wranglerJsoncPath);
|
|
103743
103752
|
};
|
|
103744
103753
|
var readWranglerToml = (ctx) => {
|
|
103745
103754
|
const wranglerTomlPath = getWranglerTomlPath(ctx);
|
|
@@ -103747,7 +103756,7 @@ var readWranglerToml = (ctx) => {
|
|
|
103747
103756
|
};
|
|
103748
103757
|
var readWranglerJsonOrJsonc = (ctx, reviver) => {
|
|
103749
103758
|
const wranglerJsonPath = getWranglerJsonPath(ctx);
|
|
103750
|
-
if ((0,
|
|
103759
|
+
if ((0, import_node_fs21.existsSync)(wranglerJsonPath)) {
|
|
103751
103760
|
return readJSONWithComments(wranglerJsonPath, reviver);
|
|
103752
103761
|
}
|
|
103753
103762
|
const wranglerJsoncPath = getWranglerJsoncPath(ctx);
|
|
@@ -103759,7 +103768,7 @@ var writeWranglerToml = (ctx, contents) => {
|
|
|
103759
103768
|
};
|
|
103760
103769
|
var writeWranglerJsonOrJsonc = (ctx, config49) => {
|
|
103761
103770
|
const wranglerJsonPath = getWranglerJsonPath(ctx);
|
|
103762
|
-
if ((0,
|
|
103771
|
+
if ((0, import_node_fs21.existsSync)(wranglerJsonPath)) {
|
|
103763
103772
|
return writeJSONWithComments(wranglerJsonPath, config49);
|
|
103764
103773
|
}
|
|
103765
103774
|
const wranglerJsoncPath = getWranglerJsoncPath(ctx);
|
|
@@ -103767,10 +103776,10 @@ var writeWranglerJsonOrJsonc = (ctx, config49) => {
|
|
|
103767
103776
|
};
|
|
103768
103777
|
var addVscodeConfig = (ctx) => {
|
|
103769
103778
|
const settingsPath = `${ctx.project.path}/.vscode/settings.json`;
|
|
103770
|
-
if ((0,
|
|
103779
|
+
if ((0, import_node_fs21.existsSync)(settingsPath)) {
|
|
103771
103780
|
return;
|
|
103772
103781
|
}
|
|
103773
|
-
(0,
|
|
103782
|
+
(0, import_node_fs21.mkdirSync)(`${ctx.project.path}/.vscode`, { recursive: true });
|
|
103774
103783
|
writeJSON(settingsPath, {
|
|
103775
103784
|
"files.associations": {
|
|
103776
103785
|
"wrangler.json": "jsonc"
|
|
@@ -104510,7 +104519,7 @@ var createProject = async (ctx) => {
|
|
|
104510
104519
|
};
|
|
104511
104520
|
|
|
104512
104521
|
// src/workers.ts
|
|
104513
|
-
var
|
|
104522
|
+
var import_node_fs22 = require("node:fs");
|
|
104514
104523
|
var import_node_path25 = require("node:path");
|
|
104515
104524
|
|
|
104516
104525
|
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
@@ -105842,7 +105851,7 @@ async function addTypes(ctx) {
|
|
|
105842
105851
|
}
|
|
105843
105852
|
async function generateWorkersTypes(ctx, npm24) {
|
|
105844
105853
|
const packageJsonPath = (0, import_node_path25.join)(ctx.project.path, "package.json");
|
|
105845
|
-
if (!(0,
|
|
105854
|
+
if (!(0, import_node_fs22.existsSync)(packageJsonPath)) {
|
|
105846
105855
|
return;
|
|
105847
105856
|
}
|
|
105848
105857
|
const packageManifest = readJSON(packageJsonPath);
|
|
@@ -105882,7 +105891,7 @@ var maybeInstallNodeTypes = async (ctx, npm24) => {
|
|
|
105882
105891
|
};
|
|
105883
105892
|
async function updateTsConfig(ctx, { usesNodeCompat }) {
|
|
105884
105893
|
const tsconfigPath = (0, import_node_path25.join)(ctx.project.path, "tsconfig.json");
|
|
105885
|
-
if (!(0,
|
|
105894
|
+
if (!(0, import_node_fs22.existsSync)(tsconfigPath)) {
|
|
105886
105895
|
return;
|
|
105887
105896
|
}
|
|
105888
105897
|
const tsconfig = readFile(tsconfigPath);
|
|
@@ -105902,7 +105911,7 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
|
|
|
105902
105911
|
newTypes.delete("@cloudflare/workers-types");
|
|
105903
105912
|
if (entrypointVersion !== null) {
|
|
105904
105913
|
newTypes.add(`@cloudflare/workers-types/${entrypointVersion}`);
|
|
105905
|
-
} else if ((0,
|
|
105914
|
+
} else if ((0, import_node_fs22.existsSync)(
|
|
105906
105915
|
(0, import_node_path25.join)(
|
|
105907
105916
|
ctx.project.path,
|
|
105908
105917
|
"node_modules",
|
|
@@ -106017,7 +106026,7 @@ var setupProjectDirectory = (ctx) => {
|
|
|
106017
106026
|
throw new Error(err);
|
|
106018
106027
|
}
|
|
106019
106028
|
const directory = (0, import_node_path26.dirname)(path6);
|
|
106020
|
-
(0,
|
|
106029
|
+
(0, import_node_fs23.mkdirSync)(directory, { recursive: true });
|
|
106021
106030
|
(0, import_node_process14.chdir)(directory);
|
|
106022
106031
|
};
|
|
106023
106032
|
var create = async (ctx) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-cloudflare",
|
|
3
|
-
"version": "2.70.
|
|
3
|
+
"version": "2.70.9",
|
|
4
4
|
"description": "A CLI for creating and deploying new applications to Cloudflare.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@babel/parser": "^7.21.3",
|
|
32
32
|
"@babel/types": "^7.21.4",
|
|
33
33
|
"@clack/prompts": "^1.2.0",
|
|
34
|
-
"@cloudflare/workers-types": "^
|
|
34
|
+
"@cloudflare/workers-types": "^5.20260706.1",
|
|
35
35
|
"@types/command-exists": "^1.2.0",
|
|
36
36
|
"@types/cross-spawn": "^6.0.2",
|
|
37
37
|
"@types/deepmerge": "^2.2.0",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"@cloudflare/cli-shared-helpers": "0.1.12",
|
|
75
75
|
"@cloudflare/codemod": "1.1.0",
|
|
76
76
|
"@cloudflare/mock-npm-registry": "0.0.0",
|
|
77
|
-
"@cloudflare/vite-plugin": "1.43.
|
|
77
|
+
"@cloudflare/vite-plugin": "1.43.2",
|
|
78
78
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
79
79
|
"@cloudflare/workers-utils": "0.25.1",
|
|
80
|
-
"wrangler": "4.
|
|
80
|
+
"wrangler": "4.108.0"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=22.0.0"
|