zcb 0.0.8 → 0.0.10

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 (62) hide show
  1. package/dist/main/cli.mjs +182 -0
  2. package/dist/main/cli.mjs.map +1 -0
  3. package/dist/main/index.mjs +321 -0
  4. package/dist/main/index.mjs.map +1 -0
  5. package/dist/main/templates/config.ts.hbs +4 -0
  6. package/dist/tsconfig.build.tsbuildinfo +1 -0
  7. package/dist/types/cli.d.ts +6 -0
  8. package/dist/types/cli.d.ts.map +1 -0
  9. package/dist/types/createConfigBuilder.d.ts +23 -0
  10. package/dist/types/createConfigBuilder.d.ts.map +1 -0
  11. package/dist/types/createConfigParser.d.ts +3 -0
  12. package/dist/types/createConfigParser.d.ts.map +1 -0
  13. package/dist/types/createConfigReader.d.ts +38 -0
  14. package/dist/types/createConfigReader.d.ts.map +1 -0
  15. package/dist/types/data/countryCodes.d.ts +2 -0
  16. package/dist/types/data/countryCodes.d.ts.map +1 -0
  17. package/dist/types/data/countryNames.d.ts +2 -0
  18. package/dist/types/data/countryNames.d.ts.map +1 -0
  19. package/dist/types/data/distanceUnits.d.ts +2 -0
  20. package/dist/types/data/distanceUnits.d.ts.map +1 -0
  21. package/dist/types/data/languageCodes.d.ts +2 -0
  22. package/dist/types/data/languageCodes.d.ts.map +1 -0
  23. package/dist/types/data/timezones.d.ts +2 -0
  24. package/dist/types/data/timezones.d.ts.map +1 -0
  25. package/dist/types/index.d.ts +10 -0
  26. package/dist/types/index.d.ts.map +1 -0
  27. package/dist/types/transformers/cloneNonEnumerableValues.d.ts +3 -0
  28. package/dist/types/transformers/cloneNonEnumerableValues.d.ts.map +1 -0
  29. package/dist/types/transformers/removeDisabledSlices.d.ts +3 -0
  30. package/dist/types/transformers/removeDisabledSlices.d.ts.map +1 -0
  31. package/dist/types/transformers/runExperiments.d.ts +3 -0
  32. package/dist/types/transformers/runExperiments.d.ts.map +1 -0
  33. package/dist/types/transformers/setupExperiments.d.ts +3 -0
  34. package/dist/types/transformers/setupExperiments.d.ts.map +1 -0
  35. package/dist/types/types.d.ts +45 -0
  36. package/dist/types/types.d.ts.map +1 -0
  37. package/dist/types/utils/arrayHasInvalidDefaults.d.ts +3 -0
  38. package/dist/types/utils/arrayHasInvalidDefaults.d.ts.map +1 -0
  39. package/dist/types/utils/importValidateTransformWriteConfig.d.ts +3 -0
  40. package/dist/types/utils/importValidateTransformWriteConfig.d.ts.map +1 -0
  41. package/dist/types/utils/isDerivedValueCallback.d.ts +2 -0
  42. package/dist/types/utils/isDerivedValueCallback.d.ts.map +1 -0
  43. package/dist/types/utils/isInvalidPropertyOverride.d.ts +2 -0
  44. package/dist/types/utils/isInvalidPropertyOverride.d.ts.map +1 -0
  45. package/dist/types/utils/isPropertyReservedWord.d.ts +3 -0
  46. package/dist/types/utils/isPropertyReservedWord.d.ts.map +1 -0
  47. package/dist/types/utils/isSchemaValid.d.ts +3 -0
  48. package/dist/types/utils/isSchemaValid.d.ts.map +1 -0
  49. package/dist/types/utils/isValidPropertyDefinition.d.ts +3 -0
  50. package/dist/types/utils/isValidPropertyDefinition.d.ts.map +1 -0
  51. package/dist/types/utils/isValidValue.d.ts +2 -0
  52. package/dist/types/utils/isValidValue.d.ts.map +1 -0
  53. package/dist/types/utils/objectHasInvalidDefaults.d.ts +3 -0
  54. package/dist/types/utils/objectHasInvalidDefaults.d.ts.map +1 -0
  55. package/dist/types/utils/recordHasInvalidDefaults.d.ts +3 -0
  56. package/dist/types/utils/recordHasInvalidDefaults.d.ts.map +1 -0
  57. package/dist/types/utils/transformConfig.d.ts +4 -0
  58. package/dist/types/utils/transformConfig.d.ts.map +1 -0
  59. package/dist/types/utils/transformWriteConfig.d.ts +3 -0
  60. package/dist/types/utils/transformWriteConfig.d.ts.map +1 -0
  61. package/package.json +2 -2
  62. package/tsconfig.build.json +2 -1
