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>
91 lines
2.0 KiB
JavaScript
Executable File
91 lines
2.0 KiB
JavaScript
Executable File
/*
|
|
MIT License http://www.opensource.org/licenses/mit-license.php
|
|
Author Sean Larkin @thelarkinn
|
|
*/
|
|
|
|
"use strict";
|
|
|
|
const WebpackError = require("./WebpackError");
|
|
|
|
/**
|
|
* @template T
|
|
* @callback Callback
|
|
* @param {Error | null} err
|
|
* @param {T=} stats
|
|
* @returns {void}
|
|
*/
|
|
|
|
class HookWebpackError extends WebpackError {
|
|
/**
|
|
* Creates an instance of HookWebpackError.
|
|
* @param {Error} error inner error
|
|
* @param {string} hook name of hook
|
|
*/
|
|
constructor(error, hook) {
|
|
super(error.message);
|
|
|
|
this.name = "HookWebpackError";
|
|
this.hook = hook;
|
|
this.error = error;
|
|
this.hideStack = true;
|
|
this.details = `caused by plugins in ${hook}\n${error.stack}`;
|
|
|
|
this.stack += `\n-- inner error --\n${error.stack}`;
|
|
}
|
|
}
|
|
|
|
module.exports = HookWebpackError;
|
|
|
|
/**
|
|
* @param {Error} error an error
|
|
* @param {string} hook name of the hook
|
|
* @returns {WebpackError} a webpack error
|
|
*/
|
|
const makeWebpackError = (error, hook) => {
|
|
if (error instanceof WebpackError) return error;
|
|
return new HookWebpackError(error, hook);
|
|
};
|
|
|
|
module.exports.makeWebpackError = makeWebpackError;
|
|
|
|
/**
|
|
* @template T
|
|
* @param {(err: WebpackError | null, result?: T) => void} callback webpack error callback
|
|
* @param {string} hook name of hook
|
|
* @returns {Callback<T>} generic callback
|
|
*/
|
|
const makeWebpackErrorCallback = (callback, hook) => (err, result) => {
|
|
if (err) {
|
|
if (err instanceof WebpackError) {
|
|
callback(err);
|
|
return;
|
|
}
|
|
callback(new HookWebpackError(err, hook));
|
|
return;
|
|
}
|
|
callback(null, result);
|
|
};
|
|
|
|
module.exports.makeWebpackErrorCallback = makeWebpackErrorCallback;
|
|
|
|
/**
|
|
* @template T
|
|
* @param {() => T} fn function which will be wrapping in try catch
|
|
* @param {string} hook name of hook
|
|
* @returns {T} the result
|
|
*/
|
|
const tryRunOrWebpackError = (fn, hook) => {
|
|
let r;
|
|
try {
|
|
r = fn();
|
|
} catch (err) {
|
|
if (err instanceof WebpackError) {
|
|
throw err;
|
|
}
|
|
throw new HookWebpackError(/** @type {Error} */ (err), hook);
|
|
}
|
|
return r;
|
|
};
|
|
|
|
module.exports.tryRunOrWebpackError = tryRunOrWebpackError;
|