@absolutejs/absolute 0.19.0-beta.1137 → 0.19.0-beta.1138

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,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-vhjnaI/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-DyeBTl/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  var __require = import.meta.require;
3
3
 
4
- // .angular-partial-tmp-vhjnaI/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-DyeBTl/src/core/streamingSlotRegistrar.ts
5
5
  var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
6
6
  var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
7
7
  var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
@@ -48,7 +48,7 @@ var warnMissingStreamingSlotCollector = (primitiveName) => {
48
48
  getWarningController()?.maybeWarn(primitiveName);
49
49
  };
50
50
 
51
- // .angular-partial-tmp-vhjnaI/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-DyeBTl/src/core/streamingSlotRegistry.ts
52
52
  var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
53
53
  var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
54
54
  var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
package/dist/cli/index.js CHANGED
@@ -1163,6 +1163,7 @@ var exports_eslintChunked = {};
1163
1163
  __export(exports_eslintChunked, {
1164
1164
  upstreamRef: () => upstreamRef,
1165
1165
  ruleSummary: () => ruleSummary,
1166
+ resolveLintTargets: () => resolveLintTargets,
1166
1167
  parseChunkedArgs: () => parseChunkedArgs,
1167
1168
  gitVisibleFiles: () => gitVisibleFiles,
1168
1169
  gitChangedFiles: () => gitChangedFiles,
@@ -1182,7 +1183,7 @@ var DEFAULT_CHUNK_SIZE = 20, DEFAULT_SHARDS = 4, DEFAULT_CONCURRENCY = 2, DEFAUL
1182
1183
  const visible = gitVisibleFiles(cwd);
1183
1184
  const matched = parsed.globs.length === 0 ? visible.filter((file) => LINTABLE_EXTENSIONS.test(file)) : visible.filter((file) => matchesAnyGlob(file, parsed.globs));
1184
1185
  return matched.filter((file) => existsSync6(resolve4(cwd, file))).sort();
1185
- }, buildShardChunks = (files, shards, chunkSize) => {
1186
+ }, resolveLintTargets = (args, cwd = process.cwd()) => resolveLintSet(parseChunkedArgs(args), cwd), buildShardChunks = (files, shards, chunkSize) => {
1186
1187
  const shardFiles = Array.from({ length: shards }, () => []);
1187
1188
  for (const file of files)
1188
1189
  shardFiles[shardOf(file, shards)]?.push(file);
@@ -1407,7 +1408,7 @@ var DEFAULT_CACHE_LOCATION = ".absolutejs/eslint-cache", CACHE_CONTRACT_VERSION
1407
1408
  return true;
1408
1409
  }
1409
1410
  return false;
1410
- }, findConfigPath = (cwd = process.cwd()) => {
1411
+ }, findEslintConfigPath = (cwd = process.cwd()) => {
1411
1412
  for (const name of CONFIG_CANDIDATES) {
1412
1413
  const candidate = resolve5(cwd, name);
1413
1414
  if (existsSync7(candidate))
@@ -1477,15 +1478,20 @@ var DEFAULT_CACHE_LOCATION = ".absolutejs/eslint-cache", CACHE_CONTRACT_VERSION
1477
1478
  }, createEslintCacheFingerprint = (cwd = process.cwd()) => {
1478
1479
  const hash = createHash("sha256");
1479
1480
  hash.update(`absolute-eslint-cache:${CACHE_CONTRACT_VERSION}\x00`);
1480
- const configPath2 = findConfigPath(cwd);
1481
- if (configPath2)
1482
- addFileToFingerprint(hash, configPath2, relative2(cwd, configPath2));
1481
+ const configPath2 = findEslintConfigPath(cwd);
1483
1482
  for (const dependency of lintDependencyNames(cwd, configPath2).sort()) {
1484
1483
  const manifestPath = findInstalledManifest(cwd, dependency);
1485
1484
  if (manifestPath)
1486
1485
  addFileToFingerprint(hash, manifestPath, dependency);
1487
1486
  }
1488
1487
  return hash.digest("hex");
1488
+ }, createEslintConfigDigest = (cwd = process.cwd()) => {
1489
+ const hash = createHash("sha256");
1490
+ hash.update(`absolute-eslint-config:${CACHE_CONTRACT_VERSION}\x00`);
1491
+ const configPath2 = findEslintConfigPath(cwd);
1492
+ if (configPath2)
1493
+ addFileToFingerprint(hash, configPath2, relative2(cwd, configPath2));
1494
+ return hash.digest("hex");
1489
1495
  }, writeFingerprint = (path, fingerprint) => {
1490
1496
  mkdirSync5(dirname3(path), { recursive: true });
1491
1497
  const temporary = `${path}.${process.pid}.tmp`;
@@ -1580,7 +1586,7 @@ var DEFAULT_CACHE_LOCATION = ".absolutejs/eslint-cache", CACHE_CONTRACT_VERSION
1580
1586
  }
1581
1587
  return blocks;
1582
1588
  }, checkForMisplacedIgnores = () => {
1583
- const configPath2 = findConfigPath();
1589
+ const configPath2 = findEslintConfigPath();
1584
1590
  if (!configPath2)
1585
1591
  return;
1586
1592
  let source;
@@ -172012,7 +172018,7 @@ import {
172012
172018
  } from "fs";
172013
172019
  import { tmpdir as tmpdir2 } from "os";
172014
172020
  import { delimiter, dirname as dirname5, relative as relative4, resolve as resolve12 } from "path";
172015
- var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSION = 1, FLAG_NOT_FOUND = -1, runGit = (args, options) => {
172021
+ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSION = 2, FLAG_NOT_FOUND = -1, CHUNKED_FLAG = "--chunked", TSCONFIG_PATTERN, ABSOLUTE_BINARY, runGit = (args, options) => {
172016
172022
  const proc = Bun.spawnSync(["git", ...args], {
172017
172023
  cwd: options.cwd,
172018
172024
  env: { ...process.env, ...options.env },
@@ -172060,7 +172066,30 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
172060
172066
  env: env3
172061
172067
  });
172062
172068
  }
172063
- }, createLintSourceTree = (cwd = process.cwd(), proofLocation = DEFAULT_PROOF_LOCATION) => {
172069
+ }, eslintChunkedArgs = (command) => {
172070
+ const index = command.indexOf("eslint");
172071
+ if (index <= 0)
172072
+ return null;
172073
+ const binary = command[index - 1];
172074
+ if (binary === undefined || !ABSOLUTE_BINARY.test(binary))
172075
+ return null;
172076
+ const args = command.slice(index + 1);
172077
+ return args.includes(CHUNKED_FLAG) ? args : null;
172078
+ }, lintScopedFiles = (command, root) => {
172079
+ const args = eslintChunkedArgs(command);
172080
+ if (args === null)
172081
+ return null;
172082
+ const auxiliary = gitVisibleFiles(root).filter((file) => TSCONFIG_PATTERN.test(file));
172083
+ const configPath2 = findEslintConfigPath(root);
172084
+ const configRelative = configPath2 === null ? null : relative4(root, configPath2).replaceAll("\\", "/");
172085
+ return [
172086
+ ...new Set([
172087
+ ...resolveLintTargets(args, root),
172088
+ ...auxiliary,
172089
+ ...configRelative === null || configRelative.startsWith("../") ? [] : [configRelative]
172090
+ ])
172091
+ ].sort();
172092
+ }, createLintSourceTree = (cwd = process.cwd(), proofLocation = DEFAULT_PROOF_LOCATION, command = []) => {
172064
172093
  const root = gitRoot(cwd);
172065
172094
  const proofPath = resolve12(cwd, proofLocation);
172066
172095
  const proofRelative = relative4(root, proofPath).replaceAll("\\", "/");
@@ -172084,7 +172113,15 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
172084
172113
  };
172085
172114
  try {
172086
172115
  runGit(["read-tree", "--empty"], { cwd: root, env: env3 });
172087
- const files = runGit(["ls-files", "--cached", "--others", "--exclude-standard", "-z"], { cwd: root }).split("\x00").filter((path) => {
172116
+ const scoped = lintScopedFiles(command, root);
172117
+ const visible = scoped ?? runGit([
172118
+ "ls-files",
172119
+ "--cached",
172120
+ "--others",
172121
+ "--exclude-standard",
172122
+ "-z"
172123
+ ], { cwd: root }).split("\x00");
172124
+ const files = visible.filter((path) => {
172088
172125
  if (!path || path === proofRelative)
172089
172126
  return false;
172090
172127
  try {
@@ -172099,7 +172136,7 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
172099
172136
  } finally {
172100
172137
  rmSync5(temporaryDirectory, { force: true, recursive: true });
172101
172138
  }
172102
- }, proofFingerprint = (cwd) => createHash2("sha256").update(`absolute-lint-proof:${PROOF_CONTRACT_VERSION}\x00`).update(createEslintCacheFingerprint(cwd)).digest("hex"), createLintProof = (command, options = {}) => {
172139
+ }, proofFingerprint = (cwd) => createHash2("sha256").update(`absolute-lint-proof:${PROOF_CONTRACT_VERSION}\x00`).update(createEslintCacheFingerprint(cwd)).update("\x00").update(createEslintConfigDigest(cwd)).digest("hex"), createLintProof = (command, options = {}) => {
172103
172140
  const cwd = options.cwd ?? process.cwd();
172104
172141
  const proofLocation = options.proofLocation ?? DEFAULT_PROOF_LOCATION;
172105
172142
  return {
@@ -172107,7 +172144,7 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
172107
172144
  contractVersion: PROOF_CONTRACT_VERSION,
172108
172145
  createdAt: new Date().toISOString(),
172109
172146
  lintFingerprint: proofFingerprint(cwd),
172110
- sourceTree: createLintSourceTree(cwd, proofLocation)
172147
+ sourceTree: createLintSourceTree(cwd, proofLocation, command)
172111
172148
  };
172112
172149
  }, writeLintProof = (command, options = {}) => {
172113
172150
  const cwd = options.cwd ?? process.cwd();
@@ -172189,7 +172226,7 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
172189
172226
  reason: "ESLint configuration or toolchain changed",
172190
172227
  valid: false
172191
172228
  };
172192
- if (proof.sourceTree !== createLintSourceTree(cwd, proofLocation))
172229
+ if (proof.sourceTree !== createLintSourceTree(cwd, proofLocation, command))
172193
172230
  return {
172194
172231
  reason: "source tree changed since lint passed",
172195
172232
  valid: false
@@ -172278,6 +172315,9 @@ var DEFAULT_PROOF_LOCATION = ".absolutejs/lint-proof.json", PROOF_CONTRACT_VERSI
172278
172315
  };
172279
172316
  var init_lintProof = __esm(() => {
172280
172317
  init_eslint();
172318
+ init_eslintChunked();
172319
+ TSCONFIG_PATTERN = /(?:^|\/)tsconfig[^/]*\.json$/;
172320
+ ABSOLUTE_BINARY = /(?:^|[\\/])absolute(?:\.[cm]?[jt]s|\.exe)?$/;
172281
172321
  });
172282
172322
 
172283
172323
  // src/build/scanConventions.ts
@@ -173751,7 +173791,7 @@ var init_fromType = __esm(() => {
173751
173791
  // src/cli/config/absolute/resolveAbsoluteConfig.ts
173752
173792
  import { existsSync as existsSync17, readFileSync as readFileSync18 } from "fs";
173753
173793
  import { resolve as resolve14 } from "path";
173754
- var import_typescript5, CONFIG_CANDIDATES2, RUNTIME_FIELDS, findConfigPath2 = (cwd, override) => {
173794
+ var import_typescript5, CONFIG_CANDIDATES2, RUNTIME_FIELDS, findConfigPath = (cwd, override) => {
173755
173795
  if (override) {
173756
173796
  const resolved = resolve14(cwd, override);
173757
173797
  return existsSync17(resolved) ? resolved : null;
@@ -173843,7 +173883,7 @@ var import_typescript5, CONFIG_CANDIDATES2, RUNTIME_FIELDS, findConfigPath2 = (c
173843
173883
  }
173844
173884
  return { current, opaqueKeys };
173845
173885
  }, readAbsoluteConfigValues = (cwd, override) => {
173846
- const configPath2 = findConfigPath2(cwd, override);
173886
+ const configPath2 = findConfigPath(cwd, override);
173847
173887
  const { current, opaqueKeys } = configPath2 ? readCurrent(configPath2) : { current: {}, opaqueKeys: [] };
173848
173888
  return { configPath: configPath2, current, opaqueKeys };
173849
173889
  };
@@ -174017,7 +174057,7 @@ var asString = (value) => typeof value === "string" ? value : undefined, isRecor
174017
174057
  const entry = asString(config.entry) ?? DEFAULT_SERVER_ENTRY;
174018
174058
  return {
174019
174059
  config,
174020
- configPath: findConfigPath2(cwd, configOverride),
174060
+ configPath: findConfigPath(cwd, configOverride),
174021
174061
  cwd,
174022
174062
  frameworkDirs,
174023
174063
  serverEntry: resolveDir(cwd, entry),
@@ -1,5 +1,26 @@
1
1
  export declare const getCacheLocation: (args: string[]) => string;
2
+ export declare const findEslintConfigPath: (cwd?: string) => string | null;
3
+ /**
4
+ * Guards the on-disk ESLint cache. Covers the INSTALLED manifests of every
5
+ * lint-related dependency — plugin and parser implementations are functions,
6
+ * so they vanish from the config object ESLint itself hashes, and an upgrade
7
+ * (or node_modules drifting from the lockfile) would otherwise reuse stale
8
+ * verdicts forever.
9
+ *
10
+ * Deliberately NOT the config file's text. ESLint already stores a hash of
11
+ * each file's *calculated* config in its own cache entry, so editing one
12
+ * `files:` override re-lints exactly the files whose computed config changed
13
+ * and leaves the rest hot. Mixing config text in here dropped every cached
14
+ * verdict in the repo for a one-line edit. The config's import list still
15
+ * feeds `lintDependencyNames`, so adding a plugin does reset the cache.
16
+ *
17
+ * The lint proof must fail closed on any config edit, so it hashes
18
+ * `createEslintConfigDigest` in on top of this.
19
+ */
2
20
  export declare const createEslintCacheFingerprint: (cwd?: string) => string;
21
+ /** Digest of the flat-config file itself, for callers that must invalidate on
22
+ * any config edit rather than defer to ESLint's per-file config hashing. */
23
+ export declare const createEslintConfigDigest: (cwd?: string) => string;
3
24
  type EslintCacheOptions = {
4
25
  cacheLocation: string;
5
26
  cwd?: string;
@@ -12,7 +33,8 @@ export declare const buildEslintCommand: (args: string[], cacheLocation: string)
12
33
  *
13
34
  * - Caching: enabled by default with ESLint's content strategy, so Git
14
35
  * operations that alter mtimes don't make unchanged files expensive.
15
- * Installed lint-tool or config changes invalidate the cache automatically.
36
+ * Installed lint-tool changes invalidate the cache automatically; config
37
+ * edits are left to ESLint's own per-file config hashing.
16
38
  * The cache location is overridable via `ABSOLUTE_ESLINT_CACHE`
17
39
  * (default: `.absolutejs/eslint-cache`).
18
40
  * - Implicit lint target: `.` is appended only when the user hasn't
@@ -7,6 +7,13 @@ type ChunkedArgs = {
7
7
  passthrough: string[];
8
8
  shards: number;
9
9
  };
10
+ /**
11
+ * The exact set of files an `absolute eslint --chunked` invocation lints,
12
+ * resolved through the same glob semantics the run itself uses. `--changed` is
13
+ * deliberately ignored: callers that attest to a run (the lint proof) must
14
+ * cover the whole lint set, not one diff's slice of it.
15
+ */
16
+ export declare const resolveLintTargets: (args: string[], cwd?: string) => string[];
10
17
  export declare const eslintChunked: (args: string[], cwd?: string) => Promise<void>;
11
18
  /**
12
19
  * Files that differ from `base` plus anything staged/unstaged/untracked —
@@ -29,11 +29,12 @@ type VerifyLintProofOptions = CreateLintProofOptions & {
29
29
  trustedKeyLocation?: string;
30
30
  };
31
31
  /**
32
- * Build a Git tree from the complete working copy without modifying the real
33
- * index. Ignored files and the proof itself are excluded. Git performs its
34
- * normal clean filters, so the digest is stable across checkout platforms.
32
+ * Build a Git tree from the files the lint command covers, without modifying
33
+ * the real index. Ignored files and the proof itself are excluded. Git
34
+ * performs its normal clean filters, so the digest is stable across checkout
35
+ * platforms.
35
36
  */
36
- export declare const createLintSourceTree: (cwd?: string, proofLocation?: string) => string;
37
+ export declare const createLintSourceTree: (cwd?: string, proofLocation?: string, command?: string[]) => string;
37
38
  export declare const createLintProof: (command: string[], options?: CreateLintProofOptions) => LintProof;
38
39
  export declare const writeLintProof: (command: string[], options?: WriteLintProofOptions) => LintProof;
39
40
  export declare const verifyLintProof: (command: string[], options?: VerifyLintProofOptions) => ProofResult;
package/package.json CHANGED
@@ -698,7 +698,7 @@
698
698
  ]
699
699
  }
700
700
  },
701
- "version": "0.19.0-beta.1137",
701
+ "version": "0.19.0-beta.1138",
702
702
  "workspaces": [
703
703
  "tests/fixtures/*",
704
704
  "tests/fixtures/_packages/*"