@multiplatform.one/config 7.37.0 → 7.39.0
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/design-lint.mjs +17 -0
- package/package.json +2 -2
package/design-lint.mjs
CHANGED
|
@@ -63,6 +63,7 @@ export const designRules = [
|
|
|
63
63
|
"geometry",
|
|
64
64
|
"inline-spacing",
|
|
65
65
|
"raw-control",
|
|
66
|
+
"raw-icon",
|
|
66
67
|
"styled-mpo",
|
|
67
68
|
"token-file",
|
|
68
69
|
];
|
|
@@ -99,6 +100,10 @@ export function inspectDesign(source, filename) {
|
|
|
99
100
|
}
|
|
100
101
|
const mpoComponent = (node) =>
|
|
101
102
|
importedFrom(node, (specifier) => specifier.startsWith("@multiplatform.one/"));
|
|
103
|
+
const rawIcon = (node) =>
|
|
104
|
+
importedFrom(node, (specifier) =>
|
|
105
|
+
/^(?:@phosphor-icons\/react(?:\/.*)?|phosphor-react-native)$/.test(specifier),
|
|
106
|
+
);
|
|
102
107
|
const fromSvg = (node) =>
|
|
103
108
|
importedFrom(node, (specifier) => /^(?:@tamagui\/)?react-native-svg$/.test(specifier));
|
|
104
109
|
function svgTag(tag, set) {
|
|
@@ -249,6 +254,18 @@ export function inspectDesign(source, filename) {
|
|
|
249
254
|
});
|
|
250
255
|
}
|
|
251
256
|
function visit(node) {
|
|
257
|
+
const icon =
|
|
258
|
+
ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)
|
|
259
|
+
? node.tagName
|
|
260
|
+
: ts.isCallExpression(node) && referenceName(node.expression) === "createElement"
|
|
261
|
+
? node.arguments[0]
|
|
262
|
+
: undefined;
|
|
263
|
+
if (icon && rawIcon(icon))
|
|
264
|
+
report(
|
|
265
|
+
node,
|
|
266
|
+
"raw-icon",
|
|
267
|
+
"Wrap Phosphor icons in themed() before rendering, or pass the component to an MPO icon slot.",
|
|
268
|
+
);
|
|
252
269
|
if (
|
|
253
270
|
!tokenFile &&
|
|
254
271
|
ts.isCallExpression(node) &&
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.39.0",
|
|
4
4
|
"description": "Shared build and test configuration presets for multiplatform.one",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"access": "public"
|
|
105
105
|
},
|
|
106
106
|
"dependencies": {
|
|
107
|
-
"@multiplatform.one/utils": "^7.
|
|
107
|
+
"@multiplatform.one/utils": "^7.39.0",
|
|
108
108
|
"@tamagui/vite-plugin": "2.7.6",
|
|
109
109
|
"@vitejs/plugin-react": "^6.1.2",
|
|
110
110
|
"dotenv": "^17.4.2",
|