@cedarjs/cli 6.0.0-canary.2677 → 6.0.0-canary.2680

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.
@@ -1,9 +1,11 @@
1
1
  const command = "console";
2
2
  const aliases = ["c"];
3
- const description = "Launch an interactive Redwood shell (experimental)";
3
+ const description = "Launch an interactive Cedar shell";
4
4
  const handler = async () => {
5
- const { handler: handler2 } = await import("./consoleHandler.js");
6
- return handler2();
5
+ console.log(
6
+ "`cedar console` has been removed from the Cedar CLI.\nRun it as a standalone tool instead:\n\n yarn dlx @cedarjs/console\n npx @cedarjs/console\n pnpm dlx @cedarjs/console\n"
7
+ );
8
+ process.exit(1);
7
9
  };
8
10
  export {
9
11
  aliases,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "6.0.0-canary.2677",
3
+ "version": "6.0.0-canary.2680",
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.2677",
37
- "@cedarjs/cli-helpers": "6.0.0-canary.2677",
38
- "@cedarjs/fastify-web": "6.0.0-canary.2677",
39
- "@cedarjs/internal": "6.0.0-canary.2677",
40
- "@cedarjs/prerender": "6.0.0-canary.2677",
41
- "@cedarjs/project-config": "6.0.0-canary.2677",
42
- "@cedarjs/structure": "6.0.0-canary.2677",
43
- "@cedarjs/telemetry": "6.0.0-canary.2677",
44
- "@cedarjs/utils": "6.0.0-canary.2677",
45
- "@cedarjs/vite": "6.0.0-canary.2677",
46
- "@cedarjs/web-server": "6.0.0-canary.2677",
36
+ "@cedarjs/api-server": "6.0.0-canary.2680",
37
+ "@cedarjs/cli-helpers": "6.0.0-canary.2680",
38
+ "@cedarjs/fastify-web": "6.0.0-canary.2680",
39
+ "@cedarjs/internal": "6.0.0-canary.2680",
40
+ "@cedarjs/prerender": "6.0.0-canary.2680",
41
+ "@cedarjs/project-config": "6.0.0-canary.2680",
42
+ "@cedarjs/structure": "6.0.0-canary.2680",
43
+ "@cedarjs/telemetry": "6.0.0-canary.2680",
44
+ "@cedarjs/utils": "6.0.0-canary.2680",
45
+ "@cedarjs/vite": "6.0.0-canary.2680",
46
+ "@cedarjs/web-server": "6.0.0-canary.2680",
47
47
  "@listr2/prompt-adapter-enquirer": "4.2.2",
48
48
  "@opentelemetry/api": "1.9.1",
49
49
  "@opentelemetry/core": "1.30.1",
@@ -1,75 +0,0 @@
1
- import fs from "node:fs";
2
- import { createRequire } from "node:module";
3
- import path from "node:path";
4
- import repl from "node:repl";
5
- import { registerApiSideBabelHook } from "@cedarjs/babel-config";
6
- import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
7
- import { getPaths } from "../lib/index.js";
8
- const paths = getPaths();
9
- function isREPLServerWithHistory(replServer) {
10
- return "history" in replServer && "lines" in replServer;
11
- }
12
- const loadPrismaClient = (replContext) => {
13
- const createdRequire = createRequire(import.meta.url);
14
- const { db } = createdRequire(path.join(paths.api.lib, "db"));
15
- db[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = "PrismaClient";
16
- replContext.db = db;
17
- };
18
- const consoleHistoryFile = path.join(paths.generated.base, "console_history");
19
- const persistConsoleHistory = (r) => {
20
- const lines = isREPLServerWithHistory(r) ? r.lines : [];
21
- fs.appendFileSync(
22
- consoleHistoryFile,
23
- lines.filter((line) => line.trim()).join("\n") + "\n",
24
- "utf8"
25
- );
26
- };
27
- const loadConsoleHistory = async (r) => {
28
- try {
29
- const history = await fs.promises.readFile(consoleHistoryFile, "utf8");
30
- if (isREPLServerWithHistory(r)) {
31
- history.split("\n").reverse().map((line) => r.history.push(line));
32
- }
33
- } catch {
34
- }
35
- };
36
- const handler = (_options) => {
37
- recordTelemetryAttributes({
38
- command: "console"
39
- });
40
- registerApiSideBabelHook({
41
- plugins: [
42
- [
43
- "babel-plugin-module-resolver",
44
- {
45
- alias: {
46
- src: paths.api.src
47
- }
48
- },
49
- "rwjs-console-module-resolver"
50
- ]
51
- ]
52
- });
53
- const r = repl.start();
54
- const defaultEval = r.eval;
55
- const asyncEval = (cmd, context, filename, callback) => {
56
- defaultEval.call(r, cmd, context, filename, async (err, result) => {
57
- if (err) {
58
- callback(err, null);
59
- } else {
60
- try {
61
- callback(null, await Promise.resolve(result));
62
- } catch (err2) {
63
- callback(err2 instanceof Error ? err2 : new Error(String(err2)), null);
64
- }
65
- }
66
- });
67
- };
68
- r.eval = asyncEval;
69
- loadConsoleHistory(r);
70
- r.addListener("close", () => persistConsoleHistory(r));
71
- loadPrismaClient(r.context);
72
- };
73
- export {
74
- handler
75
- };