Skip to content

Bump glob from v7 to v10 #7112

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

Merged
merged 1 commit into from
Aug 19, 2024
Merged
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
510 changes: 492 additions & 18 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"falafel": "^2.2.5",
"fs-extra": "^10.1.0",
"fuse.js": "^6.6.2",
"glob": "^7.2.0",
"glob": "^10.4.5",
"gzip-size": "^6.0.0",
"ify-loader": "^1.1.0",
"into-stream": "^6.0.0",
Expand Down
13 changes: 5 additions & 8 deletions tasks/find_locale_strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path');
var fs = require('fs');

var falafel = require('falafel');
var glob = require('glob');
var { glob } = require('glob');

var constants = require('./util/constants');
var srcGlob = path.join(constants.pathToSrc, '**/*.js');
Expand All @@ -19,13 +19,7 @@ var noOutput = process.argv.indexOf('--no-output') !== -1;
findLocaleStrings();

function findLocaleStrings() {
glob(srcGlob, function(err, files) {
if(err) {
EXIT_CODE = 1;
console.log(err);
return;
}

glob(srcGlob).then(function(files) {
var dict = {};
var hasTranslation = false;
var maxLen = 0;
Expand Down Expand Up @@ -82,6 +76,9 @@ function findLocaleStrings() {
console.log('ok find_locale_strings - wrote new key file.');
}
}
}).catch(function(err) {
EXIT_CODE = 1;
console.log(err);
});
}

Expand Down
4 changes: 2 additions & 2 deletions tasks/locales.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var path = require('path');
var glob = require('glob');
var { glob } = require('glob');

var constants = require('./util/constants');
var wrapLocale = require('./util/wrap_locale');
Expand All @@ -9,7 +9,7 @@ var pathToDist = constants.pathToDist;

// Bundle the locales
var localeGlob = path.join(pathToLib, 'locales', '*.js');
glob(localeGlob, function(err, files) {
glob(localeGlob).then(function(files) {
files.forEach(function(file) {
var outName = 'plotly-locale-' + path.basename(file);
var outPath = path.join(pathToDist, outName);
Expand Down
8 changes: 4 additions & 4 deletions tasks/shard_jasmine_tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var fs = require('fs');
var path = require('path');

var falafel = require('falafel');
var glob = require('glob');
var { glob } = require('glob');
var minimist = require('minimist');

var pathToJasmineTests = require('./util/constants').pathToJasmineTests;
Expand All @@ -22,9 +22,7 @@ var argv = minimist(process.argv.slice(2), {
var tag = argv.tag;
var limit = argv.limit;

glob(path.join(pathToJasmineTests, '*.js'), function(err, files) {
if(err) throw err;

glob(path.join(pathToJasmineTests, '*.js')).then((files) => {
var file2cnt = {};

files.forEach(function(file) {
Expand Down Expand Up @@ -91,4 +89,6 @@ glob(path.join(pathToJasmineTests, '*.js'), function(err, files) {

// print result to stdout
console.log(runs.join('\n'));
}).catch((err) => {
throw err;
});
7 changes: 4 additions & 3 deletions tasks/sync_packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path');
var fs = require('fs-extra');
var exec = require('child_process').exec;
var runSeries = require('run-series');
var glob = require('glob');
var { glob } = require('glob');

var common = require('./util/common');
var constants = require('./util/constants');
Expand Down Expand Up @@ -172,10 +172,11 @@ function syncLocalesPkg(d) {
var localeFiles;
function listLocalFiles(cb) {
var localeGlob = path.join(constants.pathToLib, 'locales', '*.js');
glob(localeGlob, function(err, _localeFiles) {
if(err) cb(null);
glob(localeGlob).then(function(_localeFiles) {
localeFiles = _localeFiles;
cb();
}).catch(function(err) {
cb(null);
});
}

Expand Down
4 changes: 2 additions & 2 deletions tasks/test_bundle.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var path = require('path');
var exec = require('child_process').exec;
var glob = require('glob');
var { glob } = require('glob');
var runSeries = require('run-series');

var constants = require('./util/constants');
Expand All @@ -13,7 +13,7 @@ var pathToJasmineBundleTests = constants.pathToJasmineBundleTests;
*
* $ npm run test-jasmine -- --bundleTest=<name-of-suite>
*/
glob(pathToJasmineBundleTests + '/*.js', function(err, files) {
glob(pathToJasmineBundleTests + '/*.js').then(function(files) {
var tasks = files.map(function(file) {
return function(cb) {
var cmd = [
Expand Down
10 changes: 5 additions & 5 deletions tasks/test_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var path = require('path');
var fs = require('fs');

var falafel = require('falafel');
var glob = require('glob');
var { glob } = require('glob');
var madge = require('madge');
var readLastLines = require('read-last-lines');
var trueCasePath = require('true-case-path').trueCasePathSync;
Expand Down Expand Up @@ -37,7 +37,7 @@ function assertJasmineSuites() {

var addTagPrefix = function(t) { return '@' + t; };

glob(combineGlobs([testGlob, bundleTestGlob]), function(err, files) {
glob(combineGlobs([testGlob, bundleTestGlob])).then((files) => {
files.forEach(function(file) {
var code = fs.readFileSync(file, 'utf-8');
var bn = path.basename(file);
Expand Down Expand Up @@ -112,7 +112,7 @@ function assertSrcContents() {

var getComputedStyleCnt = 0;

glob(combineGlobs([srcGlob, libGlob]), function(err, files) {
glob(combineGlobs([srcGlob, libGlob])).then((files) => {
files.forEach(function(file) {
var code = fs.readFileSync(file, 'utf-8');

Expand Down Expand Up @@ -218,7 +218,7 @@ function assertFileNames() {

var logs = [];

glob(pattern, function(err, files) {
glob(pattern).then((files) => {
files.forEach(function(file) {
var base = path.basename(file);

Expand Down Expand Up @@ -257,7 +257,7 @@ function assertTrailingNewLine() {
var promises = [];
var logs = [];

glob(pattern, function(err, files) {
glob(pattern).then((files) => {
files.forEach(function(file) {
var promise = readLastLines.read(file, 1);

Expand Down
4 changes: 2 additions & 2 deletions test/image/assets/get_mock_list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var path = require('path');
var glob = require('glob');
var { globSync } = require('glob');

var constants = require('../../../tasks/util/constants');

Expand All @@ -21,7 +21,7 @@ module.exports = function getMocks(pattern) {
if(path.extname(pattern) === '') pattern += '.json';

var patternFull = constants.pathToTestImageMocks + '/' + pattern;
var matches = glob.sync(patternFull);
var matches = globSync(patternFull);

// return only the mock name (not a full path, no ext)
var mockNames = matches.map(function(match) {
Expand Down