Skip to content

Commit

Permalink
Development 80x lodash dependency issue (#34)
Browse files Browse the repository at this point in the history
* Move comma to inside conditional conditional to avoid possible invalid json

* small fix

* fix index.ts causing config.json to not generate properly

* Add lodash dependency to ensure correct version is dedup

* Bump version

* Fix comma

Co-authored-by: Ivo Navega <[email protected]>
Co-authored-by: Carlos Samouco <[email protected]>
Co-authored-by: Francisco Maciel <[email protected]>
  • Loading branch information
4 people authored and Francisco Maciel committed May 12, 2021
1 parent 9c94a8c commit 6c264c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions generators/application/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,23 @@ export = class extends HtmlGenerator {
});
this.fs.copy(this.templatePath("web.config"), this.destinationPath("web.config"));
this.fs.copy(this.templatePath("manifest.json"), this.destinationPath("manifest.json"));
this.fs.copy(this.templatePath("config.json"), this.destinationPath("config.json"));
this.fs.copyTpl(this.templatePath("index.html"), this.destinationPath("index.html"), {isExtendingMes: this.basePackage === WebAppName.MES});
}

install() {
// Install the web after all files are generated
this.spawnCommandSync('gulp', ['purge']);
this.spawnCommandSync('gulp', ['install']);

// Try to populate settings
const configPath = this.destinationPath("node_modules", this.basePackage, "config.setup.json");
// Add here other files that may have settings
if (this.fs.exists(configPath)) {
// Try to assign dynamic bundles location (optional task)
try {
// delete file to recreate it from the base package
fs.unlinkSync(this.destinationPath("config.json"));
// Copy config setup file
fs.copyFileSync(configPath, this.destinationPath("config.json"));
// Regular expression to find the bundle path within non standard config JSON
Expand Down Expand Up @@ -136,16 +143,9 @@ export = class extends HtmlGenerator {
catch (error) {
this.fs.copy(this.templatePath("config.json"), this.destinationPath("config.json"));
}
} else {
this.fs.copy(this.templatePath("config.json"), this.destinationPath("config.json"));
}

this.log(`Please configure the file ${this.destinationPath("config.json")}`);
}

end() {
// Install the web after all files are generated
this.spawnCommandSync('gulp', ['purge']);
this.spawnCommandSync('gulp', ['install']);
}
}
3 changes: 2 additions & 1 deletion generators/application/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
"description": "<%= package %> package",
"dependencies": {
<% if (basePackage && channel) { %>
"<%= basePackage %>": "<%= channel %>"
"<%= basePackage %>": "<%= channel %>",
<% } %>
"lodash": "3.10.1"
},
"optionalDependencies": {},
"cmfLinkDependencies" : {}
Expand Down

0 comments on commit 6c264c6

Please sign in to comment.