1
- import { existsSync } from 'fs' ;
2
- import { promises as fs } from 'fs' ;
3
- import { Command } from 'commander' ;
4
- import { execa } from 'execa' ;
5
- import ora , { Ora } from 'ora' ;
6
- import path from 'path' ;
7
- import { z } from 'zod' ;
8
- import { handleError } from '@/src/utils/handle-error' ;
9
- import { logger } from '@/src/utils/logger' ;
10
- import chalk from 'chalk' ;
11
- import prompts from 'prompts' ;
12
- import glob from 'fast-glob' ;
13
- import { createRequire } from 'module' ;
14
- import { execSync } from 'child_process' ;
15
1
import {
2
+ DEFAULT_COMPONENTS ,
3
+ DEFAULT_LIB ,
16
4
getConfig ,
17
5
rawConfigSchema ,
18
6
resolveConfigPaths ,
19
- DEFAULT_COMPONENTS ,
20
- DEFAULT_LIB ,
21
7
} from '@/src/utils/get-config' ;
8
+ import { handleError } from '@/src/utils/handle-error' ;
9
+ import { logger } from '@/src/utils/logger' ;
10
+ import chalk from 'chalk' ;
11
+ import { execSync } from 'child_process' ;
12
+ import { Command } from 'commander' ;
13
+ import { execa } from 'execa' ;
14
+ import glob from 'fast-glob' ;
15
+ import { existsSync , promises as fs } from 'fs' ;
16
+ import ora , { Ora } from 'ora' ;
17
+ import path from 'path' ;
18
+ import prompts from 'prompts' ;
19
+ import { fileURLToPath } from 'url' ;
20
+ import { z } from 'zod' ;
21
+
22
+ const filePath = fileURLToPath ( import . meta. url ) ;
23
+ const fileDir = path . dirname ( filePath ) ;
22
24
23
25
const initOptionsSchema = z . object ( {
24
26
cwd : z . string ( ) ,
@@ -29,7 +31,6 @@ const REQUIRED_DEPENDENCIES = [
29
31
'nativewind' ,
30
32
'expo-navigation-bar' ,
31
33
'tailwindcss-animate' ,
32
- '@react-native-async-storage/async-storage' ,
33
34
'class-variance-authority' ,
34
35
'clsx' ,
35
36
'tailwind-merge' ,
@@ -282,7 +283,7 @@ async function initializeProject(cwd: string, overwrite: boolean) {
282
283
spinner . start ( ) ;
283
284
}
284
285
285
- const templatesDir = path . dirname ( createRequire ( import . meta . url ) . resolve ( '@rnr/ starter-base') ) ;
286
+ const templatesDir = path . join ( fileDir , '../__generated/ starter-base') ;
286
287
287
288
await installDependencies ( cwd , spinner ) ;
288
289
await updateTsConfig ( cwd , config , spinner ) ;
0 commit comments