Skip to content

Commit

Permalink
Clean check in prepublishOnly (#9590)
Browse files Browse the repository at this point in the history
* Clean check in prepublishOnly

Runs clean check as a first step in prepublishOnly.
This ensures a clean directory before building the build content and
before the manual diffing with previously published tarball.

* Address comments
  • Loading branch information
karimnaaji authored Apr 21, 2020
1 parent ced93c1 commit 01a9929
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"build-prod-min": "rollup -c --environment BUILD:production,MINIFY:true",
"build-csp": "rollup -c rollup.config.csp.js",
"build-query-suite": "rollup -c test/integration/rollup.config.test.js",
"build-flow-types": "cp build/mapbox-gl.js.flow dist/mapbox-gl.js.flow && cp build/mapbox-gl.js.flow dist/mapbox-gl-dev.js.flow",
"build-flow-types": "mkdir -p dist && cp build/mapbox-gl.js.flow dist/mapbox-gl.js.flow && cp build/mapbox-gl.js.flow dist/mapbox-gl-dev.js.flow",
"build-css": "postcss -o dist/mapbox-gl.css src/css/mapbox-gl.css",
"build-style-spec": "cd src/style-spec && npm run build && cd ../.. && mkdir -p dist/style-spec && cp src/style-spec/dist/* dist/style-spec",
"watch-css": "postcss --watch -o dist/mapbox-gl.css src/css/mapbox-gl.css",
Expand All @@ -141,6 +141,7 @@
"start-bench": "run-p build-token watch-benchmarks start-server",
"start-release": "run-s build-token build-prod-min build-css print-release-url start-server",
"diff-tarball": "build/run-node build/diff-tarball && echo \"Please confirm the above is correct [y/n]? \"; read answer; if [ \"$answer\" = \"${answer#[Yy]}\" ]; then false; fi",
"prepare-publish": "git clean -fdx && yarn install",
"lint": "eslint --cache --ignore-path .gitignore src test bench debug/*.html",
"lint-docs": "documentation lint src/index.js",
"lint-css": "stylelint 'src/css/mapbox-gl.css'",
Expand All @@ -157,7 +158,7 @@
"test-expressions": "build/run-node test/expression.test.js",
"test-flow": "build/run-node build/generate-flow-typed-style-spec && flow .",
"test-cov": "nyc --require=@mapbox/flow-remove-types/register --reporter=text-summary --reporter=lcov --cache run-s test-unit test-expressions test-query test-render",
"prepublishOnly": "run-s build-flow-types build-dev build-prod-min build-prod build-csp build-css build-style-spec test-build diff-tarball",
"prepublishOnly": "run-s prepare-publish build-flow-types build-dev build-prod-min build-prod build-csp build-css build-style-spec test-build diff-tarball",
"print-release-url": "node build/print-release-url.js",
"codegen": "build/run-node build/generate-style-code.js && build/run-node build/generate-struct-arrays.js"
},
Expand Down
2 changes: 1 addition & 1 deletion src/style-spec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"copy-flow-typed": "cp -R ../../flow-typed .",
"build": "../../node_modules/.bin/rollup -c && ../../node_modules/.bin/rollup -c --environment esm",
"prepublish": "yarn copy-flow-typed && yarn build",
"prepublish": "git clean -fdx && yarn copy-flow-typed && yarn build",
"postpublish": "rm -r flow-typed dist/index.js"
},
"repository": {
Expand Down

0 comments on commit 01a9929

Please sign in to comment.