feat: initial scaffolding

This commit is contained in:
2026-02-03 10:08:03 -08:00
parent 0ecfc9b54a
commit 2f38aa3b92
63 changed files with 23000 additions and 20 deletions
+3
View File
@@ -0,0 +1,3 @@
# shared-types
This library was generated with [Nx](https://nx.dev).
+8
View File
@@ -0,0 +1,8 @@
import nhcarrigan from '@nhcarrigan/eslint-config';
export default [
...nhcarrigan,
{
ignores: ['**/dist', '**/out-tsc', 'node_modules'],
},
];
+9
View File
@@ -0,0 +1,9 @@
{
"name": "shared-types",
"$schema": "../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "shared-types/src",
"projectType": "library",
"tags": [],
"// targets": "to see all targets run: nx show project shared-types --web",
"targets": {}
}
+4
View File
@@ -0,0 +1,4 @@
export * from './lib/game.types';
export * from './lib/book.types';
export * from './lib/music.types';
export * from './lib/auth.types';
+20
View File
@@ -0,0 +1,20 @@
export interface User {
id: string;
email: string;
username: string;
avatarUrl?: string;
discordId: string;
}
export interface JwtPayload {
sub: string; // user id
email: string;
username: string;
iat?: number;
exp?: number;
}
export interface AuthResponse {
accessToken: string;
user: User;
}
+34
View File
@@ -0,0 +1,34 @@
export enum BookStatus {
READING = 'READING',
FINISHED = 'FINISHED',
TO_READ = 'TO_READ',
}
export interface Book {
id: string;
title: string;
author: string;
isbn?: string;
status: BookStatus;
dateAdded: Date;
dateFinished?: Date;
rating?: number;
notes?: string;
coverImage?: string;
createdAt: Date;
updatedAt: Date;
}
export interface CreateBookDto {
title: string;
author: string;
isbn?: string;
status: BookStatus;
rating?: number;
notes?: string;
coverImage?: string;
}
export interface UpdateBookDto extends Partial<CreateBookDto> {
dateFinished?: Date;
}
+32
View File
@@ -0,0 +1,32 @@
export enum GameStatus {
PLAYING = 'PLAYING',
COMPLETED = 'COMPLETED',
BACKLOG = 'BACKLOG',
}
export interface Game {
id: string;
title: string;
platform?: string;
status: GameStatus;
dateAdded: Date;
dateCompleted?: Date;
rating?: number;
notes?: string;
coverImage?: string;
createdAt: Date;
updatedAt: Date;
}
export interface CreateGameDto {
title: string;
platform?: string;
status: GameStatus;
rating?: number;
notes?: string;
coverImage?: string;
}
export interface UpdateGameDto extends Partial<CreateGameDto> {
dateCompleted?: Date;
}
+40
View File
@@ -0,0 +1,40 @@
export enum MusicType {
ALBUM = 'ALBUM',
SINGLE = 'SINGLE',
EP = 'EP',
}
export enum MusicStatus {
LISTENING = 'LISTENING',
COMPLETED = 'COMPLETED',
WANT_TO_LISTEN = 'WANT_TO_LISTEN',
}
export interface Music {
id: string;
title: string;
artist: string;
type: MusicType;
status: MusicStatus;
dateAdded: Date;
dateCompleted?: Date;
rating?: number;
notes?: string;
coverArt?: string;
createdAt: Date;
updatedAt: Date;
}
export interface CreateMusicDto {
title: string;
artist: string;
type: MusicType;
status: MusicStatus;
rating?: number;
notes?: string;
coverArt?: string;
}
export interface UpdateMusicDto extends Partial<CreateMusicDto> {
dateCompleted?: Date;
}
+20
View File
@@ -0,0 +1,20 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"module": "commonjs",
"forceConsistentCasingInFileNames": true,
"strict": true,
"importHelpers": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noPropertyAccessFromIndexSignature": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
}
]
}
+9
View File
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../dist/out-tsc",
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"]
}