fix(web): import @tasks/ai via workspace alias instead of relative path
Two AI components were importing from ../../../../packages/ai/src using relative paths that escape the workspace root. This worked locally because all packages are siblings on disk, but failed in Docker where Dockerfile.web only copies apps/web, packages/database, and packages/shared into the build context — packages/ai never made it in. Changes: - Add @tasks/ai as a workspace dependency in apps/web/package.json - Switch both imports (command-palette.tsx, ai-block.tsx) to "@tasks/ai" - Add @tasks/ai to transpilePackages in next.config.ts and the docker variant - Copy packages/ai into the Docker build context (Dockerfile.web) - Refresh pnpm-lock.yaml for the new workspace edge Verified locally: web builds compile cleanly past the previously failing "Module not found" errors. (Local final step hits an unrelated ENOSPC on the dev disk; Coolify's volume has plenty of headroom.) Made-with: Cursor
This commit is contained in:
parent
3ddbb4fb83
commit
ba519a8b78
7 changed files with 9 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ import {
|
||||||
createOpenAIClient,
|
createOpenAIClient,
|
||||||
GENERAL_SYSTEM_PROMPT,
|
GENERAL_SYSTEM_PROMPT,
|
||||||
selectOpenAIModel,
|
selectOpenAIModel,
|
||||||
} from "../../../../packages/ai/src";
|
} from "@tasks/ai";
|
||||||
|
|
||||||
const RECENT_KEY = "tasks-command-palette-recent-v1";
|
const RECENT_KEY = "tasks-command-palette-recent-v1";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ import {
|
||||||
selectOpenAIModel,
|
selectOpenAIModel,
|
||||||
summarize,
|
summarize,
|
||||||
translate,
|
translate,
|
||||||
} from "../../../../../packages/ai/src";
|
} from "@tasks/ai";
|
||||||
|
|
||||||
type AiStatus = "idle" | "loading" | "done" | "error";
|
type AiStatus = "idle" | "loading" | "done" | "error";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import path from "path";
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
transpilePackages: ["@tasks/database", "@tasks/shared"],
|
transpilePackages: ["@tasks/ai", "@tasks/database", "@tasks/shared"],
|
||||||
outputFileTracingRoot: path.join(__dirname, "../.."),
|
outputFileTracingRoot: path.join(__dirname, "../.."),
|
||||||
experimental: {
|
experimental: {
|
||||||
serverActions: {
|
serverActions: {
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@
|
||||||
"@radix-ui/react-tabs": "^1.1.3",
|
"@radix-ui/react-tabs": "^1.1.3",
|
||||||
"@radix-ui/react-tooltip": "^1.1.8",
|
"@radix-ui/react-tooltip": "^1.1.8",
|
||||||
"@tanstack/react-query": "^5.62.0",
|
"@tanstack/react-query": "^5.62.0",
|
||||||
|
"@tasks/ai": "workspace:*",
|
||||||
"@tasks/database": "workspace:*",
|
"@tasks/database": "workspace:*",
|
||||||
"@tasks/shared": "workspace:*",
|
"@tasks/shared": "workspace:*",
|
||||||
"@tiptap/extension-code-block": "^3.20.5",
|
"@tiptap/extension-code-block": "^3.20.5",
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ COPY packages/ai/package.json ./packages/ai/
|
||||||
RUN pnpm install --frozen-lockfile
|
RUN pnpm install --frozen-lockfile
|
||||||
|
|
||||||
COPY apps/web ./apps/web
|
COPY apps/web ./apps/web
|
||||||
|
COPY packages/ai ./packages/ai
|
||||||
COPY packages/database ./packages/database
|
COPY packages/database ./packages/database
|
||||||
COPY packages/shared ./packages/shared
|
COPY packages/shared ./packages/shared
|
||||||
COPY docker/next.config.docker.ts ./apps/web/next.config.ts
|
COPY docker/next.config.docker.ts ./apps/web/next.config.ts
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import path from "path";
|
||||||
*/
|
*/
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
transpilePackages: ["@tasks/database", "@tasks/shared"],
|
transpilePackages: ["@tasks/ai", "@tasks/database", "@tasks/shared"],
|
||||||
outputFileTracingRoot: path.join(__dirname, "../.."),
|
outputFileTracingRoot: path.join(__dirname, "../.."),
|
||||||
experimental: {
|
experimental: {
|
||||||
serverActions: {
|
serverActions: {
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,9 @@ importers:
|
||||||
'@tanstack/react-query':
|
'@tanstack/react-query':
|
||||||
specifier: ^5.62.0
|
specifier: ^5.62.0
|
||||||
version: 5.95.2(react@19.2.4)
|
version: 5.95.2(react@19.2.4)
|
||||||
|
'@tasks/ai':
|
||||||
|
specifier: workspace:*
|
||||||
|
version: link:../../packages/ai
|
||||||
'@tasks/database':
|
'@tasks/database':
|
||||||
specifier: workspace:*
|
specifier: workspace:*
|
||||||
version: link:../../packages/database
|
version: link:../../packages/database
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue