Skip to content

feat: dotenvx#11

Merged
0xJagger merged 7 commits into
devfrom
feat/dotenvx
Jul 3, 2025
Merged

feat: dotenvx#11
0xJagger merged 7 commits into
devfrom
feat/dotenvx

Conversation

@0xJagger

@0xJagger 0xJagger commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

🤖 Linear

Closes SCR-31

Description

This PR implements a significant update to our environment configuration system, transitioning to dotenvx and improving our environment management workflow.

Changes

Documentation and Setup

  • Updated README.md with comprehensive documentation for dotenvx usage and new environment commands
  • Added dotenvx configuration to .env.example for better developer onboarding

Environment Configuration

  • Removed legacy dotenv configuration from env.ts
  • Added new env:prebuild script for environment setup
  • Updated pre-commit hooks to ensure proper environment handling
  • Updated .gitignore to include .env.keys and streamlined env file patterns

Dependencies and Maintenance

  • Updated package dependencies in pnpm-lock.yaml
  • Updated sample-app package.json configurations

Additional Notes

This PR represents a shift from traditional dotenv to dotenvx for improved environment variable management. All developers should review the updated README.md for new environment setup instructions.

Checklist before requesting a review

  • I have conducted a self-review of my code.
  • I have conducted a QA.
  • If it is a core feature, I have included comprehensive tests.

@linear

linear Bot commented Jun 19, 2025

Copy link
Copy Markdown

@defi-wonderland defi-wonderland deleted a comment from linear Bot Jun 19, 2025

@0xnigir1 0xnigir1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥷

Comment thread apps/sample-app/README.md
Comment on lines +30 to +49
- Encrypt the `.env` file and get your `.env.keys`

```bash
$ pnpm env:encrypt
```

Note that your `.env` file will be encrypted and tracked by git but the `.env.keys` won't.

To add a new env variable use the `pnpm env:set` command

```bash
pnpm env:set <key> <value>
```

To get the value of an encrypted env variable, use the `pnpm env:get` command.

```bash
pnpm env:get <key>
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so what we should share between teammates is the .env.keys that contains the private key for encrypt/decrypt right? i think i would add this so it's clear

@0xnigir1 0xnigir1 Jun 26, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah just read the Notion guide, maybe when the dotenvx is in the handbook, we could add a reference here 💡

Comment on lines +10 to +19
"env:decrypt": "npx @dotenvx/dotenvx decrypt",
"env:encrypt": "npx @dotenvx/dotenvx encrypt",
"env:get": "npx @dotenvx/dotenvx get",
"env:prebuild": "npx @dotenvx/dotenvx ext prebuild",
"env:set": "npx @dotenvx/dotenvx set",
"format": "prettier --check \"{src,test}/**/*.{js,ts,json}\"",
"format:fix": "prettier --write \"{src,test}/**/*.{js,ts,json}\"",
"lint": "eslint \"{src,test}/**/*.{js,ts,json}\"",
"lint:fix": "pnpm lint --fix",
"start": "node dist/index.js",
"start": "npx @dotenvx/dotenvx run -- node dist/index.js",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you know if this works, for example, when dockerizing an app?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a Use dotenvx with docker doc

In general the strategy is to install the tool with curl and then using the dotenvx run command

@0xAaCE 0xAaCE left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@0xJagger 0xJagger merged commit 4bd1650 into dev Jul 3, 2025
7 checks passed
@0xJagger 0xJagger deleted the feat/dotenvx branch July 3, 2025 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants