Skip to content

Commit

Permalink
fix: make a separate index.js with a shebang to run as global binary (#…
Browse files Browse the repository at this point in the history
…61)

Fixes #50 

I don't love having to build before running lint. Other options would be
to keep `src/index.ts` the executable and try to figure out how to make
n/shebang understand that. Or to exclude the top-level `index.js` from
linting.
  • Loading branch information
danvk authored Feb 24, 2024
1 parent 19eacf0 commit 22af571
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare
- run: pnpm build
- run: pnpm lint

name: Lint
Expand Down
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env node
import "./lib/index.js";
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
},
"type": "module",
"main": "./lib/index.js",
"bin": "./lib/index.js",
"bin": "./index.js",
"files": [
"index.js",
"lib/",
"package.json",
"LICENSE.md",
Expand Down

0 comments on commit 22af571

Please sign in to comment.