@runtime-type-inspector/repl 3.2.0 → 3.2.1
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/importmap.js +9 -8
- package/index.html +1 -1
- package/{index.mjs → index.js} +18 -6
- package/package.json +2 -2
- /package/{babel-helper-plugin-utils.mjs → babel-helper-plugin-utils.js} +0 -0
- /package/{babel-parser.mjs → babel-parser.js} +0 -0
- /package/{babel-plugin-syntax-typescript.mjs → babel-plugin-syntax-typescript.js} +0 -0
package/importmap.js
CHANGED
|
@@ -6,14 +6,15 @@ function importFile(content) {
|
|
|
6
6
|
return "data:text/javascript;base64," + btoa(content);
|
|
7
7
|
}
|
|
8
8
|
const imports = {
|
|
9
|
-
"@runtime-type-inspector/runtime" : '../src-runtime/index.
|
|
10
|
-
"@runtime-type-inspector/transpiler": '../src-transpiler/index.
|
|
11
|
-
"@babel/parser": "./babel-parser.
|
|
12
|
-
"display-anything": "./node_modules/display-anything/src/index.js",
|
|
13
|
-
|
|
14
|
-
//"@babel/plugin-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
9
|
+
"@runtime-type-inspector/runtime" : '../src-runtime/index.js',
|
|
10
|
+
"@runtime-type-inspector/transpiler": '../src-transpiler/index.js',
|
|
11
|
+
"@babel/parser" : "./babel-parser.js",
|
|
12
|
+
"display-anything" : "./node_modules/display-anything/src/index.js",
|
|
13
|
+
"test-import-validation-b" : "../test/typechecking/import-validation/b.js",
|
|
14
|
+
//"@babel/helper-plugin-utils" : "./babel-helper-plugin-utils.js",
|
|
15
|
+
//"@babel/plugin-syntax-typescript" : "./babel-plugin-syntax-typescript.js",
|
|
16
|
+
"fs" : importFile("export default {};"),
|
|
17
|
+
"typescript" : importFile("export default ts;"), // UMD import
|
|
17
18
|
};
|
|
18
19
|
if (location.host.includes('runtimetypeinspector.org') || location.port === '7000') {
|
|
19
20
|
imports['@runtime-type-inspector/runtime' ] = './node_modules/@runtime-type-inspector/runtime/index.mjs';
|
package/index.html
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
Left: <input id="left" type="checkbox" checked></input>
|
|
29
29
|
Right: <input id="right" type="checkbox" checked></input>
|
|
30
30
|
<script type="module">
|
|
31
|
-
import * as Index from "./index.
|
|
31
|
+
import * as Index from "./index.js";
|
|
32
32
|
Object.assign(window, {...Index});
|
|
33
33
|
</script>
|
|
34
34
|
</body>
|
package/{index.mjs → index.js}
RENAMED
|
@@ -145,13 +145,25 @@ function activateREPL() {
|
|
|
145
145
|
* @todo remove import/exports of RTI Runtime, since we are injecting them
|
|
146
146
|
*/
|
|
147
147
|
function activateREPLRuntime() {
|
|
148
|
-
|
|
148
|
+
/** @type {Partial<typeof rti>} */
|
|
149
|
+
const fixedModule = {...rti};
|
|
150
|
+
delete fixedModule.warnedTable;
|
|
151
|
+
delete fixedModule.typePanel;
|
|
152
|
+
const code = Object.entries(fixedModule)
|
|
149
153
|
.map(([key, val]) => data2code(key, val))
|
|
150
|
-
.join('\n')
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const
|
|
154
|
+
.join('\n');
|
|
155
|
+
const precode = [
|
|
156
|
+
'import {DisplayAnything} from "display-anything";',
|
|
157
|
+
].join('\n');
|
|
158
|
+
const postcode = [
|
|
159
|
+
// options.warned needs to be cleared since it contains "tr" values from old session
|
|
160
|
+
'clearObject(options.warned)',
|
|
161
|
+
// replacers because we get the old/initialized values that need to be renewed
|
|
162
|
+
'const warnedTable = createTable();',
|
|
163
|
+
'const typePanel = new TypePanel();',
|
|
164
|
+
].join('\n');
|
|
165
|
+
const right = getRight().replace('import {inspect', '// import {inspect}');
|
|
166
|
+
const newCode = [precode, code, postcode, right].join('\n');
|
|
155
167
|
setRight(newCode);
|
|
156
168
|
}
|
|
157
169
|
buttonREPL.onclick = activateREPL;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@runtime-type-inspector/repl",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "REPL of RuntimeTypeInspector.js",
|
|
5
5
|
"main": "index.html",
|
|
6
6
|
"author": "Hermann Rolfes (kungfooman)",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@runtime-type-inspector/transpiler": "^3.2.
|
|
12
|
+
"@runtime-type-inspector/transpiler": "^3.2.1",
|
|
13
13
|
"ace-builds": "^1.28.0",
|
|
14
14
|
"display-anything": "^1.1.0",
|
|
15
15
|
"express": "^4.18.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|