@cedarjs/cli 6.0.0-canary.2713 → 6.0.0-canary.2715

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/cfw.js CHANGED
@@ -40,6 +40,8 @@ try {
40
40
  // CEDAR_DISABLE_TELEMETRY
41
41
  env: { CEDAR_CWD: projectPath }
42
42
  });
43
- } catch {
43
+ } catch (e) {
44
44
  console.log();
45
+ const exitCode = e && typeof e === "object" && "exitCode" in e && typeof e.exitCode === "number" ? e.exitCode : 1;
46
+ process.exit(exitCode);
45
47
  }
@@ -24,15 +24,35 @@ function getPersistenceDirectory() {
24
24
  persistenceDirectory = path.join(getPaths().generated.base, "updateCheck");
25
25
  return persistenceDirectory;
26
26
  }
27
- async function check() {
27
+ function getLocalVersion() {
28
+ let version;
28
29
  try {
29
- console.time("Update Check");
30
30
  const packageJson = JSON.parse(
31
31
  fs.readFileSync(path.join(getPaths().base, "package.json"), "utf-8")
32
32
  );
33
- let localVersion = packageJson.devDependencies["@cedarjs/core"];
34
- while (!/\d/.test(localVersion.charAt(0))) {
35
- localVersion = localVersion.substring(1);
33
+ version = packageJson.devDependencies?.["@cedarjs/core"];
34
+ } catch {
35
+ return void 0;
36
+ }
37
+ if (typeof version === "string" && semver.valid(version)) {
38
+ return version;
39
+ }
40
+ return void 0;
41
+ }
42
+ async function check() {
43
+ try {
44
+ console.time("Update Check");
45
+ const localVersion = getLocalVersion();
46
+ if (!localVersion) {
47
+ console.log(
48
+ "Skipping update check: no pinned @cedarjs/core version found"
49
+ );
50
+ updateUpdateDataFile({
51
+ localVersion: "0.0.0",
52
+ remoteVersions: /* @__PURE__ */ new Map(),
53
+ checkedAt: (/* @__PURE__ */ new Date()).getTime()
54
+ });
55
+ return;
36
56
  }
37
57
  console.log(`Detected the current version of Cedar: '${localVersion}'`);
38
58
  const remoteVersions = /* @__PURE__ */ new Map();
@@ -69,16 +89,24 @@ function shouldCheck() {
69
89
  return false;
70
90
  }
71
91
  const data = readUpdateDataFile();
92
+ const localVersion = getLocalVersion();
93
+ if (localVersion && localVersion !== data.localVersion) {
94
+ return true;
95
+ }
72
96
  return data.checkedAt < (/* @__PURE__ */ new Date()).getTime() - CHECK_PERIOD;
73
97
  }
74
98
  function shouldShow() {
75
99
  if (isLockSet(SHOW_LOCK_IDENTIFIER)) {
76
100
  return false;
77
101
  }
102
+ const localVersion = getLocalVersion();
103
+ if (!localVersion) {
104
+ return false;
105
+ }
78
106
  const data = readUpdateDataFile();
79
107
  let newerVersion = false;
80
108
  data.remoteVersions.forEach((version) => {
81
- newerVersion ||= semver.gt(version, data.localVersion);
109
+ newerVersion ||= semver.gt(version, localVersion);
82
110
  });
83
111
  return data.shownAt < (/* @__PURE__ */ new Date()).getTime() - SHOW_PERIOD && newerVersion;
84
112
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "6.0.0-canary.2713",
3
+ "version": "6.0.0-canary.2715",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,17 +33,17 @@
33
33
  "dependencies": {
34
34
  "@babel/parser": "7.29.7",
35
35
  "@babel/preset-typescript": "7.29.7",
36
- "@cedarjs/api-server": "6.0.0-canary.2713",
37
- "@cedarjs/cli-helpers": "6.0.0-canary.2713",
38
- "@cedarjs/fastify-web": "6.0.0-canary.2713",
39
- "@cedarjs/internal": "6.0.0-canary.2713",
40
- "@cedarjs/prerender": "6.0.0-canary.2713",
41
- "@cedarjs/project-config": "6.0.0-canary.2713",
42
- "@cedarjs/structure": "6.0.0-canary.2713",
43
- "@cedarjs/telemetry": "6.0.0-canary.2713",
44
- "@cedarjs/utils": "6.0.0-canary.2713",
45
- "@cedarjs/vite": "6.0.0-canary.2713",
46
- "@cedarjs/web-server": "6.0.0-canary.2713",
36
+ "@cedarjs/api-server": "6.0.0-canary.2715",
37
+ "@cedarjs/cli-helpers": "6.0.0-canary.2715",
38
+ "@cedarjs/fastify-web": "6.0.0-canary.2715",
39
+ "@cedarjs/internal": "6.0.0-canary.2715",
40
+ "@cedarjs/prerender": "6.0.0-canary.2715",
41
+ "@cedarjs/project-config": "6.0.0-canary.2715",
42
+ "@cedarjs/structure": "6.0.0-canary.2715",
43
+ "@cedarjs/telemetry": "6.0.0-canary.2715",
44
+ "@cedarjs/utils": "6.0.0-canary.2715",
45
+ "@cedarjs/vite": "6.0.0-canary.2715",
46
+ "@cedarjs/web-server": "6.0.0-canary.2715",
47
47
  "@listr2/prompt-adapter-enquirer": "4.2.2",
48
48
  "@opentelemetry/api": "1.9.1",
49
49
  "@opentelemetry/core": "1.30.1",