@@ -0,0 +1,182 @@
1
+ import { readFileSync, watchFile } from 'node:fs';
2
+ import { resolve, dirname } from 'node:path';
3
+ import shelljs from 'shelljs';
4
+ import yargs from 'yargs';
5
+ import 'core-js/modules/es.array.push.js';
6
+ import { outputFileSync } from 'fs-extra/esm';
7
+ import Handlebars from 'handlebars';
8
+ import { fileURLToPath } from 'node:url';
9
+ import castArray from 'lodash/castArray.js';
10
+ import isPlainObject from 'lodash/isPlainObject.js';
11
+
12
+ let NonEmumeralProperties = function (NonEmumeralProperties) {
13
+ NonEmumeralProperties["CALLBACKS"] = "__callbacks";
14
+ NonEmumeralProperties["DISABLED"] = "__disabled";
15
+ NonEmumeralProperties["EXPERIMENT"] = "__experiment";
16
+ NonEmumeralProperties["ZCB"] = "__zcb";
17
+ return NonEmumeralProperties;
18
+ }({});
19
+ let TransformConfigHandlerAction = function (TransformConfigHandlerAction) {
20
+ TransformConfigHandlerAction["DELETE_NODE"] = "deleteNode";
21
+ TransformConfigHandlerAction["SKIP_NODE"] = "skipNode";
22
+ return TransformConfigHandlerAction;
23
+ }({});
24
+
25
+ const removeDisabledSlices = (clone, config) => {
26
+ if (NonEmumeralProperties.DISABLED in config) {
27
+ return {
28
+ action: TransformConfigHandlerAction.DELETE_NODE
29
+ };
30
+ }
31
+ return {
32
+ value: clone
33
+ };
34
+ };
35
+
36
+ const setupExperiments = callback => async (clone, config) => {
37
+ if (NonEmumeralProperties.EXPERIMENT in config && typeof config.__experiment === 'string') {
38
+ const buckets = await callback(config.__experiment, clone, config);
39
+ clone.__experiment = {
40
+ buckets,
41
+ id: config.__experiment
42
+ };
43
+ return {
44
+ value: clone
45
+ };
46
+ }
47
+ return {
48
+ value: clone
49
+ };
50
+ };
51
+
52
+ const transformArray = (list, handler) => Promise.all(list.map(entry => {
53
+ if (isPlainObject(entry)) {
54
+ return transformConfig(entry, handler);
55
+ }
56
+ if (Array.isArray(entry)) {
57
+ return transformArray(entry, handler);
58
+ }
59
+ return entry;
60
+ }));
61
+ const transformConfig = async (config, handler = []) => {
62
+ let transform = {};
63
+ const handlers = castArray(handler);
64
+ for (const callback of handlers) {
65
+ const result = await Promise.resolve(callback(transform, config));
66
+ if (result.action === TransformConfigHandlerAction.DELETE_NODE) {
67
+ return {};
68
+ }
69
+ if (result.value) {
70
+ transform = result.value;
71
+ }
72
+ if (result.action === TransformConfigHandlerAction.SKIP_NODE) {
73
+ return transform;
74
+ }
75
+ }
76
+ for (const key in config) {
77
+ const value = config[key];
78
+ if (isPlainObject(value)) {
79
+ transform[key] = await transformConfig(value, handler);
80
+ } else if (Array.isArray(value)) {
81
+ transform[key] = await transformArray(value, handler);
82
+ } else {
83
+ transform[key] = value;
84
+ }
85
+ }
86
+ return transform;
87
+ };
88
+
89
+ const transformWriteConfig = async (config, {
90
+ experimentsCallback,
91
+ outputFile
92
+ }) => {
93
+ const handlers = [removeDisabledSlices];
94
+ if (experimentsCallback) {
95
+ handlers.push(setupExperiments(experimentsCallback));
96
+ }
97
+ const template = Handlebars.compile(readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), './templates/config.ts.hbs'), {
98
+ encoding: 'utf8'
99
+ }));
100
+ const output = template({
101
+ config: JSON.stringify(await transformConfig(config, handlers), undefined, 2)
102
+ }).replaceAll(/"([A-Za-z][\dA-Za-z]+)":/g, '$1:');
103
+ shelljs.echo(`zcd watch => writing to file: ${outputFile}`);
104
+ shelljs.echo(`zcd watch => content to write:\n${output}\n`);
105
+ outputFileSync(resolve(process.cwd(), outputFile), output);
106
+ };
107
+
108
+ const importValidateTransformWriteConfig = (inputFile, outputFile, command, experimentCallbackFile) => {
109
+ import(resolve(process.cwd(), inputFile)).then(({
110
+ default: configBuilder
111
+ }) => {
112
+ if (!configBuilder.validate()) {
113
+ shelljs.echo(`zcd ${command} => invalid config`);
114
+ shelljs.echo(`zcd ${command} => config values:\n${configBuilder.toJson()}\n`);
115
+ shelljs.echo(`zcd ${command} => errors:\n${JSON.stringify(configBuilder.errors(), undefined, 2)}\n`);
116
+ shelljs.exit(1);
117
+ }
118
+ shelljs.echo('zcd ${command} => valid config');
119
+ shelljs.echo(`zcd ${command} => config values:\n${configBuilder.toJson()}\n`);
120
+ if (experimentCallbackFile) {
121
+ import(resolve(process.cwd(), experimentCallbackFile)).then(({
122
+ default: experimentsCallback
123
+ }) => {
124
+ void transformWriteConfig(configBuilder.values(), {
125
+ experimentsCallback,
126
+ outputFile
127
+ });
128
+ }).catch(error => {
129
+ if (error instanceof Error) {
130
+ shelljs.echo(`zcd ${command} => error message: ${error.message}`);
131
+ if (error.stack) {
132
+ shelljs.echo(`zcd ${command} => error stack:\n${error.stack}\n`);
133
+ }
134
+ }
135
+ });
136
+ return;
137
+ }
138
+ void transformWriteConfig(configBuilder.values(), {
139
+ outputFile
140
+ });
141
+ }).catch(error => {
142
+ if (error instanceof Error) {
143
+ shelljs.echo(`zcd ${command} => error message: ${error.message}`);
144
+ if (error.stack) {
145
+ shelljs.echo(`zcd ${command} => error stack:\n${error.stack}\n`);
146
+ }
147
+ }
148
+ });
149
+ };
150
+
151
+ let Commands = function (Commands) {
152
+ Commands["BUILD"] = "build";
153
+ Commands["WATCH"] = "watch";
154
+ return Commands;
155
+ }({});
156
+ const generateArguments = cmdYargs => cmdYargs.positional('input-file', {
157
+ demandOption: true,
158
+ desc: 'The relative path to the config builder root file',
159
+ type: 'string'
160
+ }).positional('output-file', {
161
+ demandOption: true,
162
+ desc: 'The relative path to the output config file',
163
+ type: 'string'
164
+ }).option('experiments-callback-file', {
165
+ desc: 'The relative path to the experiment callback file',
166
+ type: 'string'
167
+ });
168
+ const cli = () => {
169
+ yargs.command('watch <input-file> <output-file>', 'Watch a config builder and write config', cmdYargs => generateArguments(cmdYargs), argv => {
170
+ shelljs.echo(`zcd watch => watching file: ${argv['input-file']}`);
171
+ watchFile(resolve(process.cwd(), argv['input-file']), () => {
172
+ shelljs.echo('zcd watch => file change detected');
173
+ importValidateTransformWriteConfig(argv['input-file'], argv['output-file'], Commands.WATCH, argv['experiments-callback-file']);
174
+ });
175
+ }).command('build <input-file> <output-file>', 'Write config from a config builder', cmdYargs => generateArguments(cmdYargs), argv => {
176
+ shelljs.echo(`zcd build => building file: ${argv['input-file']}`);
177
+ importValidateTransformWriteConfig(argv['input-file'], argv['output-file'], Commands.BUILD, argv['experiments-callback-file']);
178
+ }).help().argv;
179
+ };
180
+
181
+ export { Commands, cli };
182
+ //# sourceMappingURL=cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.mjs","sources":["../zod-config-builder/src//types.ts","../zod-config-builder/src//transformers/removeDisabledSlices.ts","../zod-config-builder/src//transformers/setupExperiments.ts","../zod-config-builder/src//utils/transformConfig.ts","../zod-config-builder/src//utils/transformWriteConfig.ts","../zod-config-builder/src//utils/importValidateTransformWriteConfig.ts","../zod-config-builder/src//cli.ts"],"sourcesContent":["import type { List } from 'ts-toolbelt';\nimport type { Includes, Join } from 'type-fest';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyRecord = Record<string, any>;\n\nexport type Buckets<Config extends AnyRecord> = Record<string, Experiment<Config>>;\n\nexport interface ConfigParserOptions {\n experimentsCallback?: RunExperimentsCallback;\n}\n\nexport interface Experiment<Config extends AnyRecord> {\n action?: TransformConfigHandlerAction;\n value?: Config;\n}\n\nexport enum NonEmumeralProperties {\n CALLBACKS = '__callbacks',\n DISABLED = '__disabled',\n EXPERIMENT = '__experiment',\n ZCB = '__zcb',\n}\n\nexport type Path<Config extends object> = Join<Leaves<Config>, '.'>;\n\nexport type RunExperimentsCallback = (id: string) => Promise<string>;\n\nexport type Scope<Config extends object> = Join<Paths<Config>, '.'>;\n\nexport type SetupExperimentsCallback = <Config extends AnyRecord>(\n id: string,\n clone: Config,\n config: Config\n) => Promise<Buckets<Config>>;\n\nexport type TransformConfigHandler = <Config extends AnyRecord>(\n clone: Config,\n config: Config\n) => TransformConfigHandlerReturnType<Config> | Promise<TransformConfigHandlerReturnType<Config>>;\n\nexport type TransformConfigHandlerSync = <Config extends AnyRecord>(\n clone: Config,\n config: Config\n) => TransformConfigHandlerReturnType<Config>;\n\nexport enum TransformConfigHandlerAction {\n DELETE_NODE = 'deleteNode',\n SKIP_NODE = 'skipNode',\n}\n\nexport interface TransformConfigHandlerReturnType<Config extends AnyRecord> {\n action?: TransformConfigHandlerAction;\n value?: Config;\n}\n\nexport interface WriteConfigOptions {\n experimentsCallback?: SetupExperimentsCallback;\n outputFile: string;\n}\n\nexport type Leaves<T, Path extends string[] = []> = T extends string\n ? Path\n : {\n [K in keyof T & string]: Leaves<T[K], [...Path, K]>;\n }[keyof T & string];\n\nexport type Paths<T, Path extends string[] = []> = T extends string\n ? Path\n : {\n [K in keyof T & string]: T[K] extends object ? Paths<T[K], [...Path, K]> : Path;\n }[keyof T & string];\n\nexport type LeavesScopeDiffs<T1 extends readonly string[][], T2 extends string[]> = {\n [K1 in keyof T1]: List.Length<List.Intersect<T1[K1], T2, '<-contains'>> extends 1\n ? List.Length<T1[K1]> extends 1\n ? Includes<T2, T1[K1][0]> extends false\n ? T1[K1]\n : never\n : List.Diff<T1[K1], T2>\n : never;\n}[number];\n","import {\n type AnyRecord,\n NonEmumeralProperties,\n TransformConfigHandlerAction,\n type TransformConfigHandlerSync,\n} from '../types.ts';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const removeDisabledSlices: TransformConfigHandlerSync = <Config extends AnyRecord>(\n clone: Config,\n config: Config\n) => {\n if (NonEmumeralProperties.DISABLED in config) {\n return {\n action: TransformConfigHandlerAction.DELETE_NODE,\n };\n }\n\n return {\n value: clone,\n };\n};\n","import {\n type AnyRecord,\n NonEmumeralProperties,\n type SetupExperimentsCallback,\n type TransformConfigHandler,\n} from '../types.ts';\n\nexport const setupExperiments =\n (callback: SetupExperimentsCallback): TransformConfigHandler =>\n async <Config extends AnyRecord>(clone: Config, config: Config) => {\n if (NonEmumeralProperties.EXPERIMENT in config && typeof config.__experiment === 'string') {\n const buckets = await callback(config.__experiment, clone, config);\n\n // @ts-expect-error private property\n clone.__experiment = {\n buckets,\n id: config.__experiment,\n };\n\n return {\n value: clone,\n };\n }\n\n return {\n value: clone,\n };\n };\n","import castArray from 'lodash/castArray.js';\nimport isPlainObject from 'lodash/isPlainObject.js';\nimport {\n type AnyRecord,\n type TransformConfigHandler,\n TransformConfigHandlerAction,\n type TransformConfigHandlerSync,\n} from '../types.ts';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst transformArray = (list: any[], handler: TransformConfigHandler | TransformConfigHandler[]): Promise<any[]> =>\n Promise.all(\n list.map(entry => {\n if (isPlainObject(entry)) {\n return transformConfig(entry, handler);\n }\n\n if (Array.isArray(entry)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return transformArray(entry, handler);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return entry;\n })\n );\n\nexport const transformConfig = async <Config extends AnyRecord>(\n config: Config,\n handler: TransformConfigHandler | TransformConfigHandler[] = []\n): Promise<Config> => {\n let transform = {} as Config;\n const handlers = castArray(handler);\n\n for (const callback of handlers) {\n const result = await Promise.resolve(callback(transform, config));\n\n if (result.action === TransformConfigHandlerAction.DELETE_NODE) {\n return {} as Config;\n }\n\n if (result.value) {\n transform = result.value;\n }\n\n if (result.action === TransformConfigHandlerAction.SKIP_NODE) {\n return transform;\n }\n }\n\n for (const key in config) {\n const value = config[key];\n\n if (isPlainObject(value)) {\n transform[key] = await transformConfig(value, handler);\n } else if (Array.isArray(value)) {\n transform[key] = (await transformArray(value, handler)) as Config[Extract<keyof Config, string>];\n } else {\n transform[key] = value;\n }\n }\n\n return transform;\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst transformArraySync = (list: any[], handler: TransformConfigHandlerSync | TransformConfigHandlerSync[]): any[] =>\n list.map(entry => {\n if (isPlainObject(entry)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return transformConfigSync(entry, handler);\n }\n\n if (Array.isArray(entry)) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return transformArraySync(entry, handler);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return entry;\n });\n\nexport const transformConfigSync = <Config extends AnyRecord>(\n config: Config,\n handler: TransformConfigHandlerSync | TransformConfigHandlerSync[] = []\n): Config => {\n let transform = {} as Config;\n const handlers = castArray(handler);\n\n for (const callback of handlers) {\n const result = callback(transform, config);\n\n if (result.action === TransformConfigHandlerAction.DELETE_NODE) {\n return {} as Config;\n }\n\n if (result.value) {\n transform = result.value;\n }\n\n if (result.action === TransformConfigHandlerAction.SKIP_NODE) {\n return transform;\n }\n }\n\n for (const key in config) {\n const value = config[key];\n\n if (isPlainObject(value)) {\n transform[key] = transformConfigSync(value, handler);\n } else if (Array.isArray(value)) {\n transform[key] = transformArraySync(value, handler) as Config[Extract<keyof Config, string>];\n } else {\n transform[key] = value;\n }\n }\n\n return transform;\n};\n","import { outputFileSync } from 'fs-extra/esm';\nimport Handlebars from 'handlebars';\nimport { readFileSync } from 'node:fs';\nimport { dirname, resolve } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport shelljs from 'shelljs';\nimport { removeDisabledSlices } from '../transformers/removeDisabledSlices.ts';\nimport { setupExperiments } from '../transformers/setupExperiments.ts';\nimport type { TransformConfigHandler, WriteConfigOptions } from '../types.ts';\nimport { transformConfig } from './transformConfig.ts';\n\nexport const transformWriteConfig = async <Config extends object>(\n config: Config,\n { experimentsCallback, outputFile }: WriteConfigOptions\n) => {\n const handlers: TransformConfigHandler[] = [removeDisabledSlices];\n\n if (experimentsCallback) {\n handlers.push(setupExperiments(experimentsCallback));\n }\n\n const template = Handlebars.compile(\n readFileSync(resolve(dirname(fileURLToPath(import.meta.url)), './templates/config.ts.hbs'), { encoding: 'utf8' })\n );\n\n const output = template({ config: JSON.stringify(await transformConfig(config, handlers), undefined, 2) }).replaceAll(\n /\"([A-Za-z][\\dA-Za-z]+)\":/g,\n '$1:'\n );\n\n shelljs.echo(`zcd watch => writing to file: ${outputFile}`);\n shelljs.echo(`zcd watch => content to write:\\n${output}\\n`);\n outputFileSync(resolve(process.cwd(), outputFile), output);\n};\n","import { resolve } from 'node:path';\nimport shelljs from 'shelljs';\nimport type { Commands } from '../cli.ts';\nimport type { SetupExperimentsCallback } from '../types.ts';\nimport { transformWriteConfig } from './transformWriteConfig.ts';\n\nexport const importValidateTransformWriteConfig = (\n inputFile: string,\n outputFile: string,\n command: Commands,\n experimentCallbackFile?: string\n) => {\n import(resolve(process.cwd(), inputFile))\n .then(\n ({\n default: configBuilder,\n }: {\n default: ReturnType<typeof import('../createConfigBuilder.ts')['createConfigBuilder']>;\n }) => {\n if (!configBuilder.validate()) {\n shelljs.echo(`zcd ${command} => invalid config`);\n shelljs.echo(`zcd ${command} => config values:\\n${configBuilder.toJson()}\\n`);\n shelljs.echo(`zcd ${command} => errors:\\n${JSON.stringify(configBuilder.errors(), undefined, 2)}\\n`);\n shelljs.exit(1);\n }\n\n shelljs.echo('zcd ${command} => valid config');\n shelljs.echo(`zcd ${command} => config values:\\n${configBuilder.toJson()}\\n`);\n\n if (experimentCallbackFile) {\n import(resolve(process.cwd(), experimentCallbackFile))\n .then(({ default: experimentsCallback }: { default: SetupExperimentsCallback }) => {\n void transformWriteConfig(configBuilder.values(), { experimentsCallback, outputFile });\n })\n .catch((error: unknown) => {\n if (error instanceof Error) {\n shelljs.echo(`zcd ${command} => error message: ${error.message}`);\n\n if (error.stack) {\n shelljs.echo(`zcd ${command} => error stack:\\n${error.stack}\\n`);\n }\n }\n });\n\n return;\n }\n\n void transformWriteConfig(configBuilder.values(), { outputFile });\n }\n )\n .catch((error: unknown) => {\n if (error instanceof Error) {\n shelljs.echo(`zcd ${command} => error message: ${error.message}`);\n\n if (error.stack) {\n shelljs.echo(`zcd ${command} => error stack:\\n${error.stack}\\n`);\n }\n }\n });\n};\n","import { watchFile } from 'node:fs';\nimport { resolve } from 'node:path';\nimport shelljs from 'shelljs';\nimport yargs from 'yargs';\nimport { importValidateTransformWriteConfig } from './utils/importValidateTransformWriteConfig.ts';\n\nexport enum Commands {\n BUILD = 'build',\n WATCH = 'watch',\n}\n\nconst generateArguments = (cmdYargs: yargs.Argv) =>\n cmdYargs\n .positional('input-file', {\n demandOption: true,\n desc: 'The relative path to the config builder root file',\n type: 'string',\n })\n .positional('output-file', {\n demandOption: true,\n desc: 'The relative path to the output config file',\n type: 'string',\n })\n .option('experiments-callback-file', {\n desc: 'The relative path to the experiment callback file',\n type: 'string',\n });\n\nexport const cli = () => {\n yargs\n .command(\n 'watch <input-file> <output-file>',\n 'Watch a config builder and write config',\n cmdYargs => generateArguments(cmdYargs),\n argv => {\n shelljs.echo(`zcd watch => watching file: ${argv['input-file']}`);\n\n watchFile(resolve(process.cwd(), argv['input-file']), () => {\n shelljs.echo('zcd watch => file change detected');\n\n importValidateTransformWriteConfig(\n argv['input-file'],\n argv['output-file'],\n Commands.WATCH,\n argv['experiments-callback-file']\n );\n });\n }\n )\n .command(\n 'build <input-file> <output-file>',\n 'Write config from a config builder',\n cmdYargs => generateArguments(cmdYargs),\n argv => {\n shelljs.echo(`zcd build => building file: ${argv['input-file']}`);\n\n importValidateTransformWriteConfig(\n argv['input-file'],\n argv['output-file'],\n Commands.BUILD,\n argv['experiments-callback-file']\n );\n }\n )\n .help().argv;\n};\n"],"names":["NonEmumeralProperties","TransformConfigHandlerAction","removeDisabledSlices","clone","config","DISABLED","action","DELETE_NODE","value","setupExperiments","callback","EXPERIMENT","__experiment","buckets","id","transformArray","list","handler","Promise","all","map","entry","isPlainObject","transformConfig","Array","isArray","transform","handlers","castArray","result","resolve","SKIP_NODE","key","transformWriteConfig","experimentsCallback","outputFile","push","template","Handlebars","compile","readFileSync","dirname","fileURLToPath","import","meta","url","encoding","output","JSON","stringify","undefined","replaceAll","shelljs","echo","outputFileSync","process","cwd","importValidateTransformWriteConfig","inputFile","command","experimentCallbackFile","then","default","configBuilder","validate","toJson","errors","exit","values","catch","error","Error","message","stack","Commands","generateArguments","cmdYargs","positional","demandOption","desc","type","option","cli","yargs","argv","watchFile","WATCH","BUILD","help"],"mappings":";;;;;;;;;;;AAiBYA,IAA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AE,EAAE4B,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM;AAC1DhC,MAAAA,OAAO,CAACC,IAAI,CAAC,mCAAmC,CAAC,CAAA;AAEjDI,MAAAA,kCAAkC,CAChC2B,IAAI,CAAC,YAAY,CAAC,EAClBA,IAAI,CAAC,aAAa,CAAC,EACnBV,QAAQ,CAACY,KAAK,EACdF,IAAI,CAAC,2BAA2B,CAClC,CAAC,CAAA;AACH,KAAC,CAAC,CAAA;AACJ,GACF,CAAC,CACAzB,OAAO,CACN,kCAAkC,EAClC,oCAAoC,EACpCiB,QAAQ,IAAID,iBAAiB,CAACC,QAAQ,CAAC,EACvCQ,IAAI,IAAI;IACNhC,OAAO,CAACC,IAAI,CAAE,CAAA,4BAAA,EAA8B+B,IAAI,CAAC,YAAY,CAAE,CAAA,CAAC,CAAC,CAAA;AAEjE3B,IAAAA,kCAAkC,CAChC2B,IAAI,CAAC,YAAY,CAAC,EAClBA,IAAI,CAAC,aAAa,CAAC,EACnBV,QAAQ,CAACa,KAAK,EACdH,IAAI,CAAC,2BAA2B,CAClC,CAAC,CAAA;AACH,GACF,CAAC,CACAI,IAAI,EAAE,CAACJ,IAAI,CAAA;AAChB;;;;"}
@@ -0,0 +1,321 @@
1
+ import 'json-schema';
2
+ import 'zod';
3
+ import { zodToJsonSchema } from 'zod-to-json-schema';
4
+ import isPlainObject from 'lodash/isPlainObject.js';
5
+ import castArray from 'lodash/castArray.js';
6
+ import 'core-js/modules/es.array.push.js';
7
+ import get from 'lodash/get.js';
8
+
9
+ let NonEmumeralProperties = function (NonEmumeralProperties) {
10
+ NonEmumeralProperties["CALLBACKS"] = "__callbacks";
11
+ NonEmumeralProperties["DISABLED"] = "__disabled";
12
+ NonEmumeralProperties["EXPERIMENT"] = "__experiment";
13
+ NonEmumeralProperties["ZCB"] = "__zcb";
14
+ return NonEmumeralProperties;
15
+ }({});
16
+ let TransformConfigHandlerAction = function (TransformConfigHandlerAction) {
17
+ TransformConfigHandlerAction["DELETE_NODE"] = "deleteNode";
18
+ TransformConfigHandlerAction["SKIP_NODE"] = "skipNode";
19
+ return TransformConfigHandlerAction;
20
+ }({});
21
+
22
+ const NON_ENUMERABLE_KEYS = new Set(Object.values(NonEmumeralProperties));
23
+ const cloneNonEnumerableValues = (clone, config) => {
24
+ for (const nonEnumerableKey of NON_ENUMERABLE_KEYS) {
25
+ if (nonEnumerableKey in config) {
26
+ Object.defineProperty(clone, nonEnumerableKey, {
27
+ configurable: false,
28
+ enumerable: false,
29
+ value: config[nonEnumerableKey]
30
+ });
31
+ }
32
+ }
33
+ return {
34
+ value: clone
35
+ };
36
+ };
37
+
38
+ const arrayHasInvalidDefaults = propertyDefinition => {
39
+ const {
40
+ items
41
+ } = propertyDefinition;
42
+ return items && typeof items === 'object' && 'default' in items;
43
+ };
44
+
45
+ const isDerivedValueCallback = value => typeof value === 'function';
46
+
47
+ const isInvalidPropertyOverride = (propertyValue, override = false) => !override && propertyValue !== undefined;
48
+
49
+ const RESERVED_KEYWORDS = new Set(['disable', 'errors', 'experiment', 'extend', 'flush', 'fork', 'toJson', 'validate', 'values']);
50
+ const isPropertyReservedWord = propertyName => RESERVED_KEYWORDS.has(propertyName);
51
+
52
+ const isSchemaValid = schema => schema.type !== 'object';
53
+
54
+ const isValidPropertyDefinition = propertyDefinition => typeof propertyDefinition === 'object';
55
+
56
+ const isValidValue = (value, depth = 0) => {
57
+ if (isPlainObject(value)) {
58
+ const object = value;
59
+ if (object.__zcb === true) {
60
+ return true;
61
+ }
62
+ if (depth < 1 && Object.values(object).every(v => isValidValue(v, depth + 1))) {
63
+ return true;
64
+ }
65
+ return false;
66
+ }
67
+ if (Array.isArray(value)) {
68
+ if (value.every(v => isValidValue(v, depth + 1))) {
69
+ return true;
70
+ }
71
+ return false;
72
+ }
73
+ return true;
74
+ };
75
+
76
+ const objectHasInvalidDefaults = propertyDefinition => propertyDefinition.properties && Object.values(propertyDefinition.properties).some(value => typeof value === 'object' && 'default' in value);
77
+
78
+ const recordHasInvalidDefaults = propertyDefinition => propertyDefinition.additionalProperties && typeof propertyDefinition.additionalProperties === 'object' && 'default' in propertyDefinition.additionalProperties;
79
+
80
+ const transformArray = (list, handler) => Promise.all(list.map(entry => {
81
+ if (isPlainObject(entry)) {
82
+ return transformConfig(entry, handler);
83
+ }
84
+ if (Array.isArray(entry)) {
85
+ return transformArray(entry, handler);
86
+ }
87
+ return entry;
88
+ }));
89
+ const transformConfig = async (config, handler = []) => {
90
+ let transform = {};
91
+ const handlers = castArray(handler);
92
+ for (const callback of handlers) {
93
+ const result = await Promise.resolve(callback(transform, config));
94
+ if (result.action === TransformConfigHandlerAction.DELETE_NODE) {
95
+ return {};
96
+ }
97
+ if (result.value) {
98
+ transform = result.value;
99
+ }
100
+ if (result.action === TransformConfigHandlerAction.SKIP_NODE) {
101
+ return transform;
102
+ }
103
+ }
104
+ for (const key in config) {
105
+ const value = config[key];
106
+ if (isPlainObject(value)) {
107
+ transform[key] = await transformConfig(value, handler);
108
+ } else if (Array.isArray(value)) {
109
+ transform[key] = await transformArray(value, handler);
110
+ } else {
111
+ transform[key] = value;
112
+ }
113
+ }
114
+ return transform;
115
+ };
116
+ const transformArraySync = (list, handler) => list.map(entry => {
117
+ if (isPlainObject(entry)) {
118
+ return transformConfigSync(entry, handler);
119
+ }
120
+ if (Array.isArray(entry)) {
121
+ return transformArraySync(entry, handler);
122
+ }
123
+ return entry;
124
+ });
125
+ const transformConfigSync = (config, handler = []) => {
126
+ let transform = {};
127
+ const handlers = castArray(handler);
128
+ for (const callback of handlers) {
129
+ const result = callback(transform, config);
130
+ if (result.action === TransformConfigHandlerAction.DELETE_NODE) {
131
+ return {};
132
+ }
133
+ if (result.value) {
134
+ transform = result.value;
135
+ }
136
+ if (result.action === TransformConfigHandlerAction.SKIP_NODE) {
137
+ return transform;
138
+ }
139
+ }
140
+ for (const key in config) {
141
+ const value = config[key];
142
+ if (isPlainObject(value)) {
143
+ transform[key] = transformConfigSync(value, handler);
144
+ } else if (Array.isArray(value)) {
145
+ transform[key] = transformArraySync(value, handler);
146
+ } else {
147
+ transform[key] = value;
148
+ }
149
+ }
150
+ return transform;
151
+ };
152
+
153
+ const createConfigBuilder = (zodSchema, derivedValueCallbacks = {}, initialValues = {}) => {
154
+ let config = initialValues;
155
+ Object.defineProperty(config, NonEmumeralProperties.ZCB, {
156
+ configurable: false,
157
+ enumerable: false,
158
+ value: true
159
+ });
160
+ let callbacks = {
161
+ ...derivedValueCallbacks
162
+ };
163
+ const configBuilder = {
164
+ disable: () => {
165
+ Object.defineProperty(config, NonEmumeralProperties.DISABLED, {
166
+ configurable: false,
167
+ enumerable: false,
168
+ value: true
169
+ });
170
+ return configBuilder;
171
+ },
172
+ errors: () => {
173
+ try {
174
+ zodSchema.parse(configBuilder.values());
175
+ return [];
176
+ } catch (error) {
177
+ return error.errors;
178
+ }
179
+ },
180
+ experiment: key => {
181
+ Object.defineProperty(config, NonEmumeralProperties.EXPERIMENT, {
182
+ configurable: false,
183
+ enumerable: false,
184
+ value: key
185
+ });
186
+ return configBuilder;
187
+ },
188
+ extend: configBuilder => {
189
+ config = transformConfigSync(configBuilder.values(), [cloneNonEnumerableValues]);
190
+ callbacks = {
191
+ ...configBuilder.__callbacks
192
+ };
193
+ },
194
+ flush: () => {
195
+ const values = configBuilder.values();
196
+ config = {};
197
+ Object.defineProperty(config, NonEmumeralProperties.ZCB, {
198
+ configurable: false,
199
+ enumerable: false,
200
+ value: true
201
+ });
202
+ return values;
203
+ },
204
+ fork: () => createConfigBuilder(zodSchema, derivedValueCallbacks),
205
+ toJson: () => JSON.stringify(configBuilder.values(), undefined, 2),
206
+ validate: () => {
207
+ try {
208
+ zodSchema.parse(configBuilder.values());
209
+ return true;
210
+ } catch (error) {
211
+ console.error(error);
212
+ return false;
213
+ }
214
+ },
215
+ values: () => {
216
+ for (const property in callbacks) {
217
+ const callback = callbacks[property];
218
+ if (callback) {
219
+ config[property] = callback(config);
220
+ }
221
+ }
222
+ return config;
223
+ }
224
+ };
225
+ Object.defineProperty(configBuilder, NonEmumeralProperties.CALLBACKS, {
226
+ configurable: false,
227
+ enumerable: false,
228
+ value: callbacks
229
+ });
230
+ const jsonSchema = zodToJsonSchema(zodSchema);
231
+ if (isSchemaValid(jsonSchema)) {
232
+ throw new Error(`The root type of a config schema must be "object", but received "${String(jsonSchema.type)}"`);
233
+ }
234
+ for (const propertyName in jsonSchema.properties) {
235
+ if (isPropertyReservedWord(propertyName)) {
236
+ throw new Error(`"${propertyName}" is a reserved keyword within the config builder. Please use a different property name. The full list of reserved keywords is: ${[...RESERVED_KEYWORDS].join(', ')}`);
237
+ }
238
+ const castProperty = propertyName;
239
+ const propertyDefinition = jsonSchema.properties[propertyName];
240
+ if (isValidPropertyDefinition(propertyDefinition)) {
241
+ if (propertyDefinition.default) {
242
+ config[castProperty] = propertyDefinition.default;
243
+ }
244
+ if (propertyDefinition.type === 'array' && arrayHasInvalidDefaults(propertyDefinition)) {
245
+ throw new Error(`When setting schema array defaults for the array assigned to "${String(castProperty)}", set them on the array and not the item.`);
246
+ }
247
+ if (propertyDefinition.type === 'object') {
248
+ if (objectHasInvalidDefaults(propertyDefinition)) {
249
+ throw new Error(`When setting schema property defaults for the object assigned to "${String(castProperty)}", set them on the object and not the property.`);
250
+ }
251
+ if (recordHasInvalidDefaults(propertyDefinition)) {
252
+ throw new Error(`When setting schema property defaults for the object assigned to "${String(castProperty)}", set them on the object and not the property.`);
253
+ }
254
+ }
255
+ }
256
+ configBuilder[castProperty] = (value, override) => {
257
+ if (isInvalidPropertyOverride(config[castProperty], override)) {
258
+ throw new Error(`A value already exists for "${String(castProperty)}". You may be trying to add a new values before flushing the old one. If you intended to override the existing value, pass in true as the second argument.`);
259
+ }
260
+ let propertyValue;
261
+ const MAX_DEPTH = 1;
262
+ if (!isValidValue(value)) {
263
+ throw new Error(`"${String(castProperty)}" value has a depth greater than ${MAX_DEPTH}. To pass in objects with a depth greater than ${MAX_DEPTH}, create a builder for that config slice.`);
264
+ }
265
+ if (isDerivedValueCallback(value)) {
266
+ callbacks[castProperty] = value;
267
+ propertyValue = value(config);
268
+ } else {
269
+ propertyValue = value;
270
+ }
271
+ config[castProperty] = propertyValue;
272
+ return configBuilder;
273
+ };
274
+ }
275
+ return configBuilder;
276
+ };
277
+
278
+ const runExperiments = callback => async (clone, config) => {
279
+ if (NonEmumeralProperties.EXPERIMENT in config && typeof config.__experiment === 'object') {
280
+ const {
281
+ buckets,
282
+ id
283
+ } = config.__experiment;
284
+ const bucket = await callback(id);
285
+ if (bucket && bucket in buckets && buckets[bucket]) {
286
+ return buckets[bucket];
287
+ }
288
+ }
289
+ return {
290
+ value: clone
291
+ };
292
+ };
293
+
294
+ const createConfigParser = async (config, {
295
+ experimentsCallback
296
+ } = {}) => {
297
+ const handlers = [];
298
+ if (experimentsCallback) {
299
+ handlers.push(runExperiments(experimentsCallback));
300
+ }
301
+ return handlers.length > 0 ? await transformConfig(config, handlers) : config;
302
+ };
303
+
304
+ const createConfigReader = config => {
305
+ const configReader = path => get(config, path);
306
+ configReader.scope = scope => createConfigReader(get(config, scope));
307
+ return configReader;
308
+ };
309
+
310
+ const countryCodes = ['AF', 'AX', 'AL', 'DZ', 'AS', 'AD', 'AO', 'AI', 'AQ', 'AG', 'AR', 'AM', 'AW', 'AU', 'AT', 'AZ', 'BS', 'BH', 'BD', 'BB', 'BY', 'BE', 'BZ', 'BJ', 'BM', 'BT', 'BO', 'BA', 'BW', 'BV', 'BR', 'IO', 'BN', 'BG', 'BF', 'BI', 'KH', 'CM', 'CA', 'CV', 'KY', 'CF', 'TD', 'CL', 'CN', 'CX', 'CC', 'CO', 'KM', 'CG', 'CD', 'CK', 'CR', 'CI', 'HR', 'CU', 'CY', 'CZ', 'DK', 'DJ', 'DM', 'DO', 'EC', 'EG', 'SV', 'GQ', 'ER', 'EE', 'ET', 'FK', 'FO', 'FJ', 'FI', 'FR', 'GF', 'PF', 'TF', 'GA', 'GM', 'GE', 'DE', 'GH', 'GI', 'GR', 'GL', 'GD', 'GP', 'GU', 'GT', 'GG', 'GN', 'GW', 'GY', 'HT', 'HM', 'VA', 'HN', 'HK', 'HU', 'IS', 'IN', 'ID', 'IR', 'IQ', 'IE', 'IM', 'IL', 'IT', 'JM', 'JP', 'JE', 'JO', 'KZ', 'KE', 'KI', 'KR', 'KW', 'KG', 'LA', 'LV', 'LB', 'LS', 'LR', 'LY', 'LI', 'LT', 'LU', 'MO', 'MK', 'MG', 'MW', 'MY', 'MV', 'ML', 'MT', 'MH', 'MQ', 'MR', 'MU', 'YT', 'MX', 'FM', 'MD', 'MC', 'MN', 'ME', 'MS', 'MA', 'MZ', 'MM', 'NA', 'NR', 'NP', 'NL', 'AN', 'NC', 'NZ', 'NI', 'NE', 'NG', 'NU', 'NF', 'MP', 'NO', 'OM', 'PK', 'PW', 'PS', 'PA', 'PG', 'PY', 'PE', 'PH', 'PN', 'PL', 'PT', 'PR', 'QA', 'RE', 'RO', 'RU', 'RW', 'BL', 'SH', 'KN', 'LC', 'MF', 'PM', 'VC', 'WS', 'SM', 'ST', 'SA', 'SN', 'RS', 'SC', 'SL', 'SG', 'SK', 'SI', 'SB', 'SO', 'ZA', 'GS', 'ES', 'LK', 'SD', 'SR', 'SJ', 'SZ', 'SE', 'CH', 'SY', 'TW', 'TJ', 'TZ', 'TH', 'TL', 'TG', 'TK', 'TO', 'TT', 'TN', 'TR', 'TM', 'TC', 'TV', 'UG', 'UA', 'AE', 'GB', 'US', 'UM', 'UY', 'UZ', 'VU', 'VE', 'VN', 'VG', 'VI', 'WF', 'EH', 'YE', 'ZM', 'ZW'];
311
+
312
+ const countryNames = ['Afghanistan', 'Albania', 'Algeria', 'Andorra', 'Angola', 'Anguilla', 'Antigua and Barbuda', 'Argentina', 'Armenia', 'Aruba', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bermuda', 'Bhutan', 'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Brazil', 'British Virgin Islands', 'Brunei', 'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon', 'Cape Verde', 'Cayman Islands', 'Chad', 'Chile', 'China', 'Colombia', 'Congo', 'Cook Islands', 'Costa Rica', 'Cote D Ivoire', 'Croatia', 'Cruise Ship', 'Cuba', 'Cyprus', 'Czech Republic', 'Denmark', 'Djibouti', 'Dominica', 'Dominican Republic', 'Ecuador', 'Egypt', 'El Salvador', 'Equatorial Guinea', 'Estonia', 'Ethiopia', 'Falkland Islands', 'Faroe Islands', 'Fiji', 'Finland', 'France', 'French Polynesia', 'French West Indies', 'Gabon', 'Gambia', 'Georgia', 'Germany', 'Ghana', 'Gibraltar', 'Greece', 'Greenland', 'Grenada', 'Guam', 'Guatemala', 'Guernsey', 'Guinea', 'Guinea Bissau', 'Guyana', 'Haiti', 'Honduras', 'Hong Kong', 'Hungary', 'Iceland', 'India', 'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Isle of Man', 'Israel', 'Italy', 'Jamaica', 'Japan', 'Jersey', 'Jordan', 'Kazakhstan', 'Kenya', 'Kuwait', 'Kyrgyz Republic', 'Laos', 'Latvia', 'Lebanon', 'Lesotho', 'Liberia', 'Libya', 'Liechtenstein', 'Lithuania', 'Luxembourg', 'Macau', 'Macedonia', 'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta', 'Mauritania', 'Mauritius', 'Mexico', 'Moldova', 'Monaco', 'Mongolia', 'Montenegro', 'Montserrat', 'Morocco', 'Mozambique', 'Namibia', 'Nepal', 'Netherlands', 'Netherlands Antilles', 'New Caledonia', 'New Zealand', 'Nicaragua', 'Niger', 'Nigeria', 'Norway', 'Oman', 'Pakistan', 'Palestine', 'Panama', 'Papua New Guinea', 'Paraguay', 'Peru', 'Philippines', 'Poland', 'Portugal', 'Puerto Rico', 'Qatar', 'Reunion', 'Romania', 'Russia', 'Rwanda', 'Saint Pierre and Miquelon', 'Samoa', 'San Marino', 'Satellite', 'Saudi Arabia', 'Senegal', 'Serbia', 'Seychelles', 'Sierra Leone', 'Singapore', 'Slovakia', 'Slovenia', 'South Africa', 'South Korea', 'Spain', 'Sri Lanka', 'St Kitts and Nevis', 'St Lucia', 'St Vincent', 'St. Lucia', 'Sudan', 'Suriname', 'Swaziland', 'Sweden', 'Switzerland', 'Syria', 'Taiwan', 'Tajikistan', 'Tanzania', 'Thailand', "Timor L'Este", 'Togo', 'Tonga', 'Trinidad and Tobago', 'Tunisia', 'Turkey', 'Turkmenistan', 'Turks and Caicos', 'Uganda', 'Ukraine', 'United Arab Emirates', 'United Kingdom', 'Uruguay', 'Uzbekistan', 'Venezuela', 'Vietnam', 'Virgin Islands (US)', 'Yemen', 'Zambia', 'Zimbabwe'];
313
+
314
+ const distanceUnits = ['km', 'mi'];
315
+
316
+ const languageCodes = ['aa', 'ab', 'ae', 'af', 'ak', 'am', 'an', 'ar', 'as', 'av', 'ay', 'az', 'ba', 'be', 'bg', 'bi', 'bm', 'bn', 'bo', 'br', 'bs', 'ca', 'ce', 'ch', 'co', 'cr', 'cs', 'cu', 'cv', 'cy', 'da', 'de', 'dv', 'dz', 'ee', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'ff', 'fi', 'fj', 'fo', 'fr', 'fy', 'ga', 'gd', 'gl', 'gn', 'gu', 'gv', 'ha', 'he', 'hi', 'ho', 'hr', 'ht', 'hu', 'hy', 'hz', 'ia', 'id', 'ie', 'ig', 'ii', 'ik', 'io', 'is', 'it', 'iu', 'ja', 'jv', 'ka', 'kg', 'ki', 'kj', 'kk', 'kl', 'km', 'kn', 'ko', 'kr', 'ks', 'ku', 'kv', 'kw', 'ky', 'la', 'lb', 'lg', 'li', 'ln', 'lo', 'lt', 'lu', 'lv', 'mg', 'mh', 'mi', 'mk', 'ml', 'mn', 'mr', 'ms', 'mt', 'my', 'na', 'nb', 'nd', 'ne', 'ng', 'nl', 'nn', 'no', 'nr', 'nv', 'ny', 'oc', 'oj', 'om', 'or', 'os', 'pa', 'pi', 'pl', 'ps', 'pt', 'qu', 'rm', 'rn', 'ro', 'ru', 'rw', 'sa', 'sc', 'sd', 'se', 'sg', 'si', 'sk', 'sl', 'sm', 'sn', 'so', 'sq', 'sr', 'ss', 'st', 'su', 'sv', 'sw', 'ta', 'te', 'tg', 'th', 'ti', 'tk', 'tl', 'tn', 'to', 'tr', 'ts', 'tt', 'tw', 'ty', 'ug', 'uk', 'ur', 'uz', 've', 'vi', 'vo', 'wa', 'wo', 'xh', 'yi', 'yo', 'za', 'zh', 'zu'];
317
+
318
+ const timezones = ['Africa/Abidjan', 'Africa/Accra', 'Africa/Addis_Ababa', 'Africa/Algiers', 'Africa/Asmara', 'Africa/Bamako', 'Africa/Bangui', 'Africa/Banjul', 'Africa/Bissau', 'Africa/Blantyre', 'Africa/Brazzaville', 'Africa/Bujumbura', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Ceuta', 'Africa/Conakry', 'Africa/Dakar', 'Africa/Dar_es_Salaam', 'Africa/Djibouti', 'Africa/Douala', 'Africa/El_Aaiun', 'Africa/Freetown', 'Africa/Gaborone', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Juba', 'Africa/Kampala', 'Africa/Khartoum', 'Africa/Kigali', 'Africa/Kinshasa', 'Africa/Lagos', 'Africa/Libreville', 'Africa/Lome', 'Africa/Luanda', 'Africa/Lubumbashi', 'Africa/Lusaka', 'Africa/Malabo', 'Africa/Maputo', 'Africa/Maseru', 'Africa/Mbabane', 'Africa/Mogadishu', 'Africa/Monrovia', 'Africa/Nairobi', 'Africa/Ndjamena', 'Africa/Niamey', 'Africa/Nouakchott', 'Africa/Ouagadougou', 'Africa/Porto-Novo', 'Africa/Sao_Tome', 'Africa/Tripoli', 'Africa/Tunis', 'Africa/Windhoek', 'America/Adak', 'America/Anchorage', 'America/Anguilla', 'America/Antigua', 'America/Araguaina', 'America/Argentina/Buenos_Aires', 'America/Argentina/Catamarca', 'America/Argentina/Cordoba', 'America/Argentina/Jujuy', 'America/Argentina/La_Rioja', 'America/Argentina/Mendoza', 'America/Argentina/Rio_Gallegos', 'America/Argentina/Salta', 'America/Argentina/San_Juan', 'America/Argentina/San_Luis', 'America/Argentina/Tucuman', 'America/Argentina/Ushuaia', 'America/Aruba', 'America/Asuncion', 'America/Atikokan', 'America/Bahia', 'America/Bahia_Banderas', 'America/Barbados', 'America/Belem', 'America/Belize', 'America/Blanc-Sablon', 'America/Boa_Vista', 'America/Bogota', 'America/Boise', 'America/Cambridge_Bay', 'America/Campo_Grande', 'America/Cancun', 'America/Caracas', 'America/Cayenne', 'America/Cayman', 'America/Chicago', 'America/Chihuahua', 'America/Costa_Rica', 'America/Creston', 'America/Cuiaba', 'America/Curacao', 'America/Danmarkshavn', 'America/Dawson', 'America/Dawson_Creek', 'America/Denver', 'America/Detroit', 'America/Dominica', 'America/Edmonton', 'America/Eirunepe', 'America/El_Salvador', 'America/Fort_Nelson', 'America/Fortaleza', 'America/Glace_Bay', 'America/Godthab', 'America/Goose_Bay', 'America/Grand_Turk', 'America/Grenada', 'America/Guadeloupe', 'America/Guatemala', 'America/Guayaquil', 'America/Guyana', 'America/Halifax', 'America/Havana', 'America/Hermosillo', 'America/Indiana/Indianapolis', 'America/Indiana/Knox', 'America/Indiana/Marengo', 'America/Indiana/Petersburg', 'America/Indiana/Tell_City', 'America/Indiana/Vevay', 'America/Indiana/Vincennes', 'America/Indiana/Winamac', 'America/Inuvik', 'America/Iqaluit', 'America/Jamaica', 'America/Juneau', 'America/Kentucky/Louisville', 'America/Kentucky/Monticello', 'America/Kralendijk', 'America/La_Paz', 'America/Lima', 'America/Los_Angeles', 'America/Lower_Princes', 'America/Maceio', 'America/Managua', 'America/Manaus', 'America/Marigot', 'America/Martinique', 'America/Matamoros', 'America/Mazatlan', 'America/Menominee', 'America/Merida', 'America/Metlakatla', 'America/Mexico_City', 'America/Miquelon', 'America/Moncton', 'America/Monterrey', 'America/Montevideo', 'America/Montserrat', 'America/Nassau', 'America/New_York', 'America/Nipigon', 'America/Nome', 'America/Noronha', 'America/North_Dakota/Beulah', 'America/North_Dakota/Center', 'America/North_Dakota/New_Salem', 'America/Ojinaga', 'America/Panama', 'America/Pangnirtung', 'America/Paramaribo', 'America/Phoenix', 'America/Port-au-Prince', 'America/Port_of_Spain', 'America/Porto_Velho', 'America/Puerto_Rico', 'America/Rainy_River', 'America/Rankin_Inlet', 'America/Recife', 'America/Regina', 'America/Resolute', 'America/Rio_Branco', 'America/Santa_Isabel', 'America/Santarem', 'America/Santiago', 'America/Santo_Domingo', 'America/Sao_Paulo', 'America/Scoresbysund', 'America/Sitka', 'America/St_Barthelemy', 'America/St_Johns', 'America/St_Kitts', 'America/St_Lucia', 'America/St_Thomas', 'America/St_Vincent', 'America/Swift_Current', 'America/Tegucigalpa', 'America/Thule', 'America/Thunder_Bay', 'America/Tijuana', 'America/Toronto', 'America/Tortola', 'America/Vancouver', 'America/Whitehorse', 'America/Winnipeg', 'America/Yakutat', 'America/Yellowknife', 'Antarctica/Casey', 'Antarctica/Davis', 'Antarctica/DumontDUrville', 'Antarctica/Macquarie', 'Antarctica/Mawson', 'Antarctica/McMurdo', 'Antarctica/Palmer', 'Antarctica/Rothera', 'Antarctica/Syowa', 'Antarctica/Troll', 'Antarctica/Vostok', 'Arctic/Longyearbyen', 'Asia/Aden', 'Asia/Almaty', 'Asia/Amman', 'Asia/Anadyr', 'Asia/Aqtau', 'Asia/Aqtobe', 'Asia/Ashgabat', 'Asia/Baghdad', 'Asia/Bahrain', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Beirut', 'Asia/Bishkek', 'Asia/Brunei', 'Asia/Chita', 'Asia/Choibalsan', 'Asia/Colombo', 'Asia/Damascus', 'Asia/Dhaka', 'Asia/Dili', 'Asia/Dubai', 'Asia/Dushanbe', 'Asia/Gaza', 'Asia/Hebron', 'Asia/Ho_Chi_Minh', 'Asia/Hong_Kong', 'Asia/Hovd', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jayapura', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Khandyga', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuching', 'Asia/Kuwait', 'Asia/Macau', 'Asia/Magadan', 'Asia/Makassar', 'Asia/Manila', 'Asia/Muscat', 'Asia/Nicosia', 'Asia/Novokuznetsk', 'Asia/Novosibirsk', 'Asia/Omsk', 'Asia/Oral', 'Asia/Phnom_Penh', 'Asia/Pontianak', 'Asia/Pyongyang', 'Asia/Qatar', 'Asia/Qyzylorda', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Sakhalin', 'Asia/Samarkand', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Thimphu', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Ust-Nera', 'Asia/Vientiane', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Bermuda', 'Atlantic/Canary', 'Atlantic/Cape_Verde', 'Atlantic/Faroe', 'Atlantic/Madeira', 'Atlantic/Reykjavik', 'Atlantic/South_Georgia', 'Atlantic/St_Helena', 'Atlantic/Stanley', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Broken_Hill', 'Australia/Currie', 'Australia/Darwin', 'Australia/Eucla', 'Australia/Hobart', 'Australia/Lindeman', 'Australia/Lord_Howe', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Europe/Amsterdam', 'Europe/Andorra', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Busingen', 'Europe/Chisinau', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Gibraltar', 'Europe/Guernsey', 'Europe/Helsinki', 'Europe/Isle_of_Man', 'Europe/Istanbul', 'Europe/Jersey', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/Luxembourg', 'Europe/Madrid', 'Europe/Malta', 'Europe/Mariehamn', 'Europe/Minsk', 'Europe/Monaco', 'Europe/Moscow', 'Europe/Oslo', 'Europe/Paris', 'Europe/Podgorica', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/San_Marino', 'Europe/Sarajevo', 'Europe/Simferopol', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Tirane', 'Europe/Uzhgorod', 'Europe/Vaduz', 'Europe/Vatican', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Europe/Zaporozhye', 'Europe/Zurich', 'Indian/Antananarivo', 'Indian/Chagos', 'Indian/Christmas', 'Indian/Cocos', 'Indian/Comoro', 'Indian/Kerguelen', 'Indian/Mahe', 'Indian/Maldives', 'Indian/Mauritius', 'Indian/Mayotte', 'Indian/Reunion', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Bougainville', 'Pacific/Chatham', 'Pacific/Chuuk', 'Pacific/Easter', 'Pacific/Efate', 'Pacific/Enderbury', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Funafuti', 'Pacific/Galapagos', 'Pacific/Gambier', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Johnston', 'Pacific/Kiritimati', 'Pacific/Kosrae', 'Pacific/Kwajalein', 'Pacific/Majuro', 'Pacific/Marquesas', 'Pacific/Midway', 'Pacific/Nauru', 'Pacific/Niue', 'Pacific/Norfolk', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Palau', 'Pacific/Pitcairn', 'Pacific/Pohnpei', 'Pacific/Port_Moresby', 'Pacific/Rarotonga', 'Pacific/Saipan', 'Pacific/Tahiti', 'Pacific/Tarawa', 'Pacific/Tongatapu', 'Pacific/Wake', 'Pacific/Wallis'];
319
+
320
+ export { NonEmumeralProperties, TransformConfigHandlerAction, countryCodes, countryNames, createConfigBuilder, createConfigParser, createConfigReader, distanceUnits, languageCodes, timezones };
321
+ //# sourceMappingURL=index.mjs.map