From 06c3091b189912bd2108065b89171439a4b9bdb1 Mon Sep 17 00:00:00 2001 From: Noah Date: Sun, 26 Mar 2023 11:53:18 -0400 Subject: [PATCH] fix: use manifest bin field for rvg bin (#293) --- packages/cli/bin/rvg | 2 -- packages/cli/package.json | 9 +++++++-- packages/cli/src/bin.ts | 3 +++ packages/core/src/main.ts | 1 - yarn.lock | 2 ++ 5 files changed, 12 insertions(+), 5 deletions(-) delete mode 100755 packages/cli/bin/rvg create mode 100644 packages/cli/src/bin.ts diff --git a/packages/cli/bin/rvg b/packages/cli/bin/rvg deleted file mode 100755 index 3464edd..0000000 --- a/packages/cli/bin/rvg +++ /dev/null @@ -1,2 +0,0 @@ -#!/usr/bin/env node -require('../lib/index').default() diff --git a/packages/cli/package.json b/packages/cli/package.json index 5cbf61e..f7305ba 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -6,8 +6,10 @@ "homepage": "https://github.com/tophat/react-vector-graphics#readme", "license": "Apache-2.0", "main": "src/index.ts", + "bin": { + "rvg": "src/bin.ts" + }, "files": [ - "bin", "lib" ], "repository": { @@ -24,7 +26,10 @@ "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/", - "main": "lib/index.js" + "main": "lib/index.js", + "bin": { + "rvg": "lib/bin.js" + } }, "dependencies": { "@react-vector-graphics/core": "workspace:^0.4.2", diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.ts new file mode 100644 index 0000000..e6b90fd --- /dev/null +++ b/packages/cli/src/bin.ts @@ -0,0 +1,3 @@ +import run from './index' + +run() diff --git a/packages/core/src/main.ts b/packages/core/src/main.ts index 533cf2d..418c434 100644 --- a/packages/core/src/main.ts +++ b/packages/core/src/main.ts @@ -1,4 +1,3 @@ -// eslint-disable-next-line prettier/prettier import { type Config as CoreConfig, loadConfig } from '@svgr/core' import { getLogger } from './logging' diff --git a/yarn.lock b/yarn.lock index 193d3f0..9dac295 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1678,6 +1678,8 @@ __metadata: fs-extra: ^9.0.0 memfs: ^3.1.1 yargs: ^16.0.3 + bin: + rvg: src/bin.ts languageName: unknown linkType: soft