envilder 0.3.1 โ†’ 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- name: Publish to npm
1
+ name: ๐Ÿ„ Power-Up Publisher
2
2
 
3
3
  on:
4
4
  push:
@@ -9,37 +9,37 @@ on:
9
9
  - 'package.json'
10
10
  - '.github/workflows/publish.yml'
11
11
 
12
+ # Add explicit permissions for the GITHUB_TOKEN
13
+ permissions:
14
+ contents: write
15
+ packages: write
16
+
12
17
  jobs:
13
18
  publish:
14
19
  runs-on: ubuntu-latest
15
20
  steps:
16
- - name: Checkout repository
21
+ - name: ๐Ÿงฑ Checkout repository
17
22
  uses: actions/checkout@v3
18
23
  with:
19
24
  fetch-depth: 0
20
25
 
21
- - name: Setup Node.js
26
+ - name: ๐Ÿ”ง Setup Node.js
22
27
  uses: actions/setup-node@v3
23
28
  with:
24
29
  node-version: '20'
25
30
  registry-url: 'https://registry.npmjs.org'
26
31
  cache: 'yarn'
27
32
 
28
- - name: Install dependencies
33
+ - name: ๐ŸŒŸ Install dependencies
29
34
  run: yarn install --frozen-lockfile
30
35
 
31
- - name: Lint
32
- run: yarn lint
33
-
34
- - name: Security Check
35
- run: |
36
- npm install -g @secretlint/secretlint-rule-preset-recommend secretlint
37
- secretlint "**/*" --secretlintrc .secretlintrc.json
36
+ - name: ๐Ÿ”ฅ Lint
37
+ run: yarn lint
38
38
 
39
- - name: Run tests
39
+ - name: ๐Ÿ„ Run tests
40
40
  run: yarn test
41
41
 
42
- - name: Detect version bump
42
+ - name: ๐Ÿ‘‘ Detect version bump
43
43
  id: version-check
44
44
  run: |
45
45
  CURRENT_VERSION=$(node -p "require('./package.json').version")
@@ -58,21 +58,23 @@ jobs:
58
58
  echo "version_changed=false" >> $GITHUB_OUTPUT
59
59
  fi
60
60
 
61
- - name: Build package
61
+ - name: ๐Ÿ”จ Build package
62
62
  if: steps.version-check.outputs.version_changed == 'true'
63
63
  run: yarn build
64
64
 
65
- - name: Publish to npm
65
+ - name: ๐Ÿšฉ Publish to npm
66
66
  if: steps.version-check.outputs.version_changed == 'true'
67
67
  run: yarn publish --non-interactive
68
68
  env:
69
69
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
70
70
 
71
- - name: Create GitHub Release
71
+ - name: ๐Ÿฐ Create GitHub Release
72
72
  if: steps.version-check.outputs.version_changed == 'true'
73
73
  uses: ncipollo/release-action@v1
74
74
  with:
75
75
  tag: "v${{ steps.version-check.outputs.current_version }}"
76
- name: "Release v${{ steps.version-check.outputs.current_version }}"
76
+ name: "๐Ÿ„ Level Up Release v${{ steps.version-check.outputs.current_version }}"
77
77
  generateReleaseNotes: true
78
78
  token: ${{ secrets.GITHUB_TOKEN }}
