Framework updates
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
29
node_modules/svgo/lib/svgo/coa.js
generated
vendored
29
node_modules/svgo/lib/svgo/coa.js
generated
vendored
@@ -140,7 +140,7 @@ async function action(args, opts, command) {
|
||||
!opts.string &&
|
||||
!opts.stdin &&
|
||||
!opts.folder &&
|
||||
process.stdin.isTTY === true
|
||||
process.stdin.isTTY
|
||||
) {
|
||||
return command.help();
|
||||
}
|
||||
@@ -524,10 +524,33 @@ function checkWriteFileError(input, output, data, error) {
|
||||
}
|
||||
}
|
||||
|
||||
/** Show list of available plugins with short description. */
|
||||
/**
|
||||
* Show list of available plugins with short description with the presets it belongs to.
|
||||
*/
|
||||
function showAvailablePlugins() {
|
||||
const pluginToPresetsMap = new Map();
|
||||
|
||||
for (const plugin of builtinPlugins) {
|
||||
if (plugin.isPreset) {
|
||||
for (const presetPlugins of plugin.plugins) {
|
||||
if (!pluginToPresetsMap.has(presetPlugins.name)) {
|
||||
pluginToPresetsMap.set(presetPlugins.name, [plugin.name]);
|
||||
} else {
|
||||
pluginToPresetsMap.get(presetPlugins.name).push(plugin.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
const list = builtinPlugins
|
||||
.map((plugin) => ` [ ${colors.green(plugin.name)} ] ${plugin.description}`)
|
||||
.map((plugin) => {
|
||||
const name = plugin.name;
|
||||
let description = plugin.description || '';
|
||||
const presetsForThisPlugin = pluginToPresetsMap.get(name) || [];
|
||||
if (presetsForThisPlugin && presetsForThisPlugin.length > 0) {
|
||||
description += ` (${presetsForThisPlugin.join(', ')})`;
|
||||
}
|
||||
return ` [ ${colors.green(name)} ] ${description}`;
|
||||
})
|
||||
.join('\n');
|
||||
console.log('Currently available plugins:\n' + list);
|
||||
}
|
||||
|
||||
2
node_modules/svgo/lib/svgo/plugins.js
generated
vendored
2
node_modules/svgo/lib/svgo/plugins.js
generated
vendored
@@ -33,7 +33,7 @@ export const invokePlugins = (
|
||||
};
|
||||
|
||||
/**
|
||||
* @template {string} T
|
||||
* @template {`preset-${string}`} T
|
||||
* @param {{ name: T, plugins: ReadonlyArray<import('../types.js').BuiltinPlugin<string, any>> }} arg0
|
||||
* @returns {import('../types.js').BuiltinPluginOrPreset<T, any>}
|
||||
*/
|
||||
|
||||
18
node_modules/svgo/lib/svgo/tools.js
generated
vendored
18
node_modules/svgo/lib/svgo/tools.js
generated
vendored
@@ -145,6 +145,14 @@ export const removeLeadingZero = (value) => {
|
||||
return strValue;
|
||||
};
|
||||
|
||||
const hasScriptsEventAttrs = [
|
||||
...attrsGroups.animationEvent,
|
||||
...attrsGroups.documentEvent,
|
||||
...attrsGroups.documentElementEvent,
|
||||
...attrsGroups.globalEvent,
|
||||
...attrsGroups.graphicalEvent,
|
||||
];
|
||||
|
||||
/**
|
||||
* If the current node contains any scripts. This does not check parents or
|
||||
* children of the node, only the properties and attributes of the node itself.
|
||||
@@ -170,15 +178,7 @@ export const hasScripts = (node) => {
|
||||
}
|
||||
}
|
||||
|
||||
const eventAttrs = [
|
||||
...attrsGroups.animationEvent,
|
||||
...attrsGroups.documentEvent,
|
||||
...attrsGroups.documentElementEvent,
|
||||
...attrsGroups.globalEvent,
|
||||
...attrsGroups.graphicalEvent,
|
||||
];
|
||||
|
||||
return eventAttrs.some((attr) => node.attributes[attr] != null);
|
||||
return hasScriptsEventAttrs.some((attr) => node.attributes[attr] != null);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
26
node_modules/svgo/lib/types.ts
generated
vendored
26
node_modules/svgo/lib/types.ts
generated
vendored
@@ -136,18 +136,26 @@ export type BuiltinPlugin<Name extends string, Params> = {
|
||||
fn: Plugin<Params>;
|
||||
};
|
||||
|
||||
type PresetProperties<IsPreset extends boolean> = {
|
||||
name: IsPreset extends true ? `preset-${string}` : string;
|
||||
|
||||
/** If the plugin is itself a preset that invokes other plugins. */
|
||||
isPreset: IsPreset extends true ? true : undefined;
|
||||
|
||||
/**
|
||||
* If {@link #isPreset} is true, an array of the plugins in the preset
|
||||
* in the order that they are invoked.
|
||||
*/
|
||||
plugins: IsPreset extends true
|
||||
? ReadonlyArray<BuiltinPlugin<string, Object>>
|
||||
: undefined;
|
||||
};
|
||||
|
||||
export type BuiltinPluginOrPreset<Name extends string, Params> = BuiltinPlugin<
|
||||
Name,
|
||||
Params
|
||||
> & {
|
||||
/** If the plugin is itself a preset that invokes other plugins. */
|
||||
isPreset?: true;
|
||||
/**
|
||||
* If the plugin is a preset that invokes other plugins, this returns an
|
||||
* array of the plugins in the preset in the order that they are invoked.
|
||||
*/
|
||||
plugins?: ReadonlyArray<BuiltinPlugin<string, Object>>;
|
||||
};
|
||||
> &
|
||||
(PresetProperties<true> | Partial<PresetProperties<false>>);
|
||||
|
||||
export type XastDoctype = {
|
||||
type: 'doctype';
|
||||
|
||||
2
node_modules/svgo/lib/version.js
generated
vendored
2
node_modules/svgo/lib/version.js
generated
vendored
@@ -4,4 +4,4 @@
|
||||
* @type {string}
|
||||
* @since 4.0.0
|
||||
*/
|
||||
export const VERSION = '4.0.0';
|
||||
export const VERSION = '4.0.1';
|
||||
|
||||
Reference in New Issue
Block a user