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): bump glob from 7.2.3 to 10.3.3 #2384

Open
wants to merge 6 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/slimy-snakes-promise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@web/rollup-plugin-copy': patch
'@web/rollup-plugin-html': patch
---

Update `glob` dependency
190 changes: 104 additions & 86 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 packages/rollup-plugin-copy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"copy"
],
"dependencies": {
"glob": "^7.1.6"
"glob": "^10.3.3"
},
"devDependencies": {
"@types/glob": "^7.1.3"
Expand Down
22 changes: 8 additions & 14 deletions packages/rollup-plugin-copy/src/listFiles.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const glob = require('glob');
const { glob } = require('glob');
const fs = require('fs');
const path = require('path');

Expand All @@ -10,20 +10,14 @@ const path = require('path');
* @param {string} fromGlob
* @param {string} rootDir
* @param {string|string[]} [ignore]
*
* @returns Promise<string[]>
*/
function listFiles(fromGlob, rootDir, ignore) {
return new Promise(resolve => {
glob(fromGlob, { cwd: rootDir, dot: true, ignore }, (er, files) => {
// remember, each filepath returned is relative to rootDir
resolve(
files
// fully resolve the filename relative to rootDir
.map(filePath => path.resolve(rootDir, filePath))
// filter out directories
.filter(filePath => !fs.lstatSync(filePath).isDirectory()),
);
});
});
async function listFiles(fromGlob, rootDir, ignore) {
const files = (await glob(fromGlob, { cwd: rootDir, dot: true, ignore })) || [];
return files
.map(filePath => path.resolve(rootDir, filePath))
.filter(filePath => !fs.lstatSync(filePath).isDirectory());
}

module.exports = { listFiles };
2 changes: 1 addition & 1 deletion packages/rollup-plugin-html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
],
"dependencies": {
"@web/parse5-utils": "^2.0.0",
"glob": "^7.1.6",
"glob": "^10.3.3",
"html-minifier-terser": "^7.1.0",
"parse5": "^6.0.1"
},
Expand Down
9 changes: 3 additions & 6 deletions packages/rollup-plugin-html/src/input/getInputData.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'fs';
import path from 'path';
import glob from 'glob';
import type { GlobOptions } from 'glob';

import { createError } from '../utils';
import { RollupPluginHTMLOptions } from '../RollupPluginHTMLOptions';
Expand All @@ -9,13 +10,9 @@ import { normalizeInputOptions } from './normalizeInputOptions';
import { extractModulesAndAssets } from './extract/extractModulesAndAssets';
import { InputOption } from 'rollup';

function resolveGlob(fromGlob: string, opts: glob.IOptions) {
function resolveGlob(fromGlob: string, opts: GlobOptions) {
const files = glob.sync(fromGlob, { ...opts, absolute: true });
return (
files
// filter out directories
.filter(filePath => !fs.lstatSync(filePath).isDirectory())
);
return (files as any[]).filter(filePath => !fs.lstatSync(filePath).isDirectory());
}

function getName(filePath: string, rootDir: string, flattenOutput = true) {
Expand Down