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,6 +1,6 @@
{
"name": "postcss-unique-selectors",
"version": "5.1.1",
"version": "7.0.4",
"description": "Ensure CSS selectors are unique.",
"main": "src/index.js",
"types": "types/index.d.ts",
@@ -23,19 +23,18 @@
},
"repository": "cssnano/cssnano",
"dependencies": {
"postcss-selector-parser": "^6.0.5"
"postcss-selector-parser": "^7.1.0"
},
"bugs": {
"url": "https://github.com/cssnano/cssnano/issues"
},
"engines": {
"node": "^10 || ^12 || >=14.0"
"node": "^18.12.0 || ^20.9.0 || >=22.0"
},
"devDependencies": {
"postcss": "^8.2.15"
"postcss": "^8.5.3"
},
"peerDependencies": {
"postcss": "^8.2.15"
},
"readme": "# [postcss][postcss]-unique-selectors\n\n> Ensure CSS selectors are unique.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-unique-selectors) do:\n\n```\nnpm install postcss-unique-selectors --save\n```\n\n## Example\n\nSelectors are sorted naturally, and deduplicated:\n\n### Input\n\n```css\nh1,h3,h2,h1 {\n color: red\n}\n```\n\n### Output\n\n```css\nh1,h2,h3 {\n color: red\n}\n```\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## Contributors\n\nSee [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).\n\n## License\n\nMIT © [Ben Briggs](http://beneb.info)\n\n[postcss]: https://github.com/postcss/postcss\n"
"postcss": "^8.4.32"
}
}

View File

@@ -3,23 +3,45 @@ const selectorParser = require('postcss-selector-parser');
/**
* @param {string} selectors
* @param {selectorParser.SyncProcessor<void>} callback
* @return {string}
*/
function parseSelectors(selectors, callback) {
return selectorParser(callback).processSync(selectors);
}
function generateUniqueSelector(selectors) {
/** @type {Map<string, string>} */
const uniqueSelectors = new Map();
/**
* @param {import('postcss').Rule} rule
* @return {string}
*/
function unique(rule) {
const selector = [...new Set(rule.selectors)];
selector.sort();
return selector.join();
}
/** @type {selectorParser.SyncProcessor<void>} */
const collectUniqueSelectors = (selNode) => {
for (const node of selNode.nodes) {
/** @type {string[]} */
const comments = [];
// Duplicates are removed by stripping the comments and using the results as the Map key.
const keyNode = node.clone();
keyNode.walk((sel) => {
if (sel.type === 'comment') {
comments.push(sel.value);
sel.remove();
}
});
const key = keyNode.toString().trim();
const dupeSelector = uniqueSelectors.get(key);
if (!dupeSelector) {
uniqueSelectors.set(key, node.toString());
} else if (comments.length) {
// If the duplicate selector has a comment, it is concatenated to the end of the selector.
uniqueSelectors.set(key, `${dupeSelector}${comments.join('')}`);
}
}
};
selectorParser(collectUniqueSelectors).processSync(selectors);
return [...uniqueSelectors.entries()]
.sort(([a], [b]) => (a > b ? 1 : a < b ? -1 : 0))
.map(([, selector]) => selector)
.join();
}
/**
* @type {import('postcss').PluginCreator<void>}
* @return {import('postcss').Plugin}
@@ -29,27 +51,13 @@ function pluginCreator() {
postcssPlugin: 'postcss-unique-selectors',
OnceExit(css) {
css.walkRules((nodes) => {
/** @type {string[]} */
let comments = [];
/** @type {selectorParser.SyncProcessor<void>} */
const removeAndSaveComments = (selNode) => {
selNode.walk((sel) => {
if (sel.type === 'comment') {
comments.push(sel.value);
sel.remove();
return;
} else {
return;
}
});
};
if (nodes.raws.selector && nodes.raws.selector.raw) {
parseSelectors(nodes.raws.selector.raw, removeAndSaveComments);
nodes.raws.selector.raw = unique(nodes);
nodes.raws.selector.raw = generateUniqueSelector(
nodes.raws.selector.raw
);
} else {
nodes.selector = generateUniqueSelector(nodes.selector);
}
nodes.selector = parseSelectors(nodes.selector, removeAndSaveComments);
nodes.selector = unique(nodes);
nodes.selectors = nodes.selectors.concat(comments);
});
},
};

View File

@@ -3,7 +3,8 @@ export = pluginCreator;
* @type {import('postcss').PluginCreator<void>}
* @return {import('postcss').Plugin}
*/
declare function pluginCreator(): import('postcss').Plugin;
declare function pluginCreator(): import("postcss").Plugin;
declare namespace pluginCreator {
const postcss: true;
let postcss: true;
}
//# sourceMappingURL=index.d.ts.map

1
node_modules/postcss-unique-selectors/types/index.d.ts.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AA4CA;;;GAGG;AACH,kCAFY,OAAO,SAAS,EAAE,MAAM,CAiBnC"}