You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"`wrangler types` now outputs runtime and Env types in one file.\nYou can now delete the ./.wrangler/types/runtime.d.ts and update your tsconfig.json`"
25
+
)
26
+
);
27
+
logger.log("");
28
+
}
29
+
if(isWorkersTypesInstalled){
30
+
logAction(
31
+
"Migrate from @cloudflare/workers-types to generated runtime types"
32
+
);
33
+
logger.log(
34
+
chalk.dim(
35
+
"`wrangler types` now generates runtime types and supersedes @cloudflare/workers-types.\nYou should now uninstall @cloudflare/workers-types and remove it from your tsconfig.json."
36
+
)
37
+
);
38
+
logger.log("");
39
+
}
22
40
if(updatedTypesString){
23
-
logger.info(dedent`
24
-
📣 Add the generated types to the types array in your tsconfig.json:
25
-
41
+
logAction(`Update your tsconfig.json to include the generated types`);
42
+
logger.log(
43
+
chalk.dim(dedent`
26
44
{
27
45
"compilerOptions": {
28
-
...
29
46
"types": ${updatedTypesString}
30
-
...
31
47
}
32
48
}
33
-
34
-
`);
35
-
}elseif(isWorkersTypesInstalled){
36
-
logger.info(dedent`
37
-
📣 Replace the existing "@cloudflare/workers-types" entry with the generated types path:
38
-
{
39
-
"compilerOptions": {
40
-
...
41
-
"types": ${updatedTypesString}
42
-
...
43
-
}
44
-
}
45
-
46
-
`);
47
-
}
48
-
if(isWorkersTypesInstalled){
49
-
logger.info('📣 You can now uninstall "@cloudflare/workers-types".');
49
+
`)
50
+
);
51
+
logger.log("");
50
52
}
51
53
if(isNodeCompat&&!isNodeTypesInstalled){
52
-
logger.info(
53
-
'📣 Since you have Node.js compatibility mode enabled, you should consider adding Node.js for TypeScript by running "npm i --save-dev @types/[email protected]". Please see the docs for more details: https://developers.cloudflare.com/workers/languages/typescript/#transitive-loading-of-typesnode-overrides-cloudflareworkers-types'
54
+
logAction("Install types@node");
55
+
logger.log(
56
+
chalk.dim(
57
+
`Since you have the \`nodejs_compat\` flag, you should install Node.js types by running "npm i --save-dev @types/node${isWorkersTypesInstalled ? '@20.8.3".\nFor more details: https://developers.cloudflare.com/workers/languages/typescript/#known-issues' : '".'}`
58
+
)
54
59
);
60
+
logger.log("");
55
61
}
56
-
logger.info(
57
-
`📣 Remember to run 'wrangler types --x-include-runtime' again if you change 'compatibility_date' or 'compatibility_flags' in your ${configFileName(configPath)} file.\n`
0 commit comments