Skip to content

Commit 2be2b16

Browse files
committed
chore: initial commit
chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip chore: wip
0 parents  commit 2be2b16

Some content is hidden

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

77 files changed

+5948
-0
lines changed

.cursor/rules/code-style.mdc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
description: Code Style & Structure specifics
3+
globs:
4+
---
5+
## Code Style & Structure
6+
7+
- Write concise, technical TypeScript code with accurate examples in the docblock
8+
- If Bun native modules are available, use them
9+
- Use functional and declarative programming patterns; avoid classes unless needed
10+
- Prefer iteration and modularization over code duplication
11+
- Use descriptive variable names with auxiliary verbs (e.g., `isLoading`, `hasError`)
12+
- Use proper jsdoc comments for functions, types, interfaces, and ensure examples are accurate

.cursor/rules/documentation.mdc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: Documentation specific rules
3+
globs: docs/**/*.md
4+
---
5+
## Documentation
6+
7+
- Write documentation for all functions, types, interfaces, and ensure examples are accurate
8+
- The `./docs` directory is where the vitepress markdown documentation is stored
9+
- Make sure to update the docs markdown files

.cursor/rules/error-handling.mdc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Error Handling and Validation specifics
3+
globs:
4+
---
5+
## Error Handling and Validation
6+
7+
- Prioritize error handling: handle errors and edge cases early
8+
- Use early returns and guard clauses
9+
- Implement proper error logging and user-friendly messages
10+
- Use error boundaries for unexpected errors
11+
- when `neverthrow` is available, ensure errors are typed

.cursor/rules/key-conventions.mdc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Key code conventions
3+
globs:
4+
---
5+
## Key Conventions
6+
7+
- If there are two equally valid implementations, the browser version should be preferred
8+
- Aim for 100% test coverage
9+
- Avoid usage of `any`
10+
- Reuse eslint-ignore comments where present, unless not needed
11+
- ensure we log everything properly, including for debug reasons

.cursor/rules/project-structure.mdc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
description: Project structure information
3+
globs:
4+
---
5+
## Project Structure
6+
7+
- the `./src` directory is the source code
8+
- the `./test` directory is the test code
9+
- the `./bin` directory is the command-line code
10+
- you can also call the CLI via `./clarity ...`
11+
- the `./docs` directory is the documentation

.cursor/rules/readme.mdc

