@cedarjs/cli 2.5.2-next.16 → 2.6.0-rc.28

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/README.md CHANGED
@@ -101,7 +101,7 @@ how to do this you'll know how to modify one too.
101
101
  CedarJS CLI is usually run in a project, this is problematic for contributors,
102
102
  because the transpiled files are not in a project, but in the CedarJS framework
103
103
  repo. Luckily the path can be modified at run-time via an env-var:
104
- `RWJS_CWD=../path/to/project`.
104
+ `CEDAR_CWD=../path/to/project`.
105
105
 
106
106
  We've added a handy yarn alias to test your modified changes to the Cedar CLI
107
107
  against the "example-todo-main" fixture (`__fixtures__/example-todo-main`) you
package/dist/cfw.js CHANGED
@@ -22,7 +22,7 @@ if (!fs.existsSync(CFW_PATH)) {
22
22
  const absCfwPath = path.resolve(process.cwd(), CFW_PATH);
23
23
  config.set("CFW_PATH", absCfwPath);
24
24
  const projectPath = path.dirname(
25
- getConfigPath(process.env.RWJS_CWD ?? process.cwd())
25
+ getConfigPath(process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd())
26
26
  );
27
27
  console.log("Cedar Framework Tools Path:", terminalLink(absCfwPath, absCfwPath));
28
28
  let command = process.argv.slice(2);
@@ -35,7 +35,7 @@ try {
35
35
  stdio: "inherit",
36
36
  cwd: absCfwPath,
37
37
  env: {
38
- RWJS_CWD: projectPath
38
+ CEDAR_CWD: projectPath
39
39
  }
40
40
  });
41
41
  } catch (e) {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { trace, SpanStatusCode } from "@opentelemetry/api";
5
5
  import { hideBin, Parser } from "yargs/helpers";
6
6
  import yargs from "yargs/yargs";
7
7
  import { loadEnvFiles, recordTelemetryAttributes } from "@cedarjs/cli-helpers";
8
- import { projectIsEsm, getConfigPath } from "@cedarjs/project-config";
8
+ import { findUp, projectIsEsm, getConfigPath } from "@cedarjs/project-config";
9
9
  import { telemetryMiddleware } from "@cedarjs/telemetry";
10
10
  import * as buildCommand from "./commands/build.js";
11
11
  import * as checkCommand from "./commands/check.js";
@@ -32,7 +32,6 @@ import * as typeCheckCommand from "./commands/type-check.js";
32
32
  import * as upgradeCommand from "./commands/upgrade/upgrade.js";
33
33
  import c from "./lib/colors.js";
34
34
  import { exitWithError } from "./lib/exit.js";
35
- import { findUp } from "./lib/index.js";
36
35
  import * as updateCheck from "./lib/updateCheck.js";
37
36
  import { loadPlugins } from "./plugin.js";
38
37
  import { startTelemetry, shutdownTelemetry } from "./telemetry/index.js";
@@ -45,8 +44,10 @@ let { cwd, telemetry, help, version } = Parser(hideBin(process.argv), {
45
44
  telemetry: process.env.REDWOOD_DISABLE_TELEMETRY === void 0 || process.env.REDWOOD_DISABLE_TELEMETRY === ""
46
45
  }
47
46
  });
47
+ cwd ??= process.env.CEDAR_CWD;
48
48
  cwd ??= process.env.RWJS_CWD;
49
49
  cwd = getTomlDir(cwd);
50
+ process.env.CEDAR_CWD = cwd;
50
51
  process.env.RWJS_CWD = cwd;
