n8n/.github/scripts/trim-fe-packageJson.js
कारतोफ्फेलस्क्रिप्ट™ cc26616198
ci: Fix trim-fe-packageJson.js (no-changelog)
2024-07-10 17:19:55 +02:00

19 lines
615 B
JavaScript

const { writeFileSync } = require('fs');
const { resolve } = require('path');
const baseDir = resolve(__dirname, '../..');
const trimPackageJson = (packageName) => {
const filePath = resolve(baseDir, 'packages', packageName, 'package.json');
const { scripts, peerDependencies, devDependencies, dependencies, ...packageJson } = require(
filePath,
);
if (packageName === '@n8n/chat') {
packageJson.dependencies = dependencies;
}
writeFileSync(filePath, JSON.stringify(packageJson, null, 2) + '\n', 'utf-8');
};
trimPackageJson('@n8n/chat');
trimPackageJson('design-system');
trimPackageJson('editor-ui');