zcb 0.2.3 → 0.2.5
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 +3 -1
- package/dist/cjs/cli.cjs +1 -185
- package/dist/cjs/cli.cjs.map +1 -1
- package/dist/cjs/index.cjs +1 -384
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/cli.mjs +1 -182
- package/dist/esm/cli.mjs.map +1 -1
- package/dist/esm/index.mjs +1 -372
- package/dist/esm/index.mjs.map +1 -1
- package/dist/production.analysis.txt +72 -0
- package/dist/types/cjs/createConfigParser.d.cts +1 -1
- package/dist/types/cjs/createConfigParser.d.cts.map +1 -1
- package/dist/types/cjs/createConfigReader.d.cts +2 -2
- package/dist/types/cjs/createConfigReader.d.cts.map +1 -1
- package/dist/types/cjs/transformers/cloneNonEnumerableValues.d.cts.map +1 -1
- package/dist/types/cjs/types.d.cts +2 -2
- package/dist/types/cjs/types.d.cts.map +1 -1
- package/dist/types/cjs/utils/arrayHasInvalidDefaults.d.cts +1 -1
- package/dist/types/cjs/utils/arrayHasInvalidDefaults.d.cts.map +1 -1
- package/dist/types/cjs/utils/collateObjectPropertyDefaults.d.cts +2 -2
- package/dist/types/cjs/utils/collateObjectPropertyDefaults.d.cts.map +1 -1
- package/dist/types/cjs/utils/importValidateTransformWriteConfig.d.cts +1 -1
- package/dist/types/cjs/utils/importValidateTransformWriteConfig.d.cts.map +1 -1
- package/dist/types/cjs/utils/isSchemaValid.d.cts +1 -1
- package/dist/types/cjs/utils/isSchemaValid.d.cts.map +1 -1
- package/dist/types/cjs/utils/isValidPropertyDefinition.d.cts +1 -1
- package/dist/types/cjs/utils/isValidPropertyDefinition.d.cts.map +1 -1
- package/dist/types/cjs/utils/jsonStringifyReplacer.d.cts +1 -1
- package/dist/types/cjs/utils/jsonStringifyReplacer.d.cts.map +1 -1
- package/dist/types/cjs/utils/objectPropertyHasDefaults.d.cts +1 -1
- package/dist/types/cjs/utils/objectPropertyHasDefaults.d.cts.map +1 -1
- package/dist/types/cjs/utils/recordHasInvalidDefaults.d.cts +1 -1
- package/dist/types/cjs/utils/recordHasInvalidDefaults.d.cts.map +1 -1
- package/dist/types/cjs/utils/transformWriteConfig.d.cts +1 -1
- package/dist/types/cjs/utils/transformWriteConfig.d.cts.map +1 -1
- package/dist/types/esm/createConfigParser.d.ts +1 -1
- package/dist/types/esm/createConfigParser.d.ts.map +1 -1
- package/dist/types/esm/createConfigReader.d.ts +2 -2
- package/dist/types/esm/createConfigReader.d.ts.map +1 -1
- package/dist/types/esm/transformers/cloneNonEnumerableValues.d.ts.map +1 -1
- package/dist/types/esm/types.d.ts +2 -2
- package/dist/types/esm/types.d.ts.map +1 -1
- package/dist/types/esm/utils/arrayHasInvalidDefaults.d.ts +1 -1
- package/dist/types/esm/utils/arrayHasInvalidDefaults.d.ts.map +1 -1
- package/dist/types/esm/utils/collateObjectPropertyDefaults.d.ts +2 -2
- package/dist/types/esm/utils/collateObjectPropertyDefaults.d.ts.map +1 -1
- package/dist/types/esm/utils/importValidateTransformWriteConfig.d.ts +1 -1
- package/dist/types/esm/utils/importValidateTransformWriteConfig.d.ts.map +1 -1
- package/dist/types/esm/utils/isSchemaValid.d.ts +1 -1
- package/dist/types/esm/utils/isSchemaValid.d.ts.map +1 -1
- package/dist/types/esm/utils/isValidPropertyDefinition.d.ts +1 -1
- package/dist/types/esm/utils/isValidPropertyDefinition.d.ts.map +1 -1
- package/dist/types/esm/utils/jsonStringifyReplacer.d.ts +1 -1
- package/dist/types/esm/utils/jsonStringifyReplacer.d.ts.map +1 -1
- package/dist/types/esm/utils/objectPropertyHasDefaults.d.ts +1 -1
- package/dist/types/esm/utils/objectPropertyHasDefaults.d.ts.map +1 -1
- package/dist/types/esm/utils/recordHasInvalidDefaults.d.ts +1 -1
- package/dist/types/esm/utils/recordHasInvalidDefaults.d.ts.map +1 -1
- package/dist/types/esm/utils/transformWriteConfig.d.ts +1 -1
- package/dist/types/esm/utils/transformWriteConfig.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +22 -32
- package/src/createConfigParser.ts +1 -1
- package/src/createConfigReader.ts +2 -2
- package/src/transformers/cloneNonEnumerableValues.ts +6 -3
- package/src/types.ts +2 -2
- package/src/utils/arrayHasInvalidDefaults.ts +1 -1
- package/src/utils/collateObjectPropertyDefaults.ts +2 -2
- package/src/utils/importValidateTransformWriteConfig.ts +3 -3
- package/src/utils/isSchemaValid.ts +1 -1
- package/src/utils/isValidPropertyDefinition.ts +1 -1
- package/src/utils/jsonStringifyReplacer.ts +1 -1
- package/src/utils/objectPropertyHasDefaults.ts +1 -1
- package/src/utils/recordHasInvalidDefaults.ts +1 -1
- package/src/utils/transformWriteConfig.ts +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zcb",
|
|
3
3
|
"description": "Build configs with type safety from zod schema.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.5",
|
|
5
5
|
"author": "Dylan Aubrey",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/badbatch/zod-config-builder",
|
|
@@ -45,47 +45,37 @@
|
|
|
45
45
|
"zod-to-json-schema": "^3.21.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@babel/runtime": "<8",
|
|
49
48
|
"core-js": "<4",
|
|
50
49
|
"lodash-es": "<5",
|
|
51
50
|
"ts-node": "<11"
|
|
52
51
|
},
|
|
53
52
|
"devDependencies": {
|
|
54
|
-
"@babel/cli": "^7.21.5",
|
|
55
|
-
"@babel/core": "^7.21.8",
|
|
56
|
-
"@babel/eslint-parser": "^7.21.8",
|
|
57
|
-
"@babel/plugin-proposal-decorators": "^7.23.3",
|
|
58
|
-
"@babel/plugin-syntax-import-assertions": "^7.20.0",
|
|
59
|
-
"@babel/plugin-transform-class-properties": "^7.23.3",
|
|
60
|
-
"@babel/plugin-transform-export-namespace-from": "^7.23.4",
|
|
61
|
-
"@babel/plugin-transform-modules-commonjs": "^7.23.3",
|
|
62
|
-
"@babel/plugin-transform-runtime": "^7.21.4",
|
|
63
|
-
"@babel/preset-env": "^7.21.5",
|
|
64
|
-
"@babel/preset-react": "^7.18.6",
|
|
65
|
-
"@babel/preset-typescript": "^7.21.5",
|
|
66
|
-
"@babel/runtime": "^7.21.5",
|
|
67
53
|
"@commitlint/cli": "^17.6.3",
|
|
68
54
|
"@commitlint/config-conventional": "^17.6.3",
|
|
69
55
|
"@commitlint/prompt-cli": "^17.6.3",
|
|
70
|
-
"@jest/globals": "^29.
|
|
71
|
-
"@repodog/babel-config": "^1.1
|
|
72
|
-
"@repodog/cli": "^1.
|
|
73
|
-
"@repodog/commitlint-config": "^1.
|
|
74
|
-
"@repodog/eslint-config": "^1.
|
|
75
|
-
"@repodog/eslint-config-jest": "^1.1
|
|
76
|
-
"@repodog/jest-config": "^1.
|
|
77
|
-
"@repodog/markdownlint-config": "^1.1
|
|
78
|
-
"@repodog/prettier-config": "^1.1
|
|
79
|
-
"@repodog/rollup-config": "^1.
|
|
80
|
-
"@repodog/
|
|
81
|
-
"@repodog/
|
|
56
|
+
"@jest/globals": "^29.7.0",
|
|
57
|
+
"@repodog/babel-config": "^1.2.1",
|
|
58
|
+
"@repodog/cli": "^1.6.24",
|
|
59
|
+
"@repodog/commitlint-config": "^1.2.2",
|
|
60
|
+
"@repodog/eslint-config": "^1.2.2",
|
|
61
|
+
"@repodog/eslint-config-jest": "^1.2.1",
|
|
62
|
+
"@repodog/jest-config": "^1.2.3",
|
|
63
|
+
"@repodog/markdownlint-config": "^1.2.1",
|
|
64
|
+
"@repodog/prettier-config": "^1.2.1",
|
|
65
|
+
"@repodog/rollup-config": "^1.2.2",
|
|
66
|
+
"@repodog/swc-config": "^0.2.5",
|
|
67
|
+
"@repodog/syncpack-config": "^1.3.1",
|
|
68
|
+
"@repodog/ts-config": "^1.4.1",
|
|
82
69
|
"@rollup/plugin-babel": "^6.0.3",
|
|
83
70
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
84
71
|
"@rollup/plugin-image": "^3.0.2",
|
|
85
72
|
"@rollup/plugin-json": "^6.0.0",
|
|
86
73
|
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
74
|
+
"@rollup/plugin-swc": "^0.3.0",
|
|
87
75
|
"@rollup/plugin-terser": "^0.4.1",
|
|
88
|
-
"@
|
|
76
|
+
"@swc/core": "^1.4.1",
|
|
77
|
+
"@swc/jest": "^0.2.36",
|
|
78
|
+
"@types/jest": "^29.5.12",
|
|
89
79
|
"@types/lodash-es": "^4.17.9",
|
|
90
80
|
"@types/node": "^20.11.0",
|
|
91
81
|
"@typescript-eslint/eslint-plugin": "^5.59.5",
|
|
@@ -111,17 +101,17 @@
|
|
|
111
101
|
"generate-changelog": "^1.8.0",
|
|
112
102
|
"husky": "^8.0.3",
|
|
113
103
|
"identity-obj-proxy": "^3.0.0",
|
|
114
|
-
"jest": "^29.
|
|
104
|
+
"jest": "^29.7.0",
|
|
115
105
|
"jest-environment-jsdom": "^29.7.0",
|
|
116
106
|
"jest-environment-node": "^29.7.0",
|
|
117
107
|
"lodash-es": "^4.17.21",
|
|
118
|
-
"markdownlint-
|
|
108
|
+
"markdownlint-cli2": "^0.12.1",
|
|
119
109
|
"prettier": "^2.8.8",
|
|
120
110
|
"rollup": "^3.21.6",
|
|
121
111
|
"rollup-plugin-analyzer": "^4.0.0",
|
|
122
112
|
"rollup-plugin-copy": "^3.4.0",
|
|
123
113
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
124
|
-
"suppress-experimental-warnings": "^
|
|
114
|
+
"suppress-experimental-warnings": "^2.0.0",
|
|
125
115
|
"syncpack": "^12.3.0",
|
|
126
116
|
"ts-node": "^10.9.1",
|
|
127
117
|
"typescript": "^5.0.4"
|
|
@@ -145,7 +135,7 @@
|
|
|
145
135
|
"lint": "eslint . --ext .ts,.cjs",
|
|
146
136
|
"repodog": "repodog",
|
|
147
137
|
"syncpack": "syncpack format && syncpack list-mismatches && syncpack lint-semver-ranges",
|
|
148
|
-
"test": "node --require=suppress-experimental-warnings --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
138
|
+
"test": "COMPILER=swc node --require=suppress-experimental-warnings --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
149
139
|
"type-check": "tsc --noEmit",
|
|
150
140
|
"validate": "pnpm run syncpack && pnpm run build && pnpm run lint && pnpm run type-check && pnpm run test",
|
|
151
141
|
"zcb:build": "NODE_OPTIONS=\"--loader ts-node/esm\" node ./bin/zcb.mjs build ./src/__testUtils__/configBuilder.ts ./src/__testUtils__/builtConfig.ts",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { runExperiments } from './transformers/runExperiments.ts';
|
|
2
|
-
import type
|
|
2
|
+
import { type ConfigParserOptions, type TransformConfigHandler } from './types.ts';
|
|
3
3
|
import { transformConfig } from './utils/transformConfig.ts';
|
|
4
4
|
|
|
5
5
|
export const createConfigParser = async <Config extends object>(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { get } from 'lodash-es';
|
|
2
|
-
import type
|
|
3
|
-
import type
|
|
2
|
+
import { type Get } from 'type-fest';
|
|
3
|
+
import { type Path, type Scope } from './types.ts';
|
|
4
4
|
|
|
5
5
|
export interface ConfigReader<Config extends object> {
|
|
6
6
|
read: <P extends Path<Config>>(path: P) => Get<Config, P>;
|
|
@@ -3,9 +3,12 @@ import { type AnyRecord, NonEmumeralProperties, type TransformConfigHandlerSync
|
|
|
3
3
|
const NON_ENUMERABLE_KEYS = new Set(Object.values(NonEmumeralProperties));
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
6
|
-
export const cloneNonEnumerableValues: TransformConfigHandlerSync = <
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export const cloneNonEnumerableValues: TransformConfigHandlerSync = <
|
|
7
|
+
Config1 extends AnyRecord,
|
|
8
|
+
Config2 extends AnyRecord
|
|
9
|
+
>(
|
|
10
|
+
clone: Config1,
|
|
11
|
+
config: Config2
|
|
9
12
|
) => {
|
|
10
13
|
for (const nonEnumerableKey of NON_ENUMERABLE_KEYS) {
|
|
11
14
|
if (nonEnumerableKey in config) {
|
package/src/types.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
1
|
+
import { type List } from 'ts-toolbelt';
|
|
2
|
+
import { type Includes, type Join } from 'type-fest';
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
5
|
export type AnyRecord = Record<string, any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type JSONSchema7 } from 'json-schema';
|
|
2
2
|
import { isBoolean, isUndefined } from 'lodash-es';
|
|
3
|
-
import type
|
|
3
|
+
import { type Jsonifiable } from 'type-fest';
|
|
4
4
|
import { objectPropertyHasDefaults } from './objectPropertyHasDefaults.ts';
|
|
5
5
|
|
|
6
6
|
export const collateObjectPropertyDefaults = (propertyDefinition: JSONSchema7) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { resolve } from 'node:path';
|
|
2
2
|
import shelljs from 'shelljs';
|
|
3
|
-
import type
|
|
4
|
-
import type
|
|
5
|
-
import type
|
|
3
|
+
import { type Commands } from '../cli.ts';
|
|
4
|
+
import { type ConfigBuilder } from '../createConfigBuilder.ts';
|
|
5
|
+
import { type SetupExperimentsCallback } from '../types.ts';
|
|
6
6
|
import { transformWriteConfig } from './transformWriteConfig.ts';
|
|
7
7
|
|
|
8
8
|
export const importValidateTransformWriteConfig = (
|
|
@@ -6,7 +6,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
6
6
|
import shelljs from 'shelljs';
|
|
7
7
|
import { removeDisabledSlices } from '../transformers/removeDisabledSlices.ts';
|
|
8
8
|
import { setupExperiments } from '../transformers/setupExperiments.ts';
|
|
9
|
-
import type
|
|
9
|
+
import { type TransformConfigHandler, type WriteConfigOptions } from '../types.ts';
|
|
10
10
|
import { transformConfig } from './transformConfig.ts';
|
|
11
11
|
|
|
12
12
|
export const transformWriteConfig = async <Config extends object>(
|