From dbb22afde3548a59b306252f70f1abc67c3ac3e4 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Mon, 23 Sep 2024 11:58:05 -0300 Subject: [PATCH] apply javascript:bootstrap command types --- generators/javascript/generators/bootstrap/command.ts | 4 ++-- generators/javascript/types.d.ts | 8 ++++++-- lib/types/application/options.d.ts | 1 + lib/types/application/yo-rc.d.ts | 1 + 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/generators/javascript/generators/bootstrap/command.ts b/generators/javascript/generators/bootstrap/command.ts index 28de8ab124fc..cfdbedb71364 100644 --- a/generators/javascript/generators/bootstrap/command.ts +++ b/generators/javascript/generators/bootstrap/command.ts @@ -18,7 +18,7 @@ */ import type { JHipsterCommandDefinition } from '../../../../lib/command/index.js'; -const command: JHipsterCommandDefinition = { +const command = { configs: { packageJsonNodeEngine: { cli: { @@ -39,6 +39,6 @@ const command: JHipsterCommandDefinition = { }, }, import: [], -}; +} as const satisfies JHipsterCommandDefinition; export default command; diff --git a/generators/javascript/types.d.ts b/generators/javascript/types.d.ts index ddddcd46d69f..190c9ca53965 100644 --- a/generators/javascript/types.d.ts +++ b/generators/javascript/types.d.ts @@ -1,3 +1,8 @@ +import type { ExportApplicationPropertiesFromCommand } from '../../lib/command/types.js'; +import type JavascriptBootstrapCommand from './generators/bootstrap/command.ts'; + +type JavascriptBootstrapProperties = ExportApplicationPropertiesFromCommand; + export type JavaScriptSourceType = { mergePrettierConfig?: (config: Record) => void; addPrettierIgnore?: (newContent: string) => void; @@ -6,9 +11,8 @@ export type JavaScriptSourceType = { addEslintConfig?: (opts: { import?: string | string[]; config?: string | string[] }) => void; }; -export type JavaScriptApplication = { +export type JavaScriptApplication = JavascriptBootstrapProperties & { packageJsonNodeEngine?: boolean | string; - packageJsonType?: string; eslintConfigFile?: string; addPrettierExtensions?: (extensions: string[]) => void; diff --git a/lib/types/application/options.d.ts b/lib/types/application/options.d.ts index f65aeab19a61..a089c1ed9a1d 100644 --- a/lib/types/application/options.d.ts +++ b/lib/types/application/options.d.ts @@ -9,6 +9,7 @@ export type ApplicationOptions = Simplify< ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & + ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & ExportGeneratorOptionsFromCommand & diff --git a/lib/types/application/yo-rc.d.ts b/lib/types/application/yo-rc.d.ts index 9f67e2ee4604..909ba4e572e4 100644 --- a/lib/types/application/yo-rc.d.ts +++ b/lib/types/application/yo-rc.d.ts @@ -18,6 +18,7 @@ export type ApplicationConfiguration = Simplify< ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & + ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand & ExportStoragePropertiesFromCommand &