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:
94
node_modules/postcss-convert-values/src/index.js
generated
vendored
94
node_modules/postcss-convert-values/src/index.js
generated
vendored
@@ -1,4 +1,5 @@
|
||||
'use strict';
|
||||
const { dirname } = require('path');
|
||||
const valueParser = require('postcss-value-parser');
|
||||
const browserslist = require('browserslist');
|
||||
const convert = require('./lib/convert.js');
|
||||
@@ -38,7 +39,24 @@ const keepWhenZero = new Set([
|
||||
]);
|
||||
|
||||
// Can't remove the % on these properties when they're 0 on IE 11
|
||||
const keepZeroPercent = new Set(['max-height', 'height', 'min-width']);
|
||||
const keepZeroPercentOnIE11 = new Set(['max-height', 'height', 'min-width']);
|
||||
|
||||
const keepZeroPercentAlways = new Set([
|
||||
'calc',
|
||||
'color-mix',
|
||||
'min',
|
||||
'max',
|
||||
'clamp',
|
||||
'hsl',
|
||||
'hsla',
|
||||
'hwb',
|
||||
'linear',
|
||||
]);
|
||||
|
||||
const keepZeroPercentageInKeyframe = new Set([
|
||||
'border-image-width',
|
||||
'stroke-dasharray',
|
||||
]);
|
||||
|
||||
/**
|
||||
* Numbers without digits after the dot are technically invalid,
|
||||
@@ -73,6 +91,9 @@ function parseWord(node, opts, keepZeroUnit) {
|
||||
(keepZeroUnit || (!LENGTH_UNITS.has(u.toLowerCase()) && u !== '%')
|
||||
? u
|
||||
: '');
|
||||
if (node.value === '0ms') {
|
||||
node.value = '0s';
|
||||
}
|
||||
} else {
|
||||
node.value = convert(num, u, opts);
|
||||
|
||||
@@ -114,17 +135,34 @@ function clampOpacity(node) {
|
||||
function shouldKeepZeroUnit(decl, browsers) {
|
||||
const { parent } = decl;
|
||||
const lowerCasedProp = decl.prop.toLowerCase();
|
||||
|
||||
return (
|
||||
(decl.value.includes('%') &&
|
||||
keepZeroPercent.has(lowerCasedProp) &&
|
||||
keepZeroPercentOnIE11.has(lowerCasedProp) &&
|
||||
browsers.includes('ie 11')) ||
|
||||
(parent &&
|
||||
(keepZeroPercentageInKeyframe.has(lowerCasedProp) &&
|
||||
parent &&
|
||||
parent.parent &&
|
||||
parent.parent.type === 'atrule' &&
|
||||
/** @type {import('postcss').AtRule} */ (
|
||||
parent.parent
|
||||
).name.toLowerCase() === 'keyframes' &&
|
||||
lowerCasedProp === 'stroke-dasharray') ||
|
||||
/** @type {import('postcss').AtRule} */
|
||||
(parent.parent).name.toLowerCase() === 'keyframes') ||
|
||||
(lowerCasedProp === 'initial-value' &&
|
||||
parent &&
|
||||
parent.type === 'atrule' &&
|
||||
/** @type {import('postcss').AtRule} */
|
||||
(parent).name === 'property' &&
|
||||
/** @type {import('postcss').AtRule} */
|
||||
(parent).nodes !== undefined &&
|
||||
/** @type {import('postcss').AtRule} */
|
||||
(parent).nodes.some(
|
||||
(node) =>
|
||||
node.type === 'decl' &&
|
||||
node.prop.toLowerCase() === 'syntax' &&
|
||||
(node.value === "'<percentage>'" ||
|
||||
node.value === '"<percentage>"' ||
|
||||
node.value === "'<length-percentage>'" ||
|
||||
node.value === '"<length-percentage>"')
|
||||
)) ||
|
||||
keepWhenZero.has(lowerCasedProp)
|
||||
);
|
||||
}
|
||||
@@ -157,14 +195,7 @@ function transform(opts, browsers, decl) {
|
||||
clampOpacity(node);
|
||||
}
|
||||
} else if (node.type === 'function') {
|
||||
if (
|
||||
lowerCasedValue === 'calc' ||
|
||||
lowerCasedValue === 'min' ||
|
||||
lowerCasedValue === 'max' ||
|
||||
lowerCasedValue === 'clamp' ||
|
||||
lowerCasedValue === 'hsl' ||
|
||||
lowerCasedValue === 'hsla'
|
||||
) {
|
||||
if (keepZeroPercentAlways.has(lowerCasedValue)) {
|
||||
valueParser.walk(node.nodes, (n) => {
|
||||
if (n.type === 'word') {
|
||||
parseWord(n, opts, true);
|
||||
@@ -181,24 +212,39 @@ function transform(opts, browsers, decl) {
|
||||
}
|
||||
|
||||
const plugin = 'postcss-convert-values';
|
||||
|
||||
/**
|
||||
* @typedef {{precision: boolean | number, angle?: boolean, time?: boolean, length?: boolean} & browserslist.Options} Options */
|
||||
* @typedef {Parameters<typeof convert>[2]} ConvertOptions
|
||||
* @typedef {{ overrideBrowserslist?: string | string[] }} AutoprefixerOptions
|
||||
* @typedef {Pick<browserslist.Options, 'stats' | 'path' | 'env'>} BrowserslistOptions
|
||||
* @typedef {{precision?: false | number} & ConvertOptions & AutoprefixerOptions & BrowserslistOptions} Options
|
||||
*/
|
||||
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} opts
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
function pluginCreator(opts = { precision: false }) {
|
||||
const browsers = browserslist(null, {
|
||||
stats: opts.stats,
|
||||
path: __dirname,
|
||||
env: opts.env,
|
||||
});
|
||||
|
||||
return {
|
||||
postcssPlugin: plugin,
|
||||
OnceExit(css) {
|
||||
css.walkDecls((decl) => transform(opts, browsers, decl));
|
||||
|
||||
/**
|
||||
* @param {import('postcss').Result & {opts: BrowserslistOptions & {file?: string}}} result
|
||||
*/
|
||||
prepare(result) {
|
||||
const { stats, env, from, file } = result.opts || {};
|
||||
const browsers = browserslist(opts.overrideBrowserslist, {
|
||||
stats: opts.stats || stats,
|
||||
path: opts.path || dirname(from || file || __filename),
|
||||
env: opts.env || env,
|
||||
});
|
||||
|
||||
return {
|
||||
OnceExit(css) {
|
||||
css.walkDecls((decl) => transform(opts, browsers, decl));
|
||||
},
|
||||
};
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user