Skip to content

Commit db81c55

Browse files
agoose77fwkoch
authored andcommitted
feat: add warning for unbounded migration
1 parent 5a9fc15 commit db81c55

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/myst-migrate/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export { MIGRATIONS } from './migrations.js';
99
* @param options - to: desired target version, log: Logger
1010
*/
1111
export async function migrate(src: IFile, opts?: Options): Promise<IFile> {
12+
if (opts?.to === undefined) {
13+
opts?.log?.warn(`Calling migrate with no version is deprecated and will be removed in future.`);
14+
}
1215
const to = opts?.to ?? MIGRATIONS.length;
1316
let currentVersion = src.version || 0;
1417

0 commit comments

Comments
 (0)