docsHuman readable documentation of the SwissRETS JSON schemaexamplesSwissRETS JSON example filesschemaSwissRETS JSON schema filesscriptsSwissRETS JSON schema filesscriptsScript filessrcSource filestsTypescript source filesmodelTypescript model source files generated from the schema filetestsTypescript tests, mainly for the validator.vaiidatorTypescript schema validator.
- Go to the new issue page
- Make sure you fill only a single topic per issue
- Choose your template
- Please use english
- Submit
- Ensure all your changes follow the principles and rules of this document.
- Generate the typescript model and the html documentation from the json-schema (see above).
- Ensure eslint validation with
pnpm run lint. - Ensure all tests are green with
pnpm run test. - Push your branch and create a pull request.
- A maintainer will then take care about merging the pull request.
- Execute the 'Release' action. A Github (pre-)release and npm package will automatically be created by the process.
You're very welcome to fork the project and send pull requests.
- Use an editor that supports ESLint.
- Install Node 22.14.0
- Fork the project - hit the Fork button on qualipool/swissrets-json - top right corner
- Clone your fork locally
pnpm install- Execute
sudo chmod +x ./scripts/setup.sh. - Execute
./scripts/setup.shto install the required Python tooling and makegenerate-typescript-model.shexecutable.
The schema file is the master for the model and documentation files. Do not edit the files under src/ts/model or docs directly, but use the respective generators to generate them.
- Open a shell in the project root.
- Execute
./scripts/generate-typescript-model.shto generate the model.
- Open a shell in the project root.
- Execute
generate-schema-doc schema/swissRetsSchema.json docs/index.htmlto generate the model.
Mainly targeting the ./schema/schema.json
While we strive for all three, if we have conflicts, this list acts as priorities.
- Consistency
- Cleanness
- Ease of use
SwissRETS is predictable.
- Always solve the same things the same way
- Have clear naming rules (TODO: add link)
- Take time to refactor inconsistencies
SwissRETS is tidy and clean
- Use real english words to name things
- No abbrevations
- Proper indentation (4 spaces)
- Use syntax checks
SwissRETS is easy to use
- We try to have as little documentation as necessary
- Try to write selfspeaking code, to avoid documentation
-> schema/swissRetsSchema.json
- use real english words
- for node and attribute names use camelCase
- for attribute values use 'dash-separated-lower-case-words'
- use a top-down naming schema, start with the broadest thing first and become more specific after
- good: entryHallHeight, baths
- bad: heightOfEntryHall, numberOfBaths