wasm-idle 1.1.2 → 1.3.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 (136) hide show
  1. package/README.md +211 -91
  2. package/dist/container/bash-profile.d.ts +80 -0
  3. package/dist/container/bash-profile.js +328 -0
  4. package/dist/{playground/container → container}/binding.d.ts +21 -8
  5. package/dist/{playground/container → container}/binding.js +109 -25
  6. package/dist/{playground/container → container}/clang-runtime.d.ts +11 -7
  7. package/dist/container/clang-runtime.js +561 -0
  8. package/dist/container/client.d.ts +14 -0
  9. package/dist/{playground/container → container}/client.js +2 -6
  10. package/dist/{playground/container → container}/explorer.d.ts +1 -1
  11. package/dist/container/index.d.ts +11 -0
  12. package/dist/container/index.js +11 -0
  13. package/dist/container/owner-worker.d.ts +19 -0
  14. package/dist/container/owner-worker.js +464 -0
  15. package/dist/{playground/container → container}/protocol.d.ts +12 -1
  16. package/dist/{playground/container → container}/runtime-adapter.d.ts +13 -11
  17. package/dist/{playground/container → container}/runtime-adapter.js +104 -41
  18. package/dist/{playground/container → container}/shell-control.d.ts +2 -2
  19. package/dist/{playground/container → container}/shell-control.js +93 -36
  20. package/dist/{playground/container → container}/workspace.d.ts +5 -1
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.js +1 -0
  23. package/dist/playground/assetBridge.js +5 -2
  24. package/dist/playground/assets.d.ts +8 -0
  25. package/dist/playground/clang.d.ts +5 -1
  26. package/dist/playground/clang.js +61 -5
  27. package/dist/playground/compiledLldb.d.ts +41 -0
  28. package/dist/playground/compiledLldb.js +167 -0
  29. package/dist/playground/d.d.ts +4 -1
  30. package/dist/playground/d.js +78 -9
  31. package/dist/playground/debugDeadline.d.ts +12 -0
  32. package/dist/playground/debugDeadline.js +34 -0
  33. package/dist/playground/debugMailbox.d.ts +12 -0
  34. package/dist/playground/debugMailbox.js +77 -0
  35. package/dist/playground/go.js +9 -4
  36. package/dist/playground/goDebugInstrumentation.js +24 -44
  37. package/dist/playground/java-debug-HUZVAK4F.js +124 -0
  38. package/dist/playground/java-debug-notices.txt +492 -0
  39. package/dist/playground/java.d.ts +17 -1
  40. package/dist/playground/java.js +159 -3
  41. package/dist/playground/javaDebug.d.ts +62 -0
  42. package/dist/playground/javaDebug.js +305 -0
  43. package/dist/playground/javaDebugBridge.d.ts +6 -0
  44. package/dist/playground/javaDebugBridge.js +250 -0
  45. package/dist/playground/javaDebugSource.d.ts +9 -0
  46. package/dist/playground/javaDebugSource.js +4 -0
  47. package/dist/playground/javaRuntimeErrors.js +34 -1
  48. package/dist/playground/lean4Assets.d.ts +1 -25
  49. package/dist/playground/lean4Assets.js +2 -123
  50. package/dist/playground/lfortranAssets.d.ts +2 -2
  51. package/dist/playground/lldbSession.d.ts +24 -2
  52. package/dist/playground/lldbSession.js +322 -59
  53. package/dist/playground/lldbSourcePath.d.ts +2 -0
  54. package/dist/playground/lldbSourcePath.js +9 -0
  55. package/dist/playground/lua.d.ts +20 -1
  56. package/dist/playground/lua.js +190 -8
  57. package/dist/playground/luaDebug.d.ts +1 -0
  58. package/dist/playground/luaDebug.js +1 -0
  59. package/dist/playground/nim.d.ts +1 -0
  60. package/dist/playground/nim.js +8 -0
  61. package/dist/playground/objectivec.d.ts +7 -6
  62. package/dist/playground/objectivec.js +75 -9
  63. package/dist/playground/options.d.ts +10 -4
  64. package/dist/playground/python.d.ts +11 -1
  65. package/dist/playground/python.js +203 -8
  66. package/dist/playground/pythonCompileOptions.d.ts +49 -0
  67. package/dist/playground/pythonCompileOptions.js +40 -0
  68. package/dist/playground/ruby.d.ts +10 -1
  69. package/dist/playground/ruby.js +66 -1
  70. package/dist/playground/rubyDebug.d.ts +21 -0
  71. package/dist/playground/rubyDebug.js +128 -0
  72. package/dist/playground/rust.d.ts +5 -1
  73. package/dist/playground/rust.js +128 -46
  74. package/dist/playground/sandbox.d.ts +8 -1
  75. package/dist/playground/staticRuntimeModuleVersion.d.ts +1 -1
  76. package/dist/playground/staticRuntimeModuleVersion.js +1 -1
  77. package/dist/playground/staticWorkerRuntime.js +8 -2
  78. package/dist/playground/stdinBuffer.d.ts +1 -1
  79. package/dist/playground/stdinBuffer.js +19 -2
  80. package/dist/playground/tinygo.js +7 -0
  81. package/dist/playground/typescript.js +8 -0
  82. package/dist/playground/v.d.ts +3 -2
  83. package/dist/playground/v.js +66 -12
  84. package/dist/playground/wasmC3Version.d.ts +2 -2
  85. package/dist/playground/wasmC3Version.js +2 -2
  86. package/dist/playground/wasmDebugVersion.d.ts +1 -1
  87. package/dist/playground/wasmDebugVersion.js +1 -1
  88. package/dist/playground/wasmLean4Version.d.ts +1 -110
  89. package/dist/playground/wasmLean4Version.js +2 -111
  90. package/dist/playground/wasmLfortranVersion.d.ts +2 -2
  91. package/dist/playground/wasmLfortranVersion.js +2 -2
  92. package/dist/playground/wasmLuaVersion.d.ts +1 -1
  93. package/dist/playground/wasmLuaVersion.js +1 -1
  94. package/dist/playground/wasmPrologVersion.d.ts +17 -17
  95. package/dist/playground/wasmPrologVersion.js +16 -16
  96. package/dist/playground/wasmRustVersion.d.ts +26 -38
  97. package/dist/playground/wasmRustVersion.js +25 -40
  98. package/dist/playground/wasmTypeScriptVersion.d.ts +3 -3
  99. package/dist/playground/wasmTypeScriptVersion.js +3 -3
  100. package/dist/playground/worker/clang.js +1 -1
  101. package/dist/playground/worker/cobol.js +1 -1
  102. package/dist/playground/worker/d.js +51 -2
  103. package/dist/playground/worker/fortran.js +1 -1
  104. package/dist/playground/worker/java.js +188 -35
  105. package/dist/playground/worker/javaDebugEvaluator.d.ts +16 -0
  106. package/dist/playground/worker/javaDebugEvaluator.js +44 -0
  107. package/dist/playground/worker/javaDebugRuntime.d.ts +24 -0
  108. package/dist/playground/worker/javaDebugRuntime.js +315 -0
  109. package/dist/playground/worker/javaOutput.d.ts +11 -0
  110. package/dist/playground/worker/javaOutput.js +54 -0
  111. package/dist/playground/worker/lua.js +13 -0
  112. package/dist/playground/worker/python.js +81 -23
  113. package/dist/playground/worker/pythonCompile.d.ts +4 -0
  114. package/dist/playground/worker/pythonCompile.js +122 -0
  115. package/dist/playground/worker/ruby.js +13 -0
  116. package/dist/playground/worker/rubyDebugPreview.d.ts +2 -0
  117. package/dist/playground/worker/rubyDebugPreview.js +80 -0
  118. package/dist/playground/worker/rubyTracepoint.d.ts +16 -0
  119. package/dist/playground/worker/rubyTracepoint.js +162 -0
  120. package/dist/playground/worker/rust.js +4 -1
  121. package/dist/playground/worker/v.js +30 -5
  122. package/dist/playground/zig.js +4 -0
  123. package/dist/pythonCompiler.d.ts +8 -0
  124. package/dist/pythonCompiler.js +52 -0
  125. package/package.json +76 -28
  126. package/dist/playground/container/ContainerExplorer.svelte +0 -307
  127. package/dist/playground/container/ContainerExplorer.svelte.d.ts +0 -14
  128. package/dist/playground/container/clang-runtime.js +0 -343
  129. package/dist/playground/container/client.d.ts +0 -15
  130. package/dist/playground/container/owner.worker.d.ts +0 -1
  131. package/dist/playground/container/owner.worker.js +0 -390
  132. package/dist/playground/container/release.d.ts +0 -31
  133. package/dist/playground/container/release.js +0 -612
  134. /package/dist/{playground/container → container}/explorer.js +0 -0
  135. /package/dist/{playground/container → container}/protocol.js +0 -0
  136. /package/dist/{playground/container → container}/workspace.js +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wasm-idle",
