You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add onPluginsReady callback to createApp, remove autoStart (#280)
* feat: add customize callback to createApp, remove autoStart
Replace the post-await extend/start ceremony with a declarative
`customize` callback on createApp config. The callback runs after
plugin setup but before the server starts, giving access to the
full appkit handle for registering custom routes or async setup.
- Add `customize` option to createApp config
- Server start is now orchestrated by createApp (lookup by name)
- Remove `autoStart` from public API, ServerConfig, and manifest
- Remove `start()` from server plugin exports
- Remove autoStart guards from extend() and getServer()
- Remove ServerError.autoStartConflict()
- Migrate dev-playground, template, and all tests
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
* feat: rename customize to onPluginsReady, add codemod CLI and runtime detection
Rename the lifecycle hook from `customize` to `onPluginsReady` to
clearly communicate when it fires (after plugins are ready, before
server starts).
Add `appkit codemod customize-callback` CLI command that auto-migrates
old autoStart/extend/start patterns to the new onPluginsReady callback.
Supports both .then() chain (Pattern A) and await + imperative
(Pattern B, with bail-out for complex cases).
Add runtime detection that throws helpful errors when users pass
autoStart to server() or call server.start() after upgrading,
directing them to run the codemod.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
* fix: exclude codemod fixture files from typecheck
The test fixture .ts files import @databricks/appkit which doesn't
exist in the shared package, causing tsc to fail in CI. Exclude
the fixtures directory from the shared tsconfig.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
* refactor: split codemod into separate PR
Remove the codemod CLI from this PR to keep the review focused
on the core lifecycle change. The codemod will land as a follow-up
with bug fixes from review.
Runtime detection (constructor autoStart throw + exports().start()
trap) stays since it's part of the migration story.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
* fix: add debug logging for onPluginsReady lifecycle hook
Log when the onPluginsReady hook starts and completes to aid
debugging in development mode.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
* fix: rename codemod reference to on-plugins-ready
Update runtime detection error messages to point users to
`npx appkit codemod on-plugins-ready` to match the hook name.
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
---------
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Co-authored-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
0 commit comments