Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): migrate globby to tinyglobby #938

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions lib/glob-assets.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { basename, resolve } from "node:path";

import { isPlainObject, castArray, uniqWith, uniq } from "lodash-es";
import dirGlob from "dir-glob";
import { globby } from "globby";
import debugFactory from "debug";
import dirGlob from "dir-glob";
import { isPlainObject, castArray, uniqWith, uniq } from "lodash-es";
import { glob as tg } from "tinyglobby";

const debug = debugFactory("semantic-release:github");

Expand All @@ -27,12 +27,15 @@ export default async function globAssets({ cwd }, assets) {
return [];
}

const globbed = await globby(glob, {
cwd,
expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue doesn't happen with tinyglobby, so we don't need to disable expanding directories.

dot: true,
onlyFiles: false,
});
const globbed = (
await tg(glob, {
cwd,
dot: true,
onlyFiles: false,
})
).map((result) =>
result.endsWith("/") ? result.slice(0, -1) : result,
);

if (isPlainObject(asset)) {
if (globbed.length > 1) {
Expand Down
64 changes: 62 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
"aggregate-error": "^5.0.0",
"debug": "^4.3.4",
"dir-glob": "^3.0.1",
"globby": "^14.0.0",
"http-proxy-agent": "^7.0.0",
"https-proxy-agent": "^7.0.0",
"issue-parser": "^7.0.0",
"lodash-es": "^4.17.21",
"mime": "^4.0.0",
"p-filter": "^4.0.0",
"tinyglobby": "^0.2.9",
"url-join": "^5.0.0"
},
"devDependencies": {
Expand Down