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

Cleanup and standardize package.json scripts of Bazel packages #7005

Merged
merged 11 commits into from
Nov 2, 2022
8 changes: 1 addition & 7 deletions tfjs-backend-cpu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,12 @@
"@bazel/ibazel": "^0.16.2"
},
"scripts": {
"build-ci": "yarn build",
"build": "bazel build :tfjs-backend-cpu_pkg",
"bundle": "bazel build :tfjs-backend-cpu_pkg",
"bundle-ci": "yarn bundle",
"build-npm": "bazel build :tfjs-backend-cpu_pkg",
"link-local": "yalc link",
"publish-npm": "bazel run :tfjs-backend-cpu_pkg.publish",
"coverage": "bazel coverage :tfjs-backend-cpu_test",
"test": "bazel test :tests --test_output=streamed",
"test-debug": "bazel run :tfjs-backend-cpu_test --config=debug",
"test-dev": "ibazel run :tests --test-output=streamed",
"test-ci": "yarn test"
"test-dev": "ibazel run :tests --test-output=streamed"
},
"dependencies": {
"@types/seedrandom": "^2.4.28",
Expand Down
14 changes: 6 additions & 8 deletions tfjs-backend-wasm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
"miniprogram": "dist/miniprogram",
"scripts": {
"build": "bazel build -c opt :tfjs-backend-wasm_pkg",
"build-dev": "bazel build -c dbg :tfjs-backend-wasm_pkg",
"build-ci": "yarn build-dev",
"build-npm": "yarn build",
"build-dbg": "bazel build -c dbg :tfjs-backend-wasm_pkg",
"publish-npm": "bazel run -c opt :tfjs-backend-wasm_pkg.publish",
"clean": "bazel clean --expunge",
"cpplint": "./scripts/cpplint.js",
"test": "bazel test -c dbg :tests",
"test-browser": "bazel test -c dbg :tfjs-backend-wasm_test",
"test-node": "bazel test -c dbg :tfjs-backend-wasm_node_test",
"debug-browser": "bazel run -c dbg :tfjs-backend-wasm_test",
"debug-node": "bazel run --config=debug -c dbg :tfjs-backend-wasm_node_test",
"test": "bazel test -c dbg :tests --test_output=all",
"test-browser": "bazel test -c dbg :tfjs-backend-wasm_test --test_output=all",
"test-browser-debug": "bazel run -c dbg :tfjs-backend-wasm_test --test_output=all",
"test-node": "bazel test -c dbg :tfjs-backend-wasm_node_test --test_output=all",
"test-node-debug": "bazel run --config=debug -c dbg :tfjs-backend-wasm_node_test --test_output=all",
"test-bundle-size": "./scripts/test-bundle-size.js",
"test-cc": "bazel test -c dbg //tfjs-backend-wasm/src/cc:cc_tests --test_output=all"
},
Expand Down
12 changes: 2 additions & 10 deletions tfjs-backend-webgl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,10 @@
"@bazel/bazelisk": "^1.12.0"
},
"scripts": {
"build-ci": "yarn build",
"build": "bazel build :tfjs-backend-webgl_pkg",
"bundle": "bazel build :tfjs-backend-webgl_pkg",
"bundle-ci": "yarn bundle",
"build-link-package": "cd ../link-package && yarn build",
"build-deps": "yarn build-link-package",
"build-deps-ci": "yarn build-deps",
"build-npm": "bazel build :tfjs-backend-webgl_pkg",
"link-local": "yalc link",
"publish-npm": "bazel run :tfjs-backend-webgl_pkg.publish",
"test": "yarn test-dev",
"test-dev": "bazel test :tests --test_output=streamed",
"test": "bazel test :tests --test_output=streamed",
"test-debug": "bazel run :tests --test_output=streamed",
"run-browserstack": "bazel test :browserstack_bs_chrome_mac_tfjs-backend-webgl2_test"
},
"dependencies": {
Expand Down
10 changes: 3 additions & 7 deletions tfjs-converter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,13 @@
},
"scripts": {
"build": "bazel build :tfjs-converter_pkg",
"build-ci": "yarn build",
"bundle": "yarn build",
"bundle-ci": "yarn build",
"build-npm": "bazel build :tfjs-converter_pkg.pack",
"publish-npm": "bazel run :tfjs-converter_pkg.publish",
"test": "bazel test :tests",
"test-ci": "yarn test",
"test-converter": "bazel test :tfjs-converter_test",
"test-dev": "ibazel test :tests",
"test-debug": "bazel run :tfjs-converter_test --config=debug",
"test-converter": "bazel test :tfjs-converter_test",
"test-converter-debug": "yarn test-debug",
"test-snippets": "bazel test :test_snippets_test --test_output=all",
"test-snippets-ci": "yarn test-snippets",
"gen-doc": "ts-node -s ./scripts/gen_doc.ts",
"model-summary": "ts-node -s ./tools/model_summary.ts",
"pb2json": "ts-node -s ./tools/pb2json_converter.ts",
Expand Down
18 changes: 6 additions & 12 deletions tfjs-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,17 @@
"@bazel/ibazel": "^0.16.2"
},
"scripts": {
"build-ci": "yarn build",
"build": "bazel build :tfjs-core_pkg",
"bundle": "bazel build :tfjs-core_pkg",
"bundle-ci": "yarn bundle",
"build-npm": "bazel build :tfjs-core_pkg",
"format-all": "clang-format -i -style=Google --glob=src/**/*.ts",
"link-local": "yalc link",
"publish-npm": "bazel run :tfjs-core_pkg.publish",
"coverage": "bazel coverage :tfjs-core_node_test",
"test": "bazel test :tests --test_output=all",
"test-dev": "ibazel test :tests --test_output=all",
"test-browser": "bazel test :tfjs-core_test --test_output=all",
"test-browser-debug": "bazel run :tfjs-core_test",
"test-node": "bazel test :tfjs-core_node_test --test_output=all",
"test-node-debug": "bazel run :tfjs-core_node_test --config=debug",
"test-async-backends": "bazel test :tfjs-core_async_backends_test --test_output=all",
"test-snippets": "bazel test :test_snippets_test --test_output=all"
"test-browser": "bazel test :tfjs-core_test --test_output=streamed",
"test-browser-debug": "bazel run :tfjs-core_test --test_output=streamed",
"test-node": "bazel test :tfjs-core_node_test --test_output=streamed",
"test-node-debug": "bazel run :tfjs-core_node_test --config=debug --test_output=streamed",
"test-async-backends": "bazel test :tfjs-core_async_backends_test --test_output=streamed",
"test-snippets": "bazel test :test_snippets_test --test_output=streamed"
},
"dependencies": {
"@types/long": "^4.0.1",
Expand Down
15 changes: 6 additions & 9 deletions tfjs-data/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,14 @@
},
"scripts": {
"build": "bazel build :tfjs-data_pkg",
"build-ci": "yarn build",
"bundle": "yarn build",
"bundle-ci": "yarn bundle",
"build-link-package": "cd ../link-package && yarn build",
"build-deps": "yarn build-link-package",
"build-deps-ci": "yarn build-deps",
"build-npm": "bazel build :tfjs-data_pkg",
"publish-npm": "bazel run :tfjs-data_pkg.publish",
"test-browser": "ibazel run :tfjs-data_browser_test --test-output=streamed",
"test": "bazel test :tests",
"test-dev": "ibazel test :tests",
"test": "bazel test :tests"
"test-debug": "yarn test-node-debug",
"test-browser": "bazel test :tfjs-data_browser_test --test-output=streamed",
"test-browser-debug": "bazel run :tfjs-data_browser_test --test-output=streamed",
"test-node": "bazel test --test_output=streamed :tfjs-data_test",
"test-node-debug": "bazel run --config=debug --test_output=streamed :tfjs-data_test"
},
"peerDependencies": {
"@tensorflow/tfjs-core": "link:../link-package/node_modules/@tensorflow/tfjs-core",
Expand Down
1 change: 1 addition & 0 deletions tfjs-layers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ js_library(
test_suite(
name = "tests",
tests = [
":tfjs-layers_webgl1_test",
":tfjs-layers_webgl2_test",
],
)
18 changes: 11 additions & 7 deletions tfjs-layers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@
"clang-format": "~1.8.0"
},
"scripts": {
"prep": "yarn install && yarn build-ci",
"build": "bazel build :tfjs-layers_pkg",
"build-ci": "yarn build",
"bundle": "yarn build",
"bundle-ci": "yarn bundle",
"build-npm": "bazel build :tfjs-layers_pkg",
"format": "./tools/clang_format_ts.sh",
"publish-npm": "bazel run :tfjs-layers_pkg.publish",
"test-dev": "bazel test :tests --test_output=streamed",
"test": "yarn test-dev",
"test": "bazel test :tests --test_output=all",
"test-dev": "ibazel test :tests --test_output=streamed",
"test-debug": "yarn test-webgl2-debug",
"test-browser": "yarn test-webgl2",
"test-browser-debug": "yarn test-webgl2-debug",
"test-webgl2": "bazel test :tfjs-layers_webgl2_test --test_output=streamed",
"test-webgl2-debug": "bazel run :tfjs-layers_webgl2_test --test_output=streamed",
"test-webgl2-dev": "ibazel test :tfjs-layers_webgl2_test --test_output=streamed",
"test-webgl1": "bazel test :tfjs-layers_webgl1_test --test_output=streamed",
"test-webgl1-debug": "bazel run :tfjs-layers_webgl1_test --test_output=streamed",
"test-webgl1-dev": "ibazel test :tfjs-layers_webgl1_test --test_output=streamed",
"run-browserstack": "bazel test :browserstack_bs_chrome_mac_tfjs-layers_webgl2_test"
},
"peerDependencies": {
Expand Down
9 changes: 1 addition & 8 deletions tfjs-tflite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,10 @@
"@bazel/bazelisk": "^1.12.0"
},
"scripts": {
"prep": "./scripts/download-tflite-web-api.sh",
"build": "bazel build :tfjs-tflite_pkg",
"build-ci": "yarn build",
"bundle": "bazel build :tfjs-tflite_pkg",
"bundle-ci": "yarn bundle",
"build-link-package": "cd ../link-package && yarn build",
"build-deps": "yarn build-link-package",
"build-npm": "bazel build :tfjs-tflite_pkg",
"publish-npm": "bazel run :tfjs-tflite_pkg.publish",
"test": "bazel test :tests --test_output=all",
"test-ci": "yarn test",
"test-dev": "ibazel test :tests --test_output=all",
"test-debug": "bazel run :tfjs-tflite_test"
},
"resolutions": {
Expand Down