From a9e4f82e30d71f40885b7fbf798fb7a7fd44e43e Mon Sep 17 00:00:00 2001 From: yusing Date: Fri, 28 Mar 2025 09:28:02 +0800 Subject: [PATCH] refactor: move typescript stuff to 'schemas' directory --- .gitmodules | 0 Makefile | 6 +++++- bun.lock => schemas/bun.lock | 0 package.json => schemas/package.json | 8 ++++---- tsconfig.json => schemas/tsconfig.json | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) delete mode 100644 .gitmodules rename bun.lock => schemas/bun.lock (100%) rename package.json => schemas/package.json (82%) rename tsconfig.json => schemas/tsconfig.json (93%) diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index e69de29b..00000000 diff --git a/Makefile b/Makefile index 44c1e400..f0a640fb 100755 --- a/Makefile +++ b/Makefile @@ -103,7 +103,7 @@ gen-schema-single: python3 -c "import json; f=open('schemas/${OUT}', 'r'); j=json.load(f); f.close(); f=open('schemas/${OUT}', 'w'); json.dump(j, f, separators=(',', ':'));" gen-schema: - bun --bun tsc + cd schemas && bun --bun tsc make IN=config/config.ts \ CLASS=Config \ OUT=config.schema.json \ @@ -120,6 +120,10 @@ gen-schema: CLASS=DockerRoutes \ OUT=docker_routes.schema.json \ gen-schema-single + cd .. + +publish-schema: + cd schemas && bun publish && cd .. update-schema-generator: pnpm up -g typescript-json-schema diff --git a/bun.lock b/schemas/bun.lock similarity index 100% rename from bun.lock rename to schemas/bun.lock diff --git a/package.json b/schemas/package.json similarity index 82% rename from package.json rename to schemas/package.json index 79ad1490..5a34c4f6 100644 --- a/package.json +++ b/schemas/package.json @@ -13,12 +13,12 @@ "LICENSE" ], "type": "module", - "main": "./schemas/index.ts", + "main": "./index.ts", "exports": { ".": { - "types": "./schemas/index.d.ts", - "import": "./schemas/index.ts", - "require": "./schemas/index.js" + "types": "./index.d.ts", + "import": "./index.ts", + "require": "./index.js" } }, "devDependencies": { diff --git a/tsconfig.json b/schemas/tsconfig.json similarity index 93% rename from tsconfig.json rename to schemas/tsconfig.json index d355b747..3a87871c 100644 --- a/tsconfig.json +++ b/schemas/tsconfig.json @@ -12,5 +12,5 @@ "resolveJsonModule": true, "declaration": true }, - "include": ["schemas"] + "include": ["."] }