ci: Fix trim-fe-packageJson.js (no-changelog)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-07-10 17:19:55 +02:00
parent aeac7b6247
commit cc26616198
No known key found for this signature in database
GPG key ID: 9300FF7CDEA1FBAA

View file

@ -1,12 +1,15 @@
const { writeFileSync } = require('fs');
const { resolve } = require('path');
const baseDir = resolve(__dirname, '..');
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');
};