Skip to content

Commit

Permalink
feat(cli): read typscript's version from package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoppippi committed Sep 9, 2024
1 parent ebf637c commit be57505
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/executable/TypiaSetupWizard.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import fs from "fs";
import path from "path";
import { DetectResult, detect } from "package-manager-detector";

import { ArgumentParser } from "./setup/ArgumentParser";
import { CommandExecutor } from "./setup/CommandExecutor";
import { PackageManager } from "./setup/PackageManager";
import { PluginConfigurator } from "./setup/PluginConfigurator";

const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "../../package.json"), "utf-8"));

export namespace TypiaSetupWizard {
export interface IArguments {
manager: "npm" | "pnpm" | "yarn" | "bun";
Expand All @@ -22,7 +25,7 @@ export namespace TypiaSetupWizard {
const args: IArguments = await ArgumentParser.parse(pack)(inquiry);

// INSTALL TYPESCRIPT COMPILERS
pack.install({ dev: true, modulo: "typescript", version: "^5.6.2" });
pack.install({ dev: true, modulo: "typescript", version: pkg.devDependencies.typescript as string });
pack.install({ dev: true, modulo: "ts-patch", version: "latest" });
args.project ??= (() => {
const runner: string = pack.manager === "npm" ? "npx" : pack.manager;
Expand Down

0 comments on commit be57505

Please sign in to comment.