Skip to content

Commit fafb6b3

Browse files
committed
✨ Adds a publish all dry script
1 parent a78ad25 commit fafb6b3

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"validate:codemods": "ts-node scripts/validate.ts ./community",
2828
"release:codemods": "ts-node scripts/publish.ts ./community ./.tmp",
2929
"release-all:codemods": "ts-node scripts/publish-all.ts ./community ./.tmp",
30+
"release-all-dry:codemods": "ts-node scripts/publish-all-dry.ts ./community ./.tmp",
3031
"prerelease": "yarn validate && yarn test",
3132
"release": "yarn changeset publish"
3233
},

packages/cli/src/main.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jest.mock('live-plugin-manager', () => ({
77
install: () => Promise.resolve(undefined),
88
getInfo: (name: string) =>
99
Promise.resolve({ location: `node_modules/${name}` }),
10+
uninstallAll: () => Promise.resolve(),
1011
}),
1112
}));
1213

scripts/publish-all-dry.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import {
2+
getAllPackages,
3+
buildPackages,
4+
generatePackages,
5+
cleanTargetDir,
6+
} from '@codeshift/publisher';
7+
8+
async function main(sourcePath: string, targetPath: string) {
9+
cleanTargetDir(targetPath);
10+
11+
const packages = getAllPackages(sourcePath);
12+
console.log(packages);
13+
14+
console.log('Generating temporary directory');
15+
await generatePackages(sourcePath, targetPath, packages);
16+
17+
console.log('Building all packages');
18+
await buildPackages();
19+
}
20+
21+
main(process.argv[2], process.argv[3]).catch(error => {
22+
console.error('Publishing error:', error.message);
23+
});

0 commit comments

Comments
 (0)