1
1
import { logRaw } from "@cloudflare/cli" ;
2
2
import { brandColor , dim } from "@cloudflare/cli/colors" ;
3
- import { spinner } from "@cloudflare/cli/interactive" ;
4
3
import { runFrameworkGenerator } from "frameworks/index" ;
5
- import { transformFile } from "helpers/codemod" ;
6
4
import { detectPackageManager } from "helpers/packageManagers" ;
7
5
import { installPackages } from "helpers/packages" ;
8
6
import type { TemplateConfig } from "../../src/templates" ;
@@ -14,7 +12,7 @@ const generate = async (ctx: C3Context) => {
14
12
await runFrameworkGenerator ( ctx , [
15
13
ctx . project . name ,
16
14
"--template" ,
17
- "https://github.com/remix-run/remix/tree/main/templates/cloudflare" ,
15
+ "https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers " ,
18
16
] ) ;
19
17
20
18
logRaw ( "" ) ; // newline
@@ -26,27 +24,6 @@ const configure = async () => {
26
24
startText : "Updating the Wrangler version" ,
27
25
doneText : `${ brandColor ( `updated` ) } ${ dim ( "wrangler@latest" ) } ` ,
28
26
} ) ;
29
-
30
- const typeDefsPath = "load-context.ts" ;
31
-
32
- const s = spinner ( ) ;
33
- s . start ( `Updating \`${ typeDefsPath } \`` ) ;
34
-
35
- // Remove the empty Env declaration from the template to allow the type from
36
- // worker-configuration.d.ts to take over
37
- transformFile ( typeDefsPath , {
38
- visitTSInterfaceDeclaration ( n ) {
39
- if ( n . node . id . type === "Identifier" && n . node . id . name !== "Env" ) {
40
- return this . traverse ( n ) ;
41
- }
42
-
43
- // Removes the node
44
- n . replace ( ) ;
45
- return false ;
46
- } ,
47
- } ) ;
48
-
49
- s . stop ( `${ brandColor ( "updated" ) } \`${ dim ( typeDefsPath ) } \`` ) ;
50
27
} ;
51
28
52
29
const config : TemplateConfig = {
@@ -63,8 +40,6 @@ const config: TemplateConfig = {
63
40
configure,
64
41
transformPackageJson : async ( ) => ( {
65
42
scripts : {
66
- build :
67
- "remix vite:build && wrangler pages functions build --outdir build/worker" ,
68
43
deploy : `${ npm } run build && wrangler deploy` ,
69
44
preview : `${ npm } run build && wrangler dev` ,
70
45
"cf-typegen" : `wrangler types` ,
0 commit comments