{{ message }}
Tags: DaxServer/validation-schema-codegen
Tags
feat(typebox): improve handling of large union types (#24) This commit introduces a new feature to handle large union types more efficiently in the TypeBox schema codegen. The key changes are: - Introduce a `shouldChunkUnion` function to check if a union type has more than a certain number of members (20 in this case). - Implement the `createChunkNodes` function to split large union types into smaller "chunk" types, each containing a subset of the original union members. - Update the `addLocalTypes` function in `local-type-collector.ts` to detect large unions and create the corresponding chunk types. - The chunk types are added to the `NodeGraph` and `ResolverStore` to be processed by the schema codegen. This change improves the performance and memory usage of the schema codegen when dealing with large union types, which can be common in complex validation schemas.
feat(tsconfig): add tsconfig.build.json for distribution (#22) This commit adds a `tsconfig.build.json` file to the project, which is a specialized TypeScript configuration for building the distribution package. The key changes include: - Setting `noEmit` to `false` to enable compilation - Enabling `declaration` and `declarationMap` to generate type definitions - Setting `sourceMap` to `true` to generate source maps - Configuring `outDir` and `rootDir` to output the compiled files to the `dist` directory - Excluding test files, distribution, and node_modules from the build
