Skip to content

fix(template): drop root postinstall typegen to avoid deploy cache-bust - #546

Merged
MarioCadenas merged 1 commit into
mainfrom
fix/template-remove-postinstall-typegen
Aug 21, 2026
Merged

fix(template): drop root postinstall typegen to avoid deploy cache-bust#546
MarioCadenas merged 1 commit into
mainfrom
fix/template-remove-postinstall-typegen

Conversation

@MarioCadenas

Copy link
Copy Markdown
Collaborator

What

Removes the redundant root postinstall: npm run typegen from the generated app template.

Why

A root postinstall runs on every npm install. In container-based deploys, a root install-lifecycle script forces the build to copy the full application source before installing dependencies — so any source-only change invalidates the cached dependency layer and reinstalls from scratch on redeploy.

Type generation is already wired where it is actually needed:

  • prebuild: npm run sync && npm run typegen -- --wait
  • predev: npm run sync && npm run typegen

so the postinstall invocation is redundant for both local dev and deploy (deploy runs npm installnpm run build, which triggers prebuild). Dropping it lets source-only redeploys reuse the cached dependency layer, which primarily benefits the developer inner loop (edit code → redeploy).

Safety

  • No functional change — typegen still runs via prebuild/predev.
  • The template imports no generated types directly (shared/appkit-types is only a tsconfig include, which tolerates an empty dir, plus a gitignored serving stub), so a fresh npm install && npm run typecheck without a build is unaffected.

Verification

  • template/package.json remains valid JSON; typegen/sync/prebuild/predev intact
  • Scaffold from the template; clean install / build / test / start
  • Redeploy after a source-only change; confirm the dependency layer is reused

The Databricks Apps runtime treats any root preinstall/install/postinstall/prepare script as source-dependent and copies the full source tree before installing dependencies (the Dockerfile slow path). That puts every generated AppKit app on the slow path, so any source edit invalidates the dependency layer and reruns `npm install` on redeploy.

Removing the root postinstall moves generated apps onto the runtime's manifest-first fast path, so source-only redeploys reuse the cached dependency layer. Type generation still runs where it is actually needed via `prebuild` and `predev`, so generated apps are functionally unchanged.

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas
MarioCadenas requested a review from a team as a code owner August 21, 2026 14:20
@MarioCadenas
MarioCadenas requested a review from pkosiec August 21, 2026 14:20
@MarioCadenas
MarioCadenas enabled auto-merge (squash) August 21, 2026 14:25
@github-actions

Copy link
Copy Markdown
Contributor

🤖 AppKit PR bot

🔬 Run evals

Start an eval for this PR from the evals-monitor app: Go to Evals Monitor →

📦 Try this PR's app template

Scaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh auth login — and the Databricks CLI):

gh run download 32491644666 -R databricks/appkit -n appkit-template-0.64.0-pr.7c57306-fix-template-remove-postinstall-typegen-546 -D appkit-pr-546 \
  && unzip -o "appkit-pr-546/appkit-template-0.64.0-pr.7c57306-fix-template-remove-postinstall-typegen-546.zip" -d "appkit-pr-546" \
  && databricks apps init --template "appkit-pr-546"

The template pins @databricks/appkit and @databricks/appkit-ui to tarballs built from this branch, so the scaffolded app runs against this PR's code.

@MarioCadenas
MarioCadenas merged commit f44eff4 into main Aug 21, 2026
9 checks passed
@MarioCadenas
MarioCadenas deleted the fix/template-remove-postinstall-typegen branch August 21, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants