@famgia/omnify-cli 0.0.101 → 0.0.103
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/cli.js +20 -18
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +20 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -18
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/cli.js
CHANGED
|
@@ -1323,24 +1323,26 @@ async function runGenerate(options) {
|
|
|
1323
1323
|
const newLockFile = updateLockFile(existingLock, currentSnapshots, config.database.driver);
|
|
1324
1324
|
await writeLockFile(lockPath, newLockFile);
|
|
1325
1325
|
logger.debug(`Updated: ${config.lockFilePath}`);
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1326
|
+
if (comparison.hasChanges) {
|
|
1327
|
+
logger.step("Saving version history...");
|
|
1328
|
+
const versionStore = createVersionStore({ baseDir: rootDir, maxVersions: 100 });
|
|
1329
|
+
const versionSnapshot = schemasToVersionSnapshot(schemas);
|
|
1330
|
+
const versionChanges = comparison.changes.flatMap(schemaChangeToVersionChange);
|
|
1331
|
+
const migrationFileName = migrationsGenerated > 0 ? `${migrationsGenerated} migration(s)` : void 0;
|
|
1332
|
+
try {
|
|
1333
|
+
const newVersion = await versionStore.createVersion(
|
|
1334
|
+
versionSnapshot,
|
|
1335
|
+
versionChanges,
|
|
1336
|
+
{
|
|
1337
|
+
driver: config.database.driver,
|
|
1338
|
+
...migrationFileName !== void 0 && { migration: migrationFileName },
|
|
1339
|
+
description: `Generated ${comparison.changes.length} change(s)`
|
|
1340
|
+
}
|
|
1341
|
+
);
|
|
1342
|
+
logger.debug(`Created version ${newVersion.version}`);
|
|
1343
|
+
} catch (versionError) {
|
|
1344
|
+
logger.debug(`Could not save version history: ${versionError.message}`);
|
|
1345
|
+
}
|
|
1344
1346
|
}
|
|
1345
1347
|
try {
|
|
1346
1348
|
const guidesWritten = generateAIGuides(rootDir, config.plugins);
|