@lightdash/cli 1.51.1 → 1.53.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/dist/.tsbuildinfo +1 -1
- package/dist/analytics/analytics.d.ts +1 -1
- package/dist/analytics/analytics.d.ts.map +1 -1
- package/dist/analytics/analytics.js +1 -2
- package/dist/dbt/manifest.d.ts +0 -3
- package/dist/dbt/manifest.d.ts.map +1 -1
- package/dist/dbt/manifest.js +5 -8
- package/dist/dbt/targets/Bigquery/index.d.ts +0 -14
- package/dist/dbt/targets/Bigquery/index.d.ts.map +1 -1
- package/dist/dbt/targets/Bigquery/index.js +4 -4
- package/dist/dbt/targets/Bigquery/serviceAccount.d.ts +0 -3
- package/dist/dbt/targets/Bigquery/serviceAccount.d.ts.map +1 -1
- package/dist/dbt/targets/Bigquery/serviceAccount.js +5 -5
- package/dist/dbt/targets/athena.d.ts +0 -2
- package/dist/dbt/targets/athena.d.ts.map +1 -1
- package/dist/dbt/targets/athena.js +4 -4
- package/dist/dbt/targets/clickhouse.d.ts +0 -2
- package/dist/dbt/targets/clickhouse.d.ts.map +1 -1
- package/dist/dbt/targets/clickhouse.js +4 -4
- package/dist/dbt/targets/databricks.d.ts +0 -2
- package/dist/dbt/targets/databricks.d.ts.map +1 -1
- package/dist/dbt/targets/databricks.js +4 -4
- package/dist/dbt/targets/postgres.d.ts +0 -2
- package/dist/dbt/targets/postgres.d.ts.map +1 -1
- package/dist/dbt/targets/postgres.js +4 -4
- package/dist/dbt/targets/redshift.d.ts +0 -2
- package/dist/dbt/targets/redshift.d.ts.map +1 -1
- package/dist/dbt/targets/redshift.js +4 -4
- package/dist/dbt/targets/trino.d.ts +0 -2
- package/dist/dbt/targets/trino.d.ts.map +1 -1
- package/dist/dbt/targets/trino.js +4 -4
- package/dist/handlers/apps/scaffolding.d.ts +0 -4
- package/dist/handlers/apps/scaffolding.d.ts.map +1 -1
- package/dist/handlers/apps/scaffolding.js +2 -3
- package/dist/handlers/contentAsCode/fileNames.d.ts +0 -1
- package/dist/handlers/contentAsCode/fileNames.d.ts.map +1 -1
- package/dist/handlers/contentAsCode/fileNames.js +4 -4
- package/dist/handlers/dbt/compile.d.ts +0 -1
- package/dist/handlers/dbt/compile.d.ts.map +1 -1
- package/dist/handlers/dbt/compile.js +2 -4
- package/dist/handlers/dbt/getDbtVersion.d.ts +0 -1
- package/dist/handlers/dbt/getDbtVersion.d.ts.map +1 -1
- package/dist/handlers/dbt/getDbtVersion.js +5 -5
- package/dist/handlers/dbt/getWarehouseClient.d.ts +1 -8
- package/dist/handlers/dbt/getWarehouseClient.d.ts.map +1 -1
- package/dist/handlers/dbt/getWarehouseClient.js +2 -3
- package/dist/handlers/dbt/refresh.d.ts +1 -3
- package/dist/handlers/dbt/refresh.d.ts.map +1 -1
- package/dist/handlers/dbt/refresh.js +3 -5
- package/dist/handlers/deploy.d.ts +1 -2
- package/dist/handlers/deploy.d.ts.map +1 -1
- package/dist/handlers/deploy.js +3 -4
- package/dist/handlers/renameHandler.d.ts.map +1 -1
- package/dist/handlers/renameHandler.js +25 -16
- package/dist/handlers/renameHandler.test.d.ts +2 -0
- package/dist/handlers/renameHandler.test.d.ts.map +1 -0
- package/dist/handlers/renameHandler.test.js +148 -0
- package/dist/handlers/renameProject.d.ts +0 -1
- package/dist/handlers/renameProject.d.ts.map +1 -1
- package/dist/handlers/renameProject.js +2 -3
- package/dist/handlers/setProject.d.ts +0 -1
- package/dist/handlers/setProject.d.ts.map +1 -1
- package/dist/handlers/setProject.js +2 -3
- package/dist/handlers/validate.d.ts +6 -3
- package/dist/handlers/validate.d.ts.map +1 -1
- package/dist/handlers/validate.js +10 -8
- package/dist/terminal/contentAsCodeOutput.d.ts +0 -3
- package/dist/terminal/contentAsCodeOutput.d.ts.map +1 -1
- package/dist/terminal/contentAsCodeOutput.js +7 -10
- 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.
|
|
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
|
|
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
|
-
|
|
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;
|
|
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;AAwBP,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,MAAM,EAAE,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,KAAK,CAAC;CAC5C,CAAC;AAEF,eAAO,MAAM,iBAAiB,iDAI3B,wBAAwB,KAAG,OAAO,CAAC,MAAM,CAY3C,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.
|
|
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
|
|
57
|
+
throw createError(job.details?.error || 'unknown error');
|
|
60
58
|
}
|
|
61
|
-
return delay(
|
|
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
|
|
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)(
|
|
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
|
|
@@ -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,CAAC;AAEF,KAAK,yBAAyB,GAAG,IAAI,CACjC,wBAAwB,EACxB,WAAW,GAAG,OAAO,GAAG,gBAAgB,GAAG,OAAO,CACrD,GAAG;IACA,UAAU,EAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;CACxD,CAAC;
|
|
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,CAAC;AAEF,KAAK,yBAAyB,GAAG,IAAI,CACjC,wBAAwB,EACxB,WAAW,GAAG,OAAO,GAAG,gBAAgB,GAAG,OAAO,CACrD,GAAG;IACA,UAAU,EAAE,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;CACxD,CAAC;AAqBF,eAAO,MAAM,yBAAyB,mCAInC,IAAI,CAAC,uBAAuB,EAAE,OAAO,GAAG,QAAQ,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.
|
|
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
|
-
|
|
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}`)} ${
|
|
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 (
|
|
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 (!
|
|
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 =
|
|
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
|
|
173
|
+
return renderContentAsCodeComplete({
|
|
177
174
|
operation,
|
|
178
175
|
scope,
|
|
179
176
|
path,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lightdash/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.53.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/
|
|
45
|
-
"@lightdash/
|
|
44
|
+
"@lightdash/common": "1.53.0",
|
|
45
|
+
"@lightdash/warehouses": "1.53.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/inquirer": "8.2.4",
|