From b0f9f2c85c9f6731c4dfae584f5d2c601c5cf7cc Mon Sep 17 00:00:00 2001 From: mkslanc Date: Wed, 20 Nov 2024 14:48:55 +0400 Subject: [PATCH] add auto generated header to type declarations --- ace.d.ts | 2 ++ tool/ace_declaration_generator.js | 3 +++ types/ace-ext.d.ts | 2 ++ types/ace-lib.d.ts | 2 ++ types/ace-modules.d.ts | 2 ++ types/ace-snippets.d.ts | 2 ++ types/ace-theme.d.ts | 2 ++ 7 files changed, 15 insertions(+) diff --git a/ace.d.ts b/ace.d.ts index d26e52ee012..190a64cf866 100644 --- a/ace.d.ts +++ b/ace.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + /// /// /// diff --git a/tool/ace_declaration_generator.js b/tool/ace_declaration_generator.js index 838d25591f1..40b4b8bd44d 100644 --- a/tool/ace_declaration_generator.js +++ b/tool/ace_declaration_generator.js @@ -4,6 +4,8 @@ const path = require("path"); const SEPARATE_MODULES = ["ext", "theme", "snippets", "lib"]; // adjust this list for more granularity +const AUTO_GENERATED_HEADER = "/* This file is generated using `npm run update-types` */\n\n"; + const defaultFormatCodeSettings = { baseIndentSize: 0, indentSize: 4, @@ -407,6 +409,7 @@ function fixDeclaration(content, aceNamespacePath) { output = correctImportStatements(output); output = cleanComments(output); output = formatDts(outputName, output); + output = AUTO_GENERATED_HEADER + output; fs.writeFileSync(outputName, output); }); diff --git a/types/ace-ext.d.ts b/types/ace-ext.d.ts index e4935b6cfff..984dcdce743 100644 --- a/types/ace-ext.d.ts +++ b/types/ace-ext.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/ext/command_bar" { /** * Displays a command tooltip above the currently active line selection, with clickable elements. diff --git a/types/ace-lib.d.ts b/types/ace-lib.d.ts index 2c0f59e32fb..6135bd4d95b 100644 --- a/types/ace-lib.d.ts +++ b/types/ace-lib.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/lib/useragent" { export namespace OS { let LINUX: string; diff --git a/types/ace-modules.d.ts b/types/ace-modules.d.ts index bb4b6e256ba..dcd0faae0cd 100644 --- a/types/ace-modules.d.ts +++ b/types/ace-modules.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/layer/font_metrics" { export class FontMetrics { constructor(parentEl: HTMLElement); diff --git a/types/ace-snippets.d.ts b/types/ace-snippets.d.ts index 1f1085da24a..a3a14cb8cbe 100644 --- a/types/ace-snippets.d.ts +++ b/types/ace-snippets.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/snippets/abc.snippets" { const _exports: string; export = _exports; diff --git a/types/ace-theme.d.ts b/types/ace-theme.d.ts index faab6975412..363dd69b787 100644 --- a/types/ace-theme.d.ts +++ b/types/ace-theme.d.ts @@ -1,3 +1,5 @@ +/* This file is generated using `npm run update-types` */ + declare module "ace-code/src/theme/textmate-css" { const _exports: string; export = _exports;