@jakobm/peacekeeper 0.14.1 → 0.15.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/README.md
CHANGED
|
@@ -244,6 +244,9 @@ does not grant trust automatically.
|
|
|
244
244
|
## Check project conventions locally
|
|
245
245
|
|
|
246
246
|
Run `peacekeeper check-project` to check the local project configuration.
|
|
247
|
+
All projects must declare nonblank `author` and `repository` values in
|
|
248
|
+
`package.json`. npm object forms are supported with nonblank `author.name`
|
|
249
|
+
and `repository.url` strings.
|
|
247
250
|
Run `peacekeeper check-project --explain` for the complete expected
|
|
248
251
|
architecture, requirements, configuration examples, and verification limits.
|
|
249
252
|
The command prints the bundled [formal requirements](scripts/check-project-requirements.txt),
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jakobm/peacekeeper",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Shared repository test, Git worktree, and Codex hook commands",
|
|
5
5
|
"license": "MIT",
|
|
6
|
+
"author": "Jakob Mattsson",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
8
9
|
"url": "git+https://github.com/jakobmattsson/peacekeeper.git"
|
|
@@ -39,6 +39,13 @@ Project configuration
|
|
|
39
39
|
}
|
|
40
40
|
projectChecks and both its fields are mandatory in an existing configuration.
|
|
41
41
|
|
|
42
|
+
Package metadata: all projects, including private packages
|
|
43
|
+
package.json must declare author and repository.
|
|
44
|
+
author must be a nonblank string or an object with a nonblank string name.
|
|
45
|
+
repository must be a nonblank string (including npm repository shorthand)
|
|
46
|
+
or an object with a nonblank string url. Whitespace-only values fail.
|
|
47
|
+
These checks validate presence, not repository reachability or author identity.
|
|
48
|
+
|
|
42
49
|
Toolchain: package.json and all Node-based CI jobs
|
|
43
50
|
Pin exact versions in package.json with:
|
|
44
51
|
volta pin node@<exact-version> npm@<exact-version>
|
package/scripts/check-project.js
CHANGED
|
@@ -40,6 +40,14 @@ function checkProject(cwd = process.cwd()) {
|
|
|
40
40
|
try { action(); } catch (error) { errors.push(`[${category}] ${error.message}`); }
|
|
41
41
|
finally { category = previous; }
|
|
42
42
|
};
|
|
43
|
+
check('package', () => {
|
|
44
|
+
const nonblank = value => typeof value === 'string' && value.trim().length > 0;
|
|
45
|
+
requireThat(nonblank(manifest.author) || nonblank(manifest.author?.name),
|
|
46
|
+
'package.json: author must be a nonblank string or an object with a nonblank name.');
|
|
47
|
+
requireThat(nonblank(manifest.repository) || nonblank(manifest.repository?.url),
|
|
48
|
+
'package.json: repository must be a nonblank string or an object with a nonblank url.');
|
|
49
|
+
});
|
|
50
|
+
|
|
43
51
|
const workflows = new Map();
|
|
44
52
|
check('CI', () => {
|
|
45
53
|
const directory = path.join(root, '.github/workflows');
|
|
@@ -227,7 +235,7 @@ function main() {
|
|
|
227
235
|
if (errors.length) {
|
|
228
236
|
for (const error of errors) console.error(`FAIL ${error}`);
|
|
229
237
|
process.exitCode = 1;
|
|
230
|
-
} else console.log(`Project checks passed: tools, hooks, CI${published ? ', publication' : ' (private package; publication skipped)'}.`);
|
|
238
|
+
} else console.log(`Project checks passed: package, tools, hooks, CI${published ? ', publication' : ' (private package; publication skipped)'}.`);
|
|
231
239
|
}
|
|
232
240
|
if (require.main === module) {
|
|
233
241
|
try { main(); } catch (error) { console.error(`FAIL ${error.message}`); process.exitCode = 1; }
|