@guren/orm 1.0.0-rc.19 → 1.0.0-rc.20
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/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,11 +6,12 @@ if (!marker) {
|
|
|
6
6
|
globalScope[INSTANCE_KEY] = { count: 1, warned: false };
|
|
7
7
|
} else {
|
|
8
8
|
marker.count += 1;
|
|
9
|
-
|
|
9
|
+
const quiet = typeof process !== "undefined" && process.env.GUREN_QUIET_DUPLICATE_ORM === "1";
|
|
10
|
+
if (!marker.warned && !quiet) {
|
|
10
11
|
marker.warned = true;
|
|
11
12
|
console.warn(
|
|
12
13
|
`[guren/orm] ${marker.count} copies of @guren/orm are loaded in this process. Adapter configuration and model state are NOT shared between copies, so database access will fail with "database has not been configured" for models imported through the extra copy.
|
|
13
|
-
[guren/orm] This usually means mixed @guren/* versions (check \`bun pm ls | grep @guren\`). Fix it by aligning all @guren/* packages to the same release, e.g. \`bunx guren upgrade\` or updating every @guren/* entry in package.json together, then reinstalling.`
|
|
14
|
+
[guren/orm] This usually means mixed @guren/* versions (check \`bun pm ls | grep @guren\`). Fix it by aligning all @guren/* packages to the same release, e.g. \`bunx guren upgrade\` or updating every @guren/* entry in package.json together, then reinstalling. Set GUREN_QUIET_DUPLICATE_ORM=1 to silence this warning (e.g. monorepo dev where src and dist copies coexist by design).`
|
|
14
15
|
);
|
|
15
16
|
}
|
|
16
17
|
}
|