Commit Graph

32 Commits

Author SHA1 Message Date
hypercross d78ef75272 fix: typing and remove singularization 2026-04-11 23:05:22 +08:00
hypercross daac7badbb feat: parse references 2026-04-11 22:56:01 +08:00
hypercross 3051df3e8b fix: skip empty lines 2026-04-07 12:11:01 +08:00
hypercross ad38976e86 refactor: reorg/remove webpack dependency 2026-04-07 11:25:02 +08:00
hypercross 77ee96d70c feat: esbuild csv-loader support 2026-04-07 11:20:12 +08:00
hypercross 4eb6a17e9f refactor: table name deduction & readonly type 2026-04-05 12:43:23 +08:00
hypercross f656a62606 fix: add int/float to type gen 2026-04-04 17:08:29 +08:00
hypercross 4146fda348 feat: add int/float to types 2026-04-04 17:05:25 +08:00
hypercross 8bf28c8aed fix: types for rollup 2026-04-04 16:55:17 +08:00
hypercross 08cac3965e feat: add inline-schema/csv-loader/rollup for tsup/vite 2026-04-04 16:44:03 +08:00
hyper d9a91ae8be Merge branch 'master' of https://gitea.ayi-games.online/hypercross/inline-schema 2026-04-02 21:04:16 +08:00
hyper da1e3b2dac refactor: remove dist/ from git 2026-04-02 21:03:57 +08:00
hypercross 16d88d6108 build: update dist files for loader export 2026-04-02 17:34:11 +08:00
hypercross b7e65ebc1d feat: export extra functions from the loader 2026-04-02 17:32:13 +08:00
hyper cf55295ce7 feat: include member names in generated tuple type definitions
- Update schemaToTypeString to include names for named tuple elements
- Generates [current: number, max: number] instead of [number, number]
- Uses TypeScript 4.0+ tuple parameter labels syntax

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 16:57:52 +08:00
hyper 4e841be4f0 fix: make named member prefix optional in tuple values
- Allow parsing tuple values with or without name prefixes
- Supports both [x: 10; y: 20] and [10; 20] formats
- Useful for CSV data where names are schema-only metadata

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 16:45:38 +08:00
hyper 9adce3d45e build: update dist files with named tuple support
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 16:37:14 +08:00
hyper 23ee60bc20 feat: support named members in tuples
- Add NamedSchema interface with optional name property
- Update TupleSchema.elements to use NamedSchema[]
- Add parseNamedSchema() to support [x: number; y: number] syntax
- Update validator to parse named members in tuple values
- Fix schemaToTypeString in csv-loader for NamedSchema
- Fix createValidator to handle NamedSchema.schema
- Ensure single named element stays as tuple (not array)

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 16:36:32 +08:00
hyper d056145462 fix: change format of output .d.ts files 2026-03-31 16:12:17 +08:00
hyper 525ae262fd feat: add writeToDisk option for dev server support
- Add writeToDisk option to write .d.ts files directly to disk
- Useful for rsbuild/rspack dev server which uses in-memory FS
- Set writeToDisk: true in dev mode to see generated types

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 15:54:38 +08:00
hyper 377a47e49f fix: improve path handling for .d.ts file emission
- Fix leading slash in relative path
- Use .d.ts extension instead of .csv.d.ts
- Support typesOutputDir option properly
- Use ./ prefix for module declaration path

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 15:49:05 +08:00
hyper 452b600487 fix: use declare module syntax for type definitions
- Change from standalone .d.ts to module augmentation style
- Now properly declares types for the CSV module path
- Fixes TypeScript module resolution

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 15:25:58 +08:00
hyper 69b419256c feat: add TypeScript type definition generation for csv-loader
- Add emitTypes option (default true) to generate .d.ts files
- Add typesOutputDir option for custom output directory
- Generate interface based on CSV schema definitions
- Export RowType for explicit type imports

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 15:19:03 +08:00
hyper bf15adb1c0 chore: move tsup/ts to dev dependencies 2026-03-31 14:57:02 +08:00
hyper 5e93bb5a1d chore: add dist files and .npmignore for npm distribution
- Include dist/ in git for npm package distribution
- Add .npmignore to exclude source files from npm package
- This ensures npm install from git works without requiring build

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
2026-03-31 14:55:46 +08:00
hyper 7243a677fe fix: downgrade to ts v5.9.3 2026-03-31 14:50:17 +08:00
hyper 9a8cdcaaea refactor: default csv-parse params 2026-03-31 14:45:02 +08:00
hyper 3a6f57ef6f fix: typing 2026-03-31 14:25:38 +08:00
hyper c41ff44708 fix: build issue 2026-03-31 13:55:11 +08:00
hyper 848d7f136f fix: dep 2026-03-31 13:50:02 +08:00
hypercross fe2e323d19 feat: csv-loader? 2026-03-31 13:02:29 +08:00
hypercross 4296c2bdcd init: inline-schema thing 2026-03-31 12:17:46 +08:00