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

generator-hornet-js-lite

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-hornet-js-lite - npm Package Compare versions

Comparing version 5.2.1 to 5.2.2

1

generators/app/templates/_package.json

@@ -30,3 +30,2 @@ {

"sha1": "1.1.1",
"chart.js": "2.6.0",
"pg": "6.0.1",

@@ -33,0 +32,0 @@ "pg-hstore": "2.3.2",

33

generators/app/templates/config/default.json

@@ -221,18 +221,19 @@ {

"loginUrl": "/login",
"logoutUrl": "/logout"
// "saml": {
// "enabled": false,
// "configuration": {
// "hostUrlReturnTo": "http://localhost:8889",
// "callbackUrl": "/login",
// "logoutCallbackUrl": "/logout",
// "issuer": "http://localhost:8889/<%= slugify(appname) %>",
// "idp": [
// {
// "name": "idp",
// "shibbolethUrl": "./config/idp/arobas/idp-metadata.xml",
// "httpsCert": "./config/cert/arobas/arobas.dev.diplomatie.gouv.fr"
// }
// ]
// }
"logoutUrl": "/logout" /*,
"saml": {
"enabled": false,
"configuration": {
"hostUrlReturnTo": "http://localhost:8889",
"callbackUrl": "/login",
"logoutCallbackUrl": "/logout",
"issuer": "http://localhost:8889/<%= slugify(appname) %>",
"idp": [
{
"name": "idp",
"shibbolethUrl": "./config/idp/arobas/idp-metadata.xml",
"httpsCert": "./config/cert/arobas/arobas.dev.diplomatie.gouv.fr"
}
]
}
}*/
},

@@ -239,0 +240,0 @@ "request": {

@@ -6,3 +6,3 @@ {

"pattern": ".yyyy-MM-dd",
"filename":"/var/log/nodejs/#{INSTANCE_NAME}/#{INSTANCE_NAME}.log",
"filename":"#{NODE_LOG_DIR}-#{INSTANCE}/#{APPLICATION_CONTEXT_ROOT}/#{APPLICATION_CONTEXT_ROOT}.log",
"layout": {

@@ -13,3 +13,3 @@ "type": "pattern",

"compress": true,
"keepFileExt": true
"keepFileExt": false
}

@@ -16,0 +16,0 @@ },

@@ -45,3 +45,3 @@ const promptDirectory = require("inquirer-directory");

plop.setGenerator("add lazy route", {
description: "ajout des différent composants pour une route de type page",
description: "ajout des différents composants pour une route de type page",
prompts: [

@@ -81,5 +81,14 @@ {

],
actions: [{
actions: ( data ) => {
let directory = ""
if(data.repertoire && data.groupe){
directory = data.repertoire + "/" + data.groupe
}else{
directory = "{{repertoire}}{{groupe}}"
}
let actions = [{
type: "add",
path: "./src/routes/{{repertoire}}{{groupe}}/{{snakeCase routeClass}}.ts",
path: "./src/routes/"+ directory + "/{{snakeCase routeClass}}.ts",
templateFile: "plop-templates/route.hbs"

@@ -90,7 +99,9 @@ }, {

pattern: /(\s+}\s*})$/mg,
template: "\nthis.addLazyRoutes(\"/{{url}}\", \"{{repertoire}}{{groupe}}/{{snakeCase routeClass}}\");\n$1"
template: "\nthis.addLazyRoutes(\"/{{url}}\", \""+ directory+ "/{{snakeCase routeClass}}\");\n$1"
}]
return actions}
});
plop.setGenerator("new page route", {
description: "ajout des différent composants pour une route de type page",
description: "ajout des différents composants pour une route de type page",
prompts: [

@@ -114,3 +125,3 @@ {

default: "get",
choices: [{name: "get", value: "get"}, {name: "post", value: "post"}, {name: "update", value: "update"}, {name: "put", value: "put"}, {name: "delete", value: "delete"}]
choices: [{name: "get", value: "get"}, {name: "post", value: "post"}, {name: "patch", value: "patch"}, {name: "put", value: "put"}, {name: "delete", value: "delete"}]
},

@@ -138,5 +149,5 @@ {

type: "input",
name: "pageClassDescription",
name: "servicePageClassDescription",
message: "description de la page",
validate: isNotEmptyFor( "pageClassDescription" ),
validate: isNotEmptyFor( "servicePageClassDescription" ),
when: data => data.createPageClass

@@ -167,5 +178,5 @@ },

type: "input",
name: "sevicePageClass",
name: "servicePageClass",
message: "nom de la classe de service page",
validate: isNotEmptyFor( "sevicePageClass" ),
validate: isNotEmptyFor( "servicePageClass" ),
filter: ensureSuffixe("ServicePage", true)

@@ -204,5 +215,19 @@ },

let pageDirectory ="";
if(data.pageDirectory && data.creatPathPage){
pageDirectory = data.pageDirectory + "/" + data.creatPathPage
}else{
pageDirectory = "{{pageDirectory}}{{creatPathPage}}"
}
let serviceDirectory ="";
if(data.serviceDirectory && data.creatPathService){
serviceDirectory = data.serviceDirectory + "/" + data.creatPathService
}else{
serviceDirectory = "{{serviceDirectory}}{{creatPathService}}"
}
let templateImportPage = "";
if(data.createPageClass) {
templateImportPage = "import { {{pageClass}} } from \"src/views/{{pageDirectory}}{{creatPathPage}}/{{snakeCase pageClass}}\";\n$1";
templateImportPage = "import { {{pageClass}} } from \"src/views/"+ pageDirectory+ "/{{snakeCase pageClass}}\";\n$1";
} else {

@@ -214,5 +239,5 @@ templateImportPage = "import { {{pageClass}} } from \"src/views/{{unixPathCase pageFile}}\";\n$1";

if (data.createServiceClass) {
templateImportServicePage = "import { {{sevicePageClass}} } from \"src/services/page/{{serviceDirectory}}{{creatPathService}}/{{snakeCase sevicePageClass}}\";\n$1";
templateImportServicePage = "import { {{servicePageClass}} } from \"src/services/page/"+ serviceDirectory +"/{{snakeCase servicePageClass}}\";\n$1";
} else {
templateImportServicePage = "import { {{sevicePageClass}} } from \"src/services/page/{{unixPathCase serviceFile}}\";\n$1";
templateImportServicePage = "import { {{servicePageClass}} } from \"src/services/page/{{unixPathCase serviceFile}}\";\n$1";
}

@@ -224,7 +249,7 @@

pattern: /(\s+}\s*})$/mg,
template: "\nthis.addPageRoute(\"/{{url}}\",\n() => new PageRouteInfos({{camelCase pageClass}}, null, Injector.getRegistered({{camelCase sevicePageClass}})),\nRoles.{{role}}\n);$1"
template: "\nthis.addPageRoute(\"/{{url}}\",\n() => new PageRouteInfos({{camelCase pageClass}}, null, Injector.getRegistered({{camelCase servicePageClass}})),\nRoles.{{role}}\n);$1"
},{
type: "modify",
path: "./src/routes/{{routeFile}}",
pattern: /(export default class)/mg,
pattern: /(export class|export default class)/mg,
template: templateImportPage

@@ -234,3 +259,3 @@ },{

path: "./src/routes/{{routeFile}}",
pattern: /(export default class)/mg,
pattern: /(export class|export default class)/mg,
template: templateImportServicePage

@@ -242,3 +267,3 @@ }]

type: "add",
path: "./src/views/{{pageDirectory}}{{creatPathPage}}/{{snakeCase pageClass}}.tsx",
path: "./src/views/"+ pageDirectory +"/{{snakeCase pageClass}}.tsx",
templateFile: "plop-templates/page.hbs"

@@ -251,3 +276,3 @@ });

