Skip to content

Commit 9b314f1

Browse files
committedDec 27, 2023
chore: bump yarn to stable
Signed-off-by: Marc MacLeod <[email protected]>
1 parent 7fe2949 commit 9b314f1

File tree

15 files changed

+2357
-2370
lines changed

15 files changed

+2357
-2370
lines changed
 

‎.yarn/releases/yarn-4.0.0-rc.40.cjs

-876
This file was deleted.

‎.yarn/releases/yarn-4.0.2.cjs

+893
Large diffs are not rendered by default.

‎.yarnrc.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
nodeLinker: node-modules
22

3+
enableConstraintsChecks: true
4+
5+
yarnPath: .yarn/releases/yarn-4.0.2.cjs
6+
37
plugins:
48
- checksum: 8f13acff9aef76f5fbfb5474b6d23b14ed3f49258cf4e344229e3515e42f4d6990e3c51b9ab176aa46c407fb9ca97fc0902c6400db5a44e9994d0b53512f3aed
59
path: .yarn/plugins/@yarnpkg/plugin-engines.cjs
6-
spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js"
7-
8-
yarnPath: .yarn/releases/yarn-4.0.0-rc.40.cjs
10+
spec: 'https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js'

‎constraints.pro

-12
This file was deleted.

‎examples/remix-vite/api/trpc/articles.ts

+25-21
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
import { wrap } from '@decs/typeschema';
21
import { TRPCError } from '@trpc/server';
32
import { desc, eq, or } from 'drizzle-orm';
4-
import { object, omit, partial, pick } from 'valibot';
3+
import { object, omit, parse, partial, pick } from 'valibot';
54

65
import { sleep } from '~/utils.ts';
76
import { createDbId } from '~api/db/ids.ts';
@@ -27,23 +26,25 @@ export const articlesRouter = router({
2726
.execute();
2827
}),
2928

30-
byId: publicProcedure.input(wrap(pick(selectArticleSchema, ['id']))).query(async ({ input, ctx }) => {
31-
await sleep(500);
29+
byId: publicProcedure
30+
.input(i => parse(pick(selectArticleSchema, ['id']), i))
31+
.query(async ({ input, ctx }) => {
32+
await sleep(500);
3233

33-
const article = (await ctx.db.select().from(articles).where(eq(articles.id, input.id)).execute())[0];
34-
if (!article || (article.status === 'draft' && article.authorId !== ctx.user?.id)) {
35-
throw new TRPCError({ code: 'NOT_FOUND' });
36-
}
34+
const article = (await ctx.db.select().from(articles).where(eq(articles.id, input.id)).execute())[0];
35+
if (!article || (article.status === 'draft' && article.authorId !== ctx.user?.id)) {
36+
throw new TRPCError({ code: 'NOT_FOUND' });
37+
}
3738

38-
return article;
39-
}),
39+
return article;
40+
}),
4041

4142
/**
4243
* Mutations
4344
*/
4445

