|
1 | | -# Varlock |
2 | | - |
3 | | - |
4 | | - |
5 | | -> See https://varlock.dev for docs and examples. |
| 1 | +<p align="center"> |
| 2 | + <a href="https://varlock.dev" target="_blank" rel="noopener noreferrer"> |
| 3 | + <img src="/packages/varlock-website/public/default-og-image.png" alt="Varlock banner"> |
| 4 | + </a> |
| 5 | +</p> |
| 6 | +<br/> |
| 7 | +<p align="center"> |
| 8 | + <a href="https://npmjs.com/package/varlock"><img src="https://img.shields.io/npm/v/varlock.svg" alt="npm package"></a> |
| 9 | + <a href="/LICENSE.md"><img src="https://img.shields.io/npm/l/varlock.svg" alt="license"></a> |
| 10 | + <a href="https://nodejs.org/en/about/previous-releases"><img src="https://img.shields.io/node/v/varlock.svg" alt="node compatibility"></a> |
| 11 | + <a href="https://github.com/dmno-dev/varlock/actions/workflows/test.yaml"><img src="https://img.shields.io/github/actions/workflow/status/dmno-dev/varlock/test.yaml?style=flat&logo=github&label=CI" alt="build status"></a> |
| 12 | + <a href="https://chat.dmno.dev"><img src="https://img.shields.io/badge/chat-discord-5865F2?style=flat&logo=discord" alt="discord chat"></a> |
| 13 | +</p> |
| 14 | +<br/> |
| 15 | + |
| 16 | +## Varlock |
| 17 | +> add declarative schema to your .env files using @env-spec decorator comments |
| 18 | +
|
| 19 | +- 🛡️ validation, coercion, type safety |
| 20 | +- 🔏 protection for sensitive config values (log redaction, leak prevention) |
| 21 | +- 🌐 flexible multi-environment management |
| 22 | +- 📦 composition of values |
| 23 | + |
| 24 | +### Published Packages |
| 25 | +| Package | Published listing page | |
| 26 | +| --- | --- | |
| 27 | +| [varlock](packages/varlock) | [](https://npmjs.com/package/varlock) | |
| 28 | +| [@env-spec/parser](packages/env-spec-parser) | [](https://npmjs.com/package/@env-spec/parser) | |
| 29 | +| [@env-spec VSCode extension](packages/vscode-plugin) | [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=varlock.env-spec-language), [Open VSX Registry](https://open-vsx.org/extension/varlock/env-spec-language) | |
| 30 | +| [@varlock/nextjs-integration](packages/integrations/nextjs) | [](https://npmjs.com/package/@varlock/nextjs-integration) | |
| 31 | + |
| 32 | +By adding these comments to a `.env.schema` that lives within version control, you can safely share this with your team. |
6 | 33 |
|
7 | 34 | _A sample `.env.schema`_: |
8 | 35 | ```bash |
9 | | -# @envFlag=APP_ENV |
| 36 | +# @defaultSensitive=false @defaultRequired=infer @envFlag=APP_ENV |
10 | 37 | # --- |
11 | | - |
12 | | -# @type=enum(development, staging, production) |
13 | | -APP_ENV=development #sets default value |
| 38 | +# our environment flag, will control loading of `.env.xxx` files |
| 39 | +# @type=enum(development, preview, production, test |
| 40 | +APP_ENV=development # default value, can override |
14 | 41 |
|
15 | 42 | # API port |
16 | 43 | # @type=port @example=3000 |
17 | 44 | API_PORT= |
18 | 45 |
|
19 | 46 | # API url including expansion of another env var |
20 | 47 | # @required @type=url |
21 | | -API_URL=localhost:${API_PORT} |
| 48 | +API_URL=http://localhost:${API_PORT} |
22 | 49 |
|
23 | 50 | # API key with validation, securely fetched from 1Password |
24 | 51 | # @required @sensitive @type=string(startsWith=sk-) |
@@ -70,6 +97,6 @@ Varlock is built on top of @env-spec, a new DSL for attaching a schema and addit |
70 | 97 | - @env-spec [RFC](https://github.com/dmno-dev/varlock/discussions/17) |
71 | 98 |
|
72 | 99 |
|
73 | | -## Development |
| 100 | +## Development & Contribution |
74 | 101 |
|
75 | | -See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. |
| 102 | +See [CONTRIBUTING.md](CONTRIBUTING.md) for more information. |
0 commit comments