Files
twenty/packages/twenty-utils/npm-packages-release/verify-unique-package-version.ts
T
martmull 0befb021d0 Add scripts to publish cli tools (#17914)
- moves workspace:* dependencies to dev-dependencies to avoid spreading
them in npm releases
- remove fix on rollup.external
- remove prepublishOnly and postpublish scripts
- set bundle packages to private
- add release-dump-version that update package.json version before
releasing to npm
- add release-verify-build that check no externalized twenty package
exists in `dist` before releasing to npm
- works with new release github action here ->
https://github.com/twentyhq/twenty-infra/pull/397
2026-02-13 15:43:32 +00:00

28 lines
798 B
TypeScript

import { readFileSync } from 'fs';
import { resolve } from 'path';
const packages = ['twenty-sdk', 'create-twenty-app'];
const verifyUniquePackageVersion = () => {
const packageVersions = packages.map((pkg) => {
const packageJsonPath = resolve('packages', pkg, 'package.json');
const packageJsonFile = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
return packageJsonFile.version as string;
});
if (new Set(packageVersions).size !== 1) {
console.error(
`Build check failed: "${packages.join('", "')}" should have the same package.json version. Got ${packageVersions.join(', ')}`,
);
process.exit(1);
return;
}
console.log(
`"${packages.join('", "')}" share the same version ${packageVersions[0]}: OK`,
);
};
verifyUniquePackageVersion();