@lightdash/cli 0.3434.0 → 0.3436.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.
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/handlers/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,OAAO,EACP,YAAY,EAaf,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,iBAAiB,EAA8B,MAAM,eAAe,CAAC;AAI9E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAuMF,eAAO,MAAM,OAAO,GAAU,SAAS,qBAAqB,wCAwQ3D,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,iBAAiB,qBAAqB,kBAmCzC,CAAC"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../src/handlers/compile.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,OAAO,EACP,YAAY,EAaf,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,iBAAiB,EAA8B,MAAM,eAAe,CAAC;AAI9E,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG;IACpD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,0BAA0B,CAAC,EAAE,OAAO,CAAC;CACxC,CAAC;AAuMF,eAAO,MAAM,OAAO,GAAU,SAAS,qBAAqB,wCA+Q3D,CAAC;AAEF,eAAO,MAAM,cAAc,GACvB,iBAAiB,qBAAqB,kBAmCzC,CAAC"}
@@ -232,7 +232,10 @@ const compile = async (options) => {
232
232
  else {
233
233
  globalState_1.default.debug('> Skipping warehouse catalog');
234
234
  }
235
- const validModelsWithTypes = applyMetricFlowMetrics((0, common_1.attachTypesToModels)(validModels, catalog, false), manifest);
235
+ const validModelsWithTypes = applyMetricFlowMetrics((0, common_1.attachTypesToModels)(validModels, catalog, false,
236
+ // Snowflake catalogs report uppercase identifiers; match the
237
+ // server-side adapter rule (dbtBaseProjectAdapter).
238
+ adapterType !== 'snowflake'), manifest);
236
239
  if (!(0, common_1.isSupportedDbtAdapter)(manifest.metadata)) {
237
240
  await analytics_1.LightdashAnalytics.track({
238
241
  event: 'compile.error',
@@ -33,7 +33,7 @@ These are the same rules as for Recharts charts — they don't relax just becaus
33
33
 
34
34
  - **Series colors come from `CHART_COLORS`** (`@/lib/theme`). Cycle by index for multi-series; never hand-pick palettes.
35
35
  - **Apply global filters via `filtersFor(EXPLORE)`** — same rule as every other `useLightdash()` call. Wrap the filtered query in `useMemo`.
36
- - **Click → `addFilter({ ..., explore: EXPLORE })`** — the action menu requirement carries over. Wire it directly into `.on('click', ...)`. If you want a multi-option menu (Filter by / Drill into …) wrap the click in a state-driven `<DropdownMenu>` opened at the click coordinates, exactly like the Recharts example in the main skill.
36
+ - **Click → `addFilter({ ..., explore: EXPLORE })`** — the action menu requirement carries over. Wire it directly into `.on('click', ...)`. If you want a multi-option menu (Filter by / Drill into …) wrap the click in a state-driven `<DropdownMenu>` opened at the click coordinates, exactly like the Recharts example in the main skill — including the `createPortal(…, document.body)` wrapper, or an animated ancestor will displace the "fixed" trigger.
37
37
  - **Drive D3 only against the SVG ref.** Don't `d3.select('body')` or attach listeners to `document`. The iframe has strict CSP and a small DOM — don't reach outside your component.
38
38
  - **Always clear before redrawing** with `svg.selectAll('*').remove()` at the top of the effect. Without this, every data update appends a new copy of the chart on top of the old one.
39
39
  - **Format display values via `format(row, fieldName)`** — even inside D3 callbacks. Don't reimplement currency / percent / date formatting.
@@ -643,6 +643,7 @@ Lightdash-specific constraints that apply on top of `frontend-design`'s directio
643
643
  - **Chart series colors must come from `CHART_COLORS` in `@/lib/theme`** — the canonical Lightdash palette, so generated apps' charts visually match native Lightdash dashboards. Cycle by index for multi-series (`CHART_COLORS[i % CHART_COLORS.length]`). `frontend-design`'s chosen accent/background/typography colors are independent of this.
644
644
  - **Use semantic shadcn tokens for UI chrome** — `bg-background`, `bg-card`, `text-foreground`, `text-muted-foreground`, `text-destructive`, `border`, etc. Don't hardcode hex values for surfaces, text, or borders. (`frontend-design` may direct you to redefine the underlying CSS variables for a chosen theme — that's fine; the rule is no inline hex, not "use only the default token values".)
645
645
  - **Commit to one theme; don't design for dark while rendering light.** The template's `:root` defaults to white (light tokens). If your design needs a dark background, you must do *one* of: (a) apply `className="dark"` to your top-level `<div>` so Tailwind activates the dark token values, or (b) override the CSS variables on `:root` directly to match your chosen theme. **Never** author colors that assume a dark background without ensuring the page actually loads dark — the symptom is invisible secondary text (faint red/gray on white). Before declaring done, check: does the page background actually look the way you described it? If not, you have a theme-wiring bug.
646
+ - **Theme CSS variables hold complete raw colors, consumed as `var(--x)`.** The template's tokens are `oklch(…)` values, and everything — Tailwind utilities, the floating-surface chrome, your own CSS — reads them with plain `var(--x)`. When overriding on `:root`, write full CSS colors (`--background: oklch(0.14 0.005 286);` — any valid color works). **Never write bare `H S% L%` triplets and never wrap a variable in `hsl(var(--x))`** — both come from a different shadcn convention this template does not use; they produce invalid CSS that browsers silently drop, which breaks text colors or turns popovers/tooltips transparent.
646
647
  - **Leave a gutter at the bottom of the page.** Don't let the last card, chart, or footer sit flush against the iframe's bottom edge — it reads as clipped. Add bottom padding (`pb-8` or similar) on your page's top-level themed wrapper so the gutter inherits the theme's background. Don't push the gutter onto `#root` or `body` instead — those sit outside your theme, so any space below the wrapper falls back to the template default and shows as a mismatched strip.
647
648
 
648
649
  ### Sizing for scheduled-delivery screenshots
@@ -869,6 +870,7 @@ Use the `DropdownMenu` component. The menu opens on click; each option triggers
869
870
 
870
871
  ```tsx
871
872
  import { useState, useMemo, useRef } from 'react';
873
+ import { createPortal } from 'react-dom';
872
874
  import { query, useLightdash, drillDown } from '@lightdash/query-sdk';
873
875
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
874
876
  import { useGlobalFilters } from '@/lib/filters';
@@ -912,7 +914,12 @@ function RevenueChart() {
912
914
  </BarChart>
913
915
  </div>
914
916
 
915
- {menuState && (
917
+ {/* Portal the menu to document.body: any animated/transformed
918
+ ancestor (fade-in cards, slide-in sections) becomes the
919
+ containing block for position:fixed, which would displace the
920
+ menu far from the click. The portal makes the trigger truly
921
+ viewport-relative no matter how the surrounding card is styled. */}
922
+ {menuState && createPortal(
916
923
  <DropdownMenu open onOpenChange={() => setMenuState(null)}>
917
924
  <DropdownMenuTrigger asChild>
918
925
  <div style={{ position: 'fixed', left: menuState.x, top: menuState.y, width: 1, height: 1 }} />
@@ -963,7 +970,8 @@ function RevenueChart() {
963
970
  Drill into revenue
964
971
  </DropdownMenuItem>
965
972
  </DropdownMenuContent>
966
- </DropdownMenu>
973
+ </DropdownMenu>,
974
+ document.body,
967
975
  )}
968
976
 
969
977
  {drillState && (
@@ -1143,4 +1151,5 @@ The action-menu example above shows typical `drillDown()` usage. For the full AP
1143
1151
  | Building drill query inside render | Infinite re-fetching | Build in onClick handler, store in state |
1144
1152
  | Drilling by a dimension already in the source query | Pointless — same grouping | Pick a different, more granular dimension |
1145
1153
  | Using `e.chartX`/`e.chartY` for menu position | Chart-relative coords — menu appears at wrong position | Recharts `onClick` has no native event; capture `clientX`/`clientY` from a wrapper `<div onPointerDown>` via `useRef` — pointerdown fires before onClick so the ref is ready (see action menu example) |
1154
+ | Action menu opens far below/right of the click | An animated/transformed ancestor (fade-in card, slide-in section) is the containing block for the `position: fixed` trigger — "fixed" coords resolve inside the card, not the viewport | `createPortal(<DropdownMenu …>, document.body)` around the menu block, exactly as in the action-menu example — never render the fixed trigger inside the component tree |
1146
1155
  | Combining a direction word with a contradictory sign in narrative copy (`down +12%`, `up -4%`) | Sign and verb disagree → reads as a self-contradiction, looks like a platform bug | Pick one convention per report and stick to it: either signed deltas with no direction word (`+12%`, `−4%`), or direction word with unsigned magnitude (`up 12%`, `down 4%`). Never mix. |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.3434.0",
3
+ "version": "0.3436.0",
4
4
  "description": "Lightdash CLI tool",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,8 +41,8 @@
41
41
  "unique-names-generator": "4.7.1",
42
42
  "uuid": "11.1.1",
43
43
  "yaml": "2.8.3",
44
- "@lightdash/common": "0.3434.0",
45
- "@lightdash/warehouses": "0.3434.0"
44
+ "@lightdash/common": "0.3436.0",
45
+ "@lightdash/warehouses": "0.3436.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",