Skip to content

Commit 87f493b

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 0f5315d commit 87f493b

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, '20.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": ">= 20"
3536
},
@@ -63,7 +64,7 @@
6364
"scripts": {
6465
"clean": "rimraf lib",
6566
"prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
66-
"build": "tsc -p ./tsconfig.json && yarn run lint && cp src/ovsx lib/ovsx",
67+
"build": "tsc -p ./tsconfig.json && yarn run lint",
6768
"watch": "tsc -w -p ./tsconfig.json",
6869
"lint": "eslint -c ./configs/eslintrc.mjs src",
6970
"prepare": "yarn run clean && yarn run prebuild && yarn run build",

cli/yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,7 @@ __metadata:
26612661
typescript: "npm:^5.6.3"
26622662
yauzl: "npm:^3.1.3"
26632663
bin:
2664-
ovsx: lib/ovsx
2664+
ovsx: ovsx
26652665
languageName: unknown
26662666
linkType: soft
26672667

0 commit comments

Comments
 (0)