From ad0466b1d46d227f95d95ff7edd819ec43c285a7 Mon Sep 17 00:00:00 2001 From: Paul Marechal Date: Tue, 21 Nov 2023 20:56:20 -0500 Subject: [PATCH] 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. --- cli/{src/ovsx => ovsx.js} | 2 +- cli/package.json | 5 +++-- cli/yarn.lock | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) rename cli/{src/ovsx => ovsx.js} (86%) diff --git a/cli/src/ovsx b/cli/ovsx.js similarity index 86% rename from cli/src/ovsx rename to cli/ovsx.js index eebf7ecaf..266bcea67 100755 --- a/cli/src/ovsx +++ b/cli/ovsx.js @@ -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); diff --git a/cli/package.json b/cli/package.json index 0942d044c..87b6b1330 100644 --- a/cli/package.json +++ b/cli/package.json @@ -25,11 +25,12 @@ ], "files": [ "lib", + "ovsx.js", "src" ], "main": "lib/index", "types": "lib/index", - "bin": "lib/ovsx", + "bin": "ovsx", "engines": { "node": ">= 14" }, @@ -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", diff --git a/cli/yarn.lock b/cli/yarn.lock index 43dd6f3d3..6142232d6 100644 --- a/cli/yarn.lock +++ b/cli/yarn.lock @@ -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