Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Feature/update scripts #4148

Merged
merged 3 commits into from
Apr 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ that are referenced by the entry point.

The schemas are also used to generate Typescript interfaces from their `title`
attribute. This way the data shape is always synchronized with the frontend
implementations. To execute this functionality run the `yarn generate-typescript` command from the project root directory. The output of this
implementations. To execute this functionality run the `yarn generate-data-types` command from the project root directory. The output of this
script is saved to the **src/types/data.ts** file. The titles are
automatically PascalCased so spaces and \_ are replaced. In other to avoid
naming conflicts it is advised to prefix the titles. See [Guidelines For New
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ against their given schema.
`yarn validate-json-single <schema-name> <json-file>` This validates a single JSON
file from the `public/json` folder against the given schema.

`yarn generate-typescript` Generates the `src/types/data.ts` file based on the
`yarn generate-data-types` Generates the `src/types/data.ts` file based on the
JSON schemas.

`yarn validate-last-values` This validates all time series by matching every
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"scripts": {
"prepare-release": "ts-node src/release/prepare-release.ts",
"bootstrap": "yarn generate-typescript",
"bootstrap": "yarn generate-data-types",
"clean": "echo 'No clean command available for @corona-dashboard/cli'",
"nuke": "yarn clean && npx rimraf node_modules",
"build": "echo 'No build available because @corona-dashboard/cli is not meant for direct consumption'",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/scripts/generate-data-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const outputDirectory = path.join(
);

const bannerComment =
"/**\n* This file was automatically generated by json-schema-to-typescript.\n* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n* and run 'yarn generate-typescript' to regenerate this file.\n*/\n\n";
"/**\n* This file was automatically generated by json-schema-to-typescript.\n* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n* and run 'yarn generate-data-types' to regenerate this file.\n*/\n\n";

const schemaContent = fs.readdirSync(schemaDirectory);
const schemaNames = schemaContent
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/types/data.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run 'yarn generate-typescript' to regenerate this file.
* and run 'yarn generate-data-types' to regenerate this file.
*/

export type GmCode = string;
Expand Down