ezbun 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -14
- package/dist/build.d.ts +2 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +140 -0
- package/{index.ts → dist/index.d.ts} +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -0
- package/dist/preload.d.ts +2 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/utils/config.d.ts +21 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/console.d.ts +8 -0
- package/dist/utils/console.d.ts.map +1 -0
- package/dist/utils/env.d.ts +6 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/schema.d.ts +4 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/package.json +10 -5
- package/cli.ts +0 -86
- package/preload.ts +0 -3
- package/utils/config.ts +0 -43
- package/utils/console.ts +0 -4
- package/utils/env.ts +0 -65
- package/utils/schema.ts +0 -14
package/README.md
CHANGED
|
@@ -18,12 +18,25 @@ bun add -D ezbun
|
|
|
18
18
|
|
|
19
19
|
## Usage
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Without direct installation with `bunx`:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
bunx ezbun
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Installed into your project:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
bun ezbun
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Tip. you can add a script to your `package.json`:
|
|
22
34
|
|
|
23
35
|
```json
|
|
24
36
|
{
|
|
25
37
|
"scripts": {
|
|
26
|
-
"dev": "ezbun"
|
|
38
|
+
"dev": "ezbun --watch", // with hot reloading
|
|
39
|
+
"start": "ezbun"
|
|
27
40
|
}
|
|
28
41
|
}
|
|
29
42
|
```
|
|
@@ -34,23 +47,17 @@ Then run:
|
|
|
34
47
|
bun dev
|
|
35
48
|
```
|
|
36
49
|
|
|
37
|
-
Or run directly with `bunx`:
|
|
38
|
-
|
|
39
|
-
```bash
|
|
40
|
-
bunx ezbun
|
|
41
|
-
```
|
|
42
|
-
|
|
43
50
|
### Watch Mode
|
|
44
51
|
|
|
45
|
-
You can run scripts in watch mode by passing the `--watch` flag:
|
|
52
|
+
You can run scripts in watch mode (hot reloading) by passing the `--watch` flag:
|
|
46
53
|
|
|
47
54
|
```bash
|
|
48
|
-
bun
|
|
55
|
+
bun ezbun --watch
|
|
49
56
|
```
|
|
50
57
|
|
|
51
58
|
## Configuration
|
|
52
59
|
|
|
53
|
-
Create
|
|
60
|
+
Create an optional `ezbun.config.ts` file in your project root to customize behavior:
|
|
54
61
|
|
|
55
62
|
```ts
|
|
56
63
|
import { defineConfig } from "ezbun";
|
|
@@ -86,13 +93,13 @@ export default defineEnv({
|
|
|
86
93
|
2. When you run a script via `ezbun`, it will:
|
|
87
94
|
- Validate `process.env` against your schema.
|
|
88
95
|
- Print helpful error messages if validation fails.
|
|
89
|
-
- Automatically generate
|
|
96
|
+
- Automatically generate `env.d.ts` for global type definitions.
|
|
90
97
|
|
|
91
98
|
Now you can use `process.env` with full type safety in your code!
|
|
92
99
|
|
|
93
100
|
```ts
|
|
94
|
-
|
|
95
|
-
console.log(process.env.
|
|
101
|
+
/** typed as `string` not `string | undefined` */
|
|
102
|
+
console.log(process.env.API_KEY);
|
|
96
103
|
```
|
|
97
104
|
|
|
98
105
|
## License
|
package/dist/build.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../build.ts"],"names":[],"mappings":""}
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AAKA,eAAO,MAAM,GAAG,sBA8Ef,CAAC"}
|