@webstudio-is/sdk 0.143.0 → 0.144.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/lib/index.js +13 -1
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -600,6 +600,12 @@ var lintExpression = ({
|
|
|
600
600
|
};
|
|
601
601
|
};
|
|
602
602
|
if (expression.trim().length === 0) {
|
|
603
|
+
diagnostics.push({
|
|
604
|
+
from: 0,
|
|
605
|
+
to: 0,
|
|
606
|
+
severity: "error",
|
|
607
|
+
message: "Expression cannot be empty"
|
|
608
|
+
});
|
|
603
609
|
return diagnostics;
|
|
604
610
|
}
|
|
605
611
|
try {
|
|
@@ -730,7 +736,13 @@ var transpileExpression = ({
|
|
|
730
736
|
executable = false,
|
|
731
737
|
replaceVariable
|
|
732
738
|
}) => {
|
|
733
|
-
|
|
739
|
+
let root;
|
|
740
|
+
try {
|
|
741
|
+
root = parseExpressionAt(expression, 0, { ecmaVersion: "latest" });
|
|
742
|
+
} catch (error) {
|
|
743
|
+
const message = error.message;
|
|
744
|
+
throw Error(`${message} in ${JSON.stringify(expression)}`);
|
|
745
|
+
}
|
|
734
746
|
const replacements = [];
|
|
735
747
|
const replaceIdentifier = (node, assignee) => {
|
|
736
748
|
const newName = replaceVariable?.(node.name, assignee);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.144.0",
|
|
4
4
|
"description": "Webstudio project data schema",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
"acorn": "^8.11.3",
|
|
22
22
|
"acorn-walk": "^8.3.2",
|
|
23
23
|
"zod": "^3.22.4",
|
|
24
|
-
"@webstudio-is/css-engine": "0.
|
|
25
|
-
"@webstudio-is/fonts": "0.
|
|
24
|
+
"@webstudio-is/css-engine": "0.144.0",
|
|
25
|
+
"@webstudio-is/fonts": "0.144.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@jest/globals": "^29.7.0",
|
|
29
|
-
"@webstudio-is/
|
|
30
|
-
"@webstudio-is/
|
|
29
|
+
"@webstudio-is/tsconfig": "1.0.7",
|
|
30
|
+
"@webstudio-is/jest-config": "1.0.7"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"typecheck": "tsc",
|