Skip to content

Commit ad0466b

Browse files
committed
cli: simplify npm binary setup
This commit moves `ovsx.js` to the root of the package. This way we don't need to copy the file from `src` to `lib` at build time.
1 parent 97e5758 commit ad0466b

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

cli/src/ovsx renamed to cli/ovsx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ if (semver.lt(process.versions.node, '14.0.0')) {
77
process.exit(1);
88
}
99

10-
require('./main')(process.argv);
10+
require('./lib/main')(process.argv);

cli/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@
2525
],
2626
"files": [
2727
"lib",
28+
"ovsx.js",
2829
"src"
2930
],
3031
"main": "lib/index",
3132
"types": "lib/index",
32-
"bin": "lib/ovsx",
33+
"bin": "ovsx",
3334
"engines": {
3435
"node": ">= 14"
3536
},
@@ -56,7 +57,7 @@
5657
},
5758
"scripts": {
5859
"clean": "rimraf lib",
59-
"build": "tsc -p ./tsconfig.json && yarn run lint && cp src/ovsx lib/ovsx",
60+
"build": "tsc -p ./tsconfig.json && yarn run lint",
6061
"watch": "tsc -w -p ./tsconfig.json",
6162
"lint": "eslint -c ./configs/eslintrc.json --ext .ts src",
6263
"prepare": "yarn run clean && yarn run build",

cli/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ __metadata:
21252125
tmp: "npm:^0.2.1"
21262126
typescript: "npm:3.8.3"
21272127
bin:
2128-
ovsx: lib/ovsx
2128+
ovsx: ovsx
21292129
languageName: unknown
21302130
linkType: soft
21312131

0 commit comments

Comments
 (0)