type: "add",
path: "./src/services/page/{{serviceDirectory}}{{creatPathService}}/{{snakeCase sevicePageClass}}.ts",
path: "./src/services/page/"+ serviceDirectory +"/{{snakeCase servicePageClass}}.ts",
templateFile: "plop-templates/service-page.hbs"

@@ -262,3 +287,3 @@ });

plop.setGenerator("new data route", {
description: "ajout des différent composants pour une route de type data",
description: "ajout des différents composants pour une route de type data",
prompts: [

@@ -282,3 +307,3 @@ {

default: "get",
choices: [{name: "get", value: "get"}, {name: "post", value: "post"}, {name: "update", value: "update"}, {name: "put", value: "put"}, {name: "delete", value: "delete"}]
choices: [{name: "get", value: "get"}, {name: "post", value: "post"}, {name: "patch", value: "patch"}, {name: "put", value: "put"}, {name: "delete", value: "delete"}]

@@ -329,3 +354,3 @@ },

message: "fichier contenant la classe d'action'",
basePath: "./src/action",
basePath: "./src/actions",
ext: ".ts",

@@ -336,5 +361,5 @@ when: data => !data.createActionClass

type: "input",
name: "seviceDataClass",
name: "serviceDataClass",
message: "nom de la classe de service data",
validate: isNotEmptyFor( "seviceDataClass" ),
validate: isNotEmptyFor( "serviceDataClass" ),
filter: ensureSuffixe("ServiceData", true)

@@ -349,2 +374,9 @@ },

{
type: "input",
name: "serviceDataClassDescription",
message: "description de la page",
validate: isNotEmptyFor( "serviceDataClassDescription" ),
when: data => data.createServiceClass
},
{
type: "directory",

@@ -374,5 +406,19 @@ name: "serviceDirectory",

let actionDirectory ="";
if(data.actionDirectory && data.creatPathAction){
actionDirectory = data.actionDirectory + "/" + data.creatPathAction
}else{
actionDirectory = "{{actionDirectory}}{{creatPathAction}}"
}
let serviceDirectory ="";
if(data.serviceDirectory && data.creatPathService){
serviceDirectory = data.serviceDirectory + "/" + data.creatPathService
}else{
serviceDirectory = "{{serviceDirectory}}{{creatPathService}}"
}
let templateImportAction = "";
if(data.createActionClass) {
templateImportAction = "import { {{actionClass}} } from \"src/actions/{{pageDirectory}}{{creatPathPage}}/{{snakeCase actionClass}}\";\n$1";
templateImportAction = "import { {{actionClass}} } from \"src/actions/"+ actionDirectory +"/{{snakeCase actionClass}}\";\n$1";
} else {

@@ -384,5 +430,5 @@ templateImportAction = "import { {{actionClass}} } from \"src/actions/{{unixPathCase actionFile}}\";\n$1";

if (data.createServiceClass) {
templateImportServiceData = "import { {{seviceDataClass}} } from \"src/services/data/{{serviceDirectory}}{{creatPathService}}/{{snakeCase seviceDataClass}}\";\n$1";
templateImportServiceData = "import { {{serviceDataClass}} } from \"src/services/data/"+ serviceDirectory +"/{{snakeCase serviceDataClass}}\";\n$1";
} else {
templateImportServiceData = "import { {{seviceDataClass}} } from \"src/services/data/{{unixPathCase serviceFile}}\";\n$1";
templateImportServiceData = "import { {{serviceDataClass}} } from \"src/services/data/{{unixPathCase serviceFile}}\";\n$1";
}

@@ -394,7 +440,7 @@

pattern: /(\s+}\s*})$/mg,
template: "\nthis.addDataRoute(\"/{{url}}\",\n(/*route parameter*/) => new DataRouteInfos({{camelCase actionClass}}, null, Injector.getRegistered({{camelCase seviceDataClass}})),\nRoles.{{role}}, \"{{verb}}\"\n);$1"
template: "\nthis.addDataRoute(\"/{{url}}\",\n(/*route parameter*/) => new DataRouteInfos({{camelCase actionClass}}, null, Injector.getRegistered({{camelCase serviceDataClass}})),\nRoles.{{role}}, \"{{verb}}\"\n);$1"
},{
type: "modify",
path: "./src/routes/{{routeFile}}",
pattern: /(export default class)/mg,
pattern: /(export class|export default class)/mg,
template: templateImportAction

@@ -404,3 +450,3 @@ },{

path: "./src/routes/{{routeFile}}",
pattern: /(export default class)/mg,
pattern: /(export class|export default class)/mg,
template: templateImportServiceData

@@ -411,3 +457,3 @@ }]

