@sapphire/cli 1.9.3-next.8b05fec.0 → 1.9.3
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
# [1.9.3](https://github.com/sapphiredev/cli/compare/v1.9.3...v1.9.3) - (2024-01-27)
|
|
6
|
+
|
|
7
|
+
## 🐛 Bug Fixes
|
|
8
|
+
|
|
9
|
+
- Fixed generate-loader generating invalid paths ([90c6b2d](https://github.com/sapphiredev/cli/commit/90c6b2d02c642b9d7aa8d3c3ed296f8c65df898e))
|
|
10
|
+
|
|
5
11
|
# [1.9.2](https://github.com/sapphiredev/cli/compare/v1.9.2...v1.9.2) - (2024-01-19)
|
|
6
12
|
|
|
7
13
|
## 🐛 Bug Fixes
|
|
@@ -53,7 +53,7 @@ export async function CreateComponentLoaders(targetDir, config) {
|
|
|
53
53
|
.filter((dir) => Result.from(() => accessSync(injectDirIntoTargetDir(dir, targetDir))).isOk());
|
|
54
54
|
for (const dir of dirs) {
|
|
55
55
|
const dirInjectedTarget = injectDirIntoTargetDir(dir, targetDir);
|
|
56
|
-
const target = join(
|
|
56
|
+
const target = join(dirInjectedTarget, `_load.${config.projectLanguage}`);
|
|
57
57
|
const content = `${templateHeader}\n${await generateVirtualPieceLoader(dir, dirInjectedTarget)}`;
|
|
58
58
|
await writeFileRecursive(target, content);
|
|
59
59
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import findUp from 'find-up';
|
|
2
|
+
import { setTimeout as sleep } from 'node:timers/promises';
|
|
3
|
+
/**
|
|
4
|
+
* Fetches the configuration file asynchronously.
|
|
5
|
+
* It first tries to find the '.sapphirerc.json' file in the current working directory.
|
|
6
|
+
* If not found, it then tries to find the '.sapphirerc.yml' file.
|
|
7
|
+
* Returns a Promise that resolves to the configuration file as JSON if found, otherwise resolves to null.
|
|
8
|
+
* @returns A Promise that resolves to the configuration file as JSON if found, otherwise resolves to null.
|
|
9
|
+
*/
|
|
10
|
+
export async function fetchConfig() {
|
|
11
|
+
const configFileAsJson = await Promise.race([findUp('.sapphirerc.json', { cwd: '.' }), sleep(5000)]);
|
|
12
|
+
if (configFileAsJson) {
|
|
13
|
+
return configFileAsJson;
|
|
14
|
+
}
|
|
15
|
+
return Promise.race([findUp('.sapphirerc.yml', { cwd: '.' }), sleep(5000)]);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=fetchConfig.js.map
|