@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.
Files changed (2) hide show
  1. package/bin/package.json.ts +17 -13
  2. package/package.json +1 -1
@@ -398,20 +398,24 @@ field(["type"], "string", {
398
398
  'Type must be `"module"`.': (type: string) => type === "module",
399
399
  },
400
400
  });
401
- if ("main" in packageJSON || "types" in packageJSON) {
402
- field(["main"], "string", {
403
- mustBePopulatedMessage: 'Must be populated if "types" is populated.',
404
- });
405
- field(["types"], "string", {
406
- mustBePopulatedMessage: 'Must be populated if "main" is populated.',
407
- });
408
- } else {
409
- console.log("☑️ .main");
410
- console.log("☑️ .types");
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 okay.`;
649
+ return `✅ ${breadcrumbString} — Key set and ordering is OK.`;
646
650
  }
647
651
  }
648
652
  })(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cubing/dev-config",
3
- "version": "0.6.5",
3
+ "version": "0.6.6",
4
4
  "description": "Common dev configs for projects.",
5
5
  "author": {
6
6
  "name": "Lucas Garron",