Verified Commit 9e0cd892 authored by Dave Long's avatar Dave Long
Browse files

Issue #3398946 by Spokje: Upgrade glob to latest possible version working with yarn 1.*

(cherry picked from commit 4e0f2a2e)
parent f48bdfcd
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -70,7 +70,7 @@
    "eslint-plugin-jquery": "^1.5.1",
    "eslint-plugin-prettier": "^5.0.1",
    "eslint-plugin-yml": "^1.8.0",
    "glob": "^8.0.3",
    "glob": "10.3.5",
    "jquery": "~3.7.0",
    "jquery-form": "4.3.x",
    "jquery-ui": "1.13.x",
@@ -105,6 +105,7 @@
    "webpack-cli": "^5.1.3"
  },
  "resolutions": {
    "glob/jackspeak": "2.1.1",
    "nightwatch/semver": "~7.5.2"
  },
  "browserslist": [
+6 −9
Original line number Diff line number Diff line
@@ -6,9 +6,9 @@
 * Run build:css with --file to only parse a specific file. Using the --check
 * flag build:css can be run to check if files are compiled correctly.
 * @example <caption>Only process misc/drupal.pcss.css and misc/drupal.init.pcss.css</caption>
 * yarn run build:css -- --file misc/drupal.pcss.css --file misc/drupal.init.pcss.css
 * yarn run build:css --file misc/drupal.pcss.css --file misc/drupal.init.pcss.css
 * @example <caption>Check if all files have been compiled correctly</caption>
 * yarn run build:css -- --check
 * yarn run build:css --check
 *
 * @internal This file is part of the core CSS build process and is only
 * designed to be used in that context.
@@ -16,7 +16,7 @@

'use strict';

const glob = require('glob');
const { globSync } = require('glob');
const argv = require('minimist')(process.argv.slice(2));
const changeOrAdded = require('./changeOrAdded');
const check = require('./check');
@@ -28,10 +28,7 @@ const fileMatch = './**/*.pcss.css';
const globOptions = {
  ignore: './node_modules/**'
};
const processFiles = (error, filePaths) => {
  if (error) {
    process.exitCode = 1;
  }
const processFiles = (filePaths) => {
  // Process all the found files.
  let callback = changeOrAdded;
  if (argv.check) {
@@ -41,9 +38,9 @@ const processFiles = (error, filePaths) => {
};

if (argv.file) {
  processFiles(null, [].concat(argv.file));
  processFiles([].concat(argv.file));
}
else {
  glob(fileMatch, globOptions, processFiles);
  processFiles(globSync(fileMatch, globOptions).sort());
}
process.exitCode = 0;
+3 −3
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
 * @file
 * Callback returning the list of files to copy to the assets/vendor directory.
 */
const glob = require('glob');
const { globSync } = require('glob');
// There are a lot of CKEditor 5 packages, generate the list dynamically.
// Drupal-specific mapping between CKEditor 5 name and Drupal library name.
const ckeditor5PluginMapping = {
@@ -23,11 +23,11 @@ const ckeditor5PluginMapping = {
module.exports = (packageFolder) => {
  const fileList = [];
  // Get all the CKEditor 5 packages.
  const ckeditor5Dirs = glob.sync(`{${packageFolder}/@ckeditor/ckeditor5*,${packageFolder}/ckeditor5}`);
  const ckeditor5Dirs = globSync(`{${packageFolder}/@ckeditor/ckeditor5*,${packageFolder}/ckeditor5}`).sort();
  for (const ckeditor5package of ckeditor5Dirs) {
    // Add all the files in the build/ directory to the process array for
    // copying.
    const buildFiles = glob.sync(`${ckeditor5package}/build/**/*.js`, {
    const buildFiles = globSync(`${ckeditor5package}/build/**/*.js`, {
      nodir: true,
    });
    if (buildFiles.length) {
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

"use strict";

const glob = require("glob");
const { globSync } = require("glob");
const log = require("./log");
const fs = require("fs").promises;
const child_process = require("child_process");
@@ -26,7 +26,7 @@ async function getContents(files) {
}

(async () => {
  const files = glob.sync("./modules/ckeditor5/js/build/*.js");
  const files = globSync("./modules/ckeditor5/js/build/*.js").sort();

  const pluginsBefore = await getContents(files);
  // Execute the plugin build script.
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@

'use strict';

const glob = require('glob');
const { globSync } = require('glob');
const log = require('./log');
const fs = require('fs');

@@ -102,7 +102,7 @@ function processFile(filePath) {
  return false;
}

const definitions = glob.sync('./ckeditor5*/src/**/*.+(js|jsdoc)', globOptions).map(processFile);
const definitions = globSync('./ckeditor5*/src/**/*.+(js|jsdoc)', globOptions).sort().map(processFile);
// Filter definitions that do not match any regex.
const existingDefinitions = definitions.filter((e) => !!e);

Loading