2023-11-29 06:25:50 -08:00
|
|
|
const { writeFileSync } = require('fs');
|
2023-08-31 05:05:12 -07:00
|
|
|
const { resolve } = require('path');
|
2024-07-10 08:19:55 -07:00
|
|
|
const baseDir = resolve(__dirname, '../..');
|
2023-08-31 05:05:12 -07:00
|
|
|
|
|
|
|
const trimPackageJson = (packageName) => {
|
|
|
|
const filePath = resolve(baseDir, 'packages', packageName, 'package.json');
|
2023-11-29 06:25:50 -08:00
|
|
|
const { scripts, peerDependencies, devDependencies, dependencies, ...packageJson } = require(
|
|
|
|
filePath,
|
|
|
|
);
|
2024-07-10 08:19:55 -07:00
|
|
|
if (packageName === '@n8n/chat') {
|
|
|
|
packageJson.dependencies = dependencies;
|
|
|
|
}
|
2023-08-31 05:05:12 -07:00
|
|
|
writeFileSync(filePath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
|
2023-11-29 06:25:50 -08:00
|
|
|
};
|
2023-08-31 05:05:12 -07:00
|
|
|
|
2023-11-29 06:25:50 -08:00
|
|
|
trimPackageJson('@n8n/chat');
|
|
|
|
trimPackageJson('design-system');
|
|
|
|
trimPackageJson('editor-ui');
|