3
- "version": "1.1.2",
3
+ "version": "1.3.0",
4
4
  "description": "A simple web app to run code in the browser",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,63 +17,74 @@
17
17
  "@eslint/js": "^10.0.1",
18
18
  "@sveltejs/adapter-auto": "^8.0.0",
19
19
  "@sveltejs/adapter-static": "^4.0.0",
20
- "@sveltejs/kit": "^3.0.1",
21
- "@sveltejs/package": "^3.0.0",
20
+ "@sveltejs/kit": "^3.1.0",
21
+ "@sveltejs/package": "^3.0.1",
22
22
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
23
23
  "@testing-library/svelte": "^5.4.2",
24
- "@testing-library/user-event": "^14.6.7",
24
+ "@testing-library/user-event": "^14.6.8",
25
25
  "@assemblyscript/loader": "0.28.20",
26
26
  "@duckdb/duckdb-wasm": "1.33.1-dev57.0",
27
- "@electric-sql/pglite": "0.5.8",
27
+ "@electric-sql/pglite": "0.5.11",
28
28
  "@live-codes/gleam-precompiled": "0.5.0",
29
29
  "@ruby/3.4-wasm-wasi": "2.10.1",
30
30
  "@ruby/wasm-wasi": "2.10.1",
31
31
  "@seorii/monaco": "0.2.0",
