-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preparing enum generation from schema
- Loading branch information
1 parent
0bc039d
commit 2348683
Showing
24 changed files
with
75 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"type": "object", | ||
"properties": {} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Code generation is extremely important in this project, to ensure: | ||
|
||
- Multiple targets can be automatically constructed from the same specifications | ||
- They will be aligned, simplifying versioning | ||
|
||
Code generation tasks are performed by typescript code. They are based on information defined in `/schemas` and run off scripts in `/scripts/codegen`. | ||
This choice of technologies means that installing the [bun js runtime](https://bun.sh/) is needed to build the project (and only that). | ||
|
||
## Targets for generation | ||
|
||
### Database | ||
|
||
### Widgets | ||
|
||
### Enumerations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"$schema": "../../commons/schemas/json-component.schema.json", | ||
"description": "Basic button element", | ||
"exposed": true, | ||
"type": "leaf", | ||
"headers": ["FL/Fl_Button.H"], | ||
"extends": "fl:base", | ||
"codegen": {"extends": "ui<Fl_Button>"}, | ||
"fields": {} | ||
} | ||
"$schema": "../../commons/schemas/widget.schema.json", | ||
"description": "Basic button element", | ||
"exposed": true, | ||
"type": "leaf", | ||
"headers": ["FL/Fl_Button.H"], | ||
"extends": "fl:base", | ||
"codegen": { "extends": "ui<Fl_Button>" }, | ||
"fields": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
Code generator for code and derived specs out of the json schemas representing enumerations. | ||
Use `quick` as optional arg to avoid generating the meson file again. | ||
This will speed up compilation considerably and is fine as long as you have not added or removed files in the schema folder. | ||
*/ | ||
|
||
import type { Static } from '@sinclair/typebox'; | ||
import { $ } from 'bun' | ||
import { Glob } from "bun"; | ||
import { parse } from "node:path" | ||
import { enum_schema } from './schemas/enum.schema'; | ||
import { Value } from '@sinclair/typebox/value'; | ||
|
||
import { render, JSXXML } from 'jsx-xml' | ||
|
||
await Bun.write('./commons/schemas/enum.schema.json', JSON.stringify(enum_schema, null, 4)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import { Type as t } from "@sinclair/typebox" | ||
|
||
export const enum_schema = t.Object({}) |
File renamed without changes.