@cedarjs/cli 3.0.0-canary.13384 → 3.0.0-canary.13386
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.
|
@@ -4,7 +4,7 @@ const description = "Setup RedwoodJS Realtime";
|
|
|
4
4
|
function builder(yargs) {
|
|
5
5
|
yargs.option("includeExamples", {
|
|
6
6
|
alias: ["e", "examples"],
|
|
7
|
-
default:
|
|
7
|
+
default: void 0,
|
|
8
8
|
description: "Include examples of how to implement liveQueries and subscriptions",
|
|
9
9
|
type: "boolean"
|
|
10
10
|
}).option("force", {
|
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import execa from "execa";
|
|
4
4
|
import { Listr } from "listr2";
|
|
5
|
+
import prompts from "prompts";
|
|
5
6
|
import { addApiPackages } from "@cedarjs/cli-helpers";
|
|
6
7
|
import { generate as generateTypes } from "@cedarjs/internal/dist/generate/generate";
|
|
7
8
|
import { projectIsEsm } from "@cedarjs/project-config";
|
|
@@ -17,13 +18,31 @@ const { version } = JSON.parse(
|
|
|
17
18
|
"utf-8"
|
|
18
19
|
)
|
|
19
20
|
);
|
|
20
|
-
async function
|
|
21
|
+
async function handleExamplesPreference(includeExamples) {
|
|
22
|
+
let incl = includeExamples;
|
|
23
|
+
if (typeof includeExamples === "undefined") {
|
|
24
|
+
const response = await prompts({
|
|
25
|
+
type: "toggle",
|
|
26
|
+
name: "includeExamples",
|
|
27
|
+
message: "Do you want to generate examples?",
|
|
28
|
+
initial: true,
|
|
29
|
+
active: "Yes",
|
|
30
|
+
inactive: "No"
|
|
31
|
+
});
|
|
32
|
+
incl = response.includeExamples;
|
|
33
|
+
}
|
|
34
|
+
return incl;
|
|
35
|
+
}
|
|
36
|
+
async function handler(args) {
|
|
21
37
|
const redwoodPaths = getPaths();
|
|
22
38
|
const ts = isTypeScriptProject();
|
|
23
39
|
const realtimeLibFilePath = path.join(
|
|
24
40
|
redwoodPaths.api.lib,
|
|
25
41
|
`realtime.${isTypeScriptProject() ? "ts" : "js"}`
|
|
26
42
|
);
|
|
43
|
+
const force = args.force || false;
|
|
44
|
+
const verbose = args.verbose || false;
|
|
45
|
+
const includeExamples = await handleExamplesPreference(args.includeExamples);
|
|
27
46
|
const tasks = new Listr(
|
|
28
47
|
[
|
|
29
48
|
addApiPackages(["ioredis@^5", `@cedarjs/realtime@${version}`]),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.13386+e6e52784f",
|
|
4
4
|
"description": "The CedarJS Command Line",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@babel/parser": "7.29.0",
|
|
35
35
|
"@babel/preset-typescript": "7.28.5",
|
|
36
36
|
"@babel/runtime-corejs3": "7.29.0",
|
|
37
|
-
"@cedarjs/api-server": "3.0.0-canary.
|
|
38
|
-
"@cedarjs/cli-helpers": "3.0.0-canary.
|
|
39
|
-
"@cedarjs/fastify-web": "3.0.0-canary.
|
|
40
|
-
"@cedarjs/internal": "3.0.0-canary.
|
|
41
|
-
"@cedarjs/prerender": "3.0.0-canary.
|
|
42
|
-
"@cedarjs/project-config": "3.0.0-canary.
|
|
43
|
-
"@cedarjs/structure": "3.0.0-canary.
|
|
44
|
-
"@cedarjs/telemetry": "3.0.0-canary.
|
|
45
|
-
"@cedarjs/web-server": "3.0.0-canary.
|
|
37
|
+
"@cedarjs/api-server": "3.0.0-canary.13386",
|
|
38
|
+
"@cedarjs/cli-helpers": "3.0.0-canary.13386",
|
|
39
|
+
"@cedarjs/fastify-web": "3.0.0-canary.13386",
|
|
40
|
+
"@cedarjs/internal": "3.0.0-canary.13386",
|
|
41
|
+
"@cedarjs/prerender": "3.0.0-canary.13386",
|
|
42
|
+
"@cedarjs/project-config": "3.0.0-canary.13386",
|
|
43
|
+
"@cedarjs/structure": "3.0.0-canary.13386",
|
|
44
|
+
"@cedarjs/telemetry": "3.0.0-canary.13386",
|
|
45
|
+
"@cedarjs/web-server": "3.0.0-canary.13386",
|
|
46
46
|
"@listr2/prompt-adapter-enquirer": "2.0.16",
|
|
47
47
|
"@opentelemetry/api": "1.9.0",
|
|
48
48
|
"@opentelemetry/core": "1.30.1",
|
|
@@ -106,5 +106,5 @@
|
|
|
106
106
|
"publishConfig": {
|
|
107
107
|
"access": "public"
|
|
108
108
|
},
|
|
109
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "e6e52784f17aafffe4a9f394edef6dd3702e84a0"
|
|
110
110
|
}
|