type: "add",
path: "./src/actions/{{actionDirectory}}{{creatPathAction}}/{{snakeCase actionClass}}.ts",
path: "./src/actions/"+ actionDirectory +"/{{snakeCase actionClass}}.ts",
templateFile: "plop-templates/action.hbs"

@@ -419,3 +465,3 @@ });

type: "add",
path: "./src/services/data/{{serviceDirectory}}{{creatPathService}}/{{snakeCase seviceDataClass}}.ts",
path: "./src/services/data/"+ serviceDirectory +"/{{snakeCase serviceDataClass}}.ts",
templateFile: "plop-templates/service-data.hbs"

@@ -422,0 +468,0 @@ });

@@ -1,2 +0,2 @@

import { AbstractRoutes, PageRouteInfos, PUBLIC_ROUTE } from "hornet-js-core/src/routes/abstract-routes";
import { AbstractRoutes, PageRouteInfos, DataRouteInfos, PUBLIC_ROUTE } from "hornet-js-core/src/routes/abstract-routes";
import { URL_CONTACT } from "src/utils/urls";

@@ -11,2 +11,4 @@ import { HomePage } from "src/views/gen/gen-hom-page";

const logger: Logger = Utils.getLogger("<%= slugify(appname) %>.routes.routes");
import { Injector } from "hornet-js-core/src/inject/injector";
import { Roles } from "src/utils/roles";

