appwrite-utils-cli 0.9.60 → 0.9.62
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 +4 -6
- package/package.json +1 -1
- package/src/utils/loadConfigs.ts +4 -6
package/README.md
CHANGED
@@ -124,6 +124,7 @@ This updated CLI ensures that developers have robust tools at their fingertips t
|
|
124
124
|
|
125
125
|
## Changelog
|
126
126
|
|
127
|
+
- 0.9.61: Remove fileURLToPath -- should hopefully fix windows
|
127
128
|
- 0.9.60: Fix init command to repository URL
|
128
129
|
- 0.9.59: Fix to Windows path names for loading config
|
129
130
|
- 0.9.58: The same as before, I just missed it hah
|
@@ -15,12 +15,12 @@ export const findAppwriteConfig = (dir) => {
|
|
15
15
|
const files = fs.readdirSync(dir, { withFileTypes: true });
|
16
16
|
for (const file of files) {
|
17
17
|
if (file.isDirectory() && file.name !== "node_modules") {
|
18
|
-
const result = findAppwriteConfig(path.
|
18
|
+
const result = findAppwriteConfig(path.resolve(dir, file.name));
|
19
19
|
if (result)
|
20
20
|
return result;
|
21
21
|
}
|
22
22
|
else if (file.name === "appwriteConfig.ts") {
|
23
|
-
return path.
|
23
|
+
return path.resolve(dir, file.name);
|
24
24
|
}
|
25
25
|
}
|
26
26
|
return null;
|
@@ -35,15 +35,13 @@ export const loadConfig = async (configDir) => {
|
|
35
35
|
try {
|
36
36
|
const configPath = path.join(configDir, "appwriteConfig.ts");
|
37
37
|
console.log(`Loading config from: ${configPath}`);
|
38
|
-
const
|
39
|
-
const config = (await import(configUrl)).default;
|
38
|
+
const config = (await import(configPath)).default;
|
40
39
|
const collectionsDir = path.join(configDir, "collections");
|
41
40
|
const collectionFiles = fs.readdirSync(collectionsDir);
|
42
41
|
config.collections = [];
|
43
42
|
for (const file of collectionFiles) {
|
44
43
|
const filePath = path.join(collectionsDir, file);
|
45
|
-
const
|
46
|
-
const collectionModule = (await import(fileUrl)).default;
|
44
|
+
const collectionModule = (await import(filePath)).default;
|
47
45
|
config.collections.push(collectionModule);
|
48
46
|
}
|
49
47
|
return config;
|
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.62",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
package/src/utils/loadConfigs.ts
CHANGED
@@ -17,10 +17,10 @@ export const findAppwriteConfig = (dir: string): string | null => {
|
|
17
17
|
|
18
18
|
for (const file of files) {
|
19
19
|
if (file.isDirectory() && file.name !== "node_modules") {
|
20
|
-
const result = findAppwriteConfig(path.
|
20
|
+
const result = findAppwriteConfig(path.resolve(dir, file.name));
|
21
21
|
if (result) return result;
|
22
22
|
} else if (file.name === "appwriteConfig.ts") {
|
23
|
-
return path.
|
23
|
+
return path.resolve(dir, file.name);
|
24
24
|
}
|
25
25
|
}
|
26
26
|
|
@@ -40,8 +40,7 @@ export const loadConfig = async (
|
|
40
40
|
try {
|
41
41
|
const configPath = path.join(configDir, "appwriteConfig.ts");
|
42
42
|
console.log(`Loading config from: ${configPath}`);
|
43
|
-
const
|
44
|
-
const config = (await import(configUrl)).default as AppwriteConfig;
|
43
|
+
const config = (await import(configPath)).default as AppwriteConfig;
|
45
44
|
|
46
45
|
const collectionsDir = path.join(configDir, "collections");
|
47
46
|
const collectionFiles = fs.readdirSync(collectionsDir);
|
@@ -50,8 +49,7 @@ export const loadConfig = async (
|
|
50
49
|
|
51
50
|
for (const file of collectionFiles) {
|
52
51
|
const filePath = path.join(collectionsDir, file);
|
53
|
-
const
|
54
|
-
const collectionModule = (await import(fileUrl)).default as Collection;
|
52
|
+
const collectionModule = (await import(filePath)).default as Collection;
|
55
53
|
config.collections.push(collectionModule);
|
56
54
|
}
|
57
55
|
|