Skip to content

Commit 04f4c88

Browse files
committed
feat: new apps commands
chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup chore: fixup
1 parent 4b1439b commit 04f4c88

75 files changed

Lines changed: 6273 additions & 31 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

cmd/experimental/experimental.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package experimental
33
import (
44
"github.com/databricks/cli/experimental/aitools"
55
mcp "github.com/databricks/cli/experimental/apps-mcp/cmd"
6+
"github.com/databricks/cli/experimental/dev/cmd"
67
"github.com/spf13/cobra"
78
)
89

@@ -22,6 +23,7 @@ development. They may change or be removed in future versions without notice.`,
2223
}
2324

2425
cmd.AddCommand(aitools.New())
26+
cmd.AddCommand(dev.New())
2527
cmd.AddCommand(mcp.NewMcpCmd())
2628

2729
return cmd

cmd/workspace/apps/overrides.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ func listDeploymentsOverride(listDeploymentsCmd *cobra.Command, listDeploymentsR
2323
}
2424

2525
func createOverride(createCmd *cobra.Command, createReq *apps.CreateAppRequest) {
26+
createCmd.Short = `Create an app in your workspace.`
27+
createCmd.Long = `Create an app in your workspace.`
28+
2629
originalRunE := createCmd.RunE
2730
createCmd.RunE = func(cmd *cobra.Command, args []string) error {
2831
err := originalRunE(cmd, args)

experimental/apps-mcp/templates/appkit/databricks_template_schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"sql_warehouse_id": {
1111
"type": "string",
1212
"description": "SQL Warehouse ID",
13+
"default": "",
1314
"order": 2
1415
},
1516
"profile": {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DATABRICKS_HOST=https://...
2+
{{- if .dotenv_example}}
3+
{{.dotenv_example}}
4+
{{- end}}
5+
DATABRICKS_APP_PORT=8000
6+
DATABRICKS_APP_NAME=minimal
7+
FLASK_RUN_HOST=0.0.0.0
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{if ne .profile ""}}DATABRICKS_CONFIG_PROFILE={{.profile}}{{else}}DATABRICKS_HOST={{workspace_host}}{{end}}
2+
{{- if .dotenv}}
3+
{{.dotenv}}
4+
{{- end}}
5+
DATABRICKS_APP_PORT=8000
6+
DATABRICKS_APP_NAME={{.project_name}}
7+
FLASK_RUN_HOST=0.0.0.0
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
client/dist/
3+
dist/
4+
build/
5+
.env
6+
.databricks/
7+
.smoke-test/
8+
test-results/
9+
playwright-report/
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Dependencies
2+
node_modules
3+
4+
# Build outputs
5+
dist
6+
build
7+
client/dist
8+
.next
9+
.databricks/
10+
11+
# Environment files
12+
.env
13+
.env.local
14+
.env.*.local
15+
16+
# Logs
17+
logs
18+
*.log
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
# Coverage
24+
coverage
25+
26+
# Cache
27+
.cache
28+
.turbo
29+
30+
# Lock files
31+
package-lock.json
32+
yarn.lock
33+
pnpm-lock.yaml
34+
35+
# Vendor
36+
vendor
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 120,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf",
10+
"bracketSpacing": true,
11+
"jsxSingleQuote": false
12+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CLAUDE.md
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
TypeScript full-stack template powered by **Databricks AppKit** with tRPC for additional custom API endpoints.
2+
3+
- server/: Node.js backend with App Kit and tRPC
4+
- client/: React frontend with App Kit hooks and tRPC client
5+
- config/queries/: SQL query files for analytics
6+
- shared/: Shared TypeScript types
7+
- docs/: Detailed documentation on using App Kit features
8+
9+
## Quick Start: Your First Query & Chart
10+
11+
Follow these 3 steps to add data visualization to your app:
12+
13+
**Step 1: Create a SQL query file**
14+
15+
```sql
16+
-- config/queries/my_data.sql
17+
SELECT category, COUNT(*) as count, AVG(value) as avg_value
18+
FROM my_table
19+
GROUP BY category
20+
```
21+
22+
**Step 2: Define the schema**
23+
24+
```typescript
25+
// config/queries/schema.ts
26+
export const querySchemas = {
27+
my_data: z.array(
28+
z.object({
29+
category: z.string(),
30+
count: z.number(),
31+
avg_value: z.number(),
32+
})
33+
),
34+
};
35+
```
36+
37+
**Step 3: Add visualization to your app**
38+
39+
```typescript
40+
// client/src/App.tsx
41+
import { BarChart } from '@databricks/appkit-ui/react';
42+
43+
<BarChart queryKey="my_data" parameters={{}} />
44+
```
45+
46+
**That's it!** The component handles data fetching, loading states, and rendering automatically.
47+
48+
**To refresh TypeScript types after adding queries:**
49+
- Run `npm run typegen` OR run `npm run dev` - both auto-generate type definitions in `client/src/appKitTypes.d.ts`
50+
- DO NOT manually edit `appKitTypes.d.ts`
51+
52+
## Installation
53+
54+
**IMPORTANT**: When running `npm install`, always use `required_permissions: ['all']` to avoid sandbox permission errors.
55+
56+
## NPM Scripts
57+
58+
### Development
59+
- `npm run dev` - Start dev server with hot reload (**ALWAYS use during development**)
60+
61+
### Testing and Code Quality
62+
See the databricks experimental apps-mcp tools validate instead of running these individually.
63+
64+
### Utility
65+
- `npm run clean` - Remove all build artifacts and node_modules
66+
67+
**Common workflows:**
68+
- Development: `npm run dev` → make changes → `npm run typecheck``npm run lint:fix`
69+
- Pre-deploy: Validate with `databricks experimental apps-mcp tools validate .`
70+
71+
## Documentation
72+
73+
**IMPORTANT**: Read the relevant docs below before implementing features. They contain critical information about common pitfalls (e.g., SQL numeric type handling, schema definitions, Radix UI constraints).
74+
75+
- [SQL Queries](docs/sql-queries.md) - query files, schemas, type handling, parameterization
76+
- [App Kit SDK](docs/appkit-sdk.md) - TypeScript imports, server setup, useAnalyticsQuery hook
77+
- [Frontend](docs/frontend.md) - visualization components, styling, layout, Radix constraints
78+
- [tRPC](docs/trpc.md) - custom endpoints for non-SQL operations (mutations, Databricks APIs)
79+
- [Testing](docs/testing.md) - vitest unit tests, Playwright smoke/E2E tests

0 commit comments

Comments
 (0)