@cedarjs/cli 6.0.0-canary.2818 → 6.0.0-canary.2820
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/serve.js +7 -4
- package/dist/commands/serveBothHandler.js +2 -2
- package/dist/commands/setup/deploy/providers/renderHandler.js +1 -1
- package/dist/commands/setup/deploy/templates/render.js +13 -6
- package/dist/commands/setup/docker/templates/docker-compose.dev.yml +1 -1
- package/package.json +12 -12
package/dist/commands/serve.js
CHANGED
|
@@ -99,8 +99,8 @@ const builder = async (yargs) => {
|
|
|
99
99
|
const { getAPIHost, getAPIPort, getWebHost, getWebPort } = await import("@cedarjs/api-server/cliHelpers");
|
|
100
100
|
const apiPort = argv.apiPort ?? getAPIPort();
|
|
101
101
|
const apiHost = argv.apiHost ?? getAPIHost();
|
|
102
|
-
const webPort = argv.webPort ?? getWebPort();
|
|
103
|
-
const webHost = argv.webHost ?? getWebHost();
|
|
102
|
+
const webPort = argv.webPort ?? getWebPort({ isPublicSide: true });
|
|
103
|
+
const webHost = argv.webHost ?? getWebHost({ isPublicSide: true });
|
|
104
104
|
const apiRootPath = argv.apiRootPath ?? "/";
|
|
105
105
|
const apiTarget = `http://${apiHost.includes(":") ? `[${apiHost}]` : apiHost}:${apiPort}`;
|
|
106
106
|
const { serveStatic } = await import("srvx/static");
|
|
@@ -187,6 +187,11 @@ const builder = async (yargs) => {
|
|
|
187
187
|
socket: argv.socket,
|
|
188
188
|
apiRootPath: argv.apiRootPath
|
|
189
189
|
});
|
|
190
|
+
const { getAPIHost, getAPIPort } = await import("@cedarjs/api-server/cliHelpers");
|
|
191
|
+
const apiPort = argv.port ?? getAPIPort({ isPublicSide: true });
|
|
192
|
+
const apiHost = argv.host ?? getAPIHost({ isPublicSide: true });
|
|
193
|
+
argv.port = apiPort;
|
|
194
|
+
argv.host = apiHost;
|
|
190
195
|
if (argv.ud) {
|
|
191
196
|
const udEntryPath = resolveUDEntryPath();
|
|
192
197
|
if (!udEntryPath) {
|
|
@@ -197,8 +202,6 @@ const builder = async (yargs) => {
|
|
|
197
202
|
);
|
|
198
203
|
process.exit(1);
|
|
199
204
|
}
|
|
200
|
-
const apiPort = argv.port ?? parseInt(process.env.PORT ?? "8911", 10);
|
|
201
|
-
const apiHost = argv.host ?? process.env.HOST ?? "localhost";
|
|
202
205
|
process.stdout.write(
|
|
203
206
|
`API server starting at http://${apiHost}:${apiPort}...`
|
|
204
207
|
);
|
|
@@ -27,8 +27,8 @@ const bothServerFileHandler = async (argv) => {
|
|
|
27
27
|
} else {
|
|
28
28
|
argv.apiPort ??= getAPIPort();
|
|
29
29
|
argv.apiHost ??= getAPIHost();
|
|
30
|
-
argv.webPort ??= getWebPort();
|
|
31
|
-
argv.webHost ??= getWebHost();
|
|
30
|
+
argv.webPort ??= getWebPort({ isPublicSide: true });
|
|
31
|
+
argv.webHost ??= getWebHost({ isPublicSide: true });
|
|
32
32
|
const apiRootPath = argv.apiRootPath ?? getAPIRootPath();
|
|
33
33
|
const apiProxyTarget = [
|
|
34
34
|
"http://",
|
|
@@ -54,7 +54,7 @@ const getRenderYamlContent = async (database) => {
|
|
|
54
54
|
const notes = [
|
|
55
55
|
"You are ready to deploy to Render!\n",
|
|
56
56
|
"Go to https://dashboard.render.com/iacs to create your account and deploy to Render",
|
|
57
|
-
"Check out the deployment docs at https://
|
|
57
|
+
"Check out the deployment docs at https://cedarjs.com/docs/deploy/render for detailed instructions",
|
|
58
58
|
"Note: After first deployment to Render update the rewrite rule destination in `./render.yaml`"
|
|
59
59
|
];
|
|
60
60
|
const additionalFiles = [
|
|
@@ -5,13 +5,15 @@ const PROJECT_NAME = path.basename(getPaths().base);
|
|
|
5
5
|
const RENDER_YAML = (database) => {
|
|
6
6
|
const apiUrl = getUserApiUrl().replace(/\/$/, "");
|
|
7
7
|
return `# Quick links to the docs:
|
|
8
|
-
# -
|
|
9
|
-
# - Render's
|
|
8
|
+
# - Deploying Cedar: https://cedarjs.com/docs/deploy/render
|
|
9
|
+
# - Render's own walkthrough (uses \`yarn rw\`, but just swap in \`yarn cedar\`):
|
|
10
|
+
# https://render.com/docs/deploy-redwood
|
|
11
|
+
# - Render's Blueprint spec: https://render.com/docs/blueprint-spec
|
|
10
12
|
|
|
11
13
|
services:
|
|
12
14
|
- name: ${PROJECT_NAME}-web
|
|
13
15
|
type: web
|
|
14
|
-
|
|
16
|
+
runtime: static
|
|
15
17
|
buildCommand: npm install --global corepack && yarn install && yarn cedar deploy render web
|
|
16
18
|
staticPublishPath: ./web/dist
|
|
17
19
|
|
|
@@ -22,11 +24,16 @@ services:
|
|
|
22
24
|
routes:
|
|
23
25
|
- type: rewrite
|
|
24
26
|
source: ${apiUrl}/*
|
|
25
|
-
# Replace \`destination\`
|
|
27
|
+
# Replace \`destination\` after your first deploy, with the api service's
|
|
28
|
+
# URL from the Render dashboard:
|
|
26
29
|
#
|
|
27
30
|
# \`\`\`
|
|
28
|
-
# destination: https
|
|
31
|
+
# destination: https://${PROJECT_NAME}-api.onrender.com/*
|
|
29
32
|
# \`\`\`
|
|
33
|
+
#
|
|
34
|
+
# This can't be filled in automatically \u2014 Render's \`fromService\` only
|
|
35
|
+
# resolves service hosts into \`envVars\`, not into a static site's route
|
|
36
|
+
# destination.
|
|
30
37
|
destination: replace_with_api_url/*
|
|
31
38
|
- type: rewrite
|
|
32
39
|
source: /*
|
|
@@ -35,7 +42,7 @@ services:
|
|
|
35
42
|
- name: ${PROJECT_NAME}-api
|
|
36
43
|
type: web
|
|
37
44
|
plan: free
|
|
38
|
-
|
|
45
|
+
runtime: node
|
|
39
46
|
region: oregon
|
|
40
47
|
buildCommand: npm install --global corepack && yarn install && yarn cedar build api
|
|
41
48
|
startCommand: yarn cedar deploy render api
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/cli",
|
|
3
|
-
"version": "6.0.0-canary.
|
|
3
|
+
"version": "6.0.0-canary.2820",
|
|
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.
|
|
37
|
-
"@cedarjs/cli-helpers": "6.0.0-canary.
|
|
38
|
-
"@cedarjs/fastify-web": "6.0.0-canary.
|
|
39
|
-
"@cedarjs/internal": "6.0.0-canary.
|
|
40
|
-
"@cedarjs/prerender": "6.0.0-canary.
|
|
41
|
-
"@cedarjs/project-config": "6.0.0-canary.
|
|
42
|
-
"@cedarjs/structure": "6.0.0-canary.
|
|
43
|
-
"@cedarjs/telemetry": "6.0.0-canary.
|
|
44
|
-
"@cedarjs/utils": "6.0.0-canary.
|
|
45
|
-
"@cedarjs/vite": "6.0.0-canary.
|
|
46
|
-
"@cedarjs/web-server": "6.0.0-canary.
|
|
36
|
+
"@cedarjs/api-server": "6.0.0-canary.2820",
|
|
37
|
+
"@cedarjs/cli-helpers": "6.0.0-canary.2820",
|
|
38
|
+
"@cedarjs/fastify-web": "6.0.0-canary.2820",
|
|
39
|
+
"@cedarjs/internal": "6.0.0-canary.2820",
|
|
40
|
+
"@cedarjs/prerender": "6.0.0-canary.2820",
|
|
41
|
+
"@cedarjs/project-config": "6.0.0-canary.2820",
|
|
42
|
+
"@cedarjs/structure": "6.0.0-canary.2820",
|
|
43
|
+
"@cedarjs/telemetry": "6.0.0-canary.2820",
|
|
44
|
+
"@cedarjs/utils": "6.0.0-canary.2820",
|
|
45
|
+
"@cedarjs/vite": "6.0.0-canary.2820",
|
|
46
|
+
"@cedarjs/web-server": "6.0.0-canary.2820",
|
|
47
47
|
"@listr2/prompt-adapter-enquirer": "4.3.0",
|
|
48
48
|
"@opentelemetry/api": "1.9.1",
|
|
49
49
|
"@opentelemetry/core": "1.30.1",
|