32
32
  "@swmansion/popcorn": "0.3.3",
33
- "@types/node": "^24.19.1",
33
+ "@types/node": "^24.19.2",
34
34
  "@types/sql.js": "^1.4.11",
35
- "@typescript-eslint/eslint-plugin": "^8.71.1",
36
- "@typescript-eslint/parser": "^8.71.1",
37
- "@wasm-idle/container": "0.1.1",
38
- "@wasm-idle/debug": "1.1.2",
39
- "@wasm-idle/lsp": "1.1.2",
40
- "@wasm-idle/terminal": "1.1.2",
35
+ "@typescript-eslint/eslint-plugin": "^8.72.0",
36
+ "@typescript-eslint/parser": "^8.72.0",
37
+ "@wasm-idle/container": "0.2.1",
38
+ "@wasm-idle/debug": "1.3.0",
39
+ "@wasm-idle/gcc": "1.3.0",
40
+ "@wasm-idle/lsp": "1.3.0",
41
+ "@wasm-idle/terminal": "1.3.0",
41
42
  "@wasmer/sdk": "0.10.0",
42
43
  "assemblyscript": "0.28.20",
43
44
  "esbuild": "0.28.2",
44
- "eslint": "^10.12.0",
45
+ "eslint": "^10.13.0",
45
46
  "eslint-config-prettier": "^10.1.8",
46
- "eslint-plugin-svelte": "^3.23.0",
47
+ "eslint-plugin-svelte": "^3.23.1",
47
48
  "eslint-plugin-svelte3": "^4.0.0",
48
49
  "gh-pages": "^6.3.0",
49
50
  "globals": "^17.13.0",
50
- "jsdom": "^30.1.2",
51
+ "jsdom": "^30.1.3",
52
+ "java-parser": "3.0.1",
51
53
  "monaco-editor": "^0.55.1",
52
- "playwright-core": "^1.63.0",
53
- "prettier": "^3.9.9",
54
+ "playwright-core": "^1.64.1",
55
+ "prettier": "^3.9.10",
54
56
  "prettier-plugin-svelte": "^4.1.1",
55
57
  "publint": "^0.3.25",
56
58
  "pyodide": "314.0.7",
57
- "sql.js": "^1.14.2",
59
+ "sql.js": "^1.15.1",
58
60
  "svelte": "^5.57.2",
59
- "svelte-check": "^4.7.6",
60
- "swipl-wasm": "8.2.1",
61
+ "svelte-check": "^4.7.7",
62
+ "swipl-wasm": "8.2.5",
61
63
  "tslib": "^2.8.1",
62
64
  "typescript": "^6.0.3",
63
- "typescript-eslint": "^8.71.1",
65
+ "typescript-eslint": "^8.72.0",
64
66
  "vite": "^8.3.3",
65
- "vitest": "^5.0.3",
67
+ "vitest": "^5.0.5",
66
68
  "waforth": "0.20.1",
67
69
  "webr": "0.6.0"
68
70
  },
69
71
  "dependencies": {
70
72
  "@bjorn3/browser_wasi_shim": "^0.4.2",
71
- "@wasm-idle/core": "1.1.2",
72
- "@wasm-idle/llvm-core": "1.1.2",
73
+ "@wasm-idle/core": "1.3.0",
74
+ "@wasm-idle/llvm-core": "1.3.0",
73
75
  "fflate": "0.8.3"
74
76
  },
