@lightdash/cli 1.51.0 → 1.52.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.
Files changed (75) hide show
  1. package/README.md +1 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/analytics/analytics.d.ts +1 -1
  4. package/dist/analytics/analytics.d.ts.map +1 -1
  5. package/dist/analytics/analytics.js +1 -2
  6. package/dist/dbt/manifest.d.ts +0 -3
  7. package/dist/dbt/manifest.d.ts.map +1 -1
  8. package/dist/dbt/manifest.js +5 -8
  9. package/dist/dbt/targets/Bigquery/index.d.ts +0 -14
  10. package/dist/dbt/targets/Bigquery/index.d.ts.map +1 -1
  11. package/dist/dbt/targets/Bigquery/index.js +4 -4
  12. package/dist/dbt/targets/Bigquery/serviceAccount.d.ts +0 -3
  13. package/dist/dbt/targets/Bigquery/serviceAccount.d.ts.map +1 -1
  14. package/dist/dbt/targets/Bigquery/serviceAccount.js +5 -5
  15. package/dist/dbt/targets/athena.d.ts +0 -2
  16. package/dist/dbt/targets/athena.d.ts.map +1 -1
  17. package/dist/dbt/targets/athena.js +4 -4
  18. package/dist/dbt/targets/clickhouse.d.ts +0 -2
  19. package/dist/dbt/targets/clickhouse.d.ts.map +1 -1
  20. package/dist/dbt/targets/clickhouse.js +4 -4
  21. package/dist/dbt/targets/databricks.d.ts +0 -2
  22. package/dist/dbt/targets/databricks.d.ts.map +1 -1
  23. package/dist/dbt/targets/databricks.js +4 -4
  24. package/dist/dbt/targets/postgres.d.ts +0 -2
  25. package/dist/dbt/targets/postgres.d.ts.map +1 -1
  26. package/dist/dbt/targets/postgres.js +4 -4
  27. package/dist/dbt/targets/redshift.d.ts +0 -2
  28. package/dist/dbt/targets/redshift.d.ts.map +1 -1
  29. package/dist/dbt/targets/redshift.js +4 -4
  30. package/dist/dbt/targets/trino.d.ts +0 -2
  31. package/dist/dbt/targets/trino.d.ts.map +1 -1
  32. package/dist/dbt/targets/trino.js +4 -4
  33. package/dist/handlers/apps/scaffolding.d.ts +0 -4
  34. package/dist/handlers/apps/scaffolding.d.ts.map +1 -1
  35. package/dist/handlers/apps/scaffolding.js +2 -3
  36. package/dist/handlers/contentAsCode/fileNames.d.ts +0 -1
  37. package/dist/handlers/contentAsCode/fileNames.d.ts.map +1 -1
  38. package/dist/handlers/contentAsCode/fileNames.js +4 -4
  39. package/dist/handlers/dbt/compile.d.ts +0 -1
  40. package/dist/handlers/dbt/compile.d.ts.map +1 -1
  41. package/dist/handlers/dbt/compile.js +2 -4
  42. package/dist/handlers/dbt/getDbtVersion.d.ts +0 -1
  43. package/dist/handlers/dbt/getDbtVersion.d.ts.map +1 -1
  44. package/dist/handlers/dbt/getDbtVersion.js +5 -5
  45. package/dist/handlers/dbt/getWarehouseClient.d.ts +1 -8
  46. package/dist/handlers/dbt/getWarehouseClient.d.ts.map +1 -1
  47. package/dist/handlers/dbt/getWarehouseClient.js +2 -3
  48. package/dist/handlers/dbt/refresh.d.ts +1 -3
  49. package/dist/handlers/dbt/refresh.d.ts.map +1 -1
  50. package/dist/handlers/dbt/refresh.js +3 -5
  51. package/dist/handlers/deploy.d.ts +1 -2
  52. package/dist/handlers/deploy.d.ts.map +1 -1
  53. package/dist/handlers/deploy.js +3 -4
  54. package/dist/handlers/renameHandler.d.ts.map +1 -1
  55. package/dist/handlers/renameHandler.js +25 -16
  56. package/dist/handlers/renameHandler.test.d.ts +2 -0
  57. package/dist/handlers/renameHandler.test.d.ts.map +1 -0
  58. package/dist/handlers/renameHandler.test.js +148 -0
  59. package/dist/handlers/renameProject.d.ts +0 -1
  60. package/dist/handlers/renameProject.d.ts.map +1 -1
  61. package/dist/handlers/renameProject.js +2 -3
  62. package/dist/handlers/setProject.d.ts +0 -1
  63. package/dist/handlers/setProject.d.ts.map +1 -1
  64. package/dist/handlers/setProject.js +2 -3
  65. package/dist/handlers/validate.d.ts +6 -3
  66. package/dist/handlers/validate.d.ts.map +1 -1
  67. package/dist/handlers/validate.js +10 -8
  68. package/dist/index.js +11 -14
  69. package/dist/terminal/contentAsCodeOutput.d.ts +0 -3
  70. package/dist/terminal/contentAsCodeOutput.d.ts.map +1 -1
  71. package/dist/terminal/contentAsCodeOutput.js +7 -10
  72. package/dist/vendor/authoring/AGENTS.md.tmpl +1 -1
  73. package/dist/vendor/authoring/README.md.tmpl +1 -1
  74. package/dist/vendor/authoring/developing-data-apps-locally/SKILL.md +1 -1
  75. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.unsetProjectHandler = exports.unsetProjectCommand = exports.setProjectHandler = exports.setFirstProject = exports.setProjectCommand = void 0;
