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:
199
node_modules/css-tree/lib/syntax/config/mix.js
generated
vendored
199
node_modules/css-tree/lib/syntax/config/mix.js
generated
vendored
@@ -1,48 +1,4 @@
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
const shape = {
|
||||
generic: true,
|
||||
types: appendOrAssign,
|
||||
atrules: {
|
||||
prelude: appendOrAssignOrNull,
|
||||
descriptors: appendOrAssignOrNull
|
||||
},
|
||||
properties: appendOrAssign,
|
||||
parseContext: assign,
|
||||
scope: deepAssign,
|
||||
atrule: ['parse'],
|
||||
pseudo: ['parse'],
|
||||
node: ['name', 'structure', 'parse', 'generate', 'walkContext']
|
||||
};
|
||||
|
||||
function isObject(value) {
|
||||
return value && value.constructor === Object;
|
||||
}
|
||||
|
||||
function copy(value) {
|
||||
return isObject(value)
|
||||
? Object.assign({}, value)
|
||||
: value;
|
||||
}
|
||||
|
||||
function assign(dest, src) {
|
||||
return Object.assign(dest, src);
|
||||
}
|
||||
|
||||
function deepAssign(dest, src) {
|
||||
for (const key in src) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
if (isObject(dest[key])) {
|
||||
deepAssign(dest[key], copy(src[key]));
|
||||
} else {
|
||||
dest[key] = copy(src[key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return dest;
|
||||
}
|
||||
|
||||
function append(a, b) {
|
||||
function appendOrSet(a, b) {
|
||||
if (typeof b === 'string' && /^\s*\|/.test(b)) {
|
||||
return typeof a === 'string'
|
||||
? a + b
|
||||
@@ -52,89 +8,116 @@ function append(a, b) {
|
||||
return b || null;
|
||||
}
|
||||
|
||||
function appendOrAssign(a, b) {
|
||||
if (typeof b === 'string') {
|
||||
return append(a, b);
|
||||
}
|
||||
function sliceProps(obj, props) {
|
||||
const result = Object.create(null);
|
||||
|
||||
const result = Object.assign({}, a);
|
||||
for (let key in b) {
|
||||
if (hasOwnProperty.call(b, key)) {
|
||||
result[key] = append(hasOwnProperty.call(a, key) ? a[key] : undefined, b[key]);
|
||||
for (const [key, value] of Object.entries(obj)) {
|
||||
if (value) {
|
||||
result[key] = {};
|
||||
for (const prop of Object.keys(value)) {
|
||||
if (props.includes(prop)) {
|
||||
result[key][prop] = value[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function appendOrAssignOrNull(a, b) {
|
||||
const result = appendOrAssign(a, b);
|
||||
export default function mix(dest, src) {
|
||||
const result = { ...dest };
|
||||
|
||||
return !isObject(result) || Object.keys(result).length
|
||||
? result
|
||||
: null;
|
||||
}
|
||||
for (const [prop, value] of Object.entries(src)) {
|
||||
switch (prop) {
|
||||
case 'generic':
|
||||
result[prop] = Boolean(value);
|
||||
break;
|
||||
|
||||
function mix(dest, src, shape) {
|
||||
for (const key in shape) {
|
||||
if (hasOwnProperty.call(shape, key) === false) {
|
||||
continue;
|
||||
}
|
||||
case 'cssWideKeywords':
|
||||
result[prop] = dest[prop]
|
||||
? [...dest[prop], ...value]
|
||||
: value || [];
|
||||
break;
|
||||
|
||||
if (shape[key] === true) {
|
||||
if (key in src) {
|
||||
if (hasOwnProperty.call(src, key)) {
|
||||
dest[key] = copy(src[key]);
|
||||
case 'units':
|
||||
result[prop] = { ...dest[prop] };
|
||||
for (const [name, patch] of Object.entries(value)) {
|
||||
result[prop][name] = Array.isArray(patch) ? patch : [];
|
||||
}
|
||||
}
|
||||
} else if (shape[key]) {
|
||||
if (typeof shape[key] === 'function') {
|
||||
const fn = shape[key];
|
||||
dest[key] = fn({}, dest[key]);
|
||||
dest[key] = fn(dest[key] || {}, src[key]);
|
||||
} else if (isObject(shape[key])) {
|
||||
const result = {};
|
||||
break;
|
||||
|
||||
for (let name in dest[key]) {
|
||||
result[name] = mix({}, dest[key][name], shape[key]);
|
||||
}
|
||||
case 'atrules':
|
||||
result[prop] = { ...dest[prop] };
|
||||
|
||||
for (let name in src[key]) {
|
||||
result[name] = mix(result[name] || {}, src[key][name], shape[key]);
|
||||
}
|
||||
for (const [name, atrule] of Object.entries(value)) {
|
||||
const exists = result[prop][name] || {};
|
||||
const current = result[prop][name] = {
|
||||
prelude: exists.prelude || null,
|
||||
descriptors: {
|
||||
...exists.descriptors
|
||||
}
|
||||
};
|
||||
|
||||
dest[key] = result;
|
||||
} else if (Array.isArray(shape[key])) {
|
||||
const res = {};
|
||||
const innerShape = shape[key].reduce(function(s, k) {
|
||||
s[k] = true;
|
||||
return s;
|
||||
}, {});
|
||||
if (!atrule) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const [name, value] of Object.entries(dest[key] || {})) {
|
||||
res[name] = {};
|
||||
if (value) {
|
||||
mix(res[name], value, innerShape);
|
||||
current.prelude = atrule.prelude
|
||||
? appendOrSet(current.prelude, atrule.prelude)
|
||||
: current.prelude || null;
|
||||
|
||||
for (const [descriptorName, descriptorValue] of Object.entries(atrule.descriptors || {})) {
|
||||
current.descriptors[descriptorName] = descriptorValue
|
||||
? appendOrSet(current.descriptors[descriptorName], descriptorValue)
|
||||
: null;
|
||||
}
|
||||
|
||||
if (!Object.keys(current.descriptors).length) {
|
||||
current.descriptors = null;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
for (const name in src[key]) {
|
||||
if (hasOwnProperty.call(src[key], name)) {
|
||||
if (!res[name]) {
|
||||
res[name] = {};
|
||||
}
|
||||
|
||||
if (src[key] && src[key][name]) {
|
||||
mix(res[name], src[key][name], innerShape);
|
||||
}
|
||||
}
|
||||
case 'types':
|
||||
case 'properties':
|
||||
result[prop] = { ...dest[prop] };
|
||||
for (const [name, syntax] of Object.entries(value)) {
|
||||
result[prop][name] = appendOrSet(result[prop][name], syntax);
|
||||
}
|
||||
break;
|
||||
|
||||
dest[key] = res;
|
||||
}
|
||||
case 'scope':
|
||||
case 'features':
|
||||
result[prop] = { ...dest[prop] };
|
||||
for (const [name, props] of Object.entries(value)) {
|
||||
result[prop][name] = { ...result[prop][name], ...props };
|
||||
}
|
||||
break;
|
||||
|
||||
case 'parseContext':
|
||||
result[prop] = {
|
||||
...dest[prop],
|
||||
...value
|
||||
};
|
||||
break;
|
||||
|
||||
case 'atrule':
|
||||
case 'pseudo':
|
||||
result[prop] = {
|
||||
...dest[prop],
|
||||
...sliceProps(value, ['parse'])
|
||||
};
|
||||
break;
|
||||
|
||||
case 'node':
|
||||
result[prop] = {
|
||||
...dest[prop],
|
||||
...sliceProps(value, ['name', 'structure', 'parse', 'generate', 'walkContext'])
|
||||
};
|
||||
break;
|
||||
}
|
||||
}
|
||||
return dest;
|
||||
}
|
||||
|
||||
module.exports = (dest, src) => mix(dest, src, shape);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user