Skip to content

Commit 1471f68

Browse files
committed
Update package versions to 0.1.1 and include README.md in package files for CLI, core, eslint-plugin, and next packages.
1 parent fb376a5 commit 1471f68

8 files changed

Lines changed: 163 additions & 8 deletions

File tree

packages/cli/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# @envra/cli
2+
3+
Command-line tools for [envra](https://github.com/hasansmadix/envra): validate `process.env`, generate `.env.example` and `ENVIRONMENT.md`, and run hygiene checks (`doctor`).
4+
5+
## Install
6+
7+
```bash
8+
pnpm add -D @envra/cli
9+
# or
10+
npm install -D @envra/cli
11+
```
12+
13+
Your project should also depend on [`@envra/core`](https://www.npmjs.com/package/@envra/core). The CLI loads your config with [jiti](https://github.com/unjs/jiti) (TypeScript without a separate build step for the config file).
14+
15+
## Commands
16+
17+
```bash
18+
pnpm envra check -c ./env.config.ts
19+
pnpm envra sync -c ./env.config.ts -o .env.example
20+
pnpm envra docs -c ./env.config.ts -o ENVIRONMENT.md
21+
pnpm envra doctor -c ./env.config.ts
22+
```
23+
24+
Export `defineEnv(...)` as `default` or `env`, or export `envraSchema` / `schema` as field builders so the CLI can read the schema.
25+
26+
## Documentation
27+
28+
[github.com/hasansmadix/envra](https://github.com/hasansmadix/envra)
29+
30+
## License
31+
32+
MIT — see [LICENSE](https://github.com/hasansmadix/envra/blob/main/LICENSE) in the monorepo.

packages/cli/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@envra/cli",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "CLI for envra: check, sync, docs, doctor",
55
"keywords": [
66
"env",
@@ -25,7 +25,10 @@
2525
"bin": {
2626
"envra": "./dist/cli.js"
2727
},
28-
"files": ["dist"],
28+
"files": [
29+
"dist",
30+
"README.md"
31+
],
2932
"engines": {
3033
"node": ">=18"
3134
},

packages/core/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# @envra/core
2+
3+
Define, validate, and safely consume environment variables in TypeScript — schema, inferred types, secret masking, and helpers for docs / `.env.example` / `doctor`.
4+
5+
## Install
6+
7+
```bash
8+
pnpm add @envra/core
9+
# or
10+
npm install @envra/core
11+
```
12+
13+
## Quick example
14+
15+
```ts
16+
import { defineEnv, str, url, int, bool, secret, oneOf } from "@envra/core";
17+
18+
export const env = defineEnv({
19+
NODE_ENV: oneOf(["development", "test", "production"] as const),
20+
APP_URL: url(),
21+
DB_URL: secret(url()).serverOnly(),
22+
PORT: int().default(3000),
23+
REDIS_ENABLED: bool().default(false),
24+
});
25+
```
26+
27+
Use `env.values`, `env.get`, `env.has`, and `env.meta`. See the [full documentation](https://github.com/hasansmadix/envra#readme) on GitHub.
28+
29+
## CLI
30+
31+
For `check`, `sync`, `docs`, and `doctor`, add [`@envra/cli`](https://www.npmjs.com/package/@envra/cli) as a dev dependency.
32+
33+
## License
34+
35+
MIT — see [LICENSE](https://github.com/hasansmadix/envra/blob/main/LICENSE) in the monorepo.

packages/core/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@envra/core",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Define, validate, and safely consume runtime configuration in TypeScript",
55
"keywords": [
66
"env",
@@ -37,7 +37,10 @@
3737
"require": "./dist/index.js"
3838
}
3939
},
40-
"files": ["dist"],
40+
"files": [
41+
"dist",
42+
"README.md"
43+
],
4144
"engines": {
4245
"node": ">=18"
4346
},

packages/eslint-plugin/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# @envra/eslint-plugin
2+
3+
ESLint plugin for [envra](https://github.com/hasansmadix/envra): discourage direct `process.env` usage outside your env definition files.
4+
5+
## Install
6+
7+
```bash
8+
pnpm add -D @envra/eslint-plugin
9+
# or
10+
npm install -D @envra/eslint-plugin
11+
```
12+
13+
Peer: `eslint` >= 8.57.
14+
15+
## Flat config (ESLint 9+)
16+
17+
```js
18+
import { flatRecommended } from "@envra/eslint-plugin";
19+
20+
export default [
21+
...flatRecommended,
22+
{
23+
rules: {
24+
"envra/no-process-env": [
25+
"error",
26+
{ allowGlobs: ["**/env.config.ts", "**/env.ts"] },
27+
],
28+
},
29+
},
30+
];
31+
```
32+
33+
## Documentation
34+
35+
[github.com/hasansmadix/envra](https://github.com/hasansmadix/envra)
36+
37+
## License
38+
39+
MIT — see [LICENSE](https://github.com/hasansmadix/envra/blob/main/LICENSE) in the monorepo.

packages/eslint-plugin/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@envra/eslint-plugin",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "ESLint plugin for envra (no direct process.env)",
55
"keywords": [
66
"eslint",
@@ -28,7 +28,10 @@
2828
"require": "./dist/index.js"
2929
}
3030
},
31-
"files": ["dist"],
31+
"files": [
32+
"dist",
33+
"README.md"
34+
],
3235
"engines": {
3336
"node": ">=18"
3437
},

packages/next/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# @envra/next
2+
3+
Next.js adapter for [envra](https://github.com/hasansmadix/envra): split **server** vs **client** env schemas, enforce `NEXT_PUBLIC_` on client keys, and block secrets on the client block.
4+
5+
## Install
6+
7+
```bash
8+
pnpm add @envra/next
9+
# or
10+
npm install @envra/next
11+
```
12+
13+
Peer: `next` >= 14 (optional peer for typing; install `next` in your app).
14+
15+
## Example
16+
17+
```ts
18+
import { defineNextEnv, str, url, secret } from "@envra/next";
19+
20+
export const env = defineNextEnv({
21+
server: {
22+
DB_URL: secret(url()),
23+
},
24+
client: {
25+
NEXT_PUBLIC_APP_URL: url(),
26+
},
27+
runtimeEnv: process.env,
28+
});
29+
```
30+
31+
## Documentation
32+
33+
[github.com/hasansmadix/envra](https://github.com/hasansmadix/envra)
34+
35+
## License
36+
37+
MIT — see [LICENSE](https://github.com/hasansmadix/envra/blob/main/LICENSE) in the monorepo.

packages/next/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@envra/next",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Next.js adapter for envra",
55
"keywords": [
66
"nextjs",
@@ -30,7 +30,10 @@
3030
"require": "./dist/index.js"
3131
}
3232
},
33-
"files": ["dist"],
33+
"files": [
34+
"dist",
35+
"README.md"
36+
],
3437
"engines": {
3538
"node": ">=18"
3639
},

0 commit comments

Comments
 (0)