Skip to content

Commit

Permalink
feat: bin script
Browse files Browse the repository at this point in the history
  • Loading branch information
Airkro committed Jan 8, 2024
1 parent 6fdbc66 commit 23a7113
Show file tree
Hide file tree
Showing 15 changed files with 160 additions and 33 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"@nice-move/cli": "^0.11.3",
"@nice-move/eslint-config-base": "^0.11.1",
"@nice-move/prettier-config": "^0.10.0",
"best-shot": "^0.5.0",
"best-shot": "^0.5.1",
"eslint": "^8.56.0",
"garou": "^0.6.22",
"garou": "^0.6.23",
"prettier": "^3.1.1"
},
"peerDependencies": {
Expand All @@ -40,7 +40,7 @@
"node": "^18.0.0 || ^20.0.0",
"npm": ">=9.4.0"
},
"packageManager": "pnpm@8.12.1",
"packageManager": "pnpm@8.14.0",
"pnpm": {
"overrides": {
"cpu-features": "npm:[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion packages/npm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/npm",
"version": "0.5.0",
"version": "0.5.1",
"description": "Publish npm packages when needed",
"license": "MIT",
"author": {
Expand Down
1 change: 1 addition & 0 deletions packages/sample/.best-shot/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const config = {
path: 'dist',
module: true,
},
copy: ['./lib/bin.mjs'],
entry: {
sub: './lib/cmd.mjs',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/sample/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Config example:
"group": [
{
"cwd": ".",
"pattern": ["."],
"pattern": ["**/*"],
"extensions": ["js", "ts", "..."],
"ignore": ["dist"],
"title": "示例软件名称",
Expand Down
4 changes: 4 additions & 0 deletions packages/sample/lib/bin.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

/* eslint-disable n/shebang */
import '@bring-it/cli/dist/cli.mjs';
2 changes: 1 addition & 1 deletion packages/sample/lib/lib/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function mergeConfig(group = [{}]) {
title = '示例软件名称',
version = 'v1.0',
cwd = '.',
pattern = ['.'],
pattern = ['**/*'],
ignore = ['dist'],
extensions = [
['js', 'cjs', 'mjs', 'jsx'],
Expand Down
11 changes: 10 additions & 1 deletion packages/sample/lib/lib/picker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,17 @@ export function scan(config) {
gitignore: true,
onlyFiles: true,
dot: true,
caseSensitiveMatch: false,
expandDirectories: {
extensions: config.extensions,
},
}).then((list) => list.sort());
})
.then((list) => list.sort())
.then((list) => {
for (const item of list) {
logger.file(item);
}

return list;
});
}
5 changes: 4 additions & 1 deletion packages/sample/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/sample",
"version": "0.4.0",
"version": "0.4.2",
"description": "Generate code sample files",
"license": "MIT",
"author": {
Expand All @@ -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"
Expand Down
14 changes: 1 addition & 13 deletions packages/sentry/.best-shot/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
// },
// },
// },
},
};
4 changes: 4 additions & 0 deletions packages/sentry/lib/bin.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

/* eslint-disable n/shebang */
import '@bring-it/cli/dist/cli.mjs';
5 changes: 4 additions & 1 deletion packages/sentry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bring-it/sentry",
"version": "0.5.0",
"version": "0.5.1",
"description": "Update sentry artifacts",
"license": "MIT",
"author": {
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions packages/sftp/.best-shot/config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const config = {
path: 'dist',
module: true,
},
copy: ['./lib/bin.mjs'],
entry: {
sub: './lib/cmd.mjs',
},
Expand Down
4 changes: 4 additions & 0 deletions packages/sftp/lib/bin.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

/* eslint-disable n/shebang */
import '@bring-it/cli/dist/cli.mjs';
5 changes: 4 additions & 1 deletion packages/sftp/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand All @@ -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"
Expand Down
127 changes: 117 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23a7113

Please sign in to comment.