Files
bun.sh/packages/bun-vscode/package.json
Ashcon Partovi 1480889205 Improved support for debug-adapter-protocol (#4186)
* Improve support for \`debug-adapter-protocol\`

* More improvements, fix formatting in debug console

* Fix attaching

* Prepare for source maps

* Start of source map support, breakpoints work

* Source map support

* add some package.jsons

* wip

* Update package.json

* More fixes

* Make source maps safer if exception occurs

* Check bun version if it fails

* Fix console.log formatting

* Fix source maps partly

* More source map fixes

* Prepare for extension

* watch mode with dap

* Improve preview code

* Prepare for extension 2

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-24 22:53:34 -07:00

295 lines
8.2 KiB
JSON

{
"name": "bun-vscode",
"version": "0.0.1",
"author": "oven",
"repository": {
"type": "git",
"url": "https://github.com/oven-sh/bun"
},
"main": "dist/extension.js",
"dependencies": {
"semver": "^7.5.4",
"source-map-js": "^1.0.2",
"ws": "^8.13.0"
},
"devDependencies": {
"@types/vscode": "^1.81.0",
"@vscode/debugadapter": "^1.56.0",
"@vscode/debugadapter-testsupport": "^1.56.0",
"bun-types": "^0.7.3",
"typescript": "^5.0.0",
"esbuild": "^0.19.2"
},
"activationEvents": [
"onLanguage:javascript",
"onLanguage:javascriptreact",
"onLanguage:typescript",
"onLanguage:typescriptreact",
"workspaceContains:**/.lockb",
"onDebugResolve:bun",
"onDebugDynamicConfigurations:bun"
],
"browser": "dist/web-extension.js",
"bugs": {
"url": "https://github.com/oven-sh/bun/issues"
},
"capabilities": {
"untrustedWorkspaces": {
"supported": false,
"description": "This extension needs to be able to run your code using Bun."
}
},
"categories": [
"Programming Languages",
"Debuggers",
"Testing"
],
"contributes": {
"configuration": {
"title": "Bun",
"properties": {
"bun.path": {
"type": "string",
"description": "A path to the `bun` executable. By default, the extension looks for `bun` in the `PATH`, but if set, it will use the specified path instead.",
"scope": "window",
"default": null
}
}
},
"commands": [
{
"command": "extension.bun.runFile",
"title": "Run File",
"category": "Bun",
"enablement": "!inDebugMode",
"icon": "$(play)"
},
{
"command": "extension.bun.debugFile",
"title": "Debug File",
"category": "Bun",
"enablement": "!inDebugMode",
"icon": "$(debug-alt)"
}
],
"menus": {
"editor/title/run": [
{
"command": "extension.bun.runFile",
"when": "resourceLangId == javascript || resourceLangId == javascriptreact || resourceLangId == typescript || resourceLangId == typescriptreact",
"group": "navigation@1"
},
{
"command": "extension.bun.debugFile",
"when": "resourceLangId == javascript || resourceLangId == javascriptreact || resourceLangId == typescript || resourceLangId == typescriptreact",
"group": "navigation@2"
}
],
"commandPalette": [
{
"command": "extension.bun.runFile",
"when": "resourceLangId == javascript || resourceLangId == javascriptreact || resourceLangId == typescript || resourceLangId == typescriptreact"
},
{
"command": "extension.bun.debugFile",
"when": "resourceLangId == javascript || resourceLangId == javascriptreact || resourceLangId == typescript || resourceLangId == typescriptreact"
}
]
},
"breakpoints": [
{
"language": "javascript"
},
{
"language": "javascriptreact"
},
{
"language": "typescript"
},
{
"language": "typescriptreact"
}
],
"debuggers": [
{
"type": "bun",
"label": "Bun",
"languages": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
"runtime": "node",
"program": "dist/adapter.js",
"configurationAttributes": {
"launch": {
"required": [
"program"
],
"properties": {
"runtime": {
"type": "string",
"description": "The path to Bun.",
"default": "bun"
},
"program": {
"type": "string",
"description": "The file to debug.",
"default": "${file}"
},
"cwd": {
"type": "string",
"description": "The working directory.",
"default": "${workspaceFolder}"
},
"args": {
"type": "array",
"description": "The arguments passed to Bun.",
"items": {
"type": "string"
},
"default": []
},
"env": {
"type": "object",
"description": "The environment variables passed to Bun.",
"default": {}
},
"inheritEnv": {
"type": "boolean",
"description": "If environment variables should be inherited from the parent process.",
"default": true
},
"watch": {
"type": ["boolean", "string"],
"description": "If the process should be restarted when files change.",
"enum": [
true,
false,
"hot"
],
"default": true
}
}
},
"attach": {
"properties": {
"url": {
"type": "string",
"description": "The URL of the Bun process to attach to.",
"default": "ws://localhost:6499/"
}
}
}
},
"initialConfigurations": [
{
"type": "bun",
"request": "launch",
"name": "Bun: Debug",
"program": "${file}"
},
{
"type": "bun",
"request": "attach",
"name": "Bun: Attach",
"url": "ws://localhost:6499/"
}
],
"configurationSnippets": [
{
"label": "Bun: Debug",
"description": "A new configuration for 'debugging' a Bun process.",
"body": {
"type": "bun",
"request": "launch",
"name": "Ask for file name",
"program": "^\"\\${file}\""
}
},
{
"label": "Bun: Attach",
"description": "A new configuration for 'attaching' to a running Bun process.",
"body": {
"type": "bun",
"request": "attach",
"name": "Attach to Bun",
"url": "ws://localhost:6499/"
}
}
]
}
],
"languages": [
{
"id": "bun.lockb",
"aliases": [
"bun.lockb"
],
"extensions": [
".lockb"
],
"icon": {
"dark": "src/assets/icon-small.png",
"light": "src/assets/icon-small.png"
}
}
],
"jsonValidation": [
{
"fileMatch": "package.json",
"url": "src/resources/package.json"
}
],
"customEditors": [
{
"viewType": "bun.lockb",
"displayName": "bun.lockb",
"selector": [
{
"filenamePattern": "*.lockb"
}
],
"priority": "default"
}
]
},
"description": "The Visual Studio Code extension for Bun.",
"displayName": "Bun",
"engines": {
"vscode": "^1.81.0"
},
"extensionKind": [
"workspace"
],
"galleryBanner": {
"color": "#C80000",
"theme": "dark"
},
"homepage": "https://bun.sh/",
"icon": "src/assets/icon.png",
"keywords": [
"bun",
"node.js",
"javascript",
"typescript",
"vscode"
],
"license": "MIT",
"publisher": "oven",
"scripts": {
"bundle": "./node_modules/.bin/esbuild src/extension.ts src/web-extension.ts --bundle --external:vscode --outdir=dist --platform=node --format=cjs",
"prebuild": "bun run bundle && rm -rf extension && mkdir -p extension/src && cp -r dist extension/dist && cp -r src/assets extension/src/assets && cp package.json extension && cp README.md extension",
"build": "cd extension && vsce package",
"build:watch": "./node_modules/.bin/esbuild --watch src/extension.ts src/web-extension.ts --bundle --external:vscode --outdir=dist --platform=node --format=cjs"
},
"workspaceTrust": {
"request": "never"
},
"workspaces": [
"../bun-debug-adapter-protocol",
"../bun-inspector-protocol"
]
}