pairit 0.3.9 → 0.3.10
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 +20 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10444,7 +10444,7 @@ function lintEndRedirectUrls(config) {
|
|
|
10444
10444
|
|
|
10445
10445
|
// src/index.ts
|
|
10446
10446
|
var program2 = new Command;
|
|
10447
|
-
program2.name("pairit").description("CLI for Pairit experiment configs").version("0.3.
|
|
10447
|
+
program2.name("pairit").description("CLI for Pairit experiment configs").version("0.3.10").option("--env <name>", "Target environment: staging or production", (value) => {
|
|
10448
10448
|
try {
|
|
10449
10449
|
return parseEnvName(value);
|
|
10450
10450
|
} catch (error) {
|
|
@@ -10770,11 +10770,29 @@ async function lintConfig(configPath) {
|
|
|
10770
10770
|
if (!page.id) {
|
|
10771
10771
|
errors.push(`pages[${index}] is missing id`);
|
|
10772
10772
|
}
|
|
10773
|
+
const width = page?.width;
|
|
10774
|
+
if (width !== undefined && width !== "default" && width !== "wide") {
|
|
10775
|
+
errors.push(`pages[${index}].width must be "default" or "wide"`);
|
|
10776
|
+
}
|
|
10777
|
+
const pageHeight = page?.height;
|
|
10778
|
+
if (pageHeight !== undefined && (typeof pageHeight !== "number" || !Number.isFinite(pageHeight) || pageHeight <= 0)) {
|
|
10779
|
+
errors.push(`pages[${index}].height must be a positive number`);
|
|
10780
|
+
}
|
|
10773
10781
|
page.components?.forEach((component, componentIndex) => {
|
|
10774
|
-
const
|
|
10782
|
+
const comp = component;
|
|
10783
|
+
const column = comp?.column;
|
|
10775
10784
|
if (column !== undefined && column !== "left" && column !== "right") {
|
|
10776
10785
|
errors.push(`pages[${index}].components[${componentIndex}].column must be "left" or "right"`);
|
|
10777
10786
|
}
|
|
10787
|
+
if (comp?.type === "html" && comp.props) {
|
|
10788
|
+
const { height, borderless } = comp.props;
|
|
10789
|
+
if (height !== undefined && height !== "auto" && (typeof height !== "number" || !Number.isFinite(height) || height <= 0)) {
|
|
10790
|
+
errors.push(`pages[${index}].components[${componentIndex}].props.height must be "auto" or a positive number`);
|
|
10791
|
+
}
|
|
10792
|
+
if (borderless !== undefined && typeof borderless !== "boolean") {
|
|
10793
|
+
errors.push(`pages[${index}].components[${componentIndex}].props.borderless must be a boolean`);
|
|
10794
|
+
}
|
|
10795
|
+
}
|
|
10778
10796
|
});
|
|
10779
10797
|
});
|
|
10780
10798
|
}
|