@cedarjs/cli 5.0.0-canary.2439 → 5.0.0-canary.2443

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,6 +1,6 @@
1
1
  import { createHandler, createYargsForComponentDestroy } from "../helpers.js";
2
2
  const description = "Destroy a component";
3
- const { command, builder, tasks } = createYargsForComponentDestroy({
3
+ const { command, builder } = createYargsForComponentDestroy({
4
4
  componentName: "component"
5
5
  });
6
6
  const handler = createHandler("component");
@@ -8,6 +8,5 @@ export {
8
8
  builder,
9
9
  command,
10
10
  description,
11
- handler,
12
- tasks
11
+ handler
13
12
  };
@@ -1,9 +1,7 @@
1
- import { files as directiveFiles } from "../../generate/directive/directiveHandler.js";
2
1
  import { createYargsForComponentDestroy, createHandler } from "../helpers.js";
3
2
  const description = "Destroy a directive";
4
3
  const { command, builder } = createYargsForComponentDestroy({
5
- componentName: "directive",
6
- filesFn: (args) => directiveFiles({ ...args, type: "validator" })
4
+ componentName: "directive"
7
5
  });
8
6
  const handler = createHandler("directive");
9
7
  export {
@@ -1,4 +1,3 @@
1
- import { files as functionFiles } from "../../generate/function/functionHandler.js";
2
1
  import { createYargsForComponentDestroy, createHandler } from "../helpers.js";
3
2
  const description = "Destroy a Function";
4
3
  const builder = (yargs) => {
@@ -8,8 +7,7 @@ const builder = (yargs) => {
8
7
  });
9
8
  };
10
9
  const { command } = createYargsForComponentDestroy({
11
- componentName: "function",
12
- filesFn: functionFiles
10
+ componentName: "function"
13
11
  });
14
12
  const handler = createHandler("function");
15
13
  export {
@@ -1,7 +1,11 @@
1
1
  import { Listr } from "listr2";
2
2
  import { recordTelemetryAttributes } from "@cedarjs/cli-helpers";
3
3
  import { deleteFilesTask } from "../../lib/index.js";
4
- const tasks = ({ componentName, filesFn, name }) => new Listr(
4
+ const tasks = ({
5
+ componentName,
6
+ filesFn,
7
+ name
8
+ }) => new Listr(
5
9
  [
6
10
  {
7
11
  title: `Destroying ${componentName} files...`,
@@ -1,4 +1,6 @@
1
- const createYargsForComponentDestroy = ({ componentName }) => {
1
+ const createYargsForComponentDestroy = ({
2
+ componentName
3
+ }) => {
2
4
  return {
3
5
  command: `${componentName} <name>`,
4
6
  description: `Destroy a ${componentName} component`,
@@ -1,7 +1,6 @@
1
- import { files as layoutFiles } from "../../generate/layout/layoutHandler.js";
2
1
  import { createYargsForComponentDestroy, createHandler } from "../helpers.js";
3
2
  const { command, description, builder } = createYargsForComponentDestroy(
4
- { componentName: "layout", filesFn: layoutFiles }
3
+ { componentName: "layout" }
5
4
  );
6
5
  const handler = createHandler("layout");
7
6
  export {
@@ -5,6 +5,7 @@ import { handler as apiServerHandler } from "@cedarjs/api-server/cjs/apiCliConfi
5
5
  import {
6
6
  getAPIHost,
7
7
  getAPIPort,
8
+ getAPIRootPath,
8
9
  getWebHost,
9
10
  getWebPort
10
11
  } from "@cedarjs/api-server/cjs/cliHelpers";
@@ -27,18 +28,19 @@ const bothServerFileHandler = async (argv) => {
27
28
  argv.apiHost ??= getAPIHost();
28
29
  argv.webPort ??= getWebPort();
29
30
  argv.webHost ??= getWebHost();
31
+ const apiRootPath = argv.apiRootPath ?? getAPIRootPath();
30
32
  const apiProxyTarget = [
31
33
  "http://",
32
34
  argv.apiHost.includes(":") ? `[${argv.apiHost}]` : argv.apiHost,
33
35
  ":",
34
36
  argv.apiPort,
35
- argv.apiRootPath
37
+ apiRootPath
36
38
  ].join("");
37
39
  const { result } = concurrently(
38
40
  [
39
41
  {
40
42
  name: "api",
41
- command: `yarn node ${path.join("dist", "server.js")} --apiPort ${argv.apiPort} --apiHost ${argv.apiHost} --apiRootPath ${argv.apiRootPath}`,
43
+ command: `yarn node ${path.join("dist", "server.js")} --apiPort ${argv.apiPort} --apiHost ${argv.apiHost} --apiRootPath ${apiRootPath}`,
42
44
  cwd: getPaths().api.base,
43
45
  prefixColor: "cyan"
44
46
  },
@@ -71,7 +73,7 @@ const bothServerFileHandler = async (argv) => {
71
73
  };
72
74
  const bothSsrRscServerHandler = async (argv, rscEnabled) => {
73
75
  const apiPromise = apiServerHandler({
74
- apiRootPath: argv.apiRootPath,
76
+ apiRootPath: argv.apiRootPath ?? getAPIRootPath(),
75
77
  host: argv.apiHost,
76
78
  port: argv.apiPort
77
79
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "5.0.0-canary.2439",
3
+ "version": "5.0.0-canary.2443",
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.3",
35
35
  "@babel/preset-typescript": "7.28.5",
36
- "@cedarjs/api-server": "5.0.0-canary.2439",
37
- "@cedarjs/cli-helpers": "5.0.0-canary.2439",
38
- "@cedarjs/fastify-web": "5.0.0-canary.2439",
39
- "@cedarjs/internal": "5.0.0-canary.2439",
40
- "@cedarjs/prerender": "5.0.0-canary.2439",
41
- "@cedarjs/project-config": "5.0.0-canary.2439",
42
- "@cedarjs/structure": "5.0.0-canary.2439",
43
- "@cedarjs/telemetry": "5.0.0-canary.2439",
44
- "@cedarjs/utils": "5.0.0-canary.2439",
45
- "@cedarjs/vite": "5.0.0-canary.2439",
46
- "@cedarjs/web-server": "5.0.0-canary.2439",
36
+ "@cedarjs/api-server": "5.0.0-canary.2443",
37
+ "@cedarjs/cli-helpers": "5.0.0-canary.2443",
38
+ "@cedarjs/fastify-web": "5.0.0-canary.2443",
39
+ "@cedarjs/internal": "5.0.0-canary.2443",
40
+ "@cedarjs/prerender": "5.0.0-canary.2443",
41
+ "@cedarjs/project-config": "5.0.0-canary.2443",
42
+ "@cedarjs/structure": "5.0.0-canary.2443",
43
+ "@cedarjs/telemetry": "5.0.0-canary.2443",
44
+ "@cedarjs/utils": "5.0.0-canary.2443",
45
+ "@cedarjs/vite": "5.0.0-canary.2443",
46
+ "@cedarjs/web-server": "5.0.0-canary.2443",
47
47
  "@listr2/prompt-adapter-enquirer": "4.2.1",
48
48
  "@opentelemetry/api": "1.9.1",
49
49
  "@opentelemetry/core": "1.30.1",