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

@@ -22,27 +22,34 @@ function hasVariableFunction(value) {
*/
function transform(prop, value, opts) {
let lowerCasedProp = prop.toLowerCase();
let variableType = '';
if (lowerCasedProp === 'font-weight' && !hasVariableFunction(value)) {
if (typeof opts.removeQuotes === 'function') {
variableType = opts.removeQuotes(prop);
opts.removeQuotes = true;
}
if (
(lowerCasedProp === 'font-weight' || variableType === 'font-weight') &&
!hasVariableFunction(value)
) {
return minifyWeight(value);
} else if (lowerCasedProp === 'font-family' && !hasVariableFunction(value)) {
} else if (
(lowerCasedProp === 'font-family' || variableType === 'font-family') &&
!hasVariableFunction(value)
) {
const tree = valueParser(value);
tree.nodes = minifyFamily(tree.nodes, opts);
return tree.toString();
} else if (lowerCasedProp === 'font') {
const tree = valueParser(value);
tree.nodes = minifyFont(tree.nodes, opts);
return tree.toString();
} else if (lowerCasedProp === 'font' || variableType === 'font') {
return minifyFont(value, opts);
}
return value;
}
/** @typedef {{removeAfterKeyword?: boolean, removeDuplicates?: boolean, removeQuotes?: boolean}} Options */
/** @typedef {{removeAfterKeyword?: boolean, removeDuplicates?: boolean, removeQuotes?: boolean | ((prop: string) => '' | 'font' | 'font-family' | 'font-weight')}} Options */
/**
* @type {import('postcss').PluginCreator<Options>}

View File

@@ -1,21 +1,46 @@
'use strict';
const { unit } = require('postcss-value-parser');
const valueParser = require('postcss-value-parser');
const keywords = require('./keywords');
const minifyFamily = require('./minify-family');
const minifyWeight = require('./minify-weight');
/**
* Adds missing spaces before strings.
*
* @param toBeSpliced {Set<number>}
* @param {import('postcss-value-parser').Node[]} nodes
* @param {import('../index').Options} opts
* @return {import('postcss-value-parser').Node[]}
* @return {void}
*/
module.exports = function (nodes, opts) {
let i, max, node, family;
function normalizeNodes(nodes, toBeSpliced) {
for (const index of toBeSpliced) {
nodes.splice(
index,
0,
/** @type {import('postcss-value-parser').SpaceNode} */ ({
type: 'space',
value: ' ',
})
);
}
}
/**
* @param {string} unminified
* @param {import('../index').Options} opts
* @return {string}
*/
module.exports = function (unminified, opts) {
const tree = valueParser(unminified);
const nodes = tree.nodes;
let familyStart = NaN;
let hasSize = false;
const toBeSpliced = new Set();
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
for (const [i, node] of nodes.entries()) {
if (node.type === 'string' && i > 0 && nodes[i - 1].type !== 'space') {
toBeSpliced.add(i);
}
if (node.type === 'word') {
if (hasSize) {
@@ -23,7 +48,6 @@ module.exports = function (nodes, opts) {
}
const value = node.value.toLowerCase();
if (
value === 'normal' ||
value === 'inherit' ||
@@ -31,7 +55,7 @@ module.exports = function (nodes, opts) {
value === 'unset'
) {
familyStart = i;
} else if (keywords.style.has(value) || unit(value)) {
} else if (keywords.style.has(value) || valueParser.unit(value)) {
familyStart = i;
} else if (keywords.variant.has(value)) {
familyStart = i;
@@ -40,7 +64,7 @@ module.exports = function (nodes, opts) {
familyStart = i;
} else if (keywords.stretch.has(value)) {
familyStart = i;
} else if (keywords.size.has(value) || unit(value)) {
} else if (keywords.size.has(value) || valueParser.unit(value)) {
familyStart = i;
hasSize = true;
}
@@ -56,9 +80,11 @@ module.exports = function (nodes, opts) {
}
}
normalizeNodes(nodes, toBeSpliced);
familyStart += 2;
family = minifyFamily(nodes.slice(familyStart), opts);
const family = minifyFamily(nodes.slice(familyStart), opts);
return nodes.slice(0, familyStart).concat(family);
tree.nodes = nodes.slice(0, familyStart).concat(family);
return tree.toString();
};

View File

@@ -9,6 +9,6 @@ module.exports = function (value) {
return lowerCasedValue === 'normal'
? '400'
: lowerCasedValue === 'bold'
? '700'
: value;
? '700'
: value;
};