@cedarjs/cli 7.0.0-canary.3015 → 7.0.0-canary.3019
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/commands/experimental/setupReactCompilerHandler.js +3 -3
- package/dist/commands/setup/package/packageHandler.js +3 -3
- package/dist/commands/upgrade/preUpgradeScripts.js +3 -3
- package/dist/lib/updateCheck.js +4 -4
- package/dist/middleware/checkNodeVersion.js +3 -3
- package/package.json +14 -14
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { Listr } from "listr2";
|
|
4
|
-
import
|
|
4
|
+
import { coerce, isGreaterOrEqual } from "verkit";
|
|
5
5
|
import { colors as c } from "@cedarjs/cli-helpers";
|
|
6
6
|
import {
|
|
7
7
|
addRootPackages,
|
|
@@ -39,8 +39,8 @@ const handler = async (options) => {
|
|
|
39
39
|
)
|
|
40
40
|
);
|
|
41
41
|
const reactVersion = webPkgJson["dependencies"]["react"];
|
|
42
|
-
const coercedReactVersion =
|
|
43
|
-
if (!coercedReactVersion || !
|
|
42
|
+
const coercedReactVersion = coerce(reactVersion);
|
|
43
|
+
if (!coercedReactVersion || !isGreaterOrEqual(coercedReactVersion, "19.0.0")) {
|
|
44
44
|
throw new Error(
|
|
45
45
|
"You need to be using at least React version 19 to enable the React Compiler"
|
|
46
46
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import enq from "enquirer";
|
|
2
|
-
import
|
|
2
|
+
import { isGreaterOrEqual, isLess, tryParse } from "verkit";
|
|
3
3
|
import { getCompatibilityData } from "@cedarjs/cli-helpers";
|
|
4
4
|
import { dlx } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
5
5
|
import { getPaths } from "@cedarjs/project-config";
|
|
@@ -16,7 +16,7 @@ async function handler({
|
|
|
16
16
|
console.log(
|
|
17
17
|
"No compatibility check will be performed because you used the --force flag."
|
|
18
18
|
);
|
|
19
|
-
if (
|
|
19
|
+
if (tryParse(packageVersion) !== null && isLess(packageVersion, "1.0.0")) {
|
|
20
20
|
console.log(
|
|
21
21
|
"Be aware that this package is under version 1.0.0 and so should be considered experimental."
|
|
22
22
|
);
|
|
@@ -86,7 +86,7 @@ The latest version compatible with your project is ${latestCompatibleVersionText
|
|
|
86
86
|
await runPackage(packageName, versionToUse, additionalOptionsToForward);
|
|
87
87
|
}
|
|
88
88
|
async function showExperimentalWarning(version) {
|
|
89
|
-
if (version === void 0 ||
|
|
89
|
+
if (version === void 0 || tryParse(version) === null || isGreaterOrEqual(version, "1.0.0")) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
const decision = await promptWithChoices(
|
|
@@ -3,7 +3,7 @@ import { builtinModules } from "node:module";
|
|
|
3
3
|
import os from "node:os";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import execa from "execa";
|
|
6
|
-
import
|
|
6
|
+
import { tryParse } from "verkit";
|
|
7
7
|
const MAIN_BRANCH_PRERELEASE_TAGS = ["canary"];
|
|
8
8
|
function isExecaError(e) {
|
|
9
9
|
return e instanceof Error && ("stdout" in e || "stderr" in e || "exitCode" in e);
|
|
@@ -13,7 +13,7 @@ async function runPreUpgradeScripts(ctx, task, { verbose, force }) {
|
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
15
|
const version = typeof ctx.versionToUpgradeTo === "string" ? ctx.versionToUpgradeTo : void 0;
|
|
16
|
-
const parsed =
|
|
16
|
+
const parsed = version ? tryParse(version) : null;
|
|
17
17
|
const baseUrl = "https://raw.githubusercontent.com/cedarjs/cedar/main/upgrade-scripts/";
|
|
18
18
|
const manifestUrl = `${baseUrl}manifest.json`;
|
|
19
19
|
let manifest = [];
|
|
@@ -34,7 +34,7 @@ async function runPreUpgradeScripts(ctx, task, { verbose, force }) {
|
|
|
34
34
|
if (!Array.isArray(manifest) || manifest.length === 0) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
const prereleaseTag = parsed?.prerelease[0];
|
|
37
|
+
const prereleaseTag = parsed?.prerelease?.[0];
|
|
38
38
|
const isMainBranchPrerelease = typeof prereleaseTag === "string" && MAIN_BRANCH_PRERELEASE_TAGS.includes(prereleaseTag);
|
|
39
39
|
const checkLevels = [];
|
|
40
40
|
if (parsed && isMainBranchPrerelease) {
|
package/dist/lib/updateCheck.js
CHANGED
|
@@ -3,7 +3,7 @@ import path from "path";
|
|
|
3
3
|
import ansis from "ansis";
|
|
4
4
|
import boxen from "boxen";
|
|
5
5
|
import latestVersion from "latest-version";
|
|
6
|
-
import
|
|
6
|
+
import { isGreater, isValid } from "verkit";
|
|
7
7
|
import { formatCedarCommand } from "@cedarjs/cli-helpers/packageManager/display";
|
|
8
8
|
import { getNodeRunnerArgs } from "@cedarjs/cli-helpers/packageManager/exec";
|
|
9
9
|
import { getConfig } from "@cedarjs/project-config";
|
|
@@ -34,7 +34,7 @@ function getLocalVersion() {
|
|
|
34
34
|
} catch {
|
|
35
35
|
return void 0;
|
|
36
36
|
}
|
|
37
|
-
if (typeof version === "string" &&
|
|
37
|
+
if (typeof version === "string" && isValid(version)) {
|
|
38
38
|
return version;
|
|
39
39
|
}
|
|
40
40
|
return void 0;
|
|
@@ -106,7 +106,7 @@ function shouldShow() {
|
|
|
106
106
|
const data = readUpdateDataFile();
|
|
107
107
|
let newerVersion = false;
|
|
108
108
|
data.remoteVersions.forEach((version) => {
|
|
109
|
-
newerVersion ||=
|
|
109
|
+
newerVersion ||= isGreater(version, localVersion);
|
|
110
110
|
});
|
|
111
111
|
return data.shownAt < (/* @__PURE__ */ new Date()).getTime() - SHOW_PERIOD && newerVersion;
|
|
112
112
|
}
|
|
@@ -120,7 +120,7 @@ function getUpdateMessage() {
|
|
|
120
120
|
let updateCount = 0;
|
|
121
121
|
let message = ` New updates to Cedar are available via \`${formatCedarCommand(["upgrade#REPLACEME#"])}\` `;
|
|
122
122
|
data.remoteVersions.forEach((version, tag) => {
|
|
123
|
-
if (
|
|
123
|
+
if (isGreater(version, data.localVersion)) {
|
|
124
124
|
updateCount += 1;
|
|
125
125
|
if (tag === localTag) {
|
|
126
126
|
message += `
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { clean, isGreaterOrEqual } from "verkit";
|
|
2
2
|
import { colors as c } from "@cedarjs/cli-helpers";
|
|
3
3
|
function checkNodeVersion() {
|
|
4
4
|
const checks = { ok: true };
|
|
5
5
|
const pVersion = process.version;
|
|
6
|
-
const pVersionC =
|
|
6
|
+
const pVersionC = clean(pVersion);
|
|
7
7
|
const LOWER_BOUND = "v24.0.0";
|
|
8
8
|
if (!pVersionC) {
|
|
9
9
|
checks.ok = false;
|
|
10
10
|
checks.message = `Invalid Node.js version: ${pVersion}`;
|
|
11
11
|
return checks;
|
|
12
12
|
}
|
|
13
|
-
if (
|
|
13
|
+
if (isGreaterOrEqual(pVersionC, LOWER_BOUND)) {
|
|
14
14
|
return checks;
|
|
15
15
|
}
|
|
16
16
|
checks.ok = false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "7.0.0-canary.
|
|
3
|
+
"version": "7.0.0-canary.3019",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"@babel/preset-typescript": "7.29.7",
|
|
37
37
|
"@babel/traverse": "7.29.8",
|
|
38
38
|
"@babel/types": "7.29.8",
|
|
39
|
-
"@cedarjs/api-server": "7.0.0-canary.
|
|
40
|
-
"@cedarjs/babel-config": "7.0.0-canary.
|
|
41
|
-
"@cedarjs/cli-helpers": "7.0.0-canary.
|
|
42
|
-
"@cedarjs/internal": "7.0.0-canary.
|
|
43
|
-
"@cedarjs/prerender": "7.0.0-canary.
|
|
44
|
-
"@cedarjs/project-config": "7.0.0-canary.
|
|
45
|
-
"@cedarjs/structure": "7.0.0-canary.
|
|
46
|
-
"@cedarjs/telemetry": "7.0.0-canary.
|
|
47
|
-
"@cedarjs/utils": "7.0.0-canary.
|
|
48
|
-
"@cedarjs/vite": "7.0.0-canary.
|
|
49
|
-
"@cedarjs/web-server": "7.0.0-canary.
|
|
39
|
+
"@cedarjs/api-server": "7.0.0-canary.3019",
|
|
40
|
+
"@cedarjs/babel-config": "7.0.0-canary.3019",
|
|
41
|
+
"@cedarjs/cli-helpers": "7.0.0-canary.3019",
|
|
42
|
+
"@cedarjs/internal": "7.0.0-canary.3019",
|
|
43
|
+
"@cedarjs/prerender": "7.0.0-canary.3019",
|
|
44
|
+
"@cedarjs/project-config": "7.0.0-canary.3019",
|
|
45
|
+
"@cedarjs/structure": "7.0.0-canary.3019",
|
|
46
|
+
"@cedarjs/telemetry": "7.0.0-canary.3019",
|
|
47
|
+
"@cedarjs/utils": "7.0.0-canary.3019",
|
|
48
|
+
"@cedarjs/vite": "7.0.0-canary.3019",
|
|
49
|
+
"@cedarjs/web-server": "7.0.0-canary.3019",
|
|
50
50
|
"@listr2/prompt-adapter-enquirer": "4.3.0",
|
|
51
51
|
"@opentelemetry/api": "1.9.1",
|
|
52
52
|
"@opentelemetry/core": "1.30.1",
|
|
@@ -82,7 +82,6 @@
|
|
|
82
82
|
"prettier": "3.8.4",
|
|
83
83
|
"prisma": "7.8.0",
|
|
84
84
|
"prompts": "2.4.2",
|
|
85
|
-
"semver": "7.8.5",
|
|
86
85
|
"smol-toml": "1.8.0",
|
|
87
86
|
"srvx": "0.12.5",
|
|
88
87
|
"string-env-interpolation": "1.0.1",
|
|
@@ -91,10 +90,11 @@
|
|
|
91
90
|
"title-case": "3.0.3",
|
|
92
91
|
"unionfs": "4.6.0",
|
|
93
92
|
"uuid": "11.1.0",
|
|
93
|
+
"verkit": "0.4.0",
|
|
94
94
|
"yargs": "17.7.3"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@cedarjs/framework-tools": "7.0.0-canary.
|
|
97
|
+
"@cedarjs/framework-tools": "7.0.0-canary.3019",
|
|
98
98
|
"@prisma/dmmf": "7.8.0",
|
|
99
99
|
"@types/archiver": "^7.0.0",
|
|
100
100
|
"memfs": "4.68.1",
|