@runtime-type-inspector/parcel-transformer 1.0.5 → 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/README.md +16 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
# Plugin for Parcel v2
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
For integrating this plugin follow this process:
|
|
4
4
|
|
|
5
5
|
1) `npm install --save-dev @runtime-type-inspector/parcel-transformer`
|
|
6
6
|
|
|
@@ -14,3 +14,17 @@ It is a two-step process to install it:
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
```
|
|
17
|
+
|
|
18
|
+
3) Make sure to declare RTI as globals:
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<script src="/node_modules/@runtime-type-inspector/runtime/index.cjs"></script>
|
|
22
|
+
<script>
|
|
23
|
+
Object.assign(window, rtiRuntime);
|
|
24
|
+
</script>
|
|
25
|
+
<script src="./build/out.js"></script>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This is *kind of ugly*, but Parcel v2 simply doesn't seem to support adding import declarations inside a plugin. If I will find a possibility, I will fix this.
|
|
29
|
+
|
|
30
|
+
Parcel also drops files that export nothing, but given the nature of JSDoc comments in combination of RTI, a comment is converted into `registerTypedef(...)` for example. This means that typedefs in such files will simply be unregistered, causing runtime type errors (because it's an unknown type). Make sure to process such files individually and add them into the final `out.js`.
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtime-type-inspector/parcel-transformer",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "RuntimeTypeInspector.js plugin for Parcel v2",
|
|
5
5
|
"main": "index.mjs",
|
|
6
6
|
"author": "Hermann Rolfes (kungfooman)",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@parcel/plugin": "^2.10.1",
|
|
10
|
-
"@runtime-type-inspector/transpiler": "^
|
|
10
|
+
"@runtime-type-inspector/transpiler": "^3.0.0"
|
|
11
11
|
},
|
|
12
12
|
"engines": {
|
|
13
13
|
"parcel": "2.x"
|