Skip to content

Commit

Permalink
Merge branch 'main' into types/remove-incorrect-messages-property
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite authored Jan 18, 2025
2 parents c3449b1 + 052ed7f commit 7c2331c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
color: 7ef7ef
- name: backport
color: 88aabb
- name: backport-candidate
color: 0075ca
- name: blocked
color: fc1423
- name: bug
Expand Down
2 changes: 2 additions & 0 deletions packages/scripts/bin/sortLabels.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import('../dist/bin/sortLabels.mjs');
16 changes: 16 additions & 0 deletions packages/scripts/bin/sortLabels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { readFile, writeFile } from 'node:fs/promises';
import { parse as parseYAML, stringify as stringifyYAML } from 'yaml';

interface LabelerData {
color: string;
name: string;
}

const labelsYamlFile = new URL('../../../../.github/labels.yml', import.meta.url);

const content = await readFile(labelsYamlFile, 'utf8');

const labelsYAML = parseYAML(content) as LabelerData[];
labelsYAML.sort((a, b) => a.name.localeCompare(b.name));

await writeFile(labelsYamlFile, stringifyYAML(labelsYAML));
5 changes: 3 additions & 2 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
"description": "A set of scripts that we use for our workflows",
"private": true,
"scripts": {
"build": "tsc --noEmit --lib ESNext,DOM && tsup",
"build": "tsc --noEmit --lib ESNext,DOM && tsup",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src turbo/generators/config.ts",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src turbo/generators/config.ts",
"fmt": "pnpm run format"
},
"bin": {
"generate-split-documentation": "./bin/generateSplitDocumentation.js"
"generate-split-documentation": "./bin/generateSplitDocumentation.js",
"sort-labels": "./bin/sortLabels.js"
},
"exports": {
".": {
Expand Down
2 changes: 1 addition & 1 deletion packages/scripts/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default [
minify: 'terser',
}),
createTsupConfig({
entry: ['src/populateDevDatabaseBranch.ts'],
entry: ['src/populateDevDatabaseBranch.ts', 'bin/sortLabels.ts'],
format: 'esm',
minify: 'terser',
}),
Expand Down

0 comments on commit 7c2331c

Please sign in to comment.