@absolutejs/absolute 0.19.0-beta.814 → 0.19.0-beta.815

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-cZNgf3/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-5Ms3gR/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-cZNgf3/src/core/streamingSlotRegistrar.ts
4
+ // .angular-partial-tmp-5Ms3gR/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-cZNgf3/src/core/streamingSlotRegistry.ts
51
+ // .angular-partial-tmp-5Ms3gR/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
@@ -1153,7 +1153,7 @@ import {
1153
1153
  mkdirSync as mkdirSync5,
1154
1154
  readdirSync as readdirSync2,
1155
1155
  readFileSync as readFileSync10,
1156
- rmSync as rmSync2,
1156
+ rmSync as rmSync3,
1157
1157
  statSync,
1158
1158
  unlinkSync as unlinkSync2,
1159
1159
  writeFileSync as writeFileSync3
@@ -1319,7 +1319,7 @@ var cliTag4 = (color, message) => `\x1B[2m${formatTimestamp()}\x1B[0m ${color}[c
1319
1319
  return;
1320
1320
  seen.add(specifier);
1321
1321
  const destDir = join7(outdir, "node_modules", ...specifier.split("/"));
1322
- rmSync2(destDir, { force: true, recursive: true });
1322
+ rmSync3(destDir, { force: true, recursive: true });
1323
1323
  cpSync(srcDir, destDir, {
1324
1324
  filter(source) {
1325
1325
  const rel = relative(srcDir, source);
@@ -1935,7 +1935,7 @@ console.log(\`
1935
1935
  copyServerRuntimeAssetReferences(resolvedOutdir);
1936
1936
  const prerenderStart = performance.now();
1937
1937
  process.stdout.write(cliTag4("\x1B[36m", "Pre-rendering pages"));
1938
- rmSync2(join7(resolvedOutdir, "_prerendered"), {
1938
+ rmSync3(join7(resolvedOutdir, "_prerendered"), {
1939
1939
  force: true,
1940
1940
  recursive: true
1941
1941
  });
@@ -2852,49 +2852,69 @@ var dev = async (serverEntry, configPath2) => {
2852
2852
  };
2853
2853
 
2854
2854
  // src/cli/scripts/eslint.ts
2855
- import { existsSync as existsSync6, readFileSync as readFileSync5 } from "fs";
2855
+ import { existsSync as existsSync6, readFileSync as readFileSync5, rmSync as rmSync2 } from "fs";
2856
2856
  import { resolve as resolve4 } from "path";
2857
- var CACHE_LOCATION = ".absolutejs/eslint-cache";
2857
+ var DEFAULT_CACHE_LOCATION = ".absolutejs/eslint-cache";
2858
+ var getCacheLocation = () => process.env.ABSOLUTE_ESLINT_CACHE?.trim() || DEFAULT_CACHE_LOCATION;
2858
2859
  var CONFIG_CANDIDATES = [
2859
- "eslint.config.mjs",
2860
2860
  "eslint.config.js",
2861
+ "eslint.config.mjs",
2861
2862
  "eslint.config.cjs",
2862
- "eslint.config.ts"
2863
+ "eslint.config.ts",
2864
+ "eslint.config.mts",
2865
+ "eslint.config.cts"
2863
2866
  ];
2864
- var checkForMisplacedIgnores = () => {
2865
- const cwd = process.cwd();
2866
- const configPath2 = CONFIG_CANDIDATES.map((name) => resolve4(cwd, name)).find((candidate) => existsSync6(candidate));
2867
- if (!configPath2)
2868
- return;
2869
- let source;
2870
- try {
2871
- source = readFileSync5(configPath2, "utf-8");
2872
- } catch {
2873
- return;
2874
- }
2875
- const blocks = extractTopLevelObjectLiterals(source);
2876
- const offenders = [];
2877
- for (const block of blocks) {
2878
- if (hasKey(block, "ignores") && hasKey(block, "files")) {
2879
- offenders.push(block.slice(0, 80).replace(/\s+/g, " "));
2867
+ var FLAG_VALUE_FLAGS = new Set([
2868
+ "-c",
2869
+ "--config",
2870
+ "--cache-location",
2871
+ "--cache-strategy",
2872
+ "--ignore-path",
2873
+ "--ignore-pattern",
2874
+ "--rule",
2875
+ "--rulesdir",
2876
+ "--ext",
2877
+ "-f",
2878
+ "--format",
2879
+ "--max-warnings",
2880
+ "--parser",
2881
+ "--parser-options",
2882
+ "--plugin",
2883
+ "--global",
2884
+ "--env",
2885
+ "--report-unused-disable-directives-severity",
2886
+ "--resolve-plugins-relative-to",
2887
+ "-o",
2888
+ "--output-file",
2889
+ "--flag",
2890
+ "--inspect-config",
2891
+ "--stats",
2892
+ "--concurrency"
2893
+ ]);
2894
+ var hasUserPositional = (args) => {
2895
+ for (let i = 0;i < args.length; i++) {
2896
+ const arg = args[i];
2897
+ if (arg === undefined)
2898
+ continue;
2899
+ if (arg.startsWith("-")) {
2900
+ if (arg.includes("="))
2901
+ continue;
2902
+ if (FLAG_VALUE_FLAGS.has(arg))
2903
+ i++;
2904
+ continue;
2880
2905
  }
2906
+ return true;
2881
2907
  }
2882
- if (offenders.length === 0)
2883
- return;
2884
- const yellow = "\x1B[33m";
2885
- const reset = "\x1B[0m";
2886
- const bold = "\x1B[1m";
2887
- console.warn(`${yellow}${bold}\u26A0 ESLint flat-config warning${reset}${yellow}: found ${offenders.length} config block(s) where \`ignores\` lives alongside \`files\`. In ESLint v9, \`ignores\` is only a *global* ignore when it's the sole key in its config object \u2014 otherwise it just suppresses that block's own rules and ESLint still walks every other directory (including node_modules), making lint extremely slow.
2888
-
2889
- Move ignores into a standalone block at the top of your config:
2890
-
2891
- export default defineConfig([
2892
- { ignores: ['node_modules/**', 'dist/**', 'build/**', '.absolutejs/**'] },
2893
- pluginJs.configs.recommended,
2894
- ...
2895
- ]);
2896
-
2897
- Detected at: ${configPath2}${reset}`);
2908
+ return false;
2909
+ };
2910
+ var findConfigPath = () => {
2911
+ const cwd = process.cwd();
2912
+ for (const name of CONFIG_CANDIDATES) {
2913
+ const candidate = resolve4(cwd, name);
2914
+ if (existsSync6(candidate))
2915
+ return candidate;
2916
+ }
2917
+ return null;
2898
2918
  };
