Skip to content

Commit

Permalink
[compiler] Use consistent version hash for npm (#31177)
Browse files Browse the repository at this point in the history
Modifies our release script to use the same version hash (the hashed
`compiler` directory) for all compiler packages to keep them consistent.
  • Loading branch information
poteto authored Oct 14, 2024
1 parent 75dd053 commit b60286b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions compiler/scripts/release/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,20 +119,20 @@ async function main() {
);
const dateString = await getDateStringForCommit(commit);
const otp = argv.ci === false ? await promptForOTP() : null;
const {hash} = await hashElement(path.resolve(__dirname, '../..'), {
encoding: 'hex',
folders: {exclude: ['node_modules']},
files: {exclude: ['.DS_Store']},
});
const truncatedHash = hash.slice(0, 7);
const newVersion = `0.0.0-experimental-${truncatedHash}-${dateString}`;

for (const pkgName of pkgNames) {
const pkgDir = path.resolve(__dirname, `../../packages/${pkgName}`);
const pkgJsonPath = path.resolve(
__dirname,
`../../packages/${pkgName}/package.json`
);
const {hash} = await hashElement(pkgDir, {
encoding: 'hex',
folders: {exclude: ['node_modules']},
files: {exclude: ['.DS_Store']},
});
const truncatedHash = hash.slice(0, 7);
const newVersion = `0.0.0-experimental-${truncatedHash}-${dateString}`;

spinner.start(`Writing package.json for ${pkgName}@${newVersion}`);
await writeJson(
Expand Down

0 comments on commit b60286b

Please sign in to comment.