@adonisjs/session 7.0.0-7 → 7.0.0-9
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/build/configure.js
CHANGED
|
@@ -24,10 +24,18 @@ export async function configure(command) {
|
|
|
24
24
|
*/
|
|
25
25
|
await codemods.defineEnvValidations({
|
|
26
26
|
variables: {
|
|
27
|
-
SESSION_DRIVER: `Env.schema.enum(['cookie', 'redis', 'file', 'memory' as const
|
|
27
|
+
SESSION_DRIVER: `Env.schema.enum(['cookie', 'redis', 'file', 'memory'] as const)`,
|
|
28
28
|
},
|
|
29
29
|
leadingComment: 'Variables for configuring session package',
|
|
30
30
|
});
|
|
31
|
+
/**
|
|
32
|
+
* Register middleware
|
|
33
|
+
*/
|
|
34
|
+
await codemods.registerMiddleware('router', [
|
|
35
|
+
{
|
|
36
|
+
path: '@adonisjs/session/session_middleware',
|
|
37
|
+
},
|
|
38
|
+
]);
|
|
31
39
|
/**
|
|
32
40
|
* Register provider
|
|
33
41
|
*/
|
|
@@ -61,11 +61,11 @@ export const edgePluginAdonisJSSession = (edge) => {
|
|
|
61
61
|
/**
|
|
62
62
|
* Write an if statement
|
|
63
63
|
*/
|
|
64
|
-
buffer.writeStatement(`if (!!state.flashMessages.get('errors')[${key}]) {`, token.filename, token.loc.start.line);
|
|
64
|
+
buffer.writeStatement(`if (!!state.flashMessages.get('errors', {})[${key}]) {`, token.filename, token.loc.start.line);
|
|
65
65
|
/**
|
|
66
66
|
* Define a local variable
|
|
67
67
|
*/
|
|
68
|
-
buffer.writeExpression(`let messages = state.flashMessages.get('errors')[${key}]`, token.filename, token.loc.start.line);
|
|
68
|
+
buffer.writeExpression(`let messages = state.flashMessages.get('errors', {})[${key}]`, token.filename, token.loc.start.line);
|
|
69
69
|
/**
|
|
70
70
|
* Create a local variables scope and tell the parser about
|
|
71
71
|
* the existence of the "messages" variable
|
package/build/src/store.js
CHANGED
|
@@ -29,7 +29,11 @@ export class ReadOnlyStore {
|
|
|
29
29
|
* Get value for a given key
|
|
30
30
|
*/
|
|
31
31
|
get(key, defaultValue) {
|
|
32
|
-
|
|
32
|
+
const value = lodash.get(this.values, key);
|
|
33
|
+
if (defaultValue !== undefined && (value === null || value === undefined)) {
|
|
34
|
+
return defaultValue;
|
|
35
|
+
}
|
|
36
|
+
return value;
|
|
33
37
|
}
|
|
34
38
|
/**
|
|
35
39
|
* A boolean to know if value exists. Extra guards to check
|
package/build/stubs/config.stub
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/session",
|
|
3
3
|
"description": "Session provider for AdonisJS",
|
|
4
|
-
"version": "7.0.0-
|
|
4
|
+
"version": "7.0.0-9",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18.16.0"
|
|
7
7
|
},
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
],
|
|
19
19
|
"exports": {
|
|
20
20
|
".": "./build/index.js",
|
|
21
|
+
"./factories": "./build/factories/main.js",
|
|
21
22
|
"./session_provider": "./build/providers/session_provider.js",
|
|
22
23
|
"./session_middleware": "./build/src/session_middleware.js",
|
|
23
24
|
"./client": "./build/src/client.js",
|
|
@@ -41,12 +42,14 @@
|
|
|
41
42
|
},
|
|
42
43
|
"devDependencies": {
|
|
43
44
|
"@adonisjs/assembler": "^6.1.3-18",
|
|
44
|
-
"@adonisjs/core": "^6.1.5-
|
|
45
|
+
"@adonisjs/core": "^6.1.5-24",
|
|
45
46
|
"@adonisjs/eslint-config": "^1.1.8",
|
|
46
47
|
"@adonisjs/prettier-config": "^1.1.8",
|
|
47
48
|
"@adonisjs/redis": "^8.0.0-10",
|
|
48
49
|
"@adonisjs/tsconfig": "^1.1.8",
|
|
50
|
+
"@japa/api-client": "^2.0.0-0",
|
|
49
51
|
"@japa/assert": "^2.0.0-1",
|
|
52
|
+
"@japa/browser-client": "^2.0.0-3",
|
|
50
53
|
"@japa/file-system": "^2.0.0-1",
|
|
51
54
|
"@japa/plugin-adonisjs": "^2.0.0-1",
|
|
52
55
|
"@japa/runner": "^3.0.0-6",
|
|
@@ -65,6 +68,7 @@
|
|
|
65
68
|
"github-label-sync": "^2.3.1",
|
|
66
69
|
"husky": "^8.0.3",
|
|
67
70
|
"np": "^8.0.4",
|
|
71
|
+
"playwright": "^1.37.1",
|
|
68
72
|
"prettier": "^3.0.2",
|
|
69
73
|
"set-cookie-parser": "^2.6.0",
|
|
70
74
|
"supertest": "^6.3.3",
|