@runtime-type-inspector/repl 3.2.0 → 3.2.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/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.mjs',
10
- "@runtime-type-inspector/transpiler": '../src-transpiler/index.mjs',
11
- "@babel/parser": "./babel-parser.mjs",
12
- "display-anything": "./node_modules/display-anything/src/index.js",
13
- //"@babel/helper-plugin-utils": "./babel-helper-plugin-utils.mjs",
14
- //"@babel/plugin-syntax-typescript": "./babel-plugin-syntax-typescript.mjs",
15
- "fs": importFile("export default {};"),
16
- "typescript": importFile("export default ts;"), // UMD import
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.mjs";
31
+ import * as Index from "./index.js";
32
32
  Object.assign(window, {...Index});
33
33
  </script>
34
34
  </body>
@@ -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
- const code = Object.entries(rti)
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
- .replace('let warnedTable = {};', 'const warnedTable = createTable();');
152
- // options.warned needs to be cleared since it contains "tr" values from old session
153
- const extra = 'clearObject(options.warned)';
154
- const newCode = [code, extra, getRight()].join('\n');
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.0",
3
+ "version": "3.2.2",
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.0",
12
+ "@runtime-type-inspector/transpiler": "^3.2.2",
13
13
  "ace-builds": "^1.28.0",
14
14
  "display-anything": "^1.1.0",
15
15
  "express": "^4.18.2"
File without changes