diff --git a/gax/.jsdoc.cjs b/gax/.jsdoc.cjs deleted file mode 100644 index 3c0a8210b..000000000 --- a/gax/.jsdoc.cjs +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2019 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -'use strict'; - -module.exports = { - opts: { - readme: '../README.md', - package: './package.json', - template: './node_modules/jsdoc-fresh', - recurse: true, - verbose: true, - destination: './docs/' - }, - plugins: [ - 'plugins/markdown', - 'jsdoc-region-tag' - ], - source: { - excludePattern: '(^|\\/|\\\\)[._]', - include: [ - 'build/src', - 'build/protos' - ], - includePattern: '\\.js$' - }, - templates: { - copyright: 'Copyright 2024 Google, LLC.', - includeDate: false, - sourceFiles: false, - systemName: 'google-gax', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/gax/.jsdoc.json b/gax/.jsdoc.json new file mode 100644 index 000000000..a2c796518 --- /dev/null +++ b/gax/.jsdoc.json @@ -0,0 +1,35 @@ +{ + "opts": { + "readme": "../README.md", + "package": "./package.json", + "template": "./node_modules/jsdoc-fresh", + "recurse": true, + "verbose": true, + "destination": "./docs/" + }, + "plugins": [ + "plugins/markdown", + "jsdoc-region-tag" + ], + "source": { + "excludePattern": "(^|\\/|\\\\)[._]", + "include": [ + "build/esm/src", + "build/protos" + ], + "includePattern": "\\.js$" + }, + "templates": { + "copyright": "Copyright 2024 Google, LLC.", + "includeDate": false, + "sourceFiles": false, + "systemName": "google-gax", + "theme": "lumen", + "default": { + "outputSourceFiles": false + } + }, + "markdown": { + "idInHeadings": true + } +} diff --git a/gax/esm/test/showcase-echo-client/.babelrc b/gax/esm/test/showcase-echo-client/.babelrc new file mode 100644 index 000000000..d2253052f --- /dev/null +++ b/gax/esm/test/showcase-echo-client/.babelrc @@ -0,0 +1,19 @@ +{ + "presets": [ + "@babel/preset-typescript", + "@babel/env" + ], + "plugins": [ + [ + "replace-import-extension", + { + "extMapping": { + ".js": ".cjs" + } + } + ], + "./node_modules/gapic-tools/build/src/replaceESMMockingLib.js", + "./node_modules/gapic-tools/build/src/replaceImportMetaUrl.js", + "./node_modules/gapic-tools/build/src/toggleESMFlagVariable.js" + ] + } \ No newline at end of file diff --git a/gax/package.json b/gax/package.json index cd2cc5f4a..1d0e23698 100644 --- a/gax/package.json +++ b/gax/package.json @@ -36,12 +36,23 @@ "types": "./build/cjs/src/protobuf.d.ts", "default": "./build/cjs/src/protobuf.cjs" } + }, + "./build/src/protobuf.js": { + "import": { + "types": "./build/esm/src/protobuf.d.ts", + "default": "./build/esm/src/protobuf.js" + }, + "require": { + "types": "./build/cjs/src/protobuf.d.ts", + "default": "./build/cjs/src/protobuf.cjs" + } } }, "dependencies": { "@grpc/grpc-js": "^1.10.9", "@grpc/proto-loader": "^0.7.13", "@types/long": "^4.0.0", + "@types/duplexify": "^3.6.4", "abort-controller": "^3.0.0", "duplexify": "^4.0.0", "google-auth-library": "^9.3.0", @@ -58,7 +69,6 @@ "@babel/plugin-proposal-private-methods": "^7.18.6", "@babel/preset-env": "^7.26.0", "@babel/preset-typescript": "^7.26.0", - "@types/duplexify": "^3.6.4", "@types/mocha": "^9.0.0", "@types/ncp": "^2.0.1", "@types/node": "^20.5.0", @@ -83,7 +93,7 @@ "jsdoc": "^4.0.0", "jsdoc-fresh": "^3.0.0", "jsdoc-region-tag": "^3.0.0", - "linkinator": "^4.0.0", + "linkinator": "^6.0.0", "long": "^4.0.0", "lru-cache": "10.4.3", "mkdirp": "^2.0.0", @@ -104,7 +114,7 @@ "webpack-cli": "^4.0.0" }, "scripts": { - "docs": "jsdoc -c .jsdoc.js", + "docs": "jsdoc -c .jsdoc.json", "pretest": "npm run prepare", "test:cjs": "mocha build/cjs/test/unit", "test:esm": "mocha build/esm/test/unit --loader=esmock --enable-source-maps",