@travetto/doc 5.0.14 → 5.0.16
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/LICENSE +1 -1
- package/package.json +3 -3
- package/src/render/html.ts +0 -1
- package/src/util/file.ts +6 -6
package/LICENSE
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/doc",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.16",
|
|
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/runtime": "^5.0.
|
|
27
|
+
"@travetto/runtime": "^5.0.15",
|
|
28
28
|
"@types/prismjs": "^1.26.5",
|
|
29
29
|
"prismjs": "^1.29.0"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@travetto/cli": "^5.0.
|
|
32
|
+
"@travetto/cli": "^5.0.18"
|
|
33
33
|
},
|
|
34
34
|
"peerDependenciesMeta": {
|
|
35
35
|
"@travetto/cli": {
|
package/src/render/html.ts
CHANGED
|
@@ -24,7 +24,6 @@ const std = async ({ recurse, el }: RenderState<JSXElement, RenderContext>): Pro
|
|
|
24
24
|
const stdFull = async ({ recurse, el }: RenderState<JSXElement, RenderContext>): Promise<string> =>
|
|
25
25
|
`\n<${el.type}>${await recurse()}</${el.type}>\n`;
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
export const Html: RenderProvider<RenderContext> = {
|
|
29
28
|
ext: 'html',
|
|
30
29
|
finalize: (text, context) => {
|
package/src/util/file.ts
CHANGED
|
@@ -3,8 +3,8 @@ import path from 'node:path';
|
|
|
3
3
|
|
|
4
4
|
import { Runtime, RuntimeIndex } from '@travetto/runtime';
|
|
5
5
|
|
|
6
|
-
const ESLINT_PATTERN = /\s
|
|
7
|
-
const ENV_KEY = /Env.([^.]
|
|
6
|
+
const ESLINT_PATTERN = /\s{0,10}\/\/ eslint.{0,300}$/g;
|
|
7
|
+
const ENV_KEY = /Env.([^.]{1,100})[.]key/g;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Standard file utilities
|
|
@@ -113,15 +113,15 @@ export class DocFileUtil {
|
|
|
113
113
|
let methodPrefix = '';
|
|
114
114
|
code = code.split(/\n/).map((x) => {
|
|
115
115
|
if (!methodPrefix) {
|
|
116
|
-
const info = x.match(/^(\s
|
|
116
|
+
const info = x.match(/^(\s{0,50})(?:(private|public)\s{1,10})?(?:static\s{1,10})?(?:async\s{1,10})?(?:[*]\s{0,10})?(?:(?:get|set)\s{1,10})?(\S{1,200})[<(](.{0,500})/);
|
|
117
117
|
if (info) {
|
|
118
118
|
const [, space, __name, rest] = info;
|
|
119
119
|
if (!rest.endsWith(';')) {
|
|
120
|
-
if (/\s
|
|
121
|
-
return x.replace(/\s
|
|
120
|
+
if (/\s{0,50}[{]\s{0,50}return.{0,200}$/.test(x)) {
|
|
121
|
+
return x.replace(/\s{0,50}[{]\s{0,50}return.{0,200}$/, ';');
|
|
122
122
|
} else {
|
|
123
123
|
methodPrefix = space;
|
|
124
|
-
return x.replace(/\s
|
|
124
|
+
return x.replace(/\s{0,50}[{]\s{0,50}$/, ';');
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|