* feat: add devDeps, add nypm for installing deps
* feat: custom ui dir
* refactor: use consola instead of chalk
* test: ui alias
* refactor: import { z } from 'zod' instead of *, replace node:path with pathe
* chore: add components name to `configFile` option
* chore: update `c12` which fix json5 parse issue
and it also supports .config directory
* chore: update `https-proxy-agent`
* fix: await until dependencies are installed then run detypes process
* feat: add tailwind prefix
* test: tw-prefix snapshot
* chore: add prefix option to init
* test: apply prefix
* fix: tw-prefix parse wrongly
* chore: hide prefix temporarily
---------
Co-authored-by: zernonia <zernonia@gmail.com>
17 lines
455 B
TypeScript
17 lines
455 B
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import path from 'pathe'
|
|
import fs from 'fs-extra'
|
|
import { type PackageJson } from 'type-fest'
|
|
|
|
export function getPackageInfo() {
|
|
const packageJsonPath = getPackageFilePath('../package.json')
|
|
|
|
return fs.readJSONSync(packageJsonPath) as PackageJson
|
|
}
|
|
|
|
function getPackageFilePath(filePath: string) {
|
|
const distPath = fileURLToPath(new URL('.', import.meta.url))
|
|
|
|
return path.resolve(distPath, filePath)
|
|
}
|