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 Nov 22, 2023
1 parent 97e5758 commit ad0466b
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, '14.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": ">= 14"
},
Expand All @@ -56,7 +57,7 @@
},
"scripts": {
"clean": "rimraf lib",
"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.json --ext .ts src",
"prepare": "yarn run clean && 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 @@ -2125,7 +2125,7 @@ __metadata:
tmp: "npm:^0.2.1"
typescript: "npm:3.8.3"
bin:
ovsx: lib/ovsx
ovsx: ovsx
languageName: unknown
linkType: soft

Expand Down

0 comments on commit ad0466b

Please sign in to comment.