Skip to content

Commit d3da456

Browse files
committed
fix: add .exe for windows
1 parent 9290e94 commit d3da456

File tree

18 files changed

+192
-53
lines changed

18 files changed

+192
-53
lines changed

.vscode/launch.template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"autoAttachChildProcesses": true,
1313
"outFiles": [
14-
"${workspaceFolder}/packages/vscode-extension/out/**/*.js"
14+
"${workspaceFolder}/packages/vscode-extension/dist/**/*.js"
1515
],
1616
"preLaunchTask": "npm: watch - packages/vscode-extension"
1717
}

npm/darwin-arm64/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "@rslint/darwin-arm64",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"exports": {
6+
"./bin": "./rslint"
7+
},
58
"description": "binary for rslint",
69
"homepage": "https://rslint.rs",
710
"bugs": "https://github.com/web-infra-dev/rslint/issues",

npm/darwin-x64/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "@rslint/darwin-x64",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"exports": {
6+
"./bin": "./rslint"
7+
},
58
"description": "binary for rslint",
69
"bugs": "https://github.com/web-infra-dev/rslint/issues",
710
"repository": {

npm/linux-arm64/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "@rslint/linux-arm64",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"exports": {
6+
"./bin": "./rslint"
7+
},
58
"description": "binary for rslint",
69
"bugs": "https://github.com/web-infra-dev/rslint/issues",
710
"repository": {

npm/linux-x64/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "@rslint/linux-x64",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"exports": {
6+
"./bin": "./rslint"
7+
},
58
"description": "binary for rslint",
69
"bugs": "https://github.com/web-infra-dev/rslint/issues",
710
"repository": {

npm/win32-arm64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "@rslint/win32-arm64",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"exports": {
6+
"./bin": "./rslint.exe"
7+
},
58
"description": "binary for rslint",
69
"bugs": "https://github.com/web-infra-dev/rslint/issues",
710
"repository": {
@@ -15,7 +18,7 @@
1518
]
1619
},
1720
"files": [
18-
"rslint"
21+
"rslint.exe"
1922
],
2023
"os": [
2124
"win32"

npm/win32-x64/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
"name": "@rslint/win32-x64",
33
"version": "0.1.1",
44
"license": "MIT",
5+
"exports": {
6+
"./bin": "./rslint.exe"
7+
},
58
"description": "binary for rslint",
69
"bugs": "https://github.com/web-infra-dev/rslint/issues",
710
"repository": {
@@ -15,7 +18,7 @@
1518
]
1619
},
1720
"files": [
18-
"rslint"
21+
"rslint.exe"
1922
],
2023
"os": [
2124
"win32"

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"license": "MIT",
1515
"scripts": {
1616
"build": "pnpm -r build",
17-
"build:npm": "zx scripts/build-npm.mjs",
17+
"build:npm:all": "zx scripts/build-npm.mjs all",
18+
"build:npm:current": "zx scripts/build-npm.mjs current",
1819
"version": "zx scripts/version.mjs",
1920
"release": "pnpm publish -r --no-git-checks",
2021
"publish:vsce": "zx scripts/publish-marketplace.mjs",

packages/rslint/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

packages/rslint/bin/rslint.cjs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
#!/usr/bin/env node
2-
const path = require('node:path');
32
const os = require('node:os');
4-
const fs = require('node:fs');
5-
function getBinPath() {
6-
if (fs.existsSync(path.resolve(__dirname, './rslint'))) {
7-
return path.resolve(__dirname, './rslint');
8-
}
9-
let platformKey = `${process.platform}-${os.arch()}`;
103

11-
return require.resolve(`@rslint/${platformKey}/rslint`);
12-
}
134
function main() {
14-
const binPath = getBinPath();
5+
const binPath = require.resolve(`@rslint/${os.platform()}-${os.arch()}/bin`);
6+
157
try {
168
require('child_process').execFileSync(binPath, process.argv.slice(2), {
179
stdio: 'inherit',
@@ -26,4 +18,5 @@ function main() {
2618
}
2719
}
2820
}
21+
2922
main();

0 commit comments

Comments
 (0)