51
52
  if (process.argv[1]?.endsWith("redwood.js")) {
52
53
  const tomlPath = getConfigPath(cwd);
@@ -148,13 +149,13 @@ function getTomlDir(cwd2) {
148
149
  let tomlDir = "";
149
150
  try {
150
151
  if (cwd2) {
151
- const found = configFiles.some((f) => fs.existsSync(path.join(cwd2, f)));
152
+ const absCwd = path.resolve(process.cwd(), cwd2);
153
+ const found = configFiles.some((f) => fs.existsSync(path.join(absCwd, f)));
152
154
  if (!found) {
153
- throw new Error(
154
- `Couldn't find a "cedar.toml" or "redwood.toml" file in ${cwd2}`
155
- );
155
+ const tomls = configFiles.join('" or "');
156
+ throw new Error(`Couldn't find a "${tomls}" file in ${absCwd}`);
156
157
  }
157
- tomlDir = cwd2;
158
+ tomlDir = absCwd;
158
159
  } else {
159
160
  const configTomlPath = findUp("cedar.toml", process.cwd()) || findUp("redwood.toml", process.cwd());
160
161
  if (!configTomlPath) {
@@ -23,8 +23,9 @@ const runTransform = async ({
23
23
  parser = "tsx",
24
24
  options = {}
25
25
  }) => {
26
- if (process.env.NODE_ENV === "test" && process.env.RWJS_CWD) {
27
- process.chdir(process.env.RWJS_CWD);
26
+ const cedarCwd = process.env.CEDAR_CWD || process.env.RWJS_CWD;
27
+ if (process.env.NODE_ENV === "test" && cedarCwd) {
28
+ process.chdir(cedarCwd);
28
29
  }
29
30
  const { output, stdoutWrite } = patchStdoutWrite();
30
31
  const result = await jscodeshift.run(transformPath, targetPaths, {
@@ -20,8 +20,9 @@ const runTransform = async ({
20
20
  options = {}
21
21
  }) => {
22
22
  try {
23
- if (process.env.NODE_ENV === "test" && process.env.RWJS_CWD) {
24
- process.chdir(process.env.RWJS_CWD);
23
+ const cedarCwd = process.env.CEDAR_CWD || process.env.RWJS_CWD;
24
+ if (process.env.NODE_ENV === "test" && cedarCwd) {
25
+ process.chdir(cedarCwd);
25
26
  }
26
27
  await jscodeshift.run(transformPath, targetPaths, {
27
28
  ...defaultJscodeshiftOpts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "2.5.2-next.16+a27a893fb",
3
+ "version": "2.6.0-rc.28",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  "build:pack": "yarn pack -o cedarjs-cli.tgz",
25
25
  "build:types": "tsc --build --verbose ./tsconfig.build.json",
26
26
  "build:watch": "nodemon --watch src --ext \"js,jsx,ts,tsx,template\" --ignore dist --exec \"yarn build && yarn fix:permissions\"",
27
- "dev": "RWJS_CWD=../../__fixtures__/example-todo-main node dist/index.js",
27
+ "dev": "CEDAR_CWD=../../test-project node dist/index.js",
28
28
  "fix:permissions": "chmod +x dist/index.js dist/cfw.js",
29
29
  "prepublishOnly": "yarn build",
30
30
  "test": "vitest run",
@@ -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": "2.5.2-next.16+a27a893fb",
38
- "@cedarjs/cli-helpers": "2.5.2-next.16+a27a893fb",
39
- "@cedarjs/fastify-web": "2.5.2-next.16+a27a893fb",
40
- "@cedarjs/internal": "2.5.2-next.16+a27a893fb",
41
- "@cedarjs/prerender": "2.5.2-next.16+a27a893fb",
42
- "@cedarjs/project-config": "2.5.2-next.16+a27a893fb",
43
- "@cedarjs/structure": "2.5.2-next.16+a27a893fb",
44
- "@cedarjs/telemetry": "2.5.2-next.16+a27a893fb",
45
- "@cedarjs/web-server": "2.5.2-next.16+a27a893fb",
37
+ "@cedarjs/api-server": "2.6.0-rc.28",
38
+ "@cedarjs/cli-helpers": "2.6.0-rc.28",
39
+ "@cedarjs/fastify-web": "2.6.0-rc.28",
40
+ "@cedarjs/internal": "2.6.0-rc.28",
41
+ "@cedarjs/prerender": "2.6.0-rc.28",
42
+ "@cedarjs/project-config": "2.6.0-rc.28",
43
+ "@cedarjs/structure": "2.6.0-rc.28",
44
+ "@cedarjs/telemetry": "2.6.0-rc.28",
45
+ "@cedarjs/web-server": "2.6.0-rc.28",
46
46
  "@listr2/prompt-adapter-enquirer": "2.0.16",
47
47
  "@opentelemetry/api": "1.9.0",
48
48
  "@opentelemetry/core": "1.30.1",
@@ -81,7 +81,7 @@
81
81
  "prompts": "2.4.2",
82
82
  "recast": "0.23.11",
83
83
  "rimraf": "6.1.2",
84
- "semver": "7.7.3",
84
+ "semver": "7.7.4",
85
85
  "smol-toml": "1.6.0",
86
86
  "string-env-interpolation": "1.0.1",
87
87
  "systeminformation": "5.30.7",
@@ -106,5 +106,5 @@
106
106
  "publishConfig": {
107
107
  "access": "public"
108
108
  },
109
- "gitHead": "a27a893fb8f6883f3bf121dad4d3edf7696484fe"
109
+ "gitHead": "fb5acf1b34fc17ac1c8ea326567df5b5c3c2924a"
110
110
  }