0befb021d0
- 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
29 lines
819 B
TypeScript
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();
|