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
logger.info(`✨ Runtime types written to ${outFile}`);
21
-
21
+
if(isWorkersTypesInstalled){
22
+
logAction(
23
+
"Migrate from @cloudflare/workers-types to generated runtime types"
24
+
);
25
+
logger.log(
26
+
chalk.dim(
27
+
"`wrangler types` now generates runtime types and supersedes @cloudflare/workers-types."
28
+
)
29
+
);
30
+
logger.log(
31
+
chalk.dim(
32
+
"You should now uninstall @cloudflare/workers-types and remove it from your tsconfig.json."
33
+
)
34
+
);
35
+
logger.log("");
36
+
}
22
37
if(updatedTypesString){
23
-
logger.info(dedent`
24
-
📣 Add the generated types to the types array in your tsconfig.json:
25
-
26
-
{
27
-
"compilerOptions": {
28
-
...
29
-
"types": ${updatedTypesString}
30
-
...
31
-
}
32
-
}
33
-
34
-
`);
35
-
}elseif(isWorkersTypesInstalled){
36
-
logger.info(dedent`
37
-
📣 Replace the existing "@cloudflare/workers-types" entry with the generated types path:
38
+
logAction(`Update your tsconfig.json to include the generated types`);
39
+
logger.log(
40
+
chalk.dim(dedent`
38
41
{
39
42
"compilerOptions": {
40
-
...
41
43
"types": ${updatedTypesString}
42
-
...
43
44
}
44
45
}
45
-
46
-
`);
47
-
}
48
-
if(isWorkersTypesInstalled){
49
-
logger.info('📣 You can now uninstall "@cloudflare/workers-types".');
46
+
`)
47
+
);
48
+
logger.log("");
50
49
}
51
50
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'
51
+
logAction("Install types@node");
52
+
logger.log(
53
+
chalk.dim(
54
+
`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". For more details: https://developers.cloudflare.com/workers/languages/typescript/#known-issues' : '".'}`
55
+
)
54
56
);
57
+
logger.log("");
55
58
}
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