zod-envkit 1.3.5 → 1.5.0
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/CHANGELOG.md +20 -0
- package/README.RU.md +8 -1
- package/README.md +8 -1
- package/dist/cli/index.cjs +6 -1
- package/dist/cli/index.js +6 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# [1.5.0](https://github.com/nxtxe/zod-envkit/compare/v1.4.0...v1.5.0) (2026-06-06)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **ci:** use npm trusted publishing for semantic-release ([2f05e0b](https://github.com/nxtxe/zod-envkit/commit/2f05e0b9e45c385160bcc42bafbc70db6078b52f))
|
|
7
|
+
* **release:** accept semantic-release changelog heading in hygiene check ([e40a655](https://github.com/nxtxe/zod-envkit/commit/e40a655270798157a2afc4388f9a490576efd12b))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **cli:** fail on unknown dotenv keys in check --production mode ([ff52897](https://github.com/nxtxe/zod-envkit/commit/ff528978966982d0f59530b170d712efb86c09e6))
|
|
13
|
+
|
|
14
|
+
# [1.4.0](https://github.com/nxtxe/zod-envkit/compare/v1.3.5...v1.4.0) (2026-05-19)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* **cli:** add --production flag scaffold for check command ([01f3a02](https://github.com/nxtxe/zod-envkit/commit/01f3a02cfba0b991e3403968848818d73e570e0b))
|
|
20
|
+
|
|
1
21
|
## [1.3.5](https://github.com/nxtxe/zod-envkit/compare/v1.3.4...v1.3.5) (2026-05-04)
|
|
2
22
|
|
|
3
23
|
|
package/README.RU.md
CHANGED
|
@@ -233,8 +233,15 @@ npx zod-envkit check
|
|
|
233
233
|
npx zod-envkit check --strict
|
|
234
234
|
```
|
|
235
235
|
|
|
236
|
+
Production guard (более строгие проверки для deploy/CI; неизвестные ключи из dotenv — как в `--strict`):
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
npx zod-envkit check --production
|
|
240
|
+
```
|
|
241
|
+
|
|
236
242
|
- завершает процесс с кодом `1`, если отсутствуют обязательные переменные
|
|
237
|
-
- в `--strict` режиме также падает при
|
|
243
|
+
- в `--strict` режиме также падает при неизвестных переменных (только ключи из dotenv)
|
|
244
|
+
- с `--production` также падает при неизвестных переменных из dotenv (тот же dotenv-only scope, что у `--strict`)
|
|
238
245
|
|
|
239
246
|
---
|
|
240
247
|
|
package/README.md
CHANGED
|
@@ -230,8 +230,15 @@ Strict mode (fail on unknown variables):
|
|
|
230
230
|
npx zod-envkit check --strict
|
|
231
231
|
```
|
|
232
232
|
|
|
233
|
+
Production guard (stricter deploy/CI checks; unknown dotenv keys fail like `--strict`):
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
npx zod-envkit check --production
|
|
237
|
+
```
|
|
238
|
+
|
|
233
239
|
* exits with code `1` if required variables are missing
|
|
234
|
-
* in `--strict` mode also fails on unknown variables
|
|
240
|
+
* in `--strict` mode also fails on unknown variables (dotenv-loaded keys only)
|
|
241
|
+
* with `--production` also fails on unknown dotenv variables (same dotenv-only scope as `--strict`)
|
|
235
242
|
|
|
236
243
|
---
|
|
237
244
|
|
package/dist/cli/index.cjs
CHANGED
|
@@ -636,6 +636,9 @@ async function loadSchemaFile(filePath, lang) {
|
|
|
636
636
|
// src/cli/commands/check.ts
|
|
637
637
|
function registerCheck(program2, getLang2) {
|
|
638
638
|
program2.command("check").description("Exit with code 1 if env is invalid (loads dotenv)").option("-c, --config <file>", "Path to env meta json", "env.meta.json").option("--dotenv <list>", "Comma-separated dotenv files (default: .env)", ".env").option("--strict", "Fail if unknown env vars are present (dotenv-only)").option(
|
|
639
|
+
"--production",
|
|
640
|
+
"Production guard: stricter deploy/CI checks (unknown dotenv keys, empty required, placeholders)"
|
|
641
|
+
).option(
|
|
639
642
|
"--schema <file>",
|
|
640
643
|
"Path to JS file exporting Zod object; run schema\u2194meta consistency check"
|
|
641
644
|
).option(
|
|
@@ -644,6 +647,8 @@ function registerCheck(program2, getLang2) {
|
|
|
644
647
|
"strict"
|
|
645
648
|
).action(async (opts) => {
|
|
646
649
|
const lang = getLang2();
|
|
650
|
+
const production = Boolean(opts.production);
|
|
651
|
+
const strictEffective = Boolean(opts.strict) || production;
|
|
647
652
|
const loaded = loadDotEnv(opts.dotenv);
|
|
648
653
|
const { meta } = loadMeta(lang, opts.config);
|
|
649
654
|
const sections = [];
|
|
@@ -653,7 +658,7 @@ function registerCheck(program2, getLang2) {
|
|
|
653
658
|
missing.forEach((k) => sections.push(`- ${k}`));
|
|
654
659
|
sections.push("");
|
|
655
660
|
}
|
|
656
|
-
if (
|
|
661
|
+
if (strictEffective) {
|
|
657
662
|
const unknown = getUnknownEnv(meta, loaded.env);
|
|
658
663
|
if (unknown.length) {
|
|
659
664
|
sections.push(t(lang, "UNKNOWN_ENV"));
|
package/dist/cli/index.js
CHANGED
|
@@ -415,6 +415,9 @@ async function loadSchemaFile(filePath, lang) {
|
|
|
415
415
|
// src/cli/commands/check.ts
|
|
416
416
|
function registerCheck(program2, getLang2) {
|
|
417
417
|
program2.command("check").description("Exit with code 1 if env is invalid (loads dotenv)").option("-c, --config <file>", "Path to env meta json", "env.meta.json").option("--dotenv <list>", "Comma-separated dotenv files (default: .env)", ".env").option("--strict", "Fail if unknown env vars are present (dotenv-only)").option(
|
|
418
|
+
"--production",
|
|
419
|
+
"Production guard: stricter deploy/CI checks (unknown dotenv keys, empty required, placeholders)"
|
|
420
|
+
).option(
|
|
418
421
|
"--schema <file>",
|
|
419
422
|
"Path to JS file exporting Zod object; run schema\u2194meta consistency check"
|
|
420
423
|
).option(
|
|
@@ -423,6 +426,8 @@ function registerCheck(program2, getLang2) {
|
|
|
423
426
|
"strict"
|
|
424
427
|
).action(async (opts) => {
|
|
425
428
|
const lang = getLang2();
|
|
429
|
+
const production = Boolean(opts.production);
|
|
430
|
+
const strictEffective = Boolean(opts.strict) || production;
|
|
426
431
|
const loaded = loadDotEnv(opts.dotenv);
|
|
427
432
|
const { meta } = loadMeta(lang, opts.config);
|
|
428
433
|
const sections = [];
|
|
@@ -432,7 +437,7 @@ function registerCheck(program2, getLang2) {
|
|
|
432
437
|
missing.forEach((k) => sections.push(`- ${k}`));
|
|
433
438
|
sections.push("");
|
|
434
439
|
}
|
|
435
|
-
if (
|
|
440
|
+
if (strictEffective) {
|
|
436
441
|
const unknown = getUnknownEnv(meta, loaded.env);
|
|
437
442
|
if (unknown.length) {
|
|
438
443
|
sections.push(t(lang, "UNKNOWN_ENV"));
|