@itrocks/framework 0.4.3 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/main.js +5 -1
- package/package.json +2 -2
package/cjs/main.js
CHANGED
|
@@ -15,8 +15,10 @@ const request_response_1 = require("@itrocks/request-response");
|
|
|
15
15
|
const route_1 = require("@itrocks/route");
|
|
16
16
|
const store_1 = require("@itrocks/store");
|
|
17
17
|
const template_1 = require("@itrocks/template");
|
|
18
|
+
const node_crypto_1 = require("node:crypto");
|
|
18
19
|
const node_path_1 = require("node:path");
|
|
19
20
|
const node_path_2 = require("node:path");
|
|
21
|
+
const ephemeralSessionSecret = (0, node_crypto_1.randomBytes)(32).toString('base64url');
|
|
20
22
|
template_1.frontScripts.push('/lib/air-datepicker/locale/en.js', '/lib/air-datepicker/locale/fr.js');
|
|
21
23
|
async function execute(request) {
|
|
22
24
|
// Access control
|
|
@@ -63,14 +65,16 @@ async function run() {
|
|
|
63
65
|
});
|
|
64
66
|
const server = new fastify_1.FastifyServer({
|
|
65
67
|
assetPath: app_dir_1.appDir,
|
|
68
|
+
cookie: config_1.config.session.cookie,
|
|
66
69
|
execute: request => execute(new action_request_2.Request(request)),
|
|
67
70
|
favicon: config_1.config.container?.favicon ?? (0, node_path_2.normalize)((0, node_path_1.join)(__dirname, '../favicon.png')),
|
|
68
71
|
frontScripts: template_1.frontScripts,
|
|
69
72
|
host: config_1.config.server.host,
|
|
70
73
|
manifest: config_1.config.container?.manifest,
|
|
71
74
|
port: config_1.config.server.port,
|
|
75
|
+
rolling: config_1.config.session.rolling,
|
|
72
76
|
scriptCalls: ['loadCss', 'loadScript'],
|
|
73
|
-
secret: config_1.config.session.secret ?? config_1.config.secret ??
|
|
77
|
+
secret: config_1.config.session.secret ?? config_1.config.secret ?? ephemeralSessionSecret,
|
|
74
78
|
secure: config_1.config.server.secure ?? 'auto',
|
|
75
79
|
store: new fastify_file_session_store_1.FileStore((0, node_path_2.normalize)((0, node_path_1.join)(app_dir_1.appDir, config_1.config.session.path)))
|
|
76
80
|
});
|
package/package.json
CHANGED
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"scripts": {
|
|
100
100
|
"build": "npm run build:back && npm run build:front",
|
|
101
101
|
"build:back": "tsc",
|
|
102
|
-
"build:front": "tsc -p src/front/tsconfig.json &&
|
|
102
|
+
"build:front": "tsc -p src/front/tsconfig.json && node -e \"const fs=require('node:fs');for(const file of fs.readdirSync('.').filter(file=>file.endsWith('.js')||file.endsWith('.d.ts')))fs.writeFileSync(file,fs.readFileSync(file,'utf8').replaceAll('../../',''))\""
|
|
103
103
|
},
|
|
104
|
-
"version": "0.
|
|
104
|
+
"version": "0.6.0"
|
|
105
105
|
}
|