@atlaspack/transformer-html 2.12.1-dev.3443 → 2.12.1-dev.3478
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/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@atlaspack/transformer-html",
|
3
|
-
"version": "2.12.1-dev.
|
3
|
+
"version": "2.12.1-dev.3478+5fd2da535",
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -16,12 +16,12 @@
|
|
16
16
|
"source": "src/HTMLTransformer.js",
|
17
17
|
"engines": {
|
18
18
|
"node": ">= 16.0.0",
|
19
|
-
"parcel": "^2.12.1-dev.
|
19
|
+
"parcel": "^2.12.1-dev.3478+5fd2da535"
|
20
20
|
},
|
21
21
|
"dependencies": {
|
22
|
-
"@atlaspack/diagnostic": "2.12.1-dev.
|
23
|
-
"@atlaspack/plugin": "2.12.1-dev.
|
24
|
-
"@atlaspack/rust": "2.12.1-dev.
|
22
|
+
"@atlaspack/diagnostic": "2.12.1-dev.3478+5fd2da535",
|
23
|
+
"@atlaspack/plugin": "2.12.1-dev.3478+5fd2da535",
|
24
|
+
"@atlaspack/rust": "2.12.1-dev.3478+5fd2da535",
|
25
25
|
"nullthrows": "^1.1.1",
|
26
26
|
"posthtml": "^0.16.5",
|
27
27
|
"posthtml-parser": "^0.10.1",
|
@@ -30,7 +30,7 @@
|
|
30
30
|
"srcset": "4"
|
31
31
|
},
|
32
32
|
"devDependencies": {
|
33
|
-
"@atlaspack/core": "2.12.1-dev.
|
33
|
+
"@atlaspack/core": "2.12.1-dev.3478+5fd2da535"
|
34
34
|
},
|
35
|
-
"gitHead": "
|
35
|
+
"gitHead": "5fd2da535ecbe096d57e03aec15e80bb1d7601f7"
|
36
36
|
}
|
package/src/HTMLTransformer.js
CHANGED
@@ -49,7 +49,7 @@ export const transformerOpts: TransformerOpts<void> = {
|
|
49
49
|
} catch (errors) {
|
50
50
|
if (Array.isArray(errors)) {
|
51
51
|
throw new ThrowableDiagnostic({
|
52
|
-
diagnostic: errors.map(error => ({
|
52
|
+
diagnostic: errors.map((error) => ({
|
53
53
|
message: error.message,
|
54
54
|
origin: '@atlaspack/transformer-html',
|
55
55
|
codeFrames: [
|
@@ -122,7 +122,7 @@ function findFirstMatch(
|
|
122
122
|
let found;
|
123
123
|
|
124
124
|
for (const expression of expressions) {
|
125
|
-
PostHTML().match.call(ast.program, expression, node => {
|
125
|
+
PostHTML().match.call(ast.program, expression, (node) => {
|
126
126
|
found = node;
|
127
127
|
return node;
|
128
128
|
});
|
package/src/dependencies.js
CHANGED
@@ -113,7 +113,7 @@ export default function collectDependencies(
|
|
113
113
|
filePath: FilePath,
|
114
114
|
loc: PostHTMLNode['location'],
|
115
115
|
|}> = [];
|
116
|
-
PostHTML().walk.call(ast.program, node => {
|
116
|
+
PostHTML().walk.call(ast.program, (node) => {
|
117
117
|
let {tag, attrs} = node;
|
118
118
|
if (!attrs || seen.has(node)) {
|
119
119
|
return node;
|
@@ -122,7 +122,7 @@ export default function collectDependencies(
|
|
122
122
|
seen.add(node);
|
123
123
|
|
124
124
|
if (tag === 'meta') {
|
125
|
-
const isMetaDependency = Object.keys(attrs).some(attr => {
|
125
|
+
const isMetaDependency = Object.keys(attrs).some((attr) => {
|
126
126
|
let values = META[attr];
|
127
127
|
return (
|
128
128
|
values &&
|
@@ -11,8 +11,8 @@ function normalizeHTML(code: string): string {
|
|
11
11
|
const result = renderHTML(ast);
|
12
12
|
const lines = result
|
13
13
|
.split('\n')
|
14
|
-
.map(line => line.trim())
|
15
|
-
.filter(line => line);
|
14
|
+
.map((line) => line.trim())
|
15
|
+
.filter((line) => line);
|
16
16
|
return lines.join('');
|
17
17
|
}
|
18
18
|
|
@@ -38,7 +38,7 @@ async function runTestTransform(
|
|
38
38
|
let newAST = null;
|
39
39
|
const asset = {
|
40
40
|
getAST: () => parseHTML(code, true),
|
41
|
-
setAST: n => {
|
41
|
+
setAST: (n) => {
|
42
42
|
newAST = n;
|
43
43
|
},
|
44
44
|
addURLDependency(url, opts) {
|
@@ -75,7 +75,7 @@ async function runTestTransform(
|
|
75
75
|
}
|
76
76
|
|
77
77
|
function normalizeDependencies(dependencies) {
|
78
|
-
return dependencies.map(dependency => ({
|
78
|
+
return dependencies.map((dependency) => ({
|
79
79
|
...dependency,
|
80
80
|
opts: {
|
81
81
|
...dependency.opts,
|
@@ -89,7 +89,7 @@ function normalizeDependencies(dependencies) {
|
|
89
89
|
}
|
90
90
|
|
91
91
|
function normalizeAssets(assets) {
|
92
|
-
return assets.map(asset => {
|
92
|
+
return assets.map((asset) => {
|
93
93
|
// $FlowFixMe
|
94
94
|
return {
|
95
95
|
...asset,
|