From 386db998f98d62c9ea3b95e49530168ff29363d2 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 26 Dec 2023 18:53:20 +0800 Subject: [PATCH] feat: bin script --- packages/sample/.best-shot/config.mjs | 1 + packages/sample/lib/bin.mjs | 4 ++++ packages/sample/package.json | 5 ++++- packages/sentry/.best-shot/config.mjs | 14 +------------- packages/sentry/lib/bin.mjs | 4 ++++ packages/sentry/package.json | 5 ++++- packages/sftp/.best-shot/config.mjs | 1 + packages/sftp/lib/bin.mjs | 4 ++++ packages/sftp/package.json | 5 ++++- 9 files changed, 27 insertions(+), 16 deletions(-) create mode 100644 packages/sample/lib/bin.mjs create mode 100644 packages/sentry/lib/bin.mjs create mode 100644 packages/sftp/lib/bin.mjs diff --git a/packages/sample/.best-shot/config.mjs b/packages/sample/.best-shot/config.mjs index 447a26f..aa85a3b 100644 --- a/packages/sample/.best-shot/config.mjs +++ b/packages/sample/.best-shot/config.mjs @@ -4,6 +4,7 @@ export const config = { path: 'dist', module: true, }, + copy: ['./lib/bin.mjs'], entry: { sub: './lib/cmd.mjs', }, diff --git a/packages/sample/lib/bin.mjs b/packages/sample/lib/bin.mjs new file mode 100644 index 0000000..21d7ee5 --- /dev/null +++ b/packages/sample/lib/bin.mjs @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +/* eslint-disable n/shebang */ +import '@bring-it/cli/dist/cli.mjs'; diff --git a/packages/sample/package.json b/packages/sample/package.json index c8bd137..da2dcac 100644 --- a/packages/sample/package.json +++ b/packages/sample/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/sample", - "version": "0.4.0", + "version": "0.4.1", "description": "Generate code sample files", "license": "MIT", "author": { @@ -26,6 +26,9 @@ "bugs": { "url": "https://github.com/airkro/bring-it/issues" }, + "bin": { + "bring-it": "dist/bin.mjs" + }, "main": "dist/sub.mjs", "files": [ "dist" diff --git a/packages/sentry/.best-shot/config.mjs b/packages/sentry/.best-shot/config.mjs index 7032104..9abaefa 100644 --- a/packages/sentry/.best-shot/config.mjs +++ b/packages/sentry/.best-shot/config.mjs @@ -4,23 +4,11 @@ export const config = { path: 'dist', module: true, }, + copy: ['./lib/bin.mjs'], entry: { sub: './lib/cmd.mjs', }, externals: { globby: 'globby', }, - optimization: { - // splitChunks: { - // cacheGroups: { - // vendors: { - // name: 'share', - // chunks: 'all', - // minChunks: 2, - // enforce: true, - // reuseExistingChunk: true, - // }, - // }, - // }, - }, }; diff --git a/packages/sentry/lib/bin.mjs b/packages/sentry/lib/bin.mjs new file mode 100644 index 0000000..21d7ee5 --- /dev/null +++ b/packages/sentry/lib/bin.mjs @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +/* eslint-disable n/shebang */ +import '@bring-it/cli/dist/cli.mjs'; diff --git a/packages/sentry/package.json b/packages/sentry/package.json index 393c5b4..67c1f9c 100644 --- a/packages/sentry/package.json +++ b/packages/sentry/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/sentry", - "version": "0.5.0", + "version": "0.5.1", "description": "Update sentry artifacts", "license": "MIT", "author": { @@ -26,6 +26,9 @@ "bugs": { "url": "https://github.com/airkro/bring-it/issues" }, + "bin": { + "bring-it": "dist/bin.mjs" + }, "main": "dist/sub.mjs", "files": [ "dist" diff --git a/packages/sftp/.best-shot/config.mjs b/packages/sftp/.best-shot/config.mjs index fad0ea8..3eaf0e1 100644 --- a/packages/sftp/.best-shot/config.mjs +++ b/packages/sftp/.best-shot/config.mjs @@ -4,6 +4,7 @@ export const config = { path: 'dist', module: true, }, + copy: ['./lib/bin.mjs'], entry: { sub: './lib/cmd.mjs', }, diff --git a/packages/sftp/lib/bin.mjs b/packages/sftp/lib/bin.mjs new file mode 100644 index 0000000..21d7ee5 --- /dev/null +++ b/packages/sftp/lib/bin.mjs @@ -0,0 +1,4 @@ +#!/usr/bin/env node + +/* eslint-disable n/shebang */ +import '@bring-it/cli/dist/cli.mjs'; diff --git a/packages/sftp/package.json b/packages/sftp/package.json index 4934dca..7d98937 100644 --- a/packages/sftp/package.json +++ b/packages/sftp/package.json @@ -1,6 +1,6 @@ { "name": "@bring-it/sftp", - "version": "0.3.0", + "version": "0.3.1", "description": "SFTP deployment tool for frontend", "license": "MIT", "author": { @@ -27,6 +27,9 @@ "bugs": { "url": "https://github.com/airkro/bring-it/issues" }, + "bin": { + "bring-it": "dist/bin.mjs" + }, "main": "dist/sub.mjs", "files": [ "dist"