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:
9
node_modules/postcss-normalize-url/README.md
generated
vendored
9
node_modules/postcss-normalize-url/README.md
generated
vendored
@@ -29,20 +29,13 @@ h1 {
|
||||
```
|
||||
|
||||
Note that this module will also try to normalize relative URLs, and is capable
|
||||
of stripping unnecessary quotes. For more examples, see the [tests](test.js).
|
||||
of stripping unnecessary quotes. For more examples, see the [tests](test/index.js).
|
||||
|
||||
## Usage
|
||||
|
||||
See the [PostCSS documentation](https://github.com/postcss/postcss#usage) for
|
||||
examples for your environment.
|
||||
|
||||
## API
|
||||
|
||||
### normalize([options])
|
||||
|
||||
Please see the [normalize-url documentation][docs]. By default,
|
||||
`normalizeProtocol`, `stripHash` & `stripWWW` are set to `false`.
|
||||
|
||||
## Contributors
|
||||
|
||||
See [CONTRIBUTORS.md](https://github.com/cssnano/cssnano/blob/master/CONTRIBUTORS.md).
|
||||
|
||||
12
node_modules/postcss-normalize-url/package.json
generated
vendored
12
node_modules/postcss-normalize-url/package.json
generated
vendored
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "postcss-normalize-url",
|
||||
"version": "5.1.0",
|
||||
"version": "7.0.1",
|
||||
"description": "Normalize URLs with PostCSS",
|
||||
"main": "src/index.js",
|
||||
"types": "types/index.d.ts",
|
||||
@@ -20,7 +20,6 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"normalize-url": "^6.0.1",
|
||||
"postcss-value-parser": "^4.2.0"
|
||||
},
|
||||
"homepage": "https://github.com/cssnano/cssnano",
|
||||
@@ -34,13 +33,12 @@
|
||||
"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]-normalize-url\n\n> [Normalize URLs](https://github.com/sindresorhus/normalize-url) with PostCSS.\n\n## Install\n\nWith [npm](https://npmjs.org/package/postcss-normalize-url) do:\n\n```\nnpm install postcss-normalize-url --save\n```\n\n## Example\n\n### Input\n\n```css\nh1 {\n background: url(\"http://site.com:80/image.jpg\")\n}\n```\n\n### Output\n\n```css\nh1 {\n background: url(http://site.com/image.jpg)\n}\n```\n\nNote that this module will also try to normalize relative URLs, and is capable\nof stripping unnecessary quotes. For more examples, see the [tests](test.js).\n\n## Usage\n\nSee the [PostCSS documentation](https://github.com/postcss/postcss#usage) for\nexamples for your environment.\n\n## API\n\n### normalize([options])\n\nPlease see the [normalize-url documentation][docs]. By default,\n`normalizeProtocol`, `stripHash` & `stripWWW` are set to `false`.\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[docs]: https://github.com/sindresorhus/normalize-url#options\n[postcss]: https://github.com/postcss/postcss\n"
|
||||
"postcss": "^8.4.32"
|
||||
}
|
||||
}
|
||||
34
node_modules/postcss-normalize-url/src/index.js
generated
vendored
34
node_modules/postcss-normalize-url/src/index.js
generated
vendored
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
const path = require('path');
|
||||
const valueParser = require('postcss-value-parser');
|
||||
const normalize = require('normalize-url');
|
||||
const normalize = require('./normalize.js');
|
||||
|
||||
const multiline = /\\[\r\n]/;
|
||||
// eslint-disable-next-line no-useless-escape
|
||||
@@ -27,16 +27,15 @@ function isAbsolute(url) {
|
||||
|
||||
/**
|
||||
* @param {string} url
|
||||
* @param {normalize.Options} options
|
||||
* @return {string}
|
||||
*/
|
||||
function convert(url, options) {
|
||||
function convert(url) {
|
||||
if (isAbsolute(url) || url.startsWith('//')) {
|
||||
let normalizedURL;
|
||||
|
||||
try {
|
||||
normalizedURL = normalize(url, options);
|
||||
} catch (e) {
|
||||
normalizedURL = normalize(url);
|
||||
} catch {
|
||||
normalizedURL = url;
|
||||
}
|
||||
|
||||
@@ -74,10 +73,9 @@ function transformNamespace(rule) {
|
||||
|
||||
/**
|
||||
* @param {import('postcss').Declaration} decl
|
||||
* @param {normalize.Options} opts
|
||||
* @return {void}
|
||||
*/
|
||||
function transformDecl(decl, opts) {
|
||||
function transformDecl(decl) {
|
||||
decl.value = valueParser(decl.value)
|
||||
.walk((node) => {
|
||||
if (node.type !== 'function' || node.value.toLowerCase() !== 'url') {
|
||||
@@ -107,7 +105,7 @@ function transformDecl(decl, opts) {
|
||||
}
|
||||
|
||||
if (!/^.+-extension:\//i.test(url.value)) {
|
||||
url.value = convert(url.value, opts);
|
||||
url.value = convert(url.value);
|
||||
}
|
||||
|
||||
if (escapeChars.test(url.value) && url.type === 'string') {
|
||||
@@ -126,32 +124,18 @@ function transformDecl(decl, opts) {
|
||||
.toString();
|
||||
}
|
||||
|
||||
/** @typedef {normalize.Options} Options */
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} opts
|
||||
* @type {import('postcss').PluginCreator<void>}
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
function pluginCreator(opts) {
|
||||
opts = Object.assign(
|
||||
{},
|
||||
{
|
||||
normalizeProtocol: false,
|
||||
sortQueryParameters: false,
|
||||
stripHash: false,
|
||||
stripWWW: false,
|
||||
stripTextFragment: false,
|
||||
},
|
||||
opts
|
||||
);
|
||||
|
||||
function pluginCreator() {
|
||||
return {
|
||||
postcssPlugin: 'postcss-normalize-url',
|
||||
|
||||
OnceExit(css) {
|
||||
css.walk((node) => {
|
||||
if (node.type === 'decl') {
|
||||
return transformDecl(node, opts);
|
||||
return transformDecl(node);
|
||||
} else if (
|
||||
node.type === 'atrule' &&
|
||||
node.name.toLowerCase() === 'namespace'
|
||||
|
||||
153
node_modules/postcss-normalize-url/src/normalize.js
generated
vendored
Executable file
153
node_modules/postcss-normalize-url/src/normalize.js
generated
vendored
Executable file
@@ -0,0 +1,153 @@
|
||||
'use strict';
|
||||
/* Derived from normalize-url https://github.com/sindresorhus/normalize-url/main/index.js by Sindre Sorhus */
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
|
||||
const DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';
|
||||
const DATA_URL_DEFAULT_CHARSET = 'us-ascii';
|
||||
|
||||
const supportedProtocols = new Set(['https:', 'http:', 'file:']);
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
* @return {boolean} */
|
||||
function hasCustomProtocol(urlString) {
|
||||
try {
|
||||
const { protocol } = new URL(urlString);
|
||||
return protocol.endsWith(':') && !supportedProtocols.has(protocol);
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
* @return {string} */
|
||||
function normalizeDataURL(urlString) {
|
||||
const match = /^data:(?<type>[^,]*?),(?<data>[^#]*?)(?:#(?<hash>.*))?$/.exec(
|
||||
urlString
|
||||
);
|
||||
|
||||
if (!match) {
|
||||
throw new Error(`Invalid URL: ${urlString}`);
|
||||
}
|
||||
|
||||
let { type, data, hash } =
|
||||
/** @type {{type: string, data: string, hash: string}} */ (match.groups);
|
||||
const mediaType = type.split(';');
|
||||
|
||||
let isBase64 = false;
|
||||
if (mediaType[mediaType.length - 1] === 'base64') {
|
||||
mediaType.pop();
|
||||
isBase64 = true;
|
||||
}
|
||||
|
||||
// Lowercase MIME type
|
||||
const mimeType = mediaType.shift()?.toLowerCase() ?? '';
|
||||
const attributes = mediaType
|
||||
.map(
|
||||
/** @type {(string: string) => string} */ (attribute) => {
|
||||
let [key, value = ''] = attribute
|
||||
.split('=')
|
||||
.map(
|
||||
/** @type {(string: string) => string} */ (string) => string.trim()
|
||||
);
|
||||
|
||||
// Lowercase `charset`
|
||||
if (key === 'charset') {
|
||||
value = value.toLowerCase();
|
||||
|
||||
if (value === DATA_URL_DEFAULT_CHARSET) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
return `${key}${value ? `=${value}` : ''}`;
|
||||
}
|
||||
)
|
||||
.filter(Boolean);
|
||||
|
||||
const normalizedMediaType = [...attributes];
|
||||
|
||||
if (isBase64) {
|
||||
normalizedMediaType.push('base64');
|
||||
}
|
||||
|
||||
if (
|
||||
normalizedMediaType.length > 0 ||
|
||||
(mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)
|
||||
) {
|
||||
normalizedMediaType.unshift(mimeType);
|
||||
}
|
||||
|
||||
return `data:${normalizedMediaType.join(';')},${
|
||||
isBase64 ? data.trim() : data
|
||||
}${hash ? `#${hash}` : ''}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} urlString
|
||||
* @return {string}
|
||||
*/
|
||||
function normalizeUrl(urlString) {
|
||||
urlString = urlString.trim();
|
||||
|
||||
// Data URL
|
||||
if (/^data:/i.test(urlString)) {
|
||||
return normalizeDataURL(urlString);
|
||||
}
|
||||
|
||||
if (hasCustomProtocol(urlString)) {
|
||||
return urlString;
|
||||
}
|
||||
|
||||
const hasRelativeProtocol = urlString.startsWith('//');
|
||||
const isRelativeUrl = !hasRelativeProtocol && /^\.*\//.test(urlString);
|
||||
|
||||
// Prepend protocol
|
||||
if (!isRelativeUrl) {
|
||||
urlString = urlString.replace(/^(?!(?:\w+:)?\/\/)|^\/\//, 'http:');
|
||||
}
|
||||
|
||||
const urlObject = new URL(urlString);
|
||||
|
||||
// Remove duplicate slashes if not preceded by a protocol
|
||||
if (urlObject.pathname) {
|
||||
urlObject.pathname = urlObject.pathname.replace(
|
||||
/(?<!\b[a-z][a-z\d+\-.]{1,50}:)\/{2,}/g,
|
||||
'/'
|
||||
);
|
||||
}
|
||||
|
||||
// Decode URI octets
|
||||
if (urlObject.pathname) {
|
||||
try {
|
||||
urlObject.pathname = decodeURI(urlObject.pathname);
|
||||
} catch {
|
||||
/* Do nothing */
|
||||
}
|
||||
}
|
||||
|
||||
if (urlObject.hostname) {
|
||||
// Remove trailing dot
|
||||
urlObject.hostname = urlObject.hostname.replace(/\.$/, '');
|
||||
}
|
||||
|
||||
urlObject.pathname = urlObject.pathname.replace(/\/$/, '');
|
||||
|
||||
// Take advantage of many of the Node `url` normalizations
|
||||
urlString = urlObject.toString();
|
||||
|
||||
// Remove ending `/`
|
||||
if (urlObject.pathname === '/' && urlObject.hash === '') {
|
||||
urlString = urlString.replace(/\/$/, '');
|
||||
}
|
||||
|
||||
// Restore relative protocol
|
||||
if (hasRelativeProtocol) {
|
||||
urlString = urlString.replace(/^http:\/\//, '//');
|
||||
}
|
||||
|
||||
return urlString;
|
||||
}
|
||||
|
||||
module.exports = normalizeUrl;
|
||||
12
node_modules/postcss-normalize-url/types/index.d.ts
generated
vendored
12
node_modules/postcss-normalize-url/types/index.d.ts
generated
vendored
@@ -1,14 +1,10 @@
|
||||
export = pluginCreator;
|
||||
/** @typedef {normalize.Options} Options */
|
||||
/**
|
||||
* @type {import('postcss').PluginCreator<Options>}
|
||||
* @param {Options} opts
|
||||
* @type {import('postcss').PluginCreator<void>}
|
||||
* @return {import('postcss').Plugin}
|
||||
*/
|
||||
declare function pluginCreator(opts: Options): import('postcss').Plugin;
|
||||
declare function pluginCreator(): import("postcss").Plugin;
|
||||
declare namespace pluginCreator {
|
||||
export { postcss, Options };
|
||||
let postcss: true;
|
||||
}
|
||||
type Options = normalize.Options;
|
||||
declare var postcss: true;
|
||||
import normalize = require("normalize-url");
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/postcss-normalize-url/types/index.d.ts.map
generated
vendored
Executable file
1
node_modules/postcss-normalize-url/types/index.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":";AA8HA;;;GAGG;AACH,kCAFY,OAAO,SAAS,EAAE,MAAM,CAmBnC"}
|
||||
7
node_modules/postcss-normalize-url/types/normalize.d.ts
generated
vendored
Executable file
7
node_modules/postcss-normalize-url/types/normalize.d.ts
generated
vendored
Executable file
@@ -0,0 +1,7 @@
|
||||
export = normalizeUrl;
|
||||
/**
|
||||
* @param {string} urlString
|
||||
* @return {string}
|
||||
*/
|
||||
declare function normalizeUrl(urlString: string): string;
|
||||
//# sourceMappingURL=normalize.d.ts.map
|
||||
1
node_modules/postcss-normalize-url/types/normalize.d.ts.map
generated
vendored
Executable file
1
node_modules/postcss-normalize-url/types/normalize.d.ts.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../src/normalize.js"],"names":[],"mappings":";AAsFA;;;GAGG;AACH,yCAHW,MAAM,GACL,MAAM,CA8DjB"}
|
||||
Reference in New Issue
Block a user