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

Clean check in prepublishOnly #9590

Merged
merged 2 commits into from
Apr 21, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build-flow-types build step is also used in our CI build pipeline, but in a different order:

- run: yarn run build-prod-min
- run: yarn run build-prod
- run: yarn run build-csp
- run: yarn run build-dev
- run: yarn run build-css
- run: yarn run build-style-spec
- run: yarn run build-flow-types
- run: yarn run test-build
- store_artifacts:
path: "dist"
- store_artifacts:
path: "test/release"
- persist_to_workspace:
root: .
paths:
- dist

I suggest moving this into the publish-clean-check step. It belongs there as part of the clean up

Copy link
Contributor Author

@karimnaaji karimnaaji Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to leave it here so it's not order dependent like in our CI; the second part of this command depends on dist already existing since it copies into it. Our CI runs yarn run build-style-spec which creates dist/style-spec/ folder and yarn run build-flow-types runs after, so this folder happens to exist in this order only.

"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",
"publish-clean-check": "git clean -fdx && yarn install",
karimnaaji marked this conversation as resolved.
Show resolved Hide resolved
"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 publish-clean-check 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