Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove extra protos & capture ESM in headers appropriately #1658

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,16 @@ export class AssetServiceClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -182,11 +185,6 @@ export class AssetServiceClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
2 changes: 1 addition & 1 deletion baselines/asset-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"compile:esm": "tsc -p ./tsconfig.esm.json && cp -r esm/src/json-helper.cjs build/esm/src/json-helper.cjs",
"babel": "babel esm --out-dir build/cjs --ignore \"esm/**/*.d.ts\" --extensions \".ts\" --out-file-extension .cjs --copy-files",
"compile:cjs": "tsc -p ./tsconfig.json && npm run babel",
"compile": "npm run compile:esm && npm run compile:cjs && cp -r protos build/protos",
"compile": "npm run compile:esm && npm run compile:cjs && rm -rf build/protos && cp -r protos build/protos",
"samples-test": "cd samples/ && npm link ../ && npm i && npm test"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,16 @@ export class BigQueryStorageClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -183,11 +186,6 @@ export class BigQueryStorageClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
2 changes: 1 addition & 1 deletion baselines/bigquery-storage-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"compile:esm": "tsc -p ./tsconfig.esm.json && cp -r esm/src/json-helper.cjs build/esm/src/json-helper.cjs",
"babel": "babel esm --out-dir build/cjs --ignore \"esm/**/*.d.ts\" --extensions \".ts\" --out-file-extension .cjs --copy-files",
"compile:cjs": "tsc -p ./tsconfig.json && npm run babel",
"compile": "npm run compile:esm && npm run compile:cjs && cp -r protos build/protos",
"compile": "npm run compile:esm && npm run compile:cjs && rm -rf build/protos && cp -r protos build/protos",
"samples-test": "cd samples/ && npm link ../ && npm i && npm test"
},
"dependencies": {
Expand Down
10 changes: 4 additions & 6 deletions baselines/compute-esm/esm/src/v1/addresses_client.ts.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,16 @@ export class AddressesClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -186,11 +189,6 @@ export class AddressesClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,16 @@ export class RegionOperationsClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -183,11 +186,6 @@ export class RegionOperationsClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
2 changes: 1 addition & 1 deletion baselines/compute-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"compile:esm": "tsc -p ./tsconfig.esm.json && cp -r esm/src/json-helper.cjs build/esm/src/json-helper.cjs",
"babel": "babel esm --out-dir build/cjs --ignore \"esm/**/*.d.ts\" --extensions \".ts\" --out-file-extension .cjs --copy-files",
"compile:cjs": "tsc -p ./tsconfig.json && npm run babel",
"compile": "npm run compile:esm && npm run compile:cjs && cp -r protos build/protos",
"compile": "npm run compile:esm && npm run compile:cjs && rm -rf build/protos && cp -r protos build/protos",
"samples-test": "cd samples/ && npm link ../ && npm i && npm test"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,16 @@ export class DeprecatedServiceClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -182,11 +185,6 @@ export class DeprecatedServiceClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
2 changes: 1 addition & 1 deletion baselines/deprecatedtest-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"compile:esm": "tsc -p ./tsconfig.esm.json && cp -r esm/src/json-helper.cjs build/esm/src/json-helper.cjs",
"babel": "babel esm --out-dir build/cjs --ignore \"esm/**/*.d.ts\" --extensions \".ts\" --out-file-extension .cjs --copy-files",
"compile:cjs": "tsc -p ./tsconfig.json && npm run babel",
"compile": "npm run compile:esm && npm run compile:cjs && cp -r protos build/protos",
"compile": "npm run compile:esm && npm run compile:cjs && rm -rf build/protos && cp -r protos build/protos",
"samples-test": "cd samples/ && npm link ../ && npm i && npm test"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,16 @@ export class ComplianceClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -183,11 +186,6 @@ export class ComplianceClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,16 @@ export class EchoClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -188,11 +191,6 @@ export class EchoClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,16 @@ export class IdentityClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -181,11 +184,6 @@ export class IdentityClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,16 @@ export class MessagingClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -185,11 +188,6 @@ export class MessagingClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,16 @@ export class SequenceServiceClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -180,11 +183,6 @@ export class SequenceServiceClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,13 +164,16 @@ export class TestingClient {
this.auth.defaultScopes = staticMembers.scopes;
}

// Add ESM headers
const isEsm = true;
const isEsmString = isEsm ? '-esm' : '-cjs';
// Determine the client header string.
const clientHeader = [
`gax/${this._gaxModule.version}`,
`gapic/${version}`,
];
if (typeof process === 'object' && 'versions' in process) {
clientHeader.push(`gl-node/${process.versions.node}`);
clientHeader.push(`gl-node/{process.versions.node}${isEsmString}`);
} else {
clientHeader.push(`gl-web/${this._gaxModule.version}`);
}
Expand All @@ -182,11 +185,6 @@ export class TestingClient {
if (opts.libName && opts.libVersion) {
clientHeader.push(`${opts.libName}/${opts.libVersion}`);
}
// Add ESM headers
const isEsm = true;
if ((opts.libVersion || version) && isEsm) {
clientHeader.push(`${opts.libVersion ?? version}-esm`);
}

// Load the applicable protos.
this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos as gax.protobuf.INamespace);
Expand Down
2 changes: 1 addition & 1 deletion baselines/disable-packing-test-esm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"compile:esm": "tsc -p ./tsconfig.esm.json && cp -r esm/src/json-helper.cjs build/esm/src/json-helper.cjs",
"babel": "babel esm --out-dir build/cjs --ignore \"esm/**/*.d.ts\" --extensions \".ts\" --out-file-extension .cjs --copy-files",
"compile:cjs": "tsc -p ./tsconfig.json && npm run babel",
"compile": "npm run compile:esm && npm run compile:cjs && cp -r protos build/protos",
"compile": "npm run compile:esm && npm run compile:cjs && rm -rf build/protos && cp -r protos build/protos",
"samples-test": "cd samples/ && npm link ../ && npm i && npm test"
},
"dependencies": {
Expand Down
Loading
Loading