Skip to content

Commit

Permalink
geosolutions-it#5972 fix npm install and remove checkcesium (geosolut…
Browse files Browse the repository at this point in the history
…ions-it#5835)

* geosolutions-it#5972 fix npm install and remove checkcesium

* remove check cesium add html-to-draftjs
  • Loading branch information
MV88 authored Sep 8, 2020
1 parent 4caa5a0 commit c1894d8
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 37 deletions.
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`);
}

0 comments on commit c1894d8

Please sign in to comment.