zod-envkit 1.1.2 → 1.2.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 +7 -0
- package/dist/cli/index.cjs +6 -5
- package/dist/cli/index.js +6 -5
- package/package.json +16 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.2.0](https://github.com/nxtxe/zod-envkit/compare/v1.1.2...v1.2.0) (2026-02-16)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* stabilize preprod test suite, CLI E2E coverage, and CI pipeline ([463ea6e](https://github.com/nxtxe/zod-envkit/commit/463ea6e4676662dbbbe82bc79e0d85b079b524f8))
|
|
7
|
+
|
|
1
8
|
## [1.1.2](https://github.com/nxtxe/zod-envkit/compare/v1.1.1...v1.1.2) (2026-01-29)
|
|
2
9
|
|
|
3
10
|
|
package/dist/cli/index.cjs
CHANGED
|
@@ -540,18 +540,19 @@ function metaFromEnv(env, defaultGroup) {
|
|
|
540
540
|
return meta;
|
|
541
541
|
}
|
|
542
542
|
function registerInit(program2, getLang2) {
|
|
543
|
-
program2.command("init").description("Initialize env.meta.json from .env.example (or generate .env.example from meta)").option("--input <file>", "Input file (
|
|
543
|
+
program2.command("init").description("Initialize env.meta.json from .env.example (or generate .env.example from meta)").option("--input <file>", "Input file (.env.example or env.meta.json)").option("--output <file>", "Output file (env.meta.json or .env.example)").option("--from-meta", "Generate .env.example from env.meta.json instead").option("--group <name>", "Default group for all vars (when generating meta)").action((opts) => {
|
|
544
544
|
const lang = getLang2();
|
|
545
|
-
const
|
|
546
|
-
const
|
|
547
|
-
|
|
545
|
+
const fromMeta = Boolean(opts.fromMeta);
|
|
546
|
+
const input = String(opts.input ?? (fromMeta ? "env.meta.json" : ".env.example"));
|
|
547
|
+
const output = String(opts.output ?? (fromMeta ? ".env.example" : "env.meta.json"));
|
|
548
|
+
if (fromMeta) {
|
|
548
549
|
const { meta: meta2 } = loadMeta(lang, input);
|
|
549
550
|
import_node_fs4.default.writeFileSync(output, generateEnvExample(meta2), "utf8");
|
|
550
551
|
process.exit(0);
|
|
551
552
|
}
|
|
552
553
|
const env = readEnvFile(input);
|
|
553
554
|
if (Object.keys(env).length === 0) {
|
|
554
|
-
fail(lang, "
|
|
555
|
+
fail(lang, "META_PARSE_FAILED", [`- ${t(lang, "INIT_INPUT_EMPTY")} ${input}`]);
|
|
555
556
|
}
|
|
556
557
|
const meta = metaFromEnv(env, opts.group ? String(opts.group) : void 0);
|
|
557
558
|
import_node_fs4.default.writeFileSync(output, JSON.stringify(meta, null, 2) + "\n", "utf8");
|
package/dist/cli/index.js
CHANGED
|
@@ -328,18 +328,19 @@ function metaFromEnv(env, defaultGroup) {
|
|
|
328
328
|
return meta;
|
|
329
329
|
}
|
|
330
330
|
function registerInit(program2, getLang2) {
|
|
331
|
-
program2.command("init").description("Initialize env.meta.json from .env.example (or generate .env.example from meta)").option("--input <file>", "Input file (
|
|
331
|
+
program2.command("init").description("Initialize env.meta.json from .env.example (or generate .env.example from meta)").option("--input <file>", "Input file (.env.example or env.meta.json)").option("--output <file>", "Output file (env.meta.json or .env.example)").option("--from-meta", "Generate .env.example from env.meta.json instead").option("--group <name>", "Default group for all vars (when generating meta)").action((opts) => {
|
|
332
332
|
const lang = getLang2();
|
|
333
|
-
const
|
|
334
|
-
const
|
|
335
|
-
|
|
333
|
+
const fromMeta = Boolean(opts.fromMeta);
|
|
334
|
+
const input = String(opts.input ?? (fromMeta ? "env.meta.json" : ".env.example"));
|
|
335
|
+
const output = String(opts.output ?? (fromMeta ? ".env.example" : "env.meta.json"));
|
|
336
|
+
if (fromMeta) {
|
|
336
337
|
const { meta: meta2 } = loadMeta(lang, input);
|
|
337
338
|
fs4.writeFileSync(output, generateEnvExample(meta2), "utf8");
|
|
338
339
|
process.exit(0);
|
|
339
340
|
}
|
|
340
341
|
const env = readEnvFile(input);
|
|
341
342
|
if (Object.keys(env).length === 0) {
|
|
342
|
-
fail(lang, "
|
|
343
|
+
fail(lang, "META_PARSE_FAILED", [`- ${t(lang, "INIT_INPUT_EMPTY")} ${input}`]);
|
|
343
344
|
}
|
|
344
345
|
const meta = metaFromEnv(env, opts.group ? String(opts.group) : void 0);
|
|
345
346
|
fs4.writeFileSync(output, JSON.stringify(meta, null, 2) + "\n", "utf8");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zod-envkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Validate environment variables with Zod and generate .env.example",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "",
|
|
@@ -38,17 +38,24 @@
|
|
|
38
38
|
"README.md",
|
|
39
39
|
"README.RU.md",
|
|
40
40
|
"CHANGELOG.md",
|
|
41
|
-
"LICENSE"
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"package.json"
|
|
42
43
|
],
|
|
43
44
|
"scripts": {
|
|
44
45
|
"build": "rm -rf dist && tsup src/index.ts src/cli/index.ts --format esm,cjs --dts --outDir dist",
|
|
45
46
|
"dev": "tsup src/index.ts src/cli/index.ts --watch --dts --outDir dist",
|
|
46
|
-
"test": "
|
|
47
|
-
"test:
|
|
48
|
-
"
|
|
49
|
-
"
|
|
47
|
+
"test": "pnpm test:preprod",
|
|
48
|
+
"test:preprod": "pnpm build && vitest run tests/test/preprod",
|
|
49
|
+
"test:preprod:robust": "pnpm build && PREPROD_ITER=30 vitest run tests/test/preprod/30-robustness",
|
|
50
|
+
"test:before-release": "pnpm build && pnpm test:preprod && pnpm test:preprod:robust",
|
|
51
|
+
"ci:smoke": "pnpm build && node dist/cli/index.js --help",
|
|
52
|
+
"ci:docs": "pnpm docs:build",
|
|
53
|
+
"ci:all": "pnpm ci:smoke && pnpm test && pnpm ci:docs",
|
|
54
|
+
"prepublishOnly": "pnpm build && pnpm test",
|
|
55
|
+
"docs:api": "typedoc --tsconfig tsconfig.docs.json --entryPoints src/index.ts",
|
|
50
56
|
"docs:build": "pnpm docs:api && vitepress build docs",
|
|
51
|
-
"docs:dev": "vitepress dev docs"
|
|
57
|
+
"docs:dev": "vitepress dev docs",
|
|
58
|
+
"release": "semantic-release"
|
|
52
59
|
},
|
|
53
60
|
"dependencies": {
|
|
54
61
|
"commander": "^13.1.0",
|
|
@@ -64,7 +71,9 @@
|
|
|
64
71
|
"@semantic-release/release-notes-generator": "^12.1.0",
|
|
65
72
|
"@types/node": "^25.0.10",
|
|
66
73
|
"eslint": "^9.39.2",
|
|
74
|
+
"execa": "^9.6.1",
|
|
67
75
|
"semantic-release": "^22.0.12",
|
|
76
|
+
"tmp-promise": "^3.0.3",
|
|
68
77
|
"tsup": "^8.5.1",
|
|
69
78
|
"typedoc": "^0.28.16",
|
|
70
79
|
"typedoc-plugin-markdown": "^4.9.0",
|