@xylabs/ts-scripts-yarn3 7.0.1 → 7.0.3

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.
@@ -2330,6 +2330,31 @@ var packageLint = /* @__PURE__ */ __name(async (fix2 = false, verbose = false, c
2330
2330
  import { promises as fs4 } from "fs";
2331
2331
  import chalk32 from "chalk";
2332
2332
  import sortPackageJson from "sort-package-json";
2333
+ var customPubLint = /* @__PURE__ */ __name((pkg) => {
2334
+ let errorCount = 0;
2335
+ let warningCount = 0;
2336
+ if (pkg.files === void 0) {
2337
+ console.warn(chalk32.yellow('Publint [custom]: "files" field is missing'));
2338
+ warningCount++;
2339
+ }
2340
+ if (pkg.main !== void 0) {
2341
+ console.warn(chalk32.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
2342
+ warningCount++;
2343
+ }
2344
+ if (pkg.sideEffects !== false) {
2345
+ console.warn(chalk32.yellow('Publint [custom]: "sideEffects" field should be set to false'));
2346
+ warningCount++;
2347
+ }
2348
+ if (pkg.resolutions !== void 0) {
2349
+ console.warn(chalk32.yellow('Publint [custom]: "resolutions" in use'));
2350
+ console.warn(chalk32.gray(JSON.stringify(pkg.resolutions, null, 2)));
2351
+ warningCount++;
2352
+ }
2353
+ return [
2354
+ errorCount,
2355
+ warningCount
2356
+ ];
2357
+ }, "customPubLint");
2333
2358
  var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = false } = {}) => {
2334
2359
  const pkgDir = process.env.INIT_CWD;
2335
2360
  const sortedPkg = sortPackageJson(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
@@ -2344,11 +2369,7 @@ var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = fa
2344
2369
  strict
2345
2370
  });
2346
2371
  const { formatMessage } = await import("publint/utils");
2347
- const validMessage = /* @__PURE__ */ __name((_message) => {
2348
- return true;
2349
- }, "validMessage");
2350
- const validMessages = messages.filter(validMessage);
2351
- for (const message of validMessages) {
2372
+ for (const message of messages) {
2352
2373
  switch (message.type) {
2353
2374
  case "error": {
2354
2375
  console.error(chalk32.red(`[${message.code}] ${formatMessage(message, pkg)}`));
@@ -2364,10 +2385,11 @@ var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = fa
2364
2385
  }
2365
2386
  }
2366
2387
  }
2388
+ const [errorCount, warningCount] = customPubLint(pkg);
2367
2389
  if (verbose) {
2368
- console.log(chalk32.gray(`Publint [Finish]: ${pkgDir} [${validMessages.length}]`));
2390
+ console.log(chalk32.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
2369
2391
  }
2370
- return validMessages.filter((message) => message.type === "error").length;
2392
+ return messages.filter((message) => message.type === "error").length + errorCount;
2371
2393
  }, "packagePublint");
2372
2394
 
2373
2395
  // src/actions/package/recompile.ts