Skip to content

Commit f4142e6

Browse files
committed
chore(deps): switch to tinyglobby
1 parent aae83c0 commit f4142e6

File tree

5 files changed

+64
-10
lines changed

5 files changed

+64
-10
lines changed

lib/glob-assets.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { basename, resolve } from "node:path";
22

33
import { isPlainObject, castArray, uniqWith, uniq } from "lodash-es";
44
import dirGlob from "dir-glob";
5-
import { globby } from "globby";
5+
import { glob as tinyglobby } from "tinyglobby";
66
import debugFactory from "debug";
77

88
const debug = debugFactory("semantic-release:github");
@@ -27,7 +27,7 @@ export default async function globAssets({ cwd }, assets) {
2727
return [];
2828
}
2929

30-
const globbed = await globby(glob, {
30+
const globbed = await tinyglobby(glob, {
3131
cwd,
3232
expandDirectories: false, // TODO Temporary workaround for https://github.com/mrmlnc/fast-glob/issues/47
3333
dot: true,

lib/publish.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,11 @@ export default async function publish(pluginConfig, context, { Octokit }) {
107107
await Promise.all(
108108
globbedAssets.map(async (asset) => {
109109
const filePath = isPlainObject(asset) ? asset.path : asset;
110+
const resolved = resolve(cwd, filePath);
110111
let file;
111112

112113
try {
113-
file = await stat(resolve(cwd, filePath));
114+
file = await stat(resolved);
114115
} catch {
115116
logger.error(
116117
"The asset %s cannot be read, and will be ignored.",
@@ -122,7 +123,7 @@ export default async function publish(pluginConfig, context, { Octokit }) {
122123
if (!file || !file.isFile()) {
123124
logger.error(
124125
"The asset %s is not a file, and will be ignored.",
125-
filePath,
126+
resolved,
126127
);
127128
return;
128129
}
@@ -131,7 +132,7 @@ export default async function publish(pluginConfig, context, { Octokit }) {
131132
const upload = {
132133
method: "POST",
133134
url: uploadUrl,
134-
data: await readFile(resolve(cwd, filePath)),
135+
data: await readFile(resolved),
135136
name: fileName,
136137
headers: {
137138
"content-type": mime.getType(extname(fileName)) || "text/plain",

package-lock.json

Lines changed: 55 additions & 2 deletions
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
@@ -30,13 +30,13 @@
3030
"aggregate-error": "^5.0.0",
3131
"debug": "^4.3.4",
3232
"dir-glob": "^3.0.1",
33-
"globby": "^14.0.0",
3433
"http-proxy-agent": "^7.0.0",
3534
"https-proxy-agent": "^7.0.0",
3635
"issue-parser": "^7.0.0",
3736
"lodash-es": "^4.17.21",
3837
"mime": "^4.0.0",
3938
"p-filter": "^4.0.0",
39+
"tinyglobby": "^0.2.14",
4040
"url-join": "^5.0.0"
4141
},
4242
"devDependencies": {

test/glob-assets.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ test("Expand directories", async (t) => {
228228
t.deepEqual(
229229
sortAssets(globbedAssets),
230230
sortAssets([
231-
"dir",
231+
"dir/",
232232
"dir/upload_other.txt",
233233
"dir/upload.txt",
234234
"dir/.dotfile",
@@ -242,7 +242,7 @@ test("Include empty temporaryDirectory as defined", async (t) => {
242242
await mkdir(resolve(cwd, "empty"), { recursive: true });
243243
const globbedAssets = await globAssets({ cwd }, [["empty"]]);
244244

245-
t.deepEqual(globbedAssets, ["empty"]);
245+
t.deepEqual(globbedAssets, ["empty/"]);
246246
});
247247

248248
test("Deduplicate resulting files path", async (t) => {

0 commit comments

Comments
 (0)