@nan0web/release 3.3.0 → 3.5.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 +0 -35
- package/bin/nan0release.js +33 -2
- package/bin/serve.js +73 -0
- package/package.json +46 -17
- package/src/Release/Document.js +1 -0
- package/src/Release/Scanner.js +3 -2
- package/src/Release.js +7 -7
- package/src/domain/App.js +33 -2
- package/src/domain/BumpCommand.js +10 -3
- package/src/domain/CheckCommand.js +504 -146
- package/src/domain/CheckCommand.story.js +92 -0
- package/src/domain/CloseCommand.js +13 -9
- package/src/domain/Dashboard/Dashboard.story.js +155 -0
- package/src/domain/Dashboard/DashboardModel.js +308 -0
- package/src/domain/Dashboard/ReleaseDiscovery.js +132 -0
- package/src/domain/Dashboard/ReleaseParser.js +226 -0
- package/src/domain/Dashboard/index.js +19 -0
- package/src/domain/DepsCommand.js +5 -2
- package/src/domain/InitCommand.js +18 -16
- package/src/domain/ListCommand.js +45 -0
- package/src/domain/PMaCParser.js +418 -0
- package/src/domain/PMaCParser.story.js +152 -0
- package/src/domain/PreviewCommand.js +39 -0
- package/src/domain/PublishCommand.js +7 -3
- package/src/domain/Registry/Registry.story.js +82 -0
- package/src/domain/Registry/RegistryModel.js +124 -0
- package/src/domain/ServeCommand.js +165 -0
- package/src/domain/ServeCommand.story.js +88 -0
- package/src/domain/SpecCommand.js +3 -1
- package/src/domain/StatusCommand.js +249 -3
- package/src/domain/ValidateCommand.js +426 -0
- package/src/domain/ValidateCommand.story.js +92 -0
- package/src/domain/ViewCommand.js +99 -0
- package/src/domain/WebCommand.js +140 -0
- package/src/domain/inspect/ReleaseAuditor.js +508 -0
- package/src/domain/inspect/ReleaseAuditor.story.js +136 -0
- package/src/domain/models/ReleaseIssueModel.js +27 -0
- package/src/domain/models/ReleaseMemberModel.js +21 -0
- package/src/domain/models/ReleaseModel.js +191 -0
- package/src/domain/models/ReleaseParityModel.js +27 -0
- package/src/domain/models/ReleaseTaskModel.js +33 -0
- package/src/domain/models/index.js +6 -0
- package/src/domain/templates/release.html +34 -0
- package/src/domain/templates/release.html.template.js +34 -0
- package/src/index.js +15 -0
- package/src/inspectors/inspect-js.js +32 -0
- package/src/releases/1/0/v1.0.3/task.test.js +1 -1
- package/src/utils/nodejs/GitTelemetry.js +154 -0
- package/types/Release/Document.d.ts +24 -27
- package/types/Release/MarkdownToTest.d.ts +1 -1
- package/types/Release/Person.d.ts +9 -7
- package/types/Release/Scanner.d.ts +41 -41
- package/types/Release.d.ts +42 -42
- package/types/architecture/ProjectManagementAsCode.d.ts +59 -64
- package/types/domain/App.d.ts +25 -7
- package/types/domain/BumpCommand.d.ts +11 -6
- package/types/domain/CheckCommand.d.ts +128 -16
- package/types/domain/CheckCommand.story.d.ts +1 -0
- package/types/domain/CloseCommand.d.ts +4 -6
- package/types/domain/Dashboard/Dashboard.story.d.ts +1 -0
- package/types/domain/Dashboard/DashboardModel.d.ts +273 -0
- package/types/domain/Dashboard/GitTelemetry.d.ts +23 -0
- package/types/domain/Dashboard/ReleaseDiscovery.d.ts +47 -0
- package/types/domain/Dashboard/ReleaseParser.d.ts +79 -0
- package/types/domain/Dashboard/index.d.ts +3 -0
- package/types/domain/DepsCommand.d.ts +6 -6
- package/types/domain/InitCommand.d.ts +4 -6
- package/types/domain/ListCommand.d.ts +18 -0
- package/types/domain/PMaCParser.d.ts +64 -0
- package/types/domain/PMaCParser.story.d.ts +1 -0
- package/types/domain/PreviewCommand.d.ts +6 -0
- package/types/domain/PublishCommand.d.ts +8 -6
- package/types/domain/Registry/Registry.story.d.ts +1 -0
- package/types/domain/Registry/RegistryModel.d.ts +61 -0
- package/types/domain/ServeCommand.d.ts +59 -0
- package/types/domain/ServeCommand.story.d.ts +1 -0
- package/types/domain/SpecCommand.d.ts +4 -6
- package/types/domain/StatusCommand.d.ts +38 -3
- package/types/domain/ValidateCommand.d.ts +69 -0
- package/types/domain/ValidateCommand.story.d.ts +1 -0
- package/types/domain/ViewCommand.d.ts +27 -0
- package/types/domain/WebCommand.d.ts +47 -0
- package/types/domain/inspect/ReleaseAuditor.d.ts +134 -0
- package/types/domain/inspect/ReleaseAuditor.story.d.ts +1 -0
- package/types/domain/models/ReleaseIssueModel.d.ts +35 -0
- package/types/domain/models/ReleaseMemberModel.d.ts +25 -0
- package/types/domain/models/ReleaseModel.d.ts +122 -0
- package/types/domain/models/ReleaseParityModel.d.ts +37 -0
- package/types/domain/models/ReleaseTaskModel.d.ts +46 -0
- package/types/domain/models/index.d.ts +5 -0
- package/types/domain/templates/release.html.template.d.ts +2 -0
- package/types/index.d.ts +21 -10
- package/types/inspectors/inspect-js.d.ts +2 -0
- package/types/utils/nodejs/GitTelemetry.d.ts +23 -0
package/README.md
CHANGED
|
@@ -6,36 +6,29 @@ 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
|
-
|
|
10
9
|
- Tasks are represented as tests in `.test.js` files.
|
|
11
10
|
- Status is tracked via test outcomes.
|
|
12
11
|
- Team roles and approvals are stored in structured files.
|
|
13
12
|
- All changes are signed, versioned, and composable.
|
|
14
13
|
|
|
15
|
-
|
|
16
14
|
This ensures:
|
|
17
|
-
|
|
18
15
|
- Clear, automatable project tracking.
|
|
19
16
|
- Immutable release notes and retro reflections.
|
|
20
17
|
- Zero ambiguity – tasks don't exist unless tested.
|
|
21
18
|
|
|
22
|
-
|
|
23
19
|
## Installation
|
|
24
20
|
|
|
25
21
|
How to install with pnpm?
|
|
26
|
-
|
|
27
22
|
```bash
|
|
28
23
|
pnpm add @nan0web/release
|
|
29
24
|
```
|
|
30
25
|
|
|
31
26
|
How to install with npm?
|
|
32
|
-
|
|
33
27
|
```bash
|
|
34
28
|
npm install @nan0web/release
|
|
35
29
|
```
|
|
36
30
|
|
|
37
31
|
How to install with yarn?
|
|
38
|
-
|
|
39
32
|
```bash
|
|
40
33
|
yarn add @nan0web/release
|
|
41
34
|
```
|
|
@@ -45,7 +38,6 @@ yarn add @nan0web/release
|
|
|
45
38
|
Start by initializing a new release:
|
|
46
39
|
|
|
47
40
|
How to initialize a new release version?
|
|
48
|
-
|
|
49
41
|
```bash
|
|
50
42
|
nan0release init v1.0.0
|
|
51
43
|
```
|
|
@@ -53,7 +45,6 @@ nan0release init v1.0.0
|
|
|
53
45
|
Show release details:
|
|
54
46
|
|
|
55
47
|
How to show release information?
|
|
56
|
-
|
|
57
48
|
```bash
|
|
58
49
|
release show [--full]
|
|
59
50
|
```
|
|
@@ -66,7 +57,6 @@ console.info(release.version) // v1.0.0
|
|
|
66
57
|
List all releases in the project:
|
|
67
58
|
|
|
68
59
|
How to list all releases?
|
|
69
|
-
|
|
70
60
|
```bash
|
|
71
61
|
nan0release list [--json]
|
|
72
62
|
```
|
|
@@ -74,7 +64,6 @@ nan0release list [--json]
|
|
|
74
64
|
Add a chat message to the current release:
|
|
75
65
|
|
|
76
66
|
How to write a release chat message?
|
|
77
|
-
|
|
78
67
|
```bash
|
|
79
68
|
nan0release chat write --user alice "Issue with the build pipeline"
|
|
80
69
|
```
|
|
@@ -82,7 +71,6 @@ nan0release chat write --user alice "Issue with the build pipeline"
|
|
|
82
71
|
Host a static server for viewing releases:
|
|
83
72
|
|
|
84
73
|
How to host release UI?
|
|
85
|
-
|
|
86
74
|
```bash
|
|
87
75
|
nan0release host [--webui] [--port 3000]
|
|
88
76
|
```
|
|
@@ -90,7 +78,6 @@ nan0release host [--webui] [--port 3000]
|
|
|
90
78
|
Serve all release files for local inspection:
|
|
91
79
|
|
|
92
80
|
How to serve release static assets?
|
|
93
|
-
|
|
94
81
|
```bash
|
|
95
82
|
nan0release serve [--port 8080]
|
|
96
83
|
```
|
|
@@ -98,7 +85,6 @@ nan0release serve [--port 8080]
|
|
|
98
85
|
Validate release tasks and integrity:
|
|
99
86
|
|
|
100
87
|
How to validate release tasks?
|
|
101
|
-
|
|
102
88
|
```bash
|
|
103
89
|
nan0release validate [--ignore-fail]
|
|
104
90
|
```
|
|
@@ -106,7 +92,6 @@ nan0release validate [--ignore-fail]
|
|
|
106
92
|
Seal the release with retro reflection:
|
|
107
93
|
|
|
108
94
|
How to seal a release?
|
|
109
|
-
|
|
110
95
|
```bash
|
|
111
96
|
nan0release seal [--message "All core APIs are stable and tested"]
|
|
112
97
|
```
|
|
@@ -116,16 +101,13 @@ nan0release seal [--message "All core APIs are stable and tested"]
|
|
|
116
101
|
### 1. Release as Object
|
|
117
102
|
|
|
118
103
|
A `Release` is a structured class containing:
|
|
119
|
-
|
|
120
104
|
- `version`: release identifier (vX.Y.Z).
|
|
121
105
|
- `createdAt`, `startAt`, `planAt`, `completeAt`: datetime milestones.
|
|
122
106
|
- `document`: parsed markdown document with structure-aware parsing.
|
|
123
107
|
|
|
124
|
-
|
|
125
108
|
Each property is typed and validated automatically via JSDoc and runtime parsing.
|
|
126
109
|
|
|
127
110
|
How to instantiate a Release?
|
|
128
|
-
|
|
129
111
|
```js
|
|
130
112
|
import { Release } from '@nan0web/release'
|
|
131
113
|
const release = new Release({
|
|
@@ -138,14 +120,11 @@ console.info(release.createdAt instanceof Date) // ← true
|
|
|
138
120
|
### 2. Release Document Parsing
|
|
139
121
|
|
|
140
122
|
A `ReleaseDocument` extends `@nan0web/markdown` with:
|
|
141
|
-
|
|
142
123
|
- Structured parsing of markdown release notes
|
|
143
124
|
- Extraction of sections and tasks
|
|
144
125
|
- Team and role parsing from markdown frontmatter or code
|
|
145
126
|
|
|
146
|
-
|
|
147
127
|
How to parse release notes markdown into structured data?
|
|
148
|
-
|
|
149
128
|
```js
|
|
150
129
|
import { ReleaseDocument } from '@nan0web/release'
|
|
151
130
|
const md = `# v1.0.0 - 2025-08-20
|
|
@@ -162,14 +141,11 @@ console.info(doc.document.children instanceof Array) // ← true
|
|
|
162
141
|
### 3. Person & Team Structures
|
|
163
142
|
|
|
164
143
|
A `Person` instance includes:
|
|
165
|
-
|
|
166
144
|
- `name`: HumanName
|
|
167
145
|
- `gender`: HumanGender
|
|
168
146
|
- `contacts`: array of HumanContact
|
|
169
147
|
|
|
170
|
-
|
|
171
148
|
How to create a Person with typed properties?
|
|
172
|
-
|
|
173
149
|
```js
|
|
174
150
|
import { Person } from '@nan0web/release'
|
|
175
151
|
const person = new Person({
|
|
@@ -190,7 +166,6 @@ Tasks are registered as `taskId` → `testFilePath` in `ProjectManagement`.
|
|
|
190
166
|
Their status is derived by running `node:test` suites.
|
|
191
167
|
|
|
192
168
|
How to register and validate tasks as tests?
|
|
193
|
-
|
|
194
169
|
```js
|
|
195
170
|
import { ProjectManagement } from '@nan0web/release'
|
|
196
171
|
const pm = new ProjectManagement()
|
|
@@ -210,14 +185,11 @@ console.info(results.pending.includes('task-2')) // ← true
|
|
|
210
185
|
|
|
211
186
|
The `ReleaseManager` coordinates releases and validates readiness.
|
|
212
187
|
It ensures:
|
|
213
|
-
|
|
214
188
|
- All registered tests pass
|
|
215
189
|
- Version is correctly incremented
|
|
216
190
|
- Git tag is applied if all validations succeed
|
|
217
191
|
|
|
218
|
-
|
|
219
192
|
How to execute a release after validation?
|
|
220
|
-
|
|
221
193
|
```js
|
|
222
194
|
import { ReleaseManager, ProjectManagement } from '@nan0web/release'
|
|
223
195
|
const pm = new ProjectManagement()
|
|
@@ -231,14 +203,11 @@ console.info(result.published) // ← true
|
|
|
231
203
|
### Changelog Integration
|
|
232
204
|
|
|
233
205
|
Using `ChangelogTaskManager`, you can:
|
|
234
|
-
|
|
235
206
|
- Extract task definitions from changelog entries
|
|
236
207
|
- Generate corresponding test files
|
|
237
208
|
- Automate task progression in CI
|
|
238
209
|
|
|
239
|
-
|
|
240
210
|
How to parse changelog and extract tasks?
|
|
241
|
-
|
|
242
211
|
```js
|
|
243
212
|
import { ChangelogTaskManager } from '@nan0web/release'
|
|
244
213
|
const ctm = new ChangelogTaskManager()
|
|
@@ -260,7 +229,6 @@ Uses JSDoc and .d.ts files for autocompletion
|
|
|
260
229
|
Try the package in the terminal:
|
|
261
230
|
|
|
262
231
|
How to run playground demo?
|
|
263
|
-
|
|
264
232
|
```bash
|
|
265
233
|
git clone https://github.com/nan0web/release.git
|
|
266
234
|
cd release
|
|
@@ -273,7 +241,6 @@ pnpm run playground
|
|
|
273
241
|
To verify the project is ready, run:
|
|
274
242
|
|
|
275
243
|
How to check project status before publishing?
|
|
276
|
-
|
|
277
244
|
```bash
|
|
278
245
|
npm test
|
|
279
246
|
npm run test:coverage
|
|
@@ -287,5 +254,3 @@ How to contribute? - [check here](./CONTRIBUTING.md)
|
|
|
287
254
|
## License
|
|
288
255
|
|
|
289
256
|
How to license ISC? - [check here](./LICENSE)
|
|
290
|
-
|
|
291
|
-
|
package/bin/nan0release.js
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
import { resolve, dirname } from 'node:path'
|
|
3
4
|
import { bootstrapApp } from '@nan0web/ui-cli'
|
|
5
|
+
import DBFS from '@nan0web/db-fs'
|
|
4
6
|
import { ReleaseApp } from '../src/domain/App.js'
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
function findMonorepoRoot(startDir) {
|
|
9
|
+
let dir = resolve(startDir)
|
|
10
|
+
const markers = ['pnpm-workspace.yaml', 'releases.txt']
|
|
11
|
+
for (let i = 0; i < 10; i++) {
|
|
12
|
+
for (const marker of markers) {
|
|
13
|
+
if (existsSync(resolve(dir, marker))) {
|
|
14
|
+
return dir
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const parent = dirname(dir)
|
|
18
|
+
if (parent === dir) break
|
|
19
|
+
dir = parent
|
|
20
|
+
}
|
|
21
|
+
return startDir
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const startCwd = process.env.INIT_CWD || process.cwd()
|
|
25
|
+
process.env.RELEASE_CWD = startCwd
|
|
26
|
+
const root = findMonorepoRoot(startCwd)
|
|
27
|
+
if (process.cwd() !== root && existsSync(resolve(root, 'releases.txt'))) {
|
|
28
|
+
process.chdir(root)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const db = new DBFS({ root: '.' })
|
|
32
|
+
await db.connect()
|
|
33
|
+
|
|
34
|
+
bootstrapApp(ReleaseApp, { db, root: '.' }).catch((err) => {
|
|
35
|
+
console.error(err)
|
|
36
|
+
process.exit(1)
|
|
37
|
+
})
|
package/bin/serve.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync } from 'node:fs'
|
|
3
|
+
import { resolve, dirname } from 'node:path'
|
|
4
|
+
import { bootstrapApp } from '@nan0web/ui-cli'
|
|
5
|
+
import DBFS from '@nan0web/db-fs'
|
|
6
|
+
import { ServeCommand } from '../src/domain/ServeCommand.js'
|
|
7
|
+
|
|
8
|
+
function findMonorepoRoot(startDir) {
|
|
9
|
+
let dir = resolve(startDir)
|
|
10
|
+
const markers = ['pnpm-workspace.yaml', 'releases.txt']
|
|
11
|
+
for (let i = 0; i < 10; i++) {
|
|
12
|
+
for (const marker of markers) {
|
|
13
|
+
if (existsSync(resolve(dir, marker))) {
|
|
14
|
+
return dir
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const parent = dirname(dir)
|
|
18
|
+
if (parent === dir) break
|
|
19
|
+
dir = parent
|
|
20
|
+
}
|
|
21
|
+
return startDir
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const startCwd = process.env.INIT_CWD || process.cwd()
|
|
25
|
+
process.env.RELEASE_CWD = startCwd
|
|
26
|
+
const root = findMonorepoRoot(startCwd)
|
|
27
|
+
if (process.cwd() !== root && existsSync(resolve(root, 'releases.txt'))) {
|
|
28
|
+
process.chdir(root)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const db = new DBFS()
|
|
32
|
+
await db.connect()
|
|
33
|
+
|
|
34
|
+
const res = await bootstrapApp(ServeCommand, { db, noExit: true }).catch((err) => {
|
|
35
|
+
console.error(err)
|
|
36
|
+
process.exit(1)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const resultIntent = res?.data || {}
|
|
40
|
+
const data = resultIntent?.data || resultIntent || {}
|
|
41
|
+
if (data.success && data.html) {
|
|
42
|
+
try {
|
|
43
|
+
const { createServer } = await import('node:http')
|
|
44
|
+
const port = data.port || 3131
|
|
45
|
+
const server = createServer((req, resHttp) => {
|
|
46
|
+
resHttp.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' })
|
|
47
|
+
resHttp.end(data.html)
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
server.listen(port, () => {
|
|
51
|
+
if (data.open) {
|
|
52
|
+
import('node:child_process')
|
|
53
|
+
.then(({ exec }) => exec(`open http://localhost:${port}`))
|
|
54
|
+
.catch(() => {})
|
|
55
|
+
}
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
const stopServer = () => {
|
|
59
|
+
server.close(() => {
|
|
60
|
+
process.exit(0)
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
process.on('SIGINT', stopServer)
|
|
65
|
+
process.on('SIGTERM', stopServer)
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.error(`Failed to start HTTP server: ${err.message}`)
|
|
68
|
+
process.exit(1)
|
|
69
|
+
}
|
|
70
|
+
} else if (data.success === false) {
|
|
71
|
+
process.exit(1)
|
|
72
|
+
}
|
|
73
|
+
|
package/package.json
CHANGED
|
@@ -1,31 +1,59 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nan0web/release",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.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",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"bin": {
|
|
9
9
|
"nan0release": "./bin/nan0release.js",
|
|
10
|
-
"release": "./bin/nan0release.js"
|
|
10
|
+
"release": "./bin/nan0release.js",
|
|
11
|
+
"serve": "./bin/serve.js"
|
|
12
|
+
},
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"import": "./src/index.js",
|
|
16
|
+
"types": "./types/index.d.ts"
|
|
17
|
+
},
|
|
18
|
+
"./domain/inspect/ReleaseAuditor": {
|
|
19
|
+
"import": "./src/domain/inspect/ReleaseAuditor.js",
|
|
20
|
+
"types": "./types/domain/inspect/ReleaseAuditor.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./domain/CheckCommand": {
|
|
23
|
+
"import": "./src/domain/CheckCommand.js",
|
|
24
|
+
"types": "./types/domain/CheckCommand.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./domain/StatusCommand": {
|
|
27
|
+
"import": "./src/domain/StatusCommand.js",
|
|
28
|
+
"types": "./types/domain/StatusCommand.d.ts"
|
|
29
|
+
},
|
|
30
|
+
"./domain/App": {
|
|
31
|
+
"import": "./src/domain/App.js",
|
|
32
|
+
"types": "./types/domain/App.d.ts"
|
|
33
|
+
},
|
|
34
|
+
"./domain/*": {
|
|
35
|
+
"import": "./src/domain/*.js"
|
|
36
|
+
}
|
|
11
37
|
},
|
|
12
38
|
"dependencies": {
|
|
13
|
-
"@nan0web/
|
|
14
|
-
"@nan0web/
|
|
15
|
-
"@nan0web/
|
|
16
|
-
"@nan0web/
|
|
17
|
-
"@nan0web/
|
|
18
|
-
"@nan0web/
|
|
19
|
-
"@nan0web/
|
|
20
|
-
"@nan0web/logos": "3.
|
|
21
|
-
"@nan0web/
|
|
22
|
-
"@nan0web/ui
|
|
39
|
+
"@nan0web/changelog": "3.4.0",
|
|
40
|
+
"@nan0web/csv0": "3.6.0",
|
|
41
|
+
"@nan0web/co": "3.5.0",
|
|
42
|
+
"@nan0web/db-fs": "3.6.0",
|
|
43
|
+
"@nan0web/db": "3.5.0",
|
|
44
|
+
"@nan0web/inspect": "3.7.0",
|
|
45
|
+
"@nan0web/log": "3.4.0",
|
|
46
|
+
"@nan0web/logos": "3.4.0",
|
|
47
|
+
"@nan0web/markdown": "3.4.0",
|
|
48
|
+
"@nan0web/ui": "3.5.0",
|
|
49
|
+
"@nan0web/types": "3.4.0",
|
|
50
|
+
"@nan0web/ui-cli": "3.5.0"
|
|
23
51
|
},
|
|
24
52
|
"devDependencies": {
|
|
25
53
|
"@types/node": "^25.6.0",
|
|
26
54
|
"husky": "^9.1.7",
|
|
27
|
-
"knip": "^5.
|
|
28
|
-
"@nan0web/test": "3.
|
|
55
|
+
"knip": "^5.88.1",
|
|
56
|
+
"@nan0web/test": "3.4.0"
|
|
29
57
|
},
|
|
30
58
|
"files": [
|
|
31
59
|
"bin",
|
|
@@ -39,11 +67,12 @@
|
|
|
39
67
|
"build": "tsc",
|
|
40
68
|
"clean": "rm -rf .cache/ && rm -rf dist/",
|
|
41
69
|
"clean:modules": "rm -rf node_modules",
|
|
42
|
-
"test": "node --test \"src/**/*.test.js\"",
|
|
43
|
-
"
|
|
70
|
+
"test": "node --test \"src/**/*.{test,story}.js\"",
|
|
71
|
+
"test:stories": "node --test \"src/**/*.story.js\"",
|
|
72
|
+
"test1": "node --test \"src/**/*.{test,story}.js\" | nan0test parse --fail",
|
|
44
73
|
"test:docs": "node --test \"src/README.md.js\"",
|
|
45
74
|
"test:release": "node --test \"releases/**/*.test.js\"",
|
|
46
|
-
"test:coverage": "node --experimental-test-coverage --test-coverage-include=\"src/**/*.js\" --test-coverage-exclude=\"src/**/*.test.js\" --test \"src/**/*.test.js\"",
|
|
75
|
+
"test:coverage": "node --experimental-test-coverage --test-coverage-include=\"src/**/*.js\" --test-coverage-exclude=\"src/**/*.{test,story}.js\" --test \"src/**/*.{test,story}.js\"",
|
|
47
76
|
"test:coverage:collect": "nan0test coverage",
|
|
48
77
|
"test:status": "nan0test status",
|
|
49
78
|
"test:all": "npm run test && npm run test:docs && npm run build && npm run knip",
|
package/src/Release/Document.js
CHANGED
package/src/Release/Scanner.js
CHANGED
|
@@ -27,10 +27,11 @@ export default class Scanner {
|
|
|
27
27
|
root
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
* @param {string} root - Root directory of the project
|
|
30
|
+
* @param {string} [root] - Root directory of the project
|
|
31
31
|
*/
|
|
32
32
|
constructor(root) {
|
|
33
|
-
|
|
33
|
+
const targetRoot = root || process.env.INIT_CWD || process.cwd()
|
|
34
|
+
this.root = resolve(targetRoot)
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
/**
|
package/src/Release.js
CHANGED
|
@@ -18,21 +18,21 @@ import Logger from '@nan0web/log'
|
|
|
18
18
|
*/
|
|
19
19
|
export default class Release {
|
|
20
20
|
/** @type {string} */
|
|
21
|
-
version
|
|
21
|
+
version = '0.0.0'
|
|
22
22
|
/** @type {Date} */
|
|
23
|
-
createdAt
|
|
23
|
+
createdAt = new Date()
|
|
24
24
|
/** @type {Date?} */
|
|
25
|
-
startAt
|
|
25
|
+
startAt = null
|
|
26
26
|
/** @type {Date?} */
|
|
27
|
-
planAt
|
|
27
|
+
planAt = null
|
|
28
28
|
/** @type {Date?} */
|
|
29
|
-
completeAt
|
|
29
|
+
completeAt = null
|
|
30
30
|
/** @type {Map<string, Function>} */
|
|
31
|
-
tasks
|
|
31
|
+
tasks = new Map()
|
|
32
32
|
/** @type {ReleaseDocument} */
|
|
33
33
|
document
|
|
34
34
|
/** @type {Logger} */
|
|
35
|
-
logger
|
|
35
|
+
logger = new Logger()
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Creates a Release instance
|
package/src/domain/App.js
CHANGED
|
@@ -7,22 +7,40 @@ import PublishCommand from './PublishCommand.js'
|
|
|
7
7
|
import SpecCommand from './SpecCommand.js'
|
|
8
8
|
import StatusCommand from './StatusCommand.js'
|
|
9
9
|
import BumpCommand from './BumpCommand.js'
|
|
10
|
+
import WebCommand from './WebCommand.js'
|
|
11
|
+
import PreviewCommand from './PreviewCommand.js'
|
|
12
|
+
import ViewCommand from './ViewCommand.js'
|
|
13
|
+
import ListCommand from './ListCommand.js'
|
|
14
|
+
import ServeCommand from './ServeCommand.js'
|
|
15
|
+
import ValidateCommand from './ValidateCommand.js'
|
|
10
16
|
|
|
11
17
|
export class ReleaseApp extends ModelAsApp {
|
|
18
|
+
static alias = 'release'
|
|
19
|
+
|
|
20
|
+
static UI = {
|
|
21
|
+
title: 'PM-as-Code Release Protocol (nan0release)',
|
|
22
|
+
}
|
|
23
|
+
|
|
12
24
|
static command = {
|
|
13
25
|
help: 'Subcommand to run',
|
|
14
26
|
options: [
|
|
15
27
|
InitCommand,
|
|
16
28
|
CheckCommand,
|
|
29
|
+
ValidateCommand,
|
|
17
30
|
CloseCommand,
|
|
18
31
|
DepsCommand,
|
|
19
32
|
PublishCommand,
|
|
20
33
|
SpecCommand,
|
|
21
34
|
StatusCommand,
|
|
22
35
|
BumpCommand,
|
|
36
|
+
WebCommand,
|
|
37
|
+
PreviewCommand,
|
|
38
|
+
ViewCommand,
|
|
39
|
+
ListCommand,
|
|
40
|
+
ServeCommand,
|
|
23
41
|
],
|
|
24
42
|
positional: true,
|
|
25
|
-
default:
|
|
43
|
+
default: ViewCommand,
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
/**
|
|
@@ -31,6 +49,19 @@ export class ReleaseApp extends ModelAsApp {
|
|
|
31
49
|
*/
|
|
32
50
|
constructor(data = {}, options = {}) {
|
|
33
51
|
super(data, options)
|
|
34
|
-
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Run the main controller logic.
|
|
56
|
+
* @returns {AsyncGenerator<import('@nan0web/ui').Intent, any, any>}
|
|
57
|
+
*/
|
|
58
|
+
async *run() {
|
|
59
|
+
if (this.help || !this.command || typeof this.command.run !== 'function') {
|
|
60
|
+
return yield* super.run()
|
|
61
|
+
}
|
|
62
|
+
return yield* this.command.run()
|
|
35
63
|
}
|
|
36
64
|
}
|
|
65
|
+
|
|
66
|
+
export default ReleaseApp
|
|
67
|
+
|
|
@@ -3,8 +3,18 @@ import { runSpawn } from '@nan0web/test'
|
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Command to bump the version of changed packages in the monorepo.
|
|
6
|
+
* @property {string} version Target version to set
|
|
7
|
+
* @property {string} since Git reference to diff against
|
|
8
|
+
* @property {boolean} dryRun Run the command without making any changes
|
|
6
9
|
*/
|
|
7
10
|
export default class BumpCommand extends ModelAsApp {
|
|
11
|
+
/** @type {string} Target version */
|
|
12
|
+
version = '3.1.1'
|
|
13
|
+
/** @type {string} Git reference to diff against */
|
|
14
|
+
since = 'v3.1.0'
|
|
15
|
+
/** @type {boolean} Run without making changes */
|
|
16
|
+
dryRun = false
|
|
17
|
+
|
|
8
18
|
static version = {
|
|
9
19
|
help: 'Target version to set',
|
|
10
20
|
default: '3.1.1',
|
|
@@ -38,9 +48,6 @@ export default class BumpCommand extends ModelAsApp {
|
|
|
38
48
|
*/
|
|
39
49
|
constructor(data = {}, options = {}) {
|
|
40
50
|
super(data, options)
|
|
41
|
-
/** @type {string} Target version */ this.version
|
|
42
|
-
/** @type {string} Since reference */ this.since
|
|
43
|
-
/** @type {boolean} Dry run */ this.dryRun
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
/**
|