0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00
logto/.scripts/packages-meta.js

18 lines
806 B
JavaScript
Raw Permalink Normal View History

2022-12-29 01:52:43 -05:00
import { execSync } from 'node:child_process';
import changesetConfig from '../.changeset/config.json' assert { type: 'json' };
export { default as changesetConfig } from '../.changeset/config.json' assert { type: 'json' };
export const corePackageName = '@logto/core';
/** @type {Array<{ name: string; version?: string; path: string; private: boolean; }>} */
export const allPackages = JSON
.parse(execSync('pnpm recursive list --depth=-1 --json', { encoding: 'utf8' }))
.filter(({ name }) => !name.endsWith('/root'));
export const mainPackages = [...changesetConfig.fixed].map(([first]) => first);
export const configuredPackages = new Set(changesetConfig.fixed.flat());
export const singlePackages = allPackages
.filter(({ name }) => !configuredPackages.has(name))
.map(({ name }) => name);