Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/vue issue158 #211

Merged
24 commits merged into from
Mar 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ jobs:
node_version: [14.16.0]
os: [ubuntu-latest]
app-type:
- monolith-vue-jwt-i18n-jdl
- monolith-vue-oauth2-i18n-jdl
- monolith-vue-mongodb-prod-jdl
- monolith-react-jwt-jdl
- monolith-react-jwt-i18n-jdl
- monolith-react-oauth2-jdl
Expand All @@ -30,6 +33,18 @@ jobs:
- monolith-react-oauth2-dev
- microservice-oauth2-jdl
include:
- app-type: monolith-vue-jwt-i18n-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
e2e: jwt
- app-type: monolith-vue-oauth2-i18n-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
e2e: oauth2
- app-type: monolith-vue-mongodb-prod-jdl
app-folder: monolith-client-database-prod-template-jdl
entity: import-jdl
e2e: jwt
- app-type: monolith-react-jwt-jdl
app-folder: monolith-client-auth-template-jdl
entity: import-jdl
Expand All @@ -41,7 +56,7 @@ jobs:
- app-type: monolith-react-oauth2-jdl
app-folder: monolith-client-auth-template-jdl
entity: import-jdl
e2e: 'oauth2'
e2e: oauth2
- app-type: monolith-react-oauth2-i18n-jdl
app-folder: monolith-client-auth-i18n-template-jdl
entity: import-jdl
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<a name="2.0.0-beta.1"></a>
<a name="1.5.0"></a>
<a name="1.4.0"></a>
<a name="1.3.0"></a>
Expand All @@ -12,6 +13,12 @@
<a name="1.0.0-alpha.3"></a>
<a name="1.0.0-alpha.2"></a>

# [2.0.0-beta.1](https://github.com/jhipster/generator-jhipster-nodejs/tree/v2.0.0-beta.1) - XX/XX/2021 released date

