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,5 +1,6 @@
var List = require('../common/List');
var hasOwnProperty = Object.prototype.hasOwnProperty;
import { List } from '../utils/List.js';
const { hasOwnProperty } = Object.prototype;
function isValidNumber(value) {
// Number.isInteger(value) && value >= 0
@@ -26,8 +27,8 @@ function createNodeStructureChecker(type, fields) {
return warn(node, 'Type of node should be an Object');
}
for (var key in node) {
var valid = true;
for (let key in node) {
let valid = true;
if (hasOwnProperty.call(node, key) === false) {
continue;
@@ -54,8 +55,10 @@ function createNodeStructureChecker(type, fields) {
valid = false;
} else if (fields.hasOwnProperty(key)) {
for (var i = 0, valid = false; !valid && i < fields[key].length; i++) {
var fieldType = fields[key][i];
valid = false;
for (let i = 0; !valid && i < fields[key].length; i++) {
const fieldType = fields[key][i];
switch (fieldType) {
case String:
@@ -87,7 +90,7 @@ function createNodeStructureChecker(type, fields) {
}
}
for (var key in fields) {
for (const key in fields) {
if (hasOwnProperty.call(fields, key) &&
hasOwnProperty.call(node, key) === false) {
warn(node, 'Field `' + type + '.' + key + '` is missed');
@@ -96,68 +99,71 @@ function createNodeStructureChecker(type, fields) {
};
}
function genTypesList(fieldTypes, path) {
const docsTypes = [];
for (let i = 0; i < fieldTypes.length; i++) {
const fieldType = fieldTypes[i];
if (fieldType === String || fieldType === Boolean) {
docsTypes.push(fieldType.name.toLowerCase());
} else if (fieldType === null) {
docsTypes.push('null');
} else if (typeof fieldType === 'string') {
docsTypes.push(fieldType);
} else if (Array.isArray(fieldType)) {
docsTypes.push('List<' + (genTypesList(fieldType, path) || 'any') + '>'); // TODO: use type enum
} else {
throw new Error('Wrong value `' + fieldType + '` in `' + path + '` structure definition');
}
}
return docsTypes.join(' | ');
}
function processStructure(name, nodeType) {
var structure = nodeType.structure;
var fields = {
const structure = nodeType.structure;
const fields = {
type: String,
loc: true
};
var docs = {
const docs = {
type: '"' + name + '"'
};
for (var key in structure) {
for (const key in structure) {
if (hasOwnProperty.call(structure, key) === false) {
continue;
}
var docsTypes = [];
var fieldTypes = fields[key] = Array.isArray(structure[key])
const fieldTypes = fields[key] = Array.isArray(structure[key])
? structure[key].slice()
: [structure[key]];
for (var i = 0; i < fieldTypes.length; i++) {
var fieldType = fieldTypes[i];
if (fieldType === String || fieldType === Boolean) {
docsTypes.push(fieldType.name);
} else if (fieldType === null) {
docsTypes.push('null');
} else if (typeof fieldType === 'string') {
docsTypes.push('<' + fieldType + '>');
} else if (Array.isArray(fieldType)) {
docsTypes.push('List'); // TODO: use type enum
} else {
throw new Error('Wrong value `' + fieldType + '` in `' + name + '.' + key + '` structure definition');
}
}
docs[key] = docsTypes.join(' | ');
docs[key] = genTypesList(fieldTypes, name + '.' + key);
}
return {
docs: docs,
docs,
check: createNodeStructureChecker(name, fields)
};
}
module.exports = {
getStructureFromConfig: function(config) {
var structure = {};
export function getStructureFromConfig(config) {
const structure = {};
if (config.node) {
for (var name in config.node) {
if (hasOwnProperty.call(config.node, name)) {
var nodeType = config.node[name];
if (config.node) {
for (const name in config.node) {
if (hasOwnProperty.call(config.node, name)) {
const nodeType = config.node[name];
if (nodeType.structure) {
structure[name] = processStructure(name, nodeType);
} else {
throw new Error('Missed `structure` field in `' + name + '` node type definition');
}
if (nodeType.structure) {
structure[name] = processStructure(name, nodeType);
} else {
throw new Error('Missed `structure` field in `' + name + '` node type definition');
}
}
}
return structure;
}
return structure;
};