bimba-cli 0.7.14 → 0.7.15
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/package.json +1 -1
- package/typecheck.js +6 -2
package/package.json
CHANGED
package/typecheck.js
CHANGED
|
@@ -26,6 +26,10 @@ function canResolve(request, from) {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
function hasPackage(root, name) {
|
|
30
|
+
return fs.existsSync(path.join(root, name, 'package.json'));
|
|
31
|
+
}
|
|
32
|
+
|
|
29
33
|
function findTypeScript(cwd) {
|
|
30
34
|
const tsserver = canResolve('typescript/lib/tsserver.js', cwd);
|
|
31
35
|
if (tsserver) return tsserver;
|
|
@@ -35,7 +39,7 @@ function findTypeScript(cwd) {
|
|
|
35
39
|
|
|
36
40
|
function findPluginProbe(cwd) {
|
|
37
41
|
const localProbe = path.join(cwd, 'node_modules');
|
|
38
|
-
if (
|
|
42
|
+
if (hasPackage(localProbe, 'typescript-imba-plugin')) return localProbe;
|
|
39
43
|
|
|
40
44
|
const extensionRoots = [
|
|
41
45
|
path.join(os.homedir(), '.vscode', 'extensions'),
|
|
@@ -49,7 +53,7 @@ function findPluginProbe(cwd) {
|
|
|
49
53
|
|
|
50
54
|
for (const entry of fs.readdirSync(root)) {
|
|
51
55
|
const probe = path.join(root, entry, 'node_modules');
|
|
52
|
-
if (
|
|
56
|
+
if (hasPackage(probe, 'typescript-imba-plugin')) return probe;
|
|
53
57
|
}
|
|
54
58
|
}
|
|
55
59
|
|