Skip to content

Commit

Permalink
Organize tools/tasks, remove unused deps, wip update all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachTRice committed Feb 13, 2023
1 parent 8f00213 commit 4b38608
Show file tree
Hide file tree
Showing 22 changed files with 1,971 additions and 2,245 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ python
.pydevproject
.DS_Store
bitly.json
tools
*~
*.swp
options
Expand Down
4,121 changes: 1,906 additions & 2,215 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
"build": "run-s clean getcapabilities build:config build:dev",
"build:ci": "run-s getcapabilities build:config build:prod",
"build:options": "bash -c 'tasks/buildOptions.sh'",
"build:config": "run-s build:options && node ./tasks/config.js",
"build:config": "run-s build:options && node ./tasks/util/config.js",
"build:dev": "cross-env NODE_ENV=development webpack",
"build:prod": "cross-env NODE_ENV=production webpack",
"clean": "node ./tasks/clean.js",
"clean": "node ./tasks/util/clean.js",
"dist": "run-s clean getcapabilities build:config build:prod && node ./tasks/dist.js",
"dist:dev": "run-s clean getcapabilities build:config build:dev && node ./tasks/dist.js",
"distclean": "npm run clean && node ./tasks/distclean.js",
"distclean": "npm run clean && node ./tasks/util/distclean.js",
"docker:ci": "npm run docker:restart && docker exec -it worldview /bin/bash /build/e2e/docker-ci.sh ; npm run docker:stop",
"docker:image": "docker build -t worldview .",
"docker:reimage": "docker rmi -f worldview && docker build --no-cache -t worldview .",
Expand All @@ -64,12 +64,12 @@
"lint": "run-s lint:js lint:scss",
"lint:scss": "npx stylelint ./web/scss/**/*.scss",
"lint:js": "npx eslint . --quiet",
"preinstall": "node tasks/checkNodeVersion.js",
"preinstall": "node tasks/util/checkNodeVersion.js",
"postinstall": "patch-package && npm run python",
"python": "run-script-os",
"python:darwin:linux": "bash -c 'tasks/pythonInstall.sh linux'",
"python:win32": "bash -c 'tasks/pythonInstall.sh'",
"start": "node ./tasks/start.js",
"start": "node ./tasks/util/start.js",
"test": "run-script-os",
"test:coverage": "run-script-os",
"test:coverage:default": "run-s test:unit:coverage test:unit:tz:coverage lint",
Expand All @@ -84,21 +84,21 @@
"watch": "cross-env NODE_ENV=development webpack serve",
"watch:debug:logger": "cross-env DEBUG=logger NODE_ENV=development webpack serve",
"watch:debug:devtools": "cross-env DEBUG=devtools NODE_ENV=development webpack serve",
"upload": "node tasks/upload.js"
"upload": "node tasks/util/upload.js"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-proposal-class-properties": "^7.10.1",
"@babel/preset-env": "^7.10.2",
"@babel/preset-react": "^7.10.1",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
"@webpack-cli/serve": "^1.7.0",
"@babel/core": "^7.20.5",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/preset-env": "^7.20.2",
"@babel/preset-react": "^7.18.6",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@webpack-cli/serve": "^2.0.1",
"ajv": "^8.11.2",
"autoprefixer": "^10.4.12",
"autoprefixer": "^10.4.13",
"axios": "^1.2.1",
"babel-loader": "^8.1.0",
"cheerio": "^1.0.0-rc.2",
"babel-loader": "^9.1.0",
"cheerio": "^1.0.0-rc.12",
"chromedriver": "^108.0.0",
"clean-webpack-plugin": "^4.0.0",
"cross-env": "^7.0.2",
Expand All @@ -115,6 +115,8 @@
"eslint-plugin-jsx-a11y": "^6.2.3",
"eslint-plugin-n": "^15.6.0",
"eslint-plugin-no-storage": "^1.0.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-standard": "^4.0.1",
"express": "^4.18.1",
Expand Down Expand Up @@ -149,7 +151,7 @@
"terser-webpack-plugin": "^5.3.6",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-cli": "^5.0.1",
"webpack-dev-middleware": "^5.3.3",
"webpack-dev-server": "^4.11.1",
"xml-js": "^1.6.11",
Expand Down Expand Up @@ -184,7 +186,6 @@
"ol-mapbox-style": "9.4.0",
"p-queue": "^7.3.0",
"proj4": "2.6.1",
"promise-queue": "2.2.5",
"prop-types": "^15.7.2",
"rc-slider": "9.2.2",
"react": "^16.14.0",
Expand Down Expand Up @@ -212,6 +213,7 @@
"regenerator-runtime": "^0.13.3",
"reselect": "^4.0.0",
"rgbcolor": "^0.0.4",
"simplebar": "^5.3.9",
"simplebar-react": "^2.1.0",
"stackblur": "^1.0.0",
"supercluster": "7.0.0",
Expand Down
11 changes: 11 additions & 0 deletions tasks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# tasks

