@cedarjs/cli 6.0.0-canary.2832 → 6.0.0-canary.2833

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.
@@ -10,6 +10,14 @@ import * as webServerCLIConfig from "@cedarjs/web-server";
10
10
  import { getPaths, getConfig } from "../lib/index.js";
11
11
  import { serverFileExists } from "../lib/project.js";
12
12
  import { webSsrServerHandler } from "./serveWebHandler.js";
13
+ function refuseServerFileUnderUD() {
14
+ console.error(
15
+ c.error(
16
+ "\n api/src/server.ts was detected, but a custom server file is not supported with --ud. It is a Fastify concept \u2014 anything registered there (Realtime, custom plugins, custom middleware) would silently be skipped if serving continued.\n"
17
+ )
18
+ );
19
+ process.exit(1);
20
+ }
13
21
  function resolveUDEntryPath() {
14
22
  const base = path.join(getPaths().api.dist, "ud", "index");
15
23
  for (const ext of [".mjs", ".js"]) {
@@ -90,11 +98,7 @@ const builder = async (yargs) => {
90
98
  process.exit(1);
91
99
  }
92
100
  if (serverFileExists()) {
93
- console.warn(
94
- c.warning(
95
- "\n Note: api/src/server.ts was detected. This file is a Fastify concept and will be ignored when using --ud. You are testing the experimental UD support, so the behavior will not match your production Fastify setup.\n"
96
- )
97
- );
101
+ refuseServerFileUnderUD();
98
102
  }
99
103
  const { getAPIHost, getAPIPort, getWebHost, getWebPort } = await import("@cedarjs/api-server/cliHelpers");
100
104
  const apiPort = argv.apiPort ?? getAPIPort();
@@ -193,6 +197,9 @@ const builder = async (yargs) => {
193
197
  argv.port = apiPort;
194
198
  argv.host = apiHost;
195
199
  if (argv.ud) {
200
+ if (serverFileExists()) {
201
+ refuseServerFileUnderUD();
202
+ }
196
203
  const udEntryPath = resolveUDEntryPath();
197
204
  if (!udEntryPath) {
198
205
  console.error(
@@ -94,11 +94,8 @@ ENV NODE_ENV=production
94
94
 
95
95
  # default api serve command
96
96
  # ---------
97
- # If you are using a custom server file, you must use the following
98
- # command to launch your server instead of the default api-server below.
99
- # This is important if you intend to configure GraphQL to use Realtime.
100
- #
101
- # CMD [ "./api/dist/server.js" ]
97
+ # See https://cedarjs.com/docs/server-file for customizing the api server
98
+ # (Realtime, custom Fastify plugins, etc).
102
99
  CMD ["node_modules/.bin/cedarjs-server", "api"]
103
100
 
104
101
  # web serve
@@ -4,11 +4,8 @@ services:
4
4
  context: .
5
5
  dockerfile: ./Dockerfile
6
6
  target: api_serve
7
- # Without a command specified, the Dockerfile's api_serve CMD will be used.
8
- # If you are using a custom server file, you should either use the following
9
- # command to launch your server or update the Dockerfile to do so.
10
- # This is important if you intend to configure GraphQL to use Realtime.
11
- # command: "./api/dist/server.js"
7
+ # See https://cedarjs.com/docs/server-file for customizing the api
8
+ # server (Realtime, custom Fastify plugins, etc).
12
9
  ports:
13
10
  - '8911:8911'
14
11
  depends_on:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "6.0.0-canary.2832",
3
+ "version": "6.0.0-canary.2833",
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.2832",
37
- "@cedarjs/cli-helpers": "6.0.0-canary.2832",
38
- "@cedarjs/fastify-web": "6.0.0-canary.2832",
39
- "@cedarjs/internal": "6.0.0-canary.2832",
40
- "@cedarjs/prerender": "6.0.0-canary.2832",
41
- "@cedarjs/project-config": "6.0.0-canary.2832",
42
- "@cedarjs/structure": "6.0.0-canary.2832",
43
- "@cedarjs/telemetry": "6.0.0-canary.2832",
44
- "@cedarjs/utils": "6.0.0-canary.2832",
45
- "@cedarjs/vite": "6.0.0-canary.2832",
46
- "@cedarjs/web-server": "6.0.0-canary.2832",
36
+ "@cedarjs/api-server": "6.0.0-canary.2833",
37
+ "@cedarjs/cli-helpers": "6.0.0-canary.2833",
38
+ "@cedarjs/fastify-web": "6.0.0-canary.2833",
39
+ "@cedarjs/internal": "6.0.0-canary.2833",
40
+ "@cedarjs/prerender": "6.0.0-canary.2833",
41
+ "@cedarjs/project-config": "6.0.0-canary.2833",
42
+ "@cedarjs/structure": "6.0.0-canary.2833",
43
+ "@cedarjs/telemetry": "6.0.0-canary.2833",
44
+ "@cedarjs/utils": "6.0.0-canary.2833",
45
+ "@cedarjs/vite": "6.0.0-canary.2833",
46
+ "@cedarjs/web-server": "6.0.0-canary.2833",
47
47
  "@listr2/prompt-adapter-enquirer": "4.3.0",
48
48
  "@opentelemetry/api": "1.9.1",
49
49
  "@opentelemetry/core": "1.30.1",