appwrite-utils-cli 0.9.90 → 0.9.91
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 +1 -0
- package/dist/utils/loadConfigs.js +5 -1
- package/package.json +1 -1
- package/src/utils/loadConfigs.ts +5 -2
package/README.md
CHANGED
@@ -125,6 +125,7 @@ This updated CLI ensures that developers have robust tools at their fingertips t
|
|
125
125
|
|
126
126
|
## Changelog
|
127
127
|
|
128
|
+
- 0.9.91: Fixed another webpack error, screw you react (but you're supported now so I guess not-screw-you)
|
128
129
|
- 0.9.90: Fixed Webpack errors (why tf does webpack add an extra `default`...???)
|
129
130
|
- 0.9.80: Fixed collections not being unique between local and remote
|
130
131
|
- 0.9.79: Fixed local collections not being considered for the synchronization unless all de-selected
|
@@ -36,7 +36,11 @@ export const loadConfig = async (configDir) => {
|
|
36
36
|
const configPath = path.join(configDir, "appwriteConfig.ts");
|
37
37
|
console.log(`Loading config from: ${configPath}`);
|
38
38
|
const configUrl = pathToFileURL(configPath).href;
|
39
|
-
const
|
39
|
+
const configModule = (await import(configUrl));
|
40
|
+
const config = configModule.default?.default || configModule.default || configModule;
|
41
|
+
if (!config) {
|
42
|
+
throw new Error("Failed to load config");
|
43
|
+
}
|
40
44
|
const collectionsDir = path.join(configDir, "collections");
|
41
45
|
const collectionFiles = fs.readdirSync(collectionsDir);
|
42
46
|
config.collections = [];
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "appwrite-utils-cli",
|
3
3
|
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
|
4
|
-
"version": "0.9.
|
4
|
+
"version": "0.9.91",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/utils/loadConfigs.ts
CHANGED
@@ -41,8 +41,11 @@ export const loadConfig = async (
|
|
41
41
|
const configPath = path.join(configDir, "appwriteConfig.ts");
|
42
42
|
console.log(`Loading config from: ${configPath}`);
|
43
43
|
const configUrl = pathToFileURL(configPath).href;
|
44
|
-
const
|
45
|
-
|
44
|
+
const configModule = (await import(configUrl));
|
45
|
+
const config: AppwriteConfig | undefined = configModule.default?.default || configModule.default || configModule;
|
46
|
+
if (!config) {
|
47
|
+
throw new Error("Failed to load config");
|
48
|
+
}
|
46
49
|
const collectionsDir = path.join(configDir, "collections");
|
47
50
|
const collectionFiles = fs.readdirSync(collectionsDir);
|
48
51
|
|