77
+ "peerDependencies": {
78
+ "@wasm-idle/container": "0.2.1"
79
+ },
80
+ "peerDependenciesMeta": {
81
+ "@wasm-idle/container": {
82
+ "optional": true
83
+ }
84
+ },
75
85
  "files": [
76
86
  "dist",
87
+ "!dist/playground/container/**",
77
88
  "!dist/test-fixtures/**",
78
89
  "!dist/**/*.test.*",
79
90
  "!dist/**/*.spec.*",
@@ -88,11 +99,18 @@
88
99
  "svelte": "./dist/index.js",
89
100
  "import": "./dist/index.js",
90
101
  "default": "./dist/index.js"
102
+ },
103
+ "./container": {
104
+ "types": "./dist/container/index.d.ts",
105
+ "import": "./dist/container/index.js",
106
+ "default": "./dist/container/index.js"
91
107
  }
92
108
  },
93
109
  "svelte": "./dist/index.js",
94
110
  "types": "./dist/index.d.ts",
95
111
  "scripts": {
112
+ "sync:phpantom-lsp": "node scripts/sync-phpantom-lsp.mjs",
113
+ "test:lsp:browser:php": "WASM_IDLE_RUN_REAL_BROWSER_PHP_LSP=1 node --test scripts/phpantom-lsp.browser.test.mjs",
96
114
  "dev": "pnpm run prepare:app && vite dev",
97
115
  "build:preview": "pnpm run prepare:app && vite build",
98
116
  "build": "pnpm run prepare:app && vite build && pnpm run package:root",
@@ -118,6 +136,10 @@
118
136
  "test:swift-target-consumer": "node --test scripts/probe-swift-target-consumer.test.mjs",
119
137
  "sync:pyodide": "node scripts/sync-pyodide.mjs",
120
138
  "test:browser:clang-stdin": "WASM_IDLE_RUN_REAL_BROWSER_CLANG_STDIN=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts",
139
+ "test:browser:compiler-options": "WASM_IDLE_REQUIRE_BROWSER_TESTS=1 WASM_IDLE_RUN_REAL_BROWSER_COMPILER_OPTIONS=1 pnpm exec vitest run src/routes/compiler-options.playwright.test.ts",
140
+ "test:browser:gcc-worker-contract": "WASM_IDLE_RUN_GCC_WORKER_BROWSER=1 node --test scripts/gcc-worker-contract.browser.test.mjs",
141
+ "fuzz:gcc-contract": "node scripts/gcc-contract-fuzz.mjs",
142
+ "fuzz:gcc-browser": "node scripts/fuzz-x86-cross-gcc.mjs",
121
143
  "test:browser:fortran": "WASM_IDLE_RUN_REAL_BROWSER_FORTRAN=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts",
122
144
  "test:browser:cobol": "WASM_IDLE_RUN_REAL_BROWSER_COBOL=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts",
123
145
  "test:browser:v": "WASM_IDLE_RUN_REAL_BROWSER_V=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts -t \"V \"",
@@ -159,6 +181,8 @@
159
181
  "sync:runtime": "node scripts/sync-runtime.mjs",
160
182
  "sync:runtimes": "node scripts/sync-runtime.mjs all",
161
183
  "sync:wasm-php": "node scripts/sync-wasm-php.mjs",
184
+ "sync:postgresql-lsp": "node scripts/sync-postgresql-lsp.mjs",
185
+ "test:lsp:browser:postgresql": "pnpm run sync:postgresql-lsp && WASM_IDLE_RUN_POSTGRESQL_LSP_BROWSER=1 pnpm --dir packages/lsp exec vitest run test/postgresql.playwright.test.ts",
162
186
  "verify:wasm-php": "node scripts/verify-wasm-php-assets.mjs",
163
187
  "sync:wasm-clang": "node scripts/sync-wasm-clang.mjs",
164
188
  "sync:wasm-fortran": "node scripts/sync-runtime.mjs wasm-fortran",
@@ -181,6 +205,8 @@
181
205
  "sync:wasm-lisp": "node scripts/sync-runtime.mjs wasm-lisp",
182
206
  "sync:wasm-ruby": "node scripts/sync-runtime.mjs wasm-ruby",
183
207
  "sync:wasm-teavm": "node scripts/sync-wasm-teavm.mjs",
208
+ "build:java-lsp": "python3 producers/javacs-teavm/build.py",
209
+ "sync:java-lsp": "node scripts/sync-javacs-teavm-lsp.mjs",
184
210
  "sync:wasm-tinygo": "node scripts/sync-runtime.mjs wasm-tinygo",
185
211
  "sync:wasm-swift": "node scripts/sync-runtime.mjs wasm-swift",
186
212
  "sync:wasm-elixir": "node scripts/sync-runtime.mjs wasm-elixir",
@@ -217,9 +243,9 @@
217
243
  "build:static-runtime-modules": "node scripts/build-static-runtime-modules.mjs",
218
244
  "support:matrix": "node scripts/support-matrix.mjs write",
219
245
  "check:support-matrix": "node scripts/support-matrix.mjs check",
220
- "sync:page-runtimes": "pnpm run sync:pyodide && pnpm run sync:webr && pnpm run sync:wasm-of-js-of-ocaml && pnpm run sync:wasm-typescript && pnpm run sync:wasm-octave && pnpm run sync:wasm-prolog && pnpm run sync:wasm-gleam && pnpm run sync:wasm-perl && pnpm run sync:wasm-tcl && pnpm run sync:wasm-awk && pnpm run sync:wasm-pascal && pnpm run sync:wasm-forth && pnpm run sync:wasm-j && pnpm run sync:wasm-bqn && pnpm run sync:wasm-janet && pnpm run sync:wasm-julia && pnpm run sync:wasm-nim && pnpm run sync:wasm-ruby && pnpm run sync:wasm-bash && pnpm run sync:wasm-clojurescript && pnpm run sync:wasm-rescript",
221
- "page:build": "pnpm run verify:page-c3 && pnpm run verify:page-lfortran && pnpm run sync:wasm-lean4 && pnpm run prepare:test-assets -- clang && pnpm run build:page-runtimes && pnpm run sync:page-runtimes && pnpm run build:static-runtime-modules && pnpm run prepare:wasm-debug-release && pnpm run sync:wasm-commonlisp && pnpm run layer:static-runtimes && pnpm run compress:static-runtimes && pnpm run assets:lock && pnpm run check:assets-lock && pnpm run prepare:page-container && pnpm run build && pnpm run compress:build-runtimes && pnpm run verify:page-c3 build && pnpm run verify:page-lfortran build",
222
- "package:root": "svelte-kit sync && node scripts/clean-package-output.mjs && svelte-package --tsconfig ./tsconfig.package.json && publint",
246
+ "sync:page-runtimes": "pnpm run build:java-lsp && pnpm run sync:java-lsp && pnpm run sync:postgresql-lsp && pnpm run sync:bash-lsp && pnpm run sync:cobol-lsp && pnpm run sync:nim-lsp && pnpm run sync:pyodide && pnpm run sync:webr && pnpm run sync:wasm-of-js-of-ocaml && pnpm run sync:wasm-typescript && pnpm run sync:wasm-octave && pnpm run sync:wasm-prolog && pnpm run sync:wasm-gleam && pnpm run sync:wasm-perl && pnpm run sync:wasm-tcl && pnpm run sync:wasm-awk && pnpm run sync:wasm-pascal && pnpm run sync:wasm-forth && pnpm run sync:wasm-j && pnpm run sync:wasm-bqn && pnpm run sync:wasm-janet && pnpm run sync:wasm-julia && pnpm run sync:wasm-nim && pnpm run sync:wasm-ruby && pnpm run sync:wasm-bash && pnpm run sync:wasm-clojurescript && pnpm run sync:wasm-rescript && pnpm run sync:fennel-lsp && pnpm run sync:grain-lsp && pnpm run sync:rescript-lsp",
247
+ "page:build": "pnpm run sync:phpantom-lsp && pnpm run sync:forth-lsp && pnpm run sync:c3-lsp && pnpm run sync:v-lsp && pnpm run verify:page-c3 && pnpm run verify:page-lfortran && pnpm run sync:wasm-lean4 && pnpm run prepare:test-assets -- clang && pnpm run build:page-runtimes && pnpm run sync:page-runtimes && pnpm run build:static-runtime-modules && pnpm run prepare:wasm-debug-release && pnpm run sync:wasm-commonlisp && pnpm run layer:static-runtimes && pnpm run compress:static-runtimes && pnpm run assets:lock && pnpm run check:assets-lock && pnpm run prepare:page-container && pnpm run build && pnpm run compress:build-runtimes && pnpm run verify:page-c3 build && pnpm run verify:page-lfortran build",
248
+ "package:root": "svelte-kit sync && node scripts/clean-package-output.mjs && svelte-package --tsconfig ./tsconfig.package.json && node scripts/bundle-java-debug-helpers.mjs && publint",
223
249
  "package": "pnpm run build:publish-deps && pnpm run package:root",
224
250
  "verify:package": "node scripts/verify-package.mjs",
225
251
  "release:npm": "node scripts/release-npm.mjs",
@@ -275,6 +301,28 @@
275
301
  "prepare:container-distribution": "node scripts/prepare-container-distribution.mjs",
276
302
  "verify:container-distribution": "node scripts/verify-container-distribution.mjs",
277
303
  "test:container-distribution": "node --test scripts/container-distribution.test.mjs",
278
- "benchmark:container": "node scripts/benchmark-container.mjs"
304
+ "benchmark:container": "node scripts/benchmark-container.mjs",
305
+ "sync:fennel-lsp": "node scripts/sync-fennel-lsp.mjs",
306
+ "test:lsp:fennel": "WASM_IDLE_RUN_REAL_BROWSER_FENNEL_LSP=1 node --test scripts/fennel-lsp.browser.test.mjs",
307
+ "sync:forth-lsp": "node scripts/build-forth-lsp.mjs",
308
+ "test:lsp:browser:forth": "WASM_IDLE_RUN_REAL_BROWSER_FORTH_LSP=1 node --test scripts/forth-lsp.browser.test.mjs",
309
+ "sync:bash-lsp": "node scripts/sync-bash-lsp.mjs",
310
+ "test:lsp:assets:bash": "pnpm run sync:bash-lsp && WASM_IDLE_RUN_BASH_LSP_ASSET_BUILD=1 node --test scripts/sync-bash-lsp.test.mjs",
311
+ "test:lsp:browser:bash": "pnpm run sync:bash-lsp && WASM_IDLE_RUN_BASH_LSP_BROWSER=1 pnpm --dir packages/lsp exec vitest run test/bash.playwright.test.ts --pool threads --maxWorkers 1 --no-file-parallelism",
312
+ "sync:grain-lsp": "node scripts/sync-grain-lsp.mjs",
313
+ "test:lsp:grain": "WASM_IDLE_RUN_REAL_BROWSER_GRAIN_LSP=1 node --test scripts/grain-lsp.browser.test.mjs",
314
+ "sync:c3-lsp": "node scripts/build-c3-lsp.mjs",
315
+ "test:lsp:browser:c3": "WASM_IDLE_RUN_REAL_BROWSER_C3_LSP=1 node --test scripts/c3-lsp.browser.test.mjs",
316
+ "sync:cobol-lsp": "node scripts/sync-cobol-lsp.mjs",
317
+ "test:lsp:assets:cobol": "pnpm run sync:cobol-lsp && WASM_IDLE_RUN_COBOL_LSP_ASSET_BUILD=1 node --test scripts/sync-cobol-lsp.test.mjs",
318
+ "test:lsp:browser:cobol": "pnpm run sync:cobol-lsp && WASM_IDLE_RUN_COBOL_LSP_BROWSER=1 pnpm --dir packages/lsp exec vitest run test/cobol.playwright.test.ts --pool threads --maxWorkers 1 --no-file-parallelism",
319
+ "sync:rescript-lsp": "node scripts/sync-rescript-lsp.mjs",
320
+ "test:lsp:browser:rescript": "WASM_IDLE_RUN_REAL_BROWSER_LSP=1 node --test scripts/rescript-lsp.browser.test.mjs",
321
+ "test:lsp:assets:rescript": "WASM_IDLE_RUN_RESCRIPT_LSP_PRODUCER=1 node --test scripts/sync-rescript-lsp.test.mjs",
322
+ "sync:v-lsp": "node scripts/build-v-lsp.mjs",
323
+ "test:lsp:browser:v": "WASM_IDLE_RUN_REAL_BROWSER_V_LSP=1 node --test scripts/v-lsp.browser.test.mjs",
324
+ "sync:nim-lsp": "node scripts/sync-nim-lsp.mjs",
325
+ "test:lsp:assets:nim": "pnpm run sync:nim-lsp && WASM_IDLE_RUN_NIM_LSP_ASSET_BUILD=1 node --test scripts/sync-nim-lsp.test.mjs",
326
+ "test:lsp:browser:nim": "pnpm run sync:nim-lsp && python3 producers/nim-lsp/build.py --native && WASM_IDLE_RUN_NIM_LSP_BROWSER=1 pnpm --dir packages/lsp exec vitest run test/nim.playwright.test.ts --pool threads --maxWorkers 1 --no-file-parallelism"
279
327
  }
