Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
1070cbb
build: move prettier config files to root from handwritten packages
feywind Apr 20, 2026
ce2d909
build: move prettier config files to root from autogen packages
feywind Apr 20, 2026
f4505a8
chore: remove blank files
feywind Apr 20, 2026
b9fe2d4
chore: more empty files
feywind Apr 20, 2026
ce4e5fc
chore: root prettier config
feywind Apr 20, 2026
05bb14c
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Apr 20, 2026
22d383d
Merge branch 'feywind-gh4581-prettier-ag' of https://github.com/googl…
gcf-owl-bot[bot] Apr 20, 2026
c170f1f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Apr 20, 2026
89a8ec7
Merge branch 'feywind-gh4581-prettier-ag' of https://github.com/googl…
gcf-owl-bot[bot] Apr 20, 2026
4cc104c
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Apr 20, 2026
fffc71c
Merge branch 'feywind-gh4581-prettier-ag' of https://github.com/googl…
gcf-owl-bot[bot] Apr 20, 2026
2aa5598
chore: use more common gts 6 for shared version
feywind Apr 21, 2026
6b4b6fc
chore: prettierignore should cover all sub-packages
feywind Apr 21, 2026
53ce831
chore: merge branch 'feywind-gh4581-prettier-ag' of https://github.co…
feywind Apr 21, 2026
4d98731
chore: fix linting problems mostly caused by owlbot
feywind Apr 21, 2026
920c7df
chore: merge remote-tracking branch 'remotes/origin/main' into feywin…
feywind Apr 21, 2026
24ee54b
chore: merge remote-tracking branch 'remotes/origin/feywind-gh4581-pr…
feywind Apr 22, 2026
13a0dfe
chore: merge remote-tracking branch 'remotes/origin/main' into feywin…
feywind Apr 28, 2026
2627382
build: drop gts to 6.x to work with node 18
feywind Apr 28, 2026
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
6 changes: 3 additions & 3 deletions packages/google-storage-control/librarian.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@
// See the License for the specific language governing permissions and
// limitations under the License.

const {execSync} = require('child_process');
const { execSync } = require('child_process');
const path = require('path');
const fs = require('fs');

const packageRoot = __dirname;
const utilDir = path.join(packageRoot, 'src', 'util');

