@travetto/doc 3.2.2 → 3.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/package.json +3 -3
- package/src/util/file.ts +7 -7
- package/support/cli.doc.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/doc",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.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.
|
|
27
|
+
"@travetto/base": "^3.3.0",
|
|
28
28
|
"@types/prismjs": "^1.26.0",
|
|
29
29
|
"prismjs": "^1.29.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^3.
|
|
32
|
+
"@travetto/cli": "^3.3.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependenciesMeta": {
|
|
35
35
|
"@travetto/cli": {
|
package/src/util/file.ts
CHANGED
|
@@ -11,11 +11,11 @@ export class DocFileUtil {
|
|
|
11
11
|
|
|
12
12
|
static #decCache: Record<string, boolean> = {};
|
|
13
13
|
static #extToLang: Record<string, string> = {
|
|
14
|
-
ts: 'typescript',
|
|
15
|
-
tsx: 'typescript',
|
|
16
|
-
js: 'javascript',
|
|
17
|
-
yml: 'yaml',
|
|
18
|
-
sh: 'bash',
|
|
14
|
+
'.ts': 'typescript',
|
|
15
|
+
'.tsx': 'typescript',
|
|
16
|
+
'.js': 'javascript',
|
|
17
|
+
'.yml': 'yaml',
|
|
18
|
+
'.sh': 'bash',
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
static isFile(src: string): boolean {
|
|
@@ -49,8 +49,8 @@ export class DocFileUtil {
|
|
|
49
49
|
static async read(file: string): Promise<{ content: string, language: string, file: string }> {
|
|
50
50
|
file = await this.resolveFile(file);
|
|
51
51
|
|
|
52
|
-
const ext = path.extname(file)
|
|
53
|
-
const language = this.#extToLang[ext] ?? ext;
|
|
52
|
+
const ext = path.extname(file);
|
|
53
|
+
const language = this.#extToLang[ext] ?? ext.replace('.', '');
|
|
54
54
|
|
|
55
55
|
let text: string | undefined;
|
|
56
56
|
if (language) {
|
package/support/cli.doc.ts
CHANGED
|
@@ -66,7 +66,7 @@ export class DocCommand implements CliCommandShape {
|
|
|
66
66
|
const { DocRenderer } = await import('../src/render/renderer.js');
|
|
67
67
|
const ctx = await DocRenderer.get(this.input, RootIndex.manifest);
|
|
68
68
|
const outputs = this.outputs.map(output =>
|
|
69
|
-
output.includes('.') ? [path.extname(output).
|
|
69
|
+
output.includes('.') ? [path.extname(output).replace('.', ''), path.resolve(output)] :
|
|
70
70
|
[output, null] as const
|
|
71
71
|
);
|
|
72
72
|
|