* chore(deps): add lerna-lite * feat: update-1 * feat(db-mongodb): update 2 * chore: lerna init * chore: add version option to lerna config * chore(ci): add gh usernames to changelog and user root package.json for version * chore(ci): whitelist poc branches * chore(ci): add contributors section * chore(ci): use turbo for prepublishOnly scripts, enable caching * chore(deps): update turborepo, add execa * feat(plugin-stripe): adjust type import * chore: remove lerna-lite * chore(ci): new and improved release script for fixed versioning * chore: remove unused lerna-lite packages * chore: sync root package.json version * chore: remove remnants of bundler packages * chore(plugin-seo): update packagea.json from main, disable build * chore: disable turbo caching * chore(ci): update release script * chore: sync pnpm-lock.yaml * chore: ci cleanup
33 lines
936 B
TypeScript
33 lines
936 B
TypeScript
import fse from 'fs-extra'
|
|
import path from 'path'
|
|
|
|
const packagesDir = path.resolve(__dirname, '../../packages')
|
|
|
|
export type PackageDetails = {
|
|
name: string
|
|
shortName: string
|
|
packagePath: string
|
|
version: string
|
|
}
|
|
|
|
export const getPackageDetails = async (): Promise<PackageDetails[]> => {
|
|
const packageDirs = fse.readdirSync(packagesDir).filter((d) => d !== 'eslint-config-payload')
|
|
|
|
const packageDetails = await Promise.all(
|
|
packageDirs.map(async (dirName) => {
|
|
const packageJson = await fse.readJson(`${packagesDir}/${dirName}/package.json`)
|
|
const isPublic = packageJson.private !== true
|
|
if (!isPublic) return null
|
|
|
|
return {
|
|
name: packageJson.name as string,
|
|
shortName: dirName,
|
|
packagePath: path.resolve(packagesDir, dirName),
|
|
version: packageJson.version,
|
|
}
|
|
}),
|
|
)
|
|
|
|
return packageDetails.filter((p): p is Exclude<typeof p, null> => p !== null)
|
|
}
|