diff --git a/src/cli.ts b/src/cli.ts index 9f3d70c..4211aea 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -1,7 +1,6 @@ import { Command } from 'commander'; import fs from 'fs'; import path from 'path'; -import { description } from '../package.json'; import { pkgName, pkgVersion } from './const'; import { resolveConfigFile, run } from './generators/command'; @@ -11,7 +10,7 @@ export function createCLI() { program .name(pkgName) .version(pkgVersion) - .description(description) + .description(process.env.PKG_DESCRIPTION) .action((options, command) => { if (command.args.length === 0) return run(); diff --git a/src/types/process.env.d.ts b/src/types/process.env.d.ts index 9b91eef..d936098 100644 --- a/src/types/process.env.d.ts +++ b/src/types/process.env.d.ts @@ -8,6 +8,9 @@ declare global { // package version PKG_VERSION: string; + + // package description + PKG_DESCRIPTION: string; } } } diff --git a/vite.config.mts b/vite.config.mts index 753b9c5..8c45015 100644 --- a/vite.config.mts +++ b/vite.config.mts @@ -19,6 +19,7 @@ export default defineConfig({ define: { 'process.env.PKG_NAME': JSON.stringify(pkg.name), 'process.env.PKG_VERSION': JSON.stringify(pkg.version), + 'process.env.PKG_DESCRIPTION': JSON.stringify(pkg.description), }, build: { minify: false, @@ -51,6 +52,7 @@ export default defineConfig({ env: { PKG_NAME: 'pkg-name-for-test', PKG_VERSION: 'pkg-version-for-test', + PKG_DESCRIPTION: 'pkg-description-for-test', }, coverage: { all: true,