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,66 +1,68 @@
var isDigit = require('../../tokenizer').isDigit;
var TYPE = require('../../tokenizer').TYPE;
import {
Delim,
Number as NumberToken,
Function as FunctionToken
} from '../../tokenizer/index.js';
var NUMBER = TYPE.Number;
var DELIM = TYPE.Delim;
var SOLIDUS = 0x002F; // U+002F SOLIDUS (/)
var FULLSTOP = 0x002E; // U+002E FULL STOP (.)
const SOLIDUS = 0x002F; // U+002F SOLIDUS (/)
// Terms of <ratio> should be a positive numbers (not zero or negative)
// (see https://drafts.csswg.org/mediaqueries-3/#values)
// However, -o-min-device-pixel-ratio takes fractional values as a ratio's term
// and this is using by various sites. Therefore we relax checking on parse
// to test a term is unsigned number without an exponent part.
// Additional checking may be applied on lexer validation.
function consumeNumber() {
this.scanner.skipWS();
// Media Queries Level 3 defines terms of <ratio> as a positive (not zero or negative)
// integers (see https://drafts.csswg.org/mediaqueries-3/#values)
// However, Media Queries Level 4 removes any definition of values
// (see https://drafts.csswg.org/mediaqueries-4/#values) and refers to
// CSS Values and Units for detail. In CSS Values and Units Level 4 a <ratio>
// definition was added (see https://drafts.csswg.org/css-values-4/#ratios) which
// defines ratio as "<number [0,∞]> [ / <number [0,∞]> ]?" and based on it
// any constrains on terms were removed. Parser also doesn't test numbers
// in any way to make possible for linting and fixing them by the tools using CSSTree.
// An additional syntax examination may be applied by a lexer.
function consumeTerm() {
this.skipSC();
var value = this.consume(NUMBER);
switch (this.tokenType) {
case NumberToken:
return this.Number();
for (var i = 0; i < value.length; i++) {
var code = value.charCodeAt(i);
if (!isDigit(code) && code !== FULLSTOP) {
this.error('Unsigned number is expected', this.scanner.tokenStart - value.length + i);
}
case FunctionToken:
return this.Function(this.readSequence, this.scope.Value);
default:
this.error('Number of function is expected');
}
if (Number(value) === 0) {
this.error('Zero number is not allowed', this.scanner.tokenStart - value.length);
}
return value;
}
// <positive-integer> S* '/' S* <positive-integer>
module.exports = {
name: 'Ratio',
structure: {
left: String,
right: String
},
parse: function() {
var start = this.scanner.tokenStart;
var left = consumeNumber.call(this);
var right;
this.scanner.skipWS();
if (!this.scanner.isDelim(SOLIDUS)) {
this.error('Solidus is expected');
}
this.eat(DELIM);
right = consumeNumber.call(this);
return {
type: 'Ratio',
loc: this.getLocation(start, this.scanner.tokenStart),
left: left,
right: right
};
},
generate: function(node) {
this.chunk(node.left);
this.chunk('/');
this.chunk(node.right);
}
export const name = 'Ratio';
export const structure = {
left: ['Number', 'Function'],
right: ['Number', 'Function', null]
};
// <number [0,∞]> [ / <number [0,∞]> ]?
export function parse() {
const start = this.tokenStart;
const left = consumeTerm.call(this);
let right = null;
this.skipSC();
if (this.isDelim(SOLIDUS)) {
this.eatDelim(SOLIDUS);
right = consumeTerm.call(this);
}
return {
type: 'Ratio',
loc: this.getLocation(start, this.tokenStart),
left,
right
};
}
export function generate(node) {
this.node(node.left);
this.token(Delim, '/');
if (node.right) {
this.node(node.right);
} else {
this.node(NumberToken, 1);
}
}