diff --git a/.changeset/metal-cooks-wonder.md b/.changeset/metal-cooks-wonder.md new file mode 100644 index 000000000000..f6ab7b229abd --- /dev/null +++ b/.changeset/metal-cooks-wonder.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +Add more fields to the `tsconfig.json` generated by `wrangler init` diff --git a/.vscode/extensions.json b/.vscode/extensions.json index c99c6248cd01..1d7ac851ea8a 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,3 @@ { - "recommendations": [ - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode" - ] -} \ No newline at end of file + "recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"] +} diff --git a/package-lock.json b/package-lock.json index f6c44e8c24c0..23b5902d1c76 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13442,7 +13442,7 @@ "dependencies": { "@cloudflare/pages-functions-compiler": "0.3.8", "esbuild": "0.14.1", - "miniflare": "^2.0.0-rc.4", + "miniflare": "2.0.0-rc.4", "semiver": "^1.1.0" }, "bin": { diff --git a/packages/wrangler/package.json b/packages/wrangler/package.json index 1384fe28cd02..3a945610f1ea 100644 --- a/packages/wrangler/package.json +++ b/packages/wrangler/package.json @@ -38,7 +38,7 @@ "dependencies": { "@cloudflare/pages-functions-compiler": "0.3.8", "esbuild": "0.14.1", - "miniflare": "^2.0.0-rc.4", + "miniflare": "2.0.0-rc.4", "semiver": "^1.1.0" }, "optionalDependencies": { diff --git a/packages/wrangler/src/index.tsx b/packages/wrangler/src/index.tsx index 5e118375e274..7dbc57a69ef3 100644 --- a/packages/wrangler/src/index.tsx +++ b/packages/wrangler/src/index.tsx @@ -216,7 +216,7 @@ export async function main(argv: string[]): Promise { destination, `compatibility_date = "${compatibilityDate}"` + "\n" ); - console.log(`✨ Succesfully created wrangler.toml`); + console.log(`✨ Successfully created wrangler.toml`); // TODO: suggest next steps? } catch (err) { console.error(`Failed to create wrangler.toml`); @@ -260,9 +260,17 @@ export async function main(argv: string[]): Promise { JSON.stringify( { compilerOptions: { - target: "ES2020", - module: "CommonJS", - lib: ["ES2020"], + target: "esnext", + module: "esnext", + moduleResolution: "node", + esModuleInterop: true, + allowJs: true, + allowSyntheticDefaultImports: true, + isolatedModules: true, + noEmit: true, + lib: ["esnext"], + jsx: "react", + resolveJsonModule: true, types: ["@cloudflare/workers-types"], }, }, @@ -1568,7 +1576,7 @@ export async function main(argv: string[]): Promise { // -- snip, end -- // annoyingly, the API for this one doesn't return the - // data in the 'standard' format. goddamit. + // data in the 'standard' format. goddammit. // That's why we have the fallthrough response in cfetch. // Oh well. console.log( diff --git a/tsconfig.json b/tsconfig.json index b263ba879f20..939fdad33335 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,5 @@ "jsx": "react", "resolveJsonModule": true }, - "lib": ["esnext"], "exclude": ["node_modules/", "packages/wrangler/vendor"] }