build: update npm install command to use --legacy-peer-deps

This change modifies the build scripts to use --legacy-peer-deps flag when installing npm dependencies to resolve potential peer dependency conflicts during the build process. The change is applied to both bash (build.sh) and batch (build.bat) build scripts.
This commit is contained in:
Luiz Costa
2025-11-18 10:23:55 -03:00
parent 20129a1ac7
commit ac4f232e5e
787 changed files with 82341 additions and 121690 deletions
+16 -5
View File
@@ -178,7 +178,6 @@ class PluginConflictError extends Error {
* @param {Record<string, DependentPlugin>} target The destination to merge
* @param {Record<string, DependentPlugin>|undefined} source The source to merge.
* @returns {void}
* @throws {PluginConflictError} When a plugin was conflicted.
*/
function mergePlugins(target, source) {
if (!isNonNullObject(source)) {
@@ -259,7 +258,6 @@ function mergeRuleConfigs(target, source) {
* @param {ConfigArray} instance The config elements.
* @param {number[]} indices The indices to use.
* @returns {ExtractedConfig} The extracted config.
* @throws {Error} When a plugin is conflicted.
*/
function createConfig(instance, indices) {
const config = new ExtractedConfig();
@@ -321,18 +319,31 @@ function createConfig(instance, indices) {
* @param {string} pluginId The plugin ID for prefix.
* @param {Record<string,T>} defs The definitions to collect.
* @param {Map<string, U>} map The map to output.
* @param {function(T): U} [normalize] The normalize function for each value.
* @returns {void}
*/
function collect(pluginId, defs, map) {
function collect(pluginId, defs, map, normalize) {
if (defs) {
const prefix = pluginId && `${pluginId}/`;
for (const [key, value] of Object.entries(defs)) {
map.set(`${prefix}${key}`, value);
map.set(
`${prefix}${key}`,
normalize ? normalize(value) : value
);
}
}
}
/**
* Normalize a rule definition.
* @param {Function|Rule} rule The rule definition to normalize.
* @returns {Rule} The normalized rule definition.
*/
function normalizePluginRule(rule) {
return typeof rule === "function" ? { create: rule } : rule;
}
/**
* Delete the mutation methods from a given map.
* @param {Map<any, any>} map The map object to delete.
@@ -374,7 +385,7 @@ function initPluginMemberMaps(elements, slots) {
collect(pluginId, plugin.environments, slots.envMap);
collect(pluginId, plugin.processors, slots.processorMap);
collect(pluginId, plugin.rules, slots.ruleMap);
collect(pluginId, plugin.rules, slots.ruleMap, normalizePluginRule);
}
}
@@ -15,7 +15,7 @@
* @author Toru Nagashima <https://github.com/mysticatea>
*/
import util from "node:util";
import util from "util";
/**
* The class is to store parsers or plugins.
@@ -88,8 +88,8 @@ class ConfigDependency {
this.importerPath = importerPath;
}
// eslint-disable-next-line jsdoc/require-description
/**
* Converts this instance to a JSON compatible object.
* @returns {Object} a JSON compatible object.
*/
toJSON() {
@@ -103,14 +103,14 @@ class ConfigDependency {
return obj;
}
// eslint-disable-next-line jsdoc/require-description
/**
* Custom inspect method for Node.js `console.log()`.
* @returns {Object} an object to display by `console.log()`.
*/
[util.inspect.custom]() {
const {
definition: _ignore1, // eslint-disable-line no-unused-vars -- needed to make `obj` correct
original: _ignore2, // eslint-disable-line no-unused-vars -- needed to make `obj` correct
definition: _ignore1, // eslint-disable-line no-unused-vars
original: _ignore2, // eslint-disable-line no-unused-vars
...obj
} = this;
@@ -120,10 +120,10 @@ class ExtractedConfig {
*/
toCompatibleObjectAsConfigFileContent() {
const {
/* eslint-disable no-unused-vars -- needed to make `config` correct */
/* eslint-disable no-unused-vars */
configNameOfNoInlineConfig: _ignore1,
processor: _ignore2,
/* eslint-enable no-unused-vars -- needed to make `config` correct */
/* eslint-enable no-unused-vars */
ignores,
...config
} = this;
+5 -6
View File
@@ -32,8 +32,8 @@
// Requirements
//------------------------------------------------------------------------------
import assert from "node:assert";
import path from "node:path";
import assert from "assert";
import path from "path";
import ignore from "ignore";
import debugOrig from "debug";
@@ -117,9 +117,6 @@ const DotPatterns = Object.freeze([".*", "!.eslintrc.*", "!../"]);
// Public
//------------------------------------------------------------------------------
/**
* Represents a set of glob patterns to ignore against a base path.
*/
class IgnorePattern {
/**
@@ -156,7 +153,9 @@ class IgnorePattern {
debug("Create with: %o", ignorePatterns);
const basePath = getCommonAncestorPath(ignorePatterns.map(p => p.basePath));
const patterns = ignorePatterns.flatMap(p => p.getPatternsRelativeTo(basePath));
const patterns = [].concat(
...ignorePatterns.map(p => p.getPatternsRelativeTo(basePath))
);
const ig = ignore({ allowRelativePaths: true }).add([...DotPatterns, ...patterns]);
const dotIg = ignore({ allowRelativePaths: true }).add(patterns);
@@ -17,9 +17,9 @@
* @author Toru Nagashima <https://github.com/mysticatea>
*/
import assert from "node:assert";
import path from "node:path";
import util from "node:util";
import assert from "assert";
import path from "path";
import util from "util";
import minimatch from "minimatch";
const { Minimatch } = minimatch;
@@ -94,7 +94,6 @@ class OverrideTester {
* @param {string|string[]} excludedFiles The glob patterns for excluded files.
* @param {string} basePath The path to the base directory to test paths.
* @returns {OverrideTester|null} The created instance or `null`.
* @throws {Error} When invalid patterns are given.
*/
static create(files, excludedFiles, basePath) {
const includePatterns = normalizePatterns(files);
@@ -184,7 +183,6 @@ class OverrideTester {
* Test if a given path is matched or not.
* @param {string} filePath The absolute path to the target file.
* @returns {boolean} `true` if the path was matched.
* @throws {Error} When invalid `filePath` is given.
*/
test(filePath) {
if (typeof filePath !== "string" || !path.isAbsolute(filePath)) {
@@ -198,8 +196,8 @@ class OverrideTester {
));
}
// eslint-disable-next-line jsdoc/require-description
/**
* Converts this instance to a JSON compatible object.
* @returns {Object} a JSON compatible object.
*/
toJSON() {
@@ -215,8 +213,8 @@ class OverrideTester {
};
}
// eslint-disable-next-line jsdoc/require-description
/**
* Custom inspect method for Node.js `console.log()`.
* @returns {Object} an object to display by `console.log()`.
*/
[util.inspect.custom]() {