Skip to content

Commit 5d30b5a

Browse files
authored
plugins and 1pass docs (#175)
* plugin docs, 1pass docs, general cleanup * mark examples as private * linting, cleanup
1 parent 9161687 commit 5d30b5a

Some content is hidden

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

50 files changed

+773
-751
lines changed

.cursor/rules/varlock.mdc

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ actions:
2828

2929
1. File Structure:
3030
```
31-
.env.schema # Schema definition with decorators
32-
.env # Local development values
31+
.env.schema # Schema definition with decorators and default values
32+
.env.local # Local (git-ignored) development overrides
3333
.env.production # Production values
3434
.env.staging # Staging values
3535
```
@@ -41,7 +41,7 @@ actions:
4141
- Values can be strings, numbers, booleans, or function calls
4242

4343
3. Root Level Decorators:
44-
- @envFlag - Sets environment flag key
44+
- @currentEnv - Sets current environment env var (e.g., `@currentEnv=$APP_ENV`)
4545
- @defaultRequired - Sets default required state for all items
4646
- @defaultSensitive - Sets default sensitive state for all items
4747

@@ -52,7 +52,7 @@ actions:
5252
4. Item Level Decorators:
5353
- @required - Makes item required (omit if @defaultRequired=true)
5454
- @sensitive - Marks item as sensitive (omit if @defaultSensitive=true)
55-
- @type - Sets value type
55+
- @type - Sets value type (omit if basic string with no additional settings)
5656
- @example - Provides example value
5757
- @trim - Trims whitespace
5858
- @deindent - Trims leading whitespace
@@ -112,10 +112,18 @@ examples:
112112
- input: |
113113
# Bad: Missing type decorator
114114
PORT=3000
115+
# Bad: Unnecessary type decorator for basic string
116+
# @type=string
117+
BASIC_STRING
115118

116-
# Good: With type decorator
119+
# Good: With type decorators when necessary
117120
# @type=port
118121
PORT=3000
122+
# @type=string(startsWith=abc_)
123+
STRING_WITH_VALIDATION=
124+
# no @type necessary for basic strings
125+
BASIC_STRING=
126+
119127
output: "Environment variable with proper type"
120128

121129
metadata:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ changesets-summary.json
1010

1111
.env.local
1212
.env.*.local
13+
env.d.ts
1314

1415

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
## Varlock
1717
> add declarative schema to your .env files using @env-spec decorator comments
1818
19-
- 🛡️ validation, coercion, type safety w/ Intellisense
19+
- 🛡️ validation, coercion, type safety w/ IntelliSense
2020
- 🔏 protection for sensitive config values (log redaction, leak prevention)
2121
- 🌐 flexible multi-environment management
2222
- 💫 composition of values, functions, load from external sources
2323

2424
Your `.env.schema` is a declarative schema of your environment variables that lives within version control, so it will never be out of sync.
2525

2626
```bash
27-
# @defaultSensitive=false @defaultRequired=infer @envFlag=APP_ENV
27+
# @defaultSensitive=false @defaultRequired=infer @currentEnv=$APP_ENV
2828
# ---
2929
# our environment flag, will control automatic loading of `.env.xxx` files
3030
# @type=enum(development, preview, production, test

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ export default tseslint.config(
156156
{
157157
files: [
158158
'scripts/**',
159-
'example-monorepo/**',
159+
'examples/**',
160160
'packages/*.ignore/**',
161161
'packages/varlock/src/cli/**',
162162
'packages/varlock/scripts/**',

examples/astro-example/env.d.ts

Lines changed: 0 additions & 90 deletions
This file was deleted.

examples/astro-example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "astro-example",
33
"type": "module",
44
"version": "0.0.1",
5+
"private": true,
56
"scripts": {
67
"dev": "astro dev",
78
"build": "astro build",

0 commit comments

Comments
 (0)