which-webstorm 3.2.1 → 4.0.0
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/.gitattributes +0 -20
- package/README.md +2 -2
- package/bin/bin.js +5 -0
- package/bin/webstorm.js +25 -27
- package/output/cjs-shim.js +7 -0
- package/output/cjs-shim.js.map +1 -0
- package/output/main.js +2905 -0
- package/output/main.js.map +1 -0
- package/output/main.test.js +170 -0
- package/output/main.test.js.map +1 -0
- package/output/output/main.js +83 -0
- package/output/output/main.js.map +1 -0
- package/output/source/main.test.js +171 -0
- package/output/source/main.test.js.map +1 -0
- package/output/tsconfig.tsbuildinfo +1 -0
- package/package.json +50 -27
- package/.editorconfig +0 -28
- package/.github/workflows/qa.yml +0 -31
- package/.nyc_output/8b602563-2e0c-41d6-8ab7-f19f1e50f226.json +0 -1
- package/.nyc_output/d4c50289-7d1d-4075-a67e-aec2b3e247e5.json +0 -1
- package/.nyc_output/processinfo/8b602563-2e0c-41d6-8ab7-f19f1e50f226.json +0 -1
- package/.nyc_output/processinfo/d4c50289-7d1d-4075-a67e-aec2b3e247e5.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
- package/.prettierignore +0 -4
- package/.prettierrc.json +0 -1
- package/.vscode/settings.json +0 -6
- package/index.d.ts +0 -27
- package/index.js +0 -108
- package/renovate.json +0 -21
- package/test/test.js +0 -193
package/package.json
CHANGED
|
@@ -1,49 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/package.json",
|
|
2
3
|
"name": "which-webstorm",
|
|
3
|
-
"version": "
|
|
4
|
+
"version": "4.0.0",
|
|
4
5
|
"description": "Find WebStorm binary",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Oliver Salzburg <oliver.salzburg@gmail.com>",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/oliversalzburg/which-webstorm.git"
|
|
11
|
+
},
|
|
12
|
+
"type": "module",
|
|
5
13
|
"main": "index.js",
|
|
6
|
-
"types": "index.d.ts",
|
|
7
14
|
"bin": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
15
|
+
"which-webstorm": "index.js",
|
|
16
|
+
"wstorm": "bin/webstorm.js"
|
|
10
17
|
},
|
|
11
18
|
"scripts": {
|
|
19
|
+
"build": "node build.js",
|
|
20
|
+
"clean": "rm -rf ./output",
|
|
21
|
+
"lint": "yarn run lint:all",
|
|
22
|
+
"lint:all": "yarn run lint:eslint && yarn run lint:prettier && yarn run lint:tsc",
|
|
23
|
+
"lint:eslint": "eslint .",
|
|
24
|
+
"lint:prettier": "prettier --check .",
|
|
25
|
+
"lint:tsc": "tsc --noEmit",
|
|
12
26
|
"npm:publish": "npm publish",
|
|
27
|
+
"npm:publish:major": "npm version major && npm publish",
|
|
13
28
|
"npm:publish:minor": "npm version minor && npm publish",
|
|
14
29
|
"npm:publish:patch": "npm version patch && npm publish",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"test": "nyc mocha"
|
|
30
|
+
"test": "tsc && node $(yarn bin mocha) output/*.test.js",
|
|
31
|
+
"test:coverage": "tsc && c8 --reporter=html-spa node $(yarn bin mocha) output/*.test.js"
|
|
18
32
|
},
|
|
19
|
-
"
|
|
20
|
-
"webstorm"
|
|
21
|
-
],
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "https://github.com/oliversalzburg/which-webstorm.git"
|
|
25
|
-
},
|
|
26
|
-
"author": "Oliver Salzburg <oliver.salzburg@gmail.com>",
|
|
27
|
-
"license": "MIT",
|
|
33
|
+
"types": "index.d.ts",
|
|
28
34
|
"dependencies": {
|
|
35
|
+
"@oliversalzburg/js-utils": "0.0.28",
|
|
29
36
|
"execa": "8.0.1",
|
|
30
|
-
"semver": "7.
|
|
37
|
+
"semver": "7.6.0",
|
|
31
38
|
"which": "4.0.0"
|
|
32
39
|
},
|
|
33
40
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"@types/
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
41
|
+
"@eslint/js": "9.1.1",
|
|
42
|
+
"@types/chai": "4.3.14",
|
|
43
|
+
"@types/eslint": "8.56.10",
|
|
44
|
+
"@types/mocha": "10.0.6",
|
|
45
|
+
"@types/mock-fs": "4.13.4",
|
|
46
|
+
"@types/node": "20.12.7",
|
|
47
|
+
"@types/which": "3.0.3",
|
|
48
|
+
"c8": "9.1.0",
|
|
49
|
+
"chai": "5.1.0",
|
|
50
|
+
"esbuild": "0.20.2",
|
|
51
|
+
"eslint": "8.57.0",
|
|
52
|
+
"globals": "15.0.0",
|
|
53
|
+
"lint-staged": "15.2.2",
|
|
54
|
+
"mocha": "10.4.0",
|
|
39
55
|
"mock-fs": "5.2.0",
|
|
40
|
-
"
|
|
41
|
-
"prettier": "
|
|
56
|
+
"prettier": "3.2.5",
|
|
57
|
+
"prettier-package-json": "2.8.0",
|
|
58
|
+
"prettier-plugin-organize-imports": "3.2.4",
|
|
59
|
+
"typescript": "5.4.5",
|
|
60
|
+
"typescript-eslint": "7.7.1"
|
|
61
|
+
},
|
|
62
|
+
"keywords": [
|
|
63
|
+
"webstorm"
|
|
64
|
+
],
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">= 18"
|
|
42
67
|
},
|
|
43
68
|
"publishConfig": {
|
|
44
69
|
"registry": "https://registry.npmjs.org"
|
|
45
70
|
},
|
|
46
|
-
"
|
|
47
|
-
"node": ">=12"
|
|
48
|
-
}
|
|
71
|
+
"packageManager": "yarn@4.1.1"
|
|
49
72
|
}
|
package/.editorconfig
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# editorconfig.org
|
|
2
|
-
root = true
|
|
3
|
-
|
|
4
|
-
[*]
|
|
5
|
-
indent_style = tab
|
|
6
|
-
end_of_line = lf
|
|
7
|
-
charset = utf-8
|
|
8
|
-
trim_trailing_whitespace = true
|
|
9
|
-
insert_final_newline = true
|
|
10
|
-
continuation_indent = 4
|
|
11
|
-
|
|
12
|
-
[bower.json]
|
|
13
|
-
indent_style = space
|
|
14
|
-
indent_size = 2
|
|
15
|
-
|
|
16
|
-
[package.json]
|
|
17
|
-
indent_style = space
|
|
18
|
-
indent_size = 2
|
|
19
|
-
|
|
20
|
-
[*.md]
|
|
21
|
-
trim_trailing_whitespace = false
|
|
22
|
-
|
|
23
|
-
[*.{jade,pug}]
|
|
24
|
-
trim_trailing_whitespace = false
|
|
25
|
-
|
|
26
|
-
[*.yml]
|
|
27
|
-
indent_style = space
|
|
28
|
-
indent_size = 2
|
package/.github/workflows/qa.yml
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: QA
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
- main
|
|
8
|
-
pull_request:
|
|
9
|
-
branches:
|
|
10
|
-
- master
|
|
11
|
-
- main
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
qa:
|
|
15
|
-
name: Run QA
|
|
16
|
-
runs-on: windows-latest
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- name: Checkout
|
|
20
|
-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
21
|
-
|
|
22
|
-
- name: Select NodeJS version
|
|
23
|
-
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
|
|
24
|
-
with:
|
|
25
|
-
node-version: lts/*
|
|
26
|
-
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: npm ci
|
|
29
|
-
|
|
30
|
-
- name: Run tests
|
|
31
|
-
run: npm test
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"/home/oliver/projects/which-webstorm/index.js":{"path":"/home/oliver/projects/which-webstorm/index.js","statementMap":{"0":{"start":{"line":5,"column":11},"end":{"line":5,"column":24}},"1":{"start":{"line":6,"column":13},"end":{"line":6,"column":28}},"2":{"start":{"line":7,"column":14},"end":{"line":7,"column":30}},"3":{"start":{"line":8,"column":15},"end":{"line":8,"column":32}},"4":{"start":{"line":12,"column":2},"end":{"line":12,"column":68}},"5":{"start":{"line":16,"column":2},"end":{"line":21,"column":3}},"6":{"start":{"line":17,"column":3},"end":{"line":17,"column":44}},"7":{"start":{"line":20,"column":3},"end":{"line":20,"column":28}},"8":{"start":{"line":24,"column":2},"end":{"line":29,"column":3}},"9":{"start":{"line":25,"column":3},"end":{"line":25,"column":45}},"10":{"start":{"line":28,"column":3},"end":{"line":28,"column":28}},"11":{"start":{"line":33,"column":2},"end":{"line":33,"column":82}},"12":{"start":{"line":36,"column":2},"end":{"line":38,"column":4}},"13":{"start":{"line":42,"column":2},"end":{"line":48,"column":3}},"14":{"start":{"line":44,"column":4},"end":{"line":44,"column":64}},"15":{"start":{"line":47,"column":4},"end":{"line":47,"column":72}},"16":{"start":{"line":51,"column":2},"end":{"line":57,"column":3}},"17":{"start":{"line":53,"column":4},"end":{"line":53,"column":75}},"18":{"start":{"line":56,"column":4},"end":{"line":56,"column":72}},"19":{"start":{"line":61,"column":2},"end":{"line":82,"column":4}},"20":{"start":{"line":63,"column":23},"end":{"line":63,"column":46}},"21":{"start":{"line":65,"column":5},"end":{"line":71,"column":7}},"22":{"start":{"line":73,"column":27},"end":{"line":73,"column":51}},"23":{"start":{"line":75,"column":17},"end":{"line":75,"column":68}},"24":{"start":{"line":76,"column":5},"end":{"line":79,"column":7}},"25":{"start":{"line":86,"column":2},"end":{"line":86,"column":50}},"26":{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},"27":{"start":{"line":91,"column":3},"end":{"line":91,"column":41}},"28":{"start":{"line":93,"column":2},"end":{"line":93,"column":25}},"29":{"start":{"line":97,"column":0},"end":{"line":108,"column":1}},"30":{"start":{"line":98,"column":17},"end":{"line":98,"column":38}},"31":{"start":{"line":101,"column":1},"end":{"line":101,"column":58}},"32":{"start":{"line":102,"column":1},"end":{"line":102,"column":58}},"33":{"start":{"line":103,"column":1},"end":{"line":103,"column":70}},"34":{"start":{"line":105,"column":1},"end":{"line":105,"column":50}},"35":{"start":{"line":107,"column":1},"end":{"line":107,"column":82}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":1},"end":{"line":11,"column":2}},"loc":{"start":{"line":11,"column":18},"end":{"line":13,"column":2}},"line":11},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":1},"end":{"line":15,"column":2}},"loc":{"start":{"line":15,"column":16},"end":{"line":22,"column":2}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":23,"column":1},"end":{"line":23,"column":2}},"loc":{"start":{"line":23,"column":27},"end":{"line":30,"column":2}},"line":23},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":1},"end":{"line":32,"column":2}},"loc":{"start":{"line":32,"column":25},"end":{"line":34,"column":2}},"line":32},"4":{"name":"(anonymous_4)","decl":{"start":{"line":35,"column":1},"end":{"line":35,"column":2}},"loc":{"start":{"line":35,"column":30},"end":{"line":39,"column":2}},"line":35},"5":{"name":"(anonymous_5)","decl":{"start":{"line":41,"column":1},"end":{"line":41,"column":2}},"loc":{"start":{"line":41,"column":14},"end":{"line":49,"column":2}},"line":41},"6":{"name":"(anonymous_6)","decl":{"start":{"line":50,"column":1},"end":{"line":50,"column":2}},"loc":{"start":{"line":50,"column":25},"end":{"line":58,"column":2}},"line":50},"7":{"name":"(anonymous_7)","decl":{"start":{"line":60,"column":1},"end":{"line":60,"column":2}},"loc":{"start":{"line":60,"column":68},"end":{"line":83,"column":2}},"line":60},"8":{"name":"(anonymous_8)","decl":{"start":{"line":63,"column":12},"end":{"line":63,"column":13}},"loc":{"start":{"line":63,"column":23},"end":{"line":63,"column":46}},"line":63},"9":{"name":"(anonymous_9)","decl":{"start":{"line":64,"column":9},"end":{"line":64,"column":10}},"loc":{"start":{"line":64,"column":20},"end":{"line":72,"column":5}},"line":64},"10":{"name":"(anonymous_10)","decl":{"start":{"line":73,"column":12},"end":{"line":73,"column":13}},"loc":{"start":{"line":73,"column":27},"end":{"line":73,"column":51}},"line":73},"11":{"name":"(anonymous_11)","decl":{"start":{"line":74,"column":9},"end":{"line":74,"column":10}},"loc":{"start":{"line":74,"column":20},"end":{"line":80,"column":5}},"line":74},"12":{"name":"(anonymous_12)","decl":{"start":{"line":85,"column":1},"end":{"line":85,"column":2}},"loc":{"start":{"line":85,"column":19},"end":{"line":87,"column":2}},"line":85},"13":{"name":"(anonymous_13)","decl":{"start":{"line":89,"column":1},"end":{"line":89,"column":2}},"loc":{"start":{"line":89,"column":21},"end":{"line":94,"column":2}},"line":89}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":9},"end":{"line":12,"column":67}},"type":"cond-expr","locations":[{"start":{"line":12,"column":34},"end":{"line":12,"column":50}},{"start":{"line":12,"column":53},"end":{"line":12,"column":67}}],"line":12},"1":{"loc":{"start":{"line":42,"column":2},"end":{"line":48,"column":3}},"type":"switch","locations":[{"start":{"line":43,"column":3},"end":{"line":44,"column":64}},{"start":{"line":46,"column":3},"end":{"line":47,"column":72}}],"line":42},"2":{"loc":{"start":{"line":51,"column":2},"end":{"line":57,"column":3}},"type":"switch","locations":[{"start":{"line":52,"column":3},"end":{"line":53,"column":75}},{"start":{"line":55,"column":3},"end":{"line":56,"column":72}}],"line":51},"3":{"loc":{"start":{"line":60,"column":38},"end":{"line":60,"column":66}},"type":"default-arg","locations":[{"start":{"line":60,"column":62},"end":{"line":60,"column":66}}],"line":60},"4":{"loc":{"start":{"line":75,"column":17},"end":{"line":75,"column":68}},"type":"binary-expr","locations":[{"start":{"line":75,"column":17},"end":{"line":75,"column":56}},{"start":{"line":75,"column":60},"end":{"line":75,"column":68}}],"line":75},"5":{"loc":{"start":{"line":86,"column":9},"end":{"line":86,"column":49}},"type":"cond-expr","locations":[{"start":{"line":86,"column":43},"end":{"line":86,"column":45}},{"start":{"line":86,"column":48},"end":{"line":86,"column":49}}],"line":86},"6":{"loc":{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},"type":"if","locations":[{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},{"start":{"line":90,"column":2},"end":{"line":92,"column":3}}],"line":90},"7":{"loc":{"start":{"line":90,"column":6},"end":{"line":90,"column":33}},"type":"binary-expr","locations":[{"start":{"line":90,"column":6},"end":{"line":90,"column":14}},{"start":{"line":90,"column":18},"end":{"line":90,"column":33}}],"line":90},"8":{"loc":{"start":{"line":97,"column":0},"end":{"line":108,"column":1}},"type":"if","locations":[{"start":{"line":97,"column":0},"end":{"line":108,"column":1}},{"start":{"line":97,"column":0},"end":{"line":108,"column":1}}],"line":97}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":0,"6":0,"7":0,"8":1,"9":1,"10":1,"11":0,"12":0,"13":1,"14":0,"15":1,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":1,"30":0,"31":0,"32":0,"33":0,"34":0,"35":1},"f":{"0":1,"1":0,"2":1,"3":0,"4":0,"5":1,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"b":{"0":[1,0],"1":[0,1],"2":[0,0],"3":[0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,1]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"19cd7209151458d9545fd5123ff1c5abafd01e22","contentHash":"5faf9087c6c446d28bdcb32e27b502fec2bebe833a5bfacba2b941bc0e0a05c7"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"/home/oliver/projects/which-webstorm/index.js":{"path":"/home/oliver/projects/which-webstorm/index.js","statementMap":{"0":{"start":{"line":5,"column":11},"end":{"line":5,"column":24}},"1":{"start":{"line":6,"column":13},"end":{"line":6,"column":28}},"2":{"start":{"line":7,"column":14},"end":{"line":7,"column":30}},"3":{"start":{"line":8,"column":15},"end":{"line":8,"column":32}},"4":{"start":{"line":12,"column":2},"end":{"line":12,"column":68}},"5":{"start":{"line":16,"column":2},"end":{"line":21,"column":3}},"6":{"start":{"line":17,"column":3},"end":{"line":17,"column":44}},"7":{"start":{"line":20,"column":3},"end":{"line":20,"column":28}},"8":{"start":{"line":24,"column":2},"end":{"line":29,"column":3}},"9":{"start":{"line":25,"column":3},"end":{"line":25,"column":45}},"10":{"start":{"line":28,"column":3},"end":{"line":28,"column":28}},"11":{"start":{"line":33,"column":2},"end":{"line":33,"column":82}},"12":{"start":{"line":36,"column":2},"end":{"line":38,"column":4}},"13":{"start":{"line":42,"column":2},"end":{"line":48,"column":3}},"14":{"start":{"line":44,"column":4},"end":{"line":44,"column":64}},"15":{"start":{"line":47,"column":4},"end":{"line":47,"column":72}},"16":{"start":{"line":51,"column":2},"end":{"line":57,"column":3}},"17":{"start":{"line":53,"column":4},"end":{"line":53,"column":75}},"18":{"start":{"line":56,"column":4},"end":{"line":56,"column":72}},"19":{"start":{"line":61,"column":2},"end":{"line":82,"column":4}},"20":{"start":{"line":63,"column":23},"end":{"line":63,"column":46}},"21":{"start":{"line":65,"column":5},"end":{"line":71,"column":7}},"22":{"start":{"line":73,"column":27},"end":{"line":73,"column":51}},"23":{"start":{"line":75,"column":17},"end":{"line":75,"column":68}},"24":{"start":{"line":76,"column":5},"end":{"line":79,"column":7}},"25":{"start":{"line":86,"column":2},"end":{"line":86,"column":50}},"26":{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},"27":{"start":{"line":91,"column":3},"end":{"line":91,"column":41}},"28":{"start":{"line":93,"column":2},"end":{"line":93,"column":25}},"29":{"start":{"line":97,"column":0},"end":{"line":108,"column":1}},"30":{"start":{"line":98,"column":17},"end":{"line":98,"column":38}},"31":{"start":{"line":101,"column":1},"end":{"line":101,"column":58}},"32":{"start":{"line":102,"column":1},"end":{"line":102,"column":58}},"33":{"start":{"line":103,"column":1},"end":{"line":103,"column":70}},"34":{"start":{"line":105,"column":1},"end":{"line":105,"column":50}},"35":{"start":{"line":107,"column":1},"end":{"line":107,"column":82}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":11,"column":1},"end":{"line":11,"column":2}},"loc":{"start":{"line":11,"column":18},"end":{"line":13,"column":2}},"line":11},"1":{"name":"(anonymous_1)","decl":{"start":{"line":15,"column":1},"end":{"line":15,"column":2}},"loc":{"start":{"line":15,"column":16},"end":{"line":22,"column":2}},"line":15},"2":{"name":"(anonymous_2)","decl":{"start":{"line":23,"column":1},"end":{"line":23,"column":2}},"loc":{"start":{"line":23,"column":27},"end":{"line":30,"column":2}},"line":23},"3":{"name":"(anonymous_3)","decl":{"start":{"line":32,"column":1},"end":{"line":32,"column":2}},"loc":{"start":{"line":32,"column":25},"end":{"line":34,"column":2}},"line":32},"4":{"name":"(anonymous_4)","decl":{"start":{"line":35,"column":1},"end":{"line":35,"column":2}},"loc":{"start":{"line":35,"column":30},"end":{"line":39,"column":2}},"line":35},"5":{"name":"(anonymous_5)","decl":{"start":{"line":41,"column":1},"end":{"line":41,"column":2}},"loc":{"start":{"line":41,"column":14},"end":{"line":49,"column":2}},"line":41},"6":{"name":"(anonymous_6)","decl":{"start":{"line":50,"column":1},"end":{"line":50,"column":2}},"loc":{"start":{"line":50,"column":25},"end":{"line":58,"column":2}},"line":50},"7":{"name":"(anonymous_7)","decl":{"start":{"line":60,"column":1},"end":{"line":60,"column":2}},"loc":{"start":{"line":60,"column":68},"end":{"line":83,"column":2}},"line":60},"8":{"name":"(anonymous_8)","decl":{"start":{"line":63,"column":12},"end":{"line":63,"column":13}},"loc":{"start":{"line":63,"column":23},"end":{"line":63,"column":46}},"line":63},"9":{"name":"(anonymous_9)","decl":{"start":{"line":64,"column":9},"end":{"line":64,"column":10}},"loc":{"start":{"line":64,"column":20},"end":{"line":72,"column":5}},"line":64},"10":{"name":"(anonymous_10)","decl":{"start":{"line":73,"column":12},"end":{"line":73,"column":13}},"loc":{"start":{"line":73,"column":27},"end":{"line":73,"column":51}},"line":73},"11":{"name":"(anonymous_11)","decl":{"start":{"line":74,"column":9},"end":{"line":74,"column":10}},"loc":{"start":{"line":74,"column":20},"end":{"line":80,"column":5}},"line":74},"12":{"name":"(anonymous_12)","decl":{"start":{"line":85,"column":1},"end":{"line":85,"column":2}},"loc":{"start":{"line":85,"column":19},"end":{"line":87,"column":2}},"line":85},"13":{"name":"(anonymous_13)","decl":{"start":{"line":89,"column":1},"end":{"line":89,"column":2}},"loc":{"start":{"line":89,"column":21},"end":{"line":94,"column":2}},"line":89}},"branchMap":{"0":{"loc":{"start":{"line":12,"column":9},"end":{"line":12,"column":67}},"type":"cond-expr","locations":[{"start":{"line":12,"column":34},"end":{"line":12,"column":50}},{"start":{"line":12,"column":53},"end":{"line":12,"column":67}}],"line":12},"1":{"loc":{"start":{"line":42,"column":2},"end":{"line":48,"column":3}},"type":"switch","locations":[{"start":{"line":43,"column":3},"end":{"line":44,"column":64}},{"start":{"line":46,"column":3},"end":{"line":47,"column":72}}],"line":42},"2":{"loc":{"start":{"line":51,"column":2},"end":{"line":57,"column":3}},"type":"switch","locations":[{"start":{"line":52,"column":3},"end":{"line":53,"column":75}},{"start":{"line":55,"column":3},"end":{"line":56,"column":72}}],"line":51},"3":{"loc":{"start":{"line":60,"column":38},"end":{"line":60,"column":66}},"type":"default-arg","locations":[{"start":{"line":60,"column":62},"end":{"line":60,"column":66}}],"line":60},"4":{"loc":{"start":{"line":75,"column":17},"end":{"line":75,"column":68}},"type":"binary-expr","locations":[{"start":{"line":75,"column":17},"end":{"line":75,"column":56}},{"start":{"line":75,"column":60},"end":{"line":75,"column":68}}],"line":75},"5":{"loc":{"start":{"line":86,"column":9},"end":{"line":86,"column":49}},"type":"cond-expr","locations":[{"start":{"line":86,"column":43},"end":{"line":86,"column":45}},{"start":{"line":86,"column":48},"end":{"line":86,"column":49}}],"line":86},"6":{"loc":{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},"type":"if","locations":[{"start":{"line":90,"column":2},"end":{"line":92,"column":3}},{"start":{"line":90,"column":2},"end":{"line":92,"column":3}}],"line":90},"7":{"loc":{"start":{"line":90,"column":6},"end":{"line":90,"column":33}},"type":"binary-expr","locations":[{"start":{"line":90,"column":6},"end":{"line":90,"column":14}},{"start":{"line":90,"column":18},"end":{"line":90,"column":33}}],"line":90},"8":{"loc":{"start":{"line":97,"column":0},"end":{"line":108,"column":1}},"type":"if","locations":[{"start":{"line":97,"column":0},"end":{"line":108,"column":1}},{"start":{"line":97,"column":0},"end":{"line":108,"column":1}}],"line":97}},"s":{"0":1,"1":1,"2":1,"3":1,"4":6,"5":2,"6":2,"7":2,"8":2,"9":2,"10":2,"11":0,"12":0,"13":4,"14":0,"15":4,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":0},"f":{"0":6,"1":2,"2":2,"3":0,"4":0,"5":4,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0},"b":{"0":[5,1],"1":[0,4],"2":[0,0],"3":[0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[1,0]},"_coverageSchema":"1a1c01bbd47fc00a2c39e90264f33305004495a9","hash":"19cd7209151458d9545fd5123ff1c5abafd01e22","contentHash":"5faf9087c6c446d28bdcb32e27b502fec2bebe833a5bfacba2b941bc0e0a05c7"}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"parent":"d4c50289-7d1d-4075-a67e-aec2b3e247e5","pid":12300,"argv":["/usr/local/bin/node","/home/oliver/projects/which-webstorm/index.js"],"execArgv":[],"cwd":"/home/oliver/projects/which-webstorm","time":1697974536586,"ppid":12277,"coverageFilename":"/home/oliver/projects/which-webstorm/.nyc_output/8b602563-2e0c-41d6-8ab7-f19f1e50f226.json","externalId":"","uuid":"8b602563-2e0c-41d6-8ab7-f19f1e50f226","files":["/home/oliver/projects/which-webstorm/index.js"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"parent":null,"pid":12277,"argv":["/usr/local/bin/node","/home/oliver/projects/which-webstorm/node_modules/.bin/mocha"],"execArgv":[],"cwd":"/home/oliver/projects/which-webstorm","time":1697974535564,"ppid":12248,"coverageFilename":"/home/oliver/projects/which-webstorm/.nyc_output/d4c50289-7d1d-4075-a67e-aec2b3e247e5.json","externalId":"","uuid":"d4c50289-7d1d-4075-a67e-aec2b3e247e5","files":["/home/oliver/projects/which-webstorm/index.js"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"processes":{"8b602563-2e0c-41d6-8ab7-f19f1e50f226":{"parent":"d4c50289-7d1d-4075-a67e-aec2b3e247e5","children":[]},"d4c50289-7d1d-4075-a67e-aec2b3e247e5":{"parent":null,"children":["8b602563-2e0c-41d6-8ab7-f19f1e50f226"]}},"files":{"/home/oliver/projects/which-webstorm/index.js":["8b602563-2e0c-41d6-8ab7-f19f1e50f226","d4c50289-7d1d-4075-a67e-aec2b3e247e5"]},"externalIds":{}}
|
package/.prettierignore
DELETED
package/.prettierrc.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
package/.vscode/settings.json
DELETED
package/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import * as fs from "fs";
|
|
3
|
-
declare module "which-webstorm" {
|
|
4
|
-
type findWebstormAsync = () => Promise<string>;
|
|
5
|
-
type findWebstormSync = {
|
|
6
|
-
sync: () => string;
|
|
7
|
-
webstormBinary: () => string;
|
|
8
|
-
};
|
|
9
|
-
const findWebstorm: findWebstormAsync & findWebstormSync;
|
|
10
|
-
|
|
11
|
-
type readDirResult = string[] | Buffer[] | fs.Dirent[];
|
|
12
|
-
|
|
13
|
-
export class WebStormLocator {
|
|
14
|
-
webstormBinary: () => string;
|
|
15
|
-
findWebstorm: () => string;
|
|
16
|
-
findWebstormAsync: () => Promise<string>;
|
|
17
|
-
findJetbrainsProducts: () => readDirResult;
|
|
18
|
-
findJetbrainsProductsAsync: () => Promise<readDirResult>;
|
|
19
|
-
findManual: () => string;
|
|
20
|
-
findManualAsync: () => string;
|
|
21
|
-
findManualWindows: (
|
|
22
|
-
jetbrainsProducts: readDirResult,
|
|
23
|
-
validateSynchronously: boolean
|
|
24
|
-
) => string;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export default findWebstorm;
|
package/index.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
"use strict";
|
|
4
|
-
|
|
5
|
-
const fs = require("fs");
|
|
6
|
-
const path = require("path");
|
|
7
|
-
const which = require("which");
|
|
8
|
-
const semver = require("semver");
|
|
9
|
-
|
|
10
|
-
class WebStormLocator {
|
|
11
|
-
webstormBinary() {
|
|
12
|
-
return process.arch === "x64" ? "webstorm64.exe" : "webstorm.exe";
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
findWebstorm() {
|
|
16
|
-
try {
|
|
17
|
-
return which.sync(this.webstormBinary());
|
|
18
|
-
} catch (error) {
|
|
19
|
-
// Not found on PATH, attempt manual lookup.
|
|
20
|
-
return this.findManual();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async findWebstormAsync() {
|
|
24
|
-
try {
|
|
25
|
-
return await which(this.webstormBinary());
|
|
26
|
-
} catch (error) {
|
|
27
|
-
// Not found on PATH, attempt manual lookup.
|
|
28
|
-
return this.findManual();
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
findJetbrainsProducts() {
|
|
33
|
-
return fs.readdirSync(path.join(process.env["ProgramFiles(x86)"], "JetBrains"));
|
|
34
|
-
}
|
|
35
|
-
findJetbrainsProductsAsync() {
|
|
36
|
-
return fs.promises.readdir(
|
|
37
|
-
path.join(process.env["ProgramFiles(x86)"], "JetBrains")
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
findManual() {
|
|
42
|
-
switch (process.platform) {
|
|
43
|
-
case "win32":
|
|
44
|
-
return this.findManualWindows(this.findJetbrainsProducts());
|
|
45
|
-
|
|
46
|
-
default:
|
|
47
|
-
throw new Error(`Platform '${process.platform}' is not supported.`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
async findManualAsync() {
|
|
51
|
-
switch (process.platform) {
|
|
52
|
-
case "win32":
|
|
53
|
-
return this.findManualWindows(await this.findJetbrainsProductsAsync());
|
|
54
|
-
|
|
55
|
-
default:
|
|
56
|
-
throw new Error(`Platform '${process.platform}' is not supported.`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
findManualWindows(jetbrainsProducts, validateSynchronously = true) {
|
|
61
|
-
return this._getLatest(
|
|
62
|
-
jetbrainsProducts
|
|
63
|
-
.filter((entry) => entry.match(/WebStorm/))
|
|
64
|
-
.map((entry) => {
|
|
65
|
-
return path.join(
|
|
66
|
-
process.env["ProgramFiles(x86)"],
|
|
67
|
-
"JetBrains",
|
|
68
|
-
entry,
|
|
69
|
-
"bin",
|
|
70
|
-
this.webstormBinary()
|
|
71
|
-
);
|
|
72
|
-
})
|
|
73
|
-
.filter((candidate) => fs.existsSync(candidate))
|
|
74
|
-
.map((entry) => {
|
|
75
|
-
const ver = entry.match(/WebStorm[^0-9]([0-9\.]+)/) || ["", ""];
|
|
76
|
-
return {
|
|
77
|
-
version: semver.valid(semver.coerce(ver[1])),
|
|
78
|
-
path: entry,
|
|
79
|
-
};
|
|
80
|
-
})
|
|
81
|
-
.sort(this._customSort)
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
_customSort(a, b) {
|
|
86
|
-
return semver.gt(a.version, b.version) ? -1 : 1;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
_getLatest(entries) {
|
|
90
|
-
if (!entries || !entries.length) {
|
|
91
|
-
throw new Error("WebStorm not found");
|
|
92
|
-
}
|
|
93
|
-
return entries[0].path;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (module.parent) {
|
|
98
|
-
const locator = new WebStormLocator();
|
|
99
|
-
|
|
100
|
-
// For compatibility with older versions, export a matching interface.
|
|
101
|
-
module.exports = locator.findWebstormAsync.bind(locator);
|
|
102
|
-
module.exports.sync = locator.findWebstorm.bind(locator);
|
|
103
|
-
module.exports.webstormBinary = locator.webstormBinary.bind(locator);
|
|
104
|
-
// Also export the class itself for external consumption.
|
|
105
|
-
module.exports.WebStormLocator = WebStormLocator;
|
|
106
|
-
} else {
|
|
107
|
-
new WebStormLocator().findWebstormAsync().then(console.log).catch(console.error);
|
|
108
|
-
}
|
package/renovate.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
3
|
-
"branchConcurrentLimit": 0,
|
|
4
|
-
"extends": ["config:recommended", ":disableDependencyDashboard"],
|
|
5
|
-
"lockFileMaintenance": {
|
|
6
|
-
"enabled": true,
|
|
7
|
-
"automerge": true
|
|
8
|
-
},
|
|
9
|
-
"packageRules": [
|
|
10
|
-
{
|
|
11
|
-
"matchDepTypes": ["devDependencies"],
|
|
12
|
-
"matchPackagePatterns": ["^@types/"],
|
|
13
|
-
"automerge": true
|
|
14
|
-
}
|
|
15
|
-
],
|
|
16
|
-
"pinDigests": true,
|
|
17
|
-
"postUpdateOptions": ["yarnDedupeHighest"],
|
|
18
|
-
"prConcurrentLimit": 0,
|
|
19
|
-
"prHourlyLimit": 0,
|
|
20
|
-
"rangeStrategy": "pin"
|
|
21
|
-
}
|
package/test/test.js
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const mocha = require("mocha");
|
|
4
|
-
|
|
5
|
-
const after = mocha.after;
|
|
6
|
-
const before = mocha.before;
|
|
7
|
-
const chai = require("chai");
|
|
8
|
-
const chaiAsPromised = require("chai-as-promised");
|
|
9
|
-
const chaiExec = require("@jsdevtools/chai-exec");
|
|
10
|
-
const describe = mocha.describe;
|
|
11
|
-
const expect = require("chai").expect;
|
|
12
|
-
const it = mocha.it;
|
|
13
|
-
const mockFs = require("mock-fs");
|
|
14
|
-
|
|
15
|
-
chai.use(chaiAsPromised);
|
|
16
|
-
chai.use(chaiExec);
|
|
17
|
-
|
|
18
|
-
describe("which-webstorm", () => {
|
|
19
|
-
const whichWebstorm = require("..");
|
|
20
|
-
|
|
21
|
-
describe("x86", () => {
|
|
22
|
-
let originalArch;
|
|
23
|
-
before(() => {
|
|
24
|
-
originalArch = process.arch;
|
|
25
|
-
Object.defineProperty(process, "arch", {
|
|
26
|
-
value: "x86",
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
after(() => {
|
|
30
|
-
Object.defineProperty(process, "arch", {
|
|
31
|
-
value: originalArch,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
it("should return the x86 binary name", () => {
|
|
35
|
-
expect(whichWebstorm.webstormBinary()).to.equal("webstorm.exe");
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
describe("x64", () => {
|
|
40
|
-
let originalArch;
|
|
41
|
-
before(() => {
|
|
42
|
-
originalArch = process.arch;
|
|
43
|
-
Object.defineProperty(process, "arch", {
|
|
44
|
-
value: "x64",
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
after(() => {
|
|
48
|
-
Object.defineProperty(process, "arch", {
|
|
49
|
-
value: originalArch,
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
it("should return the x64 binary name", () => {
|
|
53
|
-
expect(whichWebstorm.webstormBinary()).to.equal("webstorm64.exe");
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe("eap directory (async)", () => {
|
|
58
|
-
let originalArch;
|
|
59
|
-
before(() => {
|
|
60
|
-
originalArch = process.arch;
|
|
61
|
-
Object.defineProperty(process, "arch", {
|
|
62
|
-
value: "x64",
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
after(() => {
|
|
66
|
-
Object.defineProperty(process, "arch", {
|
|
67
|
-
value: originalArch,
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
before(() =>
|
|
72
|
-
mockFs({
|
|
73
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 163.9999\\bin\\webstorm64.exe":
|
|
74
|
-
"foo",
|
|
75
|
-
})
|
|
76
|
-
);
|
|
77
|
-
after(() => mockFs.restore());
|
|
78
|
-
|
|
79
|
-
it("should return the webstorm binary", () => {
|
|
80
|
-
return expect(whichWebstorm()).to.eventually.equal(
|
|
81
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 163.9999\\bin\\webstorm64.exe"
|
|
82
|
-
);
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
describe("eap directory", () => {
|
|
87
|
-
let originalArch;
|
|
88
|
-
before(() => {
|
|
89
|
-
originalArch = process.arch;
|
|
90
|
-
Object.defineProperty(process, "arch", {
|
|
91
|
-
value: "x64",
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
after(() => {
|
|
95
|
-
Object.defineProperty(process, "arch", {
|
|
96
|
-
value: originalArch,
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
before(() =>
|
|
101
|
-
mockFs({
|
|
102
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 163.9999\\bin\\webstorm64.exe":
|
|
103
|
-
"foo",
|
|
104
|
-
})
|
|
105
|
-
);
|
|
106
|
-
after(() => mockFs.restore());
|
|
107
|
-
|
|
108
|
-
it("should return the webstorm binary", () => {
|
|
109
|
-
return expect(whichWebstorm.sync()).to.equal(
|
|
110
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 163.9999\\bin\\webstorm64.exe"
|
|
111
|
-
);
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
describe("return latest", () => {
|
|
116
|
-
let originalArch;
|
|
117
|
-
before(() => {
|
|
118
|
-
originalArch = process.arch;
|
|
119
|
-
Object.defineProperty(process, "arch", {
|
|
120
|
-
value: "x64",
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
after(() => {
|
|
124
|
-
Object.defineProperty(process, "arch", {
|
|
125
|
-
value: originalArch,
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
before(() =>
|
|
130
|
-
mockFs({
|
|
131
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.1\\bin\\webstorm64.exe":
|
|
132
|
-
"foo",
|
|
133
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 17.9.0\\bin\\webstorm64.exe":
|
|
134
|
-
"foo",
|
|
135
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.1.4\\bin\\webstorm64.exe":
|
|
136
|
-
"foo",
|
|
137
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.2\\bin\\webstorm64.exe":
|
|
138
|
-
"foo",
|
|
139
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 163.9999\\bin\\webstorm64.exe":
|
|
140
|
-
"foo",
|
|
141
|
-
})
|
|
142
|
-
);
|
|
143
|
-
after(() => mockFs.restore());
|
|
144
|
-
|
|
145
|
-
it("should return the LATEST webstorm binary", () => {
|
|
146
|
-
return expect(whichWebstorm.sync()).to.equal(
|
|
147
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.2\\bin\\webstorm64.exe"
|
|
148
|
-
);
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
describe("return latest (async)", () => {
|
|
152
|
-
let originalArch;
|
|
153
|
-
before(() => {
|
|
154
|
-
originalArch = process.arch;
|
|
155
|
-
Object.defineProperty(process, "arch", {
|
|
156
|
-
value: "x64",
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
after(() => {
|
|
160
|
-
Object.defineProperty(process, "arch", {
|
|
161
|
-
value: originalArch,
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
before(() =>
|
|
166
|
-
mockFs({
|
|
167
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.1\\bin\\webstorm64.exe":
|
|
168
|
-
"foo",
|
|
169
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 17.9.0\\bin\\webstorm64.exe":
|
|
170
|
-
"foo",
|
|
171
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.1.4\\bin\\webstorm64.exe":
|
|
172
|
-
"foo",
|
|
173
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.2\\bin\\webstorm64.exe":
|
|
174
|
-
"foo",
|
|
175
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 163.9999\\bin\\webstorm64.exe":
|
|
176
|
-
"foo",
|
|
177
|
-
})
|
|
178
|
-
);
|
|
179
|
-
after(() => mockFs.restore());
|
|
180
|
-
|
|
181
|
-
it("should return the LATEST webstorm binary", () => {
|
|
182
|
-
return expect(whichWebstorm()).to.eventually.equal(
|
|
183
|
-
"C:\\Program Files (x86)\\JetBrains\\WebStorm 2020.2\\bin\\webstorm64.exe"
|
|
184
|
-
);
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
describe("CLI", () => {
|
|
188
|
-
it("should not throw when being executed", () => {
|
|
189
|
-
const cli = chaiExec("node index.js");
|
|
190
|
-
return expect(cli).to.exit.with.code(0);
|
|
191
|
-
});
|
|
192
|
-
});
|
|
193
|
-
});
|