2899
2919
  var hasKey = (objectLiteralSource, key) => {
2900
2920
  const pattern = new RegExp(`(^|[\\s,{])${key}\\s*:`, "m");
@@ -2968,6 +2988,40 @@ var extractTopLevelObjectLiterals = (source) => {
2968
2988
  }
2969
2989
  return blocks;
2970
2990
  };
2991
+ var checkForMisplacedIgnores = () => {
2992
+ const configPath2 = findConfigPath();
2993
+ if (!configPath2)
2994
+ return;
2995
+ let source;
2996
+ try {
2997
+ source = readFileSync5(configPath2, "utf-8");
2998
+ } catch {
2999
+ return;
3000
+ }
3001
+ const blocks = extractTopLevelObjectLiterals(source);
3002
+ let offenderCount = 0;
3003
+ for (const block of blocks) {
3004
+ if (hasKey(block, "ignores") && hasKey(block, "files")) {
3005
+ offenderCount++;
3006
+ }
3007
+ }
3008
+ if (offenderCount === 0)
3009
+ return;
3010
+ const yellow = "\x1B[33m";
3011
+ const reset = "\x1B[0m";
3012
+ const bold = "\x1B[1m";
3013
+ console.warn(`${yellow}${bold}\u26A0 ESLint flat-config warning${reset}${yellow}: found ${offenderCount} config block(s) where \`ignores\` lives alongside \`files\`. In ESLint v9, \`ignores\` is only a *global* ignore when it's the sole key in its config object \u2014 otherwise it just suppresses that block's own rules and ESLint still walks every other directory (including node_modules), making lint extremely slow.
3014
+
3015
+ Move ignores into a standalone block at the top of your config:
3016
+
3017
+ export default defineConfig([
3018
+ { ignores: ['node_modules/**', 'dist/**', 'build/**', '.absolutejs/**'] },
3019
+ pluginJs.configs.recommended,
3020
+ ...
3021
+ ]);
3022
+
3023
+ Detected at: ${configPath2}${reset}`);
3024
+ };
2971
3025
  var formatDuration = (ms) => {
2972
3026
  if (ms < 1000)
2973
3027
  return `${ms}ms`;
@@ -2977,20 +3031,34 @@ var formatDuration = (ms) => {
2977
3031
  const seconds = Math.round(ms % 60000 / 1000);
2978
3032
  return `${minutes}m ${seconds}s`;
2979
3033
  };
3034
+ var handleClearCache = (cacheLocation) => {
3035
+ try {
3036
+ rmSync2(cacheLocation, { force: true });
3037
+ console.log(`\x1B[32m\u2713\x1B[0m Cleared cache: ${cacheLocation}`);
3038
+ } catch (err) {
3039
+ console.error(`\x1B[31m\u2717\x1B[0m Failed to clear cache at ${cacheLocation}:`, err);
3040
+ process.exit(1);
3041
+ }
3042
+ };
2980
3043
  var eslint = async (args) => {
3044
+ const cacheLocation = getCacheLocation();
3045
+ if (args.includes("--clear-cache")) {
3046
+ handleClearCache(cacheLocation);
3047
+ return;
3048
+ }
2981
3049
  checkForMisplacedIgnores();
2982
3050
  const command = [
2983
3051
  "bun",
2984
3052
  "eslint",
2985
3053
  "--cache",
2986
3054
  "--cache-location",
2987
- CACHE_LOCATION,
3055
+ cacheLocation,
2988
3056
  ...args,
2989
- "."
3057
+ ...hasUserPositional(args) ? [] : ["."]
2990
3058
  ];
2991
3059
  const dim = "\x1B[2m";
2992
3060
  const reset = "\x1B[0m";
2993
- console.log(`${dim}cache: ${CACHE_LOCATION} (subsequent runs only re-lint changed files)${reset}`);
3061
+ console.log(`${dim}cache: ${cacheLocation} (subsequent runs only re-lint changed files)${reset}`);
2994
3062
  const startedAt = Date.now();
2995
3063
  const proc = Bun.spawn(command, {
2996
3064
  stderr: "inherit",
@@ -1 +1,19 @@
1
+ /**
2
+ * Run ESLint with sensible absolutejs defaults.
3
+ *
4
+ * - Caching: enabled by default, cache file location overridable via
5
+ * the `ABSOLUTE_ESLINT_CACHE` env var (default: `.absolutejs/eslint-cache`).
6
+ * - Implicit lint target: `.` is appended only when the user hasn't
7
+ * supplied a positional path of their own. So `bun lint src/backend/`
8
+ * lints just that directory — not the whole repo plus `src/backend/`.
9
+ * - `--clear-cache`: handled by this script (not passed to ESLint),
10
+ * wipes the cache file and exits cleanly.
11
+ *
12
+ * NOTE: this script does NOT pass `--fix`. Autofixing is opt-in via the
13
+ * standard ESLint flag — `bun lint --fix` works because user args are
14
+ * spread through to the underlying `bun eslint` invocation. Users who
15
+ * see files getting auto-fixed without `--fix` are typically running an
16
+ * editor extension (VS Code's `editor.codeActionsOnSave` is the usual
17
+ * suspect) — that's IDE behavior, not this CLI.
18
+ */
1
19
  export declare const eslint: (args: string[]) => Promise<void>;
package/package.json CHANGED
@@ -347,5 +347,5 @@
347
347
  ]
348
348
  }
349
349
  },
350
- "version": "0.19.0-beta.814"
350
+ "version": "0.19.0-beta.815"
351
351
  }