Skip to content

Commit

Permalink
fix: Update config file to address labeller file changes (#10332)
Browse files Browse the repository at this point in the history
fix: update label script
  • Loading branch information
Jiralite committed Jun 7, 2024
1 parent 4f174c6 commit 885defb
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 23 deletions.
80 changes: 60 additions & 20 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,60 +1,100 @@
apps:guide:
- changed-files:
- any-glob-to-any-file: ['apps/guide/*', 'apps/guide/**/*']
- any-glob-to-any-file:
- apps/guide/*
- apps/guide/**/*
apps:website:
- changed-files:
- any-glob-to-any-file: ['apps/website/*', 'apps/website/**/*']
- any-glob-to-any-file:
- apps/website/*
- apps/website/**/*
packages:api-extractor:
- changed-files:
- any-glob-to-any-file: ['packages/api-extractor/*', 'packages/api-extractor/**/*']
- any-glob-to-any-file:
- packages/api-extractor/*
- packages/api-extractor/**/*
packages:api-extractor-model:
- changed-files:
- any-glob-to-any-file: ['packages/api-extractor-model/*', 'packages/api-extractor-model/**/*']
- any-glob-to-any-file:
- packages/api-extractor-model/*
- packages/api-extractor-model/**/*
packages:brokers:
- changed-files:
- any-glob-to-any-file: ['packages/brokers/*', 'packages/brokers/**/*']
- any-glob-to-any-file:
- packages/brokers/*
- packages/brokers/**/*
packages:builders:
- changed-files:
- any-glob-to-any-file: ['packages/builders/*', 'packages/builders/**/*']
- any-glob-to-any-file:
- packages/builders/*
- packages/builders/**/*
packages:collection:
- changed-files:
- any-glob-to-any-file: ['packages/collection/*', 'packages/collection/**/*']
- any-glob-to-any-file:
- packages/collection/*
- packages/collection/**/*
packages:core:
- changed-files:
- any-glob-to-any-file: ['packages/core/*', 'packages/core/**/*']
- any-glob-to-any-file:
- packages/core/*
- packages/core/**/*
packages:create-discord-bot:
- changed-files:
- any-glob-to-any-file: ['packages/create-discord-bot/*', 'packages/create-discord-bot/**/*']
- any-glob-to-any-file:
- packages/create-discord-bot/*
- packages/create-discord-bot/**/*
packages:discord.js:
- changed-files:
- any-glob-to-any-file: ['packages/discord.js/*', 'packages/discord.js/**/*']
- any-glob-to-any-file:
- packages/discord.js/*
- packages/discord.js/**/*
packages:docgen:
- changed-files:
- any-glob-to-any-file: ['packages/docgen/*', 'packages/docgen/**/*']
- any-glob-to-any-file:
- packages/docgen/*
- packages/docgen/**/*
packages:formatters:
- changed-files:
- any-glob-to-any-file: ['packages/formatters/*', 'packages/formatters/**/*']
- any-glob-to-any-file:
- packages/formatters/*
- packages/formatters/**/*
packages:next:
- changed-files:
- any-glob-to-any-file: ['packages/next/*', 'packages/next/**/*']
- any-glob-to-any-file:
- packages/next/*
- packages/next/**/*
packages:proxy:
- changed-files:
- any-glob-to-any-file: ['packages/proxy/*', 'packages/proxy/**/*']
- any-glob-to-any-file:
- packages/proxy/*
- packages/proxy/**/*
packages:proxy-container:
- changed-files:
- any-glob-to-any-file: ['packages/proxy-container/*', 'packages/proxy-container/**/*']
- any-glob-to-any-file:
- packages/proxy-container/*
- packages/proxy-container/**/*
packages:rest:
- changed-files:
- any-glob-to-any-file: ['packages/rest/*', 'packages/rest/**/*']
- any-glob-to-any-file:
- packages/rest/*
- packages/rest/**/*
packages:ui:
- changed-files:
- any-glob-to-any-file: ['packages/ui/*', 'packages/ui/**/*']
- any-glob-to-any-file:
- packages/ui/*
- packages/ui/**/*
packages:util:
- changed-files:
- any-glob-to-any-file: ['packages/util/*', 'packages/util/**/*']
- any-glob-to-any-file:
- packages/util/*
- packages/util/**/*
packages:voice:
- changed-files:
- any-glob-to-any-file: ['packages/voice/*', 'packages/voice/**/*']
- any-glob-to-any-file:
- packages/voice/*
- packages/voice/**/*
packages:ws:
- changed-files:
- any-glob-to-any-file: ['packages/ws/*', 'packages/ws/**/*']
- any-glob-to-any-file:
- packages/ws/*
- packages/ws/**/*
13 changes: 10 additions & 3 deletions packages/scripts/turbo/generators/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,17 @@ export default function generator(plop: PlopTypes.NodePlopAPI): void {
type: 'modify',
path: `${plop.getDestBasePath()}/../../.github/labeler.yml`,
transform(content, answers) {
const labelerYAML = parseYAML(content) as Record<string, string[]>;
labelerYAML[`packages:${answers.name}`] = [`packages/${answers.name}/*`, `packages/${answers.name}/**/*`];
const labelerYAML = parseYAML(content) as Record<string, Record<string, Record<string, string[]>[]>[]>;

return stringifyYAML(sortYAMLObject(labelerYAML));
labelerYAML[`packages:${answers.name}`] = [
{
'changed-files': [
{ 'any-glob-to-any-file': [`packages/${answers.name}/*`, `packages/${answers.name}/**/*`] },
],
},
];

return stringifyYAML(labelerYAML, { sortMapEntries: true });
},
},
{
Expand Down

0 comments on commit 885defb

Please sign in to comment.