280
328
  }
@@ -1,307 +0,0 @@
1
- <script lang="ts">
2
- import type { ContainerWorkspaceEntry } from './protocol';
3
- import {
4
- buildExplorerModel,
5
- explorerBreadcrumbs,
6
- EXPLORER_PAGE_SIZE,
7
- resolveExplorerDirectory,
8
- visibleExplorerRows
9
- } from './explorer';
10
-
11
- interface Props {
12
- entries: readonly ContainerWorkspaceEntry[];
13
- selectedPath?: string;
14
- initialDirectory?: string;
15
- busy?: boolean;
16
- onOpenFile: (entry: ContainerWorkspaceEntry) => void;
17
- }
18
-
19
- let {
20
- entries,
21
- selectedPath,
22
- initialDirectory = '',
23
- busy = false,
24
- onOpenFile
25
- }: Props = $props();
26
- let requestedDirectory = $state('');
27
- let expanded = $state(new Set<string>());
28
- let offset = $state(0);
29
- const model = $derived(buildExplorerModel(entries));
30
- const directory = $derived(resolveExplorerDirectory(model, requestedDirectory));
31
- const breadcrumbs = $derived(explorerBreadcrumbs(directory));
32
- const visible = $derived(visibleExplorerRows(model, directory, expanded, offset));
33
-
34
- $effect(() => {
35
- requestedDirectory = initialDirectory;
36
- expanded = new Set();
37
- offset = 0;
38
- });
39
-
40
- function enterDirectory(path: string) {
41
- requestedDirectory = resolveExplorerDirectory(model, path);
42
- offset = 0;
43
- }
44
-
45
- function toggleDirectory(path: string) {
46
- const next = new Set(expanded);
47
- if (next.has(path)) next.delete(path);
48
- else next.add(path);
49
- expanded = next;
50
- offset = 0;
51
- }
52
- </script>
53
-
54
- <div class="container-explorer">
55
- <nav aria-label="Workspace folder" class="breadcrumbs">
56
- <button
57
- type="button"
58
- class="parent-button"
59
- aria-label="Go to parent folder"
60
- title="Go to parent folder"
61
- disabled={!directory}
62
- onclick={() => enterDirectory(model.entries.get(directory)?.parent ?? '')}>↑</button
63
- >
64
- <ol>
65
- {#each breadcrumbs as crumb (crumb.path)}
66
- <li>
67
- <button
68
- type="button"
69
- title={crumb.path ? `/workspace/${crumb.path}` : '/workspace'}
70
- aria-current={crumb.path === directory ? 'location' : undefined}
71
- onclick={() => enterDirectory(crumb.path)}>{crumb.name}</button
72
- >
73
- </li>
74
- {/each}
75
- </ol>
76
- </nav>
77
- <div class="files">
78
- {#if visible.rows.length === 0}
79
- <p class="empty">This folder is empty.</p>
80
- {:else}
81
- <ul aria-label="Workspace files">
82
- {#each visible.rows as row (row.entry.path)}
83
- {@const entry = row.entry}
84
- <li style:padding-left={`${Math.min(row.depth, 16) * 12}px`}>
85
- {#if entry.type === 'directory'}
86
- <button
87
- type="button"
88
- class="toggle"
89
- aria-label={`${row.expanded ? 'Collapse' : 'Expand'} /workspace/${entry.path}`}
90
- aria-expanded={row.expanded}
91
- onclick={() => toggleDirectory(entry.path)}
92
- >{row.expanded ? '▾' : '▸'}</button
93
- >
94
- <button
95
- type="button"
96
- class="entry directory"
97
- data-container-directory={entry.path}
98
- aria-label={`Open folder /workspace/${entry.path}`}
99
- title={`/workspace/${entry.path}/`}
100
- onclick={() => enterDirectory(entry.path)}
101
- >
102
- <span class="material-symbols-outlined" aria-hidden="true"
103
- >folder</span
104
- >
105
- <span>{entry.name}</span>
106
- </button>
107
- {:else if entry.type === 'file'}
108
- <button
109
- type="button"
110
- class="entry file"
111
- class:active={entry.path === selectedPath}
112
- data-container-path={entry.path}
113
- aria-current={entry.path === selectedPath ? 'true' : undefined}
114
- title={`/workspace/${entry.path} (${entry.size} bytes)`}
115
- disabled={busy}
116
- onclick={() => onOpenFile(entry)}
117
- >
118
- <span class="material-symbols-outlined" aria-hidden="true"
119
- >draft</span
120
- >
121
- <span>{entry.name}</span>
122
- </button>
123
- {:else}
124
- <div
125
- class="entry symlink"
126
- title={`/workspace/${entry.path} (symbolic link; target is not followed)`}
127
- >
128
- <span class="material-symbols-outlined" aria-hidden="true"
129
- >link</span
130
- >
131
- <span>{entry.name}</span>
132
- <small>link</small>
133
- </div>
134
- {/if}
135
- </li>
136
- {/each}
137
- </ul>
138
- {/if}
139
- </div>
140
- {#if visible.offset > 0 || visible.remaining > 0}
141
- <div class="pagination">
142
- {#if visible.offset > 0}<button
143
- type="button"
144
- onclick={() => (offset = visible.offset - EXPLORER_PAGE_SIZE)}
145
- >Previous files</button
146
- >{/if}
147
- <span aria-live="polite"
148
- >{visible.offset + 1}–{visible.offset + visible.rows.length} of {visible.total}</span
149
- >
150
- {#if visible.remaining > 0}<button
151
- type="button"
152
- onclick={() => (offset = visible.offset + EXPLORER_PAGE_SIZE)}
153
- >Show more ({visible.remaining} remaining)</button
154
- >{/if}
155
- </div>
156
- {/if}
157
- </div>
158
-
159
- <style>
160
- .container-explorer {
161
- display: flex;
162
- flex-direction: column;
163
- min-height: 36px;
164
- overflow: hidden;
165
- }
166
- .breadcrumbs {
167
- display: flex;
168
- align-items: flex-start;
169
- gap: 4px;
170
- padding: 4px 0;
171
- border-bottom: 1px solid var(--line-soft, #e5e7eb);
172
- }
173
- .breadcrumbs ol {
174
- display: flex;
175
- flex-wrap: wrap;
176
- align-items: center;
177
- gap: 2px;
178
- min-width: 0;
179
- margin: 0;
180
- padding: 0;
181
- list-style: none;
182
- }
183
- .breadcrumbs li {
184
- display: flex;
185
- align-items: center;
186
- min-width: 0;
187
- }
188
- .breadcrumbs li + li::before {
189
- content: '/';
190
- color: var(--text-4, #888);
191
- font-size: 10px;
192
- }
193
- button {
194
- border: 0;
195
- border-radius: 6px;
196
- background: transparent;
197
- color: var(--text-2, #535c6d);
198
- cursor: pointer;
199
- font: inherit;
200
- }
201
- button:disabled {
202
- cursor: not-allowed;
203
- opacity: 0.6;
204
- }
205
- button:hover:enabled,
206
- button.active {
207
- background: var(--primary-soft, #eaf2ff);
208
- color: var(--primary-strong, #2563eb);
209
- }
210
- button:focus-visible {
211
- outline: 2px solid var(--primary, #3182f6);
212
- outline-offset: -2px;
213
- }
214
- .breadcrumbs button {
215
- max-width: 200px;
216
- padding: 4px 5px;
217
- overflow-wrap: anywhere;
218
- text-align: left;
219
- font: 10px var(--mono, monospace);
220
- }
221
- .breadcrumbs button[aria-current] {
222
- color: var(--text, #1f2937);
223
- }
224
- .breadcrumbs .parent-button {
225
- flex: 0 0 26px;
226
- text-align: center;
227
- font-size: 15px;
228
- }
229
- .files {
230
- min-height: 36px;
231
- overflow: auto;
232
- }
233
- .files ul {
234
- margin: 0;
235
- padding: 4px 0;
236
- list-style: none;
237
- }
238
- .files li {
239
- display: flex;
240
- align-items: center;
241
- box-sizing: border-box;
242
- min-width: 0;
243
- }
244
- .entry {
245
- display: flex;
246
- align-items: center;
247
- flex: 1 1 auto;
248
- gap: 6px;
249
- min-width: 0;
250
- min-height: 30px;
251
- padding: 5px 8px;
252
- text-align: left;
253
- font: 11px var(--mono, monospace);
254
- color: var(--text-2, #535c6d);
255
- }
256
- .entry > span:last-child {
257
- min-width: 0;
258
- overflow: hidden;
259
- text-overflow: ellipsis;
260
- white-space: nowrap;
261
- }
262
- .entry.file,
263
- .entry.symlink {
264
- margin-left: 24px;
265
- }
266
- .toggle {
267
- flex: 0 0 24px;
268
- width: 24px;
269
- min-height: 30px;
270
- padding: 0;
271
- font-size: 13px;
272
- }
273
- .material-symbols-outlined {
274
- flex: 0 0 auto;
275
- font-size: 16px;
276
- }
277
- .symlink {
278
- color: var(--text-3, #7a8393);
279
- }
280
- .symlink span:nth-child(2) {
281
- overflow: hidden;
282
- text-overflow: ellipsis;
283
- white-space: nowrap;
284
- }
285
- .symlink small {
286
- margin-left: auto;
287
- font-size: 9px;
288
- }
289
- .empty {
290
- margin: 8px;
291
- color: var(--text-3, #7a8393);
292
- font-size: 11px;
293
- }
294
- .pagination {
295
- display: flex;
296
- flex-wrap: wrap;
297
- align-items: center;
298
- gap: 5px;
299
- border-top: 1px solid var(--line-soft, #e5e7eb);
300
- padding: 5px 0;
301
- color: var(--text-3, #7a8393);
302
- font-size: 10px;
303
- }
304
- .pagination button {
305
- padding: 5px;
306
- }
307
- </style>
@@ -1,14 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: Record<string, never>;
4
- events: {
5
- [evt: string]: CustomEvent<any>;
6
- };
7
- slots: {};
8
- };
9
- export type ContainerExplorerProps = typeof __propDef.props;
10
- export type ContainerExplorerEvents = typeof __propDef.events;
11
- export type ContainerExplorerSlots = typeof __propDef.slots;
12
- export default class ContainerExplorer extends SvelteComponentTyped<ContainerExplorerProps, ContainerExplorerEvents, ContainerExplorerSlots> {
13
- }
14
- export {};