A collection of tasks used in ci/cd and to build worldview locally.

## bamboo

## link-check

## build

## util
6 changes: 3 additions & 3 deletions tasks/bamboo/buildAll.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ node node_modules/.bin/patch-package --allow-root

# Replacement of npm run dist
# Needed for bamboo to avoid permission errors with npm
node $BASE/tasks/clean.js
node $BASE/tasks/util/clean.js
FETCH_GC=1 $BASE/tasks/buildOptions.sh
$BASE/tasks/buildOptions.sh
node $BASE/tasks/config.js
node $BASE/tasks/util/config.js
NODE_ENV=production npx webpack
node $BASE/tasks/dist.js
node $BASE/tasks/util/dist.js
6 changes: 6 additions & 0 deletions tasks/bamboo/linkReport.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

# TODO: this is a placeholder for the link-check ci/cd plan (to be built) that
# will run once a month
npm ci --production=false --ignore-scripts
node $BASE/tasks/link-check/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const pkg = require('../package.json')
const pkg = require('../../package.json')

// modified versionCompare function from https://stackoverflow.com/a/6832721
const versionCompare = (v1, v2) => {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tasks/dist.js → tasks/util/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const fs = require('fs')
const moment = require('moment')
const shell = require('shelljs')
const tar = require('tar')
const pkg = require('../package.json')
const pkg = require('../../package.json')

console.log('Preparing distribution')
shell.rm('-rf', 'build/worldview')
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# tools

A collection of "run-once" scripts.

## csv2colormap

## generateColormapUnitDictionary

## generateLayergroup

## generatePreviewImage

## migrateConfigs

## removeProps

## renameProps
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tasks/removeProps.js → tools/removeProps.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function processConfig (filePath) {
const layerId = Object.keys(layerJson.layers)[0]
removeKeys.forEach((key) => {
const entry = layerJson.layers[layerId]
// Leav ID prop on WMS entries
// Leave ID prop on WMS entries
if (entry.type === 'wms' && key === 'id') return
delete layerJson.layers[layerId][key]
})
Expand Down
File renamed without changes.
10 changes: 5 additions & 5 deletions web/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import keyPress from './modules/key-press/actions';
import setScreenInfo from './modules/screen-size/actions';

// Dependency CSS
import '../../node_modules/bootstrap/dist/css/bootstrap.min.css';
import '../../node_modules/ol/ol.css';
import '../../node_modules/rc-slider/dist/rc-slider.min.css';
import '../../node_modules/simplebar/dist/simplebar.min.css';
import '../../node_modules/react-swipe-to-delete-component/dist/swipe-to-delete.css';
import 'bootstrap/dist/css/bootstrap.min.css';
import 'ol/ol.css';
import 'rc-slider/dist/rc-slider.min.css';
import 'simplebar/dist/simplebar.min.css';
import 'react-swipe-to-delete-component/dist/swipe-to-delete.css';
import 'react-image-crop/dist/ReactCrop.css';
import 'react-resizable/css/styles.css';
// App CSS
Expand Down

0 comments on commit 4b38608

Please sign in to comment.