|
1 | | -import { |
2 | | - branchConfigs, |
3 | | - examplesDirs, |
4 | | - latestBranch, |
5 | | - packages, |
6 | | - rootDir, |
7 | | -} from './config' |
| 1 | +import { branchConfigs, latestBranch, packages, rootDir } from './config' |
8 | 2 | import type { BranchConfig, Commit, Package } from './types' |
9 | 3 |
|
10 | 4 | // Originally ported to TS from https://github.com/remix-run/react-router/tree/main/scripts/{version,publish}.js |
11 | 5 | import path from 'path' |
12 | | -import { exec, execSync } from 'child_process' |
| 6 | +import { execSync } from 'child_process' |
13 | 7 | import fsp from 'fs/promises' |
14 | 8 | import chalk from 'chalk' |
15 | 9 | import jsonfile from 'jsonfile' |
@@ -373,53 +367,7 @@ async function run() { |
373 | 367 | console.info('') |
374 | 368 |
|
375 | 369 | console.info('Validating packages...') |
376 | | - const failedValidations: string[] = [] |
377 | | - |
378 | | - await Promise.all( |
379 | | - packages.map(async (pkg) => { |
380 | | - const pkgJson = await readPackageJson( |
381 | | - path.resolve(rootDir, 'packages', pkg.packageDir, 'package.json'), |
382 | | - ) |
383 | | - |
384 | | - const entries = |
385 | | - pkg.name === '@tanstack/eslint-plugin-query' |
386 | | - ? (['main'] as const) |
387 | | - : pkg.name === '@tanstack/svelte-query' |
388 | | - ? (['types', 'module'] as const) |
389 | | - : (['main', 'types', 'module'] as const) |
390 | | - |
391 | | - await Promise.all( |
392 | | - entries.map(async (entryKey) => { |
393 | | - const entry = pkgJson[entryKey] as string |
394 | | - |
395 | | - if (!entry) { |
396 | | - throw new Error( |
397 | | - `Missing entry for "${entryKey}" in ${pkg.packageDir}/package.json!`, |
398 | | - ) |
399 | | - } |
400 | | - |
401 | | - const filePath = path.resolve( |
402 | | - rootDir, |
403 | | - 'packages', |
404 | | - pkg.packageDir, |
405 | | - entry, |
406 | | - ) |
407 | | - |
408 | | - try { |
409 | | - await fsp.access(filePath) |
410 | | - } catch (err) { |
411 | | - failedValidations.push(`Missing build file: ${filePath}`) |
412 | | - } |
413 | | - }), |
414 | | - ) |
415 | | - }), |
416 | | - ) |
417 | | - console.info('') |
418 | | - if (failedValidations.length > 0) { |
419 | | - throw new Error( |
420 | | - 'Some packages failed validation:\n\n' + failedValidations.join('\n'), |
421 | | - ) |
422 | | - } |
| 370 | + execSync(`pnpm run validatePackages`, { encoding: 'utf8', stdio: 'inherit' }) |
423 | 371 |
|
424 | 372 | console.info(`Updating all changed packages to version ${version}...`) |
425 | 373 | // Update each package to the new version |
|
0 commit comments