4546
create: protectedProcedure
46-
.input(wrap(omit(insertArticleSchema, ['id', 'authorId'])))
47+
.input(i => parse(omit(insertArticleSchema, ['id', 'authorId']), i))
4748
.mutation(async ({ input, ctx }) => {
4849
const article = await ctx.db
4950
.insert(articles)
@@ -59,12 +60,13 @@ export const articlesRouter = router({
5960
}),
6061

6162
update: protectedProcedure
62-
.input(
63-
wrap(
63+
.input(i =>
64+
parse(
6465
object({
6566
lookup: pick(insertArticleSchema, ['id']),
6667
set: partial(pick(insertArticleSchema, ['title', 'body', 'status'])),
6768
}),
69+
i,
6870
),
6971
)
7072
.mutation(async ({ input: { lookup, set }, ctx }) => {
@@ -86,14 +88,16 @@ export const articlesRouter = router({
8688
return article[0];
8789
}),
8890

89-
delete: protectedProcedure.input(wrap(pick(selectArticleSchema, ['id']))).mutation(async ({ input: { id }, ctx }) => {
90-
const existing = (await ctx.db.select().from(articles).where(eq(articles.id, id)).execute())[0];
91-
if (!existing || existing.authorId !== ctx.user.id) {
92-
throw new TRPCError({ code: 'NOT_FOUND' });
93-
}
91+
delete: protectedProcedure
92+
.input(i => parse(pick(selectArticleSchema, ['id']), i))
93+
.mutation(async ({ input: { id }, ctx }) => {
94+
const existing = (await ctx.db.select().from(articles).where(eq(articles.id, id)).execute())[0];
95+
if (!existing || existing.authorId !== ctx.user.id) {
96+
throw new TRPCError({ code: 'NOT_FOUND' });
97+
}
9498

95-
await ctx.db.delete(articles).where(eq(articles.id, id)).execute();
99+
await ctx.db.delete(articles).where(eq(articles.id, id)).execute();
96100

97-
return null;
98-
}),
101+
return null;
102+
}),
99103
});

‎examples/remix-vite/api/trpc/auth.ts

+73-70
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { wrap } from '@decs/typeschema';
21
import { TRPCError } from '@trpc/server';
32
import { SqliteError } from 'better-sqlite3';
43
import type { CookieOptions } from 'hono/utils/cookie';
54
import { LuciaError } from 'lucia';
6-
import { maxLength, minLength, object, string } from 'valibot';
5+
import { maxLength, minLength, object, parse, string } from 'valibot';
76

87
import { auth } from '~api/auth.ts';
98
import { createDbId } from '~api/db/ids.ts';
@@ -21,89 +20,93 @@ export const authRouter = router({
2120
return ctx.user ?? null;
2221
}),
2322

24-
signup: publicProcedure.input(wrap(SignupSchema)).mutation(async ({ input, ctx }) => {
25-
const { username, password } = input;
26-
27-
try {
28-
const user = await auth.createUser({
29-
userId: `u_${createDbId()}`,
30-
key: {
31-
providerId: 'username', // auth method
32-
providerUserId: username.toLowerCase(), // unique id when using "username" auth method
33-
password, // hashed by Lucia
34-
},
35-
attributes: {
36-
username,
37-
},
38-
});
39-
40-
const session = await auth.createSession({
41-
userId: user.userId,
42-
attributes: {},
43-
});
44-
45-
const sessionCookie = auth.createSessionCookie(session);
46-
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
47-
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
48-
...cookieAttrs,
49-
sameSite: sameSiteLuciaToHono(sameSite),
50-
});
51-
} catch (e) {
52-
if (e instanceof SqliteError && e.code === 'SQLITE_CONSTRAINT_UNIQUE') {
23+
signup: publicProcedure
24+
.input(i => parse(SignupSchema, i))
25+
.mutation(async ({ input, ctx }) => {
26+
const { username, password } = input;
27+
28+
try {
29+
const user = await auth.createUser({
30+
userId: `u_${createDbId()}`,
31+
key: {
32+
providerId: 'username', // auth method
33+
providerUserId: username.toLowerCase(), // unique id when using "username" auth method
34+
password, // hashed by Lucia
35+
},
36+
attributes: {
37+
username,
38+
},
39+
});
40+
41+
const session = await auth.createSession({
42+
userId: user.userId,
43+
attributes: {},
44+
});
45+
46+
const sessionCookie = auth.createSessionCookie(session);
47+
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
48+
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
49+
...cookieAttrs,
50+
sameSite: sameSiteLuciaToHono(sameSite),
51+
});
52+
} catch (e) {
53+
if (e instanceof SqliteError && e.code === 'SQLITE_CONSTRAINT_UNIQUE') {
54+
throw new TRPCError({
55+
code: 'BAD_REQUEST',
56+
message: 'Username already exists.',
57+
cause: e,
58+
});
59+
}
60+
5361
throw new TRPCError({
54-
code: 'BAD_REQUEST',
55-
message: 'Username already exists.',
62+
code: 'INTERNAL_SERVER_ERROR',
63+
message: 'An unknown error occurred.',
5664
cause: e,
5765
});
5866
}
5967

60-
throw new TRPCError({
61-
code: 'INTERNAL_SERVER_ERROR',
62-
message: 'An unknown error occurred.',
63-
cause: e,
64-
});
65-
}
68+
return null;
69+
}),
6670

67-
return null;
68-
}),
71+
login: publicProcedure
72+
.input(i => parse(LoginSchema, i))
73+
.mutation(async ({ input, ctx }) => {
74+
const { username, password } = input;
6975

70-
login: publicProcedure.input(wrap(LoginSchema)).mutation(async ({ input, ctx }) => {
71-
const { username, password } = input;
76+
try {
77+
// find user by key
78+
// and validate password
79+
const key = await auth.useKey('username', username.toLowerCase(), password);
7280

73-
try {
74-
// find user by key
75-
// and validate password
76-
const key = await auth.useKey('username', username.toLowerCase(), password);
81+
const session = await auth.createSession({
82+
userId: key.userId,
83+
attributes: {},
84+
});
7785

78-
const session = await auth.createSession({
79-
userId: key.userId,
80-
attributes: {},
81-
});
86+
const sessionCookie = auth.createSessionCookie(session);
87+
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
88+
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
89+
...cookieAttrs,
90+
sameSite: sameSiteLuciaToHono(sameSite),
91+
});
8292

83-
const sessionCookie = auth.createSessionCookie(session);
84-
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
85-
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
86-
...cookieAttrs,
87-
sameSite: sameSiteLuciaToHono(sameSite),
88-
});
93+
return null;
94+
} catch (e) {
95+
if (e instanceof LuciaError && (e.message === 'AUTH_INVALID_KEY_ID' || e.message === 'AUTH_INVALID_PASSWORD')) {
96+
throw new TRPCError({
97+
code: 'BAD_REQUEST',
98+
message: 'Incorrect username or password.',
99+
cause: e,
100+
});
101+
}
89102

90-
return null;
91-
} catch (e) {
92-
if (e instanceof LuciaError && (e.message === 'AUTH_INVALID_KEY_ID' || e.message === 'AUTH_INVALID_PASSWORD')) {
93103
throw new TRPCError({
94-
code: 'BAD_REQUEST',
95-
message: 'Incorrect username or password.',
104+
code: 'INTERNAL_SERVER_ERROR',
105+
message: 'An unknown error occurred.',
96106
cause: e,
97107
});
98108
}
99-
100-
throw new TRPCError({
101-
code: 'INTERNAL_SERVER_ERROR',
102-
message: 'An unknown error occurred.',
103-
cause: e,
104-
});
105-
}
106-
}),
109+
}),
107110