- Vue.js support from 7.x jhipster upgrade [issue #158](https://github.com/jhipster/generator-jhipster-nodejs/issues/158)

- Unable to create a new entity for jhipster 6.8.0 bug [issue #147](https://github.com/jhipster/generator-jhipster-nodejs/issues/147)

# [1.5.0](https://github.com/jhipster/generator-jhipster-nodejs/tree/v1.5.0) - 19/03/2021 released date

- Rename NODE_ENV in BACKEND_ENV with better usage documentation [issue #206](https://github.com/jhipster/generator-jhipster-nodejs/issues/206)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This project adds nodejs for your backend, **all TypeScript files generation, no
> - NestJS base app with web controllers, [swagger doc](https://github.com/nestjs/swagger) and [JWT or OAuth2 passport auth](https://github.com/nestjs/passport) services
> - The app starts with four seed users (admin, basic user and anonymous roles), as standard JHipster monolithic app, with SQLite for dev and configurable sql db for prod. But from the 1.5.0 release you can choose mongodb that uses an embedded version for dev/test
> - The app starts with four seed users (admin, basic user and anonymous roles), as standard JHipster monolithic app, with SQLite for dev and configurable sql db for prod. But from the 1.5.0 release you can choose mongodb that uses a memory version for dev/test
> - The app uses [TypeORM](https://github.com/nestjs/typeorm) and asks you a question for another sql db or for mongodb
Expand Down Expand Up @@ -189,7 +189,7 @@ $ npm link
$ cd ..
$ git clone https://github.com/jhipster/generator-jhipster.git
$ cd generator-jhipster
$ git checkout v6.8.0
$ git checkout v7.0.0
$ npm install
$ npm link
$ cd ..
Expand Down
2 changes: 1 addition & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ To contribute for the next featues, fork the repo and open a pull request regard
- [x] DTOs based rest api
- [x] Validation
- [x] Add MongoDB support with docker compose and embedded for dev/test
- [x] Upgrade Jhipster 7.0.0 with Vue

## To DO for next release

- [ ] Export json/yaml for swagger to integrate with jhipster gateway
- [ ] pagination options in client
- [ ] Elastic Search support
- [ ] Search api
- [ ] Admin services sending email (for new user and change password api)
4 changes: 2 additions & 2 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ RUN \
/var/tmp/*

# install jhipster
RUN npm install -g generator-jhipster@6.8.0
RUN npm install -g generator-jhipster@7.0.0

RUN \
# install the blueprint
Expand All @@ -50,4 +50,4 @@ USER jhipster
ENV PATH $PATH:/usr/bin
WORKDIR "/home/jhipster/app"
VOLUME ["/home/jhipster/app"]
CMD nhipster
CMD nhipster
136 changes: 51 additions & 85 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
const chalk = require('chalk');
const AppGenerator = require('generator-jhipster/generators/app');
const nodePackagejs = require('../../package.json');
const nodePromptApp = require('./prompts.js');

module.exports = class extends AppGenerator {
constructor(args, opts) {
super(args, Object.assign({ fromBlueprint: true }, opts)); // fromBlueprint variable is important
super(args, { fromBlueprint: true, ...opts }); // fromBlueprint variable is important

const jhContext = (this.jhipsterContext = this.options.jhipsterContext);

Expand Down Expand Up @@ -92,113 +91,80 @@ module.exports = class extends AppGenerator {
},
/* eslint-enable */
// remove jhipster standard java requirement not used in this blueprint
validateJava() {},

customSettings() {
if (!this.skipClient) {
this.testFrameworks = ['protractor'];
this.protractorTests = true;
} else {
this.testFrameworks = [];
this.protractorTests = false;
}
if (this.options['skip-i18n']) {
this.enableTranslation = false;
this.skipI18n = true;
}
}
validateJava() {}
};

return Object.assign(initPhaseFromJHipster, nodeInitAppPhaseSteps);
return { ...initPhaseFromJHipster, ...nodeInitAppPhaseSteps };
}

get prompting() {
const promptPhaseFromJHipster = super._prompting();
return Object.assign(promptPhaseFromJHipster, nodePromptApp);
return super._prompting();
}

get configuring() {
const configuringPhaseFromJHipster = super._configuring();

const jhipsterConfigureAppPhaseSteps = {
composeServer() {
if (this.skipServer) return;
const options = this.options;
const configOptions = this.configOptions;

this.composeWith(require.resolve('../server'), {
...options,
configOptions,
'client-hook': !this.skipClient,
debug: this.isDebugEnabled
});
},

composeClient() {
if (this.skipClient) return;
const options = this.options;
const configOptions = this.configOptions;
customI18n() {
if (this.options['skip-i18n']) {
this.configOptions.enableTranslation = false;
this.configOptions.skipI18n = true;
}
}
};

this.composeWith(require.resolve('../client'), {
...options,
configOptions,
debug: this.isDebugEnabled
});
},
return { ...configuringPhaseFromJHipster, ...jhipsterConfigureAppPhaseSteps };
}

composeCommon() {
const options = this.options;
const configOptions = this.configOptions;
get composing() {
const composingPhaseFromJHipster = super._composing();
composingPhaseFromJHipster.askForTestOpts = {};
return composingPhaseFromJHipster;
}

this.composeWith(require.resolve('../common'), {
...options,
'client-hook': !this.skipClient,
configOptions,
debug: this.isDebugEnabled
});
}
};
get loading() {
return super._loading();
}

return Object.assign(configuringPhaseFromJHipster, jhipsterConfigureAppPhaseSteps);
get preparing() {
return this._preparing();
}

get default() {
const defaultPhaseFromJHipster = super._default();
const jhipsterConfigureAppPhaseSteps = {
/* saveConfig() {
// remove old update in yo-rc.json
},
*/
askForTestOpts: {}
// askForMoreModules: {}
};

return Object.assign(defaultPhaseFromJHipster, jhipsterConfigureAppPhaseSteps);
return super._default();
}

get writing() {
const writingPhaseFromJHipster = super._writing();

const jhipsterWritingAppPhaseSteps = {
regenerateEntities() {
if (this.withEntities) {
const options = this.options;
const configOptions = this.configOptions;
this.getExistingEntities().forEach(entity => {
this.composeWith(require.resolve('../entity'), {
...options,
configOptions,
regenerate: true,
'skip-install': true,
debug: this.isDebugEnabled,
arguments: [entity.name]
});
});
return super._writing();
}

get postWriting() {
return super._postWriting();
}

get install() {
const installPhaseFromJHipster = super._install();

const nodeServerInstall = {
/* istanbul ignore next */
jhipsterNodeServerInstall() {
if (this.skipServer) return;
const logMsg = `To install your server dependencies manually, run: cd server && ${chalk.yellow.bold('npm install')}`;

if (this.options.skipInstall) {
this.log(logMsg);
} else {
try {
this.log(chalk.bold('\nInstalling server dependencies using npm'));
this.spawnCommandSync('npm', ['install'], { cwd: `${process.cwd()}/server` });
} catch (e) {
this.warning('Install of server dependencies failed!');
this.log(logMsg);
}
}
}
};

return Object.assign(writingPhaseFromJHipster, jhipsterWritingAppPhaseSteps);
return { ...installPhaseFromJHipster, ...nodeServerInstall };
}

get end() {
Expand Down
52 changes: 0 additions & 52 deletions generators/app/prompts.js

This file was deleted.

Loading