Skip to content

Commit

Permalink
Add build/watch shell scripts to api-explorer-ui
Browse files Browse the repository at this point in the history
This allows you to do `lerna run build/watch` at the top level
to build/watch all the packages
  • Loading branch information
Dom Harrington committed Dec 7, 2017
1 parent d8cbc57 commit 68bcd00
Show file tree
Hide file tree
Showing 7 changed files with 46,692 additions and 1,246 deletions.
84 changes: 43 additions & 41 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
"scripts": {
"test": "eslint -f unix example && lerna run test",
"example": "npm start",
"start": "node scripts/update-example-swagger-files && budo example/index.jsx --dir example -- -t babelify -p livereactload --extension .jsx",
"build": "watchify packages/api-explorer-ui/src/index.jsx -t [ babelify ] -o 'derequire > packages/api-explorer-ui/dist/index.js' --extension jsx --standalone ApiExplorer --debug -v"
"start": "node scripts/update-example-swagger-files && budo example/index.jsx --dir example -- -t babelify -p livereactload --extension .jsx"
},
"publishConfig": {
"registry": "http://registry.npmjs.org"
Expand Down
7 changes: 7 additions & 0 deletions packages/api-explorer-ui/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
browserify src/index.jsx \
--extension jsx \
--standalone ApiExplorer \
-t [ babelify ] \
-g [ envify --NODE_ENV production ] \
-g uglifyify \
| uglifyjs --compress --mangle > ./dist/index.js
47,769 changes: 46,567 additions & 1,202 deletions packages/api-explorer-ui/dist/index.js

Large diffs are not rendered by default.

61 changes: 61 additions & 0 deletions packages/api-explorer-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion packages/api-explorer-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
"inspect": "jsinspect",
"prettier": "prettier --list-different \"./**/**.{js,jsx}\"",
"pretest": "npm run lint && npm run inspect && npm run prettier",
"test": "jest --coverage"
"test": "jest --coverage",
"watch": "./watch.sh",
"build": "./build.sh"
},
"jest": {
"setupFiles": [
Expand Down Expand Up @@ -57,6 +59,7 @@
"babel-preset-react": "^6.24.1",
"babelify": "^7.3.0",
"derequire": "^2.0.6",
"envify": "^4.1.0",
"enzyme": "^3.1.0",
"enzyme-adapter-react-16": "^1.0.1",
"eslint": "^3.19.0",
Expand All @@ -75,6 +78,8 @@
"raf": "^3.4.0",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.0.0",
"uglify-es": "^3.2.1",
"uglifyify": "^4.0.5",
"watchify": "^3.9.0",
"webpack": "^3.3.0"
}
Expand Down
7 changes: 7 additions & 0 deletions packages/api-explorer-ui/watch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
watchify src/index.jsx \
--extension jsx \
--standalone ApiExplorer \
--debug \
--verbose \
-t [ babelify ] \
-o 'derequire > dist/index.js'

0 comments on commit 68bcd00

Please sign in to comment.