@sapphire-sh/utils 3.4.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/sapphire-bootstrap.js +38 -0
- package/lib/cjs/eslint.d.ts +1 -1
- package/lib/cjs/eslintNext.d.ts +1 -1
- package/lib/eslint.d.ts +1 -1
- package/lib/eslintNext.d.ts +1 -1
- package/package.json +4 -4
|
@@ -62,6 +62,32 @@ const readWorkflowValues = () => {
|
|
|
62
62
|
return JSON.parse(readFileSync(filepath, 'utf-8'));
|
|
63
63
|
};
|
|
64
64
|
|
|
65
|
+
const codeOwnersPath = join('.github', 'CODEOWNERS');
|
|
66
|
+
|
|
67
|
+
const readCodeOwnerAssignees = () => {
|
|
68
|
+
const filepath = join(cwd, codeOwnersPath);
|
|
69
|
+
|
|
70
|
+
if (existsSync(filepath) === false) {
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let assignees = [];
|
|
75
|
+
|
|
76
|
+
for (const line of readFileSync(filepath, 'utf-8').split('\n')) {
|
|
77
|
+
const tokens = line.trim().split(/\s+/);
|
|
78
|
+
const commentIndex = tokens.findIndex((token) => token.startsWith('#'));
|
|
79
|
+
const [pattern, ...owners] = commentIndex === -1 ? tokens : tokens.slice(0, commentIndex);
|
|
80
|
+
|
|
81
|
+
if (pattern === '*') {
|
|
82
|
+
assignees = owners
|
|
83
|
+
.filter((owner) => owner.startsWith('@') && owner.includes('/') === false)
|
|
84
|
+
.map((owner) => owner.slice(1));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return assignees;
|
|
89
|
+
};
|
|
90
|
+
|
|
65
91
|
const isSelf = readPackageName() === selfPackageName;
|
|
66
92
|
const workflowValues = readWorkflowValues();
|
|
67
93
|
|
|
@@ -174,6 +200,18 @@ const writeDependabotConfig = (outputName, template) => {
|
|
|
174
200
|
);
|
|
175
201
|
}
|
|
176
202
|
|
|
203
|
+
const assignees = readCodeOwnerAssignees();
|
|
204
|
+
|
|
205
|
+
if (assignees.length > 0) {
|
|
206
|
+
const assigneeLines = assignees.map((assignee) => ` - ${formatYamlValue(assignee)}\n`).join('');
|
|
207
|
+
content = content
|
|
208
|
+
.split(/(?=^ {2}- package-ecosystem: )/m)
|
|
209
|
+
.map((entry) =>
|
|
210
|
+
entry.startsWith(' - package-ecosystem: ') === true ? `${entry} assignees:\n${assigneeLines}` : entry,
|
|
211
|
+
)
|
|
212
|
+
.join('');
|
|
213
|
+
}
|
|
214
|
+
|
|
177
215
|
mkdirSync(dirname(filepath), { recursive: true });
|
|
178
216
|
writeFileSync(filepath, content);
|
|
179
217
|
console.log(`wrote ${outputName}`);
|
package/lib/cjs/eslint.d.ts
CHANGED
package/lib/cjs/eslintNext.d.ts
CHANGED
package/lib/eslint.d.ts
CHANGED
package/lib/eslintNext.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sapphire-sh/utils",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "@sapphire-sh/utils",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -124,11 +124,11 @@
|
|
|
124
124
|
}
|
|
125
125
|
},
|
|
126
126
|
"devDependencies": {
|
|
127
|
-
"@eslint/js": "^
|
|
128
|
-
"@types/node": "^
|
|
127
|
+
"@eslint/js": "^10.0.1",
|
|
128
|
+
"@types/node": "^26.6.5",
|
|
129
129
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
130
130
|
"@vitest/coverage-v8": "^5.0.1",
|
|
131
|
-
"eslint": "^
|
|
131
|
+
"eslint": "^10.12.0",
|
|
132
132
|
"eslint-config-next": "^16.3.5",
|
|
133
133
|
"eslint-config-prettier": "^10.1.2",
|
|
134
134
|
"eslint-plugin-promise": "^7.2.1",
|