@travetto/doc 3.3.4 → 3.4.0-rc.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/package.json +4 -4
- package/src/util/run.ts +3 -0
- package/support/cli.doc.ts +8 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/doc",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-rc.0",
|
|
4
4
|
"description": "Documentation support for the Travetto framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"docs",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"directory": "module/doc"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@travetto/base": "^3.
|
|
28
|
-
"@types/prismjs": "^1.26.
|
|
27
|
+
"@travetto/base": "^3.4.0-rc.0",
|
|
28
|
+
"@types/prismjs": "^1.26.2",
|
|
29
29
|
"prismjs": "^1.29.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^3.
|
|
32
|
+
"@travetto/cli": "^3.4.0-rc.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependenciesMeta": {
|
|
35
35
|
"@travetto/cli": {
|
package/src/util/run.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import os from 'os';
|
|
2
|
+
|
|
1
3
|
import { path, RootIndex } from '@travetto/manifest';
|
|
2
4
|
import { ExecUtil, ExecutionOptions, ExecutionState } from '@travetto/base';
|
|
3
5
|
import { stripAnsiCodes } from '@travetto/terminal';
|
|
@@ -77,6 +79,7 @@ export class DocRunUtil {
|
|
|
77
79
|
const cwd = path.toPosix((cfg.module ? RootIndex.getModule(cfg.module)! : RootIndex.mainModule).sourcePath);
|
|
78
80
|
text = stripAnsiCodes(text.trim())
|
|
79
81
|
.replaceAll(cwd, '.')
|
|
82
|
+
.replaceAll(os.tmpdir(), '/tmp')
|
|
80
83
|
.replaceAll(RootIndex.manifest.workspacePath, '<workspace-root>')
|
|
81
84
|
.replace(/[/]tmp[/][a-z_A-Z0-9\/\-]+/g, '/tmp/<temp-folder>')
|
|
82
85
|
.replace(/^(\s*framework:\s*')(\d+[.]\d+)[^']*('[,]?\s*)$/gm, (_, pre, ver, post) => `${pre}${ver}.x${post}`)
|
package/support/cli.doc.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
|
|
3
|
-
import { PackageUtil, path, RootIndex
|
|
3
|
+
import { PackageUtil, path, RootIndex } from '@travetto/manifest';
|
|
4
4
|
import { ExecUtil, GlobalEnvConfig } from '@travetto/base';
|
|
5
|
-
import { CliCommandShape, CliCommand, CliValidationError } from '@travetto/cli';
|
|
5
|
+
import { CliCommandShape, CliCommand, CliValidationError, CliUtil } from '@travetto/cli';
|
|
6
6
|
import { MinLength } from '@travetto/schema';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -49,9 +49,13 @@ export class DocCommand implements CliCommandShape {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
async runWatch(): Promise<void> {
|
|
52
|
+
if (await CliUtil.runWithRestart(this)) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
52
56
|
const args = process.argv.slice(2).filter(x => !/(-w|--watch)/.test(x));
|
|
53
|
-
const
|
|
54
|
-
for await (const { action, file } of
|
|
57
|
+
const { listenFileChanges } = await import('@travetto/base/src/internal/compiler-client.js');
|
|
58
|
+
for await (const { action, file } of listenFileChanges()) {
|
|
55
59
|
if (action === 'update' && file === this.input) {
|
|
56
60
|
await ExecUtil.spawn('npx', ['trv', ...args], {
|
|
57
61
|
cwd: RootIndex.mainModule.sourcePath,
|