Skip to content

Commit 03b8184

Browse files
committed
fix running from npx
1 parent 5b19878 commit 03b8184

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

build

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,27 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
cd "$SCRIPT_DIR"
55
ESBUILD=./node_modules/.bin/esbuild
66

7-
$ESBUILD src/index.ts \
8-
--bundle \
9-
--minify \
10-
--format=iife \
11-
--global-name=StaticVault \
12-
--outfile=dist/index.min.js \
13-
--platform=browser \
7+
$ESBUILD src/index.ts \
8+
--bundle \
9+
--minify \
10+
--format=iife \
11+
--global-name=StaticVault \
12+
--outfile=dist/index.min.js \
13+
--platform=browser \
1414
--log-level=warning
1515

16-
$ESBUILD src/index.ts \
17-
--bundle \
18-
--format=iife \
19-
--global-name=StaticVault \
20-
--outfile=dist/index.js \
21-
--platform=browser \
16+
$ESBUILD src/index.ts \
17+
--bundle \
18+
--format=iife \
19+
--global-name=StaticVault \
20+
--outfile=dist/index.js \
21+
--platform=browser \
2222
--log-level=warning
2323

24-
$ESBUILD src/cli.ts \
25-
--bundle \
26-
--format=esm \
27-
--outfile=dist/cli.js \
28-
--platform=node \
24+
$ESBUILD src/cli.ts \
25+
--bundle \
26+
--format=esm \
27+
--banner:js="#!/usr/bin/env node" \
28+
--outfile=dist/cli.js \
29+
--platform=node \
2930
--log-level=warning

dist/cli.js

100644100755
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env node
2+
13
// src/util.ts
24
function bytesToString(bytes) {
35
const b64 = typeof process !== "undefined" ? Buffer.from(bytes).toString("base64") : btoa(String.fromCharCode(...bytes));

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
22
"name": "staticvault",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"author": "velipso",
55
"license": "0BSD",
66
"type": "module",
77
"main": "./dist/cli.js",
8+
"bin": {
9+
"staticvault": "dist/cli.js"
10+
},
811
"scripts": {
912
"tsc": "tsc"
1013
},

0 commit comments

Comments
 (0)