Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jhipster-core

Package Overview
Dependencies
Maintainers
4
Versions
90
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jhipster-core - npm Package Compare versions

Comparing version 7.2.0 to 7.2.1

10

CHANGELOG.md

@@ -1,3 +0,11 @@

# Latest: v7.2.0
# Latest: v7.2.1
## Bug fix:
- Fixed bug when parsing a JDL content with no entity
- The failing cases happened when parsing applications without entities, and it failed because we wanted to export no entities.
___
# v7.2.0
## What's new

@@ -4,0 +12,0 @@ - JDL:

5

lib/converters/JDLToJSON/jdl_with_applications_to_json_converter.js

@@ -51,3 +51,6 @@ /**

if (entitiesPerApplication.size === 0) {
return new Map();
const applicationNames = jdlObject
.getApplications()
.map(jdlApplication => jdlApplication.getConfigurationOptionValue('baseName'));
return new Map(applicationNames.map(applicationName => [applicationName, []]));
}

@@ -54,0 +57,0 @@ setBasicEntityInformation(args.creationTimestamp);

@@ -92,2 +92,5 @@ /**

init(passedConfiguration);
if (configuration.entities.length === 0) {
return configuration.entities;
}
const subFolder = passedConfiguration.application.forSeveralApplications ? configuration.application.name : '';

@@ -94,0 +97,0 @@ configuration.entities = updateEntities(subFolder);

@@ -221,9 +221,11 @@ /** Copyright 2013-2020 the original author or authors from the JHipster project.

const jsonEntities = entitiesPerApplicationMap.get(applicationName);
const exportedJSONEntities = exportJSONEntities(jsonEntities, {
applicationName,
applicationType: jdlApplication.getConfigurationOptionValue('applicationType'),
forSeveralApplications: false,
skipEntityFilesGeneration
});
importState.exportedEntities = uniqBy([...importState.exportedEntities, ...exportedJSONEntities], 'name');
if (jsonEntities.length !== 0) {
const exportedJSONEntities = exportJSONEntities(jsonEntities, {
applicationName,
applicationType: jdlApplication.getConfigurationOptionValue('applicationType'),
forSeveralApplications: false,
skipEntityFilesGeneration
});
importState.exportedEntities = uniqBy([...importState.exportedEntities, ...exportedJSONEntities], 'name');
}
return importState;

@@ -230,0 +232,0 @@ }

{
"name": "jhipster-core",
"version": "7.2.0",
"version": "7.2.1",
"description": "JHipster's own domain language and core objects",

@@ -5,0 +5,0 @@ "main": "module/index.js",

@@ -92,2 +92,21 @@ /**

});
context('when not exporting entities', () => {
let returned;
before(() => {
returned = JHipsterEntityExporter.exportEntities({
entities: [],
application: {
name: 'MyApp',
type: ApplicationTypes.MONOLITH
}
});
});
it('should return an empty list', () => {
expect(returned).to.deep.equal([]);
});
it('should not create a .jhipster folder', () => {
expect(FileUtils.doesDirectoryExist('.jhipster')).to.be.false;
});
});
context('when exporting the same entity', () => {

@@ -94,0 +113,0 @@ let entities;

@@ -1851,3 +1851,20 @@ /**

});
context('when not exporting entities but only applications', () => {
before(() => {
const importer = createImporterFromFiles([path.join('test', 'test_files', 'application.jdl')], {
creationTimestamp: '2019-01-01'
});
importer.import();
});
after(() => {
fse.removeSync('.yo-rc.json');
});
it('should export the .yo-rc.json file', () => {
expect(fse.existsSync('.yo-rc.json')).to.be.true;
});
it('should not create the .jhipster folder', () => {
expect(fse.existsSync('.jhipster')).to.be.false;
});
});
});
});

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc