diff --git a/package.json b/package.json index 24fd7f6..bd57961 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ }, "dependencies": { "bash-language-server": "3.0.3", - "pkg-dir": "^6.0.1", "tslib": "^2.4.0" } } diff --git a/src/extension.ts b/src/extension.ts index c666621..01097ab 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,6 +1,5 @@ import path from 'path' import fs from 'fs' -import { packageDirectory as pkgDir } from 'pkg-dir' import { ExtensionContext, LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, commands, services, window, workspace } from 'coc.nvim' interface ShConfig { @@ -43,7 +42,7 @@ export async function activate(context: ExtensionContext): Promise { context.subscriptions.push( services.registLanguageClient(client), commands.registerCommand("sh.version", async () => { - const rootDir = await pkgDir({ cwd: __dirname }) + const rootDir = path.join(__dirname, '..') const { version } = JSON.parse(fs.readFileSync(path.resolve(rootDir, 'package.json'), 'utf-8')) window.showMessage(`Version: ${version} [node: ${process.versions.node}]`, 'more') diff --git a/yarn.lock b/yarn.lock index ccdc4ea..566e1d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -775,14 +775,6 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-up@^6.1.0: - version "6.3.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz" - integrity sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw== - dependencies: - locate-path "^7.1.0" - path-exists "^5.0.0" - flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" @@ -1073,13 +1065,6 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -locate-path@^7.1.0: - version "7.1.1" - resolved "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz" - integrity sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg== - dependencies: - p-locate "^6.0.0" - lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz" @@ -1182,20 +1167,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -p-limit@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz" - integrity sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ== - dependencies: - yocto-queue "^1.0.0" - -p-locate@^6.0.0: - version "6.0.0" - resolved "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz" - integrity sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw== - dependencies: - p-limit "^4.0.0" - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz" @@ -1203,11 +1174,6 @@ parent-module@^1.0.0: dependencies: callsites "^3.0.0" -path-exists@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz" - integrity sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" @@ -1233,13 +1199,6 @@ picomatch@^2.2.3: resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -pkg-dir@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/pkg-dir/-/pkg-dir-6.0.1.tgz" - integrity sha512-C9R+PTCKGA32HG0n5I4JMYkdLL58ZpayVuncQHQrGeKa8o26A4o2x0u6BKekHG+Au0jv5ZW7Xfq1Cj6lm9Ag4w== - dependencies: - find-up "^6.1.0" - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz" @@ -1669,8 +1628,3 @@ yargs@^16.0.3: string-width "^4.2.0" y18n "^5.0.5" yargs-parser "^20.2.2" - -yocto-queue@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz" - integrity sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==