Skip to content

Commit ceaa769

Browse files
committed
adjusts
1 parent 43afbee commit ceaa769

17 files changed

Lines changed: 79 additions & 9 deletions

File tree

generators/angular/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
*/
1919
export { default } from './generator.ts';
2020
export { default as command } from './command.ts';
21+
export type { Application, Config, Entity, Field, Options, Relationship, Source } from './types.ts';

generators/app/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
*/
1919
export { default } from './generator.ts';
2020
export { default as command } from './command.ts';
21+
export type { Application, Config, Entity, Field, Options, Relationship, Source } from './types.ts';

generators/app/types.d.ts

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,39 @@
1717
* limitations under the License.
1818
*/
1919
import type { CommandTypeMap } from '../../lib/command/types.ts';
20-
import type { Config as BaseApplicationConfig, Options as BaseApplicationOptions } from '../base-application/types.ts';
20+
import type {
21+
Application as ClientApplication,
22+
Config as ClientConfig,
23+
Entity as ClientEntity,
24+
Field as ClientField,
25+
Options as ClientOptions,
26+
Relationship as ClientRelationship,
27+
Source as ClientSource,
28+
} from '../client/types.d.ts';
29+
import type {
30+
Application as ServerApplication,
31+
Config as ServerConfig,
32+
Entity as ServerEntity,
33+
Field as ServerField,
34+
Options as ServerOptions,
35+
Relationship as ServerRelationship,
36+
Source as ServerSource,
37+
} from '../server/types.d.ts';
2138

2239
import type command from './command.ts';
2340

2441
type Command = CommandTypeMap<typeof command>;
2542

26-
export type Config = Command['Config'] & BaseApplicationConfig;
43+
export type Config = Command['Config'] & ClientConfig & ServerConfig;
2744

28-
export type Options = Command['Options'] & BaseApplicationOptions;
45+
export type Options = Command['Options'] & ClientOptions & ServerOptions;
46+
47+
export type Source = ClientSource & ServerSource;
48+
49+
export type Field = ClientField & ServerField;
50+
51+
export interface Relationship extends ClientRelationship, ServerRelationship {}
52+
53+
export type Entity<F extends Field = Field, R extends Relationship = Relationship> = ClientEntity<F, R> & ServerEntity<F, R>;
54+
55+
export type Application = Command['Application'] & ClientApplication<Entity> & ServerApplication<Entity>;

generators/cypress/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@
1919
export { default } from './generator.ts';
2020
export { default as command } from './command.ts';
2121
export { cypressEntityFiles, cypressFiles } from './files.ts';
22+
export type { Application, Config, Entity, Field, Options, Relationship, Source } from './types.ts';

generators/cypress/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
Options as JavascriptOptions,
77
} from '../client/types.ts';
88

9-
export type { Features, Field, Relationship } from '../client/types.ts';
9+
export type { Features, Field, Relationship, Source } from '../client/types.ts';
1010
import type command from './command.ts';
1111

1212
type Command = CommandTypeMap<typeof command>;

generators/generate-blueprint/generators/standalone/generator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export default class StandaloneBlueprintGenerator extends GenerateBlueprintBaseG
7272
`.blueprint/generate-sample/command.${extension}`,
7373
`.blueprint/generate-sample/generator.${extension}`,
7474
`.blueprint/generate-sample/index.${extension}`,
75+
...(application.javascriptBlueprint ? [] : ['generators/base-generator.ts']),
7576
// Always write cli for devBlueprint usage
7677
`cli/${application.blueprintCliName}`,
7778
{ sourceFile: `cli/cli-customizations.c${application.javascriptBlueprint ? 'j' : 't'}s`, override: false },
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { JHipsterCommandDefinition } from 'generator-jhipster';
2+
import BaseApplicationGenerator from 'generator-jhipster/generators/base-application';
3+
import type {
4+
Application as BaseApplication,
5+
Config as BaseConfig,
6+
Entity as BaseEntity,
7+
Options as BaseOptions,
8+
Source as BaseSource,
9+
} from 'generator-jhipster/generators/add';
10+
11+
type <%- upperFirstCamelCaseBaseName %>BlueprintConfig = any;
12+
13+
type <%- upperFirstCamelCaseBaseName %>Entity = BaseEntity;
14+
15+
export type <%- upperFirstCamelCaseBaseName %>Application = BaseApplication<<%- upperFirstCamelCaseBaseName %>Entity> & {
16+
<%- upperFirstCamelCaseBaseName %>EventChangelogDate: string;
17+
auditedEntities: string[];
18+
};
19+
20+
type <%- upperFirstCamelCaseBaseName %>Options = BaseOptions;
21+
22+
type <%- upperFirstCamelCaseBaseName %>Source = BaseSource;
23+
24+
export class <%- upperFirstCamelCaseBaseName %>ApplicationGenerator extends BaseApplicationGenerator<
25+
<%- upperFirstCamelCaseBaseName %>Entity,
26+
<%- upperFirstCamelCaseBaseName %>Application,
27+
BaseConfig,
28+
<%- upperFirstCamelCaseBaseName %>Options,
29+
<%- upperFirstCamelCaseBaseName %>Source
30+
> {
31+
declare blueprintConfig: <%- upperFirstCamelCaseBaseName %>BlueprintConfig;
32+
}
33+
34+
export const asCommand = <const Def extends JHipsterCommandDefinition<<%- upperFirstCamelCaseBaseName %>ApplicationGenerator>>(command: Def): Def => command;

generators/java-simple-application/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
*/
1919
export { default } from './generator.ts';
2020
export { default as command } from './command.ts';
21+
export type { Application, Config, Options, Source } from './types.ts';

generators/languages/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
*/
1919
export { default } from './generator.ts';
2020
export { default as command } from './command.ts';
21-
export type { Application, Entity, Field, Relationship } from './types.ts';
21+
export type { Application, Config, Entity, Field, Options, Relationship, Source } from './types.ts';

generators/liquibase/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
*/
1919
export { default } from './generator.ts';
2020
export { default as command } from './command.ts';
21-
export type { Application, Entity, Field, Relationship, Source } from './types.d.ts';
21+
export type { Application, Config, Entity, Field, Options, Relationship, Source } from './types.ts';

0 commit comments

Comments
 (0)