@antelopejs/tooling-configs 0.2.0 → 0.2.1

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { a as repositoryRoot, i as repositoryPath, o as runCli, t as authoredSizes } from "../files-BSl0U8lT.mjs";
3
- import { t as checkSize } from "../size-DRCgYCLA.mjs";
2
+ import { a as repositoryRoot, i as repositoryPath, o as runCli, t as authoredSizes } from "../files-Bocv-qA8.mjs";
3
+ import { t as checkSize } from "../size-DJ7YSry_.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  import { join, resolve } from "node:path";
6
6
  import { spawnSync } from "node:child_process";
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { a as repositoryRoot, o as runCli } from "../files-BSl0U8lT.mjs";
2
+ import { a as repositoryRoot, o as runCli } from "../files-Bocv-qA8.mjs";
3
3
  import { i as parseManifest, r as packageManager } from "../package-B1aipTbn.mjs";
4
4
  import { readFileSync } from "node:fs";
5
5
  import { join } from "node:path";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { o as readCeilings } from "../ceilings--pJmhSde.mjs";
3
- import { a as repositoryRoot, i as repositoryPath, o as runCli } from "../files-BSl0U8lT.mjs";
4
- import { n as ratchet, r as lintDiagnostics } from "../ratchet-DNsVZH9s.mjs";
3
+ import { a as repositoryRoot, i as repositoryPath, o as runCli } from "../files-Bocv-qA8.mjs";
4
+ import { n as ratchet, r as lintDiagnostics } from "../ratchet-B2-4XxAl.mjs";
5
5
  import { resolve } from "node:path";
6
6
  import { execFileSync } from "node:child_process";
7
7
  import { parseArgs } from "node:util";
package/dist/bin/sync.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { a as formatCeilings, t as CEILINGS_FILE } from "../ceilings--pJmhSde.mjs";
3
- import { a as repositoryRoot, o as runCli } from "../files-BSl0U8lT.mjs";
3
+ import { a as repositoryRoot, o as runCli } from "../files-Bocv-qA8.mjs";
4
4
  import { a as repositoryTools, i as parseManifest, n as managedPackage, o as toolingVersions, r as packageManager, t as execCommand } from "../package-B1aipTbn.mjs";
5
- import { t as measureBaseline } from "../ratchet-DNsVZH9s.mjs";
5
+ import { t as measureBaseline } from "../ratchet-B2-4XxAl.mjs";
6
6
  import { chmodSync, existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, readlinkSync, statSync, unlinkSync, writeFileSync } from "node:fs";
7
7
  import { dirname, join, resolve } from "node:path";
8
8
  import { parseArgs } from "node:util";
@@ -84,11 +84,16 @@ function fileBytes(root, file, staged = false) {
84
84
  const stat = lstatSync(path);
85
85
  return stat.isFile() ? stat.size : void 0;
86
86
  }
87
+ /** `path.matchesGlob` never lets `*` or `**` cross a segment starting with a dot, so each path is also tried with those dots removed. */
88
+ function isExcluded(file) {
89
+ const undotted = file.replace(/(^|\/)\./gu, "$1");
90
+ return SIZE_EXCLUSIONS.some(({ patterns }) => patterns.some((pattern) => matchesGlob(file, pattern) || matchesGlob(undotted, pattern)));
91
+ }
87
92
  function authoredSizes(root, files = gitFiles(root), staged = false) {
88
93
  const sizes = /* @__PURE__ */ new Map();
89
94
  for (const input of files) {
90
95
  const file = repositoryPath(root, input);
91
- if (SIZE_EXCLUSIONS.some(({ patterns }) => patterns.some((pattern) => matchesGlob(file, pattern)))) continue;
96
+ if (isExcluded(file)) continue;
92
97
  const size = fileBytes(root, file, staged);
93
98
  if (size !== void 0) sizes.set(file, size);
94
99
  }
@@ -1,6 +1,6 @@
1
1
  import { a as formatCeilings, n as MAX_FILE_BYTES, o as readCeilings, r as MEASURE_ENV, t as CEILINGS_FILE } from "./ceilings--pJmhSde.mjs";
2
- import { i as repositoryPath, n as fileBytes, r as gitFiles, t as authoredSizes } from "./files-BSl0U8lT.mjs";
3
- import { n as sizeFailure } from "./size-DRCgYCLA.mjs";
2
+ import { i as repositoryPath, n as fileBytes, r as gitFiles, t as authoredSizes } from "./files-Bocv-qA8.mjs";
3
+ import { n as sizeFailure } from "./size-DJ7YSry_.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { existsSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
6
6
  import { basename, dirname, join } from "node:path";
@@ -1,5 +1,5 @@
1
1
  import { o as readCeilings } from "./ceilings--pJmhSde.mjs";
2
- import { t as authoredSizes } from "./files-BSl0U8lT.mjs";
2
+ import { t as authoredSizes } from "./files-Bocv-qA8.mjs";
3
3
  //#region src/guardrails/size.ts
4
4
  function sizeFailure(file, size, limit) {
5
5
  return `${file}: ${size} bytes, ${size - limit} bytes over the ${limit}-byte ceiling. Split by responsibility into sibling modules, one cohesive group of exports each; keep the original path re-exporting only if it is a public entry point. Split a test file by behaviour under test, one file per describe. Do not minify, strip whitespace, or move code under an excluded path to pass.`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antelopejs/tooling-configs",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Shared tooling presets for AntelopeJS repositories: oxlint (with the vendored anti-slop rules), oxfmt, ESLint for Nuxt layers, Knip, and an interface range check",
5
5
  "keywords": [
6
6
  "antelopejs",