feat(shared): add @solelog/shared contracts package and wire packages/* workspace
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"apps/*"
|
"apps/*",
|
||||||
|
"packages/*"
|
||||||
],
|
],
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"react-native": "patch:react-native@npm%3A0.81.4#~/.yarn/patches/react-native+0.81.4.patch",
|
"react-native": "patch:react-native@npm%3A0.81.4#~/.yarn/patches/react-native+0.81.4.patch",
|
||||||
|
|||||||
14
packages/shared/package.json
Normal file
14
packages/shared/package.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "@solelog/shared",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"main": "./src/index.ts",
|
||||||
|
"types": "./src/index.ts",
|
||||||
|
"exports": {
|
||||||
|
".": "./src/index.ts"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"zod": "^3.23.8"
|
||||||
|
}
|
||||||
|
}
|
||||||
18
packages/shared/src/index.ts
Normal file
18
packages/shared/src/index.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import { z } from 'zod';
|
||||||
|
|
||||||
|
export const HealthResponse = z.object({
|
||||||
|
status: z.literal('ok'),
|
||||||
|
});
|
||||||
|
export type HealthResponse = z.infer<typeof HealthResponse>;
|
||||||
|
|
||||||
|
export const PublicUser = z.object({
|
||||||
|
id: z.string(),
|
||||||
|
email: z.string().email(),
|
||||||
|
name: z.string(),
|
||||||
|
});
|
||||||
|
export type PublicUser = z.infer<typeof PublicUser>;
|
||||||
|
|
||||||
|
export const MeResponse = z.object({
|
||||||
|
user: PublicUser,
|
||||||
|
});
|
||||||
|
export type MeResponse = z.infer<typeof MeResponse>;
|
||||||
13
packages/shared/tsconfig.json
Normal file
13
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"target": "ES2022",
|
||||||
|
"module": "ESNext",
|
||||||
|
"moduleResolution": "Bundler",
|
||||||
|
"strict": true,
|
||||||
|
"declaration": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"verbatimModuleSyntax": true
|
||||||
|
},
|
||||||
|
"include": ["src"]
|
||||||
|
}
|
||||||
10
yarn.lock
10
yarn.lock
@@ -6933,6 +6933,14 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
"@solelog/shared@workspace:packages/shared":
|
||||||
|
version: 0.0.0-use.local
|
||||||
|
resolution: "@solelog/shared@workspace:packages/shared"
|
||||||
|
dependencies:
|
||||||
|
zod: "npm:^3.23.8"
|
||||||
|
languageName: unknown
|
||||||
|
linkType: soft
|
||||||
|
|
||||||
"@standard-schema/spec@npm:^1.0.0, @standard-schema/spec@npm:^1.1.0":
|
"@standard-schema/spec@npm:^1.0.0, @standard-schema/spec@npm:^1.1.0":
|
||||||
version: 1.1.0
|
version: 1.1.0
|
||||||
resolution: "@standard-schema/spec@npm:1.1.0"
|
resolution: "@standard-schema/spec@npm:1.1.0"
|
||||||
@@ -20643,7 +20651,7 @@ __metadata:
|
|||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"zod@npm:^3.25.76":
|
"zod@npm:^3.23.8, zod@npm:^3.25.76":
|
||||||
version: 3.25.76
|
version: 3.25.76
|
||||||
resolution: "zod@npm:3.25.76"
|
resolution: "zod@npm:3.25.76"
|
||||||
checksum: 10c0/5718ec35e3c40b600316c5b4c5e4976f7fee68151bc8f8d90ec18a469be9571f072e1bbaace10f1e85cf8892ea12d90821b200e980ab46916a6166a4260a983c
|
checksum: 10c0/5718ec35e3c40b600316c5b4c5e4976f7fee68151bc8f8d90ec18a469be9571f072e1bbaace10f1e85cf8892ea12d90821b200e980ab46916a6166a4260a983c
|
||||||
|
|||||||
Reference in New Issue
Block a user