Skip to content

Commit f49fd2a

Browse files
authored
vite integration (#77)
* explicit type imports * vite integration * example vite project * update labeler github action * docs updates
1 parent 33874e8 commit f49fd2a

72 files changed

Lines changed: 2095 additions & 201 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/empty-seals-fail.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@varlock/vite-integration": patch
3+
"varlock": patch
4+
---
5+
6+
vite integration

.github/config/labeler.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ parser:
1111
vscode-plugin:
1212
- changed-files:
1313
- any-glob-to-any-file: 'packages/vscode-plugin/*'
14+
nextjs-integration:
15+
- changed-files:
16+
- any-glob-to-any-file: 'packages/integrations/nextjs/*'
17+
vite-integration:
18+
- changed-files:
19+
- any-glob-to-any-file: 'packages/integrations/vite/*'
1420

1521
## website + docs
1622
docs:
1723
- changed-files:
18-
- any-glob-to-any-file: 'packages/varlock-website/*'
24+
- any-glob-to-any-file: 'packages/varlock-website/*'

README.md

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,51 @@
1-
# Varlock
2-
3-
![og-image](/packages/varlock-website/public/default-og-image.png)
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) | [![npm version](https://img.shields.io/npm/v/varlock.svg)](https://npmjs.com/package/varlock) |
28+
| [@env-spec/parser](packages/env-spec-parser) | [![npm version](https://img.shields.io/npm/v/@env-spec/parser.svg)](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) | [![npm version](https://img.shields.io/npm/v/@varlock/nextjs-integration.svg)](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.
633

734
_A sample `.env.schema`_:
835
```bash
9-
# @envFlag=APP_ENV
36+
# @defaultSensitive=false @defaultRequired=infer @envFlag=APP_ENV
1037
# ---
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
1441

1542
# API port
1643
# @type=port @example=3000
1744
API_PORT=
1845

1946
# API url including expansion of another env var
2047
# @required @type=url
21-
API_URL=localhost:${API_PORT}
48+
API_URL=http://localhost:${API_PORT}
2249

2350
# API key with validation, securely fetched from 1Password
2451
# @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
7097
- @env-spec [RFC](https://github.com/dmno-dev/varlock/discussions/17)
7198

7299

73-
## Development
100+
## Development & Contribution
74101

75-
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
102+
See [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

example-repo/package.json renamed to example-monorepo/packages/basic/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"author": "",
1515
"license": "ISC",
1616
"dependencies": {
17-
"dotenv": "link:../packages/varlock",
17+
"dotenv": "link:../../../packages/varlock",
1818
"openai": "^5.5.1",
19-
"varlock": "link:../packages/varlock"
19+
"varlock": "link:../../../packages/varlock"
2020
},
2121
"packageManager": "pnpm@10.8.1",
2222
"devDependencies": {
23-
"@types/node": "^22.14.1"
23+
"@types/node": "catalog:"
2424
}
2525
}

0 commit comments

Comments
 (0)