diff --git a/src/cli/init/index.ts b/src/cli/init/index.ts index ce10862..4e3373b 100644 --- a/src/cli/init/index.ts +++ b/src/cli/init/index.ts @@ -189,6 +189,9 @@ function updatePackageManager( packageManager === "pnpm" ? "pnpm@9.0.0" : "npm@10.0.0"; } + // Add "type": "module" to support ES modules + packageJson.type = "module"; + writeFileSync(packageJsonPath, JSON.stringify(packageJson, null, 2)); console.log( chalk.green(`✓ Package manager set to ${packageJson.packageManager}`), @@ -216,6 +219,12 @@ function installDependencies( stdio: "pipe", }); + console.log(chalk.gray(" Installing zod...")); + execSync(`${installCmd} zod`, { + cwd: targetDir, + stdio: "pipe", + }); + // Install dev dependencies console.log(chalk.gray(" Installing TypeScript and type definitions...")); execSync(`${installDevCmd} typescript @types/node`, {