Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#5972 fix npm install and remove checkcesium #5835

Merged
merged 2 commits into from
Sep 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@
"geostyler-openlayers-parser": "1.1.4",
"geostyler-sld-parser": "2.0.1",
"history": "4.6.1",
"html2canvas": "0.5.0-beta4",
"html2canvas": "0.5.0-beta4",
"html-to-draftjs": "1.5.0",
"immutable": "4.0.0-rc.12",
"intersection-observer": "0.7.0",
"intl": "1.2.2",
Expand Down Expand Up @@ -249,7 +250,7 @@
"cleandoc": "rimraf web/docs && rimraf web/client/mapstore/docs",
"doctest": "docma -c build/docma-config.json --dest web/client/mapstore/docs && echo documentation is accessible from the mapstore/docs path when running npm start",
"i18n": "node utility/translations/findMissingTranslations.js",
"postinstall": "node utility/build/checkCesium.js && node utility/build/postInstall.js",
"postinstall": "node utility/build/postInstall.js",
"clean": "rimraf ./web/client/dist",
"compile": "npm run clean && mkdirp ./web/client/dist && node --max_old_space_size=2048 ./node_modules/webpack/bin/webpack.js --progress --colors --config build/prod-webpack.config.js",
"analyze": "npm run clean && mkdirp ./web/client/dist && webpack --json --config build/prod-webpack.config.js | webpack-bundle-size-analyzer",
Expand Down
28 changes: 0 additions & 28 deletions utility/build/checkCesium.js

This file was deleted.

25 changes: 18 additions & 7 deletions utility/build/postInstall.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
console.log("********** post install **********");

const fs = require('fs-extra');
const isInProject = !fs.existsSync('./node_modules/cesium');
const dirPrefix = isInProject ? '..' : '.';
fs.removeSync(`${dirPrefix}/node_modules/leaflet-simple-graticule/node_modules`);
fs.removeSync(`${dirPrefix}/node_modules/react-sortable-items/node_modules/react-dom`);
fs.removeSync(`${dirPrefix}/node_modules/geostyler-openlayers-parser/node_modules/@terrestris`); // explicit dependency in package.json
fs.emptyDirSync(`${dirPrefix}/node_modules/mocha`);
fs.copySync(`${dirPrefix}/node_modules/@geosolutions/mocha`, `${dirPrefix}/node_modules/mocha`);
const isInProject = fs.existsSync('./MapStore2');
console.log(isInProject ? "* in project" : "* not in project");

fs.removeSync(`./node_modules/leaflet-simple-graticule/node_modules`);
fs.removeSync(`./node_modules/react-sortable-items/node_modules/react-dom`);
fs.removeSync(`./node_modules/geostyler-openlayers-parser/node_modules/@terrestris`); // explicit dependency in package.json
/**
* this is run 2 times because one from the package.json of the project and one from mapstore2 library
* when run from the project there is an error when the version from mapstore is executed therefore
* we perform a check before do the copy
* */
if (fs.existsSync('./node_modules/@geosolutions/mocha')) {
console.log("* executing the copy of mocha");
fs.emptyDirSync(`./node_modules/mocha`);
fs.copySync(`./node_modules/@geosolutions/mocha`, `./node_modules/mocha`);
}