mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-11 08:46:16 +00:00
39 lines
1020 B
JavaScript
39 lines
1020 B
JavaScript
const path = require("path");
|
|
const merge = require("deepmerge");
|
|
|
|
function readPackage(pkg, context) {
|
|
const eslintDeps = require('./configuration/eslint-config/package.json').peerDependencies;
|
|
const prettierDeps = require('./configuration/prettier-config/package.json').peerDependencies;
|
|
|
|
pkg.devDependencies = {
|
|
...eslintDeps,
|
|
...prettierDeps,
|
|
...(pkg.devDependencies || {}),
|
|
}
|
|
|
|
// const targetConfig = defaultConfig
|
|
// .provideFields
|
|
// ?.map(it => it.split('.'))
|
|
// .reduce((acc, curr) => {
|
|
// let target = acc;
|
|
// let from = defaultConfig;
|
|
// for (const fragment of curr.slice(0, -1)) {
|
|
// target[fragment] = target[fragment] || {}
|
|
// target = target[fragment]
|
|
// from = from[fragment]
|
|
// }
|
|
// const fragment = curr[curr.length - 1]
|
|
// target[fragment] = from[fragment];
|
|
// return acc;
|
|
// }, {}) ?? {}
|
|
// return merge(targetConfig, pkg);
|
|
|
|
return pkg
|
|
}
|
|
|
|
module.exports = {
|
|
hooks: {
|
|
readPackage,
|
|
}
|
|
}
|