Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/but-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"types": "./src/generated/index.d.ts",
"scripts": {
"artifacts": "napi artifacts",
"build:types": "cargo run -p but-ts -- --output ./src/generated/index.d.ts",
"build:napi": "napi build --platform --release --esm --manifest-path ../../crates/but-napi/Cargo.toml --js index.js --dts index.d.ts --output-dir ./src/generated/.",
"build": "pnpm build:napi && pnpm build:types",
"build:debug": "napi build --platform --esm --manifest-path ../../crates/but-napi/Cargo.toml --js index.js --dts index.d.ts --output-dir . --verbose",
"compile:types": "cargo run -p but-ts -- --output ./src/generated/index.d.ts",
"compile:napi": "napi build --platform --release --esm --manifest-path ../../crates/but-napi/Cargo.toml --js index.js --dts index.d.ts --output-dir ./src/generated/.",
"compile": "pnpm compile:napi && pnpm compile:types",
"compile:debug": "napi build --platform --esm --manifest-path ../../crates/but-napi/Cargo.toml --js index.js --dts index.d.ts --output-dir . --verbose",
Comment thread
Caleb-T-Owens marked this conversation as resolved.
"check": "tsc -p tsconfig.generated.json --noEmit",
"prepublishOnly": "napi prepublish -t npm",
"testTypes": "ts-node ./src/test.ts",
Expand Down
9 changes: 6 additions & 3 deletions turbo.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"$schema": "https://turborepo.org/schema.json",
"tasks": {
"compile": {
"outputs": ["dist/**", ".svelte-kit/**", "src/generated/**"]
},
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compile in @gitbutler/but-sdk depends on Rust sources outside the package directory (../../crates/but-napi, but-ts, and likely but-api schemas). With Turbo caching enabled and no explicit inputs/globalDependencies, changes in those crates may not invalidate the compile cache, leaving src/generated stale. Consider adding explicit inputs for the relevant crates/** paths (and Cargo.lock), or mark compile as non-cacheable if correctness is more important than caching.

Suggested change
},
},
"@gitbutler/but-sdk#compile": {
"inputs": [
"$TURBO_DEFAULT$",
"$TURBO_ROOT$/Cargo.lock",
"$TURBO_ROOT$/crates/but-napi/**",
"$TURBO_ROOT$/crates/but-ts/**",
"$TURBO_ROOT$/crates/but-api/**"
],
"outputs": ["dist/**", ".svelte-kit/**", "src/generated/**"]
},

Copilot uses AI. Check for mistakes.
"package": {
"dependsOn": ["^package"],
"dependsOn": ["^package", "^compile"],
"outputs": ["dist/**", ".svelte-kit/**"]
},
"build": {
"dependsOn": ["package"],
"dependsOn": ["package", "^compile"],
"passThroughEnv": ["SENTRY_AUTH_TOKEN", "GITHUB_TOKEN"],
Comment on lines 11 to 13
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build.dependsOn includes "compile" without the ^ prefix, so Turbo will only try to run compile in the same package. Apps like @gitbutler/desktop don’t have a compile script, and this won’t force @gitbutler/but-sdk to compile before the app build even though it’s a dependency. Use ^compile here (and keep compile too only if the package itself needs it).

Copilot uses AI. Check for mistakes.
"env": ["SENTRY_RELEASE"],
"outputs": [
Expand All @@ -18,7 +21,7 @@
]
},
"dev": {
"dependsOn": ["package"],
"dependsOn": ["package", "compile"],
Copy link

Copilot AI Apr 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dev.dependsOn includes "compile" without the ^ prefix, so Turbo won’t run dependency compiles (notably @gitbutler/but-sdk) before starting dev servers. Since desktop/lite import types/runtime from @gitbutler/but-sdk, consider switching this to ^compile (and optionally compile if the package has its own compile step).

Suggested change
"dependsOn": ["package", "compile"],
"dependsOn": ["package", "^compile", "compile"],

Copilot uses AI. Check for mistakes.
"cache": false,
"persistent": true
},
Expand Down
Loading