Skip to content

Commit 0a9f81d

Browse files
committed
feat: Improve headers of generated schemas
* Show path to source file * Show actual yarn command to run to update
1 parent 26789f8 commit 0a9f81d

31 files changed

+58
-56
lines changed

packages/timeline-state-resolver-tools/bin/schema-types.mjs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ if (!searchPath || !outputPath) {
4747
}
4848

4949
const BANNER =
50-
'/* eslint-disable */\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 re-run the "tsr-schema-types" tool to regenerate this file.\n */\n'
50+
'/* eslint-disable */\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-schema-types" regenerate this file.\n */\n'
51+
const BANNER_WITH_SOURCE =
52+
'/* eslint-disable */\n/**\n * This file was automatically generated by json-schema-to-typescript from [source].\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run "yarn generate-schema-types" regenerate this file.\n */\n'
5153

5254
let hadError = false
5355

@@ -450,7 +452,7 @@ export interface DeviceOptions${dirId} extends DeviceOptionsBase<${dirId}Options
450452
// Output to tsr types package
451453
const outputFilePath = path.join(resolvedOutputPath, dir + '.ts')
452454
if (output) {
453-
output = BANNER + output
455+
output = BANNER_WITH_SOURCE.replace('[source]', 'src/$schemas/generated/' + dir) + output
454456

455457
await fs.writeFile(outputFilePath, output)
456458

packages/timeline-state-resolver-types/src/generated/abstract.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable */
22
/**
3-
* This file was automatically generated by json-schema-to-typescript.
3+
* This file was automatically generated by json-schema-to-typescript from src/$schemas/generated/abstract.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77
import type { ActionExecutionResult } from "../actions"
88

packages/timeline-state-resolver-types/src/generated/action-schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file was automatically generated by json-schema-to-typescript.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77

88
export interface TSRActionSchema {

packages/timeline-state-resolver-types/src/generated/atem.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable */
22
/**
3-
* This file was automatically generated by json-schema-to-typescript.
3+
* This file was automatically generated by json-schema-to-typescript from src/$schemas/generated/atem.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77
import type { ActionExecutionResult } from "../actions"
88

packages/timeline-state-resolver-types/src/generated/casparCG.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable */
22
/**
3-
* This file was automatically generated by json-schema-to-typescript.
3+
* This file was automatically generated by json-schema-to-typescript from src/$schemas/generated/casparCG.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77
import type { ActionExecutionResult } from "../actions"
88

packages/timeline-state-resolver-types/src/generated/common-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file was automatically generated by json-schema-to-typescript.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77

88
export interface DeviceCommonOptions {

packages/timeline-state-resolver-types/src/generated/device-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file was automatically generated by json-schema-to-typescript.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77

88
import type { DeviceOptionsBase } from '../device'

packages/timeline-state-resolver-types/src/generated/generic-ptz-actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/**
33
* This file was automatically generated by json-schema-to-typescript.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77

88

packages/timeline-state-resolver-types/src/generated/httpSend.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable */
22
/**
3-
* This file was automatically generated by json-schema-to-typescript.
3+
* This file was automatically generated by json-schema-to-typescript from src/$schemas/generated/httpSend.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77
import type { ActionExecutionResult } from "../actions"
88

packages/timeline-state-resolver-types/src/generated/httpWatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* eslint-disable */
22
/**
3-
* This file was automatically generated by json-schema-to-typescript.
3+
* This file was automatically generated by json-schema-to-typescript from src/$schemas/generated/httpWatcher.
44
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5-
* and re-run the "tsr-schema-types" tool to regenerate this file.
5+
* and run "yarn generate-schema-types" regenerate this file.
66
*/
77

88
export interface HttpWatcherOptions {

0 commit comments

Comments
 (0)