79
+ makeLatest: legacy
80
+ replacesArtifacts: true
package/README.md CHANGED
@@ -1,26 +1,119 @@
1
- ![Envilder](https://github.com/user-attachments/assets/f646a3e7-6ae2-4f3b-8f51-3807067fc99c)
1
+ <h1 align="center">
2
+ <br>
3
+ <img src="https://github.com/user-attachments/assets/96bf1efa-7d21-440a-a414-3a20e7f9a1f1" alt="Envilder" width="200">
4
+ <br>
5
+ Envilder
6
+ <br>
7
+ </h1>
8
+
9
+ <h4 align="center">Secure Your Environment Variables with AWS SSM Parameter Store</h4>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/envilder">
13
+ <img src="https://img.shields.io/npm/v/envilder.svg" alt="npm version">
14
+ </a>
15
+ <a href="./LICENSE">
16
+ <img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License">
17
+ </a>
18
+ <a href="https://macalbert.github.io/envilder/">
19
+ <img src="https://img.shields.io/badge/coverage-report-green.svg" alt="Coverage Report">
20
+ </a>
21
+ </p>
22
+
23
+ <p align="center">
24
+ <b>Stop committing secrets to your repo! Start using AWS SSM Parameter Store to secure your credentials.</b>
25
+ </p>
26
+
27
+ ## โšก Quick Start
2
28
 
3
- Envilder is a CLI tool for managing AWS SSM Parameter Store parameters and automatically generating the required
4
- `.env` file. This tool simplifies project environment variable management, avoiding manual updates and ensuring
5
- consistency across environments.
29
+ ```bash
30
+ # Install globally
31
+ npm install -g envilder
32
+
33
+ # Create a simple mapping file
34
+ echo '{"DB_PASSWORD": "/my-app/db/password"}' > param-map.json
35
+
36
+ # Generate your .env file
37
+ envilder --map=param-map.json --envfile=.env
38
+ ```
39
+
40
+ ## ๐Ÿค” What Problem Does Envilder Solve?
41
+
42
+ <table>
43
+ <tr>
44
+ <th>โŒ Without Envilder</th>
45
+ <th>โœ… With Envilder</th>
46
+ </tr>
47
+ <tr>
48
+ <td>
49
+
50
+ ```plaintext
51
+ - Secrets committed to repos
52
+ - Manual .env file updates
53
+ - Inconsistent environments
54
+ - Password sharing via chat/email
55
+ - CI/CD secrets management pain
56
+ ```
57
+
58
+ </td>
59
+ <td>
60
+
61
+ ```plaintext
62
+ - Secrets stored securely in AWS SSM
63
+ - Automated .env file generation
64
+ - Consistent environments
65
+ - No need to share raw credentials
66
+ - Simple CI/CD integration
67
+ ```
68
+
69
+ </td>
70
+ </tr>
71
+ </table>
72
+
73
+ ## ๐Ÿ’ก Why Envilder?
74
+
75
+ - ๐Ÿ” **No More Secrets in Git** - Store credentials in AWS SSM Parameter Store instead of version control
76
+ - ๐Ÿค– **Automate Everything** - One command to generate your `.env` files across all environments
77
+ - ๐Ÿ”„ **Always in Sync** - Keep your local, dev, and production environments consistent
78
+ - ๐ŸŽ๏ธ **Fast to Set Up** - Configure once, then generate `.env` files with a single command
79
+ - ๐Ÿชถ **Simple but Powerful** - Easy interface with support for encrypted parameters and multiple AWS profiles
80
+
81
+ ## ๐ŸŽฏ Perfect for Teams
82
+
83
+ Envilder is the tool you need if you:
6
84
 
7
- # โœจ Features
85
+ - ๐Ÿ‘ฅ **Work in a Development Team** - Ensure everyone has the same environment without sharing raw secrets
86
+ - ๐Ÿ”‘ **Deal with API Keys & Tokens** - Securely store and retrieve sensitive credentials
87
+ - โš™๏ธ **Run CI/CD Pipelines** - Automatically generate environment files during deployments
88
+ - โ˜๏ธ **Use AWS Already** - Leverage your existing AWS infrastructure more effectively
89
+ - ๐ŸŒ **Manage Multiple Environments** - Switch easily between dev, staging, and production
8
90
 
9
- - ๐Ÿ”’ Fetch parameters securely from AWS SSM Parameter Store.
10
- - โšก Automatically generates a `.env` file with specified parameters.
11
- - ๐Ÿ›ก๏ธ Handles encrypted SSM parameters.
12
- - ๐Ÿชถ Lightweight and simple to use.
13
- - ๐Ÿ”„ Support for multiple AWS profiles.
91
+ ## ๐Ÿ” How It Works (Simple!)
14
92
 
15
- # Prerequisites
93
+ ```mermaid
94
+ graph LR
95
+ A[Mapping File] --> B[Envilder]
96
+ C[AWS Credentials] --> B
97
+ B --> D[.env File]
98
+ E[SSM Parameters] --> B
99
+ ```
100
+
101
+ 1. ๐Ÿ“– **Define Your Mapping** - Simple JSON mapping env vars to SSM paths
102
+ 2. ๐Ÿš€ **Run Envilder** - One command with your mapping file
103
+ 3. ๐Ÿ”„ **Auto-Fetch from AWS** - Retrieves values using your AWS credentials
104
+ 4. ๐Ÿ’พ **Get Your .env File** - Ready to use in your project
105
+
106
+ ## โš™๏ธ Prerequisites
107
+
108
+ You'll need:
16
109
 
17
- Before using `Envilder`, ensure that you have the AWS CLI installed and properly configured on your local
18
- machine. This configuration is required for `Envilder` to access and manage parameters in AWS SSM.
110
+ - โœ… **AWS CLI** - Installed and configured with proper permissions to access SSM Parameter Store
111
+ - โœ… **Node.js** - Version 14 or higher
19
112
 
20
- ## AWS CLI Installation & Configuration
113
+ ### AWS CLI Setup
21
114
 
22
- 1. Install the AWS CLI by following the instructions [here](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
23
- 2. After installation, configure the AWS CLI using the following command:
115
+ 1. Install the AWS CLI by following the [official instructions](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).
116
+ 2. After installation, configure the AWS CLI:
24
117
 
25
118
  ```bash
26
119
  aws configure
@@ -32,38 +125,31 @@ machine. This configuration is required for `Envilder` to access and manage para
32
125
  - Default region name (e.g., `us-east-1`)
33
126
  - Default output format (e.g., `json`)
34
127
 
35
- Make sure that the AWS credentials you're using have the appropriate permissions to access the SSM Parameter
36
- Store in your AWS account.
128
+ Make sure your AWS credentials have the appropriate permissions to access the SSM Parameter Store.
37
129
 
38
- # Installation
39
-
40
- You can install `Envilder` globally using yarn. This will allow you to use the `envilder` command from any
41
- directory on your system.
130
+ ## ๐Ÿ“ฆ Installation
42
131
 
43
132
  ```bash
133
+ # Using npm
134
+ npm install -g envilder
135
+
136
+ # Using yarn
44
137
  yarn global add envilder
45
138
  ```
46
139
 
47
- # ๐Ÿ“ฆ Installation
48
-
49
- You can install **envilder** globally or locally using npm:
140
+ ## ๐Ÿš€ Usage
50
141
 
51
142
  ```bash
52
- npm install -g envilder
143
+ envilder --map=<mapping-file> --envfile=<output-file> [--profile=<aws-profile>]
53
144
  ```
54
145
 
55
- # ๐Ÿš€ Usage
56
-
57
- Envilder requires two arguments:
58
-
59
- - `--map <path>`: Path to a JSON file mapping environment variable names to SSM parameters.
60
- - `--envfile <path>`: Path where the generated .env file will be saved.
61
-
62
- Optional arguments:
146
+ | Option | Description |
147
+ |--------|-------------|
148
+ | `--map` | Path to JSON mapping file (required) |
149
+ | `--envfile` | Path to output .env file (required) |
150
+ | `--profile` | AWS CLI profile to use (optional) |
63
151
 
64
- - `--profile <name>`: AWS CLI profile to use for credentials (if not using the default profile).
65
-
66
- # ๐Ÿ”ง Example
152
+ ## ๐Ÿ”ง Quick Example
67
153
 
68
154
  1. Create a mapping file `param-map.json`:
69
155
 
@@ -74,25 +160,24 @@ Optional arguments:
74
160
  }
75
161
  ```
76
162
 
77
- 2. Run envilder to generate your `.env` file:
163
+ 2. Generate your `.env` file:
78
164
 
79
165
  ```bash
80
166
  envilder --map=param-map.json --envfile=.env
81
167
  ```
82
168
 
83
- 3. To use a specific AWS profile:
169
+ 3. Use a specific AWS profile:
84
170
 
85
171
  ```bash
86
172
  envilder --map=param-map.json --envfile=.env --profile=dev-account
87
173
  ```
88
174
 
89
- 4. The `.env` file will be generated in the specified location.
90
-
91
175
  ## ๐ŸŒ Working with Multiple AWS Profiles
92
176
 
93
- If you work with multiple AWS accounts or environments, you can configure different profiles in your AWS credentials file:
177
+ For multiple AWS accounts or environments, configure different profiles in your AWS credentials file:
94
178
 
95
- 1. Edit your AWS credentials file (usually at `~/.aws/credentials` on Linux/Mac or `%USERPROFILE%\.aws\credentials` on Windows):
179
+ 1. Edit your AWS credentials file (typically located at `~/.aws/credentials` on Linux/Mac
180
+ or `%USERPROFILE%\.aws\credentials` on Windows):
96
181
 
97
182
  ```ini
98
183
  [default]
@@ -108,37 +193,35 @@ If you work with multiple AWS accounts or environments, you can configure differ
108
193
  aws_secret_access_key=YOUR_PROD_SECRET_KEY
109
194
  ```
110
195
 
111
- 2. When running Envilder, specify which profile to use with the `--profile` option:
196
+ 2. Specify which profile to use:
112
197
 
113
198
  ```bash
114
- # For development environment
199
+ # Development environment
115
200
  envilder --map=param-map.json --envfile=.env.development --profile=dev-account
116
201
 
117
- # For production environment
202
+ # Production environment
118
203
  envilder --map=param-map.json --envfile=.env.production --profile=prod-account
119
204
  ```
120
205
 
121
- # ๐Ÿ“‚ Sample `.env` Output
206
+ ## ๐Ÿ“‚ Sample `.env` Output
122
207
 
123
- ```makefile
208
+ ```ini
124
209
  SECRET_TOKEN=mockedEmail@example.com
125
210
  SECRET_KEY=mockedPassword
126
211
  ```
127
212
 
128
- # ๐Ÿงช Running Tests
129
-
130
- To run the tests with coverage:
213
+ ## ๐Ÿงช Running Tests
131
214
 
132
215
  ```bash
133
216
  yarn test
134
217
  ```
135
218
 
136
- Here you can see the current coverage report: <https://macalbert.github.io/envilder/>
219
+ Check the current coverage report: [Coverage Report](https://macalbert.github.io/envilder/)
137
220
 
138
- # ๐Ÿ“ License
221
+ ## ๐Ÿ“ License
139
222
 
140
223
  This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
141
224
 
142
- # ๐Ÿ™Œ Contributing
225
+ ## ๐Ÿ™Œ Contributing
143
226
 
144
227
  Contributions are welcome! Feel free to submit issues and pull requests.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envilder",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "A CLI tool to generate .env files from AWS SSM parameters",
5
5
  "exports": {
6
6
  ".": {
@@ -61,4 +61,4 @@
61
61
  "node": ">=20.0.0",
62
62
  "yarn": ">=1.22"
63
63
  }
64
- }
64
+ }