Repository navigation
Optimize package builds for faster outputs - #1791
mantrakp04 wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe changes exclude test files and duplicate declarations from library builds, remove source directories from published packages, update package-manager scripts and Turbo, add tsdown TypeScript settings, and configure VS Code to use the repository TypeScript SDK. ChangesBuild and package distribution
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
1 issue found across 15 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="turbo.json">
<violation number="1" location="turbo.json:163">
P2: The build outputs for `@hexclave/hosted-components` and `@hexclave/example-tanstack-start-demo` won't be cached by Turbo. Both use `vite build` (Nitro/TanStack Start) which outputs to `.output/`, but the inherited root `build` outputs only track `.next/**` and `dist/**`. Every invocation will run a full Vite/Nitro build even when nothing changed. Add a package-specific `outputs` entry like `".output/**"` and/or `"!.output/server/**"` to match the actual output and enable caching.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| "VITE_STACK_*" | ||
| ] | ||
| }, | ||
| "@hexclave/hosted-components#build": { |
There was a problem hiding this comment.
P2: The build outputs for @hexclave/hosted-components and @hexclave/example-tanstack-start-demo won't be cached by Turbo. Both use vite build (Nitro/TanStack Start) which outputs to .output/, but the inherited root build outputs only track .next/** and dist/**. Every invocation will run a full Vite/Nitro build even when nothing changed. Add a package-specific outputs entry like ".output/**" and/or "!.output/server/**" to match the actual output and enable caching.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At turbo.json, line 163:
<comment>The build outputs for `@hexclave/hosted-components` and `@hexclave/example-tanstack-start-demo` won't be cached by Turbo. Both use `vite build` (Nitro/TanStack Start) which outputs to `.output/`, but the inherited root `build` outputs only track `.next/**` and `dist/**`. Every invocation will run a full Vite/Nitro build even when nothing changed. Add a package-specific `outputs` entry like `".output/**"` and/or `"!.output/server/**"` to match the actual output and enable caching.</comment>
<file context>
@@ -101,28 +101,81 @@
+ "VITE_STACK_*"
+ ]
+ },
+ "@hexclave/hosted-components#build": {
+ "dependsOn": [
+ "^build"
</file context>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.vscode/settings.json:
- Line 188: Update the VS Code TypeScript settings alongside js/ts.tsdk.path to
enable prompting for the workspace TypeScript version, ensuring fresh clones can
use the repository version for IntelliSense without requiring manual selection.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e73f3f73-42d3-4a70-914c-accfc42ed389
📒 Files selected for processing (2)
.vscode/settings.jsonconfigs/tsdown/tsconfig.json
| "git.ignoreLimitWarning": true, | ||
| "chatgpt.commentCodeLensEnabled": false | ||
| "chatgpt.commentCodeLensEnabled": false, | ||
| "js/ts.tsdk.path": "node_modules/typescript/lib" |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== .vscode/settings.json tsdk settings =="
if [ -f .vscode/settings.json ]; then
nl -ba .vscode/settings.json | sed -n '170,195p'
else
echo ".vscode/settings.json not found"
fi
echo "== TypeScript declarations =="
if [ -f package.json ]; then
node -e 'const p=require("./package.json"); console.log(JSON.stringify({dependencies:p.dependencies,devDependencies:p.devDependencies},null,2))' | sed -n '/"typescript"/,+4p'
fi
echo "== VS Code config references to tsdk/packageInfo/enforce =="
rg -n --hidden --glob '.vscode/settings.json' --glob 'README.md' --glob '*.md' --glob '*.yml' --glob '*.yaml' --glob 'package.json' \
'tsdk|TypeScript: Select TypeScript Version|packageInfo|workspace trust|typescript' .vscode README.md package.json 2>/dev/null || trueRepository: hexclave/hexclave
Length of output: 237
🌐 Web query:
VS Code TypeScript workspace setting js/ts.tsdk.path select TypeScript Version documentation
💡 Result:
To configure Visual Studio Code to use a specific version of TypeScript for your workspace, you should use the js/ts.tsdk.path setting [1][2]. This setting replaced the deprecated typescript.tsdk ID as part of a unification of JavaScript and TypeScript settings [3][4]. Steps to use a workspace TypeScript version: 1. Installation: Ensure you have installed the desired version of TypeScript locally in your project, typically in your node_modules directory [1][2]. 2. Configure Path: Add the js/ts.tsdk.path setting to your.vscode/settings.json file, pointing to the directory containing the tsserver.js file (usually the lib folder) [1][2][5]. { "js/ts.tsdk.path": "./node_modules/typescript/lib" } 3. Select Version: Simply defining this path in your workspace settings makes the TypeScript version available to VS Code [1][5]. To begin using this version for IntelliSense, you must manually run the TypeScript: Select TypeScript Version command from the Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and choose the workspace version [1][6][2]. Note that when the setting is defined in your workspace, VS Code does not automatically switch to it; you must perform the manual selection step mentioned above [1][2][7]. If you want VS Code to prompt you to use the workspace version when opening the project, you can add the following to your settings [8][7]: { "js/ts.tsdk.promptToUseWorkspaceVersion": true } The js/ts.tsdk.path setting must point to a valid full TypeScript installation that includes the package.json file [5]. For further details on managing TypeScript versions, you can refer to the official Visual Studio Code documentation on TypeScript transpiling [2][5].
Citations:
- 1: https://github.com/microsoft/vscode-docs/blob/2e31a7ce/docs/typescript/typescript-transpiling.md
- 2: https://code.visualstudio.com/docs/typescript/typescript-transpiling
- 3: migrate js/ts settings microsoft/vscode#297312
- 4: microsoft/vscode@830b948
- 5: https://github.com/microsoft/vscode-docs/blob/main/docs/typescript/typescript-transpiling.md
- 6: https://github.com/microsoft/TypeScript-wiki/blob/main/Debugging-Language-Service-in-VS-Code.md
- 7: https://stackoverflow.com/questions/49949148/how-to-use-typescript-version-defined-in-settings-json-by-default-in-vscode
- 8: https://stackoverflow.com/questions/74642723/how-do-i-force-visual-studio-code-to-always-use-my-workspaces-version-of-typesc
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== .vscode/settings.json tsdk settings =="
if [ -f .vscode/settings.json ]; then
awk '{printf "%6d\t%s\n", NR, $0}' .vscode/settings.json | sed -n '170,195p'
else
echo ".vscode/settings.json not found"
fi
echo "== TypeScript declarations in package.json =="
if [ -f package.json ]; then
awk '
/"typescript"/ {
print
# print next two lines if they are part of same dependency block
for (i=1;i<=2;i++) { getline; print }
}
' package.json
fi
echo "== Related VS Code/TypeScript references =="
rg -n --hidden --glob '.vscode/settings.json' --glob 'README.md' --glob '*.md' --glob '*.yml' --glob '*.yaml' --glob 'package.json' \
'js/ts\.tsdk\.path|typescript\.tsdk|Select TypeScript Version|promptToUseWorkspaceVersion|workspace trust|typescript' .vscode README.md package.json 2>/dev/null || trueRepository: hexclave/hexclave
Length of output: 2416
Prompt to use the workspace TypeScript version
js/ts.tsdk.path only exposes node_modules/typescript/lib to VS Code; users still need to run TypeScript: Select TypeScript Version and choose the workspace version. Add js/ts.tsdk.promptToUseWorkspaceVersion: true or another mechanism if fresh clones are expected to use the repository TypeScript version for IntelliSense.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.vscode/settings.json at line 188, Update the VS Code TypeScript settings
alongside js/ts.tsdk.path to enable prompting for the workspace TypeScript
version, ensuring fresh clones can use the repository version for IntelliSense
without requiring manual selection.
There was a problem hiding this comment.
1 issue found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".vscode/settings.json">
<violation number="1" location=".vscode/settings.json:188">
P3: The `js/ts.tsdk.path` setting tells VS Code where to find the workspace TypeScript, but without the companion `js/ts.tsdk.promptToUseWorkspaceVersion: true` setting, users on fresh clones won't be prompted to actually use it — they'll silently get VS Code's built-in TypeScript for IntelliSense instead.
Consider adding:
```json
"js/ts.tsdk.promptToUseWorkspaceVersion": true
```</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| "git.ignoreLimitWarning": true, | ||
| "chatgpt.commentCodeLensEnabled": false | ||
| "chatgpt.commentCodeLensEnabled": false, | ||
| "js/ts.tsdk.path": "node_modules/typescript/lib" |
There was a problem hiding this comment.
P3: The js/ts.tsdk.path setting tells VS Code where to find the workspace TypeScript, but without the companion js/ts.tsdk.promptToUseWorkspaceVersion: true setting, users on fresh clones won't be prompted to actually use it — they'll silently get VS Code's built-in TypeScript for IntelliSense instead.
Consider adding:
"js/ts.tsdk.promptToUseWorkspaceVersion": truePrompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At .vscode/settings.json, line 188:
<comment>The `js/ts.tsdk.path` setting tells VS Code where to find the workspace TypeScript, but without the companion `js/ts.tsdk.promptToUseWorkspaceVersion: true` setting, users on fresh clones won't be prompted to actually use it — they'll silently get VS Code's built-in TypeScript for IntelliSense instead.
Consider adding:
```json
"js/ts.tsdk.promptToUseWorkspaceVersion": true
```</comment>
<file context>
@@ -184,5 +184,6 @@
"git.ignoreLimitWarning": true,
- "chatgpt.commentCodeLensEnabled": false
+ "chatgpt.commentCodeLensEnabled": false,
+ "js/ts.tsdk.path": "node_modules/typescript/lib"
}
</file context>
| "js/ts.tsdk.path": "node_modules/typescript/lib" | |
| "js/ts.tsdk.path": "node_modules/typescript/lib", | |
| "js/ts.tsdk.promptToUseWorkspaceVersion": true |
| "pre-no-codegen": "pnpm exec only-allow pnpm", | ||
| "pre-preinstall": "pnpx only-allow@1.2.2 pnpm && node -e \"if(process.env.HEXCLAVE_SKIP_TEMPLATE_GENERATION !== 'true') require('child_process').execSync('pnpm exec tsx ./scripts/generate-sdks.ts', {stdio: 'inherit'})\"", | ||
| "pre-no-codegen": "only-allow pnpm", | ||
| "pre-preinstall": "only-allow pnpm && node -e \"if(process.env.HEXCLAVE_SKIP_TEMPLATE_GENERATION !== 'true') require('child_process').execSync('pnpm exec tsx ./scripts/generate-sdks.ts', {stdio: 'inherit'})\"", |
There was a problem hiding this comment.
i don't think this will work because it needs to run pre install — we don't have only-allow installed yet at that point
| "files": [ | ||
| "README.md", | ||
| "dist", | ||
| "src", |
There was a problem hiding this comment.
the reason we had this is because ai agents use it to infer things about the source code
| "NEXT_PUBLIC_*", | ||
| "VITE_*", |
Summary
Testing
Not run (not requested)
Summary by cubic
Speeds up package builds and trims published artifacts by excluding tests, stopping source publication, and avoiding duplicate ESM type output. Refines
turbooutputs and env scoping to improve caching and build times, upgradesturbo, and adds workspace typings fortsdownconfigs.Refactors
*.test.*and*.spec.*fromtsupentries inconfigs/tsdown/js-library.ts.dts: falseto emit types once fromdist, reducing work and artifacts.srcfolders by removing them fromfilesin package manifests.turbo.jsonoutputs to.next/**(excluding.next/cache/**) and scope envs for@hexclave/*builds (NEXT_PUBLIC_HEXCLAVE_*,VITE_HEXCLAVE_*, etc.) to avoid unnecessary cache busting.only-allow pnpm.configs/tsdown/tsconfig.jsonand set VS Code to use workspace TypeScript (js/ts.tsdk.path) for correct IDE typings in build configs.Dependencies
turboto^2.10.5.pnpm-lock.yaml, bumping@supabase/supabase-jsand related packages.Written for commit 6f508dc. Summary will update on new commits.
Summary by CodeRabbit
src; only build output plus docs (README/CHANGELOG/LICENSE) are shipped.