@cedarjs/cli 1.0.0-canary.13087 → 1.0.0-canary.13089

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.
@@ -68,7 +68,7 @@ const handler = async ({
68
68
  },
69
69
  {
70
70
  title: "Checking latest version",
71
- task: async (ctx) => setLatestVersionToContext(ctx, tag)
71
+ task: async (ctx) => setLatestVersionToContext(ctx, tag, verbose)
72
72
  },
73
73
  {
74
74
  title: "Running pre-upgrade scripts",
@@ -220,7 +220,10 @@ async function removeCliCache({
220
220
  fs.rmSync(cliCacheDir, { recursive: true, force: true });
221
221
  }
222
222
  }
223
- async function setLatestVersionToContext(ctx, tag) {
223
+ function isErrorWithNestedCode(error, code) {
224
+ return error instanceof Object && ("code" in error && error.code === code || "cause" in error && isErrorWithNestedCode(error.cause, code));
225
+ }
226
+ async function setLatestVersionToContext(ctx, tag, verbose) {
224
227
  try {
225
228
  const foundVersion = await latestVersion(
226
229
  "@cedarjs/core",
@@ -228,11 +231,15 @@ async function setLatestVersionToContext(ctx, tag) {
228
231
  );
229
232
  ctx.versionToUpgradeTo = foundVersion;
230
233
  return foundVersion;
231
- } catch {
234
+ } catch (error) {
235
+ if (verbose) {
236
+ console.error(error);
237
+ }
238
+ const proxyError = isErrorWithNestedCode(error, "ENOTFOUND") ? "\n\nIf you are behind a proxy, please set the relevant proxy environment variables.\nSee here for more information: https://nodejs.org/api/http.html#built-in-proxy-support\n" : "";
232
239
  if (tag) {
233
- throw new Error("Could not find the latest `" + tag + "` version");
240
+ throw new Error(`Could not find the latest '${tag}' version${proxyError}`);
234
241
  }
235
- throw new Error("Could not find the latest version");
242
+ throw new Error(`Could not find the latest version${proxyError}`);
236
243
  }
237
244
  }
238
245
  function updatePackageJsonVersion(pkgPath, version, task, { dryRun, verbose }) {
@@ -422,10 +429,7 @@ async function downloadYarnPatches(ctx, { dryRun, verbose }) {
422
429
  }
423
430
  async function refreshPrismaClient(task, { verbose }) {
424
431
  try {
425
- await generatePrismaClient({
426
- verbose,
427
- force: false
428
- });
432
+ await generatePrismaClient({ verbose, force: false });
429
433
  } catch (e) {
430
434
  const message = e instanceof Error ? e.message : String(e);
431
435
  task.skip("Refreshing the Prisma client caused an Error.");
@@ -446,7 +450,7 @@ const dedupeDeps = async (_task, { verbose }) => {
446
450
  const message = e instanceof Error ? e.message : String(e);
447
451
  console.log(c.error(message));
448
452
  throw new Error(
449
- "Could not finish de-duplication. For yarn 1.x, please run `npx yarn-deduplicate`, or for yarn >= 3 run `yarn dedupe` before continuing"
453
+ "Could not finish de-duplication. Please run `yarn dedupe` before continuing"
450
454
  );
451
455
  }
452
456
  await yarnInstall({ verbose });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "1.0.0-canary.13087+3ff4fbc34",
3
+ "version": "1.0.0-canary.13089+e15b34d23",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -32,15 +32,15 @@
32
32
  "dependencies": {
33
33
  "@babel/preset-typescript": "7.28.5",
34
34
  "@babel/runtime-corejs3": "7.28.4",
35
- "@cedarjs/api-server": "1.0.0-canary.13087",
36
- "@cedarjs/cli-helpers": "1.0.0-canary.13087",
37
- "@cedarjs/fastify-web": "1.0.0-canary.13087",
38
- "@cedarjs/internal": "1.0.0-canary.13087",
39
- "@cedarjs/prerender": "1.0.0-canary.13087",
40
- "@cedarjs/project-config": "1.0.0-canary.13087",
41
- "@cedarjs/structure": "1.0.0-canary.13087",
42
- "@cedarjs/telemetry": "1.0.0-canary.13087",
43
- "@cedarjs/web-server": "1.0.0-canary.13087",
35
+ "@cedarjs/api-server": "1.0.0-canary.13089",
36
+ "@cedarjs/cli-helpers": "1.0.0-canary.13089",
37
+ "@cedarjs/fastify-web": "1.0.0-canary.13089",
38
+ "@cedarjs/internal": "1.0.0-canary.13089",
39
+ "@cedarjs/prerender": "1.0.0-canary.13089",
40
+ "@cedarjs/project-config": "1.0.0-canary.13089",
41
+ "@cedarjs/structure": "1.0.0-canary.13089",
42
+ "@cedarjs/telemetry": "1.0.0-canary.13089",
43
+ "@cedarjs/web-server": "1.0.0-canary.13089",
44
44
  "@listr2/prompt-adapter-enquirer": "2.0.16",
45
45
  "@opentelemetry/api": "1.8.0",
46
46
  "@opentelemetry/core": "1.22.0",
@@ -102,5 +102,5 @@
102
102
  "publishConfig": {
103
103
  "access": "public"
104
104
  },
105
- "gitHead": "3ff4fbc3470b1390190d4b1efc9f03737e61e91b"
105
+ "gitHead": "e15b34d233e0784e967ceed098e0241d4e34c1f8"
106
106
  }