Tygo for go->typescript type generation
This commit is contained in:
parent
3c87fd4d8c
commit
151d6de39b
3 changed files with 14 additions and 1 deletions
|
@ -118,3 +118,7 @@ uml: plantuml.jar
|
||||||
install-just:
|
install-just:
|
||||||
@echo "Installing just"
|
@echo "Installing just"
|
||||||
@curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
|
@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
9
backend/tygo.yaml
Normal 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 */"
|
|
@ -9,7 +9,7 @@ module.exports = {
|
||||||
'plugin:react-hooks/recommended',
|
'plugin:react-hooks/recommended',
|
||||||
'plugin:prettier/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',
|
parser: '@typescript-eslint/parser',
|
||||||
plugins: ['react-refresh', 'prettier'],
|
plugins: ['react-refresh', 'prettier'],
|
||||||
rules: {
|
rules: {
|
||||||
|
|
Loading…
Reference in a new issue