remult 0.27.18 → 0.27.19
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/esm/server/initAsyncHooks.js +1 -0
- package/esm/server/remult-api-server.js +1 -1
- package/esm/src/context.js +2 -1
- package/esm/src/remult3/remult3.js +2 -22
- package/package.json +1 -1
- package/server/initAsyncHooks.d.ts +1 -0
- package/server/initAsyncHooks.js +1 -0
- package/server/remult-api-server.js +3 -1
- package/src/context.d.ts +1 -0
- package/src/context.js +3 -2
- package/src/remult3/remult3.js +2 -22
|
@@ -335,7 +335,7 @@ export class RemultServerImplementation {
|
|
|
335
335
|
await what(remult, myReq, myRes, genReq, origRes, req);
|
|
336
336
|
}
|
|
337
337
|
finally {
|
|
338
|
-
|
|
338
|
+
remultStatic.asyncContext.setInInitRequest(false);
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
});
|
package/esm/src/context.js
CHANGED
|
@@ -39,7 +39,8 @@ export class RemultAsyncLocalStorage {
|
|
|
39
39
|
const store = this.remultObjectStorage?.getStore();
|
|
40
40
|
if (!store)
|
|
41
41
|
return;
|
|
42
|
-
|
|
42
|
+
if (val || this.remultObjectStorage?.isStub)
|
|
43
|
+
store.inInitRequest = val;
|
|
43
44
|
}
|
|
44
45
|
getStore() {
|
|
45
46
|
if (!this.remultObjectStorage) {
|
|
@@ -19,24 +19,11 @@ export const flags = {
|
|
|
19
19
|
};
|
|
20
20
|
/*p1 - create-remult discussion
|
|
21
21
|
|
|
22
|
-
p1 -
|
|
23
|
-
- yes, `remult.initUser` - the url will be /api/me
|
|
24
|
-
- ask to add a todo example
|
|
22
|
+
p1 - ask to add a todo example
|
|
25
23
|
- admin question
|
|
26
24
|
- ask to add a user table + password hash
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
- test angular with auth
|
|
30
|
-
- check nextauth if the env variable should be called NEXTAUTH_SECRET or just AUTH_SECRET
|
|
31
|
-
/** @type {import('next').NextConfig}
|
|
32
|
-
const nextConfig = {
|
|
33
|
-
experimental: {
|
|
34
|
-
serverComponentsExternalPackages: ["knex"],
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export default nextConfig;
|
|
39
|
-
|
|
26
|
+
|
|
40
27
|
p1 - Landing page:
|
|
41
28
|
- p2 include the selections (react,vite, postgres,auth)
|
|
42
29
|
- include server is alive test (remind to run dev-node)
|
|
@@ -48,13 +35,6 @@ export default nextConfig;
|
|
|
48
35
|
- the selections
|
|
49
36
|
- how to run dev
|
|
50
37
|
- which environment variables to set
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- should we add admin? ensureSchema:false etc...
|
|
54
|
-
- should we read existing database?
|
|
55
|
-
- knex issue with next
|
|
56
|
-
|
|
57
|
-
|
|
58
38
|
*/
|
|
59
39
|
//p1 - add aggregate to query
|
|
60
40
|
//p1 - add parameter all to deleteMany, and updateMany
|
package/package.json
CHANGED
|
@@ -14,6 +14,7 @@ export declare class SequentialRemultAsyncLocalStorageCore<T> implements RemultA
|
|
|
14
14
|
currentValue?: T;
|
|
15
15
|
}
|
|
16
16
|
export declare class StubRemultAsyncLocalStorageCore<T> implements RemultAsyncLocalStorageCore<T> {
|
|
17
|
+
isStub: boolean;
|
|
17
18
|
wasImplemented: "yes";
|
|
18
19
|
run<R>(store: T, callback: () => Promise<R>): Promise<R>;
|
|
19
20
|
getStore(): T | undefined;
|
package/server/initAsyncHooks.js
CHANGED
|
@@ -140,6 +140,7 @@ var SequentialRemultAsyncLocalStorageCore = /** @class */ (function () {
|
|
|
140
140
|
exports.SequentialRemultAsyncLocalStorageCore = SequentialRemultAsyncLocalStorageCore;
|
|
141
141
|
var StubRemultAsyncLocalStorageCore = /** @class */ (function () {
|
|
142
142
|
function StubRemultAsyncLocalStorageCore() {
|
|
143
|
+
this.isStub = true;
|
|
143
144
|
this.wasImplemented = 'yes';
|
|
144
145
|
this.lastPromise = Promise.resolve(undefined);
|
|
145
146
|
}
|
|
@@ -634,7 +634,9 @@ var RemultServerImplementation = /** @class */ (function () {
|
|
|
634
634
|
case 7:
|
|
635
635
|
_a.sent();
|
|
636
636
|
return [3 /*break*/, 9];
|
|
637
|
-
case 8:
|
|
637
|
+
case 8:
|
|
638
|
+
remult_static_js_1.remultStatic.asyncContext.setInInitRequest(false);
|
|
639
|
+
return [7 /*endfinally*/];
|
|
638
640
|
case 9: return [2 /*return*/];
|
|
639
641
|
}
|
|
640
642
|
});
|
package/src/context.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export type RemultAsyncLocalStorageCore<T> = {
|
|
|
24
24
|
run<R>(store: T, callback: () => Promise<R>): Promise<R>;
|
|
25
25
|
getStore(): T | undefined;
|
|
26
26
|
wasImplemented: 'yes';
|
|
27
|
+
isStub?: boolean;
|
|
27
28
|
};
|
|
28
29
|
export declare function isBackend(): boolean;
|
|
29
30
|
export declare class Remult {
|
package/src/context.js
CHANGED
|
@@ -49,11 +49,12 @@ var RemultAsyncLocalStorage = /** @class */ (function () {
|
|
|
49
49
|
return (_b = (_a = this.remultObjectStorage) === null || _a === void 0 ? void 0 : _a.getStore()) === null || _b === void 0 ? void 0 : _b.inInitRequest;
|
|
50
50
|
};
|
|
51
51
|
RemultAsyncLocalStorage.prototype.setInInitRequest = function (val) {
|
|
52
|
-
var _a;
|
|
52
|
+
var _a, _b;
|
|
53
53
|
var store = (_a = this.remultObjectStorage) === null || _a === void 0 ? void 0 : _a.getStore();
|
|
54
54
|
if (!store)
|
|
55
55
|
return;
|
|
56
|
-
|
|
56
|
+
if (val || ((_b = this.remultObjectStorage) === null || _b === void 0 ? void 0 : _b.isStub))
|
|
57
|
+
store.inInitRequest = val;
|
|
57
58
|
};
|
|
58
59
|
RemultAsyncLocalStorage.prototype.getStore = function () {
|
|
59
60
|
if (!this.remultObjectStorage) {
|
package/src/remult3/remult3.js
CHANGED
|
@@ -22,24 +22,11 @@ exports.flags = {
|
|
|
22
22
|
};
|
|
23
23
|
/*p1 - create-remult discussion
|
|
24
24
|
|
|
25
|
-
p1 -
|
|
26
|
-
- yes, `remult.initUser` - the url will be /api/me
|
|
27
|
-
- ask to add a todo example
|
|
25
|
+
p1 - ask to add a todo example
|
|
28
26
|
- admin question
|
|
29
27
|
- ask to add a user table + password hash
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
- test angular with auth
|
|
33
|
-
- check nextauth if the env variable should be called NEXTAUTH_SECRET or just AUTH_SECRET
|
|
34
|
-
/** @type {import('next').NextConfig}
|
|
35
|
-
const nextConfig = {
|
|
36
|
-
experimental: {
|
|
37
|
-
serverComponentsExternalPackages: ["knex"],
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default nextConfig;
|
|
42
|
-
|
|
29
|
+
|
|
43
30
|
p1 - Landing page:
|
|
44
31
|
- p2 include the selections (react,vite, postgres,auth)
|
|
45
32
|
- include server is alive test (remind to run dev-node)
|
|
@@ -51,13 +38,6 @@ export default nextConfig;
|
|
|
51
38
|
- the selections
|
|
52
39
|
- how to run dev
|
|
53
40
|
- which environment variables to set
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- should we add admin? ensureSchema:false etc...
|
|
57
|
-
- should we read existing database?
|
|
58
|
-
- knex issue with next
|
|
59
|
-
|
|
60
|
-
|
|
61
41
|
*/
|
|
62
42
|
//p1 - add aggregate to query
|
|
63
43
|
//p1 - add parameter all to deleteMany, and updateMany
|