@primate/core 0.8.0 → 0.8.1
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.
|
@@ -7,7 +7,7 @@ export default function plugin_client_routes(app) {
|
|
|
7
7
|
build.onResolve({ filter: /.*/ }, async (args) => {
|
|
8
8
|
if (args.pluginData === "primate-client-route-inner")
|
|
9
9
|
return null;
|
|
10
|
-
if (intercept(args, app.
|
|
10
|
+
if (intercept(args, app.root))
|
|
11
11
|
return null;
|
|
12
12
|
const result = await build.resolve(args.path, {
|
|
13
13
|
resolveDir: args.resolveDir,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FileRef } from "@rcompat/fs";
|
|
2
2
|
import type { OnResolveArgs } from "esbuild";
|
|
3
|
-
export default function intercept(args: OnResolveArgs,
|
|
3
|
+
export default function intercept(args: OnResolveArgs, root: FileRef): boolean;
|
|
4
4
|
//# sourceMappingURL=intercept.d.ts.map
|
|
@@ -17,8 +17,10 @@ function is_npm_package(path, resolve_dir) {
|
|
|
17
17
|
return false;
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
-
export default function intercept(args,
|
|
21
|
-
if (!args.resolveDir.startsWith(
|
|
20
|
+
export default function intercept(args, root) {
|
|
21
|
+
if (!args.resolveDir.startsWith(root.path))
|
|
22
|
+
return true;
|
|
23
|
+
if (args.resolveDir.includes("node_modules"))
|
|
22
24
|
return true;
|
|
23
25
|
if (is_bare(args.path))
|
|
24
26
|
return true;
|
package/lib/private/errors.js
CHANGED
|
@@ -151,7 +151,7 @@ function session_id_string() {
|
|
|
151
151
|
return t `session store session_id must be a string type`;
|
|
152
152
|
}
|
|
153
153
|
function session_id_data() {
|
|
154
|
-
return t `
|
|
154
|
+
return t `both ${"id"} and ${"data"} must be defined or undefined`;
|
|
155
155
|
}
|
|
156
156
|
function session_handle_unavailable() {
|
|
157
157
|
return t `session handle not available in this context`;
|
|
@@ -53,7 +53,7 @@ export default function session_module(config) {
|
|
|
53
53
|
db_id = _id;
|
|
54
54
|
}
|
|
55
55
|
const session_type = p.omit(store.schema, "id", "session_id");
|
|
56
|
-
const session = new SessionHandle(sid, data, session_type);
|
|
56
|
+
const session = new SessionHandle(exists ? sid : undefined, data, session_type);
|
|
57
57
|
const response = await new Promise((resolve, reject) => {
|
|
58
58
|
storage().run(session, async () => {
|
|
59
59
|
try {
|