diff --git a/docs/schema.md b/docs/schema.md index 7cb4d753c4..28bb29c39a 100644 --- a/docs/schema.md +++ b/docs/schema.md @@ -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 diff --git a/packages/cli/README.md b/packages/cli/README.md index 0614db5346..f7f21ab28f 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -8,7 +8,7 @@ against their given schema. `yarn validate-json-single ` 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 diff --git a/packages/cli/package.json b/packages/cli/package.json index 0601d8bd83..bc0858a922 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -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'", diff --git a/packages/cli/src/scripts/generate-data-types.ts b/packages/cli/src/scripts/generate-data-types.ts index 6089d64b9b..8dfebe52f9 100644 --- a/packages/cli/src/scripts/generate-data-types.ts +++ b/packages/cli/src/scripts/generate-data-types.ts @@ -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 diff --git a/packages/common/src/types/data.ts b/packages/common/src/types/data.ts index 2ceeefa8fa..530884d00a 100644 --- a/packages/common/src/types/data.ts +++ b/packages/common/src/types/data.ts @@ -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;