@plumeria/turbopack-loader 18.5.1 → 18.5.2
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/index.js +24 -30
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -130,6 +130,8 @@ const destructuredPropAliases = (fn) => {
|
|
|
130
130
|
}
|
|
131
131
|
return aliases;
|
|
132
132
|
};
|
|
133
|
+
const propDefaultMessage = (source) => `Plumeria: A style prop default must be a defined style: "${source}". ` +
|
|
134
|
+
`Apply a conditional or dynamic style where the element is styled.`;
|
|
133
135
|
const spreadStyleMessage = (source) => `Plumeria: Spread elements in a style array are not supported: "...${source}". ` +
|
|
134
136
|
`List each style explicitly.`;
|
|
135
137
|
const resolveLocalStyleAlias = (aliases, expression) => {
|
|
@@ -1443,37 +1445,29 @@ async function loader(source) {
|
|
|
1443
1445
|
possibilities = candidates;
|
|
1444
1446
|
}
|
|
1445
1447
|
const fallback = owner && propDefaults.get(owner)?.get(propName);
|
|
1446
|
-
if (fallback) {
|
|
1448
|
+
if (fallback && !isNoOpStyle((0, utils_1.unwrapExpression)(fallback))) {
|
|
1447
1449
|
const style = resolveStyleObject(fallback);
|
|
1448
|
-
if (style)
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
const
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
end: span.end - baseByteOffset,
|
|
1470
|
-
content: JSON.stringify(key),
|
|
1471
|
-
});
|
|
1472
|
-
}
|
|
1473
|
-
}
|
|
1474
|
-
else {
|
|
1475
|
-
assertResolvable(fallback);
|
|
1476
|
-
}
|
|
1450
|
+
if (!style)
|
|
1451
|
+
throwCompilationError(propDefaultMessage(getSource(fallback)), fallback);
|
|
1452
|
+
const atoms = {};
|
|
1453
|
+
(0, utils_1.getStyleRecords)(style).forEach((record) => {
|
|
1454
|
+
atoms[record.key] = record.hash;
|
|
1455
|
+
});
|
|
1456
|
+
const key = (0, zss_engine_1.genBase36Hash)(Object.values(atoms).join(' '), 1, 8);
|
|
1457
|
+
possibilities = [...(possibilities ?? []), { key, styleObj: style }];
|
|
1458
|
+
const span = fallback.span;
|
|
1459
|
+
for (let index = replacements.length - 1; index >= 0; index--) {
|
|
1460
|
+
const replacement = replacements[index];
|
|
1461
|
+
if (replacement.start >= span.start - baseByteOffset &&
|
|
1462
|
+
replacement.end <= span.end - baseByteOffset)
|
|
1463
|
+
replacements.splice(index, 1);
|
|
1464
|
+
}
|
|
1465
|
+
excludeSubtreeSpans(fallback);
|
|
1466
|
+
replacements.push({
|
|
1467
|
+
start: span.start - baseByteOffset,
|
|
1468
|
+
end: span.end - baseByteOffset,
|
|
1469
|
+
content: JSON.stringify(key),
|
|
1470
|
+
});
|
|
1477
1471
|
}
|
|
1478
1472
|
if (!possibilities || possibilities.length === 0) {
|
|
1479
1473
|
return Boolean(isPropsMember || (owner && declaredProps.get(owner)?.has(propName)));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/turbopack-loader",
|
|
3
|
-
"version": "18.5.
|
|
3
|
+
"version": "18.5.2",
|
|
4
4
|
"description": "Plumeria Turbopack-loader",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"zero-virtual.css"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@plumeria/compiler": "^18.5.
|
|
33
|
-
"@plumeria/utils": "^18.5.
|
|
32
|
+
"@plumeria/compiler": "^18.5.2",
|
|
33
|
+
"@plumeria/utils": "^18.5.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@swc/core": "1.15.47",
|