Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../node_modules/gts",
"root": true
}
6 changes: 0 additions & 6 deletions packages/gapic-node-processing/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/gapic-node-processing/.eslintrc.json

This file was deleted.

11 changes: 7 additions & 4 deletions packages/gapic-node-processing/src/combine-libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,10 @@ export async function generateFinalDirectoryPath(
const uniquefullPathAndContent = [];

for (const fullPathAndContent of fullPathsAndContents) {
if (!uniquePaths.has(fullPathAndContent.filePath)) {
uniquePaths.add(fullPathAndContent.filePath);
const normalizedPath = fullPathAndContent.filePath.replace(/\\/g, '/');
fullPathAndContent.filePath = normalizedPath;
if (!uniquePaths.has(normalizedPath)) {
uniquePaths.add(normalizedPath);
uniquefullPathAndContent.push(fullPathAndContent);
}
}
Expand Down Expand Up @@ -203,9 +205,10 @@ export function setOnlyDefaultSystemTests(

for (let i = filePaths.length - 1; i >= 0; i--) {
const filePathObj = filePaths[i];
const normalizedPath = filePathObj.filePath.replace(/\\/g, '/');
if (
systemTestRegex.test(filePathObj.filePath) &&
!filePathObj.filePath.includes(defaultVersion)
systemTestRegex.test(normalizedPath) &&
!normalizedPath.includes(defaultVersion)
) {
filePaths.splice(i, 1);
}
Expand Down
13 changes: 8 additions & 5 deletions packages/gapic-node-processing/src/generate-readme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,19 @@ export async function getSamplesMetadata(
// which we then use to remove from the absolute filePath (so
// /google-cloud-node/packages/gapic-node-processing/test/fixtures/combined-library/google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js
// becomes just google-cloud-speech/samples/generated/v1/adaptation.create_custom_class.js (the relative path to the new directory)
const stringToRemove = currentLibrary
const normalizedLibrary = currentLibrary.replace(/\\/g, '/');
const stringToRemove = normalizedLibrary
.split('/')
.slice(0, currentLibrary.split('/').length - 1)
.slice(0, normalizedLibrary.split('/').length - 1)
.join('/');

const samples = await traverseDirectory(
path.join(currentLibrary, SAMPLES_PATH),
[],
);
samples.map(sample => {
sample.filePath = sample.filePath
const normalizedSamplePath = sample.filePath.replace(/\\/g, '/');
sample.filePath = normalizedSamplePath
.replace(stringToRemove, '')
.replace('-nodejs', '');
Object.assign(sample, {title: getSampleName(sample)});
Expand All @@ -93,9 +95,10 @@ export async function getSamplesMetadata(
*/
export function getSampleName(sample: {filePath: string}): string {
// Get just the sample name from the path
let sampleName = sample.filePath;
const normalizedPath = sample.filePath.replace(/\\/g, '/');
let sampleName = normalizedPath;
try {
sampleName = sampleName.split('/')[sample.filePath.split('/').length - 1];
sampleName = sampleName.split('/')[normalizedPath.split('/').length - 1];
// Remove the API name
sampleName = sampleName.split('.')[1];
// Remove the .js
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe('combine libraries', () => {
it('should generate unique final directory paths', async () => {
const libraryPaths = await generateFinalDirectoryPath(libraryConfigCJS);
// This should be the amount of unique file paths in the tree directory
assert.deepStrictEqual(libraryPaths.length, 102);
assert.deepStrictEqual(libraryPaths.length, 100);

// Confirm there are only unique items in the array
assert.deepStrictEqual(
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 16 additions & 3 deletions packages/gapic-node-processing/test/templating.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,24 @@ describe('tests for templates', () => {
folderName: 'google-cloud-keymanagement',
});

snapshot(readFileSync(join(templateDirWrite, '.OwlBot.yaml'), 'utf8'));
snapshot(
readFileSync(join(templateDirWrite, '.repo-metadata.json'), 'utf8'),
readFileSync(join(templateDirWrite, '.OwlBot.yaml'), 'utf8').replace(
/\r\n/g,
'\n',
),
);
snapshot(
readFileSync(join(templateDirWrite, '.repo-metadata.json'), 'utf8').replace(
/\r\n/g,
'\n',
),
);
snapshot(
readFileSync(join(templateDirWrite, 'LICENSE'), 'utf8').replace(
/\r\n/g,
'\n',
),
);
snapshot(readFileSync(join(templateDirWrite, 'LICENSE'), 'utf8'));
const packageJson = JSON.parse(
readFileSync(join(templateDirWrite, 'package.json'), 'utf8'),
);
Expand Down
7 changes: 0 additions & 7 deletions packages/google-ads-admanager/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-ads-admanager/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-ads-datamanager/.eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/google-ads-datamanager/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-ai-generativelanguage/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-ai-generativelanguage/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-analytics-admin/.eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/google-analytics-admin/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-analytics-data/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-analytics-data/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-api-apikeys/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-api-apikeys/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-api-cloudquotas/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-api-cloudquotas/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-api-servicecontrol/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-api-servicecontrol/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-api-servicemanagement/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-api-servicemanagement/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-api-serviceusage/.eslintignore

This file was deleted.

3 changes: 0 additions & 3 deletions packages/google-api-serviceusage/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-appengine/.eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/google-appengine/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-apps-events-subscriptions/.eslintignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/google-apps-events-subscriptions/.eslintrc.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/google-apps-meet/.eslintignore

This file was deleted.

Loading
Loading