@databricks/appkit 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +52 -0
- package/CLAUDE.md +52 -0
- package/NOTICE.md +2 -0
- package/README.md +21 -15
- package/bin/appkit-lint.js +129 -0
- package/dist/analytics/analytics.d.ts.map +1 -1
- package/dist/analytics/analytics.js +16 -3
- package/dist/analytics/analytics.js.map +1 -1
- package/dist/analytics/query.js +8 -2
- package/dist/analytics/query.js.map +1 -1
- package/dist/app/index.d.ts.map +1 -1
- package/dist/app/index.js +7 -5
- package/dist/app/index.js.map +1 -1
- package/dist/appkit/package.js +1 -1
- package/dist/cache/index.d.ts.map +1 -1
- package/dist/cache/index.js +24 -3
- package/dist/cache/index.js.map +1 -1
- package/dist/cache/storage/persistent.js +12 -6
- package/dist/cache/storage/persistent.js.map +1 -1
- package/dist/connectors/lakebase/client.js +25 -14
- package/dist/connectors/lakebase/client.js.map +1 -1
- package/dist/connectors/sql-warehouse/client.js +68 -28
- package/dist/connectors/sql-warehouse/client.js.map +1 -1
- package/dist/context/service-context.js +13 -8
- package/dist/context/service-context.js.map +1 -1
- package/dist/errors/authentication.d.ts +38 -0
- package/dist/errors/authentication.d.ts.map +1 -0
- package/dist/errors/authentication.js +48 -0
- package/dist/errors/authentication.js.map +1 -0
- package/dist/errors/base.d.ts +58 -0
- package/dist/errors/base.d.ts.map +1 -0
- package/dist/errors/base.js +70 -0
- package/dist/errors/base.js.map +1 -0
- package/dist/errors/configuration.d.ts +38 -0
- package/dist/errors/configuration.d.ts.map +1 -0
- package/dist/errors/configuration.js +45 -0
- package/dist/errors/configuration.js.map +1 -0
- package/dist/errors/connection.d.ts +42 -0
- package/dist/errors/connection.d.ts.map +1 -0
- package/dist/errors/connection.js +54 -0
- package/dist/errors/connection.js.map +1 -0
- package/dist/errors/execution.d.ts +42 -0
- package/dist/errors/execution.d.ts.map +1 -0
- package/dist/errors/execution.js +51 -0
- package/dist/errors/execution.js.map +1 -0
- package/dist/errors/index.js +28 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/initialization.d.ts +34 -0
- package/dist/errors/initialization.d.ts.map +1 -0
- package/dist/errors/initialization.js +42 -0
- package/dist/errors/initialization.js.map +1 -0
- package/dist/errors/server.d.ts +38 -0
- package/dist/errors/server.d.ts.map +1 -0
- package/dist/errors/server.js +45 -0
- package/dist/errors/server.js.map +1 -0
- package/dist/errors/tunnel.d.ts +38 -0
- package/dist/errors/tunnel.d.ts.map +1 -0
- package/dist/errors/tunnel.js +51 -0
- package/dist/errors/tunnel.js.map +1 -0
- package/dist/errors/validation.d.ts +36 -0
- package/dist/errors/validation.d.ts.map +1 -0
- package/dist/errors/validation.js +45 -0
- package/dist/errors/validation.js.map +1 -0
- package/dist/index.d.ts +12 -3
- package/dist/index.js +18 -3
- package/dist/index.js.map +1 -0
- package/dist/logging/logger.js +179 -0
- package/dist/logging/logger.js.map +1 -0
- package/dist/logging/sampling.js +56 -0
- package/dist/logging/sampling.js.map +1 -0
- package/dist/logging/wide-event-emitter.js +108 -0
- package/dist/logging/wide-event-emitter.js.map +1 -0
- package/dist/logging/wide-event.js +167 -0
- package/dist/logging/wide-event.js.map +1 -0
- package/dist/plugin/dev-reader.d.ts.map +1 -1
- package/dist/plugin/dev-reader.js +8 -3
- package/dist/plugin/dev-reader.js.map +1 -1
- package/dist/plugin/interceptors/cache.js.map +1 -1
- package/dist/plugin/interceptors/retry.js +10 -2
- package/dist/plugin/interceptors/retry.js.map +1 -1
- package/dist/plugin/interceptors/telemetry.js +24 -9
- package/dist/plugin/interceptors/telemetry.js.map +1 -1
- package/dist/plugin/interceptors/timeout.js +4 -0
- package/dist/plugin/interceptors/timeout.js.map +1 -1
- package/dist/plugin/plugin.d.ts +1 -1
- package/dist/plugin/plugin.d.ts.map +1 -1
- package/dist/plugin/plugin.js +9 -4
- package/dist/plugin/plugin.js.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +22 -17
- package/dist/server/index.js.map +1 -1
- package/dist/server/remote-tunnel/remote-tunnel-controller.js +4 -2
- package/dist/server/remote-tunnel/remote-tunnel-controller.js.map +1 -1
- package/dist/server/remote-tunnel/remote-tunnel-manager.js +10 -8
- package/dist/server/remote-tunnel/remote-tunnel-manager.js.map +1 -1
- package/dist/server/vite-dev-server.js +8 -3
- package/dist/server/vite-dev-server.js.map +1 -1
- package/dist/stream/arrow-stream-processor.js +13 -6
- package/dist/stream/arrow-stream-processor.js.map +1 -1
- package/dist/stream/buffers.js +5 -1
- package/dist/stream/buffers.js.map +1 -1
- package/dist/stream/stream-manager.d.ts.map +1 -1
- package/dist/stream/stream-manager.js +47 -36
- package/dist/stream/stream-manager.js.map +1 -1
- package/dist/stream/types.js.map +1 -1
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/index.js +2 -2
- package/dist/telemetry/instrumentations.js +14 -10
- package/dist/telemetry/instrumentations.js.map +1 -1
- package/dist/telemetry/telemetry-manager.js +8 -6
- package/dist/telemetry/telemetry-manager.js.map +1 -1
- package/dist/telemetry/trace-sampler.js +33 -0
- package/dist/telemetry/trace-sampler.js.map +1 -0
- package/dist/type-generator/index.js +4 -2
- package/dist/type-generator/index.js.map +1 -1
- package/dist/type-generator/query-registry.js +4 -2
- package/dist/type-generator/query-registry.js.map +1 -1
- package/dist/type-generator/vite-plugin.d.ts.map +1 -1
- package/dist/type-generator/vite-plugin.js +5 -3
- package/dist/type-generator/vite-plugin.js.map +1 -1
- package/dist/utils/env-validator.js +5 -1
- package/dist/utils/env-validator.js.map +1 -1
- package/dist/utils/path-exclusions.js +66 -0
- package/dist/utils/path-exclusions.js.map +1 -0
- package/llms.txt +52 -0
- package/package.json +4 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { createLogger } from "../logging/logger.js";
|
|
1
2
|
import { generateFromEntryPoint } from "./index.js";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import fs from "node:fs";
|
|
4
5
|
|
|
5
6
|
//#region src/type-generator/vite-plugin.ts
|
|
7
|
+
const logger = createLogger("type-generator:vite-plugin");
|
|
6
8
|
/**
|
|
7
9
|
* Vite plugin to generate types for AppKit queries.
|
|
8
10
|
* Calls generateFromEntryPoint under the hood.
|
|
@@ -17,7 +19,7 @@ function appKitTypesPlugin(options) {
|
|
|
17
19
|
try {
|
|
18
20
|
const warehouseId = process.env.DATABRICKS_WAREHOUSE_ID || "";
|
|
19
21
|
if (!warehouseId) {
|
|
20
|
-
|
|
22
|
+
logger.debug("Warehouse ID not found. Skipping type generation.");
|
|
21
23
|
return;
|
|
22
24
|
}
|
|
23
25
|
await generateFromEntryPoint({
|
|
@@ -28,14 +30,14 @@ function appKitTypesPlugin(options) {
|
|
|
28
30
|
});
|
|
29
31
|
} catch (error) {
|
|
30
32
|
if (process.env.NODE_ENV === "production") throw error;
|
|
31
|
-
|
|
33
|
+
logger.error("Error generating types: %O", error);
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
return {
|
|
35
37
|
name: "appkit-types",
|
|
36
38
|
apply() {
|
|
37
39
|
if (!(process.env.DATABRICKS_WAREHOUSE_ID || "")) {
|
|
38
|
-
|
|
40
|
+
logger.debug("Warehouse ID not found. Skipping type generation.");
|
|
39
41
|
return false;
|
|
40
42
|
}
|
|
41
43
|
if (!fs.existsSync(path.join(process.cwd(), "config", "queries"))) return false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin.js","names":[],"sources":["../../src/type-generator/vite-plugin.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { Plugin } from \"vite\";\nimport
|
|
1
|
+
{"version":3,"file":"vite-plugin.js","names":[],"sources":["../../src/type-generator/vite-plugin.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { Plugin } from \"vite\";\nimport { createLogger } from \"../logging/logger\";\nimport { generateFromEntryPoint } from \"./index\";\n\nconst logger = createLogger(\"type-generator:vite-plugin\");\n\n/**\n * Options for the AppKit types plugin.\n */\ninterface AppKitTypesPluginOptions {\n /* Path to the output d.ts file (relative to client folder). */\n outFile?: string;\n /** Folders to watch for changes. */\n watchFolders?: string[];\n}\n\n/**\n * Vite plugin to generate types for AppKit queries.\n * Calls generateFromEntryPoint under the hood.\n * @param options - Options to override default values.\n * @returns Vite plugin to generate types for AppKit queries.\n */\nexport function appKitTypesPlugin(options?: AppKitTypesPluginOptions): Plugin {\n let root: string;\n let outFile: string;\n let watchFolders: string[];\n\n async function generate() {\n try {\n const warehouseId = process.env.DATABRICKS_WAREHOUSE_ID || \"\";\n\n if (!warehouseId) {\n logger.debug(\"Warehouse ID not found. Skipping type generation.\");\n return;\n }\n\n await generateFromEntryPoint({\n outFile,\n queryFolder: watchFolders[0],\n warehouseId,\n noCache: false,\n });\n } catch (error) {\n // throw in production to fail the build\n if (process.env.NODE_ENV === \"production\") {\n throw error;\n }\n logger.error(\"Error generating types: %O\", error);\n }\n }\n\n return {\n name: \"appkit-types\",\n\n apply() {\n const warehouseId = process.env.DATABRICKS_WAREHOUSE_ID || \"\";\n\n if (!warehouseId) {\n logger.debug(\"Warehouse ID not found. Skipping type generation.\");\n return false;\n }\n\n if (!fs.existsSync(path.join(process.cwd(), \"config\", \"queries\"))) {\n return false;\n }\n\n return true;\n },\n\n configResolved(config) {\n root = config.root;\n outFile = path.resolve(root, options?.outFile ?? \"src/appKitTypes.d.ts\");\n watchFolders = options?.watchFolders ?? [\n path.join(process.cwd(), \"config\", \"queries\"),\n ];\n },\n\n buildStart() {\n generate();\n },\n\n configureServer(server) {\n server.watcher.add(watchFolders);\n\n server.watcher.on(\"change\", (changedFile) => {\n const isWatchedFile = watchFolders.some((folder) =>\n changedFile.startsWith(folder),\n );\n\n if (isWatchedFile && changedFile.endsWith(\".sql\")) {\n generate();\n }\n });\n },\n };\n}\n"],"mappings":";;;;;;AAMA,MAAM,SAAS,aAAa,6BAA6B;;;;;;;AAkBzD,SAAgB,kBAAkB,SAA4C;CAC5E,IAAI;CACJ,IAAI;CACJ,IAAI;CAEJ,eAAe,WAAW;AACxB,MAAI;GACF,MAAM,cAAc,QAAQ,IAAI,2BAA2B;AAE3D,OAAI,CAAC,aAAa;AAChB,WAAO,MAAM,oDAAoD;AACjE;;AAGF,SAAM,uBAAuB;IAC3B;IACA,aAAa,aAAa;IAC1B;IACA,SAAS;IACV,CAAC;WACK,OAAO;AAEd,OAAI,QAAQ,IAAI,aAAa,aAC3B,OAAM;AAER,UAAO,MAAM,8BAA8B,MAAM;;;AAIrD,QAAO;EACL,MAAM;EAEN,QAAQ;AAGN,OAAI,EAFgB,QAAQ,IAAI,2BAA2B,KAEzC;AAChB,WAAO,MAAM,oDAAoD;AACjE,WAAO;;AAGT,OAAI,CAAC,GAAG,WAAW,KAAK,KAAK,QAAQ,KAAK,EAAE,UAAU,UAAU,CAAC,CAC/D,QAAO;AAGT,UAAO;;EAGT,eAAe,QAAQ;AACrB,UAAO,OAAO;AACd,aAAU,KAAK,QAAQ,MAAM,SAAS,WAAW,uBAAuB;AACxE,kBAAe,SAAS,gBAAgB,CACtC,KAAK,KAAK,QAAQ,KAAK,EAAE,UAAU,UAAU,CAC9C;;EAGH,aAAa;AACX,aAAU;;EAGZ,gBAAgB,QAAQ;AACtB,UAAO,QAAQ,IAAI,aAAa;AAEhC,UAAO,QAAQ,GAAG,WAAW,gBAAgB;AAK3C,QAJsB,aAAa,MAAM,WACvC,YAAY,WAAW,OAAO,CAC/B,IAEoB,YAAY,SAAS,OAAO,CAC/C,WAAU;KAEZ;;EAEL"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { ValidationError } from "../errors/validation.js";
|
|
2
|
+
import { init_errors } from "../errors/index.js";
|
|
3
|
+
|
|
1
4
|
//#region src/utils/env-validator.ts
|
|
5
|
+
init_errors();
|
|
2
6
|
function validateEnv(envVars) {
|
|
3
7
|
const missingVars = [];
|
|
4
8
|
for (const envVar of envVars) if (!process.env[envVar]) missingVars.push(envVar);
|
|
5
|
-
if (missingVars.length > 0) throw
|
|
9
|
+
if (missingVars.length > 0) throw ValidationError.missingEnvVars(missingVars);
|
|
6
10
|
}
|
|
7
11
|
|
|
8
12
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env-validator.js","names":[],"sources":["../../src/utils/env-validator.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"env-validator.js","names":[],"sources":["../../src/utils/env-validator.ts"],"sourcesContent":["import { ValidationError } from \"../errors\";\n\nexport function validateEnv(envVars: string[]) {\n const missingVars = [];\n\n for (const envVar of envVars) {\n if (!process.env[envVar]) {\n missingVars.push(envVar);\n }\n }\n\n if (missingVars.length > 0) {\n throw ValidationError.missingEnvVars(missingVars);\n }\n}\n"],"mappings":";;;;aAA4C;AAE5C,SAAgB,YAAY,SAAmB;CAC7C,MAAM,cAAc,EAAE;AAEtB,MAAK,MAAM,UAAU,QACnB,KAAI,CAAC,QAAQ,IAAI,QACf,aAAY,KAAK,OAAO;AAI5B,KAAI,YAAY,SAAS,EACvB,OAAM,gBAAgB,eAAe,YAAY"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//#region src/utils/path-exclusions.ts
|
|
2
|
+
/**
|
|
3
|
+
* Paths and patterns to exclude from tracing and logging.
|
|
4
|
+
* Requests matching these will not create spans or WideEvents.
|
|
5
|
+
*/
|
|
6
|
+
const EXCLUDED_PATH_PREFIXES = [
|
|
7
|
+
"/@fs/",
|
|
8
|
+
"/@vite/",
|
|
9
|
+
"/@id/",
|
|
10
|
+
"/@react-refresh",
|
|
11
|
+
"/src/",
|
|
12
|
+
"/node_modules/",
|
|
13
|
+
"/favicon.ico",
|
|
14
|
+
"/_next/",
|
|
15
|
+
"/static/",
|
|
16
|
+
"/health",
|
|
17
|
+
"/metrics"
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* File extensions to exclude from tracing.
|
|
21
|
+
* These are typically static assets that don't need tracing.
|
|
22
|
+
*/
|
|
23
|
+
const EXCLUDED_EXTENSIONS = [
|
|
24
|
+
".svg",
|
|
25
|
+
".png",
|
|
26
|
+
".jpg",
|
|
27
|
+
".jpeg",
|
|
28
|
+
".gif",
|
|
29
|
+
".webp",
|
|
30
|
+
".ico",
|
|
31
|
+
".css",
|
|
32
|
+
".woff",
|
|
33
|
+
".woff2",
|
|
34
|
+
".ttf",
|
|
35
|
+
".eot",
|
|
36
|
+
".map",
|
|
37
|
+
".js"
|
|
38
|
+
];
|
|
39
|
+
/**
|
|
40
|
+
* Check if a request should be ignored for tracing.
|
|
41
|
+
* This is the primary filter used by HttpInstrumentation.
|
|
42
|
+
*/
|
|
43
|
+
function shouldIgnoreRequest(request) {
|
|
44
|
+
const url = request.url;
|
|
45
|
+
if (!url) return false;
|
|
46
|
+
const path = url.split("?")[0];
|
|
47
|
+
return shouldExcludePath(path);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if a path should be excluded from tracing/logging.
|
|
51
|
+
* Returns true if path should be excluded, false otherwise.
|
|
52
|
+
*/
|
|
53
|
+
function shouldExcludePath(path) {
|
|
54
|
+
if (typeof path !== "string") return false;
|
|
55
|
+
const cleanPath = path.split("?")[0];
|
|
56
|
+
const lowerPath = cleanPath.toLowerCase();
|
|
57
|
+
for (const prefix of EXCLUDED_PATH_PREFIXES) if (cleanPath.includes(prefix)) return true;
|
|
58
|
+
if (!cleanPath.startsWith("/api/")) {
|
|
59
|
+
for (const ext of EXCLUDED_EXTENSIONS) if (lowerPath.endsWith(ext)) return true;
|
|
60
|
+
}
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
//#endregion
|
|
65
|
+
export { shouldExcludePath, shouldIgnoreRequest };
|
|
66
|
+
//# sourceMappingURL=path-exclusions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-exclusions.js","names":[],"sources":["../../src/utils/path-exclusions.ts"],"sourcesContent":["import type { IncomingMessage } from \"node:http\";\n\n/**\n * Paths and patterns to exclude from tracing and logging.\n * Requests matching these will not create spans or WideEvents.\n */\nexport const EXCLUDED_PATH_PREFIXES = [\n // Vite dev server internals\n \"/@fs/\",\n \"/@vite/\",\n \"/@id/\",\n \"/@react-refresh\",\n \"/src/\", // Vite HMR source files\n \"/node_modules/\",\n\n // Static assets and common paths\n \"/favicon.ico\",\n \"/_next/\",\n \"/static/\",\n\n // Health checks\n \"/health\",\n \"/metrics\",\n];\n\n/**\n * File extensions to exclude from tracing.\n * These are typically static assets that don't need tracing.\n */\nexport const EXCLUDED_EXTENSIONS = [\n \".svg\",\n \".png\",\n \".jpg\",\n \".jpeg\",\n \".gif\",\n \".webp\",\n \".ico\",\n \".css\",\n \".woff\",\n \".woff2\",\n \".ttf\",\n \".eot\",\n \".map\", // Source maps\n \".js\", // Static JS files (not API endpoints)\n];\n\n/**\n * Check if a request should be ignored for tracing.\n * This is the primary filter used by HttpInstrumentation.\n */\nexport function shouldIgnoreRequest(request: IncomingMessage): boolean {\n const url = request.url;\n if (!url) return false;\n\n // Remove query string for path matching\n const path = url.split(\"?\")[0];\n\n return shouldExcludePath(path);\n}\n\n/**\n * Check if a path should be excluded from tracing/logging.\n * Returns true if path should be excluded, false otherwise.\n */\nexport function shouldExcludePath(path: string | undefined): boolean {\n if (typeof path !== \"string\") return false;\n\n // Remove query string\n const cleanPath = path.split(\"?\")[0];\n const lowerPath = cleanPath.toLowerCase();\n\n // Check path prefixes\n for (const prefix of EXCLUDED_PATH_PREFIXES) {\n if (cleanPath.includes(prefix)) {\n return true;\n }\n }\n\n // Check file extensions (but not for /api/ routes)\n if (!cleanPath.startsWith(\"/api/\")) {\n for (const ext of EXCLUDED_EXTENSIONS) {\n if (lowerPath.endsWith(ext)) {\n return true;\n }\n }\n }\n\n return false;\n}\n"],"mappings":";;;;;AAMA,MAAa,yBAAyB;CAEpC;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CAGA;CACA;CACD;;;;;AAMD,MAAa,sBAAsB;CACjC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD;;;;;AAMD,SAAgB,oBAAoB,SAAmC;CACrE,MAAM,MAAM,QAAQ;AACpB,KAAI,CAAC,IAAK,QAAO;CAGjB,MAAM,OAAO,IAAI,MAAM,IAAI,CAAC;AAE5B,QAAO,kBAAkB,KAAK;;;;;;AAOhC,SAAgB,kBAAkB,MAAmC;AACnE,KAAI,OAAO,SAAS,SAAU,QAAO;CAGrC,MAAM,YAAY,KAAK,MAAM,IAAI,CAAC;CAClC,MAAM,YAAY,UAAU,aAAa;AAGzC,MAAK,MAAM,UAAU,uBACnB,KAAI,UAAU,SAAS,OAAO,CAC5B,QAAO;AAKX,KAAI,CAAC,UAAU,WAAW,QAAQ,EAChC;OAAK,MAAM,OAAO,oBAChB,KAAI,UAAU,SAAS,IAAI,CACzB,QAAO;;AAKb,QAAO"}
|
package/llms.txt
CHANGED
|
@@ -668,6 +668,56 @@ export function SpendChart() {
|
|
|
668
668
|
}
|
|
669
669
|
```
|
|
670
670
|
|
|
671
|
+
**Chart props reference (important):**
|
|
672
|
+
|
|
673
|
+
Charts are **self-contained ECharts components**. Configure via props, NOT children:
|
|
674
|
+
|
|
675
|
+
```tsx
|
|
676
|
+
// ✅ Correct: use props for customization
|
|
677
|
+
<BarChart
|
|
678
|
+
queryKey="sales_by_region"
|
|
679
|
+
parameters={{}}
|
|
680
|
+
xKey="region" // X-axis field
|
|
681
|
+
yKey={["revenue", "expenses"]} // Y-axis field(s) - string or string[]
|
|
682
|
+
colors={['#40d1f5', '#4462c9']} // Custom colors
|
|
683
|
+
stacked // Stack bars (BarChart, AreaChart)
|
|
684
|
+
orientation="horizontal" // "vertical" (default) | "horizontal"
|
|
685
|
+
showLegend // Show legend
|
|
686
|
+
height={400} // Height in pixels (default: 300)
|
|
687
|
+
/>
|
|
688
|
+
|
|
689
|
+
<LineChart
|
|
690
|
+
queryKey="trend_data"
|
|
691
|
+
parameters={{}}
|
|
692
|
+
xKey="date"
|
|
693
|
+
yKey="value"
|
|
694
|
+
smooth // Smooth curves (default: true)
|
|
695
|
+
showSymbol={false} // Hide data point markers
|
|
696
|
+
/>
|
|
697
|
+
```
|
|
698
|
+
|
|
699
|
+
**❌ CRITICAL: Charts do NOT accept Recharts children**
|
|
700
|
+
|
|
701
|
+
```tsx
|
|
702
|
+
// ❌ WRONG - AppKit charts are NOT Recharts wrappers
|
|
703
|
+
import { BarChart } from "@databricks/appkit-ui/react";
|
|
704
|
+
import { Bar, XAxis, YAxis, CartesianGrid } from "recharts";
|
|
705
|
+
|
|
706
|
+
<BarChart queryKey="data" parameters={{}}>
|
|
707
|
+
<CartesianGrid /> // ❌ This will cause TypeScript errors
|
|
708
|
+
<XAxis dataKey="x" /> // ❌ Not supported
|
|
709
|
+
<Bar dataKey="y" /> // ❌ Not supported
|
|
710
|
+
</BarChart>
|
|
711
|
+
|
|
712
|
+
// ✅ CORRECT - use props instead
|
|
713
|
+
<BarChart
|
|
714
|
+
queryKey="data"
|
|
715
|
+
parameters={{}}
|
|
716
|
+
xKey="x"
|
|
717
|
+
yKey="y"
|
|
718
|
+
/>
|
|
719
|
+
```
|
|
720
|
+
|
|
671
721
|
### SQL helpers (`sql.*`)
|
|
672
722
|
|
|
673
723
|
Use these to build typed parameters (they return marker objects: `{ __sql_type, value }`):
|
|
@@ -1169,6 +1219,7 @@ env:
|
|
|
1169
1219
|
- `useMemo` wraps parameters objects
|
|
1170
1220
|
- Loading/error/empty states are explicit
|
|
1171
1221
|
- Charts use `format="auto"` unless you have a reason to force `"json"`/`"arrow"`
|
|
1222
|
+
- Charts use props (`xKey`, `yKey`, `colors`) NOT children (they're ECharts-based, not Recharts)
|
|
1172
1223
|
- If using tooltips: root is wrapped with `<TooltipProvider>`
|
|
1173
1224
|
|
|
1174
1225
|
- **Never**
|
|
@@ -1176,4 +1227,5 @@ env:
|
|
|
1176
1227
|
- Don't pass untyped raw params for annotated queries
|
|
1177
1228
|
- Don't ignore `createApp()`'s promise
|
|
1178
1229
|
- Don't invent UI components not listed in this file
|
|
1230
|
+
- Don't pass Recharts children (`<Bar>`, `<XAxis>`, etc.) to AppKit chart components
|
|
1179
1231
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/appkit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"packageManager": "pnpm@10.21.0",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"bin": {
|
|
28
28
|
"appkit-generate-types": "./bin/generate-types.js",
|
|
29
|
+
"appkit-lint": "./bin/appkit-lint.js",
|
|
29
30
|
"appkit-setup": "./bin/setup-claude.js"
|
|
30
31
|
},
|
|
31
32
|
"scripts": {
|
|
@@ -39,6 +40,7 @@
|
|
|
39
40
|
"postinstall": "node scripts/postinstall.js"
|
|
40
41
|
},
|
|
41
42
|
"dependencies": {
|
|
43
|
+
"@ast-grep/napi": "^0.37.0",
|
|
42
44
|
"@databricks/sdk-experimental": "^0.15.0",
|
|
43
45
|
"@opentelemetry/api": "^1.9.0",
|
|
44
46
|
"@opentelemetry/api-logs": "^0.208.0",
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
"@types/semver": "^7.7.1",
|
|
58
60
|
"dotenv": "^16.6.1",
|
|
59
61
|
"express": "^4.22.0",
|
|
62
|
+
"obug": "^2.1.1",
|
|
60
63
|
"pg": "^8.16.3",
|
|
61
64
|
"semver": "^7.7.3",
|
|
62
65
|
"vite": "npm:rolldown-vite@7.1.14",
|