From 3ebe1178f4dcd4d643f87352a5c1c3aa3eb3a02a Mon Sep 17 00:00:00 2001 From: Boki Date: Wed, 18 Jun 2025 22:13:28 -0400 Subject: [PATCH] some fixes --- apps/web-api/tsconfig.json | 13 ++++++++++++- docs/typescript-configuration.md | 16 +--------------- libs/browser/package.json | 16 +++++++++++++--- libs/browser/tsconfig.json | 6 +++--- libs/browser/turbo.json | 19 +++++++++++++++++++ libs/config/turbo.json | 19 +++++++++++++++++++ libs/proxy/tsconfig.json | 4 ++-- libs/proxy/turbo.json | 19 +++++++++++++++++++ libs/queue/turbo.json | 19 +++++++++++++++++++ tsconfig.json | 3 +++ tsconfig.lib.json | 11 ----------- turbo.json | 2 +- 12 files changed, 111 insertions(+), 36 deletions(-) create mode 100644 libs/browser/turbo.json create mode 100644 libs/config/turbo.json create mode 100644 libs/proxy/turbo.json create mode 100644 libs/queue/turbo.json delete mode 100644 tsconfig.lib.json diff --git a/apps/web-api/tsconfig.json b/apps/web-api/tsconfig.json index 29e5e92..e91ca6e 100644 --- a/apps/web-api/tsconfig.json +++ b/apps/web-api/tsconfig.json @@ -5,5 +5,16 @@ "outDir": "./dist" }, "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "**/*.test.ts"] + "exclude": ["node_modules", "dist", "**/*.test.ts"], + "references": [ + { "path": "../../libs/types" }, + { "path": "../../libs/config" }, + { "path": "../../libs/logger" }, + { "path": "../../libs/cache" }, + { "path": "../../libs/queue" }, + { "path": "../../libs/mongodb-client" }, + { "path": "../../libs/postgres-client" }, + { "path": "../../libs/questdb-client" }, + { "path": "../../libs/shutdown" } + ] } diff --git a/docs/typescript-configuration.md b/docs/typescript-configuration.md index 0d88271..c0a103e 100644 --- a/docs/typescript-configuration.md +++ b/docs/typescript-configuration.md @@ -41,21 +41,7 @@ The root `tsconfig.json` at the project root establishes common settings for all We provide two template configurations: -1. `tsconfig.lib.json` - For library projects: -```json -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "./src", - "declaration": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] -} -``` - -2. `tsconfig.app.json` - For application projects: +1. `tsconfig.app.json` - For application projects: ```json { "extends": "../../../tsconfig.json", diff --git a/libs/browser/package.json b/libs/browser/package.json index 38cc84a..affb57b 100644 --- a/libs/browser/package.json +++ b/libs/browser/package.json @@ -2,13 +2,23 @@ "name": "@stock-bot/browser", "version": "1.0.0", "description": "High-performance browser automation library with proxy support", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.js", + "types": "./dist/index.d.ts" + } + }, + "main": "./dist/index.js", + "types": "./dist/index.d.ts", "type": "module", "scripts": { "build": "tsc", + "dev": "tsc --watch", "test": "bun test", - "dev": "tsc --watch" + "clean": "rm -rf dist", + "cli": "bun run src/cli.ts", + "validate": "bun run src/cli.ts --validate", + "check": "bun run src/cli.ts --check" }, "dependencies": { "playwright": "^1.53.0" diff --git a/libs/browser/tsconfig.json b/libs/browser/tsconfig.json index 350f503..68ffb75 100644 --- a/libs/browser/tsconfig.json +++ b/libs/browser/tsconfig.json @@ -1,8 +1,8 @@ { - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "dist", - "rootDir": "src" + "outDir": "./dist", + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"], diff --git a/libs/browser/turbo.json b/libs/browser/turbo.json new file mode 100644 index 0000000..9cf45c3 --- /dev/null +++ b/libs/browser/turbo.json @@ -0,0 +1,19 @@ +{ + "extends": ["//"], + "tasks": { + "build": { + "dependsOn": ["@stock-bot/logger#build", "@stock-bot/http#build"], + "outputs": ["dist/**"], + "inputs": [ + "src/**", + "package.json", + "tsconfig.json", + "!**/*.test.ts", + "!**/*.spec.ts", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**" + ] + } + } +} diff --git a/libs/config/turbo.json b/libs/config/turbo.json new file mode 100644 index 0000000..6d18e62 --- /dev/null +++ b/libs/config/turbo.json @@ -0,0 +1,19 @@ +{ + "extends": ["//"], + "tasks": { + "build": { + "dependsOn": [], + "outputs": ["dist/**"], + "inputs": [ + "src/**", + "package.json", + "tsconfig.json", + "!**/*.test.ts", + "!**/*.spec.ts", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**" + ] + } + } +} diff --git a/libs/proxy/tsconfig.json b/libs/proxy/tsconfig.json index ffc624d..c3f6351 100644 --- a/libs/proxy/tsconfig.json +++ b/libs/proxy/tsconfig.json @@ -1,7 +1,7 @@ { - "extends": "../../tsconfig.lib.json", + "extends": "../../tsconfig.json", "compilerOptions": { - "outDir": "dist", + "outDir": "./dist", "rootDir": "src", "skipLibCheck": true }, diff --git a/libs/proxy/turbo.json b/libs/proxy/turbo.json new file mode 100644 index 0000000..6d18e62 --- /dev/null +++ b/libs/proxy/turbo.json @@ -0,0 +1,19 @@ +{ + "extends": ["//"], + "tasks": { + "build": { + "dependsOn": [], + "outputs": ["dist/**"], + "inputs": [ + "src/**", + "package.json", + "tsconfig.json", + "!**/*.test.ts", + "!**/*.spec.ts", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**" + ] + } + } +} diff --git a/libs/queue/turbo.json b/libs/queue/turbo.json new file mode 100644 index 0000000..49d5a87 --- /dev/null +++ b/libs/queue/turbo.json @@ -0,0 +1,19 @@ +{ + "extends": ["//"], + "tasks": { + "build": { + "dependsOn": ["@stock-bot/cache#build", "@stock-bot/logger#build", "@stock-bot/types#build"], + "outputs": ["dist/**"], + "inputs": [ + "src/**", + "package.json", + "tsconfig.json", + "!**/*.test.ts", + "!**/*.spec.ts", + "!**/test/**", + "!**/tests/**", + "!**/__tests__/**" + ] + } + } +} diff --git a/tsconfig.json b/tsconfig.json index 9cb2bcf..fc42764 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -53,6 +53,9 @@ { "path": "./libs/http" }, { "path": "./libs/event-bus" }, { "path": "./libs/shutdown" }, + { "path": "./libs/browser" }, + { "path": "./libs/proxy" }, + // Engine libraries { "path": "./libs/data-frame" }, { "path": "./libs/vector-engine" }, diff --git a/tsconfig.lib.json b/tsconfig.lib.json deleted file mode 100644 index 090238f..0000000 --- a/tsconfig.lib.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./dist", - "rootDir": "./src", - "declaration": true, - "composite": true - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] -} diff --git a/turbo.json b/turbo.json index a7163af..68e9ec8 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,7 @@ "tasks": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**", ".next/**", "!.next/cache/**"], + "outputs": ["dist/**"], "inputs": [ "src/**", "package.json",