@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.
- package/README.md +12 -0
- package/dist/controller.d.ts +44 -0
- package/dist/controller.d.ts.map +1 -0
- package/dist/controller.js +273 -0
- package/dist/controller.js.map +1 -0
- package/dist/editor/index.d.ts +3 -0
- package/dist/editor/index.d.ts.map +1 -0
- package/dist/editor/index.js +2 -0
- package/dist/editor/index.js.map +1 -0
- package/dist/editor/monaco.d.ts +27 -0
- package/dist/editor/monaco.d.ts.map +1 -0
- package/dist/editor/monaco.js +131 -0
- package/dist/editor/monaco.js.map +1 -0
- package/dist/expression.d.ts +27 -0
- package/dist/expression.d.ts.map +1 -0
- package/dist/expression.js +548 -0
- package/dist/expression.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/language/cpp.d.ts +3 -0
- package/dist/language/cpp.d.ts.map +1 -0
- package/dist/language/cpp.js +8 -0
- package/dist/language/cpp.js.map +1 -0
- package/dist/language/go.d.ts +3 -0
- package/dist/language/go.d.ts.map +1 -0
- package/dist/language/go.js +8 -0
- package/dist/language/go.js.map +1 -0
- package/dist/language/index.d.ts +6 -0
- package/dist/language/index.d.ts.map +1 -0
- package/dist/language/index.js +5 -0
- package/dist/language/index.js.map +1 -0
- package/dist/language/python.d.ts +3 -0
- package/dist/language/python.d.ts.map +1 -0
- package/dist/language/python.js +15 -0
- package/dist/language/python.js.map +1 -0
- package/dist/language/rust.d.ts +3 -0
- package/dist/language/rust.d.ts.map +1 -0
- package/dist/language/rust.js +8 -0
- package/dist/language/rust.js.map +1 -0
- package/dist/language/types.d.ts +7 -0
- package/dist/language/types.d.ts.map +1 -0
- package/dist/language/types.js +2 -0
- package/dist/language/types.js.map +1 -0
- package/dist/locals.d.ts +3 -0
- package/dist/locals.d.ts.map +1 -0
- package/dist/locals.js +9 -0
- package/dist/locals.js.map +1 -0
- 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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
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 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/language/types.ts"],"names":[],"mappings":""}
|
package/dist/locals.d.ts
ADDED
|
@@ -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
|
+
}
|