@versatiles/release-tool 2.2.3 → 2.3.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
@@ -53,7 +53,7 @@ Options:
53
53
  -h, --help display help for command
54
54
 
55
55
  Commands:
56
- check-package Check package.json for required scripts and other metadata.
56
+ check Check repo for required scripts and other stuff.
57
57
  deps-graph Analyze project files and output a dependency graph as Mermaid markup.
58
58
  deps-upgrade Upgrade all dependencies in the current project to their latest versions.
59
59
  doc-command <command> Generate Markdown documentation for a specified command and output the result.
@@ -64,13 +64,13 @@ Commands:
64
64
  release-npm [path] Publish an npm package from the specified path to the npm registry.
65
65
  ```
66
66
 
67
- ## Subcommand: `vrt check-package`
67
+ ## Subcommand: `vrt check`
68
68
 
69
69
  ```console
70
- $ vrt check-package
71
- Usage: vrt check-package [options]
70
+ $ vrt check
71
+ Usage: vrt check [options]
72
72
 
73
- Check package.json for required scripts and other metadata.
73
+ Check repo for required scripts and other stuff.
74
74
 
75
75
  Options:
76
76
  -h, --help display help for command
@@ -196,7 +196,7 @@ flowchart TB
196
196
 
197
197
  subgraph 0["src"]
198
198
  subgraph 1["commands"]
199
- 2["check-package.ts"]
199
+ 2["check.ts"]
200
200
  5["deps-graph.ts"]
201
201
  6["deps-upgrade.ts"]
202
202
  8["doc-command.ts"]
@@ -0,0 +1,3 @@
1
+ export declare function check(directory: string): void;
2
+ export declare function checkPackage(directory: string): void;
3
+ export declare function checkWorkflow(directory: string): void;
@@ -1,6 +1,10 @@
1
- import { readFileSync } from "node:fs";
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
+ export function check(directory) {
5
+ checkPackage(directory);
6
+ checkWorkflow(directory);
7
+ }
4
8
  export function checkPackage(directory) {
5
9
  const pack = JSON.parse(readFileSync(resolve(directory, 'package.json'), 'utf8'));
6
10
  const { scripts } = pack;
@@ -12,6 +16,9 @@ export function checkPackage(directory) {
12
16
  info('scripts.doc is recommended');
13
17
  if (!scripts.build)
14
18
  panic('scripts.build is required');
19
+ if (!scripts.build.includes("npm run doc")) {
20
+ warn(`scripts.build should include "npm run doc-graph", but is "${scripts.build}"`);
21
+ }
15
22
  if (!scripts.check)
16
23
  panic('scripts.check is required');
17
24
  if (!scripts.check.includes('npm run build')) {
@@ -50,4 +57,9 @@ export function checkPackage(directory) {
50
57
  }
51
58
  });
52
59
  }
53
- //# sourceMappingURL=check-package.js.map
60
+ export function checkWorkflow(directory) {
61
+ if (!existsSync(resolve(directory, '.github/workflows/pages.yml'))) {
62
+ info('GitHub Pages workflow not found');
63
+ }
64
+ }
65
+ //# sourceMappingURL=check.js.map
@@ -7,7 +7,7 @@ export async function generateTypescriptDocs(options) {
7
7
  const plugin = [
8
8
  isMarkdown && 'typedoc-plugin-markdown',
9
9
  format === 'wiki' && 'typedoc-github-wiki-theme',
10
- format === 'html' && 'typedoc-unhoax-theme',
10
+ format === 'html' && 'typedoc-github-theme',
11
11
  ].filter(Boolean);
12
12
  const app = await td.Application.bootstrapWithPlugins({
13
13
  entryPoints: [entryPoint ?? './src/index.ts'],
@@ -32,6 +32,9 @@ export async function generateTypescriptDocs(options) {
32
32
  app.options.setValue('propertyMembersFormat', 'table');
33
33
  app.options.setValue('typeDeclarationFormat', 'table');
34
34
  }
35
+ if (format === 'html') {
36
+ app.options.setValue('githubPages', true);
37
+ }
35
38
  const project = await app.convert();
36
39
  if (!project)
37
40
  panic('Failed to convert project');
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import { generateCommandDocumentation } from './commands/doc-command.js';
9
9
  import { release } from './commands/release-npm.js';
10
10
  import { upgradeDependencies } from './commands/deps-upgrade.js';
11
11
  import { generateDependencyGraph } from './commands/deps-graph.js';
12
- import { checkPackage } from './commands/check-package.js';
12
+ import { check } from './commands/check.js';
13
13
  import { generateTypescriptDocs } from './commands/doc-typescript.js';
14
14
  /**
15
15
  * Main CLI program, configured with custom text styling for titles, commands, options, etc.
@@ -31,10 +31,10 @@ program
31
31
  * Command: check-package
32
32
  * Checks that the project's package.json includes certain required scripts/fields.
33
33
  */
34
- program.command('check-package')
35
- .description('Check package.json for required scripts and other metadata.')
34
+ program.command('check')
35
+ .description('Check repo for required scripts and other stuff.')
36
36
  .action(() => {
37
- void checkPackage(process.cwd());
37
+ void check(process.cwd());
38
38
  });
39
39
  /**
40
40
  * Command: deps-graph
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@versatiles/release-tool",
3
- "version": "2.2.3",
3
+ "version": "2.3.0",
4
4
  "description": "VersaTiles release and documentation tools",
5
5
  "bin": {
6
6
  "vrt": "./dist/index.js"
@@ -35,15 +35,15 @@
35
35
  "devDependencies": {
36
36
  "@schemastore/package": "^0.0.10",
37
37
  "@types/jest": "^29.5.14",
38
- "@types/node": "^22.13.5",
39
- "@typescript-eslint/eslint-plugin": "^8.22.0",
40
- "@typescript-eslint/parser": "^8.22.0",
38
+ "@types/node": "^22.13.8",
39
+ "@typescript-eslint/eslint-plugin": "^8.25.0",
40
+ "@typescript-eslint/parser": "^8.25.0",
41
41
  "eslint": "^9.21.0",
42
42
  "jest": "^29.7.0",
43
- "ts-jest": "^29.2.5",
43
+ "ts-jest": "^29.2.6",
44
44
  "tsx": "^4.19.3",
45
45
  "typescript": "^5.7.3",
46
- "typescript-eslint": "^8.24.1"
46
+ "typescript-eslint": "^8.25.0"
47
47
  },
48
48
  "dependencies": {
49
49
  "@inquirer/select": "^4.0.9",
@@ -51,9 +51,9 @@
51
51
  "dependency-cruiser": "^16.10.0",
52
52
  "remark": "^15.0.1",
53
53
  "remark-gfm": "^4.0.1",
54
- "typedoc": "^0.27.8",
54
+ "typedoc": "^0.27.9",
55
+ "typedoc-github-theme": "^0.2.1",
55
56
  "typedoc-github-wiki-theme": "^2.1.0",
56
- "typedoc-plugin-markdown": "^4.4.2",
57
- "typedoc-unhoax-theme": "^0.4.6"
57
+ "typedoc-plugin-markdown": "^4.4.2"
58
58
  }
59
59
  }
@@ -1 +0,0 @@
1
- export declare function checkPackage(directory: string): void;