bio-dts 0.15.0 → 0.15.2
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 +1 -0
- package/lib/generate-types.js +7 -3
- package/lib/pre-transform.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,7 @@ Generates clean type definitions from ES5 code bases:
|
|
|
28
28
|
* Converts JSDoc to [TSDoc](https://github.com/microsoft/tsdoc)
|
|
29
29
|
* Only exposed documented parameters
|
|
30
30
|
* Validates, where needed declared parameters
|
|
31
|
+
* Supports [declaration maps](https://www.typescriptlang.org/tsconfig/#declarationMap)
|
|
31
32
|
|
|
32
33
|
Checkout the [test fixtures](./test/fixtures) for full coverage.
|
|
33
34
|
|
package/lib/generate-types.js
CHANGED
|
@@ -151,15 +151,19 @@ export default function generateTypes(fileNames, compilerOptions, ts, generateOp
|
|
|
151
151
|
|
|
152
152
|
const combinedJSON = JSON.parse(JSON.stringify(combined));
|
|
153
153
|
|
|
154
|
-
// produce source maps with relative paths
|
|
155
|
-
|
|
154
|
+
// produce source maps with relative paths, following typescript conventions
|
|
155
|
+
const mapDir = path.dirname(path.resolve(fileName));
|
|
156
|
+
|
|
156
157
|
if (combinedJSON.sources) {
|
|
157
|
-
const mapDir = path.dirname(path.resolve(fileName));
|
|
158
158
|
combinedJSON.sources = combinedJSON.sources.map(src =>
|
|
159
159
|
path.relative(mapDir, path.resolve(src))
|
|
160
160
|
);
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
+
if (combinedJSON.file) {
|
|
164
|
+
combinedJSON.file = path.relative(mapDir, path.resolve(fileName));
|
|
165
|
+
}
|
|
166
|
+
|
|
163
167
|
// keep maps small, do not inline source text in declaration maps
|
|
164
168
|
delete combinedJSON.sourcesContent;
|
|
165
169
|
|
package/lib/pre-transform.js
CHANGED
|
@@ -82,6 +82,7 @@ function clazzDefinition(cls, ctor) {
|
|
|
82
82
|
static: false,
|
|
83
83
|
key: m.identifier,
|
|
84
84
|
kind: 'method',
|
|
85
|
+
async: m.member.async || false,
|
|
85
86
|
params: m.member.params,
|
|
86
87
|
body: m.member.body,
|
|
87
88
|
comments: m.comments || null,
|
|
@@ -107,6 +108,7 @@ function clazzDefinition(cls, ctor) {
|
|
|
107
108
|
static: true,
|
|
108
109
|
key: m.identifier,
|
|
109
110
|
kind: 'method',
|
|
111
|
+
async: m.member.async || false,
|
|
110
112
|
params: m.member.params,
|
|
111
113
|
body: m.member.body,
|
|
112
114
|
comments: m.comments || null,
|