@wasm-idle/debug 1.0.0-next.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.
Files changed (50) hide show
  1. package/README.md +12 -0
  2. package/dist/controller.d.ts +44 -0
  3. package/dist/controller.d.ts.map +1 -0
  4. package/dist/controller.js +273 -0
  5. package/dist/controller.js.map +1 -0
  6. package/dist/editor/index.d.ts +3 -0
  7. package/dist/editor/index.d.ts.map +1 -0
  8. package/dist/editor/index.js +2 -0
  9. package/dist/editor/index.js.map +1 -0
  10. package/dist/editor/monaco.d.ts +27 -0
  11. package/dist/editor/monaco.d.ts.map +1 -0
  12. package/dist/editor/monaco.js +131 -0
  13. package/dist/editor/monaco.js.map +1 -0
  14. package/dist/expression.d.ts +27 -0
  15. package/dist/expression.d.ts.map +1 -0
  16. package/dist/expression.js +548 -0
  17. package/dist/expression.js.map +1 -0
  18. package/dist/index.d.ts +9 -0
  19. package/dist/index.d.ts.map +1 -0
  20. package/dist/index.js +6 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/language/cpp.d.ts +3 -0
  23. package/dist/language/cpp.d.ts.map +1 -0
  24. package/dist/language/cpp.js +8 -0
  25. package/dist/language/cpp.js.map +1 -0
  26. package/dist/language/go.d.ts +3 -0
  27. package/dist/language/go.d.ts.map +1 -0
  28. package/dist/language/go.js +8 -0
  29. package/dist/language/go.js.map +1 -0
  30. package/dist/language/index.d.ts +6 -0
  31. package/dist/language/index.d.ts.map +1 -0
  32. package/dist/language/index.js +5 -0
  33. package/dist/language/index.js.map +1 -0
  34. package/dist/language/python.d.ts +3 -0
  35. package/dist/language/python.d.ts.map +1 -0
  36. package/dist/language/python.js +15 -0
  37. package/dist/language/python.js.map +1 -0
  38. package/dist/language/rust.d.ts +3 -0
  39. package/dist/language/rust.d.ts.map +1 -0
  40. package/dist/language/rust.js +8 -0
  41. package/dist/language/rust.js.map +1 -0
  42. package/dist/language/types.d.ts +7 -0
  43. package/dist/language/types.d.ts.map +1 -0
  44. package/dist/language/types.js +2 -0
  45. package/dist/language/types.js.map +1 -0
  46. package/dist/locals.d.ts +3 -0
  47. package/dist/locals.d.ts.map +1 -0
  48. package/dist/locals.js +9 -0
  49. package/dist/locals.js.map +1 -0
  50. package/package.json +67 -0
