Skip to content

Commit 4c3360c

Browse files
committed
feat(commandkit): add deno package manager support
1 parent 15af515 commit 4c3360c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/commandkit/src/cli/common.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ function detectPackageManager() {
8585
'package-lock.json': 'npm',
8686
'bun.lock': 'bun',
8787
'bun.lockb': 'bun',
88+
'deno.lock': 'deno',
8889
};
8990

9091
for (const [lockfile, manager] of Object.entries(lockfiles)) {
@@ -114,8 +115,8 @@ export async function loadTypeScript(e?: string) {
114115
if (e instanceof Error && 'code' in e && e.code === 'MODULE_NOT_FOUND') {
115116
try {
116117
const packageManager = detectPackageManager();
117-
118-
execSync(`${packageManager} add typescript`, {
118+
const prefix = packageManager === 'deno' ? 'npm:' : '';
119+
execSync(`${packageManager} add -D ${prefix}typescript`, {
119120
stdio: 'inherit',
120121
cwd: process.cwd(),
121122
});

0 commit comments

Comments
 (0)