appwrite-utils-cli 0.0.286 → 0.9.0
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 +122 -96
- package/dist/collections/attributes.d.ts +4 -0
- package/dist/collections/attributes.js +224 -0
- package/dist/collections/indexes.d.ts +4 -0
- package/dist/collections/indexes.js +27 -0
- package/dist/collections/methods.d.ts +16 -0
- package/dist/collections/methods.js +216 -0
- package/dist/databases/methods.d.ts +6 -0
- package/dist/databases/methods.js +33 -0
- package/dist/interactiveCLI.d.ts +19 -0
- package/dist/interactiveCLI.js +555 -0
- package/dist/main.js +227 -62
- package/dist/migrations/afterImportActions.js +37 -40
- package/dist/migrations/appwriteToX.d.ts +26 -25
- package/dist/migrations/appwriteToX.js +42 -6
- package/dist/migrations/attributes.js +21 -20
- package/dist/migrations/backup.d.ts +93 -87
- package/dist/migrations/collections.d.ts +6 -0
- package/dist/migrations/collections.js +149 -20
- package/dist/migrations/converters.d.ts +2 -18
- package/dist/migrations/converters.js +13 -2
- package/dist/migrations/dataLoader.d.ts +276 -161
- package/dist/migrations/dataLoader.js +535 -292
- package/dist/migrations/databases.js +8 -2
- package/dist/migrations/helper.d.ts +3 -0
- package/dist/migrations/helper.js +21 -0
- package/dist/migrations/importController.d.ts +5 -2
- package/dist/migrations/importController.js +125 -88
- package/dist/migrations/importDataActions.d.ts +9 -1
- package/dist/migrations/importDataActions.js +15 -3
- package/dist/migrations/indexes.js +3 -2
- package/dist/migrations/logging.js +20 -8
- package/dist/migrations/migrationHelper.d.ts +9 -4
- package/dist/migrations/migrationHelper.js +6 -5
- package/dist/migrations/openapi.d.ts +1 -1
- package/dist/migrations/openapi.js +33 -18
- package/dist/migrations/queue.js +3 -2
- package/dist/migrations/relationships.d.ts +2 -2
- package/dist/migrations/schemaStrings.js +53 -41
- package/dist/migrations/setupDatabase.d.ts +2 -4
- package/dist/migrations/setupDatabase.js +24 -105
- package/dist/migrations/storage.d.ts +3 -1
- package/dist/migrations/storage.js +110 -16
- package/dist/migrations/transfer.d.ts +30 -0
- package/dist/migrations/transfer.js +337 -0
- package/dist/migrations/users.d.ts +2 -1
- package/dist/migrations/users.js +78 -43
- package/dist/schemas/authUser.d.ts +2 -2
- package/dist/storage/methods.d.ts +15 -0
- package/dist/storage/methods.js +207 -0
- package/dist/storage/schemas.d.ts +687 -0
- package/dist/storage/schemas.js +175 -0
- package/dist/utils/getClientFromConfig.d.ts +4 -0
- package/dist/utils/getClientFromConfig.js +16 -0
- package/dist/utils/helperFunctions.d.ts +11 -1
- package/dist/utils/helperFunctions.js +38 -0
- package/dist/utils/retryFailedPromises.d.ts +2 -0
- package/dist/utils/retryFailedPromises.js +21 -0
- package/dist/utils/schemaStrings.d.ts +13 -0
- package/dist/utils/schemaStrings.js +403 -0
- package/dist/utils/setupFiles.js +110 -61
- package/dist/utilsController.d.ts +40 -22
- package/dist/utilsController.js +164 -84
- package/package.json +13 -15
- package/src/collections/attributes.ts +483 -0
- package/src/collections/indexes.ts +53 -0
- package/src/collections/methods.ts +331 -0
- package/src/databases/methods.ts +47 -0
- package/src/init.ts +64 -64
- package/src/interactiveCLI.ts +767 -0
- package/src/main.ts +292 -83
- package/src/migrations/afterImportActions.ts +553 -490
- package/src/migrations/appwriteToX.ts +237 -174
- package/src/migrations/attributes.ts +483 -422
- package/src/migrations/backup.ts +205 -205
- package/src/migrations/collections.ts +545 -300
- package/src/migrations/converters.ts +161 -150
- package/src/migrations/dataLoader.ts +1615 -1304
- package/src/migrations/databases.ts +44 -25
- package/src/migrations/dbHelpers.ts +92 -92
- package/src/migrations/helper.ts +40 -0
- package/src/migrations/importController.ts +448 -384
- package/src/migrations/importDataActions.ts +315 -307
- package/src/migrations/indexes.ts +40 -37
- package/src/migrations/logging.ts +29 -16
- package/src/migrations/migrationHelper.ts +207 -201
- package/src/migrations/openapi.ts +83 -70
- package/src/migrations/queue.ts +118 -119
- package/src/migrations/relationships.ts +324 -324
- package/src/migrations/schemaStrings.ts +472 -460
- package/src/migrations/setupDatabase.ts +118 -219
- package/src/migrations/storage.ts +538 -358
- package/src/migrations/transfer.ts +608 -0
- package/src/migrations/users.ts +362 -285
- package/src/migrations/validationRules.ts +63 -63
- package/src/schemas/authUser.ts +23 -23
- package/src/setup.ts +8 -8
- package/src/storage/methods.ts +371 -0
- package/src/storage/schemas.ts +205 -0
- package/src/types.ts +9 -9
- package/src/utils/getClientFromConfig.ts +17 -0
- package/src/utils/helperFunctions.ts +181 -127
- package/src/utils/index.ts +2 -2
- package/src/utils/loadConfigs.ts +59 -59
- package/src/utils/retryFailedPromises.ts +27 -0
- package/src/utils/schemaStrings.ts +473 -0
- package/src/utils/setupFiles.ts +228 -182
- package/src/utilsController.ts +325 -194
- package/tsconfig.json +37 -37
package/src/utilsController.ts
CHANGED
@@ -1,194 +1,325 @@
|
|
1
|
-
import { Client, Databases, Storage } from "node-appwrite";
|
2
|
-
import {
|
3
|
-
import
|
4
|
-
import
|
5
|
-
import {
|
6
|
-
import {
|
7
|
-
import {
|
8
|
-
import {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
import
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
private
|
58
|
-
private
|
59
|
-
|
60
|
-
public
|
61
|
-
public
|
62
|
-
public
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
await
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
);
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
1
|
+
import { Client, Databases, Query, Storage, type Models } from "node-appwrite";
|
2
|
+
import { type AppwriteConfig } from "appwrite-utils";
|
3
|
+
import { loadConfig, findAppwriteConfig } from "./utils/loadConfigs.js";
|
4
|
+
import { UsersController } from "./migrations/users.js";
|
5
|
+
import { AppwriteToX } from "./migrations/appwriteToX.js";
|
6
|
+
import { ImportController } from "./migrations/importController.js";
|
7
|
+
import { ImportDataActions } from "./migrations/importDataActions.js";
|
8
|
+
import {
|
9
|
+
setupMigrationDatabase,
|
10
|
+
ensureDatabasesExist,
|
11
|
+
wipeOtherDatabases,
|
12
|
+
} from "./migrations/setupDatabase.js";
|
13
|
+
import {
|
14
|
+
createOrUpdateCollections,
|
15
|
+
wipeDatabase,
|
16
|
+
generateSchemas,
|
17
|
+
fetchAllCollections,
|
18
|
+
} from "./collections/methods.js";
|
19
|
+
import {
|
20
|
+
backupDatabase,
|
21
|
+
initOrGetBackupStorage,
|
22
|
+
wipeDocumentStorage,
|
23
|
+
} from "./storage/methods.js";
|
24
|
+
import path from "path";
|
25
|
+
import {
|
26
|
+
type AfterImportActions,
|
27
|
+
type ConverterFunctions,
|
28
|
+
converterFunctions,
|
29
|
+
validationRules,
|
30
|
+
type ValidationRules,
|
31
|
+
} from "appwrite-utils";
|
32
|
+
import { afterImportActions } from "./migrations/afterImportActions.js";
|
33
|
+
import {
|
34
|
+
transferDatabaseLocalToLocal,
|
35
|
+
transferDatabaseLocalToRemote,
|
36
|
+
transferStorageLocalToLocal,
|
37
|
+
transferStorageLocalToRemote,
|
38
|
+
type TransferOptions,
|
39
|
+
} from "./migrations/transfer.js";
|
40
|
+
import { getClient } from "./utils/getClientFromConfig.js";
|
41
|
+
import { fetchAllDatabases } from "./migrations/databases.js";
|
42
|
+
|
43
|
+
export interface SetupOptions {
|
44
|
+
databases?: Models.Database[];
|
45
|
+
collections?: string[];
|
46
|
+
doBackup?: boolean;
|
47
|
+
wipeDatabase?: boolean;
|
48
|
+
wipeDocumentStorage?: boolean;
|
49
|
+
wipeUsers?: boolean;
|
50
|
+
generateSchemas?: boolean;
|
51
|
+
importData?: boolean;
|
52
|
+
checkDuplicates?: boolean;
|
53
|
+
shouldWriteFile?: boolean;
|
54
|
+
}
|
55
|
+
|
56
|
+
export class UtilsController {
|
57
|
+
private appwriteFolderPath: string;
|
58
|
+
private appwriteConfigPath: string;
|
59
|
+
public config?: AppwriteConfig;
|
60
|
+
public appwriteServer?: Client;
|
61
|
+
public database?: Databases;
|
62
|
+
public storage?: Storage;
|
63
|
+
public converterDefinitions: ConverterFunctions = converterFunctions;
|
64
|
+
public validityRuleDefinitions: ValidationRules = validationRules;
|
65
|
+
public afterImportActionsDefinitions: AfterImportActions = afterImportActions;
|
66
|
+
|
67
|
+
constructor(currentUserDir: string) {
|
68
|
+
const basePath = currentUserDir;
|
69
|
+
const appwriteConfigFound = findAppwriteConfig(basePath);
|
70
|
+
if (!appwriteConfigFound) {
|
71
|
+
throw new Error("Failed to find appwriteConfig.ts");
|
72
|
+
}
|
73
|
+
this.appwriteConfigPath = appwriteConfigFound;
|
74
|
+
this.appwriteFolderPath = path.dirname(appwriteConfigFound);
|
75
|
+
if (!this.appwriteFolderPath) {
|
76
|
+
throw new Error("Failed to get appwriteFolderPath");
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
async init() {
|
81
|
+
if (!this.config) {
|
82
|
+
console.log("Initializing appwrite client & loading config...");
|
83
|
+
this.config = await loadConfig(this.appwriteFolderPath);
|
84
|
+
if (!this.config) {
|
85
|
+
throw new Error("Failed to load config");
|
86
|
+
}
|
87
|
+
this.appwriteServer = new Client();
|
88
|
+
this.appwriteServer
|
89
|
+
.setEndpoint(this.config.appwriteEndpoint)
|
90
|
+
.setProject(this.config.appwriteProject)
|
91
|
+
.setKey(this.config.appwriteKey);
|
92
|
+
this.database = new Databases(this.appwriteServer);
|
93
|
+
this.storage = new Storage(this.appwriteServer);
|
94
|
+
this.config.appwriteClient = this.appwriteServer;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
async setupMigrationDatabase() {
|
99
|
+
await this.init();
|
100
|
+
if (!this.config) throw new Error("Config not initialized");
|
101
|
+
await setupMigrationDatabase(this.config);
|
102
|
+
}
|
103
|
+
|
104
|
+
async ensureDatabasesExist(databases?: Models.Database[]) {
|
105
|
+
await this.init();
|
106
|
+
if (!this.config) throw new Error("Config not initialized");
|
107
|
+
await this.setupMigrationDatabase();
|
108
|
+
await ensureDatabasesExist(this.config);
|
109
|
+
}
|
110
|
+
|
111
|
+
async getDatabasesByIds(ids: string[]) {
|
112
|
+
await this.init();
|
113
|
+
if (!this.database) throw new Error("Database not initialized");
|
114
|
+
const dbs = await this.database.list([
|
115
|
+
Query.limit(500),
|
116
|
+
Query.equal("$id", ids),
|
117
|
+
]);
|
118
|
+
return dbs.databases;
|
119
|
+
}
|
120
|
+
|
121
|
+
async wipeOtherDatabases(databasesToKeep: Models.Database[]) {
|
122
|
+
await this.init();
|
123
|
+
if (!this.database) throw new Error("Database not initialized");
|
124
|
+
await wipeOtherDatabases(this.database, databasesToKeep);
|
125
|
+
}
|
126
|
+
|
127
|
+
async wipeUsers() {
|
128
|
+
await this.init();
|
129
|
+
if (!this.config || !this.database)
|
130
|
+
throw new Error("Config or database not initialized");
|
131
|
+
const usersController = new UsersController(this.config, this.database);
|
132
|
+
await usersController.wipeUsers();
|
133
|
+
}
|
134
|
+
|
135
|
+
async backupDatabase(database: Models.Database) {
|
136
|
+
await this.init();
|
137
|
+
if (!this.database || !this.storage || !this.config)
|
138
|
+
throw new Error("Database, storage, or config not initialized");
|
139
|
+
await backupDatabase(
|
140
|
+
this.config,
|
141
|
+
this.database,
|
142
|
+
database.$id,
|
143
|
+
this.storage
|
144
|
+
);
|
145
|
+
}
|
146
|
+
|
147
|
+
async wipeDatabase(database: Models.Database) {
|
148
|
+
await this.init();
|
149
|
+
if (!this.database) throw new Error("Database not initialized");
|
150
|
+
return await wipeDatabase(this.database, database.$id);
|
151
|
+
}
|
152
|
+
|
153
|
+
async wipeDocumentStorage(bucketId: string) {
|
154
|
+
await this.init();
|
155
|
+
if (!this.storage) throw new Error("Storage not initialized");
|
156
|
+
await wipeDocumentStorage(this.storage, bucketId);
|
157
|
+
}
|
158
|
+
|
159
|
+
async createOrUpdateCollectionsForDatabases(databases: Models.Database[]) {
|
160
|
+
await this.init();
|
161
|
+
if (!this.database || !this.config)
|
162
|
+
throw new Error("Database or config not initialized");
|
163
|
+
for (const database of databases) {
|
164
|
+
await this.createOrUpdateCollections(database);
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
async createOrUpdateCollections(
|
169
|
+
database: Models.Database,
|
170
|
+
deletedCollections?: { collectionId: string; collectionName: string }[]
|
171
|
+
) {
|
172
|
+
await this.init();
|
173
|
+
if (!this.database || !this.config)
|
174
|
+
throw new Error("Database or config not initialized");
|
175
|
+
await createOrUpdateCollections(
|
176
|
+
this.database,
|
177
|
+
database.$id,
|
178
|
+
this.config,
|
179
|
+
deletedCollections
|
180
|
+
);
|
181
|
+
}
|
182
|
+
|
183
|
+
async generateSchemas() {
|
184
|
+
await this.init();
|
185
|
+
if (!this.config) throw new Error("Config not initialized");
|
186
|
+
await generateSchemas(this.config, this.appwriteFolderPath);
|
187
|
+
}
|
188
|
+
|
189
|
+
async importData(options: SetupOptions) {
|
190
|
+
await this.init();
|
191
|
+
if (!this.config || !this.database || !this.storage)
|
192
|
+
throw new Error("Config, database, or storage not initialized");
|
193
|
+
const importDataActions = new ImportDataActions(
|
194
|
+
this.database,
|
195
|
+
this.storage,
|
196
|
+
this.config,
|
197
|
+
this.converterDefinitions,
|
198
|
+
this.validityRuleDefinitions,
|
199
|
+
this.afterImportActionsDefinitions
|
200
|
+
);
|
201
|
+
const importController = new ImportController(
|
202
|
+
this.config,
|
203
|
+
this.database,
|
204
|
+
this.storage,
|
205
|
+
this.appwriteFolderPath,
|
206
|
+
importDataActions,
|
207
|
+
options
|
208
|
+
);
|
209
|
+
await importController.run();
|
210
|
+
}
|
211
|
+
|
212
|
+
async synchronizeConfigurations(
|
213
|
+
databases?: Models.Database[],
|
214
|
+
config?: AppwriteConfig
|
215
|
+
) {
|
216
|
+
await this.init();
|
217
|
+
if (!this.storage) throw new Error("Storage not initialized");
|
218
|
+
const configToUse = config || this.config;
|
219
|
+
if (!configToUse) throw new Error("Config not initialized");
|
220
|
+
const appwriteToX = new AppwriteToX(
|
221
|
+
configToUse,
|
222
|
+
this.appwriteFolderPath,
|
223
|
+
this.storage
|
224
|
+
);
|
225
|
+
await appwriteToX.toSchemas(databases);
|
226
|
+
}
|
227
|
+
|
228
|
+
async syncDb() {
|
229
|
+
await this.init();
|
230
|
+
if (!this.database) throw new Error("Database not initialized");
|
231
|
+
const databases = await fetchAllDatabases(this.database);
|
232
|
+
await this.ensureDatabasesExist(databases);
|
233
|
+
await this.createOrUpdateCollectionsForDatabases(databases);
|
234
|
+
}
|
235
|
+
|
236
|
+
getAppwriteFolderPath() {
|
237
|
+
return this.appwriteFolderPath;
|
238
|
+
}
|
239
|
+
|
240
|
+
async transferData(options: TransferOptions): Promise<void> {
|
241
|
+
if (!this.database) {
|
242
|
+
throw new Error(
|
243
|
+
"Database is not initialized, is the config file correct & created?"
|
244
|
+
);
|
245
|
+
}
|
246
|
+
|
247
|
+
let sourceClient = this.database;
|
248
|
+
let targetClient: Databases;
|
249
|
+
let sourceDatabases: Models.Database[];
|
250
|
+
let targetDatabases: Models.Database[];
|
251
|
+
|
252
|
+
if (options.isRemote) {
|
253
|
+
if (
|
254
|
+
!options.transferEndpoint ||
|
255
|
+
!options.transferProject ||
|
256
|
+
!options.transferKey
|
257
|
+
) {
|
258
|
+
throw new Error("Remote transfer options are missing");
|
259
|
+
}
|
260
|
+
|
261
|
+
const remoteClient = getClient(
|
262
|
+
options.transferEndpoint,
|
263
|
+
options.transferProject,
|
264
|
+
options.transferKey
|
265
|
+
);
|
266
|
+
targetClient = new Databases(remoteClient);
|
267
|
+
|
268
|
+
sourceDatabases = await fetchAllDatabases(sourceClient);
|
269
|
+
targetDatabases = await fetchAllDatabases(targetClient);
|
270
|
+
} else {
|
271
|
+
targetClient = sourceClient;
|
272
|
+
sourceDatabases = targetDatabases = await fetchAllDatabases(sourceClient);
|
273
|
+
}
|
274
|
+
|
275
|
+
// Validate that the provided databases exist in the fetched lists
|
276
|
+
const fromDb = sourceDatabases.find((db) => db.$id === options.fromDb.$id);
|
277
|
+
const targetDb = targetDatabases.find(
|
278
|
+
(db) => db.$id === options.targetDb.$id
|
279
|
+
);
|
280
|
+
|
281
|
+
if (!fromDb || !targetDb) {
|
282
|
+
throw new Error("Source or target database not found");
|
283
|
+
}
|
284
|
+
|
285
|
+
if (options.isRemote) {
|
286
|
+
// Remote transfer
|
287
|
+
await transferDatabaseLocalToRemote(
|
288
|
+
sourceClient,
|
289
|
+
options.transferEndpoint!,
|
290
|
+
options.transferProject!,
|
291
|
+
options.transferKey!,
|
292
|
+
fromDb.$id,
|
293
|
+
targetDb.$id
|
294
|
+
);
|
295
|
+
|
296
|
+
if (this.storage && options.sourceBucket && options.targetBucket) {
|
297
|
+
await transferStorageLocalToRemote(
|
298
|
+
this.storage,
|
299
|
+
options.transferEndpoint!,
|
300
|
+
options.transferProject!,
|
301
|
+
options.transferKey!,
|
302
|
+
options.sourceBucket.$id,
|
303
|
+
options.targetBucket.$id
|
304
|
+
);
|
305
|
+
}
|
306
|
+
} else {
|
307
|
+
// Local transfer
|
308
|
+
await transferDatabaseLocalToLocal(
|
309
|
+
sourceClient,
|
310
|
+
fromDb.$id,
|
311
|
+
targetDb.$id
|
312
|
+
);
|
313
|
+
|
314
|
+
if (this.storage && options.sourceBucket && options.targetBucket) {
|
315
|
+
await transferStorageLocalToLocal(
|
316
|
+
this.storage,
|
317
|
+
options.sourceBucket.$id,
|
318
|
+
options.targetBucket.$id
|
319
|
+
);
|
320
|
+
}
|
321
|
+
}
|
322
|
+
|
323
|
+
console.log("Data transfer completed");
|
324
|
+
}
|
325
|
+
}
|
package/tsconfig.json
CHANGED
@@ -1,37 +1,37 @@
|
|
1
|
-
{
|
2
|
-
"compilerOptions": {
|
3
|
-
// Enable latest features
|
4
|
-
"target": "ESNext",
|
5
|
-
"module": "NodeNext",
|
6
|
-
"lib": ["ESNext"],
|
7
|
-
"moduleDetection": "force",
|
8
|
-
"jsx": "react-jsx",
|
9
|
-
"allowJs": true,
|
10
|
-
"allowArbitraryExtensions": true,
|
11
|
-
"allowSyntheticDefaultImports": true,
|
12
|
-
"resolveJsonModule": true,
|
13
|
-
|
14
|
-
// NodeNext mode
|
15
|
-
"moduleResolution": "NodeNext",
|
16
|
-
"verbatimModuleSyntax": true,
|
17
|
-
"noEmit": false,
|
18
|
-
"emitDeclarationOnly": false,
|
19
|
-
|
20
|
-
// Best practices
|
21
|
-
"strict": true,
|
22
|
-
"skipLibCheck": true,
|
23
|
-
"noFallthroughCasesInSwitch": true,
|
24
|
-
|
25
|
-
// Some stricter flags (disabled by default)
|
26
|
-
"noUnusedLocals": false,
|
27
|
-
"noUnusedParameters": false,
|
28
|
-
"noPropertyAccessFromIndexSignature": false,
|
29
|
-
"baseUrl": ".",
|
30
|
-
"esModuleInterop": true,
|
31
|
-
"outDir": "./dist",
|
32
|
-
"rootDir": "./src",
|
33
|
-
"declaration": true
|
34
|
-
},
|
35
|
-
"include": ["src/**/*"],
|
36
|
-
"exclude": ["node_modules", "dist", "src/appwrite", "example/*"]
|
37
|
-
}
|
1
|
+
{
|
2
|
+
"compilerOptions": {
|
3
|
+
// Enable latest features
|
4
|
+
"target": "ESNext",
|
5
|
+
"module": "NodeNext",
|
6
|
+
"lib": ["ESNext"],
|
7
|
+
"moduleDetection": "force",
|
8
|
+
"jsx": "react-jsx",
|
9
|
+
"allowJs": true,
|
10
|
+
"allowArbitraryExtensions": true,
|
11
|
+
"allowSyntheticDefaultImports": true,
|
12
|
+
"resolveJsonModule": true,
|
13
|
+
|
14
|
+
// NodeNext mode
|
15
|
+
"moduleResolution": "NodeNext",
|
16
|
+
"verbatimModuleSyntax": true,
|
17
|
+
"noEmit": false,
|
18
|
+
"emitDeclarationOnly": false,
|
19
|
+
|
20
|
+
// Best practices
|
21
|
+
"strict": true,
|
22
|
+
"skipLibCheck": true,
|
23
|
+
"noFallthroughCasesInSwitch": true,
|
24
|
+
|
25
|
+
// Some stricter flags (disabled by default)
|
26
|
+
"noUnusedLocals": false,
|
27
|
+
"noUnusedParameters": false,
|
28
|
+
"noPropertyAccessFromIndexSignature": false,
|
29
|
+
"baseUrl": ".",
|
30
|
+
"esModuleInterop": true,
|
31
|
+
"outDir": "./dist",
|
32
|
+
"rootDir": "./src",
|
33
|
+
"declaration": true
|
34
|
+
},
|
35
|
+
"include": ["src/**/*"],
|
36
|
+
"exclude": ["node_modules", "dist", "src/appwrite", "example/*"]
|
37
|
+
}
|