Files
twenty/packages/twenty-utils/npm-packages-release/verify-build-packages-bundle-twenty-dependencies.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

29 lines
819 B
TypeScript

import { readFileSync, existsSync } from 'fs';
import { resolve } from 'path';
const verifyBuildPackagesBundleTwentyDependencies = () => {
const distPath = resolve('dist/cli.cjs');
if (!existsSync(distPath)) {
console.error(`Build check failed: ${distPath} does not exist`);
process.exit(1);
}
const content = readFileSync(distPath, 'utf8');
const filePath = resolve('package.json');
const pkg = JSON.parse(readFileSync(filePath, 'utf8'));
if (/require\("twenty/.test(content)) {
console.error(
`Build check failed: ${pkg.name}/dist/cli.cjs contains a require("twenty...) import. Workspace packages should be bundled, not externalized.`,
);
process.exit(1);
} else {
console.log(`${pkg.name}/dist/cli.cjs: OK`);
}
};
verifyBuildPackagesBundleTwentyDependencies();