From e32dce3d9b2aca880894ce5b1a7815b866b11db6 Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:41:43 -0400 Subject: [PATCH 1/5] build: shift typeless invocation into repo --- owlbot.py | 12 +++++++++--- package.json | 3 ++- samples/package.json | 5 ++++- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/owlbot.py b/owlbot.py index f3e6252cc..fb4ebecc1 100644 --- a/owlbot.py +++ b/owlbot.py @@ -12,16 +12,22 @@ # See the License for the specific language governing permissions and # limitations under the License. -import synthtool.languages.node as node +from synthtool.languages import node +from synthtool import shell +from synthtool.log import logger # Generate JS samples from TS. -node.typeless_samples_hermetic() +# node.typeless_samples_hermetic() # We need to run this before the main owlbot processing, to make # sure quickstart.js gets gts fixed before the README is generated. # This needs to be worked out more properly, this is temporary. +logger.debug("Run typeless sample bot") node.install() -node.fix() +shell.run(["npm", "run", "typeless"]) + +# node.fix() + # Main OwlBot processing. node.owlbot_main(templates_excludes=[ diff --git a/package.json b/package.json index c2b0ff7c4..d6806b37f 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,8 @@ "predocs-test": "npm run docs", "benchwrapper": "node bin/benchwrapper.js", "prelint": "cd samples; npm link ../; npm install", - "precompile": "gts clean" + "precompile": "gts clean", + "typeless": "cd samples; npm run typeless" }, "dependencies": { "@google-cloud/paginator": "^5.0.0", diff --git a/samples/package.json b/samples/package.json index aff99d498..041b769da 100644 --- a/samples/package.json +++ b/samples/package.json @@ -18,7 +18,9 @@ "sampletsc": "cd typescript && tsc -p . && cd ..", "compile": "npm run tsc && npm run sampletsc", "clean": "gts clean && rm -rf build/", - "precompile": "npm run clean" + "precompile": "npm run clean", + "typeless": "typeless-sample-bot --outputpath . --targets . --recursive", + "posttypeless": "gts fix" }, "dependencies": { "@google-cloud/opentelemetry-cloud-trace-exporter": "^2.0.0", @@ -35,6 +37,7 @@ }, "devDependencies": { "@google-cloud/bigquery": "^7.0.0", + "@google-cloud/typeless-sample-bot": "^2.1.0", "@types/chai": "^4.2.16", "chai": "^4.2.0", "gts": "^5.0.0", From dd586aed9dd9bb84db13b8ad953fc9732944b41f Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Mon, 16 Sep 2024 13:49:51 -0400 Subject: [PATCH 2/5] build: use npx --- samples/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/package.json b/samples/package.json index 041b769da..9a29ba62a 100644 --- a/samples/package.json +++ b/samples/package.json @@ -19,7 +19,7 @@ "compile": "npm run tsc && npm run sampletsc", "clean": "gts clean && rm -rf build/", "precompile": "npm run clean", - "typeless": "typeless-sample-bot --outputpath . --targets . --recursive", + "typeless": "npx typeless-sample-bot --outputpath . --targets . --recursive", "posttypeless": "gts fix" }, "dependencies": { From f1f6f1636fb31c0cae47102dd908657b08c90f2a Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:17:15 -0400 Subject: [PATCH 3/5] chore: clean up old lint error --- test/pubsub.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/pubsub.ts b/test/pubsub.ts index df330f692..d4ceef18b 100644 --- a/test/pubsub.ts +++ b/test/pubsub.ts @@ -308,6 +308,7 @@ describe('PubSub', () => { const options: pubsubTypes.ClientConfig = { enableOpenTelemetryTracing: true, }; + // eslint-disable-next-line @typescript-eslint/no-unused-vars const pubsub = new PubSub(options); assert.strictEqual( tracing.isEnabled(), From e820a7a9f74ceff196009de11e260957582d3039 Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:17:37 -0400 Subject: [PATCH 4/5] build: move typeless invocation to root --- package.json | 4 +++- samples/package.json | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d6806b37f..66bd58e00 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,8 @@ "benchwrapper": "node bin/benchwrapper.js", "prelint": "cd samples; npm link ../; npm install", "precompile": "gts clean", - "typeless": "cd samples; npm run typeless" + "typeless": "npx typeless-sample-bot --outputpath samples --targets samples --recursive", + "posttypeless": "npm run fix" }, "dependencies": { "@google-cloud/paginator": "^5.0.0", @@ -64,6 +65,7 @@ "p-defer": "^3.0.0" }, "devDependencies": { + "@google-cloud/typeless-sample-bot": "^2.1.0", "@grpc/proto-loader": "^0.7.0", "@opentelemetry/core": "^1.17.0", "@opentelemetry/sdk-trace-base": "^1.17.0", diff --git a/samples/package.json b/samples/package.json index 9a29ba62a..aff99d498 100644 --- a/samples/package.json +++ b/samples/package.json @@ -18,9 +18,7 @@ "sampletsc": "cd typescript && tsc -p . && cd ..", "compile": "npm run tsc && npm run sampletsc", "clean": "gts clean && rm -rf build/", - "precompile": "npm run clean", - "typeless": "npx typeless-sample-bot --outputpath . --targets . --recursive", - "posttypeless": "gts fix" + "precompile": "npm run clean" }, "dependencies": { "@google-cloud/opentelemetry-cloud-trace-exporter": "^2.0.0", @@ -37,7 +35,6 @@ }, "devDependencies": { "@google-cloud/bigquery": "^7.0.0", - "@google-cloud/typeless-sample-bot": "^2.1.0", "@types/chai": "^4.2.16", "chai": "^4.2.0", "gts": "^5.0.0", From 030c9568d5823985eb4c9fecd69507a5dbe301f2 Mon Sep 17 00:00:00 2001 From: feywind <57276408+feywind@users.noreply.github.com> Date: Mon, 16 Sep 2024 14:23:01 -0400 Subject: [PATCH 5/5] build: also npm i on samples when running posttypeless --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 66bd58e00..c5d3dcc27 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "prelint": "cd samples; npm link ../; npm install", "precompile": "gts clean", "typeless": "npx typeless-sample-bot --outputpath samples --targets samples --recursive", - "posttypeless": "npm run fix" + "posttypeless": "cd samples; npm i; cd ..; npm run fix" }, "dependencies": { "@google-cloud/paginator": "^5.0.0",