@nan0web/release 1.0.3 → 3.1.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 +42 -17
- package/bin/nan0release.js +3 -39
- package/knip.json +21 -0
- package/nan0web.nan0 +16 -0
- package/package.json +14 -14
- package/src/README.md.js +19 -21
- package/src/Release/Person.js +1 -1
- package/src/agents/inspectors/git-reviewer.md +35 -0
- package/src/agents/inspectors/package-hygiene.md +63 -0
- package/src/agents/workflows/commit.md +28 -0
- package/src/agents/workflows/npm-release.md +40 -0
- package/src/agents/workflows/release.md +205 -0
- package/src/agents/workflows/zero-tolerance-git.md +21 -0
- package/src/domain/App.js +33 -0
- package/src/domain/CheckCommand.js +193 -0
- package/src/domain/CloseCommand.js +68 -0
- package/src/domain/DepsCommand.js +104 -0
- package/src/domain/InitCommand.js +57 -0
- package/src/domain/PublishCommand.js +89 -0
- package/src/domain/SpecCommand.js +43 -0
- package/src/domain/StatusCommand.js +25 -0
- package/src/index.js +9 -0
- package/types/Release/Person.d.ts +3 -3
- package/types/Team.d.ts +3 -3
- package/types/commands/CheckCommand.d.ts +24 -0
- package/types/commands/CloseCommand.d.ts +2 -1
- package/types/commands/Command.d.ts +6 -1
- package/types/commands/DepsCommand.d.ts +2 -1
- package/types/commands/InitCommand.d.ts +2 -1
- package/types/commands/PublishCommand.d.ts +2 -1
- package/types/commands/SpecCommand.d.ts +2 -1
- package/types/domain/App.d.ts +16 -0
- package/types/domain/CheckCommand.d.ts +24 -0
- package/types/domain/CloseCommand.d.ts +17 -0
- package/types/domain/DepsCommand.d.ts +22 -0
- package/types/domain/InitCommand.d.ts +18 -0
- package/types/domain/PublishCommand.d.ts +27 -0
- package/types/domain/SpecCommand.d.ts +17 -0
- package/types/domain/StatusCommand.d.ts +7 -0
- package/types/index.d.ts +8 -0
- package/types/ui/cli/index.d.ts +1 -0
- package/types/utils/runSpawn.d.ts +1 -0
- package/src/Team.js +0 -35
- package/src/cli/index.js +0 -9
- package/src/co/AppCommandOptions.js +0 -25
- package/src/commands/CloseCommand.js +0 -67
- package/src/commands/Command.js +0 -48
- package/src/commands/DepsCommand.js +0 -143
- package/src/commands/InitCommand.js +0 -57
- package/src/commands/PublishCommand.js +0 -105
- package/src/commands/SpecCommand.js +0 -41
- package/src/commands/StatusCommand.js +0 -26
- package/src/db/ReleaseDB.js +0 -54
- package/src/ui/cli/ReleaseCLi.js +0 -52
- package/src/ui/cli/index.js +0 -0
- package/src/utils/runSpawn.js +0 -0
package/README.md
CHANGED
|
@@ -6,29 +6,36 @@ Project management as code, Git-native, GPG-signed, and test-driven.
|
|
|
6
6
|
|
|
7
7
|
Unlike traditional project tools that require constant syncing or manual updates,
|
|
8
8
|
`@nan0web/release` enforces project structure where:
|
|
9
|
+
|
|
9
10
|
- Tasks are represented as tests in `.test.js` files.
|
|
10
11
|
- Status is tracked via test outcomes.
|
|
11
12
|
- Team roles and approvals are stored in structured files.
|
|
12
13
|
- All changes are signed, versioned, and composable.
|
|
13
14
|
|
|
15
|
+
|
|
14
16
|
This ensures:
|
|
17
|
+
|
|
15
18
|
- Clear, automatable project tracking.
|
|
16
19
|
- Immutable release notes and retro reflections.
|
|
17
20
|
- Zero ambiguity – tasks don't exist unless tested.
|
|
18
21
|
|
|
22
|
+
|
|
19
23
|
## Installation
|
|
20
24
|
|
|
21
25
|
How to install with pnpm?
|
|
26
|
+
|
|
22
27
|
```bash
|
|
23
28
|
pnpm add @nan0web/release
|
|
24
29
|
```
|
|
25
30
|
|
|
26
31
|
How to install with npm?
|
|
32
|
+
|
|
27
33
|
```bash
|
|
28
34
|
npm install @nan0web/release
|
|
29
35
|
```
|
|
30
36
|
|
|
31
37
|
How to install with yarn?
|
|
38
|
+
|
|
32
39
|
```bash
|
|
33
40
|
yarn add @nan0web/release
|
|
34
41
|
```
|
|
@@ -38,14 +45,15 @@ yarn add @nan0web/release
|
|
|
38
45
|
Start by initializing a new release:
|
|
39
46
|
|
|
40
47
|
How to initialize a new release version?
|
|
48
|
+
|
|
41
49
|
```bash
|
|
42
|
-
|
|
50
|
+
nan0release init v1.0.0
|
|
43
51
|
```
|
|
44
52
|
|
|
45
|
-
const cli = ReleaseCLi()
|
|
46
53
|
Show release details:
|
|
47
54
|
|
|
48
55
|
How to show release information?
|
|
56
|
+
|
|
49
57
|
```bash
|
|
50
58
|
release show [--full]
|
|
51
59
|
```
|
|
@@ -58,66 +66,66 @@ console.info(release.version) // v1.0.0
|
|
|
58
66
|
List all releases in the project:
|
|
59
67
|
|
|
60
68
|
How to list all releases?
|
|
69
|
+
|
|
61
70
|
```bash
|
|
62
|
-
|
|
71
|
+
nan0release list [--json]
|
|
63
72
|
```
|
|
64
73
|
|
|
65
|
-
const cli = ReleaseCLi()
|
|
66
74
|
Add a chat message to the current release:
|
|
67
75
|
|
|
68
76
|
How to write a release chat message?
|
|
77
|
+
|
|
69
78
|
```bash
|
|
70
|
-
|
|
79
|
+
nan0release chat write --user alice "Issue with the build pipeline"
|
|
71
80
|
```
|
|
72
81
|
|
|
73
|
-
const cli = ReleaseCLi()
|
|
74
82
|
Host a static server for viewing releases:
|
|
75
83
|
|
|
76
84
|
How to host release UI?
|
|
85
|
+
|
|
77
86
|
```bash
|
|
78
|
-
|
|
87
|
+
nan0release host [--webui] [--port 3000]
|
|
79
88
|
```
|
|
80
89
|
|
|
81
|
-
const cli = ReleaseCLi()
|
|
82
90
|
Serve all release files for local inspection:
|
|
83
91
|
|
|
84
92
|
How to serve release static assets?
|
|
93
|
+
|
|
85
94
|
```bash
|
|
86
|
-
|
|
95
|
+
nan0release serve [--port 8080]
|
|
87
96
|
```
|
|
88
97
|
|
|
89
|
-
const cli = ReleaseCLi()
|
|
90
98
|
Validate release tasks and integrity:
|
|
91
99
|
|
|
92
100
|
How to validate release tasks?
|
|
101
|
+
|
|
93
102
|
```bash
|
|
94
|
-
|
|
103
|
+
nan0release validate [--ignore-fail]
|
|
95
104
|
```
|
|
96
105
|
|
|
97
|
-
const release = new Release({
|
|
98
|
-
version: 'v1.0.0',
|
|
99
|
-
createdAt: new Date('2025-08-20'),
|
|
100
|
-
})
|
|
101
106
|
Seal the release with retro reflection:
|
|
102
107
|
|
|
103
108
|
How to seal a release?
|
|
109
|
+
|
|
104
110
|
```bash
|
|
105
|
-
|
|
111
|
+
nan0release seal [--message "All core APIs are stable and tested"]
|
|
106
112
|
```
|
|
107
113
|
|
|
108
|
-
const cli = ReleaseCLi()
|
|
109
114
|
## Core Concepts
|
|
110
115
|
|
|
111
116
|
### 1. Release as Object
|
|
112
117
|
|
|
113
118
|
A `Release` is a structured class containing:
|
|
119
|
+
|
|
114
120
|
- `version`: release identifier (vX.Y.Z).
|
|
115
121
|
- `createdAt`, `startAt`, `planAt`, `completeAt`: datetime milestones.
|
|
116
122
|
- `document`: parsed markdown document with structure-aware parsing.
|
|
117
123
|
|
|
124
|
+
|
|
118
125
|
Each property is typed and validated automatically via JSDoc and runtime parsing.
|
|
119
126
|
|
|
120
127
|
How to instantiate a Release?
|
|
128
|
+
|
|
121
129
|
```js
|
|
122
130
|
import { Release } from '@nan0web/release'
|
|
123
131
|
const release = new Release({
|
|
@@ -130,11 +138,14 @@ console.info(release.createdAt instanceof Date) // ← true
|
|
|
130
138
|
### 2. Release Document Parsing
|
|
131
139
|
|
|
132
140
|
A `ReleaseDocument` extends `@nan0web/markdown` with:
|
|
141
|
+
|
|
133
142
|
- Structured parsing of markdown release notes
|
|
134
143
|
- Extraction of sections and tasks
|
|
135
144
|
- Team and role parsing from markdown frontmatter or code
|
|
136
145
|
|
|
146
|
+
|
|
137
147
|
How to parse release notes markdown into structured data?
|
|
148
|
+
|
|
138
149
|
```js
|
|
139
150
|
import { ReleaseDocument } from '@nan0web/release'
|
|
140
151
|
const md = `# v1.0.0 - 2025-08-20
|
|
@@ -151,11 +162,14 @@ console.info(doc.document.children instanceof Array) // ← true
|
|
|
151
162
|
### 3. Person & Team Structures
|
|
152
163
|
|
|
153
164
|
A `Person` instance includes:
|
|
165
|
+
|
|
154
166
|
- `name`: HumanName
|
|
155
167
|
- `gender`: HumanGender
|
|
156
168
|
- `contacts`: array of HumanContact
|
|
157
169
|
|
|
170
|
+
|
|
158
171
|
How to create a Person with typed properties?
|
|
172
|
+
|
|
159
173
|
```js
|
|
160
174
|
import { Person } from '@nan0web/release'
|
|
161
175
|
const person = new Person({
|
|
@@ -176,6 +190,7 @@ Tasks are registered as `taskId` → `testFilePath` in `ProjectManagement`.
|
|
|
176
190
|
Their status is derived by running `node:test` suites.
|
|
177
191
|
|
|
178
192
|
How to register and validate tasks as tests?
|
|
193
|
+
|
|
179
194
|
```js
|
|
180
195
|
import { ProjectManagement } from '@nan0web/release'
|
|
181
196
|
const pm = new ProjectManagement()
|
|
@@ -195,11 +210,14 @@ console.info(results.pending.includes('task-2')) // ← true
|
|
|
195
210
|
|
|
196
211
|
The `ReleaseManager` coordinates releases and validates readiness.
|
|
197
212
|
It ensures:
|
|
213
|
+
|
|
198
214
|
- All registered tests pass
|
|
199
215
|
- Version is correctly incremented
|
|
200
216
|
- Git tag is applied if all validations succeed
|
|
201
217
|
|
|
218
|
+
|
|
202
219
|
How to execute a release after validation?
|
|
220
|
+
|
|
203
221
|
```js
|
|
204
222
|
import { ReleaseManager, ProjectManagement } from '@nan0web/release'
|
|
205
223
|
const pm = new ProjectManagement()
|
|
@@ -213,11 +231,14 @@ console.info(result.published) // ← true
|
|
|
213
231
|
### Changelog Integration
|
|
214
232
|
|
|
215
233
|
Using `ChangelogTaskManager`, you can:
|
|
234
|
+
|
|
216
235
|
- Extract task definitions from changelog entries
|
|
217
236
|
- Generate corresponding test files
|
|
218
237
|
- Automate task progression in CI
|
|
219
238
|
|
|
239
|
+
|
|
220
240
|
How to parse changelog and extract tasks?
|
|
241
|
+
|
|
221
242
|
```js
|
|
222
243
|
import { ChangelogTaskManager } from '@nan0web/release'
|
|
223
244
|
const ctm = new ChangelogTaskManager()
|
|
@@ -239,6 +260,7 @@ Uses JSDoc and .d.ts files for autocompletion
|
|
|
239
260
|
Try the package in the terminal:
|
|
240
261
|
|
|
241
262
|
How to run playground demo?
|
|
263
|
+
|
|
242
264
|
```bash
|
|
243
265
|
git clone https://github.com/nan0web/release.git
|
|
244
266
|
cd release
|
|
@@ -251,6 +273,7 @@ pnpm run playground
|
|
|
251
273
|
To verify the project is ready, run:
|
|
252
274
|
|
|
253
275
|
How to check project status before publishing?
|
|
276
|
+
|
|
254
277
|
```bash
|
|
255
278
|
npm test
|
|
256
279
|
npm run test:coverage
|
|
@@ -264,3 +287,5 @@ How to contribute? - [check here](./CONTRIBUTING.md)
|
|
|
264
287
|
## License
|
|
265
288
|
|
|
266
289
|
How to license ISC? - [check here](./LICENSE)
|
|
290
|
+
|
|
291
|
+
|
package/bin/nan0release.js
CHANGED
|
@@ -1,42 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { bootstrapApp } from '@nan0web/ui-cli'
|
|
4
|
+
import { App } from '../src/domain/App.js'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
import Logger from '@nan0web/log'
|
|
7
|
-
|
|
8
|
-
import createReleaseCLI from '../src/ui/cli/ReleaseCLi.js'
|
|
9
|
-
|
|
10
|
-
class OutputLogger extends Logger {
|
|
11
|
-
log(first, ...args) {
|
|
12
|
-
if (first && first instanceof OutputMessage) {
|
|
13
|
-
if (OutputMessage.TYPES.ERROR === first.type) {
|
|
14
|
-
return this.error(first.content, ...args)
|
|
15
|
-
} else if (OutputMessage.TYPES.WARNING === first.type) {
|
|
16
|
-
return this.warn(first.content, ...args)
|
|
17
|
-
} else if (OutputMessage.TYPES.SUCCESS === first.type) {
|
|
18
|
-
return this.success(first.content, ...args)
|
|
19
|
-
}
|
|
20
|
-
return this.info(first.content, ...args)
|
|
21
|
-
}
|
|
22
|
-
return super.log(first, ...args)
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const logger = new OutputLogger(Logger.detectLevel(process.argv))
|
|
27
|
-
|
|
28
|
-
async function main(argv = []) {
|
|
29
|
-
const cli = createReleaseCLI(argv, logger)
|
|
30
|
-
logger.info(Logger.style(Logger.LOGO, { color: Logger.MAGENTA }))
|
|
31
|
-
|
|
32
|
-
const stream = cli.run()
|
|
33
|
-
for await (const entry of stream) {
|
|
34
|
-
logger.info(entry)
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
main(process.argv.slice(2)).catch((err) => {
|
|
39
|
-
logger.error('❌ Unhandled error:', err.message || err)
|
|
40
|
-
if (err.stack) logger.debug(err.stack)
|
|
41
|
-
process.exit(1)
|
|
42
|
-
})
|
|
6
|
+
bootstrapApp(App)
|
package/knip.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/knip@5/schema.json",
|
|
3
|
+
"entry": [
|
|
4
|
+
"src/index.js",
|
|
5
|
+
"bin/nan0release.js",
|
|
6
|
+
"src/README.md.js"
|
|
7
|
+
],
|
|
8
|
+
"project": ["src/**/*.js", "bin/*.js"],
|
|
9
|
+
"ignoreDependencies": [
|
|
10
|
+
"@nan0web/log",
|
|
11
|
+
"@nan0web/ui",
|
|
12
|
+
"@nan0web/ui-cli",
|
|
13
|
+
"@nan0web/logos",
|
|
14
|
+
"@nan0web/markdown",
|
|
15
|
+
"@nan0web/db",
|
|
16
|
+
"@nan0web/db-fs",
|
|
17
|
+
"@nan0web/types",
|
|
18
|
+
"@nan0web/co",
|
|
19
|
+
"@nan0web/changelog"
|
|
20
|
+
]
|
|
21
|
+
}
|
package/nan0web.nan0
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
name: "@nan0web/release"
|
|
2
|
+
agents:
|
|
3
|
+
- id: 'release-manager'
|
|
4
|
+
description: 'Release & NPM Publication Manager'
|
|
5
|
+
workflows:
|
|
6
|
+
- 'src/agents/workflows/release.md'
|
|
7
|
+
- 'src/agents/workflows/npm-release.md'
|
|
8
|
+
inspectors:
|
|
9
|
+
- 'src/agents/inspectors/package-hygiene.md'
|
|
10
|
+
- id: 'git-reviewer'
|
|
11
|
+
description: 'Architectural Git Commit Validator'
|
|
12
|
+
workflows:
|
|
13
|
+
- 'src/agents/workflows/commit.md'
|
|
14
|
+
- 'src/agents/workflows/zero-tolerance-git.md'
|
|
15
|
+
inspectors:
|
|
16
|
+
- 'src/agents/inspectors/git-reviewer.md'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nan0web/release",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Project Management as Code, Git-Native, GPG-Signed, Test-Driven",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -10,22 +10,22 @@
|
|
|
10
10
|
"release": "./bin/nan0release.js"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@nan0web/
|
|
14
|
-
"@nan0web/co": "
|
|
15
|
-
"@nan0web/
|
|
16
|
-
"@nan0web/db-fs": "
|
|
17
|
-
"@nan0web/
|
|
18
|
-
"@nan0web/
|
|
19
|
-
"@nan0web/
|
|
20
|
-
"@nan0web/ui": "
|
|
21
|
-
"@nan0web/
|
|
22
|
-
"@nan0web/
|
|
23
|
-
"supports-color": "^10.2.2"
|
|
13
|
+
"@nan0web/log": "3.1.0",
|
|
14
|
+
"@nan0web/co": "3.1.0",
|
|
15
|
+
"@nan0web/markdown": "3.1.0",
|
|
16
|
+
"@nan0web/db-fs": "3.1.0",
|
|
17
|
+
"@nan0web/types": "3.1.0",
|
|
18
|
+
"@nan0web/changelog": "3.1.0",
|
|
19
|
+
"@nan0web/db": "3.1.0",
|
|
20
|
+
"@nan0web/ui": "3.1.0",
|
|
21
|
+
"@nan0web/logos": "3.1.0",
|
|
22
|
+
"@nan0web/ui-cli": "3.1.0"
|
|
24
23
|
},
|
|
25
24
|
"devDependencies": {
|
|
26
|
-
"@
|
|
25
|
+
"@types/node": "^25.6.0",
|
|
27
26
|
"husky": "^9.1.7",
|
|
28
|
-
"knip": "^5.86.0"
|
|
27
|
+
"knip": "^5.86.0",
|
|
28
|
+
"@nan0web/test": "3.1.0"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "tsc",
|
package/src/README.md.js
CHANGED
|
@@ -4,7 +4,7 @@ import { readFile } from 'node:fs/promises'
|
|
|
4
4
|
import FS from '@nan0web/db-fs'
|
|
5
5
|
import { NoConsole } from '@nan0web/log'
|
|
6
6
|
import { DatasetParser, DocsParser, runSpawn } from '@nan0web/test'
|
|
7
|
-
import
|
|
7
|
+
import { App } from './index.js'
|
|
8
8
|
import Release from './Release.js'
|
|
9
9
|
import ReleaseDocument from './Release/Document.js'
|
|
10
10
|
import Person from './Release/Person.js'
|
|
@@ -100,11 +100,10 @@ function testRender() {
|
|
|
100
100
|
it('How to initialize a new release version?', () => {
|
|
101
101
|
/**
|
|
102
102
|
* ```bash
|
|
103
|
-
*
|
|
103
|
+
* nan0release init v1.0.0
|
|
104
104
|
* ```
|
|
105
105
|
*/
|
|
106
|
-
|
|
107
|
-
assert.ok(cli.logger)
|
|
106
|
+
assert.ok(new App().constructor.command.options)
|
|
108
107
|
})
|
|
109
108
|
|
|
110
109
|
/**
|
|
@@ -132,11 +131,10 @@ function testRender() {
|
|
|
132
131
|
it('How to list all releases?', () => {
|
|
133
132
|
/**
|
|
134
133
|
* ```bash
|
|
135
|
-
*
|
|
134
|
+
* nan0release list [--json]
|
|
136
135
|
* ```
|
|
137
136
|
*/
|
|
138
|
-
|
|
139
|
-
assert.ok(cli.logger)
|
|
137
|
+
assert.ok(new App().constructor.command.options)
|
|
140
138
|
})
|
|
141
139
|
|
|
142
140
|
/**
|
|
@@ -146,11 +144,10 @@ function testRender() {
|
|
|
146
144
|
it('How to write a release chat message?', () => {
|
|
147
145
|
/**
|
|
148
146
|
* ```bash
|
|
149
|
-
*
|
|
147
|
+
* nan0release chat write --user alice "Issue with the build pipeline"
|
|
150
148
|
* ```
|
|
151
149
|
*/
|
|
152
|
-
|
|
153
|
-
assert.ok(cli.logger)
|
|
150
|
+
assert.ok(new App().constructor.command.options)
|
|
154
151
|
})
|
|
155
152
|
|
|
156
153
|
/**
|
|
@@ -160,11 +157,10 @@ function testRender() {
|
|
|
160
157
|
it('How to host release UI?', () => {
|
|
161
158
|
/**
|
|
162
159
|
* ```bash
|
|
163
|
-
*
|
|
160
|
+
* nan0release host [--webui] [--port 3000]
|
|
164
161
|
* ```
|
|
165
162
|
*/
|
|
166
|
-
|
|
167
|
-
assert.ok(cli.logger)
|
|
163
|
+
assert.ok(new App().constructor.command.options)
|
|
168
164
|
})
|
|
169
165
|
|
|
170
166
|
/**
|
|
@@ -174,11 +170,10 @@ function testRender() {
|
|
|
174
170
|
it('How to serve release static assets?', () => {
|
|
175
171
|
/**
|
|
176
172
|
* ```bash
|
|
177
|
-
*
|
|
173
|
+
* nan0release serve [--port 8080]
|
|
178
174
|
* ```
|
|
179
175
|
*/
|
|
180
|
-
|
|
181
|
-
assert.ok(cli.logger)
|
|
176
|
+
assert.ok(new App().constructor.command.options)
|
|
182
177
|
})
|
|
183
178
|
|
|
184
179
|
/**
|
|
@@ -188,9 +183,10 @@ function testRender() {
|
|
|
188
183
|
it('How to validate release tasks?', () => {
|
|
189
184
|
/**
|
|
190
185
|
* ```bash
|
|
191
|
-
*
|
|
186
|
+
* nan0release validate [--ignore-fail]
|
|
192
187
|
* ```
|
|
193
188
|
*/
|
|
189
|
+
assert.ok(true)
|
|
194
190
|
const release = new Release({
|
|
195
191
|
version: 'v1.0.0',
|
|
196
192
|
createdAt: new Date('2025-08-20'),
|
|
@@ -205,11 +201,10 @@ function testRender() {
|
|
|
205
201
|
it('How to seal a release?', () => {
|
|
206
202
|
/**
|
|
207
203
|
* ```bash
|
|
208
|
-
*
|
|
204
|
+
* nan0release seal [--message "All core APIs are stable and tested"]
|
|
209
205
|
* ```
|
|
210
206
|
*/
|
|
211
|
-
|
|
212
|
-
assert.ok(cli.logger)
|
|
207
|
+
assert.ok(new App().constructor.command.options)
|
|
213
208
|
})
|
|
214
209
|
|
|
215
210
|
/**
|
|
@@ -404,7 +399,10 @@ Release milestone includes UI polish and core API stabilization.
|
|
|
404
399
|
assert.ok(pkg.scripts?.playground)
|
|
405
400
|
const response = await runSpawn('git', ['remote', 'get-url', 'origin'])
|
|
406
401
|
assert.ok(response.code === 0)
|
|
407
|
-
assert.ok(
|
|
402
|
+
assert.ok(
|
|
403
|
+
response.text.trim().endsWith('nan0web/monorepo.git') ||
|
|
404
|
+
response.text.trim().endsWith('nan0web/release.git'),
|
|
405
|
+
)
|
|
408
406
|
})
|
|
409
407
|
|
|
410
408
|
/**
|
package/src/Release/Person.js
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Architectural Git Commit & Diff Validator Subagent
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 🐙 Git Reviewer
|
|
6
|
+
|
|
7
|
+
**INPUTS REQUIRED:**
|
|
8
|
+
|
|
9
|
+
- `[PROJECT_MD]` (The 5-phase architectural spec, e.g. project.md from root)
|
|
10
|
+
- `[DIFF]` (The git diff patch output `git diff --cached`)
|
|
11
|
+
|
|
12
|
+
**SYSTEM PROMPT (Agnostic AI API Persona):**
|
|
13
|
+
You are an isolated, Agnostic Zero-Hallucination Git Reviewer. You do not code. You do not converse. You compare the semantic integrity of the `[DIFF]` against the core architecture.
|
|
14
|
+
|
|
15
|
+
You must evaluate the snippet rigorously based on structural integrity and specific rules provided.
|
|
16
|
+
There is no ambiguity: any deviation from the preset `[PROJECT_MD]` libraries or patterns must be strictly caught.
|
|
17
|
+
To reject a `[DIFF]`, provide the specific file name, the line number of code, and the specific phase of `[PROJECT_MD]` that it contradicts.
|
|
18
|
+
|
|
19
|
+
**OBJECTIVE:**
|
|
20
|
+
Ensure the developer is not sneaking in "hotfixes" that break structural agreements ("Zero-Trust Git Review").
|
|
21
|
+
|
|
22
|
+
- Locate any deviations from predefined libraries or patterns.
|
|
23
|
+
- Locate undocumented mutations in the `data/` or `ui/` layer.
|
|
24
|
+
- Ensure only required files are staged.
|
|
25
|
+
|
|
26
|
+
**STRICT OUTPUT CONTRACT:**
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"score": 85,
|
|
31
|
+
"errors": [
|
|
32
|
+
"File 'src/index.js' introduces direct 'node:fs' usage instead of '@nan0web/db-fs', contradicting Phase 2 of project.md."
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
```
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Гігієна пакету — обовʼязкові скрипти, конвеєр test:all, knip, .npmignore
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 🧹 Гігієна Пакету (Package Hygiene)
|
|
6
|
+
|
|
7
|
+
## 1. Обов'язкові скрипти у кожному пакеті
|
|
8
|
+
|
|
9
|
+
- `"knip": "knip --production"` — перевірка невикористаних файлів, експортів та залежностей.
|
|
10
|
+
- `"audit": "pnpm audit --prod || true"` — інформативна перевірка вразливостей. `|| true` бо `pnpm audit` monorepo-wide — вразливості сусідніх пакетів не повинні блокувати реліз.
|
|
11
|
+
- `"release:spec": "node --test \"releases/**/*.spec.js\""` — контрактні тести відкритого релізу.
|
|
12
|
+
- `"test:release": "node --test \"src/test/releases/**/*.test.js\""` — регресійні тести закритих релізів.
|
|
13
|
+
|
|
14
|
+
## 2. Повний конвеєр (`test:all`)
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
test → test:docs → build → test:release → knip → audit
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- Всі кроки через `&&` — мають бути зеленими.
|
|
21
|
+
|
|
22
|
+
## 3. Knip Конфігурація (`knip.json`)
|
|
23
|
+
|
|
24
|
+
- `entry`: головний `src/index.js`.
|
|
25
|
+
- `ignore`: `play/`, `releases/`, `types/`, `src/README.md.js`.
|
|
26
|
+
- `ignoreDependencies`: dev-інструменти (`husky`, `@nan0web/test`, тощо).
|
|
27
|
+
|
|
28
|
+
## 4. `.npmignore` (ОБОВ'ЯЗКОВО у кожному пакеті)
|
|
29
|
+
|
|
30
|
+
Без `.npmignore` npm використовує `.gitignore`, що пропускає dev-артефакти в публікацію.
|
|
31
|
+
Мінімальний шаблон:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
# Tests
|
|
35
|
+
src/**/*.test.js
|
|
36
|
+
src/test/
|
|
37
|
+
types/test/
|
|
38
|
+
|
|
39
|
+
# ProvenDoc generator
|
|
40
|
+
src/README.md.js
|
|
41
|
+
|
|
42
|
+
# Dev files
|
|
43
|
+
play/
|
|
44
|
+
releases/
|
|
45
|
+
docs/
|
|
46
|
+
knip.json
|
|
47
|
+
system.md
|
|
48
|
+
next.md
|
|
49
|
+
tsconfig.json
|
|
50
|
+
.editorconfig
|
|
51
|
+
CONTRIBUTING.md
|
|
52
|
+
|
|
53
|
+
# LLiMo / AI artifacts
|
|
54
|
+
chat/
|
|
55
|
+
.datasets/
|
|
56
|
+
me.md
|
|
57
|
+
|
|
58
|
+
# Generated
|
|
59
|
+
dist/
|
|
60
|
+
.cache/
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Перевірка**: `npm pack --dry-run` перед кожним `npm publish`.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Safe Commit Workflow (No Auto-Run)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Safe Commit Procedure
|
|
6
|
+
|
|
7
|
+
1. **Check Status**:
|
|
8
|
+
- Run `git status` to see what is staged/modified.
|
|
9
|
+
- Run `git diff --stat` to see the scope of changes.
|
|
10
|
+
|
|
11
|
+
2. **Verify Integrity**:
|
|
12
|
+
- IF (and only if) tests exist, run them: `npm run test:all`.
|
|
13
|
+
- Ensure the build passes: `npm run build` (if applicable, must be included in test:all).
|
|
14
|
+
|
|
15
|
+
3. **Formulate Message**:
|
|
16
|
+
- Create a concise, semantic commit message (e.g., `fix: ...`, `feat: ...`).
|
|
17
|
+
- Describe WHAT changed and WHY.
|
|
18
|
+
|
|
19
|
+
4. **PROPOSE Command**:
|
|
20
|
+
- **DO NOT RUN THE COMMIT COMMAND.**
|
|
21
|
+
- Output the suggested command string:
|
|
22
|
+
```bash
|
|
23
|
+
git add . && git commit -m "Your proposed message"
|
|
24
|
+
```
|
|
25
|
+
- Ask the user: "Shall I execute this?"
|
|
26
|
+
|
|
27
|
+
5. **Execute (On User Approval)**:
|
|
28
|
+
- Only after receiving explicit "Yes" or "Do it", run the command.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: /release — Публікація пакету в NPM (Smart Test & Build & Publish)
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
// turbo-all
|
|
6
|
+
|
|
7
|
+
До релізую НЕ МАЮТЬ потрапляти так файли:
|
|
8
|
+
|
|
9
|
+
- .agent/
|
|
10
|
+
- .vscode/
|
|
11
|
+
- docs/
|
|
12
|
+
- src/**/*.test.js{x}
|
|
13
|
+
- src/test/
|
|
14
|
+
- src/README.md.js{x}
|
|
15
|
+
|
|
16
|
+
Мають потрапляти:
|
|
17
|
+
|
|
18
|
+
- package.json
|
|
19
|
+
- LICENSE
|
|
20
|
+
- README.md
|
|
21
|
+
- bin/
|
|
22
|
+
- src/
|
|
23
|
+
- types/
|
|
24
|
+
|
|
25
|
+
1. **Повна перевірка (Safety First)**: Запусти локальну перевірку пакету.
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm test:all
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
2. **Публікація в NPM**: Виконай стандартний скрипт релізу.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm run release
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
3. **Верифікація статусів**: Перевір статус пакетів у монорепо.
|
|
38
|
+
```bash
|
|
39
|
+
npm run test:status
|
|
40
|
+
```
|