diff --git a/docs/zh/docs/api/node-api.md b/docs/zh/docs/api/node-api.md index 2b5218e..619d80c 100644 --- a/docs/zh/docs/api/node-api.md +++ b/docs/zh/docs/api/node-api.md @@ -72,7 +72,3 @@ interface KitOptions { export default demoKit ``` - - ## Kit Data Management - - ### diff --git a/packages/@revili/helpers/package.json b/packages/@revili/helpers/package.json index 3ef2f4b..6c92b6c 100644 --- a/packages/@revili/helpers/package.json +++ b/packages/@revili/helpers/package.json @@ -37,6 +37,7 @@ "dependencies": { "@types/inquirer": "9.0.3", "cac": "6.7.14", + "gitly": "3.0.0", "vite": "3.2.3", "vue": "3.2.45", "vue-router": "^4.1.6", diff --git a/packages/@revili/helpers/src/node/index.ts b/packages/@revili/helpers/src/node/index.ts index 8da8be0..2b752a5 100644 --- a/packages/@revili/helpers/src/node/index.ts +++ b/packages/@revili/helpers/src/node/index.ts @@ -1,2 +1,3 @@ -export * from "./composables/index.js"; +export * from './paths.js' export * from "./utils/index.js"; +export * from "./composables/index.js"; diff --git a/packages/@revili/helpers/src/node/paths.ts b/packages/@revili/helpers/src/node/paths.ts new file mode 100644 index 0000000..b81a8a4 --- /dev/null +++ b/packages/@revili/helpers/src/node/paths.ts @@ -0,0 +1,32 @@ +import os from 'node:os' +import process from 'node:process' +import { resolve } from 'node:path' + +// Environment variable for data directory +const USER_DATA_DIR_ENV = 'REVILI_DATA_DIR' + +// Get the current working directory +export const CWD = process.cwd() + +// Base user data directory structure +const homeDir = os.homedir() +const defaultDataDir = resolve(homeDir, '.revili') + +// Allow custom data directory through environment variable +export const USER_DATA_PATH = process.env[USER_DATA_DIR_ENV] + ? resolve(process.env[USER_DATA_DIR_ENV]) + : defaultDataDir + +// Organized data subdirectories +export const DATA_DIRS = { + // Directory for storing revili kits + kits: resolve(USER_DATA_PATH, 'kits'), + // Directory for storing kit-specific data + kitsData: resolve(USER_DATA_PATH, 'kitsData') +} as const + +// Specific data file paths +export const DATA_FILES = { + package: resolve(DATA_DIRS.kits, 'package.json'), + config: resolve(USER_DATA_PATH, 'revili.config.json') +} as const diff --git a/packages/@revili/helpers/src/node/utils/cac.ts b/packages/@revili/helpers/src/node/utils/cac.ts new file mode 100644 index 0000000..7204098 --- /dev/null +++ b/packages/@revili/helpers/src/node/utils/cac.ts @@ -0,0 +1 @@ +export { CAC } from "cac"; diff --git a/packages/@revili/helpers/src/node/utils/chalk.ts b/packages/@revili/helpers/src/node/utils/chalk.ts index 4b82090..8c02cfd 100644 --- a/packages/@revili/helpers/src/node/utils/chalk.ts +++ b/packages/@revili/helpers/src/node/utils/chalk.ts @@ -1,3 +1,3 @@ import chalk from 'chalk'; -export default chalk; +export { chalk } diff --git a/packages/core/src/node/utils/childProcess.ts b/packages/@revili/helpers/src/node/utils/childProcess.ts similarity index 100% rename from packages/core/src/node/utils/childProcess.ts rename to packages/@revili/helpers/src/node/utils/childProcess.ts diff --git a/packages/@revili/helpers/src/node/utils/gitly.ts b/packages/@revili/helpers/src/node/utils/gitly.ts new file mode 100644 index 0000000..08e1427 --- /dev/null +++ b/packages/@revili/helpers/src/node/utils/gitly.ts @@ -0,0 +1,4 @@ +import { default as gitlyAlias } from 'gitly' + +export const gitly = gitlyAlias.default + diff --git a/packages/@revili/helpers/src/node/utils/index.ts b/packages/@revili/helpers/src/node/utils/index.ts index 520da3c..60384be 100644 --- a/packages/@revili/helpers/src/node/utils/index.ts +++ b/packages/@revili/helpers/src/node/utils/index.ts @@ -1,7 +1,9 @@ -import { ora, spinner } from './ora.js'; -import chalk from './chalk.js'; -import inquirer from './inquirer.js'; - -export { ora, spinner, chalk, inquirer } - -export * from "./defineKit.js"; +export * from './cac.js' +export * from './ora.js' +export * from './gitly.js' +export * from './chalk.js' +export * from './kitData.js' +export * from './inquirer.js' +export * from './defineKit.js' +export * from './reviliData.js' +export * from './childProcess.js' diff --git a/packages/@revili/helpers/src/node/utils/inquirer.ts b/packages/@revili/helpers/src/node/utils/inquirer.ts index 1e35395..9433954 100644 --- a/packages/@revili/helpers/src/node/utils/inquirer.ts +++ b/packages/@revili/helpers/src/node/utils/inquirer.ts @@ -1,3 +1,3 @@ import inquirer from 'inquirer'; -export default inquirer +export { inquirer } diff --git a/packages/core/src/node/utils/kitData.ts b/packages/@revili/helpers/src/node/utils/kitData.ts similarity index 91% rename from packages/core/src/node/utils/kitData.ts rename to packages/@revili/helpers/src/node/utils/kitData.ts index c8c6697..b5b37b6 100644 --- a/packages/core/src/node/utils/kitData.ts +++ b/packages/@revili/helpers/src/node/utils/kitData.ts @@ -1,6 +1,6 @@ import fs from 'node:fs' import { resolve } from 'node:path' -import { DATA_DIRS } from '../alias.js' +import { DATA_DIRS } from '../paths.js' /** * Basic kit data structure @@ -28,7 +28,7 @@ function kitNameToPath(kitName: string): string { * @param kitName The name of the kit * @returns The absolute path to the kit's data directory */ -export function getKitDataPath(kitName: string) { +function getKitDataPath(kitName: string) { const kitPath = kitNameToPath(kitName) return resolve(DATA_DIRS.kitsData, kitPath) } @@ -39,7 +39,7 @@ export function getKitDataPath(kitName: string) { * @param filename The name of the file * @returns The absolute path to the file in the kit's data directory */ -export function getKitDataFilePath(kitName: string, filename: string) { +function getKitDataFilePath(kitName: string, filename: string) { return resolve(getKitDataPath(kitName), filename) } @@ -111,7 +111,7 @@ export async function writeKitData(kitName: string, data: T): * @param partialData Partial data object to merge with existing data */ export async function updateKitData(kitName: string, partialData: Partial): Promise { - const existingData = await getKitData(kitName) - const newData = { ...existingData, ...partialData } - await writeKitData(kitName, newData) + const currentData = await getKitData(kitName) + const updatedData = { ...currentData, ...partialData } + await writeKitData(kitName, updatedData) } diff --git a/packages/@revili/helpers/src/node/utils/reviliData.ts b/packages/@revili/helpers/src/node/utils/reviliData.ts new file mode 100644 index 0000000..f7b89ae --- /dev/null +++ b/packages/@revili/helpers/src/node/utils/reviliData.ts @@ -0,0 +1,89 @@ +import fs from 'node:fs' +import path from 'node:path' +import { pathToFileURL } from 'node:url' +import { CWD, DATA_FILES, DATA_DIRS, USER_DATA_PATH } from '../paths.js' + +import { Kit } from './defineKit.js' + +export interface ReviliConfig { + activeKit: string + kitList: string[] +} + +export async function initConfigFolder() { + if (!fs.existsSync(DATA_DIRS.kits)) { + fs.mkdirSync(DATA_DIRS.kits, { recursive: true }) + } + + if (!fs.existsSync(DATA_FILES.package)) { + // add package.json into config folder + setPackageConfig() + } +} + +export async function getReviliConfig(): Promise { + const isExistConfigFile = fs.existsSync(DATA_FILES.config) + if (!isExistConfigFile) { + // create config folder + fs.mkdirSync(USER_DATA_PATH, { recursive: true }) + setReviliConfig() + } + + try { + const content = await fs.promises.readFile(DATA_FILES.config, 'utf-8') + return JSON.parse(content) + } catch (error) { + // Return default config if file doesn't exist or is invalid + return { + activeKit: '', + kitList: [] + } + } +} + +export async function setReviliConfig(config: ReviliConfig = { + activeKit: '', + kitList: [] +}): Promise { + try { + // Ensure parent directory exists + fs.mkdirSync(USER_DATA_PATH, { recursive: true }) + fs.writeFileSync(DATA_FILES.config, JSON.stringify(config, null, 2)) + } catch (error) { + console.error('[revili] Failed to write config') + } +} + +export function setPackageConfig() { + try { + // Ensure the directory exists + fs.mkdirSync(DATA_DIRS.kits, { recursive: true }) + fs.writeFileSync(DATA_FILES.package, JSON.stringify({ + name: 'revili_kits', + type: 'module' + }, null, 2)) + } catch (error) { + console.error('[revili] Failed to write package.json') + } +} + +export async function getActiveKit(customKitDir: string) { + try { + const { activeKit: activeKitName } = await getReviliConfig(); + + const ACTIVE_KIT_DIR = path.join(USER_DATA_PATH, `./node_modules/${activeKitName}`); + + const CLIENT_DIR = customKitDir + ? path.join(CWD, `${customKitDir}/client`) + : path.join(ACTIVE_KIT_DIR, `./dist/client`); + + const ACTIVE_KIT_ENTRY = customKitDir + ? path.join(CWD, `${customKitDir}/node/index.js`) + : path.join(ACTIVE_KIT_DIR, `./dist/node/index.js`); + const activeKit = (await import(pathToFileURL(ACTIVE_KIT_ENTRY) as unknown as string)).default as Kit; + + return { activeKit, CLIENT_DIR } + } catch(error) { + return { activeKit: null, CLIENT_DIR: '' } + } +} diff --git a/packages/@revili/helpers/tsconfig.json b/packages/@revili/helpers/tsconfig.json index 556f123..1659752 100644 --- a/packages/@revili/helpers/tsconfig.json +++ b/packages/@revili/helpers/tsconfig.json @@ -7,7 +7,8 @@ "jsx": "preserve", "lib": ["ESNext", "DOM"], "outDir": "./dist", - "types": ["node"] + "types": ["node"], + "rootDir": "./src" }, "include": [ "src/**/*.ts", diff --git a/packages/core/package.json b/packages/core/package.json index 6ec875f..2de1124 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -52,8 +52,6 @@ "@vitejs/plugin-vue": "5.0.4", "@vitejs/plugin-vue-jsx": "3.1.0", "autoprefixer": "10.4.13", - "cac": "6.7.14", - "gitly": "3.0.0", "postcss": "8.4.21", "postcss-each": "1.1.0", "postcss-import": "15.0.0", diff --git a/packages/core/src/node/alias.ts b/packages/core/src/node/alias.ts index e871985..0233626 100644 --- a/packages/core/src/node/alias.ts +++ b/packages/core/src/node/alias.ts @@ -1,57 +1,28 @@ -import os from 'node:os' -import process from 'node:process' -import { resolve } from 'node:path' import { fileURLToPath } from 'node:url' - -// Environment variable for data directory -const USER_DATA_DIR_ENV = 'REVILI_DATA_DIR' - -// Get the current working directory -export const CWD = process.cwd() +import { resolve } from 'node:path' +import { + CWD, + DATA_DIRS, + DATA_FILES, + USER_DATA_PATH +} from '@revili/helpers/node' // Get the root directory of the package -export const PKG_ROOT = resolve(fileURLToPath(import.meta.url), '../..') +const PKG_ROOT = resolve(fileURLToPath(import.meta.url), '../..') // Path to the client distribution directory -export const DIST_CLIENT_PATH = resolve(PKG_ROOT, 'client') +const DIST_CLIENT_PATH = resolve(PKG_ROOT, 'client') // Directory containing CLI-related files -export const CLI_FILE_DIR = resolve(fileURLToPath(import.meta.url), '..') - -// Base user data directory structure -const homeDir = os.homedir() -const defaultDataDir = resolve(homeDir, '.revili') - -// Allow custom data directory through environment variable -// This is useful for: -// 1. Different user profiles or workspaces -// 2. Custom deployment environments -// 3. Systems with specific data storage requirements -export const USER_DATA_PATH = process.env[USER_DATA_DIR_ENV] - ? resolve(process.env[USER_DATA_DIR_ENV]) - : defaultDataDir - -// Organized data subdirectories -export const DATA_DIRS = { - // Directory for storing revili kits - kits: resolve(USER_DATA_PATH, 'kits'), - // Directory for storing kit-specific data - kitsData: resolve(USER_DATA_PATH, 'kitsData') -} as const - -// Specific data file paths -export const DATA_FILES = { - package: resolve(DATA_DIRS.kits, 'package.json'), - config: resolve(USER_DATA_PATH, 'revili.config.json') -} as const +const CLI_FILE_DIR = resolve(fileURLToPath(import.meta.url), '..') // Export all path constants export const PATHS = { CWD, PKG_ROOT, - DIST_CLIENT_PATH, + DATA_DIRS, + DATA_FILES, CLI_FILE_DIR, USER_DATA_PATH, - DATA_DIRS, - DATA_FILES + DIST_CLIENT_PATH, } as const diff --git a/packages/core/src/node/command/createAddCommand.ts b/packages/core/src/node/command/createAddCommand.ts index 4ccdd85..c34a2dc 100644 --- a/packages/core/src/node/command/createAddCommand.ts +++ b/packages/core/src/node/command/createAddCommand.ts @@ -1,10 +1,6 @@ -import {CAC} from 'cac' -import { spinner, chalk } from '@revili/helpers/node' -import { consoleUtil } from '../utils/index.js' +import { CAC, spinner, chalk, execPromise, initConfigFolder, getReviliConfig, setReviliConfig, type ReviliConfig, initKitData } from '@revili/helpers/node' + import { PATHS } from '../alias.js' -import { execPromise } from '../utils/childProcess.js' -import { initConfigFolder, getReviliConfig, setReviliConfig, type ReviliConfig } from '../utils/reviliData.js' -import { initKitData } from '../utils/kitData.js' const kitRegExp = /^(@[\d_-\w\W]+\/)?([\d_-\w]+)(@.+)?$/ @@ -49,6 +45,7 @@ export function createAddCommand(program: CAC) { } } } catch (error) { + console.error(111, error) spinner.fail(chalk.red('[revili] ') + `${targetKit} was not found!`) } diff --git a/packages/core/src/node/command/createInitKitCommand.ts b/packages/core/src/node/command/createInitKitCommand.ts index 8eed886..4c29bdc 100644 --- a/packages/core/src/node/command/createInitKitCommand.ts +++ b/packages/core/src/node/command/createInitKitCommand.ts @@ -1,10 +1,8 @@ -import {CAC} from 'cac' import fs from 'node:fs' import path from 'node:path' -import { default as gitly } from 'gitly' -import { inquirer, spinner, chalk } from '@revili/helpers/node' +import { CAC, inquirer, spinner, chalk, gitly } from '@revili/helpers/node' -import { CWD } from '../alias.js' +import { PATHS } from '../alias.js' import { consoleUtil } from '../utils/index.js' export function createInitKitCommand(program: CAC) { @@ -21,7 +19,7 @@ export function createInitKitCommand(program: CAC) { try { const targetDir = kitName ?? gitRepo // @ts-ignore - await gitly.default(`${gitScope}/${gitRepo}`, path.join(CWD, targetDir)) + await gitly(`${gitScope}/${gitRepo}#main`, path.join(PATHS.CWD, targetDir)) spinner.succeed(`[revili] Load file from https://github.com/${gitScope}/${gitRepo}`) @@ -83,7 +81,7 @@ function changePackage (kitName: string, targetDir: string) { spinner.start(chalk.blue(`[revili] Edit kit name`)) return new Promise((resolve) => { - const packageJsonPath = `${CWD}/${targetDir}/package.json` + const packageJsonPath = `${PATHS.CWD}/${targetDir}/package.json` fs.readFile(packageJsonPath, (err, data) => { if (err) throw err const _data = JSON.parse(data.toString()) diff --git a/packages/core/src/node/command/createKitCommands.ts b/packages/core/src/node/command/createKitCommands.ts index e0576b6..6873563 100644 --- a/packages/core/src/node/command/createKitCommands.ts +++ b/packages/core/src/node/command/createKitCommands.ts @@ -1,6 +1,4 @@ -import {CAC} from 'cac' - -import { getActiveKit } from '../utils/getActiveKit.js' +import { CAC, getActiveKit } from '@revili/helpers/node' export async function createKitCommands(program: CAC, customKitDir: string) { const { activeKit } = await getActiveKit(customKitDir) diff --git a/packages/core/src/node/command/createListCommand.ts b/packages/core/src/node/command/createListCommand.ts index c4215ad..be94a6e 100644 --- a/packages/core/src/node/command/createListCommand.ts +++ b/packages/core/src/node/command/createListCommand.ts @@ -1,8 +1,6 @@ -import { CAC } from 'cac' -import { chalk } from '@revili/helpers/node' +import { CAC, chalk, getReviliConfig } from '@revili/helpers/node' import { consoleUtil } from '../utils/index.js' -import { getReviliConfig } from '../utils/reviliData.js' export function createListCommand(program: CAC) { program diff --git a/packages/core/src/node/command/createRemoveCommand.ts b/packages/core/src/node/command/createRemoveCommand.ts index b98cc96..0d246e0 100644 --- a/packages/core/src/node/command/createRemoveCommand.ts +++ b/packages/core/src/node/command/createRemoveCommand.ts @@ -1,11 +1,7 @@ -import { CAC } from 'cac' -import { spinner, chalk } from '@revili/helpers/node' +import { CAC, spinner, chalk, execPromise, removeKitData, getReviliConfig, setReviliConfig, type ReviliConfig } from '@revili/helpers/node' import { PATHS } from '../alias.js' import { consoleUtil } from '../utils/index.js' -import { execPromise } from '../utils/childProcess.js' -import { getReviliConfig, setReviliConfig, type ReviliConfig } from '../utils/reviliData.js' -import { removeKitData } from '../utils/kitData.js' export function createRemoveCommand(program: CAC) { program diff --git a/packages/core/src/node/command/createStartCommand.ts b/packages/core/src/node/command/createStartCommand.ts index 079114b..2250269 100644 --- a/packages/core/src/node/command/createStartCommand.ts +++ b/packages/core/src/node/command/createStartCommand.ts @@ -1,4 +1,4 @@ -import {CAC} from 'cac' +import {CAC} from '@revili/helpers/node' import {createViteServer} from '../viteServer/index.js' export function createStartCommand(program: CAC) { diff --git a/packages/core/src/node/command/createTestCommand.ts b/packages/core/src/node/command/createTestCommand.ts index b07325b..c9e9196 100644 --- a/packages/core/src/node/command/createTestCommand.ts +++ b/packages/core/src/node/command/createTestCommand.ts @@ -1,8 +1,6 @@ -import { CAC } from 'cac' -import { chalk } from '@revili/helpers/node' +import { CAC, chalk, getReviliConfig, initConfigFolder } from '@revili/helpers/node' import { consoleUtil } from '../utils/index.js' -import { getReviliConfig, initConfigFolder } from '../utils/reviliData.js' export function createTestCommand(program: CAC) { program diff --git a/packages/core/src/node/command/createUseCommand.ts b/packages/core/src/node/command/createUseCommand.ts index 585258f..17c613e 100644 --- a/packages/core/src/node/command/createUseCommand.ts +++ b/packages/core/src/node/command/createUseCommand.ts @@ -1,7 +1,6 @@ -import {CAC} from 'cac' +import { CAC, getReviliConfig, setReviliConfig } from '@revili/helpers/node' import { consoleUtil } from '../utils/index.js' -import { getReviliConfig, setReviliConfig } from '../utils/reviliData.js' export function createUseCommand(program: CAC) { program diff --git a/packages/core/src/node/command/initCommand.ts b/packages/core/src/node/command/initCommand.ts index 71a397a..4677402 100644 --- a/packages/core/src/node/command/initCommand.ts +++ b/packages/core/src/node/command/initCommand.ts @@ -1,7 +1,9 @@ -import {CAC} from 'cac' + import fs from 'node:fs' import { join } from 'node:path' -import { CLI_FILE_DIR } from '../alias.js' +import { CAC } from '@revili/helpers/node' + +import { PATHS } from '../alias.js' const program = new CAC('revili') @@ -29,7 +31,7 @@ export async function initCommand(callback: (program: CAC) => void) { function getVerson(): string { let version = 'null' - const PACKAGE_PATH = join(CLI_FILE_DIR, '../../package.json') + const PACKAGE_PATH = join(PATHS.CLI_FILE_DIR, '../../package.json') try { version = JSON.parse(fs.readFileSync(PACKAGE_PATH).toString()).version diff --git a/packages/core/src/node/index.ts b/packages/core/src/node/index.ts index d58c46c..d071607 100644 --- a/packages/core/src/node/index.ts +++ b/packages/core/src/node/index.ts @@ -1,2 +1 @@ export * from '@revili/helpers/node' -export { getKitData, writeKitData, updateKitData } from './utils/kitData.js' diff --git a/packages/core/src/node/utils/getActiveKit.ts b/packages/core/src/node/utils/getActiveKit.ts deleted file mode 100644 index fbed450..0000000 --- a/packages/core/src/node/utils/getActiveKit.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { resolve } from 'node:path' -import { existsSync } from 'node:fs' -import { pathToFileURL } from 'node:url' - -import { PATHS } from '../alias.js' -import { getReviliConfig } from './reviliData.js' - -import type { Kit } from '@revili/helpers/node' - -export async function getActiveKit(customKitDir: string) { - try { - const config = await getReviliConfig() - const activeKit = config.activeKit - - if (!activeKit) { - return { activeKit: null, CLIENT_DIR: '' } - } - - const kitPath = resolve(PATHS.DATA_DIRS.kits, 'node_modules', activeKit) - - if (!existsSync(kitPath)) { - return { activeKit: null, CLIENT_DIR: '' } - } - - const CLIENT_DIR = customKitDir - ? resolve(PATHS.CWD, `${customKitDir}/client`) - : resolve(kitPath, `./dist/client`) - - const ACTIVE_KIT_ENTRY = customKitDir - ? resolve(PATHS.CWD, `${customKitDir}/node/index.js`) - : resolve(kitPath, `./dist/node/index.js`) - - const activeKitModule = (await import(pathToFileURL(ACTIVE_KIT_ENTRY).href)) as { default: Kit } - return { activeKit: activeKitModule.default, CLIENT_DIR } - } catch (error) { - return { activeKit: null, CLIENT_DIR: '' } - } -} diff --git a/packages/core/src/node/utils/index.ts b/packages/core/src/node/utils/index.ts index b9783d2..3abc144 100644 --- a/packages/core/src/node/utils/index.ts +++ b/packages/core/src/node/utils/index.ts @@ -1,9 +1,5 @@ import { chalk } from "@revili/helpers/node"; -export * from './getActiveKit.js' -export * from './childProcess.js' -export * from './kitData.js' - export function toLowerCamelCase(str: string): string { let arr: string[] = str.split('-'); diff --git a/packages/core/src/node/utils/reviliData.ts b/packages/core/src/node/utils/reviliData.ts deleted file mode 100644 index c01c379..0000000 --- a/packages/core/src/node/utils/reviliData.ts +++ /dev/null @@ -1,33 +0,0 @@ -import fs from 'node:fs' -import { resolve } from 'node:path' -import { DATA_FILES } from '../alias.js' - -export interface ReviliConfig { - activeKit: string - kitList: string[] -} - -export async function initConfigFolder() { - const configDir = resolve(DATA_FILES.config, '..') - if (!fs.existsSync(configDir)) { - fs.mkdirSync(configDir, { recursive: true }) - } -} - -export async function getReviliConfig(): Promise { - try { - const content = await fs.promises.readFile(DATA_FILES.config, 'utf-8') - return JSON.parse(content) - } catch (error) { - // Return default config if file doesn't exist or is invalid - return { - activeKit: '', - kitList: [] - } - } -} - -export async function setReviliConfig(config: ReviliConfig): Promise { - await initConfigFolder() - await fs.promises.writeFile(DATA_FILES.config, JSON.stringify(config, null, 2)) -} diff --git a/packages/core/src/node/viteServer/resolveViteConfig.ts b/packages/core/src/node/viteServer/resolveViteConfig.ts index ae653b8..ff98618 100644 --- a/packages/core/src/node/viteServer/resolveViteConfig.ts +++ b/packages/core/src/node/viteServer/resolveViteConfig.ts @@ -1,6 +1,8 @@ import { mergeConfig } from 'vite' import type { UserConfig } from 'vite' +import { getActiveKit } from '@revili/helpers/node' + import {default as vuePlugin} from '@vitejs/plugin-vue' import {default as vueJsxPlugin} from '@vitejs/plugin-vue-jsx' @@ -14,7 +16,7 @@ import {reviliPlugin} from './plugins/vitePluginRevili.js' import {tailwindcssConfig} from './tailwindcssConfig/index.js' import {virtualModulePlugin} from './plugins/vitePluginVirtualModule.js' -import { getActiveKit, consoleUtil } from '../utils/index.js' +import { consoleUtil } from '../utils/index.js' export async function resolveViteConfig(customKitDir: string): Promise { const { activeKit, CLIENT_DIR } = await getActiveKit(customKitDir) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6fbe7cb..5a59411 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -67,6 +67,9 @@ importers: chalk: specifier: 5.3.0 version: 5.3.0 + gitly: + specifier: 3.0.0 + version: 3.0.0 inquirer: specifier: 9.2.10 version: 9.2.10 @@ -118,12 +121,6 @@ importers: autoprefixer: specifier: 10.4.13 version: 10.4.13(postcss@8.4.21) - cac: - specifier: 6.7.14 - version: 6.7.14 - gitly: - specifier: 3.0.0 - version: 3.0.0 postcss: specifier: 8.4.21 version: 8.4.21