@cedarjs/cli 1.0.0-canary.13029 → 1.0.0-canary.13037
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/upgrade.js +18 -7
- package/dist/lib/exit.js +5 -9
- package/package.json +13 -13
package/dist/commands/upgrade.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path from "path";
|
|
1
|
+
import path from "node:path";
|
|
2
2
|
import { ListrEnquirerPromptAdapter } from "@listr2/prompt-adapter-enquirer";
|
|
3
3
|
import execa from "execa";
|
|
4
4
|
import fs from "fs-extra";
|
|
@@ -83,7 +83,7 @@ const handler = async ({ dryRun, tag, verbose, dedupe, yes }) => {
|
|
|
83
83
|
[
|
|
84
84
|
{
|
|
85
85
|
title: "Confirm upgrade",
|
|
86
|
-
task: async (
|
|
86
|
+
task: async (_ctx, task) => {
|
|
87
87
|
if (yes) {
|
|
88
88
|
task.skip("Skipping confirmation prompt because of --yes flag.");
|
|
89
89
|
return;
|
|
@@ -249,16 +249,19 @@ async function setLatestVersionToContext(ctx, tag) {
|
|
|
249
249
|
throw new Error("Could not find the latest version");
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
|
-
function updatePackageJsonVersion(pkgPath, version, { dryRun, verbose }) {
|
|
252
|
+
function updatePackageJsonVersion(pkgPath, version, task, { dryRun, verbose }) {
|
|
253
253
|
const pkg = JSON.parse(
|
|
254
254
|
fs.readFileSync(path.join(pkgPath, "package.json"), "utf-8")
|
|
255
255
|
);
|
|
256
|
+
const messages = [];
|
|
256
257
|
if (pkg.dependencies) {
|
|
257
258
|
for (const depName of Object.keys(pkg.dependencies).filter(
|
|
258
259
|
(x) => x.startsWith("@cedarjs/") && x !== "@cedarjs/studio"
|
|
259
260
|
)) {
|
|
260
261
|
if (verbose || dryRun) {
|
|
261
|
-
|
|
262
|
+
messages.push(
|
|
263
|
+
` - ${depName}: ${pkg.dependencies[depName]} => ${version}`
|
|
264
|
+
);
|
|
262
265
|
}
|
|
263
266
|
pkg.dependencies[depName] = `${version}`;
|
|
264
267
|
}
|
|
@@ -268,13 +271,16 @@ function updatePackageJsonVersion(pkgPath, version, { dryRun, verbose }) {
|
|
|
268
271
|
(x) => x.startsWith("@cedarjs/") && x !== "@cedarjs/studio"
|
|
269
272
|
)) {
|
|
270
273
|
if (verbose || dryRun) {
|
|
271
|
-
|
|
274
|
+
messages.push(
|
|
272
275
|
` - ${depName}: ${pkg.devDependencies[depName]} => ${version}`
|
|
273
276
|
);
|
|
274
277
|
}
|
|
275
278
|
pkg.devDependencies[depName] = `${version}`;
|
|
276
279
|
}
|
|
277
280
|
}
|
|
281
|
+
if (messages.length > 0) {
|
|
282
|
+
task.title = task.title + "\n" + messages.join("\n");
|
|
283
|
+
}
|
|
278
284
|
if (!dryRun) {
|
|
279
285
|
fs.writeFileSync(
|
|
280
286
|
path.join(pkgPath, "package.json"),
|
|
@@ -296,7 +302,12 @@ function updateCedarJSDepsForAllSides(ctx, options) {
|
|
|
296
302
|
const pkgJsonPath = path.join(basePath, "package.json");
|
|
297
303
|
return {
|
|
298
304
|
title: `Updating ${pkgJsonPath}`,
|
|
299
|
-
task: () => updatePackageJsonVersion(
|
|
305
|
+
task: (_ctx, task) => updatePackageJsonVersion(
|
|
306
|
+
basePath,
|
|
307
|
+
ctx.versionToUpgradeTo,
|
|
308
|
+
task,
|
|
309
|
+
options
|
|
310
|
+
),
|
|
300
311
|
skip: () => !fs.existsSync(pkgJsonPath)
|
|
301
312
|
};
|
|
302
313
|
})
|
|
@@ -433,7 +444,7 @@ async function refreshPrismaClient(task, { verbose }) {
|
|
|
433
444
|
console.log(c.error(e.message));
|
|
434
445
|
}
|
|
435
446
|
}
|
|
436
|
-
const dedupeDeps = async (
|
|
447
|
+
const dedupeDeps = async (_task, { verbose }) => {
|
|
437
448
|
try {
|
|
438
449
|
await execa("yarn dedupe", {
|
|
439
450
|
shell: true,
|
package/dist/lib/exit.js
CHANGED
|
@@ -5,16 +5,12 @@ import {
|
|
|
5
5
|
recordTelemetryAttributes,
|
|
6
6
|
recordTelemetryError
|
|
7
7
|
} from "@cedarjs/cli-helpers";
|
|
8
|
+
const discordLink = terminalLink("Discord", "https://cedarjs.com/discord");
|
|
9
|
+
const githubLink = terminalLink("GitHub", "https://github.com/cedarjs/cedar");
|
|
8
10
|
const DEFAULT_ERROR_EPILOGUE = [
|
|
9
11
|
"Need help?",
|
|
10
|
-
` - Not sure about something or need advice? Reach out on our ${
|
|
11
|
-
|
|
12
|
-
"https://community.redwoodjs.com/"
|
|
13
|
-
)}`,
|
|
14
|
-
` - Think you've found a bug? Open an issue on our ${terminalLink(
|
|
15
|
-
"GitHub",
|
|
16
|
-
"https://github.com/cedarjs/cedar"
|
|
17
|
-
)}`
|
|
12
|
+
` - Not sure about something or need advice? Reach out on our ${discordLink}`,
|
|
13
|
+
` - Think you've found a bug? Open an issue on our ${githubLink}`
|
|
18
14
|
].join("\n");
|
|
19
15
|
function exitWithError(error, { exitCode, message, epilogue, includeEpilogue, includeReferenceCode } = {}) {
|
|
20
16
|
exitCode ??= error?.exitCode ?? 1;
|
|
@@ -23,7 +19,7 @@ function exitWithError(error, { exitCode, message, epilogue, includeEpilogue, in
|
|
|
23
19
|
includeReferenceCode ??= true;
|
|
24
20
|
message ??= error.stack ?? (error.toString() || "Unknown error");
|
|
25
21
|
const errorReferenceCode = uuidv4();
|
|
26
|
-
const line = ansis.red("-".repeat(process.stderr.columns));
|
|
22
|
+
const line = ansis.red("-".repeat(process.stderr.columns - 4));
|
|
27
23
|
const content = !includeEpilogue ? message : [
|
|
28
24
|
"",
|
|
29
25
|
line,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "1.0.0-canary.
|
|
3
|
+
"version": "1.0.0-canary.13037+c8e9cd2b2",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -31,15 +31,15 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@babel/preset-typescript": "7.28.5",
|
|
33
33
|
"@babel/runtime-corejs3": "7.28.4",
|
|
34
|
-
"@cedarjs/api-server": "1.0.0-canary.
|
|
35
|
-
"@cedarjs/cli-helpers": "1.0.0-canary.
|
|
36
|
-
"@cedarjs/fastify-web": "1.0.0-canary.
|
|
37
|
-
"@cedarjs/internal": "1.0.0-canary.
|
|
38
|
-
"@cedarjs/prerender": "1.0.0-canary.
|
|
39
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
40
|
-
"@cedarjs/structure": "1.0.0-canary.
|
|
41
|
-
"@cedarjs/telemetry": "1.0.0-canary.
|
|
42
|
-
"@cedarjs/web-server": "1.0.0-canary.
|
|
34
|
+
"@cedarjs/api-server": "1.0.0-canary.13037",
|
|
35
|
+
"@cedarjs/cli-helpers": "1.0.0-canary.13037",
|
|
36
|
+
"@cedarjs/fastify-web": "1.0.0-canary.13037",
|
|
37
|
+
"@cedarjs/internal": "1.0.0-canary.13037",
|
|
38
|
+
"@cedarjs/prerender": "1.0.0-canary.13037",
|
|
39
|
+
"@cedarjs/project-config": "1.0.0-canary.13037",
|
|
40
|
+
"@cedarjs/structure": "1.0.0-canary.13037",
|
|
41
|
+
"@cedarjs/telemetry": "1.0.0-canary.13037",
|
|
42
|
+
"@cedarjs/web-server": "1.0.0-canary.13037",
|
|
43
43
|
"@listr2/prompt-adapter-enquirer": "2.0.16",
|
|
44
44
|
"@opentelemetry/api": "1.8.0",
|
|
45
45
|
"@opentelemetry/core": "1.22.0",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"prompts": "2.4.2",
|
|
79
79
|
"rimraf": "6.1.2",
|
|
80
80
|
"semver": "7.7.3",
|
|
81
|
-
"smol-toml": "1.
|
|
81
|
+
"smol-toml": "1.6.0",
|
|
82
82
|
"string-env-interpolation": "1.0.1",
|
|
83
|
-
"systeminformation": "5.27.
|
|
83
|
+
"systeminformation": "5.27.17",
|
|
84
84
|
"termi-link": "1.1.0",
|
|
85
85
|
"title-case": "3.0.3",
|
|
86
86
|
"unionfs": "4.6.0",
|
|
@@ -101,5 +101,5 @@
|
|
|
101
101
|
"publishConfig": {
|
|
102
102
|
"access": "public"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "c8e9cd2b280fba5e83e4b666d2c2c8adbe04e2c9"
|
|
105
105
|
}
|