@cubing/dev-config 0.6.5 → 0.6.6
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/bin/package.json.ts +17 -13
- package/package.json +1 -1
package/bin/package.json.ts
CHANGED
|
@@ -398,20 +398,24 @@ field(["type"], "string", {
|
|
|
398
398
|
'Type must be `"module"`.': (type: string) => type === "module",
|
|
399
399
|
},
|
|
400
400
|
});
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
401
|
+
const mainOrTypesArePopoulated = (() => {
|
|
402
|
+
if ("main" in packageJSON || "types" in packageJSON) {
|
|
403
|
+
field(["main"], "string", {
|
|
404
|
+
mustBePopulatedMessage: 'Must be populated if "types" is populated.',
|
|
405
|
+
});
|
|
406
|
+
field(["types"], "string", {
|
|
407
|
+
mustBePopulatedMessage: 'Must be populated if "main" is populated.',
|
|
408
|
+
});
|
|
409
|
+
return true;
|
|
410
|
+
} else {
|
|
411
|
+
console.log("☑️ .main");
|
|
412
|
+
console.log("☑️ .types");
|
|
413
|
+
return false;
|
|
414
|
+
}
|
|
415
|
+
})();
|
|
412
416
|
mustNotBePopulated(["module"]);
|
|
413
417
|
mustNotBePopulated(["browser"]);
|
|
414
|
-
field(["exports"], "object");
|
|
418
|
+
field(["exports"], "object", { optional: !mainOrTypesArePopoulated });
|
|
415
419
|
field(["bin"], "object", { optional: true });
|
|
416
420
|
field(["dependencies"], "object", { optional: true });
|
|
417
421
|
field(["devDependencies"], "object", { optional: true });
|
|
@@ -642,7 +646,7 @@ if (exports) {
|
|
|
642
646
|
...fixingLines,
|
|
643
647
|
].join("\n");
|
|
644
648
|
} else {
|
|
645
|
-
return `✅ ${breadcrumbString} — Key set and ordering is
|
|
649
|
+
return `✅ ${breadcrumbString} — Key set and ordering is OK.`;
|
|
646
650
|
}
|
|
647
651
|
}
|
|
648
652
|
})(),
|