Fix code quality violations and exclude Manifest from checks
Document application modes (development/debug/production) Add global file drop handler, order column normalization, SPA hash fix Serve CDN assets via /_vendor/ URLs instead of merging into bundles Add production minification with license preservation Improve JSON formatting for debugging and production optimization Add CDN asset caching with CSS URL inlining for production builds Add three-mode system (development, debug, production) Update Manifest CLAUDE.md to reflect helper class architecture Refactor Manifest.php into helper classes for better organization Pre-manifest-refactor checkpoint: Add app_mode documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
43
node_modules/svgo/plugins/removeUselessDefs.js
generated
vendored
43
node_modules/svgo/plugins/removeUselessDefs.js
generated
vendored
@@ -1,48 +1,32 @@
|
||||
'use strict';
|
||||
import { detachNodeFromParent } from '../lib/xast.js';
|
||||
import { elemsGroups } from './_collections.js';
|
||||
|
||||
/**
|
||||
* @typedef {import('../lib/types').XastElement} XastElement
|
||||
*/
|
||||
|
||||
const { detachNodeFromParent } = require('../lib/xast.js');
|
||||
const { elemsGroups } = require('./_collections.js');
|
||||
|
||||
exports.type = 'visitor';
|
||||
exports.name = 'removeUselessDefs';
|
||||
exports.active = true;
|
||||
exports.description = 'removes elements in <defs> without id';
|
||||
export const name = 'removeUselessDefs';
|
||||
export const description = 'removes elements in <defs> without id';
|
||||
|
||||
/**
|
||||
* Removes content of defs and properties that aren't rendered directly without ids.
|
||||
*
|
||||
* @author Lev Solntsev
|
||||
*
|
||||
* @type {import('../lib/types').Plugin<void>}
|
||||
* @type {import('../lib/types.js').Plugin}
|
||||
*/
|
||||
exports.fn = () => {
|
||||
export const fn = () => {
|
||||
return {
|
||||
element: {
|
||||
enter: (node, parentNode) => {
|
||||
if (node.name === 'defs') {
|
||||
/**
|
||||
* @type {Array<XastElement>}
|
||||
*/
|
||||
if (
|
||||
node.name === 'defs' ||
|
||||
(elemsGroups.nonRendering.has(node.name) &&
|
||||
node.attributes.id == null)
|
||||
) {
|
||||
/** @type {import('../lib/types.js').XastElement[]} */
|
||||
const usefulNodes = [];
|
||||
collectUsefulNodes(node, usefulNodes);
|
||||
if (usefulNodes.length === 0) {
|
||||
detachNodeFromParent(node, parentNode);
|
||||
}
|
||||
// TODO remove in SVGO 3
|
||||
for (const usefulNode of usefulNodes) {
|
||||
// @ts-ignore parentNode is legacy
|
||||
usefulNode.parentNode = node;
|
||||
}
|
||||
node.children = usefulNodes;
|
||||
} else if (
|
||||
elemsGroups.nonRendering.includes(node.name) &&
|
||||
node.attributes.id == null
|
||||
) {
|
||||
detachNodeFromParent(node, parentNode);
|
||||
}
|
||||
},
|
||||
},
|
||||
@@ -50,7 +34,8 @@ exports.fn = () => {
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {(node: XastElement, usefulNodes: Array<XastElement>) => void}
|
||||
* @param {import('../lib/types.js').XastElement} node
|
||||
* @param {import('../lib/types.js').XastElement[]} usefulNodes
|
||||
*/
|
||||
const collectUsefulNodes = (node, usefulNodes) => {
|
||||
for (const child of node.children) {
|
||||
|
||||
Reference in New Issue
Block a user