3
+ exports.unsetProjectHandler = exports.setProjectHandler = exports.setFirstProject = exports.setProjectCommand = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const common_1 = require("@lightdash/common");
6
6
  const inquirer_1 = tslib_1.__importDefault(require("inquirer"));
@@ -115,13 +115,12 @@ const unsetProjectCommand = async () => {
115
115
  await (0, config_1.unsetProject)();
116
116
  console.error(`\n Project unset.\n`);
117
117
  };
118
- exports.unsetProjectCommand = unsetProjectCommand;
119
118
  const unsetProjectHandler = async (options) => {
120
119
  const startTime = Date.now();
121
120
  let success = true;
122
121
  globalState_1.default.setVerbose(options.verbose);
123
122
  try {
124
- await (0, exports.unsetProjectCommand)();
123
+ await unsetProjectCommand();
125
124
  }
126
125
  catch (e) {
127
126
  success = false;
@@ -8,8 +8,6 @@ export declare const getJobState: (jobUuid: string) => Promise<{
8
8
  details: Record<string, import("@lightdash/common").AnyType> | null;
9
9
  }>;
10
10
  export declare const getValidation: (projectUuid: string, jobId: string) => Promise<import("@lightdash/common").ValidationResponse[]>;
11
- export declare const getProjectSpaces: (projectUuid: string) => Promise<import("@lightdash/common").SpaceSummary[]>;
12
- export declare function delay(ms: number): Promise<unknown>;
13
11
  type ValidateHandlerOptions = CompileHandlerOptions & {
14
12
  project?: string;
15
13
  verbose: boolean;
@@ -20,7 +18,12 @@ type ValidateHandlerOptions = CompileHandlerOptions & {
20
18
  includeSpaces?: string[];
21
19
  excludeSpaces?: string[];
22
20
  };
23
- export declare const waitUntilFinished: (jobUuid: string) => Promise<string>;
21
+ type WaitUntilFinishedOptions = {
22
+ jobUuid: string;
23
+ refetchIntervalMs: number;
24
+ createError: (jobError: string) => Error;
25
+ };
26
+ export declare const waitUntilFinished: ({ jobUuid, refetchIntervalMs, createError, }: WaitUntilFinishedOptions) => Promise<string>;
24
27
  export declare const validateHandler: (originalOptions: ValidateHandlerOptions) => Promise<void>;
25
28
  export {};
26
29
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/handlers/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,OAAO,EACP,YAAY,EAOZ,kBAAkB,EAGlB,gBAAgB,EACnB,MAAM,mBAAmB,CAAC;AAO3B,OAAO,EAAW,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAS3D,eAAO,MAAM,iBAAiB,gBACb,MAAM,YACT,CAAC,OAAO,GAAG,YAAY,CAAC,EAAE,qBACjB,gBAAgB,EAAE;;EAMnC,CAAC;AAEP,eAAO,MAAM,WAAW,YAAmB,MAAM;;;EAK3C,CAAC;AAEP,eAAO,MAAM,aAAa,gBAAuB,MAAM,SAAS,MAAM,8DAKhE,CAAC;AAEP,eAAO,MAAM,gBAAgB,gBAAuB,MAAM,wDAKpD,CAAC;AAEP,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAI/B;AAWD,KAAK,sBAAsB,GAAG,qBAAqB,GAAG;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,gBAAgB,EAAE,CAAC;IACzB,wBAAwB,EAAE,OAAO,CAAC;IAClC,8BAA8B,EAAE,OAAO,CAAC;IACxC,aAAa,CAAC,EAAE,MA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Y3C,CAAC;AAEF,eAAO,MAAM,eAAe,oBACP,sBAAsB,kBAgU1C,CAAC"}
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateHandler = exports.waitUntilFinished = exports.getProjectSpaces = exports.getValidation = exports.getJobState = exports.requestValidation = void 0;
4
- exports.delay = delay;
3
+ exports.validateHandler = exports.waitUntilFinished = exports.getValidation = exports.getJobState = exports.requestValidation = void 0;
5
4
  const tslib_1 = require("tslib");
6
5
  const common_1 = require("@lightdash/common");
7
6
  const columnify_1 = tslib_1.__importDefault(require("columnify"));
@@ -37,7 +36,6 @@ const getProjectSpaces = async (projectUuid) => (0, apiClient_1.lightdashApi)({
37
36
  url: `/api/v1/projects/${projectUuid}/spaces`,
38
37
  body: undefined,
39
38
  });
40
- exports.getProjectSpaces = getProjectSpaces;
41
39
  function delay(ms) {
42
40
  return new Promise((resolve) => {
43
41
  setTimeout(resolve, ms);
@@ -50,15 +48,15 @@ function styleTotalErrors(total) {
50
48
  return styles.success(`${styles.bold(total)} errors`);
51
49
  }
52
50
  const REFETCH_JOB_INTERVAL = 3000;
53
- const waitUntilFinished = async (jobUuid) => {
51
+ const waitUntilFinished = async ({ jobUuid, refetchIntervalMs, createError, }) => {
54
52
  const job = await (0, exports.getJobState)(jobUuid);
55
53
  if (job.status === common_1.SchedulerJobStatus.COMPLETED) {
56
54
  return job.status;
57
55
  }
58
56
  if (job.status === common_1.SchedulerJobStatus.ERROR) {
59
- throw new common_1.UnexpectedServerError(`\nValidation failed: ${job.details?.error || 'unknown error'}`);
57
+ throw createError(job.details?.error || 'unknown error');
60
58
  }
61
- return delay(REFETCH_JOB_INTERVAL).then(() => (0, exports.waitUntilFinished)(jobUuid));
59
+ return delay(refetchIntervalMs).then(() => (0, exports.waitUntilFinished)({ jobUuid, refetchIntervalMs, createError }));
62
60
  };
63
61
  exports.waitUntilFinished = waitUntilFinished;
64
62
  const validateHandler = async (originalOptions) => {
@@ -112,7 +110,7 @@ const validateHandler = async (originalOptions) => {
112
110
  ? options.includeSpaces
113
111
  : options.excludeSpaces;
114
112
  if (spaceFilterSlugs?.length) {
115
- const spaces = await (0, exports.getProjectSpaces)(projectUuid);
113
+ const spaces = await getProjectSpaces(projectUuid);
116
114
  spaceFilter = {
117
115
  mode: options.includeSpaces?.length ? 'include' : 'exclude',
118
116
  selectedSpaceUuids: (0, validateSpaceFilter_1.resolveSpaceSelection)(spaces, spaceFilterSlugs),
@@ -131,7 +129,11 @@ const validateHandler = async (originalOptions) => {
131
129
  const validationJob = await (0, exports.requestValidation)(projectUuid, explores, validationTargets);
132
130
  const { jobId } = validationJob;
133
131
  const spinner = globalState_1.default.startSpinner(` Waiting for validation to finish`);
134
- await (0, exports.waitUntilFinished)(jobId);
132
+ await (0, exports.waitUntilFinished)({
133
+ jobUuid: jobId,
134
+ refetchIntervalMs: REFETCH_JOB_INTERVAL,
135
+ createError: (jobError) => new common_1.UnexpectedServerError(`\nValidation failed: ${jobError}`),
136
+ });
135
137
  const allValidation = await (0, exports.getValidation)(projectUuid, jobId);
136
138
  // Filter out chart configuration warnings unless explicitly requested
137
139
  const validationWithoutConfigWarnings = options.showChartConfigurationWarnings
package/dist/index.js CHANGED
@@ -103,20 +103,6 @@ ${styles.bold('Examples:')}
103
103
  ${styles.title('⚡')}️lightdash ${styles.bold('deploy')} ${styles.secondary('-- compiles and deploys Lightdash metrics to active project')}
104
104
  ${styles.title('⚡')}️lightdash ${styles.bold('login https://lightdash.domain.com')} ${styles.secondary('-- logs in to a Lightdash instance')}
105
105
  `);
106
- const createProgram = commander_1.program
107
- .command('create')
108
- .description('Creates Lightdash content locally');
109
- createProgram
110
- .command('app <name>')
111
- .description('Creates a new data app locally')
112
- .option('--description <text>', 'Set the app description', '')
113
- .option('--slug <slug>', 'Override the app slug')
114
- .option('-p, --path <path>', 'Specify the Lightdash content root (default: ./lightdash)')
115
- .option('--project <project uuid>', 'Specify the project the app will use', parseProjectArgument, undefined)
116
- .option('-y, --assume-yes', 'approve npm package installation', false)
117
- .option('--verbose', undefined, false)
118
- .addHelpText('after', `\n${styles.bold('Example:')}\n ${styles.title('⚡')}️lightdash ${styles.bold('create app "Revenue explorer"')} ${styles.secondary('-- creates ./lightdash/apps/revenue-explorer')}\n`)
119
- .action(createApp_1.createAppHandler);
120
106
  commander_1.program
121
107
  .command('connect-snowflake')
122
108
  .description('Connects Lightdash to Snowflake using browser-based SSO')
@@ -435,6 +421,17 @@ uploadCommand.action(withOrganizationMode(download_1.uploadHandler));
435
421
  const appsProgram = commander_1.program
436
422
  .command('apps')
437
423
  .description('Work with data apps (enterprise)');
424
+ appsProgram
425
+ .command('create <name>')
426
+ .description('Creates a new data app locally')
427
+ .option('--description <text>', 'Set the app description', '')
428
+ .option('--slug <slug>', 'Override the app slug')
429
+ .option('-p, --path <path>', 'Specify the Lightdash content root (default: ./lightdash)')
430
+ .option('--project <project uuid>', 'Specify the project the app will use', parseProjectArgument, undefined)
431
+ .option('-y, --assume-yes', 'approve npm package installation', false)
432
+ .option('--verbose', undefined, false)
433
+ .addHelpText('after', `\n${styles.bold('Example:')}\n ${styles.title('⚡')}️lightdash ${styles.bold('apps create "Revenue explorer"')} ${styles.secondary('-- creates ./lightdash/apps/revenue-explorer')}\n`)
434
+ .action(createApp_1.createAppHandler);
438
435
  appsProgram
439
436
  .command('preview [path]')
440
437
  .description('Preview a downloaded data app locally against a real Lightdash instance, authenticated as you. Your credential stays in the CLI, behind a local proxy limited to data-app SDK routes.')
@@ -19,14 +19,11 @@ type ContentAsCodeProgressProps = Pick<ContentAsCodeOutputProps, 'operation' | '
19
19
  type ContentAsCodeFailureProps = Pick<ContentAsCodeOutputProps, 'operation' | 'scope' | 'elapsedSeconds' | 'items'> & {
20
20
  failedItem: Omit<ContentAsCodeOutputItem, 'variant'>;
21
21
  };
22
- export declare const formatDurationTag: (durationMs: number) => string;
23
22
  export declare const formatContentAsCodeAction: ({ label, detail, durationMs, }: Pick<ContentAsCodeOutputItem, 'label' | 'detail' | 'durationMs'>) => string;
24
23
  export declare const formatContentAsCodeProgress: ({ operation, scope, items, activeLabel, activeDetail, }: ContentAsCodeProgressProps) => string;
25
24
  export declare const formatContentAsCodeFailure: ({ operation, scope, elapsedSeconds, items, failedItem, }: ContentAsCodeFailureProps) => string;
26
25
  export declare const formatContentAsCodeComplete: ({ operation, scope, path, elapsedSeconds, items, }: ContentAsCodeOutputProps) => string;
27
- export declare const canRenderContentAsCodeTree: () => boolean;
28
26
  export declare const logContentAsCodeDiscovery: (message: string) => void;
29
- export declare const renderContentAsCodeComplete: (props: ContentAsCodeOutputProps) => boolean;
30
27
  type CreateContentAsCodeOutputProps = Pick<ContentAsCodeOutputProps, 'operation' | 'scope'>;
31
28
  type RunContentAsCodeItemProps<T> = {
32
29
  label: string;
@@ -1 +1 @@
1
- {"version":3,"file":"contentAsCodeOutput.d.ts","sourceRoot":"","sources":["../../src/terminal/contentAsCodeOutput.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,0BAA0B,GAAG,SAAS,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,uBAAuB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,0BAA0B,CAAC;CACxC,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACnC,SAAS,EAAE,UAAU,GAAG,QAAQ,CAAC;IACjC,KAAK,EAAE,cAAc,GAAG,SAAS,CAAC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,uBAAuB,EAAE,CAAC;CACpC,CAAC;AAEF,KAAK,0BAA0B,GAAG,IAAI,CAClC,wBAAwB,EACxB,WAAW,GAAG,OAAO,GAAG,OAAO,CAClC,GAAG;IACA,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB,CAA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,GAAG,YAAY,CAAC,WAG3B,CAAC;AAczC,eAAO,MAAM,2BAA2B,4DAMrC,0BAA0B,WAe5B,CAAC;AAEF,eAAO,MAAM,0BAA0B,6DAMpC,yBAAyB,WAY3B,CAAC;AAEF,eAAO,MAAM,2BAA2B,uDAMrC,wBAAwB,WAW1B,CAAC;AAWF,eAAO,MAAM,yBAAyB,YAAa,MAAM,KAAG,IAM3D,CAAC;AAaF,KAAK,8BAA8B,GAAG,IAAI,CACtC,wBAAwB,EACxB,WAAW,GAAG,OAAO,CACxB,CAAC;AAEF,KAAK,yBAAyB,CAAC,CAAC,IAAI;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC;IACzB,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,0BAA0B,GAAG,SAAS,CAAC;CAClE,CAAC;AAEF,eAAO,MAAM,yBAAyB,0BAGnC,8BAA8B;uBASH,MAAM,WAAW,MAAM;2BAwBnB,MAAM;2BAcxB,MAAM,YACJ,0BAA0B;cAkBjB,CAAC,uCAKrB,yBAAyB,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,CAAC,CAAC;wBAWX,CAAC,UACtB,MAAM,OAAO,CAAC,CAAC,CAAC,KACzB,OAAO,CAAC,CAAC,CAAC;;qBA+BQ,MAAM,kBAAkB,MAAM,KAAG,OAAO;mBAc7C,MAAM,kBACE,MAAM,gBACR,OAAO;CA0BhC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createContentAsCodeOutput = exports.renderContentAsCodeComplete = exports.logContentAsCodeDiscovery = exports.canRenderContentAsCodeTree = exports.formatContentAsCodeComplete = exports.formatContentAsCodeFailure = exports.formatContentAsCodeProgress = exports.formatContentAsCodeAction = exports.formatDurationTag = void 0;
3
+ exports.createContentAsCodeOutput = exports.logContentAsCodeDiscovery = exports.formatContentAsCodeComplete = exports.formatContentAsCodeFailure = exports.formatContentAsCodeProgress = exports.formatContentAsCodeAction = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
6
  const globalState_1 = tslib_1.__importDefault(require("../globalState"));
@@ -14,12 +14,11 @@ const getOperationLabel = (operation, tense) => {
14
14
  return tense === 'running' ? 'Uploading' : 'Uploaded';
15
15
  };
16
16
  const formatDurationTag = (durationMs) => chalk_1.default.gray(getDurationLabel(durationMs));
17
- exports.formatDurationTag = formatDurationTag;
18
- const formatContentAsCodeAction = ({ label, detail, durationMs, }) => `${chalk_1.default.bold(label.padEnd(ACTION_LABEL_WIDTH))} ${chalk_1.default.gray(detail)} ${(0, exports.formatDurationTag)(durationMs)}`;
17
+ const formatContentAsCodeAction = ({ label, detail, durationMs, }) => `${chalk_1.default.bold(label.padEnd(ACTION_LABEL_WIDTH))} ${chalk_1.default.gray(detail)} ${formatDurationTag(durationMs)}`;
19
18
  exports.formatContentAsCodeAction = formatContentAsCodeAction;
20
19
  const formatTreeItem = ({ label, detail, durationMs, variant = 'success', }) => {
21
20
  const status = variant === 'success' ? chalk_1.default.green('✓') : chalk_1.default.yellow('⚠');
22
- return ` ${TREE_CONNECTOR} ${status} ${chalk_1.default.bold(label)} ${chalk_1.default.gray(`· ${detail}`)} ${(0, exports.formatDurationTag)(durationMs)}`;
21
+ return ` ${TREE_CONNECTOR} ${status} ${chalk_1.default.bold(label)} ${chalk_1.default.gray(`· ${detail}`)} ${formatDurationTag(durationMs)}`;
23
22
  };
24
23
  const formatContentAsCodeProgress = ({ operation, scope, items, activeLabel, activeDetail, }) => {
25
24
  const header = `${chalk_1.default.bold(getOperationLabel(operation, 'running'))} content as code ${chalk_1.default.gray(`(${scope})`)}`;
@@ -49,9 +48,8 @@ const canRenderContentAsCodeTree = () => Boolean(process.stderr.isTTY &&
49
48
  process.env.TERM !== 'dumb' &&
50
49
  process.env.NO_UNICODE !== '1' &&
51
50
  process.env.NO_UNICODE !== 'true');
52
- exports.canRenderContentAsCodeTree = canRenderContentAsCodeTree;
53
51
  const logContentAsCodeDiscovery = (message) => {
54
- if ((0, exports.canRenderContentAsCodeTree)()) {
52
+ if (canRenderContentAsCodeTree()) {
55
53
  globalState_1.default.debug(message);
56
54
  }
57
55
  else {
@@ -60,15 +58,14 @@ const logContentAsCodeDiscovery = (message) => {
60
58
  };
61
59
  exports.logContentAsCodeDiscovery = logContentAsCodeDiscovery;
62
60
  const renderContentAsCodeComplete = (props) => {
63
- if (!(0, exports.canRenderContentAsCodeTree)()) {
61
+ if (!canRenderContentAsCodeTree()) {
64
62
  return false;
65
63
  }
66
64
  process.stderr.write(`${(0, exports.formatContentAsCodeComplete)(props)}\n`);
67
65
  return true;
68
66
  };
69
- exports.renderContentAsCodeComplete = renderContentAsCodeComplete;
70
67
  const createContentAsCodeOutput = ({ operation, scope, }) => {
71
- const useTree = (0, exports.canRenderContentAsCodeTree)();
68
+ const useTree = canRenderContentAsCodeTree();
72
69
  const items = [];
73
70
  let activeLabel = 'Content';
74
71
  let activeDetail;
@@ -173,7 +170,7 @@ const createContentAsCodeOutput = ({ operation, scope, }) => {
173
170
  return false;
174
171
  }
175
172
  spinner?.stop();
176
- return (0, exports.renderContentAsCodeComplete)({
173
+ return renderContentAsCodeComplete({
177
174
  operation,
178
175
  scope,
179
176
  path,
@@ -6,7 +6,7 @@ Two skills in `.claude/skills/` describe how to edit this app:
6
6
 
7
7
  Edit only `src/`. Root config files are read-only reference — the server rebuilds against a trusted template.
8
8
 
9
- The local build is an optional pre-check. Apps made with `lightdash create app` already have dependencies installed and can run `npm run build`; after `lightdash download`, use `npm install && npm run build` if you choose to build locally. If install fails, skip it and upload — never modify machine config, npmrc, or dependency files to force it; the server rebuild is authoritative.
9
+ The local build is an optional pre-check. Apps made with `lightdash apps create` already have dependencies installed and can run `npm run build`; after `lightdash download`, use `npm install && npm run build` if you choose to build locally. If install fails, skip it and upload — never modify machine config, npmrc, or dependency files to force it; the server rebuild is authoritative.
10
10
 
11
11
  Build with the template's preinstalled dependency set (see `package.json`). Adding new npm packages only works when the instance has custom dependencies enabled — assume it does not; ask the user before considering a new library, and never vendor library source into `src/` as a workaround. Where enabled, adding a dependency is the one workflow that still requires pnpm: upload requires a matching `pnpm-lock.yaml`, so `pnpm add <pkg>` (or `pnpm install --lockfile-only`) must succeed locally. If it fails, stop and report the error — hand-editing `package.json` without the lockfile makes the upload fail.
12
12
 
@@ -4,7 +4,7 @@ Created or downloaded with the Lightdash CLI.
4
4
 
5
5
  ## Edit → build → upload
6
6
  1. Edit files under `src/`.
7
- 2. Optionally, run `npm run build` to check it compiles locally. `lightdash create app` installs the initial dependencies after asking permission; after `lightdash download`, run `npm install` first if `node_modules` is absent. If install fails in your environment, skip the local build — the server build on upload is authoritative and surfaces errors on the app page. Don't change machine or registry config to force it.
7
+ 2. Optionally, run `npm run build` to check it compiles locally. `lightdash apps create` installs the initial dependencies after asking permission; after `lightdash download`, run `npm install` first if `node_modules` is absent. If install fails in your environment, skip the local build — the server build on upload is authoritative and surfaces errors on the app page. Don't change machine or registry config to force it.
8
8
  3. Optionally, preview against real data: `lightdash apps preview` (needs a successful `npm install`).
9
9
  4. `lightdash upload --apps <slug>` (the `slug` from `lightdash-app.yml`) — Lightdash rebuilds and serves the app.
10
10
 
@@ -28,7 +28,7 @@ You are editing a Lightdash **data app** that was created or downloaded with the
28
28
  ## The edit → build → upload loop
29
29
 
30
30
  1. Edit files under `src/` only.
31
- 2. Optionally, run `npm run build` to check it compiles. Apps made with `lightdash create app` already have their initial dependencies installed. After `lightdash download`, if you choose to do the local pre-check and `node_modules` is absent, run `npm install` first. This is an **optional local pre-check** — see below.
31
+ 2. Optionally, run `npm run build` to check it compiles. Apps made with `lightdash apps create` already have their initial dependencies installed. After `lightdash download`, if you choose to do the local pre-check and `node_modules` is absent, run `npm install` first. This is an **optional local pre-check** — see below.
32
32
  3. `lightdash upload --apps <slug>` (the `slug` from this folder's `lightdash-app.yml`) — the **server** rebuilds and serves the app. The server rebuild, not your local build, is what ships.
33
33
 
34
34
  ## The local build is optional — never fight a failing install
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "1.51.0",
3
+ "version": "1.52.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.51.0",
45
- "@lightdash/warehouses": "1.51.0"
44
+ "@lightdash/warehouses": "1.52.0",
45
+ "@lightdash/common": "1.52.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/inquirer": "8.2.4",