File tree Expand file tree Collapse file tree 8 files changed +13
-6
lines changed
packages/create-cloudflare Expand file tree Collapse file tree 8 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ describe("updateTsConfig", () => {
2525 ctx = createTestContext ( ) ;
2626 ctx . args . ts = true ;
2727 ctx . template . installWorkersTypes = false ;
28+ ctx . template . skipWranglerTypegen = false ;
2829
2930 vi . mocked ( existsSync ) . mockImplementation ( ( ) => true ) ;
3031 vi . mocked ( getLatestTypesEntrypoint ) . mockReturnValue ( mockCompatDate ) ;
Original file line number Diff line number Diff line change @@ -170,7 +170,9 @@ const configure = async (ctx: C3Context) => {
170170 if ( ctx . template . installWorkersTypes ) {
171171 await installWorkersTypes ( ctx ) ;
172172 }
173- await generateWorkersTypes ( ctx ) ;
173+ if ( ctx . template . skipWranglerTypegen ) {
174+ await generateWorkersTypes ( ctx ) ;
175+ }
174176
175177 await offerGit ( ctx ) ;
176178 await gitCommit ( ctx ) ;
Original file line number Diff line number Diff line change @@ -150,8 +150,11 @@ export type TemplateConfig = {
150150
151151 bindings ?: Record < string , unknown > ;
152152
153- /** Don't generate types, use @cloudflare/workers-types instead. Usually because the framework is pinned to Wrangler 3. Default false . */
153+ /** Default false. For frameworks that are pinned to Wrangler 3. */
154154 installWorkersTypes ?: boolean ;
155+
156+ /** Default false. To accomodate SSG frameworks etc. */
157+ skipWranglerTypegen ?: boolean ;
155158} ;
156159
157160type CopyFiles = ( StaticFileMap | VariantInfo ) & {
Original file line number Diff line number Diff line change @@ -120,6 +120,7 @@ export async function updateTsConfig(ctx: C3Context) {
120120}
121121
122122/**
123+ * TODO: delete if/when qwik and remix move to wrangler v4
123124 * Installs the latest version of the `@cloudflare/workers-types` package
124125 * and updates the .tsconfig file to use the latest entrypoint version.
125126 */
Original file line number Diff line number Diff line change @@ -27,6 +27,6 @@ const config: TemplateConfig = {
2727 devScript : "preview" ,
2828 deployScript : "deploy" ,
2929 previewScript : "preview" ,
30- installWorkersTypes : true ,
30+ skipWranglerTypegen : false ,
3131} ;
3232export default config ;
Original file line number Diff line number Diff line change @@ -29,6 +29,6 @@ const config: TemplateConfig = {
2929 devScript : "start" ,
3030 deployScript : "deploy" ,
3131 previewScript : "preview" ,
32- installWorkersTypes : true ,
32+ skipWranglerTypegen : true ,
3333} ;
3434export default config ;
Original file line number Diff line number Diff line change @@ -47,6 +47,6 @@ const config: TemplateConfig = {
4747 devScript : "develop" ,
4848 deployScript : "deploy" ,
4949 previewScript : "preview" ,
50- installWorkersTypes : true ,
50+ skipWranglerTypegen : true ,
5151} ;
5252export default config ;
Original file line number Diff line number Diff line change @@ -49,6 +49,6 @@ const config: TemplateConfig = {
4949 devScript : "develop" ,
5050 deployScript : "deploy" ,
5151 previewScript : "preview" ,
52- installWorkersTypes : true ,
52+ skipWranglerTypegen : true ,
5353} ;
5454export default config ;
You can’t perform that action at this time.
0 commit comments