try {
execSync('npm install', {cwd: packageRoot, stdio: 'inherit'});
execSync('npm install', { cwd: packageRoot, stdio: 'inherit' });

const tscPath = path.join(packageRoot, 'node_modules', '.bin', 'tsc');
execSync(`${tscPath} src/util/storage_control_utils.ts`, {
cwd: packageRoot,
stdio: 'inherit',
});

execSync('node storage_control_utils.js', {cwd: utilDir, stdio: 'inherit'});
execSync('node storage_control_utils.js', { cwd: utilDir, stdio: 'inherit' });

const files = fs.readdirSync(utilDir);
for (const file of files) {
Expand Down
4 changes: 2 additions & 2 deletions packages/google-storage-control/samples/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function main(bucketName) {
// const bucketName = 'abc123'

// Imports the Control library
const {StorageControlClient} = require('@google-cloud/storage-control').v2;
const { StorageControlClient } = require('@google-cloud/storage-control').v2;

// Instantiates a client
const controlClient = new StorageControlClient();
Expand All @@ -54,7 +54,7 @@ function main(bucketName) {
callGetStorageLayout();
}

process.on('unhandledRejection', err => {
process.on('unhandledRejection', (err) => {
console.error(err.message);
process.exitCode = 1;
});
Expand Down
6 changes: 3 additions & 3 deletions packages/google-storage-control/samples/test/quickstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
const assert = require('assert');
const path = require('path');
const cp = require('child_process');
const {describe, it, before} = require('mocha');
const { describe, it, before } = require('mocha');

const execSync = cmd => cp.execSync(cmd, {encoding: 'utf-8'});
const execSync = (cmd) => cp.execSync(cmd, { encoding: 'utf-8' });

const cwd = path.join(__dirname, '..');

describe('Quickstart', () => {
it('should run quickstart', async () => {
const bucketName = 'storage-control-test-monorepo';

const output = execSync(`node ./quickstart.js ${bucketName}`, {cwd});
const output = execSync(`node ./quickstart.js ${bucketName}`, { cwd });
assert.match(output, new RegExp(`Bucket ${bucketName} has location type`));
});
});
8 changes: 4 additions & 4 deletions packages/google-storage-control/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
// ** All changes to this file may be overwritten. **

import * as v2 from './v2';
import {StorageControlClient} from './storage_control_client';
import { StorageControlClient } from './storage_control_client';

export {v2, StorageControlClient};
export default {v2, StorageControlClient};
export { v2, StorageControlClient };
export default { v2, StorageControlClient };
import * as protos from '../protos/protos';
export {protos};
export { protos };
14 changes: 7 additions & 7 deletions packages/google-storage-control/src/storage_control_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
// ** This file is automatically generated **
// ** All changes to this file may be overwritten. **

import {protos} from './';
import {StorageControlClient as StorageControlInternal} from './v2/storage_control_client';
import {StorageClient} from './v2/storage_client';
import { protos } from './';
import { StorageControlClient as StorageControlInternal } from './v2/storage_control_client';
import { StorageClient } from './v2/storage_client';
import type * as gax from 'google-gax';
import {
Callback,
Expand All @@ -27,7 +27,7 @@ import {
LROperation,
Descriptors,
} from 'google-gax';
import {Transform} from 'stream';
import { Transform } from 'stream';

/**
* Options passed to the underlying client.
Expand Down Expand Up @@ -86,10 +86,10 @@ export class StorageControlClient {
batching: {},
};
warn: (code: string, message: string, warnType?: string) => void;
innerApiCalls: {[name: string]: Function};
pathTemplates: {[name: string]: gax.PathTemplate};
innerApiCalls: { [name: string]: Function };
pathTemplates: { [name: string]: gax.PathTemplate };
operationsClient: gax.OperationsClient;
storageControlStub?: Promise<{[name: string]: Function}>;
storageControlStub?: Promise<{ [name: string]: Function }>;
/**
* @param {object} [StorageControlClientOptions] - Enables user to instantiate clients separately and use those as the subclients.
* To have sub-clients with different options, instantiate each client separately.
Expand Down
22 changes: 11 additions & 11 deletions packages/google-storage-control/src/util/ast_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function getOverloadedMethod(
let promiseReturnType = '';
if (ts.isUnionTypeNode(node.type)) {
const promiseTypeNode = node.type.types.find(
t =>
(t) =>
t.kind === ts.SyntaxKind.TypeReference &&
t.getText(sourceFile).startsWith('Promise'),
);
Expand All @@ -97,7 +97,7 @@ function getOverloadedMethod(
let callbackType = '';
if (ts.isUnionTypeNode(optionsOrCallbackParam.type)) {
const callbackTypeNode = optionsOrCallbackParam.type.types.find(
t =>
(t) =>
t.kind === ts.SyntaxKind.TypeReference &&
(t.getText(sourceFile).startsWith('Callback') ||
t.getText(sourceFile).startsWith('PaginationCallback')),
Expand Down Expand Up @@ -158,7 +158,7 @@ function extract(node: ts.Node, client: string): void {
);
let docString = '';
if (commentRanges) {
commentRanges.map(r => {
commentRanges.map((r) => {
docString = docString.concat(
sourceFile!.getFullText().slice(r.pos, r.end),
);
Expand All @@ -175,7 +175,7 @@ function extract(node: ts.Node, client: string): void {
}
}
}
ts.forEachChild(node, childNode => {
ts.forEachChild(node, (childNode) => {
extract(childNode, client);
});
}
Expand All @@ -190,7 +190,7 @@ function extract(node: ts.Node, client: string): void {
* @returns {string} The generated source code for the methods.
*/
function ast(file: string, client: string): [string, string][] {
const program = ts.createProgram([file], {allowJs: true});
const program = ts.createProgram([file], { allowJs: true });
sourceFile = program.getSourceFile(file)!;
if (!sourceFile) {
throw new Error(`Could not find source file: ${file}`);
Expand All @@ -200,7 +200,7 @@ function ast(file: string, client: string): [string, string][] {
extract(sourceFile, client);
program.getTypeChecker();

return foundNodes.map(f => {
return foundNodes.map((f) => {
let output = '';
const [name, node] = f;
const escapedName = getEscapedText(name);
Expand All @@ -216,7 +216,7 @@ function ast(file: string, client: string): [string, string][] {
}

const isStatic = node.modifiers?.some(
m => m.kind === ts.SyntaxKind.StaticKeyword,
(m) => m.kind === ts.SyntaxKind.StaticKeyword,
);
if (!isExcludedFunction) {
const docString = methodDocstrings.get(functionName);
Expand Down Expand Up @@ -293,7 +293,7 @@ function ast(file: string, client: string): [string, string][] {
`;
} else {
const hasRequestArg = node.parameters.some(
p => getEscapedText(p.name) === 'request',
(p) => getEscapedText(p.name) === 'request',
);

// If there's no 'request' parameter, it's a simple helper method.
Expand Down Expand Up @@ -356,7 +356,7 @@ export function astHelper(files: string[], clients: string[]) {
}
}
let output = '';
functions.forEach(source => {
functions.forEach((source) => {
output += source;
});
return output;
Expand All @@ -379,7 +379,7 @@ export function parseClientName(client: string) {
* @returns {Map<string, string>} A map of public property names to their full text.
*/
export function getPropertyDeclarations(file: string): Map<string, string> {
const program = ts.createProgram([file], {allowJs: true});
const program = ts.createProgram([file], { allowJs: true });
const sourceFile = program.getSourceFile(file)!;
if (!sourceFile) {
throw new Error(`Could not find source file: ${file}`);
Expand All @@ -389,7 +389,7 @@ export function getPropertyDeclarations(file: string): Map<string, string> {
function visit(node: ts.Node) {
if (ts.isPropertyDeclaration(node)) {
const isPrivate = node.modifiers?.some(
m => m.kind === ts.SyntaxKind.PrivateKeyword,
(m) => m.kind === ts.SyntaxKind.PrivateKeyword,
);
if (!isPrivate) {
const propertyName = getEscapedText(node.name);
Expand Down
4 changes: 2 additions & 2 deletions packages/google-storage-control/src/util/proto_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ export function cleanObjectReferences(
filePaths: string[],
replacements: Replacement[],
): void {
filePaths.forEach(filePath => {
filePaths.forEach((filePath) => {
const fullPath = path.join(__dirname, '..', '..', filePath);
if (fs.existsSync(fullPath)) {
replacements.forEach(({pattern, replacement}) => {
replacements.forEach(({ pattern, replacement }) => {
try {
const data = fs.readFileSync(fullPath, 'utf8');
const result = data.replace(pattern, replacement);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import {
filesToUpdate,
replacements,
} from './proto_utils';
import {buildOutput} from './uber_client_builder';
import {fixIndexFile, fixV2Index} from './index_fix_utils';
import {updateSamples, fixDocsHeaders} from './samples_and_doc_fix_utils';
import { buildOutput } from './uber_client_builder';
import { fixIndexFile, fixV2Index } from './index_fix_utils';
import { updateSamples, fixDocsHeaders } from './samples_and_doc_fix_utils';

async function main() {
fixIndexFile('src/index.ts');
Expand All @@ -29,9 +29,9 @@ async function main() {
updateSamples();
fixDocsHeaders();
const finaloutput = await buildOutput();
fs.writeFile('../storage_control_client.ts', finaloutput, err => {
fs.writeFile('../storage_control_client.ts', finaloutput, (err) => {
if (err) throw err;
});
}

main().catch(err => console.error(err));
main().catch((err) => console.error(err));
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
// limitations under the License.

import * as prettier from 'prettier';
import {astHelper, parseClientName, getPropertyDeclarations} from './ast_utils';
import {
astHelper,
parseClientName,
getPropertyDeclarations,
} from './ast_utils';

export const CLIENTS = ['StorageControlInternal', 'StorageClient'];
export const FILES = [
Expand Down Expand Up @@ -170,7 +174,7 @@ function buildClientConstructor(clients: string[]) {
});
constructorInitializers = constructorInitializers.concat('\t}');
let output = 'export class StorageControlClient{\n';
properties.forEach(property => {
properties.forEach((property) => {
variableDecl = variableDecl.concat(property);
});
output = output.concat(
Expand Down
4 changes: 2 additions & 2 deletions packages/google-storage-control/src/v2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

export {StorageControlClient} from './storage_control_client';
export { StorageControlClient } from './storage_control_client';

export {StorageClient} from './storage_client';
export { StorageClient } from './storage_client';
Loading