@cedarjs/cli 1.0.0-canary.13175 → 1.0.0-canary.13177

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.
Files changed (2) hide show
  1. package/dist/index.js +38 -17
  2. package/package.json +12 -11
package/dist/index.js CHANGED
@@ -30,6 +30,7 @@ import * as testCommandEsm from "./commands/testEsm.js";
30
30
  import * as tstojsCommand from "./commands/ts-to-js.js";
31
31
  import * as typeCheckCommand from "./commands/type-check.js";
32
32
  import * as upgradeCommand from "./commands/upgrade/upgrade.js";
33
+ import c from "./lib/colors.js";
33
34
  import { exitWithError } from "./lib/exit.js";
34
35
  import { findUp } from "./lib/index.js";
35
36
  import * as updateCheck from "./lib/updateCheck.js";
@@ -45,25 +46,22 @@ let { cwd, telemetry, help, version } = Parser(hideBin(process.argv), {
45
46
  }
46
47
  });
47
48
  cwd ??= process.env.RWJS_CWD;
48
- try {
49
- if (cwd) {
50
- if (!fs.existsSync(path.join(cwd, "redwood.toml"))) {
51
- throw new Error(`Couldn't find a "redwood.toml" file in ${cwd}`);
52
- }
53
- } else {
54
- const redwoodTOMLPath = findUp("redwood.toml");
55
- if (!redwoodTOMLPath) {
56
- throw new Error(
57
- `Couldn't find up a "redwood.toml" file from ${process.cwd()}`
58
- );
59
- }
60
- cwd = path.dirname(redwoodTOMLPath);
49
+ cwd = getTomlDir(cwd);
50
+ process.env.RWJS_CWD = cwd;
51
+ if (process.argv[1]?.endsWith("redwood.js")) {
52
+ const tomlPath = path.join(cwd, "redwood.toml");
53
+ const toml = fs.readFileSync(tomlPath, "utf8");
54
+ const disableWarning = /^\s*rwBinWarning\s*=\s*false/m.test(toml);
55
+ if (!disableWarning) {
56
+ console.warn();
57
+ console.warn(
58
+ c.warning(
59
+ "'yarn rw' and 'yarn redwood' have been deprecated. Please use 'yarn cedar' instead."
60
+ )
61
+ );
62
+ console.warn();
61
63
  }
62
- } catch (error) {
63
- console.error(error.message);
64
- process.exit(1);
65
64
  }
66
- process.env.RWJS_CWD = cwd;
67
65
  if (process.cwd() !== cwd) {
68
66
  process.chdir(cwd);
69
67
  }
@@ -145,4 +143,27 @@ async function runYargs() {
145
143
  }
146
144
  });
147
145
  }
146
+ function getTomlDir(cwd2) {
147
+ let tomlDir = "";
148
+ try {
149
+ if (cwd2) {
150
+ if (!fs.existsSync(path.join(cwd2, "redwood.toml"))) {
151
+ throw new Error(`Couldn't find a "redwood.toml" file in ${cwd2}`);
152
+ }
153
+ tomlDir = cwd2;
154
+ } else {
155
+ const redwoodTomlPath = findUp("redwood.toml");
156
+ if (!redwoodTomlPath) {
157
+ throw new Error(
158
+ `Couldn't find up a "redwood.toml" file from ${process.cwd()}`
159
+ );
160
+ }
161
+ tomlDir = path.dirname(redwoodTomlPath);
162
+ }
163
+ } catch (error) {
164
+ console.error(error.message);
165
+ process.exit(1);
166
+ }
167
+ return tomlDir;
168
+ }
148
169
  main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedarjs/cli",
3
- "version": "1.0.0-canary.13175+19af035b4",
3
+ "version": "1.0.0-canary.13177+502c9ce29",
4
4
  "description": "The CedarJS Command Line",
5
5
  "repository": {
6
6
  "type": "git",
@@ -10,6 +10,7 @@
10
10
  "license": "MIT",
11
11
  "type": "module",
12
12
  "bin": {
13
+ "cedar": "./dist/index.js",
13
14
  "cedarjs": "./dist/index.js",
14
15
  "cfw": "./dist/cfw.js",
15
16
  "redwood": "./dist/index.js",
@@ -32,15 +33,15 @@
32
33
  "dependencies": {
33
34
  "@babel/preset-typescript": "7.28.5",
34
35
  "@babel/runtime-corejs3": "7.28.4",
35
- "@cedarjs/api-server": "1.0.0-canary.13175",
36
- "@cedarjs/cli-helpers": "1.0.0-canary.13175",
37
- "@cedarjs/fastify-web": "1.0.0-canary.13175",
38
- "@cedarjs/internal": "1.0.0-canary.13175",
39
- "@cedarjs/prerender": "1.0.0-canary.13175",
40
- "@cedarjs/project-config": "1.0.0-canary.13175",
41
- "@cedarjs/structure": "1.0.0-canary.13175",
42
- "@cedarjs/telemetry": "1.0.0-canary.13175",
43
- "@cedarjs/web-server": "1.0.0-canary.13175",
36
+ "@cedarjs/api-server": "1.0.0-canary.13177",
37
+ "@cedarjs/cli-helpers": "1.0.0-canary.13177",
38
+ "@cedarjs/fastify-web": "1.0.0-canary.13177",
39
+ "@cedarjs/internal": "1.0.0-canary.13177",
40
+ "@cedarjs/prerender": "1.0.0-canary.13177",
41
+ "@cedarjs/project-config": "1.0.0-canary.13177",
42
+ "@cedarjs/structure": "1.0.0-canary.13177",
43
+ "@cedarjs/telemetry": "1.0.0-canary.13177",
44
+ "@cedarjs/web-server": "1.0.0-canary.13177",
44
45
  "@listr2/prompt-adapter-enquirer": "2.0.16",
45
46
  "@opentelemetry/api": "1.8.0",
46
47
  "@opentelemetry/core": "1.22.0",
@@ -102,5 +103,5 @@
102
103
  "publishConfig": {
103
104
  "access": "public"
104
105
  },
105
- "gitHead": "19af035b4a9c030d89c52a62be98af73863dbcd9"
106
+ "gitHead": "502c9ce295cdb4ea19da8710ff84ee123efdf725"
106
107
  }