@travetto/doc 2.1.0 → 2.1.3
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/bin/cli-doc.ts +2 -2
- package/package.json +4 -4
- package/src/lib.ts +1 -1
- package/src/util/file.ts +3 -3
package/bin/cli-doc.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as path from 'path';
|
|
2
|
-
import * as fs from 'fs';
|
|
2
|
+
import * as fs from 'fs/promises';
|
|
3
3
|
|
|
4
4
|
import { BasePlugin } from '@travetto/cli/src/plugin-base';
|
|
5
5
|
import { EnvInit } from '@travetto/base/bin/init';
|
|
@@ -52,7 +52,7 @@ export class DocPlugin extends BasePlugin {
|
|
|
52
52
|
const fmt = path.extname(out) ?? this.cmd.format;
|
|
53
53
|
const finalName = await PathUtil.resolveUnix(out);
|
|
54
54
|
const result = await RenderUtil.render(docFile, fmt);
|
|
55
|
-
await fs.
|
|
55
|
+
await fs.writeFile(finalName, result, 'utf8');
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/doc",
|
|
3
3
|
"displayName": "Documentation",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.3",
|
|
5
5
|
"description": "Documentation support for the travetto framework",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"docs",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"directory": "module/doc"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/base": "^2.1.
|
|
29
|
-
"prismjs": "^1.
|
|
28
|
+
"@travetto/base": "^2.1.3",
|
|
29
|
+
"prismjs": "^1.28.0"
|
|
30
30
|
},
|
|
31
31
|
"optionalPeerDependencies": {
|
|
32
|
-
"@travetto/cli": "^2.1.
|
|
32
|
+
"@travetto/cli": "^2.1.3"
|
|
33
33
|
},
|
|
34
34
|
"private": false,
|
|
35
35
|
"publishConfig": {
|
package/src/lib.ts
CHANGED
|
@@ -88,7 +88,7 @@ export const lib = {
|
|
|
88
88
|
Busboy: Library('busboy', 'https://github.com/mscdex/busboy'),
|
|
89
89
|
Cookies: Library('cookies', 'https://www.npmjs.com/package/cookies'),
|
|
90
90
|
ServerlessExpress: Library('aws-serverless-express', 'https://github.com/awslabs/aws-serverless-express/blob/master/README.md'),
|
|
91
|
-
AwsLambdaFastify: Library('aws-lambda
|
|
91
|
+
AwsLambdaFastify: Library('@fastify/aws-lambda', 'https://github.com/fastify/aws-lambda-fastify/blob/master/README.md'),
|
|
92
92
|
Fastify: Library('fastify', 'https://www.fastify.io/'),
|
|
93
93
|
Koa: Library('koa', 'https://koajs.com/'),
|
|
94
94
|
};
|
package/src/util/file.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
|
|
4
4
|
import { FsUtil, Package, PathUtil } from '@travetto/boot';
|
|
@@ -45,7 +45,7 @@ export class FileUtil {
|
|
|
45
45
|
|
|
46
46
|
let text: string | undefined;
|
|
47
47
|
if (language) {
|
|
48
|
-
text =
|
|
48
|
+
text = readFileSync(resolved, 'utf8')
|
|
49
49
|
.replace(/^\/\/\s*@file-if.*/, '');
|
|
50
50
|
|
|
51
51
|
text = text.split(/\n/)
|
|
@@ -73,7 +73,7 @@ export class FileUtil {
|
|
|
73
73
|
return this.#decCache[key];
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const text =
|
|
76
|
+
const text = readFileSync(resolved, 'utf8')
|
|
77
77
|
.split(/\n/g);
|
|
78
78
|
|
|
79
79
|
const start = text.findIndex(x => new RegExp(`function ${name}\\b`).test(x));
|