@versatiles/release-tool 2.3.0 → 2.4.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 +6 -3
- package/dist/commands/check.js +17 -14
- package/dist/commands/deps-graph.js +5 -4
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -192,6 +192,10 @@ Options:
|
|
|
192
192
|
<!--- This chapter is generated automatically --->
|
|
193
193
|
|
|
194
194
|
```mermaid
|
|
195
|
+
---
|
|
196
|
+
config:
|
|
197
|
+
layout: elk
|
|
198
|
+
---
|
|
195
199
|
flowchart TB
|
|
196
200
|
|
|
197
201
|
subgraph 0["src"]
|
|
@@ -231,7 +235,6 @@ E-->A
|
|
|
231
235
|
E-->B
|
|
232
236
|
E-->C
|
|
233
237
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
style 3 fill-opacity:0.2
|
|
238
|
+
class 0,1,3 subgraphs;
|
|
239
|
+
classDef subgraphs fill-opacity:0.1, fill:#888, color:#888, stroke:#888;
|
|
237
240
|
```
|
package/dist/commands/check.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { panic, info, warn } from '../lib/log.js';
|
|
3
3
|
import { resolve } from 'node:path';
|
|
4
4
|
export function check(directory) {
|
|
@@ -8,6 +8,7 @@ export function check(directory) {
|
|
|
8
8
|
export function checkPackage(directory) {
|
|
9
9
|
const pack = JSON.parse(readFileSync(resolve(directory, 'package.json'), 'utf8'));
|
|
10
10
|
const { scripts } = pack;
|
|
11
|
+
const isPrivate = pack.private === true || String(pack.private).toLowerCase() === 'true';
|
|
11
12
|
if (!scripts)
|
|
12
13
|
panic('scripts not found');
|
|
13
14
|
if (!scripts.test)
|
|
@@ -15,24 +16,26 @@ export function checkPackage(directory) {
|
|
|
15
16
|
if (!scripts.doc)
|
|
16
17
|
info('scripts.doc is recommended');
|
|
17
18
|
if (!scripts.build)
|
|
18
|
-
|
|
19
|
-
if (!scripts.build.includes("npm run doc")) {
|
|
19
|
+
warn('scripts.build is required');
|
|
20
|
+
else if (!scripts.build.includes("npm run doc")) {
|
|
20
21
|
warn(`scripts.build should include "npm run doc-graph", but is "${scripts.build}"`);
|
|
21
22
|
}
|
|
22
23
|
if (!scripts.check)
|
|
23
|
-
|
|
24
|
-
if (!scripts.check.includes('npm run build')) {
|
|
24
|
+
warn('scripts.check is required');
|
|
25
|
+
else if (!scripts.check.includes('npm run build')) {
|
|
25
26
|
warn(`scripts.check should include "npm run build", but is "${scripts.check}"`);
|
|
26
27
|
}
|
|
27
|
-
if (!
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
if (!isPrivate) {
|
|
29
|
+
if (!scripts.prepack)
|
|
30
|
+
warn('scripts.prepack is required');
|
|
31
|
+
else if (scripts.prepack !== 'npm run build') {
|
|
32
|
+
warn(`scripts.prepack should be "npm run build", but is "${scripts.prepack}"`);
|
|
33
|
+
}
|
|
34
|
+
if (!scripts.release)
|
|
35
|
+
warn('scripts.release is required');
|
|
36
|
+
else if (scripts.release !== 'vrt release-npm') {
|
|
37
|
+
warn(`scripts.release should be "vrt release-npm", but is "${scripts.release}"`);
|
|
38
|
+
}
|
|
36
39
|
}
|
|
37
40
|
if (!scripts.upgrade) {
|
|
38
41
|
warn('scripts.upgrade is recommended');
|
|
@@ -6,7 +6,7 @@ export async function generateDependencyGraph(directory) {
|
|
|
6
6
|
cruiseResult = await cruise([directory], {
|
|
7
7
|
includeOnly: '^src',
|
|
8
8
|
outputType: 'mermaid',
|
|
9
|
-
exclude: ["\\.(test|d)\\.ts$", "node_modules"],
|
|
9
|
+
exclude: ["\\.(test|d)\\.ts$", "node_modules", "__mocks__/"],
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
catch (pError) {
|
|
@@ -15,10 +15,11 @@ export async function generateDependencyGraph(directory) {
|
|
|
15
15
|
let { output } = cruiseResult;
|
|
16
16
|
if (typeof output !== 'string')
|
|
17
17
|
panic('no output');
|
|
18
|
-
output = output.replace('flowchart LR', '
|
|
18
|
+
output = output.replace('flowchart LR', '---\nconfig:\n layout: elk\n---\nflowchart TB');
|
|
19
19
|
const matches = Array.from(output.matchAll(/subgraph ([0-9a-z]+)/gi));
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const subgraphIds = matches.map(([_match, id]) => id);
|
|
21
|
+
output += `\nclass ${subgraphIds.join(',')} subgraphs;`;
|
|
22
|
+
output += `\nclassDef subgraphs fill-opacity:0.1, fill:#888, color:#888, stroke:#888;`;
|
|
22
23
|
process.stdout.write(Buffer.from('```mermaid\n' + output + '\n```\n'));
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=deps-graph.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@versatiles/release-tool",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "VersaTiles release and documentation tools",
|
|
5
5
|
"bin": {
|
|
6
6
|
"vrt": "./dist/index.js"
|
|
@@ -35,18 +35,18 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@schemastore/package": "^0.0.10",
|
|
37
37
|
"@types/jest": "^29.5.14",
|
|
38
|
-
"@types/node": "^22.13.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
41
|
-
"eslint": "^9.
|
|
38
|
+
"@types/node": "^22.13.10",
|
|
39
|
+
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
40
|
+
"@typescript-eslint/parser": "^8.26.1",
|
|
41
|
+
"eslint": "^9.22.0",
|
|
42
42
|
"jest": "^29.7.0",
|
|
43
43
|
"ts-jest": "^29.2.6",
|
|
44
44
|
"tsx": "^4.19.3",
|
|
45
|
-
"typescript": "^5.
|
|
46
|
-
"typescript-eslint": "^8.
|
|
45
|
+
"typescript": "^5.8.2",
|
|
46
|
+
"typescript-eslint": "^8.26.1"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@inquirer/select": "^4.0.
|
|
49
|
+
"@inquirer/select": "^4.0.10",
|
|
50
50
|
"commander": "^13.1.0",
|
|
51
51
|
"dependency-cruiser": "^16.10.0",
|
|
52
52
|
"remark": "^15.0.1",
|