mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2025-01-09 14:12:05 -05:00
27 lines
726 B
JavaScript
27 lines
726 B
JavaScript
|
const fs = require('fs');
|
||
|
|
||
|
const desktopPackage = require('../package.json');
|
||
|
const desktopRawPackage = require('../package-deps.json');
|
||
|
const guiPackage = require('../node_modules/scratch-gui/package.json');
|
||
|
|
||
|
const sortObject = obj => Object
|
||
|
.keys(obj)
|
||
|
.sort()
|
||
|
.reduce(
|
||
|
(accumulator, currentKey) => {
|
||
|
accumulator[currentKey] = obj[currentKey];
|
||
|
return accumulator;
|
||
|
},
|
||
|
{}
|
||
|
);
|
||
|
|
||
|
desktopPackage.devDependencies = sortObject(Object.assign(
|
||
|
{},
|
||
|
guiPackage.devDependencies,
|
||
|
desktopRawPackage.devDependencies
|
||
|
));
|
||
|
|
||
|
let newDesktopPackage = JSON.stringify(desktopPackage, null, 2);
|
||
|
newDesktopPackage += '\n';
|
||
|
fs.writeFileSync('package.json', newDesktopPackage);
|