feat(cli): add 'appkit add' and 'appkit registry' commands - #462
feat(cli): add 'appkit add' and 'appkit registry' commands#462MarioCadenas wants to merge 13 commits into
Conversation
|
📦 Bundle size reportCompared against
|
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 822 KB (+31 KB) | 287 KB (+11 KB) |
| Type declarations | 302 KB (+17 KB) | 103 KB (+5.9 KB) |
| Source maps | 1.6 MB (+70 KB) | 537 KB (+23 KB) |
| Other | 11 KB | 3.7 KB |
| Total | 2.7 MB (+118 KB) | 931 KB (+39 KB) |
Per-entry composition (own code — deps external (as shipped))
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
. |
86 KB (+322 B) | 2.5 KB | 89 KB (+322 B) | external | 282 KB (+1.0 KB) |
./beta |
44 KB (+4.6 KB) | 429 B (+198 B) | 45 KB (+4.8 KB) | external | 129 KB (+9.5 KB) |
./type-generator |
19 KB (+291 B) | 0 B | 19 KB (+291 B) | external | 55 KB (+1.0 KB) |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
. |
index.js |
initial | 82 KB |
. |
utils.js |
initial | 4.0 KB |
. |
remote-tunnel-manager.js |
lazy | 2.5 KB |
./beta |
beta.js |
initial | 29 KB |
./beta |
stream-manager.js |
initial | 5.8 KB |
./beta |
wide-event-emitter.js |
initial | 3.2 KB |
./beta |
databricks.js |
initial | 3.0 KB |
./beta |
configuration.js |
initial | 2.1 KB |
./beta |
service-context.js |
initial | 1.3 KB |
./beta |
client-options.js |
initial | 220 B |
./beta |
supervisor-api.js |
lazy | 184 B |
./beta |
databricks.js |
lazy | 132 B |
./beta |
index.js |
lazy | 113 B |
./type-generator |
index.js |
initial | 19 KB |
@databricks/appkit-ui
npm tarball (packed): 305 KB (+101 B) — gzipped download (dist + bin; excludes release-only docs/NOTICE).
| dist | raw | gzip |
|---|---|---|
| JS (runtime) | 360 KB (+390 B) | 119 KB (+60 B) |
| Type declarations | 205 KB | 74 KB |
| Source maps | 686 KB (+390 B) | 224 KB (+66 B) |
| CSS | 16 KB | 3.3 KB |
| Total | 1.2 MB (+780 B) | 422 KB (+126 B) |
Per-entry composition (consumer bundle — deps bundled, peerDeps external)
| Entry | Initial (gz) | Lazy (gz) | Total (gz) | node_modules (min) | Own code (min) |
|---|---|---|---|---|---|
./js |
4.3 KB | 49 KB | 54 KB | 208 KB | 12 KB |
./js/beta |
20 B | 0 B | 20 B | 0 B | 0 B |
./react |
429 KB (+55 B) | 49 KB | 478 KB (+55 B) | 1.3 MB | 168 KB (+390 B) |
./react/beta |
20 B | 0 B | 20 B | 0 B | 0 B |
Chunks:
| Entry | Chunk | Load | Size (gz) |
|---|---|---|---|
./js |
index.js |
initial | 4.2 KB |
./js |
chunk |
initial | 120 B |
./js |
apache-arrow |
lazy | 49 KB |
./js/beta |
beta.js |
initial | 20 B |
./react |
index.js |
initial | 427 KB |
./react |
tslib |
initial | 2.1 KB |
./react |
apache-arrow |
lazy | 49 KB |
./react/beta |
beta.js |
initial | 20 B |
|
This pull request has had no activity for 23 days and has been marked as stale. It will be closed in 7 days if there is no further activity. Add a comment, push a commit, or apply the |
Add a shadcn-namespaced component registry workflow to the AppKit CLI: - 'appkit add <component...>' ensures the @AppKit registry namespace in the consumer's components.json, then delegates to 'shadcn add @appkit/<name>'. - 'appkit registry list' enumerates components from the registry index. Registry components import primitives from @databricks/appkit-ui (npm peer), so they stay in sync with the installed AppKit version and design tokens. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Serve the registry directly from the public GitHub repo over raw.githubusercontent.com instead of a placeholder host — no separate hosting infra needed. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Fetch registry items ourselves (token-aware) and hand a local file to 'shadcn add', rather than relying on a shadcn namespace — so we control the auth headers and the internal/private repo works today. - Token resolved from gh auth token, then APPKIT_REGISTRY_TOKEN / GITHUB_TOKEN / GH_TOKEN. - Private fetch uses the GitHub Contents API (Accept: raw); falls back to raw.githubusercontent.com when no token / once the repo is public. - 'appkit registry list' is token-aware too. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
AppKit registry items are self-contained (import from @databricks/appkit-ui, no shadcn @/ aliases or registryDependencies), so shadcn's alias resolution isn't needed. Write item files to their target path directly and install npm deps with the detected package manager — no components.json required. - Targets resolved under src/ when present. - --force to overwrite existing files (refuses by default). - Warns on any registryDependency rather than silently dropping it. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
'appkit add' is typically run from the repo root, where the frontend lives in a client/ subdir. Detect the frontend root (dir with components.json or src/, including common client/frontend/web/app subdirs) and write components under <frontend>/src/<target>. Install deps into the nearest package.json (single root package.json in the AppKit app layout). Add --cwd to override. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Server plugins can now be distributed through the same registry as UI components. 'appkit plugin add <name>' fetches a plugin item, writes it to plugins/<name>/ (verbatim targets, not under client/src), installs npm deps, runs 'plugin sync' to register it, and prints the createApp snippet plus any required env vars. - Extract shared fetch into registry/client.ts (reused by add + plugin add). - Detect plugin items by the presence of manifest.json. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
…server/plugins Remove the separate 'appkit plugin add' command. 'appkit add' now detects the item kind (plugin = has manifest.json) and routes: • UI components → <frontend>/src/components/appkit/ • server plugins → <server>/plugins/<name>/ (server/ subdir detected) then installs deps, runs plugin sync for plugins, and prints next steps. A single call can mix components and plugins. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
After placing a plugin and running sync, 'appkit add' edits the server entry
(server/index.ts etc.) to add the import and insert the plugin into the
createApp({ plugins: [...] }) array, reusing the ast-grep machinery from
'plugin sync'. Best-effort and safe:
• idempotent — skips if the plugin is already registered
• only edits the standard plugins:[...] array literal; otherwise falls back
to printing the manual snippet
• --no-register opts out of the server edit
Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
toPlugin exports are factories, so register as `hello()` (matching server(), analytics()), not a bare identifier. Insert before the first array element with its indentation so multi-line plugins arrays keep their formatting instead of jamming onto the opening-bracket line. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
- 'appkit registry list' shows a VERIFIED ✓ column (from item meta.verified) with a --verified filter; JSON output gains a top-level verified field. - Colorize list + add output with picocolors (green created/registered/✓, yellow updated/warnings, red errors, dim hints). Padding is applied before coloring so columns stay aligned; picocolors no-ops on non-TTY/NO_COLOR. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Derive a friendly kind per item: a manifest.json marks a plugin; otherwise map the shadcn registry:* type (component/hook/lib/theme/...). Adds a colorized TYPE column to the table and a 'kind' field to --json output. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
Adds a search subcommand so agents (and people) can match intent to items: matches all query terms against name, title, description, derived kind, and item categories. Shares the token-aware index fetch + table/JSON rendering with 'registry list'. --verified and --json supported. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
1bf0f75 to
bf0bf52
Compare
🤖 AppKit PR bot🔬 Run evalsStart an eval for this PR from the evals-monitor app: Go to Evals Monitor → 📦 Try this PR's app templateScaffolds a new app from this PR's SDK build. Run it in any folder (requires the GitHub CLI — gh run download 30819571572 -R databricks/appkit -n appkit-template-0.48.0-pr.0baf6bd-feat-registry-cli-462 -D appkit-pr-462 \
&& unzip -o "appkit-pr-462/appkit-template-0.48.0-pr.0baf6bd-feat-registry-cli-462.zip" -d "appkit-pr-462" \
&& databricks apps init --template "appkit-pr-462"The template pins |
Match the registry rename (registry.json name: appkit -> databricks-appkit) so `appkit add` writes the @databricks-appkit namespace into components.json and stripNamespace() strips the same prefix. Co-authored-by: Isaac
Add a shadcn-namespaced component registry workflow to the AppKit CLI:
appkit add <item...>ensures the@databricks-appkitregistry namespace in the consumer'scomponents.json, then delegates toshadcn add @databricks-appkit/<name>. It auto-detects UI components vs server plugins and routes each to the right place (plugins also runplugin syncand get registered increateApp).appkit registry listenumerates items from the registry index, showing each item's type and a marker for verified items.appkit registry searchfilters items by name / description / type / keywords.Registry components import primitives from
@databricks/appkit-ui(npm peer), so they stay in sync with the installed AppKit version and design tokens.Paired change
The registry itself is renamed to
@databricks-appkitin databricks/appkit-registry#1; this PR'sREGISTRY_NAMESPACEmatches it.This pull request and its description were written by Isaac.