108111
logout: protectedProcedure.mutation(async ({ ctx }) => {
109112
// make sure to invalidate the current session!

‎examples/remix-vite/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"typecheck": "tsc"
1414
},
1515
"dependencies": {
16-
"@decs/typeschema": "0.12.1",
1716
"@hono/node-server": "1.3.3",
1817
"@lucia-auth/adapter-sqlite": "2.0.1",
1918
"@paralleldrive/cuid2": "2.2.2",

‎examples/streaming-kitchen-sink/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"debug": "tsx debug.ts"
2121
},
2222
"dependencies": {
23-
"@decs/typeschema": "0.12.1",
2423
"@hono/node-server": "1.3.3",
2524
"@lucia-auth/adapter-sqlite": "2.0.1",
2625
"@paralleldrive/cuid2": "2.2.2",

‎examples/streaming-kitchen-sink/server/trpc/articles.ts

+26-22
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { wrap } from '@decs/typeschema';
21
import { TRPCError } from '@trpc/server';
32
import { desc, eq, or } from 'drizzle-orm';
4-
import { object, omit, partial, pick } from 'valibot';
3+
import { object, omit, parse, partial, pick } from 'valibot';
54

5+
import { sleep } from '~client/utils.ts';
66
import { createDbId } from '~server/db/ids.ts';
77
import { articles, insertArticleSchema, selectArticleSchema } from '~server/db/schema/index.ts';
8-
import { sleep } from '~client/utils.ts';
98

109
import { protectedProcedure, publicProcedure, router } from './trpc.ts';
1110

@@ -25,23 +24,25 @@ export const articlesRouter = router({
2524
.execute();
2625
}),
2726

28-
byId: publicProcedure.input(wrap(pick(selectArticleSchema, ['id']))).query(async ({ input, ctx }) => {
29-
await sleep(500);
27+
byId: publicProcedure
28+
.input(i => parse(pick(selectArticleSchema, ['id']), i))
29+
.query(async ({ input, ctx }) => {
30+
await sleep(500);
3031

31-
const article = (await ctx.db.select().from(articles).where(eq(articles.id, input.id)).execute())[0];
32-
if (!article || (article.status === 'draft' && article.authorId !== ctx.user?.id)) {
33-
throw new TRPCError({ code: 'NOT_FOUND' });
34-
}
32+
const article = (await ctx.db.select().from(articles).where(eq(articles.id, input.id)).execute())[0];
33+
if (!article || (article.status === 'draft' && article.authorId !== ctx.user?.id)) {
34+
throw new TRPCError({ code: 'NOT_FOUND' });
35+
}
3536

36-
return article;
37-
}),
37+
return article;
38+
}),
3839

3940
/**
4041
* Mutations
4142
*/
4243

4344
create: protectedProcedure
44-
.input(wrap(omit(insertArticleSchema, ['id', 'authorId'])))
45+
.input(i => parse(omit(insertArticleSchema, ['id', 'authorId']), i))
4546
.mutation(async ({ input, ctx }) => {
4647
const article = await ctx.db
4748
.insert(articles)
@@ -57,12 +58,13 @@ export const articlesRouter = router({
5758
}),
5859

5960
update: protectedProcedure
60-
.input(
61-
wrap(
61+
.input(i =>
62+
parse(
6263
object({
6364
lookup: pick(insertArticleSchema, ['id']),
6465
set: partial(pick(insertArticleSchema, ['title', 'body', 'status'])),
6566
}),
67+
i,
6668
),
6769
)
6870
.mutation(async ({ input: { lookup, set }, ctx }) => {
@@ -84,14 +86,16 @@ export const articlesRouter = router({
8486
return article[0];
8587
}),
8688

87-
delete: protectedProcedure.input(wrap(pick(selectArticleSchema, ['id']))).mutation(async ({ input: { id }, ctx }) => {
88-
const existing = (await ctx.db.select().from(articles).where(eq(articles.id, id)).execute())[0];
89-
if (!existing || existing.authorId !== ctx.user.id) {
90-
throw new TRPCError({ code: 'NOT_FOUND' });
91-
}
89+
delete: protectedProcedure
90+
.input(i => parse(pick(selectArticleSchema, ['id']), i))
91+
.mutation(async ({ input: { id }, ctx }) => {
92+
const existing = (await ctx.db.select().from(articles).where(eq(articles.id, id)).execute())[0];
93+
if (!existing || existing.authorId !== ctx.user.id) {
94+
throw new TRPCError({ code: 'NOT_FOUND' });
95+
}
9296

93-
await ctx.db.delete(articles).where(eq(articles.id, id)).execute();
97+
await ctx.db.delete(articles).where(eq(articles.id, id)).execute();
9498

95-
return null;
96-
}),
99+
return null;
100+
}),
97101
});

‎examples/streaming-kitchen-sink/server/trpc/auth.ts

+73-70
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { wrap } from '@decs/typeschema';
21
import { TRPCError } from '@trpc/server';
32
import { SqliteError } from 'better-sqlite3';
43
import type { CookieOptions } from 'hono/utils/cookie';
54
import { LuciaError } from 'lucia';
6-
import { maxLength, minLength, object, string } from 'valibot';
5+
import { maxLength, minLength, object, parse, string } from 'valibot';
76

87
import { auth } from '~server/auth.ts';
98
import { createDbId } from '~server/db/ids.ts';
@@ -21,89 +20,93 @@ export const authRouter = router({
2120
return ctx.user || null;
2221
}),
2322

24-
signup: publicProcedure.input(wrap(SignupSchema)).mutation(async ({ input, ctx }) => {
25-
const { username, password } = input;
26-
27-
try {
28-
const user = await auth.createUser({
29-
userId: `u_${createDbId()}`,
30-
key: {
31-
providerId: 'username', // auth method
32-
providerUserId: username.toLowerCase(), // unique id when using "username" auth method
33-
password, // hashed by Lucia
34-
},
35-
attributes: {
36-
username,
37-
},
38-
});
39-
40-
const session = await auth.createSession({
41-
userId: user.userId,
42-
attributes: {},
43-
});
44-
45-
const sessionCookie = auth.createSessionCookie(session);
46-
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
47-
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
48-
...cookieAttrs,
49-
sameSite: sameSiteLuciaToHono(sameSite),
50-
});
51-
} catch (e) {
52-
if (e instanceof SqliteError && e.code === 'SQLITE_CONSTRAINT_UNIQUE') {
23+
signup: publicProcedure
24+
.input(i => parse(SignupSchema, i))
25+
.mutation(async ({ input, ctx }) => {
26+
const { username, password } = input;
27+
28+
try {
29+
const user = await auth.createUser({
30+
userId: `u_${createDbId()}`,
31+
key: {
32+
providerId: 'username', // auth method
33+
providerUserId: username.toLowerCase(), // unique id when using "username" auth method
34+
password, // hashed by Lucia
35+
},
36+
attributes: {
37+
username,
38+
},
39+
});
40+
41+
const session = await auth.createSession({
42+
userId: user.userId,
43+
attributes: {},
44+
});
45+
46+
const sessionCookie = auth.createSessionCookie(session);
47+
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
48+
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
49+
...cookieAttrs,
50+
sameSite: sameSiteLuciaToHono(sameSite),
51+
});
52+
} catch (e) {
53+
if (e instanceof SqliteError && e.code === 'SQLITE_CONSTRAINT_UNIQUE') {
54+
throw new TRPCError({
55+
code: 'BAD_REQUEST',
56+
message: 'Username already exists.',
57+
cause: e,
58+
});
59+
}
60+
5361
throw new TRPCError({
54-
code: 'BAD_REQUEST',
55-
message: 'Username already exists.',
62+
code: 'INTERNAL_SERVER_ERROR',
63+
message: 'An unknown error occurred.',
5664
cause: e,
5765
});
5866
}
5967

60-
throw new TRPCError({
61-
code: 'INTERNAL_SERVER_ERROR',
62-
message: 'An unknown error occurred.',
63-
cause: e,
64-
});
65-
}
68+
return null;
69+
}),
6670

67-
return null;
68-
}),
71+
login: publicProcedure
72+
.input(i => parse(LoginSchema, i))
73+
.mutation(async ({ input, ctx }) => {
74+
const { username, password } = input;
6975

70-
login: publicProcedure.input(wrap(LoginSchema)).mutation(async ({ input, ctx }) => {
71-
const { username, password } = input;
76+
try {
77+
// find user by key
78+
// and validate password
79+
const key = await auth.useKey('username', username.toLowerCase(), password);
7280

73-
try {
74-
// find user by key
75-
// and validate password
76-
const key = await auth.useKey('username', username.toLowerCase(), password);
81+
const session = await auth.createSession({
82+
userId: key.userId,
83+
attributes: {},
84+
});
7785

78-
const session = await auth.createSession({
79-
userId: key.userId,
80-
attributes: {},
81-
});
86+
const sessionCookie = auth.createSessionCookie(session);
87+
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
88+
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
89+
...cookieAttrs,
90+
sameSite: sameSiteLuciaToHono(sameSite),
91+
});
8292

83-
const sessionCookie = auth.createSessionCookie(session);
84-
const { sameSite, ...cookieAttrs } = sessionCookie.attributes;
85-
ctx.setCookie(sessionCookie.name, sessionCookie.value, {
86-
...cookieAttrs,
87-
sameSite: sameSiteLuciaToHono(sameSite),
88-
});
93+
return null;
94+
} catch (e) {
95+
if (e instanceof LuciaError && (e.message === 'AUTH_INVALID_KEY_ID' || e.message === 'AUTH_INVALID_PASSWORD')) {
96+
throw new TRPCError({
97+
code: 'BAD_REQUEST',
98+
message: 'Incorrect username or password.',
99+
cause: e,
100+
});
101+
}
89102

90-
return null;
91-
} catch (e) {
92-
if (e instanceof LuciaError && (e.message === 'AUTH_INVALID_KEY_ID' || e.message === 'AUTH_INVALID_PASSWORD')) {
93103
throw new TRPCError({
94-
code: 'BAD_REQUEST',
95-
message: 'Incorrect username or password.',
104+
code: 'INTERNAL_SERVER_ERROR',
105+
message: 'An unknown error occurred.',
96106
cause: e,
97107
});
98108
}
99-
100-
throw new TRPCError({
101-
code: 'INTERNAL_SERVER_ERROR',
102-
message: 'An unknown error occurred.',
103-
cause: e,
104-
});
105-
}
106-
}),
109+
}),
107110

108111
logout: protectedProcedure.mutation(async ({ ctx }) => {
109112
// make sure to invalidate the current session!

‎package.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"name": "@ssrx/root",
33
"private": true,
4-
"packageManager": "yarn@4.0.0-rc.40",
5-
"engines": {
6-
"node": ">=18"
7-
},
4+
"packageManager": "yarn@4.0.2",
85
"workspaces": [
96
"examples/*",
107
"packages/*"
@@ -38,6 +35,7 @@
3835
"@changesets/cli": "2.27.1",
3936
"@typescript-eslint/eslint-plugin": "6.16.0",
4037
"@typescript-eslint/parser": "6.16.0",
38+
"@yarnpkg/types": "~4.0.0",
4139
"bun-types": "1.0.20",
4240
"eslint": "8.56.0",
4341
"eslint-config-prettier": "9.1.0",

‎packages/plugin-solid-router/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"@ssrx/renderer": "^0.2.0"
3434
},
3535
"devDependencies": {
36-
"@solidjs/router": "0.10.5",
36+
"@solidjs/router": "0.8.4",
3737
"esbuild-plugin-solid": "0.5.0"
3838
}
3939
}

‎packages/vite/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"radix3": "^1.1.0"
5353
},
5454
"devDependencies": {
55-
"@total-typescript/ts-reset": "0.5.1",
55+
"@total-typescript/ts-reset": "~0.5.1",
5656
"esbuild": "0.19.10",
5757
"rollup": "4.9.1",
5858
"rollup-plugin-esbuild": "6.1.0",

‎yarn.config.cjs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/** @type {import('@yarnpkg/types')} */
2+
const { defineConfig } = require(`@yarnpkg/types`);
3+
4+
// Example here: https://github.com/yarnpkg/berry/blob/master/yarn.config.cjs
5+
6+
/**
7+
* This rule will enforce that a workspace MUST depend on the same version of
8+
* a dependency as the one used by the other workspaces.
9+
*
10+
* @param {Context} context
11+
*/
12+
function enforceConsistentDependenciesAcrossTheProject({ Yarn }) {
13+
for (const dependency of Yarn.dependencies()) {
14+
if (dependency.type === `peerDependencies` || dependency.ident.startsWith('@ssrx/')) continue;
15+
16+
for (const otherDependency of Yarn.dependencies({ ident: dependency.ident })) {
17+
if (otherDependency.type === `peerDependencies`) continue;
18+
19+
dependency.update(otherDependency.range);
20+
}
21+
}
22+
}
23+
24+
module.exports = defineConfig({
25+
constraints: async ctx => {
26+
enforceConsistentDependenciesAcrossTheProject(ctx);
27+
},
28+
});

‎yarn.lock

+1,230-1,288
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.