Skip to content

Commit 0781d13

Browse files
committed
Replace tinyglobby with fast-glob
1 parent 85c417c commit 0781d13

13 files changed

+29
-29
lines changed

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const nodePlugin = require('eslint-plugin-n')
1515
const sortDestructureKeysPlugin = require('eslint-plugin-sort-destructure-keys')
1616
const unicornPlugin = require('eslint-plugin-unicorn')
1717
const globals = require('globals')
18-
const { globSync } = require('tinyglobby')
18+
const { globSync } = require('fast-glob')
1919
const tsEslint = require('typescript-eslint')
2020

2121
const constants = require('@socketregistry/scripts/constants')

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
"eslint-plugin-sort-destructure-keys": "2.0.0",
9393
"eslint-plugin-unicorn": "56.0.1",
9494
"eta": "3.5.0",
95+
"fast-glob": "3.3.3",
9596
"fs-extra": "11.3.0",
9697
"globals": "16.3.0",
9798
"husky": "9.1.7",
@@ -105,7 +106,6 @@
105106
"read-yaml-file": "2.1.0",
106107
"semver": "7.7.2",
107108
"ssri": "12.0.0",
108-
"tinyglobby": "0.2.14",
109109
"tsx": "4.20.3",
110110
"typescript": "5.8.3",
111111
"typescript-eslint": "8.38.0",

scripts/lib/templates.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { promises: fs } = require('node:fs')
44
const path = require('node:path')
55

66
const semver = require('semver')
7-
const tinyglobby = require('tinyglobby')
7+
const { glob } = require('fast-glob')
88

99
const { PackageURL } = require('@socketregistry/packageurl-js')
1010
const constants = require('@socketregistry/scripts/constants')
@@ -152,7 +152,7 @@ async function getPackageJsonAction(pkgPath, options) {
152152
async function getTypeScriptActions(pkgPath, options) {
153153
const { references, transform } = { __proto__: null, ...options }
154154
const doTransform = typeof transform === 'function'
155-
const filepaths = await tinyglobby.glob(['**/*.{[cm],}ts'], {
155+
const filepaths = await glob(['**/*.{[cm],}ts'], {
156156
absolute: true,
157157
cwd: pkgPath
158158
})

scripts/make-npm-override.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const util = require('node:util')
77
const { ReturnTypeEnums, default: didYouMean } = require('didyoumean2')
88
const { open } = require('out-url')
99
const semver = require('semver')
10-
const { glob: tinyGlob } = require('tinyglobby')
10+
const { glob } = require('fast-glob')
1111

1212
const constants = require('@socketregistry/scripts/constants')
1313
const {
@@ -181,7 +181,7 @@ void (async () => {
181181
let relJsFilepaths
182182
await extractPackage(origPkgName, async nmPkgPath => {
183183
nmPkgJson = await readPackageJson(nmPkgPath, { normalize: true })
184-
relJsFilepaths = await tinyGlob(['*.js'], {
184+
relJsFilepaths = await glob(['*.js'], {
185185
ignore: ['**/package.json'],
186186
cwd: nmPkgPath
187187
})

scripts/perf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
'use strict'
22

3-
const { glob: tinyGlob } = require('tinyglobby')
3+
const { glob } = require('fast-glob')
44

55
const constants = require('@socketregistry/scripts/constants')
66
const { runBin } = require('@socketsecurity/registry/lib/npm')
77

88
const { perfNpmPath } = constants
99

1010
void (async () => {
11-
for (const perfFile of await tinyGlob([`*.perf.ts`], {
11+
for (const perfFile of await glob([`*.perf.ts`], {
1212
cwd: perfNpmPath
1313
})) {
1414
// eslint-disable-next-line no-await-in-loop

scripts/update-empty-dirs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const { glob: tinyGlob } = require('tinyglobby')
3+
const { glob } = require('fast-glob')
44

55
const {
66
NODE_MODULES_GLOB_RECURSIVE,
@@ -10,7 +10,7 @@ const { isDirEmptySync, remove } = require('@socketsecurity/registry/lib/fs')
1010

1111
void (async () => {
1212
const dirPaths = (
13-
await tinyGlob(['**/'], {
13+
await glob(['**/'], {
1414
ignore: [NODE_MODULES_GLOB_RECURSIVE],
1515
absolute: true,
1616
cwd: rootPath,

scripts/update-empty-files.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require('node:fs/promises')
44
const path = require('node:path')
55
const util = require('node:util')
66

7-
const { glob: tinyGlob } = require('tinyglobby')
7+
const { glob } = require('fast-glob')
88

99
const constants = require('@socketregistry/scripts/constants')
1010
const { getModifiedFiles } = require('@socketregistry/scripts/lib/git')
@@ -23,7 +23,7 @@ void (async () => {
2323
if (!cliArgs.force && !modifiedAutoFile) {
2424
return
2525
}
26-
const autoFiles = await tinyGlob([AUTO_FILE_GLOB_RECURSIVE], {
26+
const autoFiles = await glob([AUTO_FILE_GLOB_RECURSIVE], {
2727
ignore: ignoreGlobs,
2828
absolute: true,
2929
cwd: npmTemplatesPath
@@ -44,7 +44,7 @@ void (async () => {
4444
)
4545
await Promise.all(
4646
(
47-
await tinyGlob(['**/*.{d.ts,js}'], {
47+
await glob(['**/*.{d.ts,js}'], {
4848
ignore: [AUTO_FILE_GLOB_RECURSIVE, ...ignoreGlobs],
4949
absolute: true,
5050
cwd: rootPath

scripts/update-npm-package-json.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const path = require('node:path')
44

5-
const { glob: tinyGlob } = require('tinyglobby')
5+
const { glob } = require('fast-glob')
66

77
const constants = require('@socketregistry/scripts/constants')
88
const { logger } = require('@socketsecurity/registry/lib/logger')
@@ -33,7 +33,7 @@ void (async () => {
3333
)
3434
if (isSubpathExports(entryExports)) {
3535
const fullName = `${SOCKET_REGISTRY_SCOPE}/${sockRegPkgName}`
36-
const availableFiles = await tinyGlob(
36+
const availableFiles = await glob(
3737
['**/*.{[cm],}js', '**/*.d.{[cm],}ts', '**/*.json'],
3838
{
3939
ignore: ['**/overrides/*', '**/shared.{js,d.ts}'],

scripts/update-registry-package-json.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
const path = require('node:path')
44

5-
const { glob: tinyGlob } = require('tinyglobby')
5+
const { glob } = require('fast-glob')
66

77
const builtinNames = require('@socketregistry/packageurl-js/data/npm/builtin-names.json')
88
const constants = require('@socketregistry/scripts/constants')
@@ -25,7 +25,7 @@ void (async () => {
2525
browser[builtinName] = false
2626
}
2727

28-
const registryPkgFiles = await tinyGlob(['**/*.{cjs,js,json,d.ts}'], {
28+
const registryPkgFiles = await glob(['**/*.{cjs,js,json,d.ts}'], {
2929
// Lazily access constants.registryPkgPath.
3030
cwd: constants.registryPkgPath,
3131
ignore: [

0 commit comments

Comments
 (0)