@@ -0,0 +1,6 @@
1
+ export { cppDebugLanguageAdapter } from './cpp.js';
2
+ export { goDebugLanguageAdapter } from './go.js';
3
+ export { pythonDebugLanguageAdapter } from './python.js';
4
+ export { rustDebugLanguageAdapter } from './rust.js';
5
+ export type { DebugLanguageAdapter } from './types.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/language/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { cppDebugLanguageAdapter } from './cpp.js';
2
+ export { goDebugLanguageAdapter } from './go.js';
3
+ export { pythonDebugLanguageAdapter } from './python.js';
4
+ export { rustDebugLanguageAdapter } from './rust.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/language/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DebugLanguageAdapter } from './types.js';
2
+ export declare const pythonDebugLanguageAdapter: DebugLanguageAdapter;
3
+ //# sourceMappingURL=python.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../src/language/python.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAWvD,eAAO,MAAM,0BAA0B,EAAE,oBAIxC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { evaluateDebugExpression } from '../expression.js';
2
+ const selectInlinePythonLocals = (lineText, locals) => {
3
+ const sanitized = lineText
4
+ .replace(/#.*$/g, ' ')
5
+ .replace(/"(?:\\.|[^"\\])*"/g, ' ')
6
+ .replace(/'(?:\\.|[^'\\])*'/g, ' ');
7
+ const identifiers = new Set(sanitized.match(/[A-Za-z_]\w*/g) || []);
8
+ return locals.filter((variable) => identifiers.has(variable.name));
9
+ };
10
+ export const pythonDebugLanguageAdapter = {
11
+ id: 'python',
12
+ evaluateExpression: evaluateDebugExpression,
13
+ selectInlineLocals: selectInlinePythonLocals
14
+ };
15
+ //# sourceMappingURL=python.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python.js","sourceRoot":"","sources":["../../src/language/python.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAG3D,MAAM,wBAAwB,GAAG,CAAC,QAAgB,EAAE,MAAuB,EAAE,EAAE;IAC9E,MAAM,SAAS,GAAG,QAAQ;SACxB,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;SACrB,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC;SAClC,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAyB;IAC/D,EAAE,EAAE,QAAQ;IACZ,kBAAkB,EAAE,uBAAuB;IAC3C,kBAAkB,EAAE,wBAAwB;CAC5C,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { DebugLanguageAdapter } from './types.js';
2
+ export declare const rustDebugLanguageAdapter: DebugLanguageAdapter;
3
+ //# sourceMappingURL=rust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rust.d.ts","sourceRoot":"","sources":["../../src/language/rust.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAEvD,eAAO,MAAM,wBAAwB,EAAE,oBAItC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { evaluateDebugExpression } from '../expression.js';
2
+ import { selectInlineDebugLocals } from '../locals.js';
3
+ export const rustDebugLanguageAdapter = {
4
+ id: 'rust',
5
+ evaluateExpression: evaluateDebugExpression,
6
+ selectInlineLocals: selectInlineDebugLocals
7
+ };
8
+ //# sourceMappingURL=rust.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rust.js","sourceRoot":"","sources":["../../src/language/rust.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAGvD,MAAM,CAAC,MAAM,wBAAwB,GAAyB;IAC7D,EAAE,EAAE,MAAM;IACV,kBAAkB,EAAE,uBAAuB;IAC3C,kBAAkB,EAAE,uBAAuB;CAC3C,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { DebugVariable } from '@wasm-idle/core';
2
+ export interface DebugLanguageAdapter {
3
+ id: string;
4
+ evaluateExpression: (expression: string, locals: DebugVariable[]) => string;
5
+ selectInlineLocals: (lineText: string, locals: DebugVariable[]) => DebugVariable[];
6
+ }
7
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/language/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,oBAAoB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,MAAM,CAAC;IAC5E,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,CAAC;CACnF"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/language/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import type { DebugVariable } from '@wasm-idle/core';
2
+ export declare function selectInlineDebugLocals(lineText: string, locals: DebugVariable[]): DebugVariable[];
3
+ //# sourceMappingURL=locals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locals.d.ts","sourceRoot":"","sources":["../src/locals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,mBAOhF"}
package/dist/locals.js ADDED
@@ -0,0 +1,9 @@
1
+ export function selectInlineDebugLocals(lineText, locals) {
2
+ const sanitized = lineText
3
+ .replace(/\/\/.*$/g, ' ')
4
+ .replace(/"(?:\\.|[^"\\])*"/g, ' ')
5
+ .replace(/'(?:\\.|[^'\\])*'/g, ' ');
6
+ const identifiers = new Set(sanitized.match(/[A-Za-z_]\w*/g) || []);
7
+ return locals.filter((variable) => identifiers.has(variable.name));
8
+ }
9
+ //# sourceMappingURL=locals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locals.js","sourceRoot":"","sources":["../src/locals.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,uBAAuB,CAAC,QAAgB,EAAE,MAAuB;IAChF,MAAM,SAAS,GAAG,QAAQ;SACxB,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC;SAClC,OAAO,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC;IACrC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;IACpE,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;AACpE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@wasm-idle/debug",
3
+ "version": "1.0.0-next.0",
4
+ "description": "Optional debugger UI and controller utilities for wasm-idle",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./controller": {
14
+ "types": "./dist/controller.d.ts",
15
+ "import": "./dist/controller.js",
16
+ "default": "./dist/controller.js"
17
+ },
18
+ "./editor": {
19
+ "types": "./dist/editor/index.d.ts",
20
+ "import": "./dist/editor/index.js",
21
+ "default": "./dist/editor/index.js"
22
+ },
23
+ "./language": {
24
+ "types": "./dist/language/index.d.ts",
25
+ "import": "./dist/language/index.js",
26
+ "default": "./dist/language/index.js"
27
+ },
28
+ "./expression": {
29
+ "types": "./dist/expression.d.ts",
30
+ "import": "./dist/expression.js",
31
+ "default": "./dist/expression.js"
32
+ }
33
+ },
34
+ "files": [
35
+ "dist",
36
+ "README.md"
37
+ ],
38
+ "publishConfig": {
39
+ "access": "public",
40
+ "tag": "next"
41
+ },
42
+ "peerDependencies": {
43
+ "@wasm-idle/core": "1.0.0-next.0",
44
+ "monaco-editor": "^0.55.0",
45
+ "svelte": "^5.0.0"
46
+ },
47
+ "peerDependenciesMeta": {
48
+ "monaco-editor": {
49
+ "optional": true
50
+ }
51
+ },
52
+ "dependencies": {
53
+ "@wasm-idle/core": "1.0.0-next.0"
54
+ },
55
+ "devDependencies": {
56
+ "jsdom": "^29.0.2",
57
+ "monaco-editor": "^0.55.1",
58
+ "svelte": "^5.55.4",
59
+ "typescript": "^6.0.2",
60
+ "vitest": "^4.1.4"
61
+ },
62
+ "scripts": {
63
+ "build": "rm -rf dist && tsc -p tsconfig.json",
64
+ "check": "tsc -p tsconfig.json --noEmit",
65
+ "test": "vitest run"
66
+ }
67
+ }