Skip to content

Commit 6c07fe9

Browse files
committed
feat: add partial support for vscode web
1 parent 76465d8 commit 6c07fe9

6 files changed

Lines changed: 1443 additions & 49 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.idea
22
.vscode/**
33
.vscode-test/**
4+
.vscode-test-web/
45
node_modules
56
mise.local.toml
67
dist/

mise.toml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,18 @@ hk = "1.18.1"
55

66
[env]
77
_.path = ["./node_modules/.bin"]
8-
CODE_CMD = "code"
8+
CODE_CMD = "npx @vscode/test-web"
99

1010
### Main tasks
1111

1212
[tasks.dev]
1313
description = 'Starts the project in watch mode and opens the extension in VSCode'
1414
depends = ['dev-extension', 'dev-webviews', 'start-vscode']
1515

16+
[tasks.dev-web]
17+
description = 'Starts the project in watch mode and opens the extension in VSCode Web'
18+
depends = ['dev-extension-web', 'dev-webviews', 'start-vscode-web']
19+
1620
[tasks.check]
1721
description = "Lint, type-check, and test the project"
1822
depends = ['lint-fix', 'test', 'ts-check', 'docs:extractSettings']
@@ -55,6 +59,11 @@ run = '$CODE_CMD --inspect-extensions=5858 --extensionDevelopmentPath={{cwd}}'
5559
sources = ['src/**', 'package.json', 'syntaxes/**']
5660
wait_for = ['install']
5761

62+
[tasks.start-vscode-web]
63+
description = 'Starts VSCode Web with the extension loaded'
64+
run = 'npx @vscode/test-web --extensionDevelopmentPath={{cwd}}'
65+
wait_for = ['install']
66+
5867
[tasks.watch-vscode]
5968
run = 'mise watch -t start-vscode'
6069

@@ -67,6 +76,11 @@ depends = ['install']
6776
description = 'Builds the project in watch mode'
6877
run = 'rsbuild dev'
6978

79+
[tasks.dev-extension-web]
80+
depends = ['install']
81+
description = 'Builds the project for VSCode Web in watch mode'
82+
run = 'rslib build -c rslib.browser.config.ts --watch --config-loader jiti'
83+
7084
[tasks.dev-webviews]
7185
description = 'Render webviews in watch mode.'
7286
run = 'node --run dev-webviews'

package.json

Lines changed: 93 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
],
3535
"icon": "resources/icon.png",
3636
"main": "./dist/extension.js",
37+
"browser": "./dist/browser/browser.js",
3738
"activationEvents": [
3839
"onTaskType:mise",
3940
"workspaceContains:.config/mise/**/config.*.toml",
@@ -52,6 +53,10 @@
5253
"untrustedWorkspaces": {
5354
"supported": false,
5455
"description": "This extension requires a trusted workspace because it can execute code in the workspace."
56+
},
57+
"virtualWorkspaces": {
58+
"supported": "limited",
59+
"description": "syntax highlighting only"
5560
}
5661
},
5762
"contributes": {
@@ -371,204 +376,241 @@
371376
"mise-panel": [
372377
{
373378
"id": "miseTasksView",
374-
"name": "Tasks"
379+
"name": "Tasks",
380+
"when": "!isWeb"
375381
},
376382
{
377383
"id": "miseToolsView",
378-
"name": "Tools"
384+
"name": "Tools",
385+
"when": "!isWeb"
379386
},
380387
{
381388
"id": "miseEnvsView",
382-
"name": "Environment Variables"
389+
"name": "Environment Variables",
390+
"when": "!isWeb"
383391
}
384392
]
385393
},
386394
"commands": [
387395
{
388396
"command": "mise.refreshEntry",
389397
"title": "Mise: Reload configuration",
390-
"icon": "$(refresh)"
398+
"icon": "$(refresh)",
399+
"enablement": "!isWeb"
391400
},
392401
{
393402
"command": "mise.openMenu",
394-
"title": "Mise: Open Menu"
403+
"title": "Mise: Open Menu",
404+
"enablement": "!isWeb"
395405
},
396406
{
397407
"command": "mise.openMissingToolsMenu",
398-
"title": "Mise: Open Missing Tools Menu"
408+
"title": "Mise: Open Missing Tools Menu",
409+
"enablement": "!isWeb"
399410
},
400411
{
401412
"command": "mise.openToolRepository",
402-
"title": "Mise: Open Tool Repository"
413+
"title": "Mise: Open Tool Repository",
414+
"enablement": "!isWeb"
403415
},
404416
{
405417
"command": "mise.selectWorkspaceFolder",
406-
"title": "Mise: Select Workspace Folder"
418+
"title": "Mise: Select Workspace Folder",
419+
"enablement": "!isWeb"
407420
},
408421
{
409422
"command": "mise.runTask",
410423
"title": "Mise: Run task",
411-
"icon": "$(play)"
424+
"icon": "$(play)",
425+
"enablement": "!isWeb"
412426
},
413427
{
414428
"command": "mise.watchTask",
415429
"title": "Mise: Run Task in Watch Mode",
416-
"icon": "$(watch)"
430+
"icon": "$(watch)",
431+
"enablement": "!isWeb"
417432
},
418433
{
419434
"command": "mise.createFileTask",
420435
"title": "Mise: Create File Task",
421-
"icon": "$(new-file)"
436+
"icon": "$(new-file)",
437+
"enablement": "!isWeb"
422438
},
423439
{
424440
"command": "mise.createTomlTask",
425441
"title": "Mise: Create Toml Task",
426-
"icon": "$(add)"
442+
"icon": "$(add)",
443+
"enablement": "!isWeb"
427444
},
428445
{
429446
"command": "mise.createTomlTaskTopMenu",
430447
"title": "Mise: Create Toml Task",
431-
"icon": "$(add)"
448+
"icon": "$(add)",
449+
"enablement": "!isWeb"
432450
},
433451
{
434452
"command": "mise.openToolDefinition",
435-
"title": "Mise: Open Tool Definition"
453+
"title": "Mise: Open Tool Definition",
454+
"enablement": "!isWeb"
436455
},
437456
{
438457
"command": "mise.openTaskDefinition",
439-
"title": "Mise: Open Task Definition"
458+
"title": "Mise: Open Task Definition",
459+
"enablement": "!isWeb"
440460
},
441461
{
442462
"command": "mise.openEnvVariableDefinition",
443-
"title": "Mise: Find Environment Variable Definition"
463+
"title": "Mise: Find Environment Variable Definition",
464+
"enablement": "!isWeb"
444465
},
445466
{
446467
"command": "mise.openFile",
447-
"title": "Mise: Open File"
468+
"title": "Mise: Open File",
469+
"enablement": "!isWeb"
448470
},
449471
{
450472
"command": "mise.removeTool",
451-
"title": "Mise: Remove Tool"
473+
"title": "Mise: Remove Tool",
474+
"enablement": "!isWeb"
452475
},
453476
{
454477
"command": "mise.copyToolInstallPath",
455478
"title": "Mise: Copy Tool Install Path",
456-
"context": [
457-
"miseToolsView"
458-
]
479+
"enablement": "!isWeb"
459480
},
460481
{
461482
"command": "mise.copyToolBinPaths",
462483
"title": "Mise: Copy Tool Bin Paths",
463-
"context": [
464-
"miseToolsView"
465-
]
484+
"enablement": "!isWeb"
466485
},
467486
{
468487
"command": "mise.copyEnvVariableName",
469-
"title": "Mise: Copy Environment Variable Name"
488+
"title": "Mise: Copy Environment Variable Name",
489+
"enablement": "!isWeb"
470490
},
471491
{
472492
"command": "mise.copyEnvVariableValue",
473-
"title": "Mise: Copy Environment Variable Value"
493+
"title": "Mise: Copy Environment Variable Value",
494+
"enablement": "!isWeb"
474495
},
475496
{
476497
"command": "mise.installTool",
477-
"title": "Mise: Install Tool"
498+
"title": "Mise: Install Tool",
499+
"enablement": "!isWeb"
478500
},
479501
{
480502
"command": "mise.installAll",
481503
"title": "Mise: Run mise install",
482-
"icon": "$(cloud-download)"
504+
"icon": "$(cloud-download)",
505+
"enablement": "!isWeb"
483506
},
484507
{
485508
"command": "mise.useTool",
486509
"title": "Mise: Run mise use",
487-
"icon": "$(add)"
510+
"icon": "$(add)",
511+
"enablement": "!isWeb"
488512
},
489513
{
490514
"command": "mise.useToolTopMenu",
491515
"title": "Mise: Use Tool",
492-
"icon": "$(add)"
516+
"icon": "$(add)",
517+
"enablement": "!isWeb"
493518
},
494519
{
495520
"command": "mise.configureSdkPath",
496-
"title": "Mise: Configure extension sdk path..."
521+
"title": "Mise: Configure extension sdk path...",
522+
"enablement": "!isWeb"
497523
},
498524
{
499525
"command": "mise.configureAllSdkPaths",
500-
"title": "Mise: Configure all extension sdk paths"
526+
"title": "Mise: Configure all extension sdk paths",
527+
"enablement": "!isWeb"
501528
},
502529
{
503530
"command": "mise.openExtensionSettings",
504531
"title": "Mise: Open extension settings",
505-
"icon": "$(tools)"
532+
"icon": "$(tools)",
533+
"enablement": "!isWeb"
506534
},
507535
{
508536
"command": "mise.openLogs",
509537
"title": "Mise: Show extension logs",
510-
"icon": "$(list-unordered)"
538+
"icon": "$(list-unordered)",
539+
"enablement": "!isWeb"
511540
},
512541
{
513542
"command": "mise.listAllTools",
514543
"title": "Mise: List all Tools",
515-
"icon": "$(list-ordered)"
544+
"icon": "$(list-ordered)",
545+
"enablement": "!isWeb"
516546
},
517547
{
518548
"command": "mise.showSettings",
519549
"title": "Mise: Show mise settings",
520-
"icon": "$(list-ordered)"
550+
"icon": "$(list-ordered)",
551+
"enablement": "!isWeb"
521552
},
522553
{
523554
"command": "mise.showTrackedConfig",
524555
"title": "Mise: Show mise tracked configurations",
525-
"icon": "$(list-ordered)"
556+
"icon": "$(list-ordered)",
557+
"enablement": "!isWeb"
526558
},
527559
{
528560
"command": "mise.visualizeTasksDeps",
529561
"title": "Mise: Visualize Tasks Dependencies",
530-
"icon": "$(git-merge)"
562+
"icon": "$(git-merge)",
563+
"enablement": "!isWeb"
531564
},
532565
{
533566
"command": "mise.setEnvVariable",
534567
"title": "Mise: Set Environment Variable",
535-
"icon": "$(add)"
568+
"icon": "$(add)",
569+
"enablement": "!isWeb"
536570
},
537571
{
538572
"command": "mise.fmt",
539-
"title": "Mise: Run mise fmt"
573+
"title": "Mise: Run mise fmt",
574+
"enablement": "!isWeb"
540575
},
541576
{
542577
"command": "mise.editSetting",
543-
"title": "Mise: Edit Setting"
578+
"title": "Mise: Edit Setting",
579+
"enablement": "!isWeb"
544580
},
545581
{
546582
"command": "mise.showAllEnvVarValues",
547583
"title": "Mise: Show All Environment Variable Values",
548-
"icon": "$(eye)"
584+
"icon": "$(eye)",
585+
"enablement": "!isWeb"
549586
},
550587
{
551588
"command": "mise.hideAllEnvVarValues",
552589
"title": "Mise: Hide All Environment Variable Values",
553-
"icon": "$(eye-closed)"
590+
"icon": "$(eye-closed)",
591+
"enablement": "!isWeb"
554592
},
555593
{
556594
"command": "mise.showEnvVariableValue",
557595
"title": "Mise: Show Environment Variable Value",
558-
"icon": "$(eye)"
596+
"icon": "$(eye)",
597+
"enablement": "!isWeb"
559598
},
560599
{
561600
"command": "mise.hideEnvVariableValue",
562601
"title": "Mise: Hide Environment Variable Value",
563-
"icon": "$(eye-closed)"
602+
"icon": "$(eye-closed)",
603+
"enablement": "!isWeb"
564604
},
565605
{
566606
"command": "mise.displayPath",
567-
"title": "Mise: Display PATH variable"
607+
"title": "Mise: Display PATH variable",
608+
"enablement": "!isWeb"
568609
},
569610
{
570611
"command": "mise.doctor",
571-
"title": "Mise: Run mise doctor"
612+
"title": "Mise: Run mise doctor",
613+
"enablement": "!isWeb"
572614
}
573615
],
574616
"menus": {
@@ -809,8 +851,9 @@
809851
},
810852
"scripts": {
811853
"dev-extension": "rsbuild dev",
854+
"dev-browser": "rslib build -c rslib.browser.config.ts --watch --config-loader jiti",
812855
"dev-webviews": "rsbuild dev -c rsbuild.webviews.config.ts",
813-
"build": "rsbuild build && rsbuild build -c rsbuild.webviews.config.ts",
856+
"build": "rsbuild build && rslib build -c rslib.browser.config.ts --config-loader jiti && rsbuild build -c rsbuild.webviews.config.ts",
814857
"ts-check": "tsc --noEmit",
815858
"lint-fix": "biome check --fix",
816859
"lint": "biome ci",
@@ -821,6 +864,7 @@
821864
"@biomejs/biome": "2.2.5",
822865
"@rsbuild/core": "^1.5.13",
823866
"@rsbuild/plugin-react": "^1.4.1",
867+
"@rslib/core": "^0.17.0",
824868
"@types/bun": "^1.2.23",
825869
"@types/micromatch": "^4.0.9",
826870
"@types/node": "^22.10.5",
@@ -834,6 +878,7 @@
834878
"typescript": "^5.9.3"
835879
},
836880
"dependencies": {
881+
"@rsbuild/plugin-node-polyfill": "^1.4.2",
837882
"@std/collections": "npm:@jsr/std__collections@^1.0.9",
838883
"@tanstack/match-sorter-utils": "^8.19.4",
839884
"@tanstack/react-query": "^5.90.2",

0 commit comments

Comments
 (0)