Skip to content

Commit a234798

Browse files
Cleanup and standardize package.json scripts of Bazel packages (#7005)
* [core] Remove unused package.json scripts * [cpu] Remove unused package.json scripts * [wasm] Remove unused package.json scripts * [webgl] Remove unused package.json scripts * [core] Add --test_output=streamed * [converter] Remove unused package.json scripts * [data] Remove unused package.json scripts * [layers] Standardize package.json scripts * [core] Use streamed test output where only one test is run * [tflite] Standardize package.json scripts * Bazel format
1 parent e28a5b0 commit a234798

File tree

9 files changed

+37
-68
lines changed

9 files changed

+37
-68
lines changed

tfjs-backend-cpu/package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,12 @@
2424
"@bazel/ibazel": "^0.16.2"
2525
},
2626
"scripts": {
27-
"build-ci": "yarn build",
2827
"build": "bazel build :tfjs-backend-cpu_pkg",
29-
"bundle": "bazel build :tfjs-backend-cpu_pkg",
30-
"bundle-ci": "yarn bundle",
31-
"build-npm": "bazel build :tfjs-backend-cpu_pkg",
32-
"link-local": "yalc link",
3328
"publish-npm": "bazel run :tfjs-backend-cpu_pkg.publish",
3429
"coverage": "bazel coverage :tfjs-backend-cpu_test",
3530
"test": "bazel test :tests --test_output=streamed",
3631
"test-debug": "bazel run :tfjs-backend-cpu_test --config=debug",
37-
"test-dev": "ibazel run :tests --test-output=streamed",
38-
"test-ci": "yarn test"
32+
"test-dev": "ibazel run :tests --test-output=streamed"
3933
},
4034
"dependencies": {
4135
"@types/seedrandom": "^2.4.28",

tfjs-backend-wasm/package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515
"miniprogram": "dist/miniprogram",
1616
"scripts": {
1717
"build": "bazel build -c opt :tfjs-backend-wasm_pkg",
18-
"build-dev": "bazel build -c dbg :tfjs-backend-wasm_pkg",
19-
"build-ci": "yarn build-dev",
20-
"build-npm": "yarn build",
18+
"build-dbg": "bazel build -c dbg :tfjs-backend-wasm_pkg",
2119
"publish-npm": "bazel run -c opt :tfjs-backend-wasm_pkg.publish",
2220
"clean": "bazel clean --expunge",
2321
"cpplint": "./scripts/cpplint.js",
24-
"test": "bazel test -c dbg :tests",
25-
"test-browser": "bazel test -c dbg :tfjs-backend-wasm_test",
26-
"test-node": "bazel test -c dbg :tfjs-backend-wasm_node_test",
27-
"debug-browser": "bazel run -c dbg :tfjs-backend-wasm_test",
28-
"debug-node": "bazel run --config=debug -c dbg :tfjs-backend-wasm_node_test",
22+
"test": "bazel test -c dbg :tests --test_output=all",
23+
"test-browser": "bazel test -c dbg :tfjs-backend-wasm_test --test_output=all",
24+
"test-browser-debug": "bazel run -c dbg :tfjs-backend-wasm_test --test_output=all",
25+
"test-node": "bazel test -c dbg :tfjs-backend-wasm_node_test --test_output=all",
26+
"test-node-debug": "bazel run --config=debug -c dbg :tfjs-backend-wasm_node_test --test_output=all",
2927
"test-bundle-size": "./scripts/test-bundle-size.js",
3028
"test-cc": "bazel test -c dbg //tfjs-backend-wasm/src/cc:cc_tests --test_output=all"
3129
},

tfjs-backend-webgl/package.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,10 @@
2323
"@bazel/bazelisk": "^1.12.0"
2424
},
2525
"scripts": {
26-
"build-ci": "yarn build",
2726
"build": "bazel build :tfjs-backend-webgl_pkg",
28-
"bundle": "bazel build :tfjs-backend-webgl_pkg",
29-
"bundle-ci": "yarn bundle",
30-
"build-link-package": "cd ../link-package && yarn build",
31-
"build-deps": "yarn build-link-package",
32-
"build-deps-ci": "yarn build-deps",
33-
"build-npm": "bazel build :tfjs-backend-webgl_pkg",
34-
"link-local": "yalc link",
3527
"publish-npm": "bazel run :tfjs-backend-webgl_pkg.publish",
36-
"test": "yarn test-dev",
37-
"test-dev": "bazel test :tests --test_output=streamed",
28+
"test": "bazel test :tests --test_output=streamed",
29+
"test-debug": "bazel run :tests --test_output=streamed",
3830
"run-browserstack": "bazel test :browserstack_bs_chrome_mac_tfjs-backend-webgl2_test"
3931
},
4032
"dependencies": {

tfjs-converter/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,13 @@
3636
},
3737
"scripts": {
3838
"build": "bazel build :tfjs-converter_pkg",
39-
"build-ci": "yarn build",
40-
"bundle": "yarn build",
41-
"bundle-ci": "yarn build",
42-
"build-npm": "bazel build :tfjs-converter_pkg.pack",
4339
"publish-npm": "bazel run :tfjs-converter_pkg.publish",
4440
"test": "bazel test :tests",
45-
"test-ci": "yarn test",
46-
"test-converter": "bazel test :tfjs-converter_test",
4741
"test-dev": "ibazel test :tests",
42+
"test-debug": "bazel run :tfjs-converter_test --config=debug",
43+
"test-converter": "bazel test :tfjs-converter_test",
44+
"test-converter-debug": "yarn test-debug",
4845
"test-snippets": "bazel test :test_snippets_test --test_output=all",
49-
"test-snippets-ci": "yarn test-snippets",
5046
"gen-doc": "ts-node -s ./scripts/gen_doc.ts",
5147
"model-summary": "ts-node -s ./tools/model_summary.ts",
5248
"pb2json": "ts-node -s ./tools/pb2json_converter.ts",

tfjs-core/package.json

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,17 @@
2424
"@bazel/ibazel": "^0.16.2"
2525
},
2626
"scripts": {
27-
"build-ci": "yarn build",
2827
"build": "bazel build :tfjs-core_pkg",
29-
"bundle": "bazel build :tfjs-core_pkg",
30-
"bundle-ci": "yarn bundle",
31-
"build-npm": "bazel build :tfjs-core_pkg",
32-
"format-all": "clang-format -i -style=Google --glob=src/**/*.ts",
33-
"link-local": "yalc link",
3428
"publish-npm": "bazel run :tfjs-core_pkg.publish",
3529
"coverage": "bazel coverage :tfjs-core_node_test",
3630
"test": "bazel test :tests --test_output=all",
3731
"test-dev": "ibazel test :tests --test_output=all",
38-
"test-browser": "bazel test :tfjs-core_test --test_output=all",
39-
"test-browser-debug": "bazel run :tfjs-core_test",
40-
"test-node": "bazel test :tfjs-core_node_test --test_output=all",
41-
"test-node-debug": "bazel run :tfjs-core_node_test --config=debug",
42-
"test-async-backends": "bazel test :tfjs-core_async_backends_test --test_output=all",
43-
"test-snippets": "bazel test :test_snippets_test --test_output=all"
32+
"test-browser": "bazel test :tfjs-core_test --test_output=streamed",
33+
"test-browser-debug": "bazel run :tfjs-core_test --test_output=streamed",
34+
"test-node": "bazel test :tfjs-core_node_test --test_output=streamed",
35+
"test-node-debug": "bazel run :tfjs-core_node_test --config=debug --test_output=streamed",
36+
"test-async-backends": "bazel test :tfjs-core_async_backends_test --test_output=streamed",
37+
"test-snippets": "bazel test :test_snippets_test --test_output=streamed"
4438
},
4539
"dependencies": {
4640
"@types/long": "^4.0.1",

tfjs-data/package.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,14 @@
2222
},
2323
"scripts": {
2424
"build": "bazel build :tfjs-data_pkg",
25-
"build-ci": "yarn build",
26-
"bundle": "yarn build",
27-
"bundle-ci": "yarn bundle",
28-
"build-link-package": "cd ../link-package && yarn build",
29-
"build-deps": "yarn build-link-package",
30-
"build-deps-ci": "yarn build-deps",
31-
"build-npm": "bazel build :tfjs-data_pkg",
3225
"publish-npm": "bazel run :tfjs-data_pkg.publish",
33-
"test-browser": "ibazel run :tfjs-data_browser_test --test-output=streamed",
26+
"test": "bazel test :tests",
3427
"test-dev": "ibazel test :tests",
35-
"test": "bazel test :tests"
28+
"test-debug": "yarn test-node-debug",
29+
"test-browser": "bazel test :tfjs-data_browser_test --test-output=streamed",
30+
"test-browser-debug": "bazel run :tfjs-data_browser_test --test-output=streamed",
31+
"test-node": "bazel test --test_output=streamed :tfjs-data_test",
32+
"test-node-debug": "bazel run --config=debug --test_output=streamed :tfjs-data_test"
3633
},
3734
"peerDependencies": {
3835
"@tensorflow/tfjs-core": "link:../link-package/node_modules/@tensorflow/tfjs-core",

tfjs-layers/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ js_library(
162162
test_suite(
163163
name = "tests",
164164
tests = [
165+
":tfjs-layers_webgl1_test",
165166
":tfjs-layers_webgl2_test",
166167
],
167168
)

tfjs-layers/package.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,20 @@
2121
"clang-format": "~1.8.0"
2222
},
2323
"scripts": {
24-
"prep": "yarn install && yarn build-ci",
2524
"build": "bazel build :tfjs-layers_pkg",
26-
"build-ci": "yarn build",
27-
"bundle": "yarn build",
28-
"bundle-ci": "yarn bundle",
29-
"build-npm": "bazel build :tfjs-layers_pkg",
3025
"format": "./tools/clang_format_ts.sh",
3126
"publish-npm": "bazel run :tfjs-layers_pkg.publish",
32-
"test-dev": "bazel test :tests --test_output=streamed",
33-
"test": "yarn test-dev",
27+
"test": "bazel test :tests --test_output=all",
28+
"test-dev": "ibazel test :tests --test_output=streamed",
29+
"test-debug": "yarn test-webgl2-debug",
30+
"test-browser": "yarn test-webgl2",
31+
"test-browser-debug": "yarn test-webgl2-debug",
32+
"test-webgl2": "bazel test :tfjs-layers_webgl2_test --test_output=streamed",
33+
"test-webgl2-debug": "bazel run :tfjs-layers_webgl2_test --test_output=streamed",
34+
"test-webgl2-dev": "ibazel test :tfjs-layers_webgl2_test --test_output=streamed",
35+
"test-webgl1": "bazel test :tfjs-layers_webgl1_test --test_output=streamed",
36+
"test-webgl1-debug": "bazel run :tfjs-layers_webgl1_test --test_output=streamed",
37+
"test-webgl1-dev": "ibazel test :tfjs-layers_webgl1_test --test_output=streamed",
3438
"run-browserstack": "bazel test :browserstack_bs_chrome_mac_tfjs-layers_webgl2_test"
3539
},
3640
"peerDependencies": {

tfjs-tflite/package.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,10 @@
2323
"@bazel/bazelisk": "^1.12.0"
2424
},
2525
"scripts": {
26-
"prep": "./scripts/download-tflite-web-api.sh",
2726
"build": "bazel build :tfjs-tflite_pkg",
28-
"build-ci": "yarn build",
29-
"bundle": "bazel build :tfjs-tflite_pkg",
30-
"bundle-ci": "yarn bundle",
31-
"build-link-package": "cd ../link-package && yarn build",
32-
"build-deps": "yarn build-link-package",
33-
"build-npm": "bazel build :tfjs-tflite_pkg",
3427
"publish-npm": "bazel run :tfjs-tflite_pkg.publish",
3528
"test": "bazel test :tests --test_output=all",
36-
"test-ci": "yarn test",
29+
"test-dev": "ibazel test :tests --test_output=all",
3730
"test-debug": "bazel run :tfjs-tflite_test"
3831
},
3932
"resolutions": {

0 commit comments

Comments
 (0)