aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-registry/index/node-debug2-adapter/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2023-02-20 22:19:39 +0100
committerGitHub <noreply@github.com>2023-02-20 22:19:39 +0100
commitb8a6632a0f2d263199d5d480ca85477fe0f414ab (patch)
tree57e1ee0f3cef078ec144ecdf1b2fa861acf47755 /lua/mason-registry/index/node-debug2-adapter/init.lua
parentchore: autogenerate (#1015) (diff)
downloadmason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.gz
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.bz2
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.lz
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.xz
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.tar.zst
mason-b8a6632a0f2d263199d5d480ca85477fe0f414ab.zip
feat: configurable registries (#1016)
Diffstat (limited to 'lua/mason-registry/index/node-debug2-adapter/init.lua')
-rw-r--r--lua/mason-registry/index/node-debug2-adapter/init.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/lua/mason-registry/index/node-debug2-adapter/init.lua b/lua/mason-registry/index/node-debug2-adapter/init.lua
new file mode 100644
index 00000000..4487b6a4
--- /dev/null
+++ b/lua/mason-registry/index/node-debug2-adapter/init.lua
@@ -0,0 +1,36 @@
+local Pkg = require "mason-core.package"
+local github = require "mason-core.managers.github"
+local git = require "mason-core.managers.git"
+local _ = require "mason-core.functional"
+local path = require "mason-core.path"
+local Optional = require "mason-core.optional"
+local platform = require "mason-core.platform"
+
+return Pkg.new {
+ name = "node-debug2-adapter",
+ desc = [[A debug adapter that supports debugging Node via the Chrome Debugging Protocol. No longer maintained.]],
+ homepage = "https://github.com/microsoft/vscode-node-debug2",
+ languages = { Pkg.Lang.JavaScript, Pkg.Lang.TypeScript },
+ categories = { Pkg.Cat.DAP },
+ ---@async
+ ---@param ctx InstallContext
+ install = function(ctx)
+ local source = github.tag { repo = "microsoft/vscode-node-debug2" }
+ source.with_receipt()
+ git.clone { "https://github.com/microsoft/vscode-node-debug2", version = Optional.of(source.tag) }
+ ctx.spawn.npm { "install" }
+ local node_env = platform
+ .get_node_version()
+ :map(_.cond {
+ { _.prop_satisfies(_.gte(18), "major"), _.always { NODE_OPTIONS = "--no-experimental-fetch" } },
+ { _.T, _.always {} },
+ })
+ :get_or_else {}
+ ctx.spawn.npm { "run", "build", env = node_env }
+ ctx.spawn.npm { "install", "--production" }
+ ctx:link_bin(
+ "node-debug2-adapter",
+ ctx:write_node_exec_wrapper("node-debug2-adapter", path.concat { "out", "src", "nodeDebug.js" })
+ )
+ end,
+}