@runtime-type-inspector/plugin-rollup 1.2.2 → 3.0.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/index.mjs +6 -4
- package/package.json +3 -3
- package/types.d.ts +0 -4
package/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
addTypeChecks, expandType, compareAST, code2ast2code
|
|
4
4
|
} from '@runtime-type-inspector/transpiler';
|
|
5
5
|
/**
|
|
6
|
-
* @typedef
|
|
6
|
+
* @typedef OptionsProps
|
|
7
7
|
* @property {boolean} [enable] - Enable or disable entire plugin. Defaults to true.
|
|
8
8
|
* @property {boolean} [selftest] - Every once in a while Babel changes the AST, so we
|
|
9
9
|
* self-test Stringifier class to ensure its functionanlity.
|
|
@@ -11,11 +11,14 @@ import {
|
|
|
11
11
|
* context, for example framework/parsers/draco-worker.js operates as WebWorker (without RTI).
|
|
12
12
|
* @property {boolean} [validateDivision] - Whether divisions are validated. Defaults to true.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* @typedef {OptionsProps & import('@runtime-type-inspector/transpiler').Options} Options
|
|
16
|
+
*/
|
|
14
17
|
/**
|
|
15
18
|
* @param {Options} [options] - Optional options.
|
|
16
19
|
* @returns {import('rollup').Plugin} The rollup plugin.
|
|
17
20
|
*/
|
|
18
|
-
function runtimeTypeInspector({enable = true, selftest = false, ignoredFiles,
|
|
21
|
+
function runtimeTypeInspector({enable = true, selftest = false, ignoredFiles, ...options} = {}) {
|
|
19
22
|
const filter = createFilter([
|
|
20
23
|
'**/*.js'
|
|
21
24
|
], []);
|
|
@@ -37,10 +40,9 @@ function runtimeTypeInspector({enable = true, selftest = false, ignoredFiles, va
|
|
|
37
40
|
}
|
|
38
41
|
// todo expose options to rollup plugin
|
|
39
42
|
code = addTypeChecks(code, {
|
|
40
|
-
validateDivision,
|
|
41
|
-
// ignoreLocations: ['Tensor#constructor'], // todo
|
|
42
43
|
expandType,
|
|
43
44
|
filename: id,
|
|
45
|
+
...options
|
|
44
46
|
});
|
|
45
47
|
return {
|
|
46
48
|
code,
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtime-type-inspector/plugin-rollup",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Rollup plugin for https://runtimetypeinspector.org/",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"types": "
|
|
7
|
+
"types": "index.mjs",
|
|
8
8
|
"author": "Hermann Rolfes (kungfooman)",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@runtime-type-inspector/transpiler": "^
|
|
11
|
+
"@runtime-type-inspector/transpiler": "^3.0.0",
|
|
12
12
|
"rollup": "^3.29.4"
|
|
13
13
|
}
|
|
14
14
|
}
|
package/types.d.ts
DELETED