typescript-language-server 0.11.2 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -0
- package/README.md +160 -27
- package/lib/calls.d.ts +3 -3
- package/lib/calls.d.ts.map +1 -1
- package/lib/calls.js +143 -195
- package/lib/calls.js.map +1 -1
- package/lib/cli.js +9 -33
- package/lib/cli.js.map +1 -1
- package/lib/commands.d.ts +1 -0
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +4 -5
- package/lib/commands.js.map +1 -1
- package/lib/completion.d.ts +8 -11
- package/lib/completion.d.ts.map +1 -1
- package/lib/completion.js +121 -163
- package/lib/completion.js.map +1 -1
- package/lib/configuration-manager.d.ts +47 -0
- package/lib/configuration-manager.d.ts.map +1 -0
- package/lib/configuration-manager.js +105 -0
- package/lib/configuration-manager.js.map +1 -0
- package/lib/diagnostic-queue.d.ts +10 -9
- package/lib/diagnostic-queue.d.ts.map +1 -1
- package/lib/diagnostic-queue.js +13 -21
- package/lib/diagnostic-queue.js.map +1 -1
- package/lib/document-symbol.d.ts +2 -2
- package/lib/document-symbol.d.ts.map +1 -1
- package/lib/document-symbol.js +20 -25
- package/lib/document-symbol.js.map +1 -1
- package/lib/document.d.ts +1 -1
- package/lib/document.d.ts.map +1 -1
- package/lib/document.js +6 -34
- package/lib/document.js.map +1 -1
- package/lib/features/fix-all.d.ts +4 -4
- package/lib/features/fix-all.d.ts.map +1 -1
- package/lib/features/fix-all.js +104 -147
- package/lib/features/fix-all.js.map +1 -1
- package/lib/features/inlay-hints.d.ts +11 -0
- package/lib/features/inlay-hints.d.ts.map +1 -0
- package/lib/features/inlay-hints.js +70 -0
- package/lib/features/inlay-hints.js.map +1 -0
- package/lib/features/source-definition.d.ts +11 -0
- package/lib/features/source-definition.d.ts.map +1 -0
- package/lib/features/source-definition.js +50 -0
- package/lib/features/source-definition.js.map +1 -0
- package/lib/file-lsp-server.spec.js +26 -36
- package/lib/file-lsp-server.spec.js.map +1 -1
- package/lib/hover.d.ts +4 -3
- package/lib/hover.d.ts.map +1 -1
- package/lib/hover.js +53 -17
- package/lib/hover.js.map +1 -1
- package/lib/logger.d.ts +12 -4
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +37 -44
- package/lib/logger.js.map +1 -1
- package/lib/lsp-client.d.ts +13 -17
- package/lib/lsp-client.d.ts.map +1 -1
- package/lib/lsp-client.js +32 -91
- package/lib/lsp-client.js.map +1 -1
- package/lib/lsp-connection.d.ts +1 -1
- package/lib/lsp-connection.d.ts.map +1 -1
- package/lib/lsp-connection.js +13 -39
- package/lib/lsp-connection.js.map +1 -1
- package/lib/lsp-protocol.calls.proposed.d.ts +1 -1
- package/lib/lsp-protocol.calls.proposed.d.ts.map +1 -1
- package/lib/lsp-protocol.calls.proposed.js +7 -32
- package/lib/lsp-protocol.calls.proposed.js.map +1 -1
- package/lib/lsp-protocol.inlayHints.proposed.d.ts +2 -11
- package/lib/lsp-protocol.inlayHints.proposed.d.ts.map +1 -1
- package/lib/lsp-protocol.inlayHints.proposed.js +2 -28
- package/lib/lsp-protocol.inlayHints.proposed.js.map +1 -1
- package/lib/lsp-server.d.ts +27 -28
- package/lib/lsp-server.d.ts.map +1 -1
- package/lib/lsp-server.js +868 -926
- package/lib/lsp-server.js.map +1 -1
- package/lib/lsp-server.spec.js +908 -633
- package/lib/lsp-server.spec.js.map +1 -1
- package/lib/organize-imports.d.ts +3 -3
- package/lib/organize-imports.d.ts.map +1 -1
- package/lib/organize-imports.js +5 -32
- package/lib/organize-imports.js.map +1 -1
- package/lib/organize-imports.spec.js +17 -42
- package/lib/organize-imports.spec.js.map +1 -1
- package/lib/protocol-translation.d.ts +5 -10
- package/lib/protocol-translation.d.ts.map +1 -1
- package/lib/protocol-translation.js +39 -170
- package/lib/protocol-translation.js.map +1 -1
- package/lib/quickfix.d.ts +3 -3
- package/lib/quickfix.d.ts.map +1 -1
- package/lib/quickfix.js +7 -35
- package/lib/quickfix.js.map +1 -1
- package/lib/refactor.d.ts +2 -2
- package/lib/refactor.d.ts.map +1 -1
- package/lib/refactor.js +11 -36
- package/lib/refactor.js.map +1 -1
- package/lib/semantic-tokens.d.ts +1 -1
- package/lib/semantic-tokens.d.ts.map +1 -1
- package/lib/semantic-tokens.js +1 -5
- package/lib/semantic-tokens.js.map +1 -1
- package/lib/test-utils.d.ts +8 -5
- package/lib/test-utils.d.ts.map +1 -1
- package/lib/test-utils.js +132 -127
- package/lib/test-utils.js.map +1 -1
- package/lib/ts-protocol.d.ts +8 -20
- package/lib/ts-protocol.d.ts.map +1 -1
- package/lib/ts-protocol.js +4 -31
- package/lib/ts-protocol.js.map +1 -1
- package/lib/tsp-client.d.ts +46 -43
- package/lib/tsp-client.d.ts.map +1 -1
- package/lib/tsp-client.js +31 -52
- package/lib/tsp-client.js.map +1 -1
- package/lib/tsp-client.spec.js +48 -75
- package/lib/tsp-client.spec.js.map +1 -1
- package/lib/tsp-command-types.d.ts +1 -0
- package/lib/tsp-command-types.d.ts.map +1 -1
- package/lib/tsp-command-types.js +4 -8
- package/lib/tsp-command-types.js.map +1 -1
- package/lib/utils/SnippetString.js +1 -4
- package/lib/utils/SnippetString.js.map +1 -1
- package/lib/utils/api.d.ts +1 -0
- package/lib/utils/api.d.ts.map +1 -1
- package/lib/utils/api.js +3 -28
- package/lib/utils/api.js.map +1 -1
- package/lib/utils/configuration.d.ts +2 -2
- package/lib/utils/configuration.d.ts.map +1 -1
- package/lib/utils/configuration.js +1 -2
- package/lib/utils/errorCodes.js +11 -14
- package/lib/utils/errorCodes.js.map +1 -1
- package/lib/utils/fixNames.js +13 -16
- package/lib/utils/fixNames.js.map +1 -1
- package/lib/utils/modules-resolver.js +7 -34
- package/lib/utils/modules-resolver.js.map +1 -1
- package/lib/utils/modules-resolver.spec.d.ts +1 -1
- package/lib/utils/modules-resolver.spec.d.ts.map +1 -1
- package/lib/utils/modules-resolver.spec.js +11 -34
- package/lib/utils/modules-resolver.spec.js.map +1 -1
- package/lib/utils/typeConverters.d.ts +20 -2
- package/lib/utils/typeConverters.d.ts.map +1 -1
- package/lib/utils/typeConverters.js +105 -9
- package/lib/utils/typeConverters.js.map +1 -1
- package/lib/utils/types.js +2 -29
- package/lib/utils/types.js.map +1 -1
- package/lib/utils/versionProvider.d.ts +3 -3
- package/lib/utils/versionProvider.d.ts.map +1 -1
- package/lib/utils/versionProvider.js +52 -60
- package/lib/utils/versionProvider.js.map +1 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +3 -5
- package/lib/utils.js.map +1 -1
- package/package.json +38 -33
|
@@ -1,20 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.TypeScriptVersionProvider = exports.MODULE_FOLDERS = exports.TypeScriptVersion = void 0;
|
|
7
1
|
/*---------------------------------------------------------------------------------------------
|
|
8
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
3
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
10
4
|
*--------------------------------------------------------------------------------------------*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import { createRequire } from 'node:module';
|
|
7
|
+
import path from 'node:path';
|
|
8
|
+
import which from 'which';
|
|
9
|
+
import { pkgUpSync } from 'pkg-up';
|
|
10
|
+
import API from './api.js';
|
|
11
|
+
import { findPathToModule } from './modules-resolver.js';
|
|
12
|
+
export class TypeScriptVersion {
|
|
18
13
|
constructor(source, path, _pathLabel, logger) {
|
|
19
14
|
this.source = source;
|
|
20
15
|
this.path = path;
|
|
@@ -23,10 +18,10 @@ class TypeScriptVersion {
|
|
|
23
18
|
this._api = null;
|
|
24
19
|
}
|
|
25
20
|
get tscPath() {
|
|
26
|
-
return
|
|
21
|
+
return path.resolve(this.path, '../bin/tsc');
|
|
27
22
|
}
|
|
28
23
|
get tsServerPath() {
|
|
29
|
-
return
|
|
24
|
+
return path.resolve(this.path, 'tsserver.js');
|
|
30
25
|
}
|
|
31
26
|
get pathLabel() {
|
|
32
27
|
return typeof this._pathLabel === 'undefined' ? this.path : this._pathLabel;
|
|
@@ -46,102 +41,99 @@ class TypeScriptVersion {
|
|
|
46
41
|
return version ? version.displayName : null;
|
|
47
42
|
}
|
|
48
43
|
getTypeScriptVersion(serverPath) {
|
|
49
|
-
|
|
50
|
-
(
|
|
51
|
-
|
|
52
|
-
(_b = this.logger) === null || _b === void 0 ? void 0 : _b.info('Server path does not exist on disk');
|
|
44
|
+
this.logger?.info(`Resolving TypeScript version from path "${serverPath}"...`);
|
|
45
|
+
if (!fs.existsSync(serverPath)) {
|
|
46
|
+
this.logger?.info('Server path does not exist on disk');
|
|
53
47
|
return null;
|
|
54
48
|
}
|
|
55
|
-
const p = serverPath.split(
|
|
49
|
+
const p = serverPath.split(path.sep);
|
|
56
50
|
if (p.length <= 2) {
|
|
57
|
-
|
|
51
|
+
this.logger?.info('Server path is invalid (has less than two path components).');
|
|
58
52
|
return null;
|
|
59
53
|
}
|
|
60
54
|
const p2 = p.slice(0, -2);
|
|
61
|
-
const modulePath = p2.join(
|
|
62
|
-
let fileName =
|
|
63
|
-
if (!
|
|
55
|
+
const modulePath = p2.join(path.sep);
|
|
56
|
+
let fileName = path.join(modulePath, 'package.json');
|
|
57
|
+
if (!fs.existsSync(fileName)) {
|
|
64
58
|
// Special case for ts dev versions
|
|
65
|
-
if (
|
|
66
|
-
fileName =
|
|
59
|
+
if (path.basename(modulePath) === 'built') {
|
|
60
|
+
fileName = path.join(modulePath, '..', 'package.json');
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
|
-
if (!
|
|
70
|
-
|
|
63
|
+
if (!fs.existsSync(fileName)) {
|
|
64
|
+
this.logger?.info(`Failed to find package.json at path "${fileName}"`);
|
|
71
65
|
return null;
|
|
72
66
|
}
|
|
73
|
-
|
|
74
|
-
const contents =
|
|
67
|
+
this.logger?.info(`Reading version from package.json at "${fileName}"`);
|
|
68
|
+
const contents = fs.readFileSync(fileName).toString();
|
|
75
69
|
let desc = null;
|
|
76
70
|
try {
|
|
77
71
|
desc = JSON.parse(contents);
|
|
78
72
|
}
|
|
79
73
|
catch (err) {
|
|
80
|
-
|
|
74
|
+
this.logger?.info('Failed parsing contents of package.json.');
|
|
81
75
|
return null;
|
|
82
76
|
}
|
|
83
77
|
if (!desc || !desc.version) {
|
|
84
|
-
|
|
78
|
+
this.logger?.info('Failed reading version number from package.json.');
|
|
85
79
|
return null;
|
|
86
80
|
}
|
|
87
|
-
|
|
88
|
-
return
|
|
81
|
+
this.logger?.info(`Resolved TypeScript version to "${desc.version}"`);
|
|
82
|
+
return API.fromVersionString(desc.version);
|
|
89
83
|
}
|
|
90
84
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
class TypeScriptVersionProvider {
|
|
85
|
+
export const MODULE_FOLDERS = ['node_modules/typescript/lib', '.vscode/pnpify/typescript/lib', '.yarn/sdks/typescript/lib'];
|
|
86
|
+
export class TypeScriptVersionProvider {
|
|
94
87
|
constructor(configuration, logger) {
|
|
95
88
|
this.configuration = configuration;
|
|
96
89
|
this.logger = logger;
|
|
97
90
|
}
|
|
98
91
|
getUserSettingVersion() {
|
|
99
|
-
var _a, _b, _c, _d, _e, _f;
|
|
100
92
|
const { tsserverPath } = this.configuration || {};
|
|
101
93
|
if (!tsserverPath) {
|
|
102
94
|
return null;
|
|
103
95
|
}
|
|
104
|
-
|
|
96
|
+
this.logger?.info(`Resolving user-provided tsserver path "${tsserverPath}"...`);
|
|
105
97
|
let resolvedPath = tsserverPath;
|
|
106
98
|
// Resolve full path to the binary if path is not absolute.
|
|
107
|
-
if (!
|
|
108
|
-
const binaryPath =
|
|
99
|
+
if (!path.isAbsolute(resolvedPath)) {
|
|
100
|
+
const binaryPath = which.sync(tsserverPath, { nothrow: true });
|
|
109
101
|
if (binaryPath) {
|
|
110
102
|
resolvedPath = binaryPath;
|
|
111
103
|
}
|
|
112
|
-
|
|
104
|
+
this.logger?.info(`Non-absolute tsserver path resolved to "${binaryPath ? resolvedPath : '<failed>'}"`);
|
|
113
105
|
}
|
|
114
106
|
// Resolve symbolic link.
|
|
115
|
-
let stat =
|
|
116
|
-
if (stat
|
|
117
|
-
resolvedPath =
|
|
118
|
-
|
|
107
|
+
let stat = fs.lstatSync(resolvedPath, { throwIfNoEntry: false });
|
|
108
|
+
if (stat?.isSymbolicLink()) {
|
|
109
|
+
resolvedPath = fs.realpathSync(resolvedPath);
|
|
110
|
+
this.logger?.info(`Symbolic link tsserver path resolved to "${resolvedPath}"`);
|
|
119
111
|
}
|
|
120
112
|
// Get directory path
|
|
121
|
-
stat =
|
|
122
|
-
if (stat
|
|
123
|
-
resolvedPath =
|
|
124
|
-
|
|
113
|
+
stat = fs.lstatSync(resolvedPath, { throwIfNoEntry: false });
|
|
114
|
+
if (stat?.isFile()) {
|
|
115
|
+
resolvedPath = path.dirname(resolvedPath);
|
|
116
|
+
this.logger?.info(`Resolved directory path from a file path: ${resolvedPath}`);
|
|
125
117
|
}
|
|
126
118
|
// Resolve path to the "lib" dir.
|
|
127
119
|
try {
|
|
128
|
-
const packageJsonPath =
|
|
129
|
-
|
|
120
|
+
const packageJsonPath = pkgUpSync({ cwd: resolvedPath });
|
|
121
|
+
this.logger?.info(`Resolved package.json location: "${packageJsonPath}"`);
|
|
130
122
|
if (packageJsonPath) {
|
|
131
|
-
resolvedPath =
|
|
132
|
-
|
|
123
|
+
resolvedPath = path.join(path.dirname(packageJsonPath), 'lib');
|
|
124
|
+
this.logger?.info(`Assumed tsserver lib location: "${resolvedPath}"`);
|
|
133
125
|
}
|
|
134
126
|
}
|
|
135
|
-
catch
|
|
127
|
+
catch {
|
|
136
128
|
// ignore
|
|
137
129
|
}
|
|
138
|
-
return new TypeScriptVersion("user-setting" /* UserSetting */, resolvedPath, undefined, this.logger);
|
|
130
|
+
return new TypeScriptVersion("user-setting" /* TypeScriptVersionSource.UserSetting */, resolvedPath, undefined, this.logger);
|
|
139
131
|
}
|
|
140
132
|
getWorkspaceVersion(workspaceFolders) {
|
|
141
133
|
for (const p of workspaceFolders) {
|
|
142
|
-
const libFolder =
|
|
134
|
+
const libFolder = findPathToModule(p, MODULE_FOLDERS);
|
|
143
135
|
if (libFolder) {
|
|
144
|
-
const version = new TypeScriptVersion("workspace" /* Workspace */, libFolder);
|
|
136
|
+
const version = new TypeScriptVersion("workspace" /* TypeScriptVersionSource.Workspace */, libFolder);
|
|
145
137
|
if (version.isValid) {
|
|
146
138
|
return version;
|
|
147
139
|
}
|
|
@@ -150,9 +142,10 @@ class TypeScriptVersionProvider {
|
|
|
150
142
|
return null;
|
|
151
143
|
}
|
|
152
144
|
bundledVersion() {
|
|
145
|
+
const require = createRequire(import.meta.url);
|
|
153
146
|
try {
|
|
154
147
|
const file = require.resolve('typescript');
|
|
155
|
-
const bundledVersion = new TypeScriptVersion("bundled" /* Bundled */,
|
|
148
|
+
const bundledVersion = new TypeScriptVersion("bundled" /* TypeScriptVersionSource.Bundled */, path.dirname(file), '');
|
|
156
149
|
return bundledVersion;
|
|
157
150
|
}
|
|
158
151
|
catch (e) {
|
|
@@ -161,5 +154,4 @@ class TypeScriptVersionProvider {
|
|
|
161
154
|
}
|
|
162
155
|
}
|
|
163
156
|
}
|
|
164
|
-
exports.TypeScriptVersionProvider = TypeScriptVersionProvider;
|
|
165
157
|
//# sourceMappingURL=versionProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versionProvider.js","sourceRoot":"","sources":["../../src/utils/versionProvider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versionProvider.js","sourceRoot":"","sources":["../../src/utils/versionProvider.ts"],"names":[],"mappings":"AAAA;;;gGAG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|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAQ,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAa;IACxC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,CAAc;IAE7C,OAAO,aAGJ;CACN"}
|
package/lib/utils.js
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/*
|
|
3
2
|
* Copyright (C) 2017, 2018 TypeFox and others.
|
|
4
3
|
*
|
|
5
4
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
6
5
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
6
|
*/
|
|
8
|
-
|
|
9
|
-
exports.Deferred = void 0;
|
|
10
|
-
class Deferred {
|
|
7
|
+
export class Deferred {
|
|
11
8
|
constructor() {
|
|
9
|
+
this.resolve = (_) => { };
|
|
10
|
+
this.reject = (_) => { };
|
|
12
11
|
this.promise = new Promise((resolve, reject) => {
|
|
13
12
|
this.resolve = resolve;
|
|
14
13
|
this.reject = reject;
|
|
15
14
|
});
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
exports.Deferred = Deferred;
|
|
19
17
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,OAAO,QAAQ;IAArB;QACI,YAAO,GAAuB,CAAC,CAAC,EAAE,EAAE,GAAE,CAAC,CAAC;QACxC,WAAM,GAA4B,CAAC,CAAE,EAAE,EAAE,GAAE,CAAC,CAAC;QAE7C,YAAO,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;CAAA"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-language-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Language Server Protocol (LSP) implementation for TypeScript using tsserver",
|
|
5
5
|
"author": "TypeFox and others",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=12"
|
|
9
|
-
},
|
|
10
|
-
"eslintIgnore": [
|
|
11
|
-
"!.eslintrc.js"
|
|
12
|
-
],
|
|
13
7
|
"repository": {
|
|
14
8
|
"type": "git",
|
|
15
9
|
"url": "https://github.com/typescript-language-server/typescript-language-server.git"
|
|
16
10
|
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": ">=14.16"
|
|
14
|
+
},
|
|
17
15
|
"files": [
|
|
18
16
|
"lib"
|
|
19
17
|
],
|
|
@@ -22,16 +20,20 @@
|
|
|
22
20
|
},
|
|
23
21
|
"scripts": {
|
|
24
22
|
"clean": "rimraf lib *.tsbuildinfo",
|
|
25
|
-
"test": "cross-env TS_NODE_PROJECT=./tsconfig.json mocha
|
|
26
|
-
"test:watch": "cross-env TS_NODE_PROJECT=./tsconfig.json mocha --
|
|
27
|
-
"test:compiled": "
|
|
23
|
+
"test": "cross-env CONSOLE_LOG_LEVEL=warn TS_NODE_PROJECT=./tsconfig.json mocha",
|
|
24
|
+
"test:watch": "cross-env CONSOLE_LOG_LEVEL=warn TS_NODE_PROJECT=./tsconfig.json mocha --watch",
|
|
25
|
+
"test:compiled": "cross-env CONSOLE_LOG_LEVEL=warn mocha \"./lib/**/*.spec.js\"",
|
|
28
26
|
"lint": "eslint --ext \".js,.ts\" src",
|
|
27
|
+
"fix": "eslint --ext \".js,.ts\" --fix src",
|
|
29
28
|
"build": "concurrently -n compile,lint -c blue,green \"yarn compile\" \"yarn lint\"",
|
|
30
29
|
"compile": "tsc -b",
|
|
31
30
|
"watch": "tsc -b --watch --verbose",
|
|
32
31
|
"postversion": "git push --follow-tags",
|
|
33
32
|
"prepare": "cd test-data/jsx && yarn"
|
|
34
33
|
},
|
|
34
|
+
"eslintIgnore": [
|
|
35
|
+
"!.eslintrc.cjs"
|
|
36
|
+
],
|
|
35
37
|
"husky": {
|
|
36
38
|
"hooks": {
|
|
37
39
|
"pre-commit": "yarn lint && yarn build && yarn test:compiled",
|
|
@@ -39,35 +41,38 @@
|
|
|
39
41
|
}
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"commander": "^9.
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"vscode-languageserver
|
|
44
|
+
"commander": "^9.4.0",
|
|
45
|
+
"deepmerge": "^4.2.2",
|
|
46
|
+
"fs-extra": "^10.1.0",
|
|
47
|
+
"p-debounce": "^4.0.0",
|
|
48
|
+
"pkg-up": "^4.0.0",
|
|
49
|
+
"semver": "^7.3.7",
|
|
50
|
+
"tempy": "^3.0.0",
|
|
51
|
+
"vscode-languageserver": "^8.0.2",
|
|
52
|
+
"vscode-languageserver-protocol": "^3.17.2",
|
|
50
53
|
"vscode-languageserver-textdocument": "1.0.5",
|
|
51
|
-
"vscode-uri": "^3.0.
|
|
54
|
+
"vscode-uri": "^3.0.3",
|
|
52
55
|
"which": "^2.0.2"
|
|
53
56
|
},
|
|
54
57
|
"devDependencies": {
|
|
55
|
-
"@types/chai": "^4.
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
58
|
+
"@types/chai": "^4.3.3",
|
|
59
|
+
"@types/deepmerge": "^2.2.0",
|
|
60
|
+
"@types/fs-extra": "^9.0.13",
|
|
61
|
+
"@types/mocha": "^9.1.1",
|
|
62
|
+
"@types/node": "^16.11.52",
|
|
63
|
+
"@types/semver": "^7.3.12",
|
|
59
64
|
"@types/which": "^2.0.1",
|
|
60
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
61
|
-
"@typescript-eslint/parser": "^5.
|
|
62
|
-
"chai": "^4.3.
|
|
63
|
-
"concurrently": "^7.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "^5.33.1",
|
|
66
|
+
"@typescript-eslint/parser": "^5.33.1",
|
|
67
|
+
"chai": "^4.3.6",
|
|
68
|
+
"concurrently": "^7.3.0",
|
|
64
69
|
"cross-env": "^7.0.3",
|
|
65
|
-
"eslint": "^8.
|
|
66
|
-
"husky": "4.x
|
|
67
|
-
"mocha": "^
|
|
70
|
+
"eslint": "^8.22.0",
|
|
71
|
+
"husky": "4.x",
|
|
72
|
+
"mocha": "^10.0.0",
|
|
68
73
|
"rimraf": "^3.0.2",
|
|
69
|
-
"source-map-support": "^0.5.
|
|
70
|
-
"ts-node": "^10.
|
|
71
|
-
"typescript": "^4.4
|
|
74
|
+
"source-map-support": "^0.5.21",
|
|
75
|
+
"ts-node": "^10.9.1",
|
|
76
|
+
"typescript": "^4.7.4"
|
|
72
77
|
}
|
|
73
78
|
}
|