Skip to content

Commit

Permalink
Merge pull request #23402 from mshima/skip_ci-cleanup-jdl
Browse files Browse the repository at this point in the history
Cleanup jdl
  • Loading branch information
DanielFran authored Sep 4, 2023
2 parents d6f5be3 + 5b48545 commit def79dd
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 1,711 deletions.
2 changes: 0 additions & 2 deletions generators/jdl/__snapshots__/generator.spec.mts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,6 @@ Options:
--skip-sample-repository Disable fetching sample files when the file is not a URL
--inline <value> Pass JDL content inline. Argument can be skipped when passing this
--skip-user-management Skip the user management module during app generation
--unidirectional-relationships Generate unidirectional relationships
--force-no-filtering Don't filter jdl entities
--skip-cache Do not remember prompt answers (default: false)
--skip-install Do not automatically install dependencies (default: false)
--force-install Fail on install dependencies error (default: false)
Expand Down
10 changes: 0 additions & 10 deletions generators/jdl/command.mts
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ const command: JHipsterCommandDefinition = {
type: Boolean,
scope: 'generator',
},
unidirectionalRelationships: {
description: 'Generate unidirectional relationships',
type: Boolean,
scope: 'generator',
},
forceNoFiltering: {
description: "Don't filter jdl entities",
type: Boolean,
scope: 'generator',
},
},
import: [GENERATOR_APP, GENERATOR_WORKSPACES],
};
Expand Down
3 changes: 0 additions & 3 deletions generators/jdl/generator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export default class JdlGenerator extends BaseGenerator {
ignoreApplication?: boolean;
ignoreDeployments?: boolean;
skipSampleRepository?: boolean;
forceNoFiltering?: boolean;
force?: boolean;
reproducible?: boolean;
createEnvBuilder = EnvironmentBuilder.createDefaultBuilder;
Expand Down Expand Up @@ -142,8 +141,6 @@ export default class JdlGenerator extends BaseGenerator {
databaseType: this.options.db ?? this.existingProject ? this.jhipsterConfigWithDefaults.prodDatabaseType : undefined,
applicationType: this.options.applicationType,
skipUserManagement: this.options.skipUserManagement,
forceNoFiltering: true,
skipFileGeneration: true,
};

const importer = createImporterFromContent(this.jdlContents.join('\n'), configuration);
Expand Down
24 changes: 0 additions & 24 deletions generators/liquibase/incremental-liquibase.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ describe('generator - app - --incremental-changelog', function () {
before(async () => {
const initialState = createImporterFromContent(jdlApplicationWithRelationshipToUser, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand All @@ -218,7 +217,6 @@ describe('generator - app - --incremental-changelog', function () {
.withOptions({ ...options, applicationWithEntities })
.run();
const state = createImporterFromContent(jdlApplicationWithRelationshipToUser, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand Down Expand Up @@ -278,7 +276,6 @@ entity Customer {
`,
{
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
},
).import();
Expand All @@ -299,7 +296,6 @@ entity Customer {
}
`,
{
skipFileGeneration: true,
...options,
},
).import();
Expand Down Expand Up @@ -363,7 +359,6 @@ entity Customer {
`,
{
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
},
).import();
Expand All @@ -384,7 +379,6 @@ entity Customer {
}
`,
{
skipFileGeneration: true,
...options,
},
).import();
Expand Down Expand Up @@ -450,7 +444,6 @@ entity Customer {
`,
{
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
},
).import();
Expand All @@ -470,7 +463,6 @@ entity Customer {
}
`,
{
skipFileGeneration: true,
...options,
},
).import();
Expand Down Expand Up @@ -535,7 +527,6 @@ entity Customer {
`,
{
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
},
).import();
Expand All @@ -555,7 +546,6 @@ entity Customer {
}
`,
{
skipFileGeneration: true,
...options,
},
).import();
Expand Down Expand Up @@ -612,7 +602,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(jdlApplicationWithEntities, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand All @@ -624,7 +613,6 @@ entity Customer {
.run();

const state = createImporterFromContent(jdlApplicationWithEntitiesAndRelationship, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand Down Expand Up @@ -679,7 +667,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(jdlApplicationWithEntities, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand All @@ -691,7 +678,6 @@ entity Customer {
.run();

const state = createImporterFromContent(jdlApplicationWithEntitiesAndRelationshipsWithOnHandlers, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand Down Expand Up @@ -756,7 +742,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(jdlApplicationWithEntities, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand All @@ -768,7 +753,6 @@ entity Customer {
.run();

const state = createImporterFromContent(jdlApplicationWithEntitiesAndRelationshipsWithOnHandlers, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand All @@ -781,7 +765,6 @@ entity Customer {
.run();

const thirdState = createImporterFromContent(jdlApplicationWithEntitiesAndRelationshipsWithChangedOnHandlers, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand Down Expand Up @@ -881,7 +864,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(jdlApplicationWithEntities, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand All @@ -893,7 +875,6 @@ entity Customer {
.run();

const state = createImporterFromContent(jdlApplicationWithEntitiesAndRelationshipsWithOnHandlers, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand All @@ -906,7 +887,6 @@ entity Customer {
.run();

const thirdState = createImporterFromContent(jdlApplicationWithEntitiesAndRelationshipsWithChangedOnHandlersAndChangedNaming, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand Down Expand Up @@ -1016,7 +996,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(jdlApplicationWithEntitiesAndRelationshipsWithOnHandlers, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand Down Expand Up @@ -1079,7 +1058,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(jdlApplicationWithEntitiesAndRelationship, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand All @@ -1091,7 +1069,6 @@ entity Customer {
.run();

const state = createImporterFromContent(jdlApplicationWithEntities, {
skipFileGeneration: true,
...options,
}).import();
runResult = await runResult
Expand Down Expand Up @@ -1160,7 +1137,6 @@ entity Customer {
const baseName = 'JhipsterApp';
const initialState = createImporterFromContent(eachEntityConfig.entity, {
...options,
skipFileGeneration: true,
creationTimestampConfig: options.creationTimestamp,
}).import();
const applicationWithEntities = initialState.exportedApplicationsWithEntities[baseName];
Expand Down
6 changes: 2 additions & 4 deletions generators/server/options/database-migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ describe(`generators - server - jdl - ${optionName}`, () => {
let state: ImportState;

before(() => {
const importer = createImporterFromContent(`application { config { ${optionName} ${optionValue} } }`, {
skipFileGeneration: true,
});
const importer = createImporterFromContent(`application { config { ${optionName} ${optionValue} } }`);
state = importer.import();
});

Expand All @@ -22,7 +20,7 @@ describe(`generators - server - jdl - ${optionName}`, () => {
});
describe('with invalid value', () => {
it('should set expected value', () => {
const importer = createImporterFromContent(`application { config { ${optionName} foo } }`, { skipFileGeneration: true });
const importer = createImporterFromContent(`application { config { ${optionName} foo } }`);
expect(() => importer.import()).toThrow(`Unknown value 'foo' for option '${optionName}'.`);
});
});
Expand Down
6 changes: 2 additions & 4 deletions generators/server/options/message-broker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ describe('generators - server - jdl - messageBroker', () => {
let state: ImportState;

before(() => {
const importer = createImporterFromContent(`application { config { ${MESSAGE_BROKER} ${optionValue} } }`, {
skipFileGeneration: true,
});
const importer = createImporterFromContent(`application { config { ${MESSAGE_BROKER} ${optionValue} } }`);
state = importer.import();
});

Expand All @@ -22,7 +20,7 @@ describe('generators - server - jdl - messageBroker', () => {
});
describe('with invalid value', () => {
it('should set expected value', () => {
const importer = createImporterFromContent(`application { config { ${MESSAGE_BROKER} foo } }`, { skipFileGeneration: true });
const importer = createImporterFromContent(`application { config { ${MESSAGE_BROKER} foo } }`);
expect(() => importer.import()).toThrow(/Unknown value 'foo' for option 'messageBroker'./);
});
});
Expand Down
Loading

0 comments on commit def79dd

Please sign in to comment.