Skip to content

Commit

Permalink
build: shift typeless bot invocation into library package (#1972)
Browse files Browse the repository at this point in the history
* build: shift typeless invocation into repo

* build: use npx

* chore: clean up old lint error

* build: move typeless invocation to root

* build: also npm i on samples when running posttypeless
  • Loading branch information
feywind authored Sep 16, 2024
1 parent 696dc60 commit 370fe8e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
12 changes: 9 additions & 3 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -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=[
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
"predocs-test": "npm run docs",
"benchwrapper": "node bin/benchwrapper.js",
"prelint": "cd samples; npm link ../; npm install",
"precompile": "gts clean"
"precompile": "gts clean",
"typeless": "npx typeless-sample-bot --outputpath samples --targets samples --recursive",
"posttypeless": "cd samples; npm i; cd ..; npm run fix"
},
"dependencies": {
"@google-cloud/paginator": "^5.0.0",
Expand All @@ -63,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",
Expand Down
1 change: 1 addition & 0 deletions test/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 370fe8e

Please sign in to comment.