Skip to content

Commit

Permalink
update packageJSON imports in gulp updater
Browse files Browse the repository at this point in the history
  • Loading branch information
GhomKrosmonaute committed May 1, 2024
1 parent 2b2a511 commit 5e46310
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,14 @@ function _copyConfig() {
.pipe(gulp.dest(__dirname, { overwrite: false }))
}

function _updateDependencies(cb) {
function _updatePackageJSON(cb) {
const localPackageJSON = JSON.parse(fs.readFileSync("./package.json", "utf8"))
const remotePackageJSON = JSON.parse(
fs.readFileSync("./temp/package.json", "utf8"),
)

localPackageJSON.main = remotePackageJSON.main
localPackageJSON.type = remotePackageJSON.type
localPackageJSON.version = remotePackageJSON.version

localPackageJSON.engines = {
Expand All @@ -152,6 +153,11 @@ function _updateDependencies(cb) {
...remotePackageJSON.scripts,
}

localPackageJSON.imports = {
...localPackageJSON.imports,
...remotePackageJSON.imports,
}

for (const baseKey of ["dependencies", "devDependencies"]) {
const dependencies = localPackageJSON[baseKey]
const newDependencies = remotePackageJSON[baseKey]
Expand Down Expand Up @@ -268,7 +274,7 @@ export const update = gulp.series(
_copyTemp,
_copyConfig,
_removeDuplicates,
_updateDependencies,
_updatePackageJSON,
_updateDatabaseFile,
_gitLog,
_cleanTemp,
Expand Down

0 comments on commit 5e46310

Please sign in to comment.