generator-hornet-js
Advanced tools
Comparing version 5.1.1 to 5.2.0
@@ -18,11 +18,11 @@ "use strict"; | ||
this.argument("appname", {type: String, required: false}); | ||
this.argument("appversion", {type: String, required: false}); | ||
this.argument("appdescription", {type: String, required: false}); | ||
this.argument("fmkversion", {type: String, required: false}); | ||
this.argument("theme", {type: String, required: false}); | ||
this.argument("themeversion", {type: String, required: false}); | ||
this.argument("urlservice", {type: String, required: false}); | ||
this.argument("hostservice", {type: String, required: false}); | ||
this.argument("fullspa", {type: Boolean, required: false}); | ||
this.argument("appname", { type: String, required: false }); | ||
this.argument("appversion", { type: String, required: false }); | ||
this.argument("appdescription", { type: String, required: false }); | ||
this.argument("fmkversion", { type: String, required: false }); | ||
this.argument("theme", { type: String, required: false }); | ||
this.argument("themeversion", { type: String, required: false }); | ||
this.argument("urlservice", { type: String, required: false }); | ||
this.argument("hostservice", { type: String, required: false }); | ||
this.argument("fullspa", { type: Boolean, required: false }); | ||
}, | ||
@@ -120,7 +120,7 @@ prompting: function () { | ||
return this.prompt(prompts).then( function(answers) { | ||
return this.prompt(prompts).then(function (answers) { | ||
if (!this.options.appname) { | ||
this._applyParam(answers, "appname", "appname"); | ||
}else{ | ||
} else { | ||
this._applyOptions("appname", this.options.appname); | ||
@@ -130,3 +130,3 @@ } | ||
this._applyParam(answers, "appversion", "appversion"); | ||
}else{ | ||
} else { | ||
this._applyOptions("appversion", this.options.appversion); | ||
@@ -136,3 +136,3 @@ } | ||
this._applyParam(answers, "appdescription", "appdescription"); | ||
}else{ | ||
} else { | ||
this._applyOptions("appdescription", this.options.appdescription); | ||
@@ -142,3 +142,3 @@ } | ||
this._applyParam(answers, "fmkversion", "fmkversion"); | ||
}else{ | ||
} else { | ||
this._applyOptions("fmkversion", this.options.fmkversion); | ||
@@ -148,3 +148,3 @@ } | ||
this._applyParam(answers, "theme", "theme"); | ||
}else{ | ||
} else { | ||
this._applyOptions("theme", this.options.theme); | ||
@@ -154,3 +154,3 @@ } | ||
this._applyParam(answers, "themeversion", "themeversion"); | ||
}else{ | ||
} else { | ||
this._applyOptions("themeversion", this.options.themeversion); | ||
@@ -160,3 +160,3 @@ } | ||
this._applyParam(answers, "hostservice", "hostservice"); | ||
}else{ | ||
} else { | ||
this._applyOptions("hostservice", this.options.hostservice); | ||
@@ -166,3 +166,3 @@ } | ||
this._applyParam(answers, "urlservice", "urlservice"); | ||
}else{ | ||
} else { | ||
this._applyOptions("urlservice", this.options.urlservice); | ||
@@ -172,3 +172,3 @@ } | ||
this._applyParam(answers, "fullspa", "fullspa"); | ||
}else{ | ||
} else { | ||
this._applyOptions("fullspa", this.options.fullspa); | ||
@@ -216,5 +216,15 @@ } | ||
// plopfile | ||
this._copy("plopfile.js", "plopfile.js", defaultConfig); | ||
// tests.webpack | ||
this._copy("tests.webpack.js", "tests.webpack.js", defaultConfig); | ||
// config/* | ||
this._writingConfig(defaultConfig); | ||
// test | ||
this._writingTest(defaultConfig); | ||
// public | ||
@@ -227,2 +237,4 @@ // Attention, ne pas copier l"image unitairement, sinon le proccessing va la corrompre | ||
this._writingPlopTemplate(defaultConfig); | ||
// src | ||
@@ -250,2 +262,6 @@ this._writingSrc(defaultConfig); | ||
}, | ||
_writingPlopTemplate: function (defaultConfig) { | ||
this._copy("plop-templates/**", "plop-templates/", defaultConfig); | ||
}, | ||
_writingSrc: function (defaultConfig) { | ||
@@ -289,3 +305,10 @@ | ||
}, | ||
_writingTest: function (defaultConfig) { | ||
// templates | ||
this._copy("test/template/**", "test/template/", defaultConfig); | ||
// karma test example | ||
this._copy("test/test.karma.tsx", defaultConfig); | ||
}, | ||
_applyParam: function (answers, key, destkey) { | ||
@@ -340,4 +363,4 @@ var useDestKey = destkey || key; | ||
install: function () { | ||
this.installDependencies({bower: false}); | ||
this.installDependencies({ bower: false }); | ||
} | ||
}); |
@@ -37,5 +37,13 @@ { | ||
"init-snapshot": "hb dependency:set-snapshot --dependencyVersionFix=hornet-js --module=hornet-js-core && hb dependency:set-snapshot --dependencyVersionFix=hornet-themes-intranet --module=hornet-themes-intranet && hb install", | ||
"version": "echo $npm_package_version" | ||
"version": "echo $npm_package_version", | ||
"plop": "node ./node_modules/plop" | ||
}, | ||
"author": "MEAE - Ministère de l'Europe et des Affaires étrangères" | ||
"devDependencies": { | ||
"inquirer-directory": "2.1.0", | ||
"inquirer-file": "1.0.0", | ||
"plop": "2.0.0" | ||
}, | ||
"author": "MEAE - Ministère de l'Europe et des Affaires étrangères", | ||
"hornetJsBuilder": "1.5.4" | ||
} |
@@ -1,2 +0,14 @@ | ||
var path = require("path"); | ||
const path = require("path"); | ||
const clientContext = [ | ||
[/moment[\/\\]locale$/, /fr|en/], | ||
[/intl[\/\\]locale-data[\/\\]jsonp$/, /fr|en/], | ||
[/^\.$/, (context) => { | ||
if (!/\/locale-data\//.test(context.context)) console.log("locale-daa", context); | ||
if (!/\/log4js\/lib$/.test(context.context)) return; | ||
context.regExp = /^\.\/appenders\/console.*$/; | ||
context.request = "."; | ||
}] | ||
]; | ||
module.exports = { | ||
@@ -60,8 +72,14 @@ type: "application", | ||
}, | ||
clientContext: [ | ||
[/moment[\/\\]locale$/, /fr/], | ||
[/intl[\/\\]locale-data[\/\\]jsonp$/, /fr/], | ||
[/.appender/, /console/] | ||
], | ||
typescript: {}, | ||
clientContext: clientContext, | ||
karma: { | ||
template: { | ||
debug: "./test/template/debug.html", | ||
context: "./test/template/context.html", | ||
clientContext: "./test/template/client_with_context.html" | ||
}, | ||
clientContext: clientContext, | ||
clientExclude: { | ||
modules: ["cluster", "continuation-local-storage", "config", "cluster"] | ||
} | ||
}, | ||
template: [{ | ||
@@ -68,0 +86,0 @@ context: [{ |
@@ -106,5 +106,5 @@ { | ||
"frameguard": { | ||
"enabled": true, | ||
"mode": "deny", | ||
"allowFromPattern": "" | ||
"enabled": true | ||
/*,"action": "sameorigin",*/ | ||
/*"domain": ""*/ | ||
}, | ||
@@ -209,4 +209,8 @@ "xss": { | ||
} | ||
}, | ||
"timeout": { | ||
"response": 10000, | ||
"deadline": 60000 | ||
} | ||
} | ||
} |
@@ -6,3 +6,3 @@ { | ||
"pattern": ".yyyy-MM-dd", | ||
"filename":"/var/log/nodejs/#{INSTANCE_NAME}/#{INSTANCE_NAME}.log", | ||
"filename":"#{NODE_LOG_DIR}/#{INSTANCE_NAME}/#{INSTANCE_NAME}.log", | ||
"layout": { | ||
@@ -9,0 +9,0 @@ "type": "pattern", |
@@ -47,6 +47,6 @@ { | ||
}, | ||
"antivirus": { | ||
"antivirus" : { | ||
"host" : "#{ANTIVIRUS_HOST}", | ||
"port": #{ANTIVIRUS_PORT}, | ||
"timeout": #{ANTIVIRUS_TIMEOUTE} | ||
"port" : #{ANTIVIRUS_PORT}, | ||
"timeout" : #{ANTIVIRUS_TIMEOUTE} | ||
}, | ||
@@ -61,6 +61,2 @@ "mail": { | ||
"rejectUnauthorized": #{MAIL_TLS_REJECT} | ||
}, | ||
"auth": { | ||
"user": "#{MAIL_USER}", | ||
"pass": "#{MAIL_PASS}" | ||
} | ||
@@ -67,0 +63,0 @@ }, |
@@ -52,4 +52,15 @@ #<%= appname %> <%= appversion %> | ||
Vous pouvez accéder à l'application depuis l'url [http://localhost:8888/<%= slugify(appname) %>/](http://localhost:8888/<%= slugify(appname) %>) | ||
L'application est accessible depuis un navigateur à l'addresse : [http://localhost:8888/<%= slugify(appname) %>/](http://localhost:8888/<%= slugify(appname) %>) | ||
## Packaging de l'application | ||
```shell | ||
hb package | ||
``` | ||
Les livrables sont à récupérer dans le répertoire : `target` | ||
- `<%= slugify(appname) %>-<%= slugify(appversion) %>-static.zip` | ||
- `<%= slugify(appname) %>-<%= slugify(appversion) %>-dynamic.zip` | ||
## Fichier de configuration de l'application : default.json | ||
@@ -56,0 +67,0 @@ |
@@ -8,18 +8,10 @@ import { Utils } from "hornet-js-utils"; | ||
import { Scope } from "hornet-js-core/src/inject/injectable"; | ||
import { AuthServiceDataMockImpl } from 'src/mock/services/data/auth/auth-service-data-mock-impl'; | ||
if (Utils.config.getOrDefault("mock.enabled", false) && Utils.config.getOrDefault("mock.serviceData.enabled", false)) { | ||
Promise.all([ | ||
import("src/mock/services/data/auth/auth-service-data-mock-impl") | ||
]).then(([AuthServiceDataMockImpl]) => { | ||
Injector.register(AuthService, AuthServiceDataMockImpl.AuthServiceDataMockImpl, Scope.SINGLETON); | ||
}); | ||
Injector.register(AuthService, AuthServiceDataMockImpl, Scope.SINGLETON); | ||
} else { | ||
Promise.all([ | ||
import("src/services/data/auth/auth-service-data-impl"), | ||
]).then(([AuthServiceImpl]) => { | ||
Injector.register(AuthService, AuthServiceImpl.AuthServiceImpl, Scope.SINGLETON); | ||
}); | ||
Injector.register(AuthService, AuthServiceImpl, Scope.SINGLETON); | ||
} | ||
@@ -8,3 +8,3 @@ { | ||
"nfePage": { | ||
"title": "Oops! Nous ne trouvons pas ce que vous cherchez!", | ||
"title": "Cette page n'existe pas", | ||
"backToHome": "Retour à la page d'accueil" | ||
@@ -62,3 +62,3 @@ }, | ||
"textarea": { | ||
"alertMessage": "Le nombre de caractère renseigné est trop élevé par rapport au nombre maximum ({count}/{maxChar}).", | ||
"alertMessage": "Le nombre de caractères renseignés est trop élevé par rapport au nombre maximum ({count}/{maxChar}).", | ||
"alertTitle": "Nombre de caractères trop élevé", | ||
@@ -118,3 +118,4 @@ "charLabel": "{count, plural, =1 {1 caractère} other {# caractères}}" | ||
"pager": { | ||
"dropdownTitle": "Nombre d'élément" | ||
"dropdownTitle": "Nombre d'éléments {summary}", | ||
"inputLabel": "Numéro de la page affichée du {summary}" | ||
}, | ||
@@ -144,3 +145,3 @@ "menuActions": { | ||
"sortByTitle": "Trier par {columnTitle} {sortTitle}", | ||
"sortedByTitle": "Trié par {columnTitle}", | ||
"sortedByTitle": "Trié par {columnTitle} {sortTitle}", | ||
"descending": "dans l'ordre décroissant", | ||
@@ -158,6 +159,2 @@ "ascending": "dans l'ordre croissant", | ||
}, | ||
"firstPage": "|< Début", | ||
"prevPage": "< Précédent", | ||
"nextPage": "Suivant >", | ||
"lastPage": "Fin >|", | ||
"inputPage": "Saisie de la page à afficher", | ||
@@ -216,3 +213,3 @@ "10": "10", | ||
"header": { | ||
"logoTitle": "Hornet - Retour vers la page d'accueil", | ||
"logoTitle": "<%= appname %> - Retour vers la page d'accueil", | ||
"contentTitle": "Aller au contenu de l'", | ||
@@ -250,2 +247,5 @@ "menuTitle": "Aller au menu de l'", | ||
}, | ||
"authPage": { | ||
"title": "Authentification" | ||
}, | ||
"contactPage": { | ||
@@ -266,3 +266,3 @@ "title": "Contact", | ||
"required": "Le champ « Email » est obligatoire. Veuillez saisir ce champ.", | ||
"format": "Le format du champ « Email » est incorrect (format attendu: nom@example.com)" | ||
"format": "Le format du champ « Email » est incorrect (format attendu : nom@example.com)" | ||
}, | ||
@@ -269,0 +269,0 @@ "message": { |
@@ -60,3 +60,3 @@ { | ||
"textarea": { | ||
"alertMessage": "Le nombre de caractère renseigné est trop élevé par rapport au nombre maximum ({count}/{maxChar}).", | ||
"alertMessage": "Le nombre de caractères renseignés est trop élevé par rapport au nombre maximum ({count}/{maxChar}).", | ||
"alertTitle": "Nombre de caractères trop élevé", | ||
@@ -103,2 +103,7 @@ "charLabel": "{count, plural, =1 {1 caractère} other {# caractères}}" | ||
}, | ||
"shortcuts": { | ||
"iconTitle": "Informations raccourcis", | ||
"modalTitle": "Accessibilité Tableau", | ||
"modalContentTitle": "Raccourcis clavier" | ||
}, | ||
"toggleColumnsButton": { | ||
@@ -112,3 +117,4 @@ "title": "Colonnes à afficher/masquer" | ||
"pager": { | ||
"dropdownTitle": "Nombre d'élément" | ||
"dropdownTitle": "Nombre d'éléments {summary}", | ||
"inputLabel": "Numéro de la page affichée du {summary}" | ||
}, | ||
@@ -142,3 +148,3 @@ "menuActions": { | ||
"rowNumber": "Lignes : ", | ||
"pageFooter": "Afficher :", | ||
"pageFooter": "Afficher ", | ||
"pageFooterOn": "sur", | ||
@@ -152,6 +158,2 @@ "exportTitle": "Exporter au format {format}", | ||
}, | ||
"firstPage": "|< Début", | ||
"prevPage": "< Précédent", | ||
"nextPage": "Suivant >", | ||
"lastPage": "Fin >|", | ||
"inputPage": "Saisie de la page à afficher", | ||
@@ -163,2 +165,3 @@ "10": "10", | ||
"displayAll": "Afficher tout", | ||
"formatDateInvalid": "Le format du champ « {title} » est incorrect.", | ||
"shortcuts": { | ||
@@ -211,6 +214,6 @@ "iconTitle": "Informations raccourcis", | ||
"logoTitle": "Hornet - Retour vers la page d'accueil", | ||
"contentTitle": "Aller au contenu de l' ", | ||
"menuTitle": "Aller au menu de l' ", | ||
"planTitle": "Plan de l'application l' ", | ||
"accessTitle": "Politique d'accessibilité de l' ", | ||
"contentTitle": "Aller au contenu de l'", | ||
"menuTitle": "Aller au menu de l'", | ||
"planTitle": "Plan de l'", | ||
"accessTitle": "Politique d'accessibilité de l'", | ||
"content": "Aller au contenu", | ||
@@ -226,5 +229,2 @@ "menu": "Aller au menu", | ||
}, | ||
"dropdown": { | ||
"selectAll": "Sélectionner tout" | ||
}, | ||
"navigation": { | ||
@@ -248,2 +248,5 @@ "welcome": "Accueil", | ||
}, | ||
"authPage": { | ||
"title": "Authentification" | ||
}, | ||
"contactPage": { | ||
@@ -264,3 +267,3 @@ "title": "Contact", | ||
"required": "Le champ « Email » est obligatoire. Veuillez saisir ce champ.", | ||
"format": "Le format du champ « Email » est incorrect (format attendu: nom@example.com)" | ||
"format": "Le format du champ « Email » est incorrect (format attendu : nom@example.com)" | ||
}, | ||
@@ -296,2 +299,2 @@ "message": { | ||
} | ||
} | ||
} |
@@ -33,3 +33,3 @@ import { Utils } from "hornet-js-utils"; | ||
let templatedMessage: string = new Template(HornetComponent.getI18n("contactPage.mailTemplate")).process(valuesToWriteIntoMessage, "?"); | ||
let templatedMessage = new Template(HornetComponent.getI18n("contactPage.mailTemplate")).process(valuesToWriteIntoMessage, "?"); | ||
@@ -36,0 +36,0 @@ let mailToSend: NodeMailerMessage = { |
@@ -5,2 +5,10 @@ var http = require("http"); | ||
// https://stackoverflow.com/questions/35453726/trigger-rundeck-job-via-api | ||
//Exemple de test en curl : | ||
// curl -D - -X "POST" -H "Accept: application/json" \ | ||
//-H "Content-Type: application/json" \ | ||
//-H "X-Rundeck-Auth-Token: <TOKEN>" \ | ||
//-d '{"argString":"-arg1 val1 -arg2 val2"}' \ | ||
//http://<URL>/api/16/job/<JOB_ID>/executions | ||
const USAGE = "Usage: node trigger-rundeck.js RUNDECK_HOST RUNDECK_JOB_ID RUNDECK_TOKEN RUNDECK_APP_VERSION"; | ||
@@ -12,7 +20,15 @@ | ||
const INITIAL_WAIT = 15; // secondes | ||
const SUB_WAIT = 5; // secondes | ||
const SUB_WAIT_COUNT = 30; | ||
const SUB_WAIT = 10; // secondes | ||
const SUB_WAIT_COUNT = 60; | ||
var host, jobId, token, version; | ||
console.logCopy = console.log.bind(console); | ||
console.log = function(data) | ||
{ | ||
var currentDate = '[' + new Date().toUTCString() + '] '; | ||
this.logCopy(currentDate, data); | ||
}; | ||
if (process.argv.length !== 6) { | ||
@@ -80,4 +96,4 @@ console.error("Illegal number of parameters"); | ||
var response = JSON.parse(dataChunks.join("")); | ||
console.log("completed:", response.completed); | ||
console.log("executionState:", response.executionState); | ||
console.log("completed : "+ response.completed); | ||
console.log("executionState : "+ response.executionState); | ||
resolve(response.completed ? response.executionState : false); | ||
@@ -90,2 +106,29 @@ }); | ||
function logOutput(id, resolve, reject) { | ||
const OPTIONS = { | ||
host: host, | ||
port: 80, | ||
path: '/api/5/execution/' + id + '/output', | ||
method: 'GET', | ||
headers: { | ||
'Accept': 'text/plain', | ||
'X-Rundeck-Auth-Token': token | ||
} | ||
}; | ||
var dataChunks = []; | ||
var req = http.request(OPTIONS, function (res) { | ||
res.on('data', function (data) { | ||
//stockage de la réponse au fur et à mesure qu'elle nous parvient | ||
dataChunks.push(data); | ||
}); | ||
res.on('end', function () { | ||
console.log("log rundeck : "+ dataChunks); | ||
resolve(); | ||
}); | ||
}); | ||
req.end(); | ||
req.on('error', reject); | ||
} | ||
function waitForEnd(id, countdown) { | ||
@@ -95,11 +138,16 @@ if (countdown) { | ||
status(id, function (completed) { | ||
console.log("Status is:", completed); | ||
console.log("Status is : "+ completed); | ||
if (completed) { | ||
if (completed === "SUCCEEDED") { | ||
console.log("Done."); | ||
process.exit(0); // Done | ||
} else { | ||
console.error("Deployment failed!"); | ||
process.exit(1); // Echéc | ||
} | ||
logOutput(id, () => { | ||
if (completed === "SUCCEEDED") { | ||
console.log("Done."); | ||
process.exit(0); // Done | ||
} else { | ||
console.error("Deployment failed!"); | ||
process.exit(1); // Echéc | ||
} | ||
}, function (error) { | ||
console.error("An error occurs : ", error); | ||
process.exit(1); | ||
}); | ||
} else { | ||
@@ -109,3 +157,3 @@ setTimeout(waitForEnd, SUB_WAIT * 1000, id, countdown - 1); | ||
}, function (error) { | ||
console.error("An error occurs: ", error); | ||
console.error("An error occurs : ", error); | ||
process.exit(1); | ||
@@ -121,6 +169,10 @@ }); | ||
trigger(function (data) { | ||
var id = JSON.parse(data).id; | ||
console.log("Deployment launched with id:", id); | ||
console.log("Waits for", INITIAL_WAIT, "seconds"); | ||
setTimeout(waitForEnd, INITIAL_WAIT * 1000, id, SUB_WAIT_COUNT); | ||
var res = JSON.parse(data); | ||
if(res.error){ | ||
console.log("An error occurs : "+ res.message); | ||
}else{ | ||
console.log("Deployment launched with id : "+ res.id); | ||
console.log("Waits for "+ INITIAL_WAIT+ " seconds"); | ||
setTimeout(waitForEnd, INITIAL_WAIT * 1000, res.id, SUB_WAIT_COUNT); | ||
} | ||
}, function (error) { | ||
@@ -132,3 +184,2 @@ console.error("An error occurs: ", error); | ||
main(); | ||
main(); |
{ | ||
"name": "generator-hornet-js", | ||
"version": "5.1.1", | ||
"version": "5.2.0", | ||
"description": "Générateur de projet d'application web Hornet JS", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
580870
88
4225
1