fix: publish

This commit is contained in:
Tanner Linsley
2023-04-25 23:02:33 -06:00
parent eac18858f0
commit 0d40001bf0

View File

@@ -364,49 +364,49 @@ async function run() {
// execSync(`yarn types`, { encoding: 'utf8', stdio: 'inherit' })
// console.info('')
console.info('Validating packages...')
const failedValidations: string[] = []
// console.info('Validating packages...')
// const failedValidations: string[] = []
await Promise.all(
packages.map(async (pkg) => {
const pkgJson = await readPackageJson(
path.resolve(rootDir, 'packages', pkg.packageDir, 'package.json'),
)
// await Promise.all(
// packages.map(async (pkg) => {
// const pkgJson = await readPackageJson(
// path.resolve(rootDir, 'packages', pkg.packageDir, 'package.json'),
// )
await Promise.all(
(['module', 'main', 'browser', 'types'] as const).map(
async (entryKey) => {
const entry = pkgJson[entryKey] as string
// await Promise.all(
// (['module', 'main', 'browser', 'types'] as const).map(
// async (entryKey) => {
// const entry = pkgJson[entryKey] as string
if (!entry) {
throw new Error(
`Missing entry for "${entryKey}" in ${pkg.packageDir}/package.json!`,
)
}
// if (!entry) {
// throw new Error(
// `Missing entry for "${entryKey}" in ${pkg.packageDir}/package.json!`,
// )
// }
const filePath = path.resolve(
rootDir,
'packages',
pkg.packageDir,
entry,
)
// const filePath = path.resolve(
// rootDir,
// 'packages',
// pkg.packageDir,
// entry,
// )
try {
await fsp.access(filePath)
} catch (err) {
failedValidations.push(`Missing build file: ${filePath}`)
}
},
),
)
}),
)
console.info('')
if (failedValidations.length > 0) {
throw new Error(
'Some packages failed validation:\n\n' + failedValidations.join('\n'),
)
}
// try {
// await fsp.access(filePath)
// } catch (err) {
// failedValidations.push(`Missing build file: ${filePath}`)
// }
// },
// ),
// )
// }),
// )
// console.info('')
// if (failedValidations.length > 0) {
// throw new Error(
// 'Some packages failed validation:\n\n' + failedValidations.join('\n'),
// )
// }
console.info('Testing packages...')
execSync(`pnpm test:ci ${SKIP_TESTS ? '|| exit 0' : ''}`, {