+153
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
---
2+
description: General information based on the latest ./README.md content
3+
globs:
4+
alwaysApply: false
5+
---
6+
<p align="center"><img src=".github/art/cover.jpg" alt="Social Card of this repo"></p>
7+
8+
[![npm version][npm-version-src]][npm-version-href]
9+
[![GitHub Actions][github-actions-src]][github-actions-href]
10+
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
11+
<!-- [![npm downloads][npm-downloads-src]][npm-downloads-href] -->
12+
<!-- [![Codecov][codecov-src]][codecov-href] -->
13+
14+
# vite-plugin-dotenvx
15+
16+
> A Vite plugin to seamlessly integrate with dotenvx.
17+
18+
## Features
19+
20+
- Automatically decrypts encrypted .env files using dotenvx
21+
- Supports multiple .env files
22+
- Supports environment-specific .env files
23+
- Supports custom .env.keys file location
24+
- Supports variable expansion and command substitution
25+
- Lightweight and easy to use
26+
27+
## Install
28+
29+
```bash
30+
npm install -D vite-plugin-dotenvx
31+
# or
32+
yarn add -D vite-plugin-dotenvx
33+
# or
34+
pnpm add -D vite-plugin-dotenvx
35+
# or
36+
bun add -D vite-plugin-dotenvx
37+
```
38+
39+
## Get Started
40+
41+
```ts
42+
// vite.config.ts
43+
import { defineConfig } from 'vite'
44+
import Dotenvx from 'vite-plugin-dotenvx'
45+
46+
export default defineConfig({
47+
plugins: [
48+
enabled: true, // default: true
49+
verbose: true, // default: false, enables detailed logging
50+
path: ['.env', '.env.local'], // default: ['.env']
51+
envKeysFile: '.env.keys', // default: '.env.keys'
52+
overload: false, // default: false
53+
convention: 'nextjs', // optional, load envs using a convention like Next.js
54+
})
55+
]
56+
})
57+
```
58+
59+
## Usage with dotenvx
60+
61+
This plugin integrates with [dotenvx](https://github.com/dotenvx/dotenvx), a better dotenv from the creator of `dotenv`. It automatically decrypts encrypted .env files during development.
62+
63+
### Encrypting your .env files
64+
65+
First, install dotenvx globally:
66+
67+
```bash
68+
npm install -g @dotenvx/dotenvx
69+
# or
70+
curl -sfS https://dotenvx.sh | sh
71+
```
72+
73+
Then encrypt your .env files:
74+
75+
```bash
76+
dotenvx encrypt
77+
```
78+
79+
This will encrypt your .env file and create a .env.keys file with the encryption keys.
80+
81+
### Using encrypted .env files
82+
83+
The plugin will automatically decrypt your encrypted .env files during development. No additional configuration is needed.
84+
85+
For more information on dotenvx, visit [dotenvx.com](https://dotenvx.com).
86+
87+
## Options
88+
89+
| Option | Type | Default | Description |
90+
|--------|------|---------|-------------|
91+
| `enabled` | `boolean` | `true` | Enable or disable the plugin |
92+
| `verbose` | `boolean` | `false` | Enable verbose logging |
93+
| `path` | `string \| string[]` | `['.env']` | Path to .env file(s) |
94+
| `envKeysFile` | `string` | `'.env.keys'` | Path to .env.keys file |
95+
| `overload` | `boolean` | `false` | Override existing env variables |
96+
| `convention` | `string` | `undefined` | Load a .env convention (e.g., 'nextjs') |
97+
98+
## Testing
99+
100+
```bash
101+
bun test
102+
```
103+
104+
## Changelog
105+
106+
Please see our [releases](https://github.com/stacksjs/vite-plugin-dotenvx/releases) page for more information on what has changed recently.
107+
108+
## Contributing
109+
110+
Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
111+
112+
## Community
113+
114+
For help, discussion about best practices, or any other conversation that would benefit from being searchable:
115+
116+
[Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
117+
118+
For casual chit-chat with others using this package:
119+
120+
[Join the Stacks Discord Server](https://discord.gg/stacksjs)
121+
122+
## Postcardware
123+
124+
"Software that is free, but hopes for a postcard." We love receiving postcards from around the world showing where `vite-plugin-dotenvx` is being used! We showcase them on our website too.
125+
126+
Our address: Stacks.js, 12665 Village Ln #2306, Playa Vista, CA 90094, United States 🌎
127+
128+
## Sponsors
129+
130+
We would like to extend our thanks to the following sponsors for funding Stacks development. If you are interested in becoming a sponsor, please reach out to us.
131+
132+
- [JetBrains](https://www.jetbrains.com/)
133+
- [The Solana Foundation](https://solana.com/)
134+
135+
## Credits
136+
137+
- [Chris Breuer](https://github.com/chrisbbreuer)
138+
- [All Contributors](https://github.com/stacksjs/vite-plugin-dotenvx/contributors)
139+
140+
## License
141+
142+
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
143+
144+
Made with 💙
145+
146+
<!-- Badges -->
147+
[npm-version-src]: https://img.shields.io/npm/v/vite-plugin-dotenvx?style=flat-square
148+
[npm-version-href]: https://npmjs.com/package/vite-plugin-dotenvx
149+
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/stacksjs/vite-plugin-dotenvx/ci.yml?style=flat-square&branch=main
150+
[github-actions-href]: https://github.com/stacksjs/vite-plugin-dotenvx/actions?query=workflow%3Aci
151+
152+
<!-- [codecov-src]: https://img.shields.io/codecov/c/gh/stacksjs/vite-plugin-dotenvx/main?style=flat-square
153+
[codecov-href]: https://codecov.io/gh/stacksjs/vite-plugin-dotenvx -->

.cursor/rules/syntax-formatting.mdc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: Syntax and Formatting specifics
3+
globs:
4+
---
5+
## Syntax and Formatting
6+
7+
- Use the "function" keyword for pure functions
8+
- Avoid unnecessary curly braces in conditionals; use concise syntax for simple statements
9+
- Make sure everything is properly commented

.cursor/rules/testing.mdc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description: Testing specifics
3+
globs:
4+
---
5+
## Testing
6+
7+
- Write tests for all functions, types, interfaces, and ensure examples are accurate
8+
- The `./test` directory is where the tests are stored
9+
- Use `bun test` to run the tests
10+
- Use bun native modules for testing from `import { x, y, z } from 'bun:test'`

.cursor/rules/typescript.mdc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
description: TypeScript Usage specifics
3+
globs: docs/**/*.md
4+
---
5+
## TypeScript Usage
6+
7+
- Use TypeScript for all code; prefer interfaces over types
8+
- Avoid enums; use `maps` instead, or `as const`
9+
- Use functional components with TypeScript interfaces

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.env

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#/-------------------[DOTENV_PUBLIC_KEY]--------------------/
2+
#/ public-key encryption for .env files /
3+
#/ [how it works](https://dotenvx.com/encryption) /
4+
#/----------------------------------------------------------/
5+
DOTENV_PUBLIC_KEY="03f98aa9d807fe770d83063539bd34fb0d4e6a6ebc7a40afeb577b97ce22c848f1"
6+
7+
# .env
8+
FRONTEND_HUGEICONS_TOKEN="encrypted:BPl62+0vwLkWR6x0n7EQjJ7pH1q+ygsbor6SO+/AqKlj1Zt98NxzyigFyP6ncK2v9ZKUgbxqO5vQmDsyErEJ4wMs56+VSXGX7HbFiH9US7DhTEfulBBoyEcIMn9K+VmurBTOL5hVzKJ0oN8YVeI5G90bwp4/rhMk9p11z9UNicqrQ42Q"

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.github/CODE_OF_CONDUCT.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
6+
7+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8+
9+
## Our Standards
10+
11+
Examples of behavior that contributes to a positive environment for our community include:
12+
13+
* Demonstrating empathy and kindness toward other people
14+
* Being respectful of differing opinions, viewpoints, and experiences
15+
* Giving and gracefully accepting constructive feedback
16+
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17+
* Focusing on what is best not just for us as individuals, but for the overall community
18+
19+
Examples of unacceptable behavior include:
20+
21+
* The use of sexualized language or imagery, and sexual attention or advances of any kind
22+
* Trolling, insulting or derogatory comments, and personal or political attacks
23+
* Public or private harassment
24+
* Publishing others' private information, such as a physical or email address, without their explicit permission
25+
* Other conduct which could reasonably be considered inappropriate in a professional setting
26+
27+
## Enforcement Responsibilities
28+
29+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
30+
31+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
32+
33+
## Scope
34+
35+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
36+
37+
## Enforcement
38+
39+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at [email protected]. All complaints will be reviewed and investigated promptly and fairly.
40+
41+
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
42+
43+
## Enforcement Guidelines
44+
45+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
46+
47+
### 1. Correction
48+
49+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
50+
51+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
52+
53+
### 2. Warning
54+
55+
**Community Impact**: A violation through a single incident or series of actions.
56+
57+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
58+
59+
### 3. Temporary Ban
60+
61+
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
62+
63+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
64+
65+
### 4. Permanent Ban
66+
67+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
68+
69+
**Consequence**: A permanent ban from any sort of public interaction within the community.
70+
71+
## Attribution
72+
73+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
74+
75+
Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC].
76+
77+
For answers to common questions about this code of conduct, see the FAQ at [https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations].
78+
79+
[homepage]: https://www.contributor-covenant.org
80+
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
81+
[Mozilla CoC]: https://github.com/mozilla/diversity
82+
[FAQ]: https://www.contributor-covenant.org/faq
83+
[translations]: https://www.contributor-covenant.org/translations

0 commit comments

Comments
 (0)