⬆️(yhub) align @y/y dependency

we have to import @y/y dependency, we use it in the migration part of
the application and @y/hub is also using it. This can lead to a
situation where 2 versions of @y/y are installed, this is not something
we want.
This commit is contained in:
Manuel Raynaud
2026-09-21 14:48:41 +02:00
parent 8ed721f0c6
commit ca2e05de22
4 changed files with 33 additions and 10 deletions
+6
View File
@@ -55,6 +55,12 @@
"matchPackageNames": ["typescript"],
"allowedVersions": "<7.0.0"
},
{
"description": "yhub-server pins @y/y while @y/hub depends on it by range: bumped apart, they install two copies of Yjs, which breaks its constructor checks",
"groupName": "@y packages",
"matchManagers": ["npm"],
"matchPackageNames": ["@y/*"]
},
{
"enabled": false,
"groupName": "ignored js dependencies",
@@ -0,0 +1,24 @@
// The Yjs this server imports must be the very copy `@y/hub` imports. Two copies
// in one process break Yjs' constructor checks, which it warns about at startup
// ("Yjs was already imported"). `package.json` pins `@y/y` while `@y/hub` asks
// for a range, so bumping one without the other makes yarn nest a second copy
// under `@y/hub`. Renovate updates the `@y/*` packages together; this catches a
// split however it came about. Resolved, not imported: nothing is loaded.
import { createRequire } from 'node:module';
import { describe, expect, it } from 'vitest';
// resolves like `src/` does: this directory shares its node_modules
const fromServer = createRequire(import.meta.url);
describe('@y/y', () => {
it('is the copy @y/hub imports', () => {
const serverCopy = fromServer.resolve('@y/y');
const hubCopy = createRequire(fromServer.resolve('@y/hub')).resolve('@y/y');
expect(
hubCopy,
'two copies of @y/y are installed: pin it to the version @y/hub resolves',
).toBe(serverCopy);
});
});
+1 -1
View File
@@ -15,7 +15,7 @@
"dependencies": {
"@aws-sdk/client-s3": "3.1110.0",
"@y/hub": "0.9.0",
"@y/y": "14.0.0-rc.24",
"@y/y": "14.0.0-rc.25",
"jose": "6.2.8"
},
"devDependencies": {
+2 -9
View File
@@ -877,14 +877,7 @@
dependencies:
lib0 "^1.0.0-rc.1"
"@y/y@14.0.0-rc.24":
version "14.0.0-rc.24"
resolved "https://registry.yarnpkg.com/@y/y/-/y-14.0.0-rc.24.tgz#8279272b767718af1303f4c22824d651978c41b1"
integrity sha512-E22nv/q6CWNodzU/yowxEp95TUVBTP5T63kAiJy2FpsuB5zxqfGhdW2222S4tFF9mo9UtBqg8ep7tPMJ9bZVOg==
dependencies:
lib0 "^1.0.0-rc.21"
"@y/y@^14.0.0-rc.24":
"@y/y@14.0.0-rc.25", "@y/y@^14.0.0-rc.24":
version "14.0.0-rc.25"
resolved "https://registry.yarnpkg.com/@y/y/-/y-14.0.0-rc.25.tgz#e5b2d825406984dc71fe65a71977ffe005ffd273"
integrity sha512-kG61I9GLF85aNtBelJKcf6D6PhLoWUBWQ2kyTAKwOWRUnuCkzGRCp3gUdwcTB9TINtgC9w5kPAKzstNDIpwSXw==
@@ -1418,7 +1411,7 @@ levn@^0.4.1:
prelude-ls "^1.2.1"
type-check "~0.4.0"
lib0@^1.0.0-rc.1, lib0@^1.0.0-rc.21, lib0@^1.0.0-rc.27, lib0@^1.0.0-rc.28:
lib0@^1.0.0-rc.1, lib0@^1.0.0-rc.27, lib0@^1.0.0-rc.28:
version "1.0.0-rc.30"
resolved "https://registry.yarnpkg.com/lib0/-/lib0-1.0.0-rc.30.tgz#2c2aec2c91a99230891918e0a551472a6cc8052e"
integrity sha512-WhIbHSbBMttOT3Ke/HDA5+kIf9KRDSd5L+aJMBkvJSxwqL7w7004/0X5fjXj8loBIm5PkdgSMRmlPjC2mIzuCw==