Skip to content

Commit 07a8521

Browse files
authored
chore: switch to tinyglobby (#705)
https://npmgraph.js.org/?q=fast-glob - 17 dependencies https://npmgraph.js.org/?q=tinyglobby - 2 dependencies
1 parent 2bd6f56 commit 07a8521

File tree

4 files changed

+50
-8
lines changed

4 files changed

+50
-8
lines changed

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 [fast-glob](https://npmjs.com/package/fast-glob), will be lexicographically sorted based on their paths
405+
- file matches, found using [tinyglobby](https://npmjs.com/package/tinyglobby), 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/fast-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/tinyglobby 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,8 +17,8 @@
1717
"dependencies": {
1818
"@rushstack/ts-command-line": "^4.12.2",
1919
"emittery": "^0.13.0",
20-
"fast-glob": "^3.3.2",
2120
"pony-cause": "^2.1.4",
21+
"tinyglobby": "^0.2.13",
2222
"type-fest": "^4.0.0"
2323
},
2424
"devDependencies": {

pnpm-lock.yaml

Lines changed: 45 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/umzug.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import emittery from 'emittery'
2-
import {glob} from 'fast-glob'
2+
import {glob} from 'tinyglobby'
33
import * as fs from 'fs'
44
import * as path from 'path'
55
import * as errorCause from 'pony-cause'
@@ -494,7 +494,7 @@ export class Umzug<Ctx extends object = object> extends emittery<UmzugEvents<Ctx
494494
const resolver: Resolver<Ctx> = inputMigrations.resolve ?? Umzug.defaultResolver
495495

496496
return async context => {
497-
const paths = await glob(globString, {...globOptions, ignore, absolute: true})
497+
const paths = await glob(globString, {...globOptions, ignore, expandDirectories: false, absolute: true})
498498
paths.sort() // glob returns results in reverse alphabetical order these days, but it has never guaranteed not to do that https://github.com/isaacs/node-glob/issues/570
499499
return paths.map(unresolvedPath => {
500500
const filepath = path.resolve(unresolvedPath)

0 commit comments

Comments
 (0)