@hyperframes/lint 0.8.208 → 0.8.210
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.js +1 -14
- package/dist/index.js +1 -14
- package/package.json +2 -2
package/dist/browser.js
CHANGED
|
@@ -6890,8 +6890,6 @@ var shaderRules = [
|
|
|
6890
6890
|
];
|
|
6891
6891
|
|
|
6892
6892
|
// src/rules/rootPaths.ts
|
|
6893
|
-
var URL_ATTRS = ["src", "href", "poster", "xlink:href"];
|
|
6894
|
-
var ROOT_PATH = /^\/(?!\/)/;
|
|
6895
6893
|
var CSS_ROOT_URL = /\burl\(\s*["']?(\/(?!\/)[^"')\s]*)/g;
|
|
6896
6894
|
var SCRIPT_ROOT_URL = /\b(?:fetch|new\s+URL)\(\s*(["'`])(\/(?!\/)[^"'`$]*)\1/g;
|
|
6897
6895
|
function relativeForm(path, cssFile) {
|
|
@@ -6912,16 +6910,6 @@ function cssRootPaths(css, cssFile) {
|
|
|
6912
6910
|
(match) => rootPathFinding(match[1] ?? "", cssFile, match[0])
|
|
6913
6911
|
);
|
|
6914
6912
|
}
|
|
6915
|
-
function tagRootPaths(tag) {
|
|
6916
|
-
if (tag.name === "a" || tag.name === "base") return [];
|
|
6917
|
-
const paths = URL_ATTRS.map((attr) => readAttr(tag.raw, attr)?.trim() ?? "").filter(
|
|
6918
|
-
(value) => ROOT_PATH.test(value)
|
|
6919
|
-
);
|
|
6920
|
-
return [
|
|
6921
|
-
...paths.map((path) => rootPathFinding(path, void 0, tag.raw)),
|
|
6922
|
-
...cssRootPaths(readAttr(tag.raw, "style") ?? "")
|
|
6923
|
-
];
|
|
6924
|
-
}
|
|
6925
6913
|
var scriptRootPaths = (script) => [...script.matchAll(SCRIPT_ROOT_URL)].map(
|
|
6926
6914
|
(match) => rootPathFinding(match[2] ?? "", void 0, match[0])
|
|
6927
6915
|
);
|
|
@@ -6944,8 +6932,7 @@ function invalidImportMap(script) {
|
|
|
6944
6932
|
}
|
|
6945
6933
|
var rootPathRules = [
|
|
6946
6934
|
(ctx) => [
|
|
6947
|
-
...ctx.
|
|
6948
|
-
...ctx.styles.flatMap((style) => cssRootPaths(style.content, style.rootRelativePath)),
|
|
6935
|
+
...ctx.styles.filter((style) => style.rootRelativePath).flatMap((style) => cssRootPaths(style.content, style.rootRelativePath)),
|
|
6949
6936
|
...ctx.scripts.flatMap((script) => scriptRootPaths(script.content)),
|
|
6950
6937
|
...ctx.scripts.flatMap(invalidImportMap)
|
|
6951
6938
|
]
|
package/dist/index.js
CHANGED
|
@@ -6896,8 +6896,6 @@ var shaderRules = [
|
|
|
6896
6896
|
];
|
|
6897
6897
|
|
|
6898
6898
|
// src/rules/rootPaths.ts
|
|
6899
|
-
var URL_ATTRS = ["src", "href", "poster", "xlink:href"];
|
|
6900
|
-
var ROOT_PATH = /^\/(?!\/)/;
|
|
6901
6899
|
var CSS_ROOT_URL = /\burl\(\s*["']?(\/(?!\/)[^"')\s]*)/g;
|
|
6902
6900
|
var SCRIPT_ROOT_URL = /\b(?:fetch|new\s+URL)\(\s*(["'`])(\/(?!\/)[^"'`$]*)\1/g;
|
|
6903
6901
|
function relativeForm(path, cssFile) {
|
|
@@ -6918,16 +6916,6 @@ function cssRootPaths(css, cssFile) {
|
|
|
6918
6916
|
(match) => rootPathFinding(match[1] ?? "", cssFile, match[0])
|
|
6919
6917
|
);
|
|
6920
6918
|
}
|
|
6921
|
-
function tagRootPaths(tag) {
|
|
6922
|
-
if (tag.name === "a" || tag.name === "base") return [];
|
|
6923
|
-
const paths = URL_ATTRS.map((attr) => readAttr(tag.raw, attr)?.trim() ?? "").filter(
|
|
6924
|
-
(value) => ROOT_PATH.test(value)
|
|
6925
|
-
);
|
|
6926
|
-
return [
|
|
6927
|
-
...paths.map((path) => rootPathFinding(path, void 0, tag.raw)),
|
|
6928
|
-
...cssRootPaths(readAttr(tag.raw, "style") ?? "")
|
|
6929
|
-
];
|
|
6930
|
-
}
|
|
6931
6919
|
var scriptRootPaths = (script) => [...script.matchAll(SCRIPT_ROOT_URL)].map(
|
|
6932
6920
|
(match) => rootPathFinding(match[2] ?? "", void 0, match[0])
|
|
6933
6921
|
);
|
|
@@ -6950,8 +6938,7 @@ function invalidImportMap(script) {
|
|
|
6950
6938
|
}
|
|
6951
6939
|
var rootPathRules = [
|
|
6952
6940
|
(ctx) => [
|
|
6953
|
-
...ctx.
|
|
6954
|
-
...ctx.styles.flatMap((style) => cssRootPaths(style.content, style.rootRelativePath)),
|
|
6941
|
+
...ctx.styles.filter((style) => style.rootRelativePath).flatMap((style) => cssRootPaths(style.content, style.rootRelativePath)),
|
|
6955
6942
|
...ctx.scripts.flatMap((script) => scriptRootPaths(script.content)),
|
|
6956
6943
|
...ctx.scripts.flatMap(invalidImportMap)
|
|
6957
6944
|
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/lint",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.210",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"linkedom": "^0.18.12",
|
|
36
36
|
"postcss": "^8.5.8",
|
|
37
37
|
"postcss-selector-parser": "^7.1.4",
|
|
38
|
-
"@hyperframes/parsers": "0.8.
|
|
38
|
+
"@hyperframes/parsers": "0.8.210"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^25.0.10",
|