stack/apps/skills/package.json
Bilal Godil 603e353484 fix(skills): import stack-shared via package boundary, inline JSON in tsdown build
The skills app's route.ts imported stack-shared through a deep relative path
into the package's src/ tree:

  import { skillSitePrompt } from "../../../../packages/stack-shared/src/...";

This bypasses the @stackframe/stack-shared package export (which points at
./dist/) and drags stack-shared's whole source graph into the Next.js
TypeScript compilation. stack-shared uses vitest's in-source-test pattern
(import.meta.vitest?.test(...)) throughout, and its own tsconfig declares
"vitest/importMeta" in types — but apps/skills/tsconfig.json does not, so
compiling stack-shared sources under skills' tsconfig fails with:

  Type error: Property 'vitest' does not exist on type 'ImportMeta'.

Route the import through the package boundary instead (matching the
established repo convention in docs/ and examples/demo/), and add
@stackframe/stack-shared as a workspace dep on apps/skills.

Once the import goes through dist/, a latent build bug surfaces: the
shared tsdown config marks every non-entry import external, including the
JSON import in stack-shared/src/ai/unified-prompts/skill-site-prompt-parts/
docs-index.ts. The verbatim relative path is preserved in both the CJS
(dist/...) and ESM (dist/esm/...) outputs, but dist/esm/ is one directory
deeper than src/, so the path resolves one segment too high
(packages/docs-mintlify/docs.json instead of docs-mintlify/docs.json).
The CJS build only worked by accident because its depth matched src/.
The published package would have been broken regardless — docs-mintlify/
isn't in stack-shared's "files".

Carve out JSON imports in the force-external plugin so they get inlined
into the dist artifacts. docs.json is 7KB; the only JSON import in
stack-shared/src is this one.
2026-05-26 13:22:41 -07:00

29 lines
788 B
JSON

{
"name": "@stackframe/skills",
"version": "2.8.105",
"repository": "https://github.com/hexclave/stack-auth",
"private": true,
"type": "module",
"scripts": {
"clean": "rimraf .next && rimraf node_modules",
"typecheck": "tsc --noEmit",
"dev": "next dev --turbopack --port ${NEXT_PUBLIC_HEXCLAVE_PORT_PREFIX:-81}45",
"build": "next build",
"start": "next start --port ${NEXT_PUBLIC_HEXCLAVE_PORT_PREFIX:-81}45",
"lint": "eslint ."
},
"dependencies": {
"@stackframe/stack-shared": "workspace:*",
"next": "16.1.7",
"react": "19.2.3",
"react-dom": "19.2.3"
},
"devDependencies": {
"@types/node": "20.17.6",
"@types/react": "^19.2.3",
"@types/react-dom": "^19.2.3",
"rimraf": "^5.0.5",
"typescript": "5.9.3"
}
}