@shubhammaji1/envparity 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/README.md +97 -8
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,22 +1,111 @@
1
1
  # EnvParity
2
2
 
3
- Offline CLI checks for missing, empty, invalid, and undocumented environment
4
- variables. Reports include key names without printing dotenv values.
3
+ EnvParity checks local environment configuration before you start a JavaScript
4
+ or TypeScript project. Use it when you join a repository, change branches, or
5
+ pull a change that adds a required variable. Checks run offline and report key
6
+ names, file locations, and suggested fixes without printing dotenv values.
5
7
 
6
- Requires Node.js 22.15 or later. Git enables repository-aware discovery.
8
+ ## Install
9
+
10
+ Requires Node.js 22.15 or later. Install Git for branch and worktree discovery.
7
11
 
8
12
  ```sh
9
- npm install -g @shubhammaji1/envparity@0.1.1
13
+ npm install -g @shubhammaji1/envparity
10
14
  envparity --version
11
15
  ```
12
16
 
13
- In your project, add a required key to .env.example, such as PORT=, then run:
17
+ ## Quick start
18
+
19
+ In your application's directory, add the following key to `.env.example`.
20
+ Commit the template with empty or placeholder values and keep real values in
21
+ an ignored local dotenv file.
22
+
23
+ ```dotenv
24
+ API_BASE_URL=
25
+ ```
26
+
27
+ Run `init` once, or skip it if the project already has `envparity.yml`.
14
28
 
15
29
  ```sh
16
30
  envparity init
17
31
  envparity doctor
18
- envparity validate --json
19
32
  ```
20
33
 
21
- Run init once per project. If PORT is missing, set it in your local .env and
22
- rerun the check. Use envparity --help for commands and exit codes.
34
+ If the key is absent from the active local files, `doctor` reports
35
+ `MISSING API_BASE_URL` and exits with code 1. Add this example value to your
36
+ local `.env` file and run `envparity validate` again.
37
+
38
+ ```dotenv
39
+ API_BASE_URL=https://example.com
40
+ ```
41
+
42
+ ## Configuration
43
+
44
+ By default, EnvParity uses `.env.example` or falls back to `.env.template`.
45
+ Template keys are required unless their YAML rule sets `required: false`.
46
+ Add rules when a value must satisfy a type or constraint:
47
+
48
+ ```yaml
49
+ version: 1
50
+ files:
51
+ schema: .env.example
52
+ variables:
53
+ API_BASE_URL:
54
+ type: url
55
+ PORT:
56
+ required: false
57
+ type: integer
58
+ min: 1
59
+ max: 65535
60
+ validation:
61
+ undeclared: error
62
+ ```
63
+
64
+ Supported types are `string`, `boolean`, `number`, `integer`, `url`, `email`,
65
+ `json`, and `enum`. Use `files.local` to select a single project-relative
66
+ dotenv file. Otherwise the CLI checks layered files for the selected mode.
67
+ The default mode is `development`; use `--mode test` to check the test layers.
68
+ Precedence depends on the detected framework.
69
+
70
+ ## Commands
71
+
72
+ | Command | Behavior |
73
+ | --- | --- |
74
+ | `envparity init` | Creates `envparity.yml` and preserves an existing configuration. |
75
+ | `envparity doctor`, `diff`, `status` | Report local configuration and static source findings. |
76
+ | `envparity validate` | Checks dotenv files and schema rules. |
77
+ | `envparity scan` | Reports source findings from common JavaScript and TypeScript environment references. |
78
+
79
+ Add `--json` for machine-readable output. Exit code `0` means the command
80
+ completed without error-level findings, `1` means error-level findings were
81
+ reported, and `2` means a usage or operational error.
82
+
83
+ ## Git guard in 0.2.0 beta
84
+
85
+ ```sh
86
+ npm install -g @shubhammaji1/envparity@0.2.0
87
+ envparity hook install
88
+ envparity hook status
89
+ ```
90
+
91
+ The opt-in guard checks development configuration at the worktree root after
92
+ branch checkout, merge, or rebase. It warns without rewriting dotenv files or
93
+ blocking Git. Existing hooks and custom `core.hooksPath` setups can call the
94
+ check manually. For a `post-checkout` shell hook, add this to its successful
95
+ path:
96
+
97
+ ```sh
98
+ envparity hook check post-checkout "$@"
99
+ ```
100
+
101
+ Use `post-merge` or `post-rewrite` for the corresponding event. Run
102
+ `envparity hook uninstall` to remove EnvParity-managed hooks. Reinstall them
103
+ if the Node or CLI installation path moves.
104
+
105
+ ## Current limits
106
+
107
+ Checks use values from dotenv files on disk. Shell-injected variables are
108
+ outside the check, and possible interpolations are reported as uncertain.
109
+ Computed source references and custom environment wrappers may need manual
110
+ review. EnvParity currently provides local validation and the opt-in Git
111
+ guard. Provider sync, a secret vault, and dedicated PR checks are future work.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shubhammaji1/envparity",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Offline environment configuration checks for Git repositories",
5
5
  "engines": {
6
6
  "node": ">=22.15.0"