Skip to content

Commit 99ff351

Browse files
unisol1020mrzachnugent
authored andcommitted
fix: update init command to use workspace path for starter-base
1 parent 116c373 commit 99ff351

File tree

3 files changed

+7638
-2537
lines changed

3 files changed

+7638
-2537
lines changed

apps/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"@babel/core": "^7.26.0",
5454
"@babel/parser": "^7.22.6",
5555
"@babel/plugin-transform-typescript": "^7.22.5",
56+
"@rnr/starter-base": "workspace:*",
5657
"chalk": "5.2.0",
5758
"commander": "^10.0.0",
5859
"cosmiconfig": "^8.1.3",

apps/cli/src/commands/init.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'url';
1111
import chalk from 'chalk';
1212
import prompts from 'prompts';
1313
import glob from 'fast-glob';
14+
import { createRequire } from 'module';
1415

1516
const filePath = fileURLToPath(import.meta.url);
1617
const fileDir = path.dirname(filePath);
@@ -196,7 +197,9 @@ export const init = new Command()
196197
}
197198

198199
const spinner = ora(`Initializing project...`).start();
199-
const templatesDir = path.join(fileDir, '../../../packages/templates/starter-base');
200+
const templatesDir = path.dirname(
201+
createRequire(import.meta.url).resolve('@rnr/starter-base/package.json')
202+
);
200203

201204
await installDependencies(cwd, spinner);
202205
await updateTsConfig(cwd, spinner);

0 commit comments

Comments
 (0)