@@ -17,6 +19,6 @@ export class Routes extends AbstractRoutes {

super();
if(Utils.isServer){
if (Utils.isServer) {
this.addClientRoutes();
this.addServerRoutes();
}else{
}else {
this.addClientRoutes();

@@ -26,23 +28,23 @@ }

public addClientRoutes(){
public addClientRoutes() {
/* Routes des pages */
this.addPageRoute("/accueil",
() => new PageRouteInfos(HomePage),
PUBLIC_ROUTE
() => new PageRouteInfos(HomePage),
PUBLIC_ROUTE,
);
this.addPageRoute("/aide",
() => new PageRouteInfos(AidePage),
PUBLIC_ROUTE
() => new PageRouteInfos(AidePage),
PUBLIC_ROUTE,
);
this.addPageRoute("/planAppli",
() => new PageRouteInfos(PlanAppliPage),
PUBLIC_ROUTE
() => new PageRouteInfos(PlanAppliPage),
PUBLIC_ROUTE,
);
this.addPageRoute("/politiqueAccessibilite",
() => new PageRouteInfos(AccessibilitePage),
PUBLIC_ROUTE
() => new PageRouteInfos(AccessibilitePage),
PUBLIC_ROUTE,
);
this.addPageRoute("/declarationConformite",
() => new PageRouteInfos(DeclarationconformitePage),
PUBLIC_ROUTE
() => new PageRouteInfos(DeclarationconformitePage),
PUBLIC_ROUTE,
);

@@ -54,5 +56,5 @@

public addServerRoutes(){
public addServerRoutes() {
this.addLazyRoutes(URL_CONTACT, "cnt/gen-cnt-server-routes");
}
}
{
"name": "generator-hornet-js-lite",
"version": "5.2.1",
"version": "5.2.2",
"description": "Générateur de projet d'application web Hornet JS Lite",

@@ -5,0 +5,0 @@ "keywords": [

@@ -56,5 +56,5 @@ # generator-hornet-js-lite

* ` Description de votre projet ` : un texte court présentant succintement le projet.
* ` Version du framework (hornet-js):` `(5.2.1)` : version du framework hornet-js (`5.2.1` par défaut identique à generator-hornet-js).
* ` Version du framework (hornet-js):` `(5.2.2)` : version du framework hornet-js (`5.2.2` par défaut identique à generator-hornet-js).
* ` Theme de l'application, ex : hornet-themes-intranet (hornet-themes-[NOM_THEME]) ` : theme sous forme de projet et dépendance
* ` Version du theme de l'application (5.2.1)` : version du projet theme
* ` Version du theme de l'application (5.2.2)` : version du projet theme

@@ -61,0 +61,0 @@ Le processus d'initialisation vous indique ensuite les fichiers créés :

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

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