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:
root
2026-01-14 10:38:22 +00:00
parent bb9046af1b
commit d523f0f600
2355 changed files with 231384 additions and 32223 deletions

View File

@@ -1,7 +1,7 @@
var resolveKeyword = require('css-tree').keyword;
var { hasNoChildren } = require('./utils');
import { keyword as resolveKeyword } from 'css-tree';
import { hasNoChildren } from './utils.js';
module.exports = function cleanAtrule(node, item, list) {
export default function cleanAtrule(node, item, list) {
if (node.block) {
// otherwise removed at-rule don't prevent @import for removal
if (this.stylesheet !== null) {
@@ -46,13 +46,15 @@ module.exports = function cleanAtrule(node, item, list) {
this.root.firstAtrulesAllowed = false;
list.remove(item);
return true;
}, this);
break;
default:
var name = resolveKeyword(node.name).basename;
default: {
const name = resolveKeyword(node.name).basename;
if (name === 'keyframes' ||
name === 'media' ||
name === 'supports') {
@@ -62,5 +64,6 @@ module.exports = function cleanAtrule(node, item, list) {
list.remove(item);
}
}
}
}
};

View File

@@ -1,3 +1,3 @@
module.exports = function cleanComment(data, item, list) {
export default function cleanComment(data, item, list) {
list.remove(item);
};

View File

@@ -1,7 +1,7 @@
var property = require('css-tree').property;
import { property } from 'css-tree';
module.exports = function cleanDeclartion(node, item, list) {
if (node.value.children && node.value.children.isEmpty()) {
export default function cleanDeclartion(node, item, list) {
if (node.value.children && node.value.children.isEmpty) {
list.remove(item);
return;
}

4
node_modules/csso/lib/clean/Raw.js generated vendored
View File

@@ -1,6 +1,6 @@
var { isNodeChildrenList } = require('./utils');
import { isNodeChildrenList } from './utils.js';
module.exports = function cleanRaw(node, item, list) {
export default function cleanRaw(node, item, list) {
// raw in stylesheet or block children
if (isNodeChildrenList(this.stylesheet, list) ||
isNodeChildrenList(this.block, list)) {

27
node_modules/csso/lib/clean/Rule.js generated vendored
View File

@@ -1,10 +1,12 @@
var hasOwnProperty = Object.prototype.hasOwnProperty;
var walk = require('css-tree').walk;
var { hasNoChildren } = require('./utils');
import { walk, keyword } from 'css-tree';
import { hasNoChildren } from './utils.js';
const { hasOwnProperty } = Object.prototype;
const skipUsageFilteringAtrule = new Set(['keyframes']);
function cleanUnused(selectorList, usageData) {
selectorList.children.each(function(selector, item, list) {
var shouldRemove = false;
selectorList.children.forEach((selector, item, list) => {
let shouldRemove = false;
walk(selector, function(node) {
// ignore nodes in nested selectors
@@ -71,19 +73,24 @@ function cleanUnused(selectorList, usageData) {
}
});
return selectorList.children.isEmpty();
return selectorList.children.isEmpty;
}
module.exports = function cleanRule(node, item, list, options) {
export default function cleanRule(node, item, list, options) {
if (hasNoChildren(node.prelude) || hasNoChildren(node.block)) {
list.remove(item);
return;
}
var usageData = options.usage;
// avoid usage filtering for some at-rules
if (this.atrule && skipUsageFilteringAtrule.has(keyword(this.atrule.name).basename)) {
return;
}
if (usageData && (usageData.whitelist !== null || usageData.blacklist !== null)) {
cleanUnused(node.prelude, usageData);
const { usage } = options;
if (usage && (usage.whitelist !== null || usage.blacklist !== null)) {
cleanUnused(node.prelude, usage);
if (hasNoChildren(node.prelude)) {
list.remove(item);

View File

@@ -1,6 +1,6 @@
// remove useless universal selector
module.exports = function cleanTypeSelector(node, item, list) {
var name = item.data.name;
export default function cleanTypeSelector(node, item, list) {
const name = item.data.name;
// check it's a non-namespaced universal selector
if (name !== '*') {
@@ -8,7 +8,7 @@ module.exports = function cleanTypeSelector(node, item, list) {
}
// remove when universal selector before other selectors
var nextType = item.next && item.next.data.type;
const nextType = item.next && item.next.data.type;
if (nextType === 'IdSelector' ||
nextType === 'ClassSelector' ||
nextType === 'AttributeSelector' ||

View File

@@ -1,30 +1,3 @@
var { isNodeChildrenList } = require('./utils');
function isSafeOperator(node) {
return node.type === 'Operator' && node.value !== '+' && node.value !== '-';
}
module.exports = function cleanWhitespace(node, item, list) {
// remove when first or last item in sequence
if (item.next === null || item.prev === null) {
list.remove(item);
return;
}
// white space in stylesheet or block children
if (isNodeChildrenList(this.stylesheet, list) ||
isNodeChildrenList(this.block, list)) {
list.remove(item);
return;
}
if (item.next.data.type === 'WhiteSpace') {
list.remove(item);
return;
}
if (isSafeOperator(item.prev.data) || isSafeOperator(item.next.data)) {
list.remove(item);
return;
}
export default function cleanWhitespace(node, item, list) {
list.remove(item);
};

30
node_modules/csso/lib/clean/index.js generated vendored
View File

@@ -1,17 +1,25 @@
var walk = require('css-tree').walk;
var handlers = {
Atrule: require('./Atrule'),
Comment: require('./Comment'),
Declaration: require('./Declaration'),
Raw: require('./Raw'),
Rule: require('./Rule'),
TypeSelector: require('./TypeSelector'),
WhiteSpace: require('./WhiteSpace')
import { walk } from 'css-tree';
import Atrule from './Atrule.js';
import Comment from './Comment.js';
import Declaration from './Declaration.js';
import Raw from './Raw.js';
import Rule from './Rule.js';
import TypeSelector from './TypeSelector.js';
import WhiteSpace from './WhiteSpace.js';
const handlers = {
Atrule,
Comment,
Declaration,
Raw,
Rule,
TypeSelector,
WhiteSpace
};
module.exports = function(ast, options) {
export default function(ast, options) {
walk(ast, {
leave: function(node, item, list) {
leave(node, item, list) {
if (handlers.hasOwnProperty(node.type)) {
handlers[node.type].call(this, node, item, list, options);
}

15
node_modules/csso/lib/clean/utils.js generated vendored
View File

@@ -1,8 +1,7 @@
module.exports = {
hasNoChildren: function(node) {
return !node || !node.children || node.children.isEmpty();
},
isNodeChildrenList: function(node, list) {
return node !== null && node.children === list;
}
};
export function hasNoChildren(node) {
return !node || !node.children || node.children.isEmpty;
}
export function isNodeChildrenList(node, list) {
return node !== null && node.children === list;
}