@cedarjs/cli-helpers 2.5.2-next.16 → 2.5.2-next.25
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/cjs/lib/index.js +1 -1
- package/dist/cjs/lib/project.d.ts +2 -2
- package/dist/cjs/lib/project.d.ts.map +1 -1
- package/dist/cjs/lib/project.js +10 -9
- package/dist/lib/index.js +1 -1
- package/dist/lib/project.d.ts +2 -2
- package/dist/lib/project.d.ts.map +1 -1
- package/dist/lib/project.js +10 -9
- package/dist/src/lib/project.d.ts +2 -2
- package/dist/src/lib/project.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
package/dist/cjs/lib/index.js
CHANGED
|
@@ -77,7 +77,7 @@ const getPrettierOptions = async () => {
|
|
|
77
77
|
const { default: options } = await import(`file://${prettierConfigPath}`);
|
|
78
78
|
if (options.tailwindConfig?.startsWith(".")) {
|
|
79
79
|
options.tailwindConfig = import_path.default.join(
|
|
80
|
-
process.env.RWJS_CWD ?? process.cwd(),
|
|
80
|
+
process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd(),
|
|
81
81
|
options.tailwindConfig
|
|
82
82
|
);
|
|
83
83
|
}
|
|
@@ -24,14 +24,14 @@ export declare const addEnvVarTask: (name: string, value: string, comment: strin
|
|
|
24
24
|
};
|
|
25
25
|
export declare const addEnvVar: (name: string, value: string, comment: string) => string | void;
|
|
26
26
|
/**
|
|
27
|
-
* This sets the `
|
|
27
|
+
* This sets the `CEDAR_CWD` env var to the redwood project directory. This is typically required for internal
|
|
28
28
|
* redwood packages to work correctly. For example, `@cedarjs/project-config` uses this when reading config
|
|
29
29
|
* or paths.
|
|
30
30
|
*
|
|
31
31
|
* @param cwd Explicitly set the redwood cwd. If not set, we'll try to determine it automatically. You likely
|
|
32
32
|
* only want to set this based on some specific input, like a CLI flag.
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare function setRedwoodCWD(cwd?: string): void;
|
|
35
35
|
/**
|
|
36
36
|
* Create or update the given setting, in the given section, with the given value.
|
|
37
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAmDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAmDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,QAoCzC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,QA0HjC"}
|
package/dist/cjs/lib/project.js
CHANGED
|
@@ -153,14 +153,16 @@ const addEnvVar = (name, value, comment) => {
|
|
|
153
153
|
}
|
|
154
154
|
return fs.writeFileSync(envPath, envFile);
|
|
155
155
|
};
|
|
156
|
-
|
|
156
|
+
function setRedwoodCWD(cwd) {
|
|
157
157
|
const configFiles = ["cedar.toml", "redwood.toml"];
|
|
158
|
+
cwd ??= process.env.CEDAR_CWD;
|
|
158
159
|
cwd ??= process.env.RWJS_CWD;
|
|
159
160
|
if (cwd) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
);
|
|
161
|
+
const absCwd = path.resolve(process.cwd(), cwd);
|
|
162
|
+
const found = configFiles.some((f) => fs.existsSync(path.join(absCwd, f)));
|
|
163
|
+
if (!found) {
|
|
164
|
+
const tomls = configFiles.join('" or "');
|
|
165
|
+
throw new Error(`Couldn't find a "${tomls}" file in ${absCwd}`);
|
|
164
166
|
}
|
|
165
167
|
} else {
|
|
166
168
|
const configTomlPath = (0, import_project_config.findUp)("cedar.toml", process.cwd()) || (0, import_project_config.findUp)("redwood.toml", process.cwd());
|
|
@@ -169,12 +171,11 @@ const setRedwoodCWD = (cwd) => {
|
|
|
169
171
|
`Couldn't find up a "cedar.toml" or "redwood.toml" file from ${process.cwd()}`
|
|
170
172
|
);
|
|
171
173
|
}
|
|
172
|
-
|
|
173
|
-
cwd = path.dirname(configTomlPath);
|
|
174
|
-
}
|
|
174
|
+
cwd = path.dirname(configTomlPath);
|
|
175
175
|
}
|
|
176
|
+
process.env.CEDAR_CWD = cwd;
|
|
176
177
|
process.env.RWJS_CWD = cwd;
|
|
177
|
-
}
|
|
178
|
+
}
|
|
178
179
|
function setTomlSetting(section, setting, value) {
|
|
179
180
|
const redwoodTomlPath = (0, import_project_config.getConfigPath)();
|
|
180
181
|
const originalTomlContent = fs.readFileSync(redwoodTomlPath, "utf-8");
|
package/dist/lib/index.js
CHANGED
|
@@ -40,7 +40,7 @@ const getPrettierOptions = async () => {
|
|
|
40
40
|
const { default: options } = await import(`file://${prettierConfigPath}`);
|
|
41
41
|
if (options.tailwindConfig?.startsWith(".")) {
|
|
42
42
|
options.tailwindConfig = path.join(
|
|
43
|
-
process.env.RWJS_CWD ?? process.cwd(),
|
|
43
|
+
process.env.CEDAR_CWD ?? process.env.RWJS_CWD ?? process.cwd(),
|
|
44
44
|
options.tailwindConfig
|
|
45
45
|
);
|
|
46
46
|
}
|
package/dist/lib/project.d.ts
CHANGED
|
@@ -24,14 +24,14 @@ export declare const addEnvVarTask: (name: string, value: string, comment: strin
|
|
|
24
24
|
};
|
|
25
25
|
export declare const addEnvVar: (name: string, value: string, comment: string) => string | void;
|
|
26
26
|
/**
|
|
27
|
-
* This sets the `
|
|
27
|
+
* This sets the `CEDAR_CWD` env var to the redwood project directory. This is typically required for internal
|
|
28
28
|
* redwood packages to work correctly. For example, `@cedarjs/project-config` uses this when reading config
|
|
29
29
|
* or paths.
|
|
30
30
|
*
|
|
31
31
|
* @param cwd Explicitly set the redwood cwd. If not set, we'll try to determine it automatically. You likely
|
|
32
32
|
* only want to set this based on some specific input, like a CLI flag.
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare function setRedwoodCWD(cwd?: string): void;
|
|
35
35
|
/**
|
|
36
36
|
* Create or update the given setting, in the given section, with the given value.
|
|
37
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAmDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAmDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,QAoCzC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,QA0HjC"}
|
package/dist/lib/project.js
CHANGED
|
@@ -116,14 +116,16 @@ const addEnvVar = (name, value, comment) => {
|
|
|
116
116
|
}
|
|
117
117
|
return fs.writeFileSync(envPath, envFile);
|
|
118
118
|
};
|
|
119
|
-
|
|
119
|
+
function setRedwoodCWD(cwd) {
|
|
120
120
|
const configFiles = ["cedar.toml", "redwood.toml"];
|
|
121
|
+
cwd ??= process.env.CEDAR_CWD;
|
|
121
122
|
cwd ??= process.env.RWJS_CWD;
|
|
122
123
|
if (cwd) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
);
|
|
124
|
+
const absCwd = path.resolve(process.cwd(), cwd);
|
|
125
|
+
const found = configFiles.some((f) => fs.existsSync(path.join(absCwd, f)));
|
|
126
|
+
if (!found) {
|
|
127
|
+
const tomls = configFiles.join('" or "');
|
|
128
|
+
throw new Error(`Couldn't find a "${tomls}" file in ${absCwd}`);
|
|
127
129
|
}
|
|
128
130
|
} else {
|
|
129
131
|
const configTomlPath = findUp("cedar.toml", process.cwd()) || findUp("redwood.toml", process.cwd());
|
|
@@ -132,12 +134,11 @@ const setRedwoodCWD = (cwd) => {
|
|
|
132
134
|
`Couldn't find up a "cedar.toml" or "redwood.toml" file from ${process.cwd()}`
|
|
133
135
|
);
|
|
134
136
|
}
|
|
135
|
-
|
|
136
|
-
cwd = path.dirname(configTomlPath);
|
|
137
|
-
}
|
|
137
|
+
cwd = path.dirname(configTomlPath);
|
|
138
138
|
}
|
|
139
|
+
process.env.CEDAR_CWD = cwd;
|
|
139
140
|
process.env.RWJS_CWD = cwd;
|
|
140
|
-
}
|
|
141
|
+
}
|
|
141
142
|
function setTomlSetting(section, setting, value) {
|
|
142
143
|
const redwoodTomlPath = getConfigPath();
|
|
143
144
|
const originalTomlContent = fs.readFileSync(redwoodTomlPath, "utf-8");
|
|
@@ -24,14 +24,14 @@ export declare const addEnvVarTask: (name: string, value: string, comment: strin
|
|
|
24
24
|
};
|
|
25
25
|
export declare const addEnvVar: (name: string, value: string, comment: string) => string | void;
|
|
26
26
|
/**
|
|
27
|
-
* This sets the `
|
|
27
|
+
* This sets the `CEDAR_CWD` env var to the redwood project directory. This is typically required for internal
|
|
28
28
|
* redwood packages to work correctly. For example, `@cedarjs/project-config` uses this when reading config
|
|
29
29
|
* or paths.
|
|
30
30
|
*
|
|
31
31
|
* @param cwd Explicitly set the redwood cwd. If not set, we'll try to determine it automatically. You likely
|
|
32
32
|
* only want to set this based on some specific input, like a CLI flag.
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare function setRedwoodCWD(cwd?: string): void;
|
|
35
35
|
/**
|
|
36
36
|
* Create or update the given setting, in the given section, with the given value.
|
|
37
37
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAmDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/lib/project.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAWrD,eAAO,MAAM,cAAc,qBAE1B,CAAA;AAED,eAAO,MAAM,sBAAsB,2BAGlC,CAAA;AAED,eAAO,MAAM,mBAAmB,eAM/B,CAAA;AAED,eAAO,MAAM,0BAA0B,WAQtC,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SAmDnD,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,aAAa,MAAM;;;CAOvD,CAAA;AAED,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM;;;CAOzE,CAAA;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,EAAE,OAAO,MAAM,EAAE,SAAS,MAAM,kBAqCrE,CAAA;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,QAoCzC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,QA0HjC"}
|