Tygo for go->typescript type generation

This commit is contained in:
Imbus 2024-03-16 17:43:38 +01:00
parent 3c87fd4d8c
commit 151d6de39b
3 changed files with 14 additions and 1 deletions

View file

@ -118,3 +118,7 @@ uml: plantuml.jar
install-just:
@echo "Installing just"
@curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
.PHONY: types
types:
tygo generate

9
backend/tygo.yaml Normal file
View file

@ -0,0 +1,9 @@
packages:
- path: "ttime/internal/types"
output_path: "../frontend/src/Types/goTypes.ts"
type_mappings:
time.Time: "string /* RFC3339 */"
null.String: "null | string"
null.Bool: "null | boolean"
uuid.UUID: "string /* uuid */"
uuid.NullUUID: "null | string /* uuid */"

View file

@ -9,7 +9,7 @@ module.exports = {
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs', 'tailwind.config.js', 'postcss.config.js', 'jest.config.cjs'],
ignorePatterns: ['dist', '.eslintrc.cjs', 'tailwind.config.js', 'postcss.config.js', 'jest.config.cjs', 'goTypes.ts'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh', 'prettier'],
rules: {