Skip to content

Commit

Permalink
Improve e2e and app subGen
Browse files Browse the repository at this point in the history
  • Loading branch information
avdev4j committed Aug 7, 2020
1 parent f0b33b6 commit 4d96aac
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
22 changes: 8 additions & 14 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,20 +367,14 @@ module.exports = class extends BaseBlueprintGenerator {
debug: this.isDebugEnabled,
});
}
},

composeE2E() {
if (this.configOptions.skipComposeE2E) return;
this.configOptions.skipComposeE2E = true;
const options = this.options;
const configOptions = this.configOptions;

this.composeWith(require.resolve('../e2e'), {
...options,
'client-hook': !this.skipClient,
configOptions,
debug: this.isDebugEnabled,
});
if (!this.configOptions.skipComposeE2E) {
this.configOptions.skipComposeE2E = true;
this.composeWith(require.resolve('../e2e'), {
...options,
configOptions,
debug: this.isDebugEnabled,
});
}
},

askForTestOpts: prompts.askForTestOpts,
Expand Down
9 changes: 4 additions & 5 deletions generators/e2e/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ module.exports = class extends BaseBlueprintGenerator {
defaults: false,
});

this.setupServerOptions(this);
this.setupClientOptions(this);

useBlueprints = !this.fromBlueprint && this.instantiateBlueprints('e2e', { 'client-hook': !this.skipClient });
}

Expand All @@ -48,13 +45,12 @@ module.exports = class extends BaseBlueprintGenerator {
this.checkInvocationFromCLI();
},

setupConsts() {
setupConstants() {
// Make constants available in templates
this.MAIN_DIR = constants.MAIN_DIR;
this.TEST_DIR = constants.TEST_DIR;
this.SERVER_MAIN_RES_DIR = constants.SERVER_MAIN_RES_DIR;
this.ANGULAR = constants.SUPPORTED_CLIENT_FRAMEWORKS.ANGULAR;
this.BUILD_DIR = this.getBuildDirectoryForBuildTool(this.buildTool);
this.CLIENT_DIST_DIR = this.getResourceBuildDirectoryForBuildTool(this.configOptions.buildTool) + constants.CLIENT_DIST_DIR;
},
};
Expand All @@ -68,6 +64,9 @@ module.exports = class extends BaseBlueprintGenerator {
// Public API method used by the getter and also by Blueprints
_default() {
return {
setupConstants() {
this.BUILD_DIR = this.getBuildDirectoryForBuildTool(this.buildTool);
},
loadSharedConfig() {
this.loadAppConfig();
this.loadClientConfig();
Expand Down

0 comments on commit 4d96aac

Please sign in to comment.