which-webstorm 3.2.2 → 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 +6 -0
- 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/.prettierrc.json +0 -1
- package/index.d.ts +0 -27
- package/index.js +0 -108
- package/test/test.js +0 -193
package/.gitattributes
ADDED
package/README.md
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Finds WebStorm
|
|
4
4
|
|
|
5
|
-
[](https://github.com/oliversalzburg/which-webstorm/actions/workflows/test.yml)
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
9
|
### As a module
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
-
|
|
12
|
+
import whichWebstorm from "which-webstorm";
|
|
13
13
|
console.log(await whichWebstorm()); // prints path to WebStorm binary
|
|
14
14
|
console.log(whichWebstorm.sync()); // prints path to WebStorm binary
|
|
15
15
|
```
|
package/bin/bin.js
ADDED
package/bin/webstorm.js
CHANGED
|
@@ -1,34 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { execa } from "execa";
|
|
4
|
+
import { statSync } from "node:fs";
|
|
5
|
+
import { resolve } from "node:path";
|
|
6
|
+
import { WebStormLocator } from "../output/main.js";
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const path = require("path");
|
|
8
|
-
const whichWebstorm = require("..");
|
|
8
|
+
new WebStormLocator().findWebstormAsync().then(webstorm => {
|
|
9
|
+
const args = process.argv.splice(2);
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
if (args.length) {
|
|
12
|
+
return Promise.all(
|
|
13
|
+
args.map(arg => {
|
|
14
|
+
// Attempt to construct absolute path.
|
|
15
|
+
// This ensures that WebStorm doesn't try to resolve paths relative to
|
|
16
|
+
// the location where the webstorm binary is located.
|
|
17
|
+
const fullPath = resolve(arg);
|
|
18
|
+
if (statSync(fullPath)) {
|
|
19
|
+
arg = fullPath;
|
|
20
|
+
}
|
|
12
21
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const fullPath = path.resolve(arg);
|
|
20
|
-
if (fs.statSync(fullPath)) {
|
|
21
|
-
arg = fullPath;
|
|
22
|
-
}
|
|
22
|
+
return execa(webstorm, [arg], {
|
|
23
|
+
cwd: process.cwd(),
|
|
24
|
+
});
|
|
25
|
+
}),
|
|
26
|
+
);
|
|
27
|
+
}
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
})
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return execa(webstorm, {
|
|
32
|
-
cwd: process.cwd(),
|
|
33
|
-
});
|
|
29
|
+
return execa(webstorm, {
|
|
30
|
+
cwd: process.cwd(),
|
|
31
|
+
});
|
|
34
32
|
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import url from "node:url";
|
|
4
|
+
globalThis.require = createRequire(import.meta.url);
|
|
5
|
+
globalThis.__filename = url.fileURLToPath(import.meta.url);
|
|
6
|
+
globalThis.__dirname = path.dirname(__filename);
|
|
7
|
+
//# sourceMappingURL=cjs-shim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cjs-shim.js","sourceRoot":"","sources":["../source/cjs-shim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,GAAG,MAAM,UAAU,CAAC;AAE3B,UAAU,CAAC,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpD,UAAU,CAAC,UAAU,GAAG,GAAG,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC3D,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC"}
|