diff --git a/build.js b/build.js index 5cca705..27f4228 100644 --- a/build.js +++ b/build.js @@ -6,7 +6,7 @@ require("esbuild") entryPoints: ["./src/extension.ts"], bundle: true, outdir: "./out", - external: ["vscode", "open"], + external: ["vscode"], format: "cjs", sourcemap: !production, minify: production, diff --git a/package-lock.json b/package-lock.json index 418b1ff..6bbe742 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "license": "MIT", "dependencies": { "clipboardy": "^2.3.0", - "open": "^8.4.2", "ramda": "^0.25.0" }, "devDependencies": { @@ -731,14 +730,6 @@ "clone": "^1.0.2" } }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://packages.atlassian.com/api/npm/npm-remote/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "engines": { - "node": ">=8" - } - }, "node_modules/diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -2169,30 +2160,6 @@ "node": ">=6" } }, - "node_modules/open": { - "version": "8.4.2", - "resolved": "https://packages.atlassian.com/api/npm/npm-remote/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", - "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/open/node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://packages.atlassian.com/api/npm/npm-remote/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dependencies": { - "is-docker": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/os-shim": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", @@ -3498,11 +3465,6 @@ "clone": "^1.0.2" } }, - "define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://packages.atlassian.com/api/npm/npm-remote/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==" - }, "diff": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", @@ -4483,26 +4445,6 @@ "mimic-fn": "^2.1.0" } }, - "open": { - "version": "8.4.2", - "resolved": "https://packages.atlassian.com/api/npm/npm-remote/open/-/open-8.4.2.tgz", - "integrity": "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==", - "requires": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" - }, - "dependencies": { - "is-wsl": { - "version": "2.2.0", - "resolved": "https://packages.atlassian.com/api/npm/npm-remote/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "requires": { - "is-docker": "^2.0.0" - } - } - } - }, "os-shim": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/os-shim/-/os-shim-0.1.3.tgz", diff --git a/package.json b/package.json index 3034190..5d1ac63 100644 --- a/package.json +++ b/package.json @@ -174,7 +174,6 @@ }, "dependencies": { "clipboardy": "^2.3.0", - "open": "^8.4.2", "ramda": "^0.25.0" } } diff --git a/src/common.ts b/src/common.ts index 3f2add1..9da8e17 100644 --- a/src/common.ts +++ b/src/common.ts @@ -2,9 +2,9 @@ import { window, workspace, QuickPickItem } from "vscode"; const exec = require("child_process").exec; const path = require("path"); -const open = require("open"); const R = require("ramda"); const clipboardy = require("clipboardy"); +import * as vscode from "vscode"; export const BRANCH_URL_SEP = " — "; @@ -537,7 +537,10 @@ export function showQuickPickWindow(quickPickList: QuickPickItem[]) { */ export async function openQuickPickItem(item?: QuickPickItem) { if (!item) return; - return await open((item as any).url); + return await vscode.commands.executeCommand( + "vscode.open", + vscode.Uri.parse((item as any).url) + ); } /**