Skip to content

Commit b2a747c

Browse files
authored
fix: restore node12 support (glob -> fast-glob) (#660)
fixes #659 Note that there are some edge-case differences between glob and fast-glob, but it's very unlikely that users of umzug will hit them. See glob docs for an in-depth comparison: https://github.com/isaacs/node-glob?tab=readme-ov-file#comparison-to-other-javascript-glob-implementations If there's anyone that needs the old `glob` behaviour, they can use glob themselves and pass an array of migrations to umzug. (see https://github.com/sequelize/umzug#direct-migrations-list)
1 parent e4f7865 commit b2a747c

File tree

5 files changed

+44
-26
lines changed

5 files changed

+44
-26
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
node migrate create --name new-migration.js
5454
node migrate up
5555
- name: run vanilla esm example
56+
if: matrix.node != 12
5657
working-directory: examples/0.5-vanilla-esm
5758
run: |
5859
npm init -y

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ const umzug = new Umzug({
402402

403403
Note on migration file sorting:
404404

405-
- file matches, found using [glob](https://npmjs.com/package/glob), will be lexicographically sorted based on their paths
405+
- file matches, found using [fast-glob](https://npmjs.com/package/fast-glob), will be lexicographically sorted based on their paths
406406
- so if your migrations are `one/m1.js`, `two/m2.js`, `three/m3.js`, the resultant order will be `one/m1.js`, `three/m3.js`, `two/m2.js`
407407
- similarly, if your migrations are called `m1.js`, `m2.js`, ... `m10.js`, `m11.js`, the resultant ordering will be `m1.js`, `m10.js`, `m11.js`, ... `m2.js`
408408
- The easiest way to deal with this is to ensure your migrations appear in a single folder, and their paths match lexicographically with the order they should run in
@@ -414,7 +414,7 @@ The Umzug class should be imported as a named import, i.e. `import { Umzug } fro
414414

415415
The `MigrationMeta` type, which is returned by `umzug.executed()` and `umzug.pending()`, no longer has a `file` property - it has a `name` and *optional* `path` - since migrations are not necessarily bound to files on the file system.
416416

417-
The `migrations.glob` parameter replaces `path`, `pattern` and `traverseDirectories`. It can be used, in combination with `cwd` and `ignore` to do much more flexible file lookups. See https://npmjs.com/package/glob for more information on the syntax.
417+
The `migrations.glob` parameter replaces `path`, `pattern` and `traverseDirectories`. It can be used, in combination with `cwd` and `ignore` to do much more flexible file lookups. See https://npmjs.com/package/fast-glob for more information on the syntax.
418418

419419
The `migrations.resolve` parameter replaces `customResolver`. Explicit support for `wrap` and `nameFormatter` has been removed - these can be easily implemented in a `resolve` function.
420420

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"dependencies": {
1818
"@rushstack/ts-command-line": "^4.12.2",
1919
"emittery": "^0.13.0",
20-
"glob": "^10.3.10",
20+
"fast-glob": "^3.3.2",
2121
"pony-cause": "^2.1.4",
2222
"type-fest": "^4.0.0"
2323
},

0 commit comments

Comments
 (0)