@lightdash/cli 0.2154.0 → 0.2154.2

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":"preview.d.ts","sourceRoot":"","sources":["../../src/handlers/preview.ts"],"names":[],"mappings":"AACA,OAAO,EAEH,+BAA+B,EAGlC,MAAM,mBAAmB,CAAC;AAe3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,KAAK,qBAAqB,GAAG,iBAAiB,GAAG;IAC7C,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,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,+BAA+B,CAAC;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AAyEF,eAAO,MAAM,cAAc,YACd,qBAAqB,KAC/B,OAAO,CAAC,IAAI,CAyOd,CAAC;AAEF,eAAO,MAAM,mBAAmB,YACnB,qBAAqB,KAC/B,OAAO,CAAC,IAAI,CAwHd,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAClB,yBAAyB,KACnC,OAAO,CAAC,IAAI,CA0Cd,CAAC"}
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/handlers/preview.ts"],"names":[],"mappings":"AACA,OAAO,EACH,+BAA+B,EAGlC,MAAM,mBAAmB,CAAC;AAe3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGlD,KAAK,qBAAqB,GAAG,iBAAiB,GAAG;IAC7C,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,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,kBAAkB,EAAE,+BAA+B,CAAC;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CACpB,CAAC;AAyEF,eAAO,MAAM,cAAc,YACd,qBAAqB,KAC/B,OAAO,CAAC,IAAI,CAiPd,CAAC;AAEF,eAAO,MAAM,mBAAmB,YACnB,qBAAqB,KAC/B,OAAO,CAAC,IAAI,CAwHd,CAAC;AAEF,eAAO,MAAM,kBAAkB,YAClB,yBAAyB,KACnC,OAAO,CAAC,IAAI,CA0Cd,CAAC"}
@@ -92,6 +92,7 @@ const previewHandler = async (options) => {
92
92
  let project;
93
93
  let hasContentCopy = false;
94
94
  let contentCopyError;
95
+ let contentCopySkipReason;
95
96
  const config = await (0, config_1.getConfig)();
96
97
  // Validate upstream project before attempting to copy content
97
98
  let upstreamProjectValid = false;
@@ -104,22 +105,27 @@ const previewHandler = async (options) => {
104
105
  body: undefined,
105
106
  });
106
107
  upstreamProjectValid =
107
- upstreamProject.results.projectUuid === config.context.project;
108
+ upstreamProject.projectUuid === config.context.project;
108
109
  if (!upstreamProjectValid) {
110
+ contentCopySkipReason = `Project UUID mismatch. Expected ${config.context.project} but got ${upstreamProject.projectUuid}`;
109
111
  console.error(styles.warning(`\n\nWarning: Cannot access upstream project "${config.context.projectName || config.context.project}"\n` +
110
112
  `Content will not be copied. Please run 'lightdash config set-project' to set a valid project.\n`));
111
113
  }
112
114
  }
113
115
  catch (e) {
114
- globalState_1.default.debug(`> Upstream project validation failed: ${e instanceof Error ? e.message : String(e)}`);
116
+ const errorMessage = e instanceof Error ? e.message : String(e);
117
+ contentCopySkipReason = `Failed to validate upstream project: ${errorMessage}`;
118
+ globalState_1.default.debug(`> Upstream project validation failed: ${errorMessage}`);
115
119
  console.error(styles.warning(`\n\nWarning: Cannot access upstream project "${config.context.projectName || config.context.project}"\n` +
116
120
  `Content will not be copied. Please run 'lightdash config set-project' to set a valid project.\n`));
117
121
  }
118
122
  }
119
123
  if (!config.context?.project) {
124
+ contentCopySkipReason = 'No upstream project configured';
120
125
  console.error(styles.warning(`\n\nDeveloper preview will be deployed without any copied content!\nPlease set a project to copy content from by running 'lightdash config set-project'.\n`));
121
126
  }
122
127
  else if (options.skipCopyContent) {
128
+ contentCopySkipReason = '--skip-copy-content flag was used';
123
129
  console.error(styles.warning(`\n\nDeveloper preview will be deployed without any copied content!\n`));
124
130
  }
125
131
  else if (upstreamProjectValid) {
@@ -173,7 +179,14 @@ const previewHandler = async (options) => {
173
179
  process.exit(0);
174
180
  });
175
181
  if (!hasContentCopy) {
176
- const errorMessage = `\n\nDeveloper preview deployed without any copied content!\n ${contentCopyError ? `Error: ${contentCopyError}\n` : ''}`;
182
+ let errorMessage = `\n\nDeveloper preview deployed without any copied content!`;
183
+ if (contentCopyError) {
184
+ errorMessage += `\nError: ${contentCopyError}`;
185
+ }
186
+ else if (contentCopySkipReason) {
187
+ errorMessage += `\nReason: ${contentCopySkipReason}`;
188
+ }
189
+ errorMessage += '\n';
177
190
  console.error(styles.warning(errorMessage));
178
191
  }
179
192
  spinner.succeed(` Developer preview "${name}" ready at: ${await projectUrl(project)}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lightdash/cli",
3
- "version": "0.2154.0",
3
+ "version": "0.2154.2",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "lightdash": "dist/index.js"
@@ -33,8 +33,8 @@
33
33
  "parse-node-version": "^2.0.0",
34
34
  "unique-names-generator": "^4.7.1",
35
35
  "uuid": "^11.0.3",
36
- "@lightdash/common": "0.2154.0",
37
- "@lightdash/warehouses": "0.2154.0"
36
+ "@lightdash/warehouses": "0.2154.2",
37
+ "@lightdash/common": "0.2154.2"
38
38
  },
39
39
  "description": "Lightdash CLI tool",
40
40
  "devDependencies": {