Skip to content

Commit df9f27e

Browse files
authored
chore: fix gapic-generator-typescript build scripts for easier local development (#8103)
* chore: fix gapic-generator-typescript build scripts for easier local development * address gemini suggestion about types field in tsconfig * remove unneeded tsconfig "types" property * update pnpm-lock.yaml so Bazel doesn't break on diff * remove uneeded copy/rename steps from prepack and postpack * restore bazelisk dev dependency, it may be required by CI * regenerate pnpm lockfile * regenerate lockfile with Bazel for compatible version
1 parent a47507c commit df9f27e

7 files changed

Lines changed: 449 additions & 413 deletions

File tree

core/generator/gapic-generator-typescript/package.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,20 @@
2626
"build/templates"
2727
],
2828
"scripts": {
29-
"baseline": "node bazel-bin/typescript/tools/update-baselines.js",
30-
"clean": "bazelisk clean && rm -rf build",
31-
"codecov": "c8 --reporter=lcov mocha bazel-bin/typescript/test/unit && c8 report",
32-
"compile": "bazelisk build //...",
29+
"baseline": "node build/typescript/tools/update-baselines.js",
30+
"clean": "rm -rf build",
31+
"codecov": "c8 --reporter=lcov mocha build/typescript/test/unit && c8 report",
32+
"compile": "tsc && chmod +x build/typescript/src/gapic-generator-typescript.js build/typescript/src/protoc-plugin.js && cp -rf templates protos build/",
3333
"compile-protos-json": "pbjs -t json -o protos/protos.json -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto",
3434
"compile-protos-js": "pbjs -t static-module -o protos/index.js -p node_modules/google-gax/build/protos -p protos google/api/annotations.proto google/api/field_behavior.proto google/api/field_info.proto google/api/resource.proto google/api/routing.proto google/longrunning/operations.proto google/protobuf/compiler/plugin.proto service_config.proto snippet_index.proto",
3535
"compile-protos-dts": "pbts protos/index.js -o protos/index.d.ts",
3636
"docker-test": "sh docker/test.sh",
3737
"fix": "gts fix",
38-
"js-test-application": "mocha bazel-bin/typescript/test/test-application/test-js --timeout 600000",
3938
"lint": "gts check",
40-
"prepack:cjs": "npm run compile && cd templates/cjs/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/",
41-
"prepack:esm": "npm run compile && cd templates/esm/typescript_gapic && rm -f package.json.njk && mv package.json package.json.njk && cd ../../.. && mkdir -p build && cp -rf bazel-bin/typescript templates protos build/",
39+
"prepack:cjs": "npm run compile",
40+
"prepack:esm": "npm run compile",
4241
"prepack": "npm run prepack:cjs && npm run prepack:esm",
43-
"postpack:cjs": "cd templates/cjs/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk",
44-
"postpack:esm": "cd templates/esm/typescript_gapic && mv package.json.njk package.json && ln -s package.json package.json.njk",
45-
"postpack": "npm run postpack:cjs && npm run postpack:esm",
46-
"test": "bazelisk test --test_output=errors //:unit_tests",
47-
"ts-test-application": "mocha bazel-bin/typescript/test/test-application/test-ts --timeout 600000",
42+
"test": "mocha build/typescript/test/unit",
4843
"system-test": "echo 'no system test'",
4944
"samples-test": "echo 'no samples test'",
5045
"docs": "echo no docs needed",

0 commit comments

Comments
 (0)