@xylabs/ts-scripts-yarn3 7.0.1 → 7.0.2
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/actions/index.mjs +24 -7
- package/dist/actions/index.mjs.map +1 -1
- package/dist/actions/package/index.mjs +24 -7
- package/dist/actions/package/index.mjs.map +1 -1
- package/dist/actions/package/publint.mjs +24 -7
- package/dist/actions/package/publint.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +24 -7
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/index.mjs +24 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +9 -11
package/dist/actions/index.mjs
CHANGED
|
@@ -2330,6 +2330,26 @@ 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.error(chalk32.yellow('Publint [custom]: "files" field is missing'));
|
|
2338
|
+
warningCount++;
|
|
2339
|
+
}
|
|
2340
|
+
if (pkg.main !== void 0) {
|
|
2341
|
+
console.error(chalk32.yellow('Publint [custom]: "main" field is deprecated, use "exports" instead'));
|
|
2342
|
+
warningCount++;
|
|
2343
|
+
}
|
|
2344
|
+
if (pkg.sideEffects !== false) {
|
|
2345
|
+
console.error(chalk32.yellow('Publint [custom]: "sideEffects" field should be set to false'));
|
|
2346
|
+
warningCount++;
|
|
2347
|
+
}
|
|
2348
|
+
return [
|
|
2349
|
+
errorCount,
|
|
2350
|
+
warningCount
|
|
2351
|
+
];
|
|
2352
|
+
}, "customPubLint");
|
|
2333
2353
|
var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = false } = {}) => {
|
|
2334
2354
|
const pkgDir = process.env.INIT_CWD;
|
|
2335
2355
|
const sortedPkg = sortPackageJson(await fs4.readFile(`${pkgDir}/package.json`, "utf8"));
|
|
@@ -2344,11 +2364,7 @@ var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = fa
|
|
|
2344
2364
|
strict
|
|
2345
2365
|
});
|
|
2346
2366
|
const { formatMessage } = await import("publint/utils");
|
|
2347
|
-
const
|
|
2348
|
-
return true;
|
|
2349
|
-
}, "validMessage");
|
|
2350
|
-
const validMessages = messages.filter(validMessage);
|
|
2351
|
-
for (const message of validMessages) {
|
|
2367
|
+
for (const message of messages) {
|
|
2352
2368
|
switch (message.type) {
|
|
2353
2369
|
case "error": {
|
|
2354
2370
|
console.error(chalk32.red(`[${message.code}] ${formatMessage(message, pkg)}`));
|
|
@@ -2364,10 +2380,11 @@ var packagePublint = /* @__PURE__ */ __name(async ({ strict = true, verbose = fa
|
|
|
2364
2380
|
}
|
|
2365
2381
|
}
|
|
2366
2382
|
}
|
|
2383
|
+
const [errorCount, warningCount] = customPubLint(pkg);
|
|
2367
2384
|
if (verbose) {
|
|
2368
|
-
console.log(chalk32.gray(`Publint [Finish]: ${pkgDir} [${
|
|
2385
|
+
console.log(chalk32.gray(`Publint [Finish]: ${pkgDir} [${messages.length + errorCount + warningCount} messages]`));
|
|
2369
2386
|
}
|
|
2370
|
-
return
|
|
2387
|
+
return messages.filter((message) => message.type === "error").length + errorCount;
|
|
2371
2388
|
}, "packagePublint");
|
|
2372
2389
|
|
|
2373
2390
|
// src/actions/package/recompile.ts
|