|
1 | | -import generatePackages, { cleanTargetDir } from './generate'; |
2 | | -import getChangedPackages from './changed'; |
3 | | -import buildPackages from './build'; |
4 | | -import publishPackages from './publish'; |
5 | | - |
6 | | -async function main(sourcePath: string, targetPath: string) { |
7 | | - cleanTargetDir(targetPath); |
8 | | - |
9 | | - console.log('Calculating changed packages'); |
10 | | - const changedPackages = await getChangedPackages(); |
11 | | - |
12 | | - if (changedPackages.length === 0) { |
13 | | - console.log('No packages changed, exiting...'); |
14 | | - process.exit(0); |
15 | | - } |
16 | | - |
17 | | - console.log('Changed packages', changedPackages); |
18 | | - |
19 | | - console.log('Generating temporary directory'); |
20 | | - await generatePackages(sourcePath, targetPath, changedPackages); |
21 | | - |
22 | | - console.log('Building changed packages'); |
23 | | - await buildPackages(); |
24 | | - |
25 | | - console.log('Publishing changed packages'); |
26 | | - await publishPackages(targetPath, process.env.NPM_TOKEN!); |
27 | | - |
28 | | - console.log('Cleaning up temporary directory'); |
29 | | - cleanTargetDir(targetPath); |
30 | | -} |
31 | | - |
32 | | -main(process.argv[2], process.argv[3]).catch(error => { |
33 | | - console.error('Publishing error:', error.message); |
34 | | -}); |
| 1 | +export { default as generatePackages, cleanTargetDir } from './generate'; |
| 2 | +export { getChangedPackages, getAllPackages } from './changed'; |
| 3 | +export { default as buildPackages } from './build'; |
| 4 | +export { default as publishPackages } from './publish'; |
0 commit comments