@cedarjs/cli 1.0.0-canary.13172 → 1.0.0-canary.13176
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/index.js +38 -17
- 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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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.
|
|
3
|
+
"version": "1.0.0-canary.13176+e74aa064f",
|
|
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.
|
|
36
|
-
"@cedarjs/cli-helpers": "1.0.0-canary.
|
|
37
|
-
"@cedarjs/fastify-web": "1.0.0-canary.
|
|
38
|
-
"@cedarjs/internal": "1.0.0-canary.
|
|
39
|
-
"@cedarjs/prerender": "1.0.0-canary.
|
|
40
|
-
"@cedarjs/project-config": "1.0.0-canary.
|
|
41
|
-
"@cedarjs/structure": "1.0.0-canary.
|
|
42
|
-
"@cedarjs/telemetry": "1.0.0-canary.
|
|
43
|
-
"@cedarjs/web-server": "1.0.0-canary.
|
|
36
|
+
"@cedarjs/api-server": "1.0.0-canary.13176",
|
|
37
|
+
"@cedarjs/cli-helpers": "1.0.0-canary.13176",
|
|
38
|
+
"@cedarjs/fastify-web": "1.0.0-canary.13176",
|
|
39
|
+
"@cedarjs/internal": "1.0.0-canary.13176",
|
|
40
|
+
"@cedarjs/prerender": "1.0.0-canary.13176",
|
|
41
|
+
"@cedarjs/project-config": "1.0.0-canary.13176",
|
|
42
|
+
"@cedarjs/structure": "1.0.0-canary.13176",
|
|
43
|
+
"@cedarjs/telemetry": "1.0.0-canary.13176",
|
|
44
|
+
"@cedarjs/web-server": "1.0.0-canary.13176",
|
|
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": "
|
|
106
|
+
"gitHead": "e74aa064fe7461d3a4c34245fb453fc1c564415a"
|
|
106
107
|
}
|