chore: migrate to pnpm workspaces monorepo with Turborepo
- Restructure directories: apps/api, apps/admin, apps/website - Add root pnpm-workspace.yaml, turbo.json, .prettierrc, .gitignore - Rename packages to @inkreach/api, @inkreach/admin, @inkreach/website - Add shared packages: packages/tsconfig, packages/shared-types - Add pnpm.onlyBuiltDependencies for native builds - Update docs: README.md, structs.md - All three projects build successfully
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "@inkreach/shared-types",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./src/index.ts",
|
||||
"types": "./src/index.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./src/index.ts",
|
||||
"import": "./src/index.ts"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
// ============================================================
|
||||
// @inkreach/shared-types — 跨子项目共享类型定义
|
||||
// ============================================================
|
||||
// 纯类型 exports,无运行时依赖。子项目通过 import type { ... } from '@inkreach/shared-types' 引入。
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Generic Response Wrappers
|
||||
// ----------------------------------------------------------
|
||||
|
||||
/** 分页响应包装 */
|
||||
export interface PaginatedResult<T> {
|
||||
items: T[];
|
||||
total: number;
|
||||
page: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
/** NestJS 后端 API 响应包络 */
|
||||
export interface BackendEnvelope<T> {
|
||||
data: T;
|
||||
success: boolean;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------
|
||||
// Core Entity Data Interfaces (flat, no decorators)
|
||||
// ----------------------------------------------------------
|
||||
|
||||
export interface CountryData {
|
||||
id: string;
|
||||
countryName: string;
|
||||
countryIcon: string | null;
|
||||
countryCode: string | null;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface CategoryData {
|
||||
id: string;
|
||||
categoryName: string;
|
||||
categoryIcon: string | null;
|
||||
sdsCategoryId: string | null;
|
||||
parentCategoryId: string | null;
|
||||
children?: CategoryData[];
|
||||
_count?: { goods: number };
|
||||
}
|
||||
|
||||
export interface TagData {
|
||||
id: string;
|
||||
tagName: string;
|
||||
tagColor: string | null;
|
||||
tagFontColor: string | null;
|
||||
tagGroupId: string | null;
|
||||
sortOrder: number;
|
||||
timing: string | null;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface TagGroupData {
|
||||
id: string;
|
||||
groupName: string;
|
||||
groupColor: string | null;
|
||||
groupIcon: string | null;
|
||||
sortOrder: number;
|
||||
_count?: { tags: number };
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface PositionData {
|
||||
id: string;
|
||||
positionName: string;
|
||||
countryId: string;
|
||||
categoryId: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
}
|
||||
|
||||
export interface OriginGoodData {
|
||||
id: string;
|
||||
sdsGoodId: string;
|
||||
goodName: string;
|
||||
sku: string | null;
|
||||
mainImage: string | null;
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
export interface TagInline {
|
||||
id: string;
|
||||
tagName: string;
|
||||
tagColor: string | null;
|
||||
tagFontColor: string | null;
|
||||
}
|
||||
|
||||
export interface GoodData {
|
||||
id: string;
|
||||
goodName: string;
|
||||
goodImage: string | null;
|
||||
goodPriority: number;
|
||||
originGoodId: string;
|
||||
originGood?: OriginGoodData;
|
||||
countryId: string;
|
||||
country?: CountryData;
|
||||
categoryId: string;
|
||||
category?: CategoryData;
|
||||
tagId?: string;
|
||||
tag?: TagInline;
|
||||
tags: TagInline[];
|
||||
positionId?: string;
|
||||
position?: PositionData;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface UserData {
|
||||
id: string;
|
||||
username: string;
|
||||
email?: string;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "ES2021",
|
||||
"emitDecoratorMetadata": true,
|
||||
"experimentalDecorators": true,
|
||||
"removeComments": true,
|
||||
"strictNullChecks": true,
|
||||
"noImplicitAny": true,
|
||||
"strictBindCallApply": true,
|
||||
"outDir": "./dist",
|
||||
"baseUrl": "./",
|
||||
"incremental": true,
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"declaration": true,
|
||||
"sourceMap": true,
|
||||
"noFallthroughCasesInSwitch": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "@inkreach/tsconfig",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"files": ["base.json", "api.json", "vue.json"]
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"jsx": "preserve",
|
||||
"types": ["vite/client", "node"],
|
||||
"baseUrl": ".",
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"erasableSyntaxOnly": true,
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user