diff --git a/.github/workflows/ci-pipeline.yaml b/.github/workflows/ci-pipeline.yaml index 3acf51b..a1582f6 100644 --- a/.github/workflows/ci-pipeline.yaml +++ b/.github/workflows/ci-pipeline.yaml @@ -35,7 +35,11 @@ jobs: id: cache-check uses: actions/cache@v4 with: - path: node_modules + path: | + node_modules + */node_modules + packages/*/node_modules + apps/*/node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('bun.lock') }} lookup-only: true @@ -51,7 +55,11 @@ jobs: if: steps.cache-check.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: - path: node_modules + path: | + node_modules + */node_modules + packages/*/node_modules + apps/*/node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('bun.lock') }} type-check: @@ -69,7 +77,11 @@ jobs: id: cache-check uses: actions/cache@v4 with: - path: node_modules + path: | + node_modules + */node_modules + packages/*/node_modules + apps/*/node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('bun.lock') }} restore-keys: ${{ runner.os }}-node_modules @@ -95,7 +107,11 @@ jobs: id: cache-check uses: actions/cache@v4 with: - path: node_modules + path: | + node_modules + */node_modules + packages/*/node_modules + apps/*/node_modules key: ${{ runner.os }}-node_modules-${{ hashFiles('bun.lock') }} restore-keys: ${{ runner.os }}-node_modules diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml index f783edf..e43d5a1 100644 --- a/.github/workflows/fly-deploy.yml +++ b/.github/workflows/fly-deploy.yml @@ -33,7 +33,7 @@ jobs: - name: Deploy to Fly.io run: | - flyctl deploy --remote-only --config fly.toml \ + flyctl deploy --remote-only --config apps/api/fly.toml \ --build-secret APP_ID="${{ vars.APP_ID }}" \ --build-secret PRIVATE_KEY="${{ secrets.PRIVATE_KEY }}" \ --build-secret WEBHOOK_SECRET="${{ secrets.WEBHOOK_SECRET }}" \ diff --git a/.gitignore b/.gitignore index e7430ce..d4d987d 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,6 @@ Thumbs.db # Misc .cache/ tmp/ + +# Turborepo +.turbo/ diff --git a/Dockerfile b/apps/api/Dockerfile similarity index 63% rename from Dockerfile rename to apps/api/Dockerfile index ee6b9d1..8d88ecc 100644 --- a/Dockerfile +++ b/apps/api/Dockerfile @@ -3,11 +3,16 @@ FROM oven/bun:1.3.9-alpine AS build WORKDIR /app COPY package.json bun.lock ./ +COPY apps/api/package.json ./apps/api/ +COPY packages/core/package.json ./packages/core/ + RUN bun install --frozen-lockfile --ignore-scripts COPY tsconfig.json ./ -COPY src/ ./src/ +COPY apps/api/ ./apps/api/ +COPY packages/core/ ./packages/core/ +WORKDIR /app/apps/api RUN bun build src/server.ts --outfile=dist/server.js --target=bun FROM oven/bun:1.3.9-alpine @@ -17,7 +22,7 @@ RUN apk add --no-cache git WORKDIR /app -COPY --from=build /app/dist/server.js ./server.js +COPY --from=build /app/apps/api/dist/server.js ./server.js EXPOSE 8080 diff --git a/fly.toml b/apps/api/fly.toml similarity index 100% rename from fly.toml rename to apps/api/fly.toml diff --git a/apps/api/package.json b/apps/api/package.json new file mode 100644 index 0000000..f875ab7 --- /dev/null +++ b/apps/api/package.json @@ -0,0 +1,20 @@ +{ + "name": "api", + "private": true, + "scripts": { + "dev": "bun run --hot src/app/index.ts", + "build": "bun build src/app/index.ts --outdir=dist --target=bun", + "types:check": "tsc --noEmit --skipLibCheck", + "lint:check": "biome check .", + "lint:fix": "biome check . --write" + }, + "dependencies": { + "@pr-stack/core": "workspace:*", + "hono": "^4.11.10", + "typescript": "^5.9.3" + }, + "devDependencies": { + "@biomejs/biome": "2.4.2", + "@types/bun": "latest" + } +} diff --git a/src/api/index.ts b/apps/api/src/app/index.ts similarity index 78% rename from src/api/index.ts rename to apps/api/src/app/index.ts index 7daa521..de48939 100644 --- a/src/api/index.ts +++ b/apps/api/src/app/index.ts @@ -3,9 +3,6 @@ import ci from "./routes/ci-check"; import health from "./routes/health"; import webhook from "./routes/webhook"; -// Register webhook handlers -import "../core/github/handlers/on-pr-merged"; - const app = new Hono(); app.route("/ci-check", ci); diff --git a/src/api/routes/ci-check.ts b/apps/api/src/app/routes/ci-check.ts similarity index 80% rename from src/api/routes/ci-check.ts rename to apps/api/src/app/routes/ci-check.ts index fc72744..491039f 100644 --- a/src/api/routes/ci-check.ts +++ b/apps/api/src/app/routes/ci-check.ts @@ -1,6 +1,5 @@ +import { ciCheckParamsSchema, shouldSkipCI } from "@pr-stack/core"; import { type Context, Hono } from "hono"; -import { shouldSkipCI } from "../../core/application/ci-check"; -import { ciCheckParamsSchema } from "../schemas/ci-check.schema"; const ci = new Hono(); diff --git a/src/api/routes/health.ts b/apps/api/src/app/routes/health.ts similarity index 100% rename from src/api/routes/health.ts rename to apps/api/src/app/routes/health.ts diff --git a/src/api/routes/webhook.ts b/apps/api/src/app/routes/webhook.ts similarity index 91% rename from src/api/routes/webhook.ts rename to apps/api/src/app/routes/webhook.ts index 716a4a4..d0ab97c 100644 --- a/src/api/routes/webhook.ts +++ b/apps/api/src/app/routes/webhook.ts @@ -1,5 +1,5 @@ +import { githubApp } from "@pr-stack/core"; import { type Context, Hono } from "hono"; -import { githubApp } from "../../core/github/app"; const webhook = new Hono(); diff --git a/src/server.ts b/apps/api/src/server.ts similarity index 76% rename from src/server.ts rename to apps/api/src/server.ts index 9045495..deda6fd 100644 --- a/src/server.ts +++ b/apps/api/src/server.ts @@ -1,5 +1,5 @@ import { serve } from "bun"; -import app from "./api/index"; +import app from "./app/index"; serve({ fetch: app.fetch, diff --git a/apps/api/tsconfig.json b/apps/api/tsconfig.json new file mode 100644 index 0000000..5b93620 --- /dev/null +++ b/apps/api/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "jsx": "react-jsx", + "jsxImportSource": "hono/jsx" + }, + "include": ["src"] +} diff --git a/bun.lock b/bun.lock index 6cec0ec..b12eb87 100644 --- a/bun.lock +++ b/bun.lock @@ -4,8 +4,29 @@ "workspaces": { "": { "name": "pr-stack", + "devDependencies": { + "@biomejs/biome": "2.4.2", + "@types/bun": "latest", + "turbo": "^2.9.3", + }, + }, + "apps/api": { + "name": "api", + "dependencies": { + "@pr-stack/core": "workspace:*", + "hono": "^4.11.10", + "typescript": "^5.9.3", + }, + "devDependencies": { + "@biomejs/biome": "2.4.2", + "@types/bun": "latest", + }, + }, + "packages/core": { + "name": "@pr-stack/core", "dependencies": { "@datastructures-js/deque": "^1.0.8", + "@octokit/plugin-retry": "^8.0.3", "hono": "^4.11.10", "octokit": "^5.0.5", "typescript": "^5.9.3", @@ -79,7 +100,7 @@ "@octokit/plugin-throttling": ["@octokit/plugin-throttling@11.0.3", "", { "dependencies": { "@octokit/types": "^16.0.0", "bottleneck": "^2.15.3" }, "peerDependencies": { "@octokit/core": "^7.0.0" } }, "sha512-34eE0RkFCKycLl2D2kq7W+LovheM/ex3AwZCYN8udpi6bxsyjZidb2McXs69hZhLmJlDqTSP8cH+jSRpiaijBg=="], - "@octokit/request": ["@octokit/request@10.0.7", "", { "dependencies": { "@octokit/endpoint": "^11.0.2", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "universal-user-agent": "^7.0.2" } }, "sha512-v93h0i1yu4idj8qFPZwjehoJx4j3Ntn+JhXsdJrG9pYaX6j/XRz2RmasMUHtNgQD39nrv/VwTWSqK0RNXR8upA=="], + "@octokit/request": ["@octokit/request@10.0.8", "", { "dependencies": { "@octokit/endpoint": "^11.0.3", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "fast-content-type-parse": "^3.0.0", "json-with-bigint": "^3.5.3", "universal-user-agent": "^7.0.2" } }, "sha512-SJZNwY9pur9Agf7l87ywFi14W+Hd9Jg6Ifivsd33+/bGUQIjNujdFiXII2/qSlN2ybqUHfp5xpekMEjIBTjlSw=="], "@octokit/request-error": ["@octokit/request-error@7.1.0", "", { "dependencies": { "@octokit/types": "^16.0.0" } }, "sha512-KMQIfq5sOPpkQYajXHwnhjCC0slzCNScLHs9JafXc4RAJI+9f+jNDlBNaIMTvazOPLgb4BnlhGJOTbnN0wIjPw=="], @@ -91,26 +112,46 @@ "@octokit/webhooks-types": ["@octokit/webhooks-types@7.6.1", "", {}, "sha512-S8u2cJzklBC0FgTwWVLaM8tMrDuDMVE4xiTK4EYXM9GntyvrdbSoxqDQa+Fh57CCNApyIpyeqPhhFEmHPfrXgw=="], - "@types/aws-lambda": ["@types/aws-lambda@8.10.160", "", {}, "sha512-uoO4QVQNWFPJMh26pXtmtrRfGshPUSpMZGUyUQY20FhfHEElEBOPKgVmFs1z+kbpyBsRs2JnoOPT7++Z4GA9pA=="], + "@pr-stack/core": ["@pr-stack/core@workspace:packages/core"], + + "@turbo/darwin-64": ["@turbo/darwin-64@2.9.3", "", { "os": "darwin", "cpu": "x64" }, "sha512-P8foouaP+y/p+hhEGBoZpzMbpVvUMwPjDpcy6wN7EYfvvyISD1USuV27qWkczecihwuPJzQ1lDBuL8ERcavTyg=="], + + "@turbo/darwin-arm64": ["@turbo/darwin-arm64@2.9.3", "", { "os": "darwin", "cpu": "arm64" }, "sha512-SIzEkvtNdzdI50FJDaIQ6kQGqgSSdFPcdn0wqmmONN6iGKjy6hsT+EH99GP65FsfV7DLZTh2NmtTIRl2kdoz5Q=="], + + "@turbo/linux-64": ["@turbo/linux-64@2.9.3", "", { "os": "linux", "cpu": "x64" }, "sha512-pLRwFmcHHNBvsCySLS6OFabr/07kDT2pxEt/k6eBf/3asiVQZKJ7Rk88AafQx2aYA641qek4RsXvYO3JYpiBug=="], + + "@turbo/linux-arm64": ["@turbo/linux-arm64@2.9.3", "", { "os": "linux", "cpu": "arm64" }, "sha512-gy6ApUroC2Nzv+qjGtE/uPNkhHAFU4c8God+zd5Aiv9L9uBgHlxVJpHT3XWl5xwlJZ2KWuMrlHTaS5kmNB+q1Q=="], - "@types/bun": ["@types/bun@1.3.9", "", { "dependencies": { "bun-types": "1.3.9" } }, "sha512-KQ571yULOdWJiMH+RIWIOZ7B2RXQGpL1YQrBtLIV3FqDcCu6FsbFUBwhdKUlCKUpS3PJDsHlJ1QKlpxoVR+xtw=="], + "@turbo/windows-64": ["@turbo/windows-64@2.9.3", "", { "os": "win32", "cpu": "x64" }, "sha512-d0YelTX6hAsB7kIEtGB3PzIzSfAg3yDoUlHwuwJc3adBXUsyUIs0YLG+1NNtuhcDOUGnWQeKUoJ2pGWvbpRj7w=="], - "@types/node": ["@types/node@25.3.0", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-4K3bqJpXpqfg2XKGK9bpDTc6xO/xoUP/RBWS7AtRMug6zZFaRekiLzjVtAoZMquxoAbzBvy5nxQ7veS5eYzf8A=="], + "@turbo/windows-arm64": ["@turbo/windows-arm64@2.9.3", "", { "os": "win32", "cpu": "arm64" }, "sha512-/08CwpKJl3oRY8nOlh2YgilZVJDHsr60XTNxRhuDeuFXONpUZ5X+Nv65izbG/xBew9qxcJFbDX9/sAmAX+ITcQ=="], + + "@types/aws-lambda": ["@types/aws-lambda@8.10.161", "", {}, "sha512-rUYdp+MQwSFocxIOcSsYSF3YYYC/uUpMbCY/mbO21vGqfrEYvNSoPyKYDj6RhXXpPfS0KstW9RwG3qXh9sL7FQ=="], + + "@types/bun": ["@types/bun@1.3.11", "", { "dependencies": { "bun-types": "1.3.11" } }, "sha512-5vPne5QvtpjGpsGYXiFyycfpDF2ECyPcTSsFBMa0fraoxiQyMJ3SmuQIGhzPg2WJuWxVBoxWJ2kClYTcw/4fAg=="], + + "@types/node": ["@types/node@25.5.2", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-tO4ZIRKNC+MDWV4qKVZe3Ql/woTnmHDr5JD8UI5hn2pwBrHEwOEMZK7WlNb5RKB6EoJ02gwmQS9OrjuFnZYdpg=="], + + "api": ["api@workspace:apps/api"], "before-after-hook": ["before-after-hook@4.0.0", "", {}, "sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ=="], "bottleneck": ["bottleneck@2.19.5", "", {}, "sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw=="], - "bun-types": ["bun-types@1.3.9", "", { "dependencies": { "@types/node": "*" } }, "sha512-+UBWWOakIP4Tswh0Bt0QD0alpTY8cb5hvgiYeWCMet9YukHbzuruIEeXC2D7nMJPB12kbh8C7XJykSexEqGKJg=="], + "bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="], "fast-content-type-parse": ["fast-content-type-parse@3.0.0", "", {}, "sha512-ZvLdcY8P+N8mGQJahJV5G4U88CSvT1rP8ApL6uETe88MBXrBHAkZlSEySdUlyztF7ccb+Znos3TFqaepHxdhBg=="], - "hono": ["hono@4.11.10", "", {}, "sha512-kyWP5PAiMooEvGrA9jcD3IXF7ATu8+o7B3KCbPXid5se52NPqnOpM/r9qeW2heMnOekF4kqR1fXJqCYeCLKrZg=="], + "hono": ["hono@4.12.10", "", {}, "sha512-mx/p18PLy5og9ufies2GOSUqep98Td9q4i/EF6X7yJgAiIopxqdfIO3jbqsi3jRgTgw88jMDEzVKi+V2EF+27w=="], + + "json-with-bigint": ["json-with-bigint@3.5.8", "", {}, "sha512-eq/4KP6K34kwa7TcFdtvnftvHCD9KvHOGGICWwMFc4dOOKF5t4iYqnfLK8otCRCRv06FXOzGGyqE8h8ElMvvdw=="], "octokit": ["octokit@5.0.5", "", { "dependencies": { "@octokit/app": "^16.1.2", "@octokit/core": "^7.0.6", "@octokit/oauth-app": "^8.0.3", "@octokit/plugin-paginate-graphql": "^6.0.0", "@octokit/plugin-paginate-rest": "^14.0.0", "@octokit/plugin-rest-endpoint-methods": "^17.0.0", "@octokit/plugin-retry": "^8.0.3", "@octokit/plugin-throttling": "^11.0.3", "@octokit/request-error": "^7.0.2", "@octokit/types": "^16.0.0", "@octokit/webhooks": "^14.0.0" } }, "sha512-4+/OFSqOjoyULo7eN7EA97DE0Xydj/PW5aIckxqQIoFjFwqXKuFCvXUJObyJfBF9Khu4RL/jlDRI9FPaMGfPnw=="], "toad-cache": ["toad-cache@3.7.0", "", {}, "sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw=="], + "turbo": ["turbo@2.9.3", "", { "optionalDependencies": { "@turbo/darwin-64": "2.9.3", "@turbo/darwin-arm64": "2.9.3", "@turbo/linux-64": "2.9.3", "@turbo/linux-arm64": "2.9.3", "@turbo/windows-64": "2.9.3", "@turbo/windows-arm64": "2.9.3" }, "bin": { "turbo": "bin/turbo" } }, "sha512-J/VUvsGRykPb9R8Kh8dHVBOqioDexLk9BhLCU/ZybRR+HN9UR3cURdazFvNgMDt9zPP8TF6K73Z+tplfmi0PqQ=="], + "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="], diff --git a/package.json b/package.json index def211e..a85cac3 100644 --- a/package.json +++ b/package.json @@ -1,25 +1,27 @@ { "name": "pr-stack", "license": "MIT", + "type": "module", + "private": true, + "workspaces": [ + "apps/*", + "packages/*" + ], "scripts": { - "dev:api": "bun run --hot src/api/index.ts", - "build:api": "bun build src/api/index.ts --outdir=dist --target=bun", - "types:check": "tsc --noEmit --skipLibCheck", - "lint:check": "biome check .", - "lint:fix": "biome check . --write", + "dev": "turbo run dev", + "dev:api": "turbo run dev --filter=api", + "build": "turbo run build", + "build:api": "turbo run build --filter=api", + "types:check": "turbo run types:check", + "lint:check": "turbo run lint:check", + "lint:fix": "turbo run lint:fix", "prepare:lefthook": "lefthook install && bun -e \"const fs=require('node:fs'); fs.writeFileSync('node_modules/lefthook/bin/index.js', fs.readFileSync('node_modules/lefthook/bin/index.js', 'utf8').replace(/^#!\\/usr\\/bin\\/env\\s+node/gm, '#!\\/usr\\/bin\\/env bun'))\"", "postinstall": "bun prepare:lefthook" }, - "dependencies": { - "@datastructures-js/deque": "^1.0.8", - "hono": "^4.11.10", - "octokit": "^5.0.5", - "typescript": "^5.9.3", - "zod": "^4.3.6" - }, "devDependencies": { "@biomejs/biome": "2.4.2", - "@octokit/webhooks-types": "^7.6.1", - "@types/bun": "latest" - } + "@types/bun": "latest", + "turbo": "^2.9.3" + }, + "packageManager": "bun@1.3.9" } diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..f6f8b8d --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,23 @@ +{ + "name": "@pr-stack/core", + "private": true, + "scripts": { + "build": "bun build src/index.ts --outdir=dist --target=bun", + "types:check": "tsc --noEmit --skipLibCheck", + "lint:check": "biome check .", + "lint:fix": "biome check . --write" + }, + "dependencies": { + "@datastructures-js/deque": "^1.0.8", + "@octokit/plugin-retry": "^8.0.3", + "hono": "^4.11.10", + "octokit": "^5.0.5", + "typescript": "^5.9.3", + "zod": "^4.3.6" + }, + "devDependencies": { + "@biomejs/biome": "2.4.2", + "@octokit/webhooks-types": "^7.6.1", + "@types/bun": "latest" + } +} diff --git a/src/core/application/ci-check.ts b/packages/core/src/application/ci-check.ts similarity index 97% rename from src/core/application/ci-check.ts rename to packages/core/src/application/ci-check.ts index 0fa9a51..924cf15 100644 --- a/src/core/application/ci-check.ts +++ b/packages/core/src/application/ci-check.ts @@ -1,6 +1,6 @@ import { $ } from "bun"; -import type { CiCheckParams } from "../../api/schemas/ci-check.schema"; import { getInstallationArtifacts } from "../github/auth"; +import type { CiCheckParams } from "../schemas/ci-check.schema"; import { GitService } from "../services/git.service"; import { OctokitService } from "../services/octokit.service"; diff --git a/src/core/application/rebase.ts b/packages/core/src/application/rebase.ts similarity index 97% rename from src/core/application/rebase.ts rename to packages/core/src/application/rebase.ts index 6633c91..b2c1914 100644 --- a/src/core/application/rebase.ts +++ b/packages/core/src/application/rebase.ts @@ -1,14 +1,11 @@ import { Deque } from "@datastructures-js/deque"; import { $ } from "bun"; import type { Octokit } from "octokit"; -import type { - PullRequestData, - RepositoryData, -} from "../../api/schemas/shared.schema"; import { getInstallationArtifacts } from "../github/auth"; import type { PullRequest } from "../models/pull-request.model"; +import type { PullRequestData, RepositoryData } from "../schemas/shared.schema"; import { GitService } from "../services/git.service"; -import { OctokitService } from "./../services/octokit.service"; +import { OctokitService } from "../services/octokit.service"; const REBASE_OPT_IN_LABEL = "pr-stack:auto-rebase"; diff --git a/src/core/github/app.ts b/packages/core/src/github/app.ts similarity index 100% rename from src/core/github/app.ts rename to packages/core/src/github/app.ts diff --git a/src/core/github/auth.ts b/packages/core/src/github/auth.ts similarity index 100% rename from src/core/github/auth.ts rename to packages/core/src/github/auth.ts diff --git a/src/core/github/handlers/on-pr-merged.ts b/packages/core/src/github/handlers/on-pr-merged.ts similarity index 100% rename from src/core/github/handlers/on-pr-merged.ts rename to packages/core/src/github/handlers/on-pr-merged.ts diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts new file mode 100644 index 0000000..4007e65 --- /dev/null +++ b/packages/core/src/index.ts @@ -0,0 +1,8 @@ +// Register side-effect handlers +import "./github/handlers/on-pr-merged"; + +export * from "./application/ci-check"; +export * from "./application/rebase"; +export * from "./github/app"; +export * from "./schemas/ci-check.schema"; +export * from "./schemas/shared.schema"; diff --git a/src/core/models/commit.model.ts b/packages/core/src/models/commit.model.ts similarity index 100% rename from src/core/models/commit.model.ts rename to packages/core/src/models/commit.model.ts diff --git a/src/core/models/pull-request.model.ts b/packages/core/src/models/pull-request.model.ts similarity index 100% rename from src/core/models/pull-request.model.ts rename to packages/core/src/models/pull-request.model.ts diff --git a/src/api/schemas/ci-check.schema.ts b/packages/core/src/schemas/ci-check.schema.ts similarity index 100% rename from src/api/schemas/ci-check.schema.ts rename to packages/core/src/schemas/ci-check.schema.ts diff --git a/src/api/schemas/shared.schema.ts b/packages/core/src/schemas/shared.schema.ts similarity index 100% rename from src/api/schemas/shared.schema.ts rename to packages/core/src/schemas/shared.schema.ts diff --git a/src/core/services/git.service.ts b/packages/core/src/services/git.service.ts similarity index 100% rename from src/core/services/git.service.ts rename to packages/core/src/services/git.service.ts diff --git a/src/core/services/octokit.service.ts b/packages/core/src/services/octokit.service.ts similarity index 100% rename from src/core/services/octokit.service.ts rename to packages/core/src/services/octokit.service.ts diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 0000000..0c91d62 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.json", + "include": ["src"] +} diff --git a/tsconfig.json b/tsconfig.json index 4835d10..ec77b6f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,8 +5,6 @@ "target": "ESNext", "module": "Preserve", "moduleDetection": "force", - "jsx": "react-jsx", - "jsxImportSource": "hono/jsx", "allowJs": true, "types": ["bun"], @@ -26,6 +24,11 @@ // Some stricter flags (disabled by default) "noUnusedLocals": false, "noUnusedParameters": false, - "noPropertyAccessFromIndexSignature": false + "noPropertyAccessFromIndexSignature": false, + + // Monorepo aliases + "paths": { + "@pr-stack/core": ["./packages/core/src"] + } } } diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..b2e595b --- /dev/null +++ b/turbo.json @@ -0,0 +1,18 @@ +{ + "$schema": "https://turborepo.dev/schema.json", + "tasks": { + "build": { + "outputs": ["dist/**"] + }, + "dev": { + "persistent": true, + "cache": false + }, + "types:check": { + "dependsOn": ["^types:check"] + }, + "lint:check": {}, + "lint:fix": {} + }, + "ui": "tui" +}