Skip to content

Commit

Permalink
cli: simplify npm binary setup
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
paul-marechal committed Dec 16, 2024
1 parent 0f5315d commit 87f493b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli/src/ovsx → cli/ovsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ if (semver.lt(process.versions.node, '20.0.0')) {
process.exit(1);
}

require('./main')(process.argv);
require('./lib/main')(process.argv);
5 changes: 3 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
],
"files": [
"lib",
"ovsx.js",
"src"
],
"main": "lib/index",
"types": "lib/index",
"bin": "lib/ovsx",
"bin": "ovsx",
"engines": {
"node": ">= 20"
},
Expand Down Expand Up @@ -63,7 +64,7 @@
"scripts": {
"clean": "rimraf lib",
"prebuild": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",
"build": "tsc -p ./tsconfig.json && yarn run lint && cp src/ovsx lib/ovsx",
"build": "tsc -p ./tsconfig.json && yarn run lint",
"watch": "tsc -w -p ./tsconfig.json",
"lint": "eslint -c ./configs/eslintrc.mjs src",
"prepare": "yarn run clean && yarn run prebuild && yarn run build",
Expand Down
2 changes: 1 addition & 1 deletion cli/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,7 @@ __metadata:
typescript: "npm:^5.6.3"
yauzl: "npm:^3.1.3"
bin:
ovsx: lib/ovsx
ovsx: ovsx
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 87f493b

Please sign in to comment.