dotenv-diff 2.1.1 → 2.1.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.
package/README.md CHANGED
@@ -63,6 +63,26 @@ You can also change the comparison file by using the `--example` flag to point t
63
63
  dotenv-diff --scan-usage --example .env.example.staging --ci
64
64
  ```
65
65
 
66
+ ## Use it in a Turborepo Monorepo
67
+
68
+ In a monorepo setup (e.g. with Turborepo), you often have multiple apps under apps/ and shared packages under packages/.
69
+ You can run dotenv-diff from one app and still include files from sibling apps or packages.
70
+
71
+ For example, if you want to scan from the apps/app1 folder and also include code in packages/auth, you can do:
72
+
73
+ ```json
74
+ {
75
+ "scripts": {
76
+ "dotenv-diff": "dotenv-diff --scan-usage --example .env.example --include-files '../../packages/**/*' --ignore VITE_MODE"
77
+ }
78
+ }
79
+ ```
80
+
81
+ This will:
82
+ - Compare the variables used in your `apps/app1` code against `apps/app1/.env.example`.
83
+ - Also scan files in `../../packages`(like `packages/components/src/..`)
84
+ - Ignore variables like VITE_MODE that you only use in special cases.
85
+
66
86
  ## Show unused variables
67
87
 
68
88
  Use `--show-unused` together with `--scan-usage` to list variables that are defined in `.env` but never used in your codebase:
@@ -80,14 +100,14 @@ This will display statistics about the scan, such as the number of files scanned
80
100
 
81
101
  ## include or exclude specific files for scanning
82
102
 
83
- You can specify which files to include or exclude from the scan using the `--include` and `--exclude` options:
103
+ You can specify which files to include or exclude from the scan using the `--include-files` and `--exclude-files` options:
84
104
 
85
105
  ```bash
86
- dotenv-diff --scan-usage --include '**/*.js,**/*.ts' --exclude '**/*.spec.ts'
106
+ dotenv-diff --scan-usage --include-files '**/*.js,**/*.ts' --exclude-files '**/*.spec.ts'
87
107
  ```
88
108
 
89
109
  By default, the scanner looks at JavaScript, TypeScript, Vue, and Svelte files.
90
- The --include and --exclude options let you refine this list to focus on specific file types or directories.
110
+ The --include-files and --exclude-files options let you refine this list to focus on specific file types or directories.
91
111
 
92
112
  ### Override with `--files`
93
113
 
@@ -158,12 +178,11 @@ Or provide just an example file and let the tool locate the appropriate `.env`:
158
178
  dotenv-diff --example .env.example.production
159
179
  ```
160
180
 
161
- ## CI usage
181
+ ## Automatically create missing files
162
182
 
163
183
  Run non-interactively in CI environments with:
164
184
 
165
185
  ```bash
166
- dotenv-diff --ci # never create files, exit 1 if required files are missing
167
186
  dotenv-diff --yes # auto-create missing files without prompts
168
187
  ```
169
188
 
@@ -46,6 +46,8 @@ const DEFAULT_INCLUDE_EXTENSIONS = [
46
46
  ];
47
47
  const DEFAULT_EXCLUDE_PATTERNS = [
48
48
  'node_modules',
49
+ '.sveltekit',
50
+ '_actions',
49
51
  'dist',
50
52
  'build',
51
53
  '.next',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dotenv-diff",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "type": "module",
5
5
  "description": "A CLI tool to find differences between .env and .env.example / .env.* files. And optionally scan your codebase to find out which environment variables are actually used in your code.",
6
6
  "bin": {