@codemod.com/codemod-sandbox 0.1.4 → 0.1.5

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.
@@ -11,10 +11,10 @@ class Capabilities {
11
11
  const parsedInputs = JSON.parse(inputData);
12
12
  const isOutputOperation = capabilityName === "output";
13
13
  const { $metadata, ...cleanInputs } = parsedInputs;
14
- const actualInputs = (!isOutputOperation && $metadata) ? cleanInputs : parsedInputs;
14
+ const actualInputs = !isOutputOperation && $metadata ? cleanInputs : parsedInputs;
15
15
  let result;
16
16
  try {
17
- result = await handler(actualInputs, []) || {};
17
+ result = (await handler(actualInputs, [])) || {};
18
18
  }
19
19
  catch (error) {
20
20
  result = {
@@ -9,8 +9,8 @@ export default function _default(): {
9
9
  dumpASTNodes: (src: string) => any;
10
10
  dumpPattern: (src: string, selector?: string | null) => any;
11
11
  __wbg_String_8f0eb39a4a4c2f66: (arg0: any, arg1: any) => void;
12
- __wbg_atob_b687cf564517d11e: (arg0: any, arg1: any, arg2: any) => void;
13
- __wbg_btoa_f1cc8b23625c1733: (arg0: any, arg1: any, arg2: any) => void;
12
+ __wbg_atob_410cd81516b5d2c0: (arg0: any, arg1: any, arg2: any) => void;
13
+ __wbg_btoa_607ab8a9e28af18a: (arg0: any, arg1: any, arg2: any) => void;
14
14
  __wbg_buffer_609cc3eee51ed158: (arg0: any) => any;
15
15
  __wbg_call_672a4d21634d4a24: (...args: any[]) => any;
16
16
  __wbg_call_7cccdd69e0791ae2: (...args: any[]) => any;
@@ -27,8 +27,8 @@ export default function _default(): {
27
27
  __wbg_endIndex_d3aa1552abc6599c: (arg0: any) => any;
28
28
  __wbg_endPosition_a4796193570eccbd: (arg0: any) => any;
29
29
  __wbg_entries_3265d4158b33e5dc: (arg0: any) => [string, any][];
30
- __wbg_error_55b26df739c2fe8b: (arg0: any, arg1: any) => void;
31
- __wbg_fetch_71724d6f0f8d9962: (arg0: any, arg1: any, arg2: any, arg3: any) => Promise<string>;
30
+ __wbg_error_b70b501f8bfc3e9f: (arg0: any, arg1: any) => void;
31
+ __wbg_fetch_cfe126521bd5ab4d: (arg0: any, arg1: any, arg2: any, arg3: any) => Promise<string>;
32
32
  __wbg_fieldIdForName_ed243dd7e35f4861: (arg0: any, arg1: any, arg2: any) => any;
33
33
  __wbg_from_2a5d3e218e67aa85: (arg0: any) => any[];
34
34
  __wbg_get_67b2ba62fc30de12: (...args: any[]) => any;
@@ -52,7 +52,7 @@ export default function _default(): {
52
52
  __wbg_length_a446193dc22c12f8: (arg0: any) => any;
53
53
  __wbg_length_e2d2a49132c1b256: (arg0: any) => any;
54
54
  __wbg_load_ac005a13bbebdb0b: (arg0: any, arg1: any) => Promise<Language>;
55
- __wbg_log_b79a24d377a91090: (arg0: any, arg1: any) => void;
55
+ __wbg_log_82a1aa28dec023ca: (arg0: any, arg1: any) => void;
56
56
  __wbg_message_97a2af9b89d693a3: (arg0: any) => any;
57
57
  __wbg_namedChildCount_44a0f24db74f4d08: (arg0: any) => any;
58
58
  __wbg_new_23a2665fac83c611: (arg0: any, arg1: any) => Promise<any>;
@@ -67,7 +67,6 @@ export default function _default(): {
67
67
  __wbg_next_6574e1a8a62d1055: (...args: any[]) => any;
68
68
  __wbg_parent_647e5f3765673032: (arg0: any) => any;
69
69
  __wbg_parse_211b75b6b50e2da5: (...args: any[]) => any;
70
- __wbg_parse_def2e24ef1252aff: (...args: any[]) => any;
71
70
  __wbg_previousSibling_0d5cdd5a811cedb2: (arg0: any) => any;
72
71
  __wbg_push_737cfc8c1432c2c6: (arg0: any, arg1: any) => any;
73
72
  __wbg_queueMicrotask_97d92b4fcc8a61c5: (arg0: any) => void;
@@ -94,13 +93,13 @@ export default function _default(): {
94
93
  __wbg_type_8c03f5de5dcc70e8: (arg0: any) => any;
95
94
  __wbg_value_cd1ffa7b1ab794f1: (arg0: any) => any;
96
95
  __wbg_walk_5a10ef3cc747c1a7: (arg0: any) => any;
97
- __wbg_warn_dec08065228a61fc: (arg0: any, arg1: any) => void;
96
+ __wbg_warn_77e725bc6baf77a6: (arg0: any, arg1: any) => void;
98
97
  __wbindgen_bigint_from_i64: (arg0: any) => any;
99
98
  __wbindgen_bigint_from_u64: (arg0: any) => bigint;
100
99
  __wbindgen_bigint_get_as_i64: (arg0: any, arg1: any) => void;
101
100
  __wbindgen_boolean_get: (arg0: any) => 0 | 1 | 2;
102
101
  __wbindgen_cb_drop: (arg0: any) => boolean;
103
- __wbindgen_closure_wrapper4820: (arg0: any, arg1: any, arg2: any) => {
102
+ __wbindgen_closure_wrapper6684: (arg0: any, arg1: any, arg2: any) => {
104
103
  (...args: any[]): any;
105
104
  original: {
106
105
  a: any;
@@ -332,10 +332,10 @@ export default function () {
332
332
  return takeFromExternrefTable0(ret[0]);
333
333
  }
334
334
  function __wbg_adapter_50(arg0, arg1, arg2) {
335
- wasm.closure1705_externref_shim(arg0, arg1, arg2);
335
+ wasm.closure2325_externref_shim(arg0, arg1, arg2);
336
336
  }
337
337
  function __wbg_adapter_200(arg0, arg1, arg2, arg3) {
338
- wasm.closure1727_externref_shim(arg0, arg1, arg2, arg3);
338
+ wasm.closure2347_externref_shim(arg0, arg1, arg2, arg3);
339
339
  }
340
340
  function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
341
341
  const ret = String(arg1);
@@ -345,7 +345,7 @@ export default function () {
345
345
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
346
346
  }
347
347
  ;
348
- function __wbg_atob_b687cf564517d11e(arg0, arg1, arg2) {
348
+ function __wbg_atob_410cd81516b5d2c0(arg0, arg1, arg2) {
349
349
  const ret = atob(getStringFromWasm0(arg1, arg2));
350
350
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
351
351
  const len1 = WASM_VECTOR_LEN;
@@ -353,7 +353,7 @@ export default function () {
353
353
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
354
354
  }
355
355
  ;
356
- function __wbg_btoa_f1cc8b23625c1733(arg0, arg1, arg2) {
356
+ function __wbg_btoa_607ab8a9e28af18a(arg0, arg1, arg2) {
357
357
  const ret = btoa(getStringFromWasm0(arg1, arg2));
358
358
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
359
359
  const len1 = WASM_VECTOR_LEN;
@@ -448,13 +448,13 @@ export default function () {
448
448
  return ret;
449
449
  }
450
450
  ;
451
- function __wbg_error_55b26df739c2fe8b(arg0, arg1) {
451
+ function __wbg_error_b70b501f8bfc3e9f(arg0, arg1) {
452
452
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
453
453
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
454
454
  console.error(...v0);
455
455
  }
456
456
  ;
457
- function __wbg_fetch_71724d6f0f8d9962(arg0, arg1, arg2, arg3) {
457
+ function __wbg_fetch_cfe126521bd5ab4d(arg0, arg1, arg2, arg3) {
458
458
  let deferred0_0;
459
459
  let deferred0_1;
460
460
  let deferred1_0;
@@ -618,7 +618,7 @@ export default function () {
618
618
  return ret;
619
619
  }
620
620
  ;
621
- function __wbg_log_b79a24d377a91090(arg0, arg1) {
621
+ function __wbg_log_82a1aa28dec023ca(arg0, arg1) {
622
622
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
623
623
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
624
624
  console.log(...v0);
@@ -716,13 +716,6 @@ export default function () {
716
716
  }, arguments);
717
717
  }
718
718
  ;
719
- function __wbg_parse_def2e24ef1252aff() {
720
- return handleError(function (arg0, arg1) {
721
- const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
722
- return ret;
723
- }, arguments);
724
- }
725
- ;
726
719
  function __wbg_previousSibling_0d5cdd5a811cedb2(arg0) {
727
720
  const ret = arg0.previousSibling;
728
721
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
@@ -852,7 +845,7 @@ export default function () {
852
845
  return ret;
853
846
  }
854
847
  ;
855
- function __wbg_warn_dec08065228a61fc(arg0, arg1) {
848
+ function __wbg_warn_77e725bc6baf77a6(arg0, arg1) {
856
849
  var v0 = getArrayJsValueFromWasm0(arg0, arg1).slice();
857
850
  wasm.__wbindgen_free(arg0, arg1 * 4, 4);
858
851
  console.warn(...v0);
@@ -891,8 +884,8 @@ export default function () {
891
884
  return ret;
892
885
  }
893
886
  ;
894
- function __wbindgen_closure_wrapper4820(arg0, arg1, arg2) {
895
- const ret = makeMutClosure(arg0, arg1, 1706, __wbg_adapter_50);
887
+ function __wbindgen_closure_wrapper6684(arg0, arg1, arg2) {
888
+ const ret = makeMutClosure(arg0, arg1, 2326, __wbg_adapter_50);
896
889
  return ret;
897
890
  }
898
891
  ;
@@ -1007,8 +1000,8 @@ export default function () {
1007
1000
  dumpASTNodes,
1008
1001
  dumpPattern,
1009
1002
  __wbg_String_8f0eb39a4a4c2f66,
1010
- __wbg_atob_b687cf564517d11e,
1011
- __wbg_btoa_f1cc8b23625c1733,
1003
+ __wbg_atob_410cd81516b5d2c0,
1004
+ __wbg_btoa_607ab8a9e28af18a,
1012
1005
  __wbg_buffer_609cc3eee51ed158,
1013
1006
  __wbg_call_672a4d21634d4a24,
1014
1007
  __wbg_call_7cccdd69e0791ae2,
@@ -1025,8 +1018,8 @@ export default function () {
1025
1018
  __wbg_endIndex_d3aa1552abc6599c,
1026
1019
  __wbg_endPosition_a4796193570eccbd,
1027
1020
  __wbg_entries_3265d4158b33e5dc,
1028
- __wbg_error_55b26df739c2fe8b,
1029
- __wbg_fetch_71724d6f0f8d9962,
1021
+ __wbg_error_b70b501f8bfc3e9f,
1022
+ __wbg_fetch_cfe126521bd5ab4d,
1030
1023
  __wbg_fieldIdForName_ed243dd7e35f4861,
1031
1024
  __wbg_from_2a5d3e218e67aa85,
1032
1025
  __wbg_get_67b2ba62fc30de12,
@@ -1050,7 +1043,7 @@ export default function () {
1050
1043
  __wbg_length_a446193dc22c12f8,
1051
1044
  __wbg_length_e2d2a49132c1b256,
1052
1045
  __wbg_load_ac005a13bbebdb0b,
1053
- __wbg_log_b79a24d377a91090,
1046
+ __wbg_log_82a1aa28dec023ca,
1054
1047
  __wbg_message_97a2af9b89d693a3,
1055
1048
  __wbg_namedChildCount_44a0f24db74f4d08,
1056
1049
  __wbg_new_23a2665fac83c611,
@@ -1065,7 +1058,6 @@ export default function () {
1065
1058
  __wbg_next_6574e1a8a62d1055,
1066
1059
  __wbg_parent_647e5f3765673032,
1067
1060
  __wbg_parse_211b75b6b50e2da5,
1068
- __wbg_parse_def2e24ef1252aff,
1069
1061
  __wbg_previousSibling_0d5cdd5a811cedb2,
1070
1062
  __wbg_push_737cfc8c1432c2c6,
1071
1063
  __wbg_queueMicrotask_97d92b4fcc8a61c5,
@@ -1092,13 +1084,13 @@ export default function () {
1092
1084
  __wbg_type_8c03f5de5dcc70e8,
1093
1085
  __wbg_value_cd1ffa7b1ab794f1,
1094
1086
  __wbg_walk_5a10ef3cc747c1a7,
1095
- __wbg_warn_dec08065228a61fc,
1087
+ __wbg_warn_77e725bc6baf77a6,
1096
1088
  __wbindgen_bigint_from_i64,
1097
1089
  __wbindgen_bigint_from_u64,
1098
1090
  __wbindgen_bigint_get_as_i64,
1099
1091
  __wbindgen_boolean_get,
1100
1092
  __wbindgen_cb_drop,
1101
- __wbindgen_closure_wrapper4820,
1093
+ __wbindgen_closure_wrapper6684,
1102
1094
  __wbindgen_debug_string,
1103
1095
  __wbindgen_error_new,
1104
1096
  __wbindgen_in,
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@codemod.com/codemod-sandbox",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Codemod Javascript Sandbox",
5
- "main": "./dist/src/index.js",
5
+ "main": "./dist/js/index.js",
6
6
  "exports": {
7
- ".": "./dist/src/index.js",
7
+ ".": "./dist/js/index.js",
8
8
  "./sandbox.wasm": "./sandbox.wasm",
9
- "./web": "./dist/src/web-exports.js",
10
- "./node": "./dist/src/node-exports.js"
9
+ "./web": "./dist/js/web-exports.js",
10
+ "./node": "./dist/js/node-exports.js"
11
11
  },
12
- "types": "dist/src/index.d.ts",
12
+ "types": "dist/js/index.d.ts",
13
13
  "type": "module",
14
14
  "scripts": {
15
15
  "prepack": "pnpm run build",
@@ -19,7 +19,7 @@
19
19
  "build:tsc": "pnpm run generate-type-declarations && tsc --project tsconfig.build.json --pretty",
20
20
  "build:runtime": "pnpm run copy-runtime-files",
21
21
  "build": "pnpm run build:runtime && pnpm run build:tsc",
22
- "lint": "pnpm run build:tsc && eslint src/ --ext .ts",
22
+ "lint": "pnpm run build:tsc && eslint js/ --ext .ts",
23
23
  "test": "pnpm run build && node --test --enable-source-maps --test-reporter spec dist/tests/*.js"
24
24
  },
25
25
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "url": "https://github.com/codemod-com/codemod"
28
28
  },
29
29
  "files": [
30
- "dist/src",
30
+ "dist/js",
31
31
  "sandbox.wasm"
32
32
  ],
33
33
  "keywords": [],
package/sandbox.wasm CHANGED
Binary file
@@ -1,16 +0,0 @@
1
- export { Telemetry };
2
- interface TelemetryConfig {
3
- enabled?: boolean;
4
- path?: number[];
5
- }
6
- declare class Telemetry {
7
- private readonly config;
8
- private operationCounter;
9
- static create(config: TelemetryConfig): undefined;
10
- constructor(config: TelemetryConfig);
11
- startModule(): Promise<void>;
12
- startCapability(): Promise<number>;
13
- endCapability(): Promise<void>;
14
- endModule(): Promise<void>;
15
- invocationPath(path: number): number[];
16
- }
@@ -1,28 +0,0 @@
1
- // Simplified telemetry implementation - functionality removed per requirements
2
- export { Telemetry };
3
- class Telemetry {
4
- config;
5
- operationCounter = 0;
6
- static create(config) {
7
- // Always return undefined to effectively disable telemetry
8
- return undefined;
9
- }
10
- constructor(config) {
11
- this.config = { enabled: false, ...config };
12
- }
13
- async startModule() {
14
- // No-op implementation
15
- }
16
- async startCapability() {
17
- return ++this.operationCounter;
18
- }
19
- async endCapability() {
20
- // No-op implementation
21
- }
22
- async endModule() {
23
- // No-op implementation
24
- }
25
- invocationPath(path) {
26
- return [...(this.config.path || []), path];
27
- }
28
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,6 +1,6 @@
1
- import { ConsoleStdout, OpenFile, WASI, File as WasiFile, } from "@bjorn3/browser_wasi_shim";
2
1
  import { readFile } from "node:fs/promises";
3
2
  import { fileURLToPath } from "node:url";
3
+ import { ConsoleStdout, OpenFile, WASI, File as WasiFile, } from "@bjorn3/browser_wasi_shim";
4
4
  import factory from "./factory.js";
5
5
  export { NodeSandbox };
6
6
  async function loadWasmRuntime() {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes