@lightdash/cli 1.5.0 → 1.6.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,5 +1,5 @@
1
1
  import { DbtManifest } from '@lightdash/common';
2
- export { combineManifests, type CombineManifestsResult, } from '@lightdash/common';
2
+ export { combineManifests } from '@lightdash/common';
3
3
  export type LoadManifestArgs = {
4
4
  targetDir: string;
5
5
  };
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/dbt/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AAQ7E,OAAO,EACH,gBAAgB,EAChB,KAAK,sBAAsB,GAC9B,MAAM,mBAAmB,CAAC;AAE3B,MAAM,MAAM,gBAAgB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAC/B,CAAC;AAE1C,eAAO,MAAM,oBAAoB,GAC7B,UAAU,MAAM,KACjB,OAAO,CAAC,WAAW,CAerB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,gBAEhC,gBAAgB,KAAG,OAAO,CAAC,WAAW,CAGxC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAOzC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC5B,KAAK,MAAM,KACZ,OAAO,CAAC,WAAW,CAarB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC5B,WAAW,MAAM,KAClB,OAAO,CAAC,WAAW,CAKrB,CAAC"}
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/dbt/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA+B,MAAM,mBAAmB,CAAC;AAQ7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,gBAAgB,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,eAAe,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,MAAM,CAC/B,CAAC;AAE1C,eAAO,MAAM,oBAAoB,GAC7B,UAAU,MAAM,KACjB,OAAO,CAAC,WAAW,CAerB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAU,gBAEhC,gBAAgB,KAAG,OAAO,CAAC,WAAW,CAGxC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,OAOzC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC5B,KAAK,MAAM,KACZ,OAAO,CAAC,WAAW,CAarB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC5B,WAAW,MAAM,KAClB,OAAO,CAAC,WAAW,CAKrB,CAAC"}
@@ -1,23 +1,4 @@
1
- import { DbtSchemaEditor, DimensionType, SupportedDbtVersions } from '@lightdash/common';
2
- type YamlColumnMeta = {
3
- dimension?: {
4
- type?: DimensionType;
5
- };
6
- };
7
- type YamlColumn = {
8
- name: string;
9
- description?: string;
10
- meta?: YamlColumnMeta;
11
- };
12
- export type YamlModel = {
13
- name: string;
14
- description?: string;
15
- columns?: YamlColumn[];
16
- };
17
- export type YamlSchema = {
18
- version?: 2;
19
- models?: YamlModel[];
20
- };
1
+ import { DbtSchemaEditor, SupportedDbtVersions } from '@lightdash/common';
21
2
  type SearchForModelArgs = {
22
3
  modelName: string;
23
4
  filenames: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/dbt/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EACf,aAAa,EAEb,oBAAoB,EACvB,MAAM,mBAAmB,CAAC;AAG3B,KAAK,cAAc,GAAG;IAClB,SAAS,CAAC,EAAE;QACR,IAAI,CAAC,EAAE,aAAa,CAAC;KACxB,CAAC;CACL,CAAC;AAEF,KAAK,UAAU,GAAG;IACd,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,EAAE,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACrB,OAAO,CAAC,EAAE,CAAC,CAAC;IACZ,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB,CAAC;AAgDF,KAAK,kBAAkB,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACrC,CAAC;AACF,eAAO,MAAM,cAAc,GAAU,uCAIlC,kBAAkB;;;cAepB,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/dbt/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,eAAe,EAEf,oBAAoB,EACvB,MAAM,mBAAmB,CAAC;AAiD3B,KAAK,kBAAkB,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACrC,CAAC;AACF,eAAO,MAAM,cAAc,GAAU,uCAIlC,kBAAkB;;;cAepB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { type CreateSnowflakeCredentials } from '@lightdash/common';
2
- import { SnowflakeWarehouseClient, type SnowflakeSessionDiscovery } from '@lightdash/warehouses';
2
+ import { SnowflakeWarehouseClient } from '@lightdash/warehouses';
3
3
  import fetch from 'node-fetch';
4
4
  export type ConnectSnowflakeOptions = {
5
5
  code: string;
@@ -24,20 +24,6 @@ type ConnectSnowflakeDependencies = {
24
24
  fetch: typeof fetch;
25
25
  write: (message: string) => void;
26
26
  };
27
- type ConnectionValueName = 'database' | 'warehouse' | 'schema' | 'role';
28
- type ConnectionValues = {
29
- database?: string;
30
- warehouse?: string;
31
- role?: string;
32
- schema?: string;
33
- };
34
- type ResolvedConnectionValues = {
35
- values: ConnectionValues;
36
- sources: Partial<Record<ConnectionValueName, 'flag' | 'session default'>>;
37
- };
38
27
  export declare const connectSnowflakeHandler: (options: ConnectSnowflakeOptions, dependencies?: ConnectSnowflakeDependencies) => Promise<void>;
39
- export declare const connectSnowflakeTestHelpers: {
40
- resolveConnectionValues: (options: ConnectSnowflakeOptions, discovery: SnowflakeSessionDiscovery) => ResolvedConnectionValues;
41
- };
42
28
  export {};
43
29
  //# sourceMappingURL=connectSnowflake.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectSnowflake.d.ts","sourceRoot":"","sources":["../../src/handlers/connectSnowflake.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,KAAK,0BAA0B,EAIlC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEH,wBAAwB,EAExB,KAAK,yBAAyB,EACjC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAwB,MAAM,YAAY,CAAC;AAIlD,MAAM,MAAM,uBAAuB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,KAAK,yBAAyB,GAAG,IAAI,CACjC,wBAAwB,EACtB,2BAA2B,GAC3B,+BAA+B,GAC/B,qBAAqB,GACrB,uBAAuB,GACvB,0BAA0B,GAC1B,+BAA+B,GAC/B,kBAAkB,GAClB,oBAAoB,CACzB,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flakeTestHelpers = exports.connectSnowflakeHandler = void 0;
3
+ exports.connectSnowflakeHandler = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@lightdash/common");
6
6
  const warehouses_1 = require("@lightdash/warehouses");
@@ -309,6 +309,3 @@ const connectSnowflakeHandler = async (options, dependencies = defaultDependenci
309
309
  }
310
310
  };
311
311
  exports.connectSnowflakeHandler = connectSnowflakeHandler;
312
- exports.connectSnowflakeTestHelpers = {
313
- resolveConnectionValues,
314
- };
@@ -54,8 +54,6 @@ export type DbtProjectConfig = {
54
54
  skipWarehouseCatalog: boolean | undefined;
55
55
  };
56
56
  export type ProjectTypeConfig = LightdashYamlProjectConfig | DbtProjectConfig;
57
- export declare function isLightdashYamlProject(config: ProjectTypeConfig): config is LightdashYamlProjectConfig;
58
- export declare function isDbtProject(config: ProjectTypeConfig): config is DbtProjectConfig;
59
57
  type DetectProjectTypeOptions = {
60
58
  /**
61
59
  * Path to the project directory
@@ -1 +1 @@
1
- {"version":3,"file":"projectType.d.ts","sourceRoot":"","sources":["../../src/lightdash/projectType.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAMH;;GAEG;AACH,oBAAY,cAAc;IACtB,aAAa,mBAAmB;IAChC,GAAG,QAAQ;CACd;AAED,MAAM,MAAM,0BAA0B,GAAG;IACrC,IAAI,EAAE,cAAc,CAAC,aAAa,CAAC;IACnC;;OAEG;IACH,oBAAoB,EAAE,KAAK,CAAC;IAC5B;;OAEG;IACH,cAAc,EAAE,IAAI,CAAC;IACrB;;OAEG;IACH,oBAAoB,EAAE,IAAI,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC3B,IAAI,EAAE,cAAc,CAAC,GAAG,CAAC;IACzB;;OAEG;IACH,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C;;OAEG;IACH,cAAc,EAAE,OAAO,GAAG,SAAS,CAAC;IACpC;;OAEG;IACH,oBAAoB,EAA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BAAoB,EAAE,OAAO,GAAG,SAAS,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,0BAA0B,GAAG,gBAAgB,CAAC;AAE9E,KAAK,wBAAwB,GAAG;IAC5B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE;QACV,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;KAClC,CAAC;CACL,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACnC,OAAO,EAAE,wBAAwB,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAiC5B"}
@@ -19,8 +19,6 @@
19
19
  */
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  exports.CliProjectType = void 0;
22
- exports.isLightdashYamlProject = isLightdashYamlProject;
23
- exports.isDbtProject = isDbtProject;
24
22
  exports.detectProjectType = detectProjectType;
25
23
  const tslib_1 = require("tslib");
26
24
  const path_1 = tslib_1.__importDefault(require("path"));
@@ -34,12 +32,6 @@ var CliProjectType;
34
32
  CliProjectType["LightdashYaml"] = "lightdash-yaml";
35
33
  CliProjectType["Dbt"] = "dbt";
36
34
  })(CliProjectType || (exports.CliProjectType = CliProjectType = {}));
37
- function isLightdashYamlProject(config) {
38
- return config.type === CliProjectType.LightdashYaml;
39
- }
40
- function isDbtProject(config) {
41
- return config.type === CliProjectType.Dbt;
42
- }
43
35
  /**
44
36
  * Detect project type based on project contents
45
37
  *
@@ -184,13 +184,13 @@ const revenueQuery = query('orders')
184
184
  .limit(10);
185
185
 
186
186
  export function RevenueBySegment() {
187
- const { data, format, loading, error } = useLightdash(revenueQuery);
187
+ const { data, format, loading, error, lineage } = useLightdash(revenueQuery);
188
188
 
189
189
  if (loading) return <p className="text-sm text-muted-foreground">Loading...</p>;
190
190
  if (error) return <p className="text-sm text-destructive">Error: {error.message}</p>;
191
191
 
192
192
  return (
193
- <div className="space-y-2">
193
+ <div className="space-y-2" {...lineage}>
194
194
  {data.map((row, i) => (
195
195
  <div key={i} className="flex justify-between">
196
196
  <span>{format(row, 'customer_segment')}</span>
@@ -297,6 +297,7 @@ If the dbt YAML declares a `parameters:` block (under a model's `meta:` / `confi
297
297
  | `totalResults` | `number \| null` | Total rows returned by the loaded source query. Use for export labels/counts. |
298
298
  | `loading` | `boolean` | True while query is in flight. |
299
299
  | `error` | `Error \| null` | Query error. |
300
+ | `lineage` | `LineageProps` | **Spread on the root element of every rendered query block** (`<div {...lineage}>`). Stamps the block so the host's Inspect data button can trace it back to this query — without it that button stays disabled. |
300
301
  | `refetch` | `() => void` | Re-run the query on demand. |
301
302
  | `queryUuid` | `string \| null` | The async Lightdash query UUID for the loaded source query. Rarely needed directly. |
302
303
  | `getUnderlyingData` | `({ row, metric, limit? }) => Promise<{ rows, columns, format, queryUuid }>` | Fetch raw rows behind an aggregated metric value. Call from a user action, never on initial render. |
@@ -717,10 +718,10 @@ import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
717
718
  import { Alert, AlertDescription } from '@/components/ui/alert';
718
719
 
719
720
  export function RevenueCard() {
720
- const { data, format, loading, error } = useLightdash(revenueQuery);
721
+ const { data, format, loading, error, lineage } = useLightdash(revenueQuery);
721
722
 
722
723
  return (
723
- <Card>
724
+ <Card {...lineage}>
724
725
  <CardHeader>
725
726
  <CardTitle>Revenue</CardTitle>
726
727
  </CardHeader>
@@ -792,8 +793,8 @@ export function RevenueBySegment() {
792
793
  () => baseRevenueQuery.filters(filtersFor(EXPLORE)),
793
794
  [filtersFor],
794
795
  );
795
- const { data, format, loading } = useLightdash(q);
796
- // ...
796
+ const { data, format, loading, lineage } = useLightdash(q);
797
+ // ...spread {...lineage} on the block's root element
797
798
  }
798
799
  ```
799
800
 
@@ -1143,6 +1144,8 @@ The action-menu example above shows typical `drillDown()` usage. For the full AP
1143
1144
  | `.limit()` too low | Silently truncates rows — charts end early, tables incomplete | Estimate row count from the grain, set limit above that |
1144
1145
  | Building queries inside render | Infinite re-fetching | Define queries at module scope or memoize them |
1145
1146
  | Forgetting to apply global filters to a query | Chart shows unfiltered data while the rest of the page is filtered → contradictory results | Every `useLightdash()` call must pass `filtersFor(EXPLORE)` into `.filters([...])` via `useMemo` |
1147
+ | Forgetting to spread `lineage` on a query block | The host's Inspect data button stays disabled for that block | Destructure `lineage` from `useLightdash()` and spread it on the block's root element |
1148
+ | Spreading `lineage` onto a component that swallows unknown props | The stamp never reaches the DOM, so the block looks wired but Inspect data still can't trace it | Spread onto a plain element (`<div {...lineage}>`) or a component that forwards rest props to its root element (all `@/components/ui` primitives do) |
1146
1149
  | Calling `addFilter` without an `explore` tag | Filter has no explore → the `filtersFor(otherExplore)` lookup never returns it, or (worse) you broadcast it everywhere → `FieldReferenceError` like `regional_sales_status` not found | Always include `explore: EXPLORE` on every `addFilter` call |
1147
1150
  | Using `filters` (raw) instead of `filtersFor(EXPLORE)` | Sends filters from other explores into this query → SDK qualifies the field name to the wrong explore → `FieldReferenceError` | Always select via `filtersFor(EXPLORE)`; never pass `allFilters` into `.filters()` |
1148
1151
  | Hard-coding the explore string in two places | Chart and its action menu disagree → filter sets but never applies | Define `const EXPLORE = '...'` at the top of the file and reuse it for both `query(EXPLORE)` and `addFilter({ ..., explore: EXPLORE })` |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "1.5.0",
3
+ "version": "1.6.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": "1.5.0",
45
- "@lightdash/warehouses": "1.5.0"
44
+ "@lightdash/common": "1.6.0",
45
+ "@lightdash/warehouses": "1.6.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",