Add semantic token highlighting for 'that' variable and comment file references in VS Code extension Add Phone_Text_Input and Currency_Input components with formatting utilities Implement client widgets, form standardization, and soft delete functionality Add modal scroll lock and update documentation Implement comprehensive modal system with form integration and validation Fix modal component instantiation using jQuery plugin API Implement modal system with responsive sizing, queuing, and validation support Implement form submission with validation, error handling, and loading states Implement country/state selectors with dynamic data loading and Bootstrap styling Revert Rsx::Route() highlighting in Blade/PHP files Target specific PHP scopes for Rsx::Route() highlighting in Blade Expand injection selector for Rsx::Route() highlighting Add custom syntax highlighting for Rsx::Route() and Rsx.Route() calls Update jqhtml packages to v2.2.165 Add bundle path validation for common mistakes (development mode only) Create Ajax_Select_Input widget and Rsx_Reference_Data controller Create Country_Select_Input widget with default country support Initialize Tom Select on Select_Input widgets Add Tom Select bundle for enhanced select dropdowns Implement ISO 3166 geographic data system for country/region selection Implement widget-based form system with disabled state support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
101 lines
2.9 KiB
JavaScript
101 lines
2.9 KiB
JavaScript
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Tobias Koppers @sokra
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const ModuleNotFoundError = require("../ModuleNotFoundError");
|
|
const LazySet = require("../util/LazySet");
|
|
|
|
/** @typedef {import("enhanced-resolve").ResolveContext} ResolveContext */
|
|
/** @typedef {import("../Compilation")} Compilation */
|
|
/** @typedef {import("../ResolverFactory").ResolveOptionsWithDependencyType} ResolveOptionsWithDependencyType */
|
|
|
|
/**
|
|
* @template T
|
|
* @typedef {object} MatchedConfigs
|
|
* @property {Map<string, T>} resolved
|
|
* @property {Map<string, T>} unresolved
|
|
* @property {Map<string, T>} prefixed
|
|
*/
|
|
|
|
/** @type {ResolveOptionsWithDependencyType} */
|
|
const RESOLVE_OPTIONS = { dependencyType: "esm" };
|
|
|
|
/**
|
|
* @template T
|
|
* @param {Compilation} compilation the compilation
|
|
* @param {[string, T][]} configs to be processed configs
|
|
* @returns {Promise<MatchedConfigs<T>>} resolved matchers
|
|
*/
|
|
module.exports.resolveMatchedConfigs = (compilation, configs) => {
|
|
/** @type {Map<string, T>} */
|
|
const resolved = new Map();
|
|
/** @type {Map<string, T>} */
|
|
const unresolved = new Map();
|
|
/** @type {Map<string, T>} */
|
|
const prefixed = new Map();
|
|
/** @type {ResolveContext} */
|
|
const resolveContext = {
|
|
fileDependencies: new LazySet(),
|
|
contextDependencies: new LazySet(),
|
|
missingDependencies: new LazySet()
|
|
};
|
|
const resolver = compilation.resolverFactory.get("normal", RESOLVE_OPTIONS);
|
|
const context = compilation.compiler.context;
|
|
|
|
return Promise.all(
|
|
// eslint-disable-next-line array-callback-return
|
|
configs.map(([request, config]) => {
|
|
if (/^\.\.?(\/|$)/.test(request)) {
|
|
// relative request
|
|
return new Promise((resolve) => {
|
|
resolver.resolve(
|
|
{},
|
|
context,
|
|
request,
|
|
resolveContext,
|
|
(err, result) => {
|
|
if (err || result === false) {
|
|
err = err || new Error(`Can't resolve ${request}`);
|
|
compilation.errors.push(
|
|
new ModuleNotFoundError(null, err, {
|
|
name: `shared module ${request}`
|
|
})
|
|
);
|
|
return resolve(null);
|
|
}
|
|
resolved.set(/** @type {string} */ (result), config);
|
|
resolve(null);
|
|
}
|
|
);
|
|
});
|
|
} else if (/^(\/|[A-Za-z]:\\|\\\\)/.test(request)) {
|
|
// absolute path
|
|
resolved.set(request, config);
|
|
} else if (request.endsWith("/")) {
|
|
// module request prefix
|
|
prefixed.set(request, config);
|
|
} else {
|
|
// module request
|
|
unresolved.set(request, config);
|
|
}
|
|
})
|
|
).then(() => {
|
|
compilation.contextDependencies.addAll(
|
|
/** @type {LazySet<string>} */
|
|
(resolveContext.contextDependencies)
|
|
);
|
|
compilation.fileDependencies.addAll(
|
|
/** @type {LazySet<string>} */
|
|
(resolveContext.fileDependencies)
|
|
);
|
|
compilation.missingDependencies.addAll(
|
|
/** @type {LazySet<string>} */
|
|
(resolveContext.missingDependencies)
|
|
);
|
|
return { resolved, unresolved, prefixed };
|
|
});
|
|
};
|