🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@ngcompass/config

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngcompass/config - npm Package Compare versions

Comparing version
0.1.9-beta
to
0.2.0-beta
+5
-5
dist/index.cjs

@@ -1,3 +0,3 @@

'use strict';var common=require('@ngcompass/common'),$=require('fs'),O=require('path'),Ie=require('os'),Pe=require('process'),defu=require('defu'),zod=require('zod'),module$1=require('module'),minimatch=require('minimatch'),He=require('crypto'),url=require('url'),jiti=require('jiti'),lilconfig=require('lilconfig'),B=require('fs/promises');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var $__namespace=/*#__PURE__*/_interopNamespace($);var O__namespace=/*#__PURE__*/_interopNamespace(O);var Ie__default=/*#__PURE__*/_interopDefault(Ie);var Pe__default=/*#__PURE__*/_interopDefault(Pe);var He__default=/*#__PURE__*/_interopDefault(He);var B__default=/*#__PURE__*/_interopDefault(B);function w(e={}){return {cwd:Pe__default.default.cwd(),fs:{existsSync:$__namespace.existsSync,accessSync:(t,r)=>$__namespace.accessSync(t,r)},os:{cpus:Ie.cpus},path:{dirname:O__namespace.dirname,resolve:O__namespace.resolve,isAbsolute:O__namespace.isAbsolute},...e}}var J=()=>Math.max(1,Math.min(4,Ie__default.default.cpus().length-1)),b={enabled:true,location:"node_modules/.cache/ngcompass",strategy:"local",ttl:864e5},v={outputFormat:"text",failOnSeverity:"error",maxWarnings:10,include:common.DEFAULT_INCLUDE_PATTERNS,exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.spec.ts","**/*.test.ts"]};var V=zod.z.enum(["warn","error"]),Le=zod.z.enum(["json","text","sarif","html"]),Z=zod.z.union([V,zod.z.literal("off"),zod.z.object({severity:zod.z.union([V,zod.z.literal("off")]),options:zod.z.record(zod.z.string(),zod.z.unknown()).optional()})]),$e=zod.z.object({enabled:zod.z.boolean().optional(),location:zod.z.string().optional(),strategy:zod.z.enum(["memory","local"]).optional(),ttl:zod.z.number().optional()}),we=zod.z.object({project:zod.z.string().optional(),tsconfigRootDir:zod.z.string().optional(),sourceType:zod.z.enum(["module","commonjs"]).optional(),ecmaVersion:zod.z.number().optional()}),Q=zod.z.object({extends:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]).optional(),include:zod.z.array(zod.z.string()).default(()=>[...v.include]),exclude:zod.z.array(zod.z.string()).default(()=>[...v.exclude]),maxWorkers:zod.z.number().optional(),concurrency:zod.z.number().optional(),cache:zod.z.union([zod.z.boolean(),$e]).optional(),cacheLocation:zod.z.string().optional(),outputFormat:Le.default(v.outputFormat),outputPath:zod.z.string().optional(),failOnSeverity:V.default(v.failOnSeverity),maxWarnings:zod.z.number().default(v.maxWarnings),ignorePatterns:zod.z.array(zod.z.string()).optional(),rules:zod.z.record(zod.z.string(),Z).optional(),overrides:zod.z.array(zod.z.object({files:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]),rules:zod.z.record(zod.z.string(),Z).optional()})).optional(),parserOptions:we.optional()}),Ue=zod.z.lazy(()=>Q.partial()),ee=Q.extend({profiles:zod.z.record(zod.z.string(),Ue).optional()}).transform(e=>{let t,r=e.maxWorkers??e.concurrency??J();if(e.cache===false)t={...b,enabled:false};else if(e.cache===true||e.cache===void 0){let i=e.cacheLocation??b.location;t={...b,location:i};}else t={...b,...e.cache};return {...e,maxWorkers:r,cache:t,rules:e.rules??{},overrides:e.overrides??[],ignorePatterns:e.ignorePatterns??[]}});var f={NEGATIVE_MAX_WARNINGS:e=>({code:"negative-max-warnings",message:`Value for 'maxWarnings' must be non-negative. Received: ${e}.`,suggestion:"Set 'maxWarnings' to 0 or higher, or remove it to use default (10).",severity:"error"}),WORKERS_BELOW_MINIMUM:{code:"workers-below-minimum",message:"Value for 'maxWorkers' must be at least 1.",suggestion:"Set to 1 or higher, or remove to use default (CPU count - 1).",severity:"error"},NEGATIVE_CACHE_TTL:e=>({code:"negative-cache-ttl",message:`Cache TTL must be non-negative. Received: ${e}ms.`,suggestion:"Set to 0 (default TTL) or higher. Example: 86400000 for 24 hours.",severity:"error"}),WORKERS_EXCESSIVE:(e,t)=>({code:"warn-workers-excessive",message:`Worker count (${e}) exceeds CPU count (${t}). May cause context switching overhead.`,suggestion:`Reduce to ${t} or lower for optimal performance.`,severity:"warning"}),CACHE_TTL_ZERO:{code:"warn-cache-ttl-zero",message:"Cache TTL is set to 0. Using driver default TTL (typically 24 hours).",suggestion:"Set explicit TTL if you need different cache expiration behavior.",severity:"warning"},INVALID_GLOB_PATTERN:(e,t)=>({code:"invalid-glob-pattern",message:`Glob pattern "${e}" is invalid. Error: ${t}.`,suggestion:"Check pattern syntax. Valid examples: 'src/**/*.ts', '**/*.{ts,html}'.",severity:"error"}),EMPTY_INCLUDE:{code:"empty-include",message:"No include patterns defined. Analysis will skip all files.",suggestion:"Add patterns like ['src/**/*.ts', 'src/**/*.html'] to enable analysis.",severity:"error"},EMPTY_EXCLUDE:{code:"warn-empty-exclude",message:"No exclude patterns defined. Performance may degrade.",suggestion:"Add common exclusions: ['node_modules/**', 'dist/**', '**/*.spec.ts'].",severity:"warning"},DUPLICATE_PATTERNS:(e,t)=>({code:"warn-duplicate-patterns",message:`Duplicate patterns found in "${e}": ${t.map(r=>`"${r}"`).join(", ")}.`,suggestion:"Remove duplicate entries to simplify configuration.",severity:"warning"}),EMPTY_GLOB_PATTERN:e=>({code:"empty-glob-pattern",message:`Empty string detected in "${e}" patterns.`,suggestion:"Remove empty strings from the pattern array.",severity:"error"}),TSCONFIG_ROOT_NOT_FOUND:e=>({code:"tsconfig-root-not-found",message:`TSConfig root directory not found: "${e}".`,suggestion:"Verify the directory exists and the path is correct relative to the config file.",severity:"error"}),TSCONFIG_PROJECT_NOT_FOUND:e=>({code:"tsconfig-project-not-found",message:`TSConfig file not found: "${e}".`,suggestion:"Verify the file exists and the path is relative to 'tsconfigRootDir' or config location.",severity:"error"}),OUTPUT_PATH_TRAVERSAL:e=>({code:"output-path-traversal",message:`Output path contains unsafe traversal (..): "${e}".`,suggestion:"Use absolute paths or paths without '..' to prevent security issues.",severity:"error"}),OUTPUT_PATH_SYSTEM_DIR:e=>({code:"output-path-system-dir",message:`Output path points to a system directory: "${e}".`,suggestion:"Choose a safe output location within your project directory.",severity:"error"}),OUTPUT_PATH_NOT_FOUND:e=>({code:"output-path-not-found",message:`Output directory does not exist: "${e}".`,suggestion:"Create the directory or update 'outputPath' to an existing location.",severity:"error"}),OUTPUT_PATH_NOT_WRITABLE:e=>({code:"output-path-not-writable",message:`Output directory is not writable: "${e}".`,suggestion:"Check directory permissions or choose a different output location.",severity:"error"}),CACHE_IN_NODE_MODULES:e=>({code:"cache-in-node-modules",message:`Cache location inside 'node_modules' is unsafe: "${e}". node_modules can be deleted, causing cache loss.`,suggestion:"Use a different directory like '.cache' or 'node_modules/.cache/ngcompass'.",severity:"error"}),CACHE_PARENT_NOT_FOUND:e=>({code:"warn-cache-parent-not-found",message:`Cache parent directory missing: "${e}". It will be created automatically.`,suggestion:"No action needed. Directory will be created on first cache write.",severity:"warning"}),INVALID_RULE_SEVERITY:(e,t)=>({code:"invalid-rule-severity",message:`Rule "${e}" has invalid severity: "${t}".`,suggestion:"Use one of: 'warn', 'error', or 'off'.",severity:"error"}),NO_RULES_CONFIGURED:{code:"warn-no-rules-configured",message:"No rules configured. Analysis effectively skips checks.",suggestion:"Add rules to enable analysis, or extend from a preset like 'recommended'.",severity:"warning"},EMPTY_RULE_NAME:{code:"empty-rule-name",message:"Empty rule name detected. Rule keys must be non-empty strings.",suggestion:"Remove empty keys from 'rules' configuration.",severity:"error"},PROFILE_CIRCULAR_INHERITANCE:e=>({code:"profile-circular-inheritance",message:`Circular profile inheritance detected: ${e.join(" \u2192 ")}.`,suggestion:"Break the circular dependency by removing one 'extends' reference.",severity:"error"}),PROFILE_EMPTY:{code:"warn-profile-empty",message:"Profiles section is defined but empty. Consider removing it.",suggestion:"Remove 'profiles: {}' or add at least one profile like 'dev' or 'ci'.",severity:"warning"},EXTENDS_NOT_FOUND:e=>({code:"extends-not-found",message:`Cannot resolve preset "${e}". Make sure the package is installed.`,suggestion:`Run: npm install --save-dev ${e}`,severity:"error"}),DEPRECATED_CACHE_LOCATION:{code:"warn-deprecated-cache-location",message:"'cacheLocation' is deprecated. Use 'cache.location' instead.",suggestion:`Replace 'cacheLocation: "..."' with 'cache: { location: "..." }'.`,severity:"warning"},DEPRECATED_CONCURRENCY:{code:"warn-deprecated-concurrency",message:"'concurrency' is deprecated. Use 'maxWorkers' instead.",suggestion:"Replace 'concurrency: N' with 'maxWorkers: N'.",severity:"warning"}};function U(e,t,r=[]){let i=[];if(e.maxWorkers!==void 0){let a=2*t.os.cpus().length;e.maxWorkers<1?i.push({...f.WORKERS_BELOW_MINIMUM,path:[...r,"maxWorkers"]}):e.maxWorkers>a&&i.push({...f.WORKERS_EXCESSIVE(e.maxWorkers,a),path:[...r,"maxWorkers"]});}if(e.cache&&typeof e.cache=="object"&&e.cache.ttl!==void 0){let{ttl:a}=e.cache;a<0&&i.push({...f.NEGATIVE_CACHE_TTL(a),path:[...r,"cache","ttl"]});}return {issues:i}}function te(e,t,r=[]){let i=[];e.maxWarnings!==void 0&&e.maxWarnings<0&&i.push({...f.NEGATIVE_MAX_WARNINGS(e.maxWarnings),path:[...r,"maxWarnings"]});let{issues:a}=U(e,t,r);return i.push(...a),{issues:i}}function re(e,t=[]){let r=[];return e&&typeof e=="object"&&("cacheLocation"in e&&e.cacheLocation!==void 0&&r.push({...f.DEPRECATED_CACHE_LOCATION,path:[...t,"cacheLocation"]}),"concurrency"in e&&e.concurrency!==void 0&&r.push({...f.DEPRECATED_CONCURRENCY,path:[...t,"concurrency"]})),{issues:r}}function ie(e,t,r){let i=[];if(!e.extends)return {issues:i};let a=Array.isArray(e.extends),o=a?e.extends:[e.extends];for(let l=0;l<o.length;l++){let n=o[l];if(typeof n!="string"||n.trim()===""||n.startsWith(".")||O__namespace.default.isAbsolute(n)||n.includes(":")||(function(u,g){try{let p=O__namespace.default.join(g,"__resolve_anchor__.cjs");return module$1.createRequire(p).resolve(u)}catch{return null}})(n,r)!==null)continue;let s=[...t,"extends"];a&&s.push(l),i.push({...f.EXTENDS_NOT_FOUND(n),path:s});}return {issues:i}}var ke=/\/\/\//,Fe=/\{/g,Me=/\}/g,We=/\[/g,Ve=/\]/g;function ne(e,t=[]){let r=[];for(let i of ["include","exclude","ignorePatterns"]){let a=e[i];if(!Array.isArray(a))continue;for(let l=0;l<a.length;l++)r.push(...(function(n,s,u,g){let p=[],m=[...g,n,u];if(!s||s.trim()==="")return p.push({...f.EMPTY_GLOB_PATTERN(n),path:m}),p;if((s.match(We)||[]).length!==(s.match(Ve)||[]).length)return p.push({...f.INVALID_GLOB_PATTERN(s,"unmatched character class brackets"),path:m}),p;if(ke.test(s)||s.startsWith("///"))return p.push({...f.INVALID_GLOB_PATTERN(s,"invalid path pattern with multiple slashes"),path:m}),p;(s.endsWith("\\")||s.endsWith("/"))&&p.push({...f.INVALID_GLOB_PATTERN(s,"trailing slash not allowed"),path:m}),(s.match(Fe)||[]).length!==(s.match(Me)||[]).length&&p.push({...f.INVALID_GLOB_PATTERN(s,"unmatched braces"),path:m});try{minimatch.minimatch("sample.ts",s);}catch(d){let h=d instanceof Error?d.message:String(d);p.push({...f.INVALID_GLOB_PATTERN(s,h),path:m});}return p})(i,a[l],l,t));let o=(function(l){let n=new Set,s=new Set;for(let u of l)n.has(u)?s.add(u):n.add(u);return [...s]})(a);o.length>0&&r.push({...f.DUPLICATE_PATTERNS(i,o),path:[...t,i]});}return e.include&&e.include.length!==0||r.push({...f.EMPTY_INCLUDE,path:[...t,"include"]}),e.exclude&&e.exclude.length!==0||r.push({...f.EMPTY_EXCLUDE,path:[...t,"exclude"]}),{issues:r}}var Ge=["/etc/","\\etc\\","/var/","\\var\\"],se=/[\\/]/;function le(e,t,r=[]){let i=[],a=o=>t.path.isAbsolute(o)?o:t.path.resolve(t.cwd,o);if(e.outputPath){let{outputPath:o}=e,l=[...r,"outputPath"];o.includes("..")&&i.push({...f.OUTPUT_PATH_TRAVERSAL(o),path:l}),Ge.some(s=>o.includes(s))&&i.push({...f.OUTPUT_PATH_SYSTEM_DIR(o),path:l});let n=t.path.dirname(a(o));if(t.fs.existsSync(n))try{t.fs.accessSync(n,$__namespace.constants.W_OK);}catch{i.push({...f.OUTPUT_PATH_NOT_WRITABLE(n),path:l});}else i.push({...f.OUTPUT_PATH_NOT_FOUND(n),path:l});}if(e.cache&&typeof e.cache=="object"&&e.cache.enabled){let{location:o}=e.cache;if(o){let l,n,s=[...r,"cache","location"];o.split(se).includes("node_modules")&&((n=(l=o.split(se)).indexOf("node_modules"))===-1||l[n+1]!==".cache")&&i.push({...f.CACHE_IN_NODE_MODULES(o),path:s});let u=t.path.dirname(a(o));t.fs.existsSync(u)||i.push({...f.CACHE_PARENT_NOT_FOUND(u),path:s});}}if(e.parserOptions){let{project:o,tsconfigRootDir:l}=e.parserOptions;if(o){let n=a(o);t.fs.existsSync(n)||i.push({...f.TSCONFIG_PROJECT_NOT_FOUND(o),path:[...r,"parserOptions","project"]});}if(l){let n=a(l);t.fs.existsSync(n)||i.push({...f.TSCONFIG_ROOT_NOT_FOUND(l),path:[...r,"parserOptions","tsconfigRootDir"]});}}return {issues:i}}function ce(e,t){let r=[];if(!e.profiles||typeof e.profiles!="object")return {issues:r};let i=e.profiles,a=Object.keys(i);if(a.length===0)return r.push({...f.PROFILE_EMPTY,path:["profiles"]}),{issues:r};for(let[l,n]of Object.entries(i)){if(!n||typeof n!="object")continue;let{issues:s}=U(n,t,["profiles",l]);r.push(...s);}let o=new Set;for(let l of a)(function(n,s,u,g){let p=[],m=n;for(;m!==void 0;){if(u.has(m))return;if(p.includes(m)){for(let d of(g.push({...f.PROFILE_CIRCULAR_INHERITANCE([...p,m]),path:["profiles",p[0],"extends"]}),p))u.add(d);return}p.push(m),m=(function(d){if(!d||typeof d!="object")return;let h=d.extends;return typeof h=="string"?h:void 0})(s[m]);}for(let d of p)u.add(d);})(l,i,o,r);return {issues:r}}var ue=["warn","error","off"];function fe(e,t=[]){var r;let i=[],a=Object.entries(e.rules||{});for(let[o,l]of(a.length>0||(Array.isArray(r=e.extends)?r.length>0:r)||i.push({...f.NO_RULES_CONFIGURED,path:[...t,"rules"]}),a)){if(!o||o.trim()===""){i.push({...f.EMPTY_RULE_NAME,path:[...t,"rules"]});continue}if(typeof l=="object"&&l!==null){let{severity:n}=l;n&&!ue.includes(n)&&i.push({...f.INVALID_RULE_SEVERITY(o,n),path:[...t,"rules",o,"severity"]});}}return {issues:i}}function D(e){return He__default.default.createHash("sha1").update(e).digest("hex")}function de(e,t){let r=common.ASTUtils.parse(e,t);return common.ASTUtils.generateLocationMap(r)}async function Ye(e,t,r,i){if(!r)return de(e,t);let a=`v${common.CACHE_VERSION}:${i}`,o=await r.get(a);if(o&&(function(n){if(!n||typeof n!="object")return false;for(let s of Object.values(n))return !!(s&&typeof s=="object"&&"line"in s&&"column"in s);return true})(o.ast))return o.ast;let l=de(e,t);return await r.set(a,{filePath:t,ast:l}),l}async function me(e,t,r,i,a){if(e.length===0)return;let o=a??D(t),l=await Ye(t,r,i,o);for(let n of e){if(n.file||(n.file=r),!((!n.line||n.line===1)&&n.path))continue;let s=l[n.path.join(".")];s&&(n.line=s.line,n.column=s.column);}}var qe=new Set(["recommended","strict","performance","reactivity","all"]);async function ze(e,t,r,i,a){if(r)return void await me(e,r,t,i,a);for(let o of e)o.file||(o.file=t);}function ge(e,t){let r,i=[...(r=new Set,e.filter(o=>{let l=o.path?o.path.join("."):"",n=`${o.code}:${o.message}:${l}`;return !r.has(n)&&(r.add(n),true)}))].sort((o,l)=>o.severity===l.severity?0:o.severity==="error"?-1:1),a=!i.some(o=>o.severity==="error");return {config:a?t:void 0,report:{valid:a,issues:i}}}async function G(e){let t,{config:r,context:i,basePath:a=[],filePath:o,fileContent:l,astCache:n,contentHash:s}=e,{issues:u,validated:g,success:p}=(t=ee.safeParse(r)).success?{issues:[],validated:t.data,success:true}:{issues:t.error.issues.map(d=>({code:d.code.replace(/_/g,"-"),message:d.message,path:[...a,...d.path],severity:"error",file:o})),validated:r,success:false},m=[...u,...(function(d,h,y,E,A){let x=[];for(let T of [{name:"cross-fields",run:()=>te(d,y,E).issues},{name:"glob-patterns",run:()=>ne(d,E).issues},{name:"paths",run:()=>le(d,y,E).issues},{name:"rules",run:()=>fe(d,E).issues},{name:"extends-chain",run:()=>ie(d,E,y.cwd).issues},{name:"profiles",run:()=>ce(d,y).issues},{name:"deprecated",run:()=>re(h,E).issues}])try{x.push(...T.run());}catch(C){let I=C instanceof Error?C.message:String(C);x.push({code:"check-failed",message:`Check "${T.name}" encountered an unexpected error: ${I}`,path:E,severity:"error",file:A});}return x})(g,r,i,a,o)];return o&&await ze(m,o,l,n,s),{issues:m,validated:p?g:void 0}}async function he(e,t=w(),r,i,a,o){let l={context:t,filePath:r,fileContent:i,astCache:a,contentHash:o},n=(function(p){if(!p||typeof p!="object")return {};let m=p.profiles;return m&&typeof m=="object"?m:{}})(e);if(t.profile){let p=n[t.profile];if(!p){var s;let y,E,A;return s=t.profile,y=Object.keys(n).join(", "),E=s.replace(/^ngcompass:/,""),A=qe.has(E)?` "${s}" is a built-in preset, not a config profile. Use 'extends: "ngcompass:${E}"' in your config instead.`:"",{config:void 0,report:{valid:false,issues:[{code:"error-profile-not-found",message:`Profile "${s}" not found. Available: [${y}]${A}`,path:["profiles",s],severity:"error",file:r}]}}}let m=await G({...l,config:e}),d=defu.defu(p,e),h=await G({...l,config:d,basePath:["profiles",t.profile]});return ge([...m.issues,...h.issues],h.validated)}let{issues:u,validated:g}=await G({...l,config:e});return ge(u,g)}var _="ngcompass",et=[`${_}.config.ts`,`${_}.config.js`,`${_}.config.mjs`,`${_}.config.cjs`,`${_}.config.json`,`.${_}rc`,`.${_}rc.json`,"package.json"],k=e=>{let t=url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));return jiti.createJiti(e,{alias:{"@ngcompass/config":O__namespace.default.basename(t).startsWith("index.")?t:url.fileURLToPath(new URL("../index.ts",(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))))}}).import(e).then(r=>r&&typeof r=="object"&&"default"in r?r.default??r:r)},ve=(e,t)=>JSON.parse(t.replace(/^\uFEFF/,"")),Te=async e=>{common.time("config-discovery"),common.debug("discovery",`Searching for config in: ${e}`);let t=lilconfig.lilconfig(_,{searchPlaces:et,loaders:{".ts":k,".js":k,".mjs":k,".cjs":k,".json":ve,noExt:ve}}),r=await t.search(e);if(!r)return common.debug("discovery","No config file found"),common.timeEnd("config-discovery"),null;common.debug("discovery",`Found config: ${r.filepath}`);let i="",a="";common.time("content-hash");try{i=$__namespace.default.readFileSync(r.filepath,"utf-8"),a=D(i);let l=common.timeEnd("content-hash");common.debug("discovery",`Content hash: ${a.substring(0,8)}... (${l.toFixed(1)}ms)`);}catch(l){common.timeEnd("content-hash");let n=l instanceof Error?l.message:String(l);common.debug("discovery",`Failed to re-read config file for hashing: ${n}`);}let o=common.timeEnd("config-discovery");return common.debug("discovery",`Discovery complete: ${o.toFixed(1)}ms`),{config:r.config,filepath:r.filepath,content:i,contentHash:a,isEmpty:r.isEmpty}};var Ae=async e=>{common.time("config-resolution");let{cwd:t,profile:r,cache:i}=e;common.debug("loader",`Starting config resolution (cwd: ${t}, profile: ${r||"none"})`);let a=await Te(t),{hash:o,cachedResult:l}=await it(a,r,i);if(l){let u=common.timeEnd("config-resolution");return common.debug("loader",`Cache HIT - returning cached result (${u.toFixed(1)}ms)`),l}common.debug("loader","Cache MISS - running validation");let n=await nt(a,r,i);common.debug("loader",`Validation complete: ${n.report.valid?"valid":`invalid (${n.report.issues.length} issues)`}`),i&&o&&(await i.configs.set(o,n),common.debug("loader",`Cached validation result: key=${o.substring(0,8)}...`));let s=common.timeEnd("config-resolution");return common.debug("loader",`Config resolution complete: ${s.toFixed(1)}ms`),n};async function it(e,t,r){if(!r)return {};let i=[e?.contentHash??"",t??"",common.PACKAGE_VERSION,common.CACHE_VERSION].join("::"),a=r.computeHash(i);common.debug("loader",`Cache lookup: key=${a.substring(0,8)}...`);let o=await r.configs.get(a);return {hash:a,cachedResult:o}}async function nt(e,t,r){return he(e?.config??{},w({profile:t}),e?.filepath,e?.content,r?.asts,e?.contentHash)}async function Sr(e){try{return await Ae(e)}catch(t){return {config:void 0,report:{valid:false,issues:[{code:"error-conf-semantic",message:t instanceof Error?t.message:String(t),path:[],severity:"error"}]}}}}var st=(e={})=>{let t=e.include??v.include,r=e.exclude??v.exclude,i=t.map(o=>` '${o}',`).join(`
`),a=r.map(o=>` '${o}',`).join(`
'use strict';var common=require('@ngcompass/common'),$=require('fs'),O=require('path'),$e=require('os'),Ie=require('process'),defu=require('defu'),zod=require('zod'),module$1=require('module'),minimatch=require('minimatch'),Ye=require('crypto'),url=require('url'),jiti=require('jiti'),lilconfig=require('lilconfig'),B=require('fs/promises');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}function _interopNamespace(e){if(e&&e.__esModule)return e;var n=Object.create(null);if(e){Object.keys(e).forEach(function(k){if(k!=='default'){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:true,get:function(){return e[k]}});}})}n.default=e;return Object.freeze(n)}var $__namespace=/*#__PURE__*/_interopNamespace($);var O__namespace=/*#__PURE__*/_interopNamespace(O);var $e__default=/*#__PURE__*/_interopDefault($e);var Ie__default=/*#__PURE__*/_interopDefault(Ie);var Ye__default=/*#__PURE__*/_interopDefault(Ye);var B__default=/*#__PURE__*/_interopDefault(B);function w(e={}){return {cwd:Ie__default.default.cwd(),fs:{existsSync:$__namespace.existsSync,accessSync:(t,r)=>$__namespace.accessSync(t,r)},os:{cpus:$e.cpus},path:{dirname:O__namespace.dirname,resolve:O__namespace.resolve,isAbsolute:O__namespace.isAbsolute},...e}}var Q=()=>Math.max(1,Math.min(4,$e__default.default.cpus().length-1)),b={enabled:true,location:"node_modules/.cache/ngcompass",strategy:"local",ttl:864e5},v={outputFormat:"text",failOnSeverity:"error",maxWarnings:10,include:common.DEFAULT_INCLUDE_PATTERNS,exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.spec.ts","**/*.test.ts"]};var G=zod.z.enum(["warn","error"]),we=zod.z.enum(["json","text","sarif","html"]),ee=zod.z.union([G,zod.z.literal("off"),zod.z.object({severity:zod.z.union([G,zod.z.literal("off")]),options:zod.z.record(zod.z.string(),zod.z.unknown()).optional()})]),Ue=zod.z.object({enabled:zod.z.boolean().optional(),location:zod.z.string().optional(),strategy:zod.z.enum(["memory","local"]).optional(),ttl:zod.z.number().optional()}),je=zod.z.object({project:zod.z.string().optional(),tsconfigRootDir:zod.z.string().optional(),sourceType:zod.z.enum(["module","commonjs"]).optional(),ecmaVersion:zod.z.number().optional()}),te=zod.z.object({extends:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]).optional(),include:zod.z.array(zod.z.string()).default(()=>[...v.include]),exclude:zod.z.array(zod.z.string()).default(()=>[...v.exclude]),maxWorkers:zod.z.number().optional(),concurrency:zod.z.number().optional(),cache:zod.z.union([zod.z.boolean(),Ue]).optional(),cacheLocation:zod.z.string().optional(),outputFormat:we.default(v.outputFormat),outputPath:zod.z.string().optional(),failOnSeverity:G.default(v.failOnSeverity),maxWarnings:zod.z.number().default(v.maxWarnings),ignorePatterns:zod.z.array(zod.z.string()).optional(),rules:zod.z.record(zod.z.string(),ee).optional(),overrides:zod.z.array(zod.z.object({files:zod.z.union([zod.z.string(),zod.z.array(zod.z.string())]),rules:zod.z.record(zod.z.string(),ee).optional()})).optional(),parserOptions:je.optional()}),De=zod.z.lazy(()=>te.partial()),re=te.extend({profiles:zod.z.record(zod.z.string(),De).optional()}).transform(e=>{let t,r=e.maxWorkers??e.concurrency??Q();if(e.cache===false)t={...b,enabled:false};else if(e.cache===true||e.cache===void 0){let i=e.cacheLocation??b.location;t={...b,location:i};}else t={...b,...e.cache};return {...e,maxWorkers:r,cache:t,rules:e.rules??{},overrides:e.overrides??[],ignorePatterns:e.ignorePatterns??[]}});var u={NEGATIVE_MAX_WARNINGS:e=>({code:"negative-max-warnings",message:`Value for 'maxWarnings' must be non-negative. Received: ${e}.`,suggestion:"Set 'maxWarnings' to 0 or higher, or remove it to use default (10).",severity:"error"}),WORKERS_BELOW_MINIMUM:{code:"workers-below-minimum",message:"Value for 'maxWorkers' must be at least 1.",suggestion:"Set to 1 or higher, or remove to use default (CPU count - 1).",severity:"error"},NEGATIVE_CACHE_TTL:e=>({code:"negative-cache-ttl",message:`Cache TTL must be non-negative. Received: ${e}ms.`,suggestion:"Set to 0 (default TTL) or higher. Example: 86400000 for 24 hours.",severity:"error"}),WORKERS_EXCESSIVE:(e,t)=>({code:"warn-workers-excessive",message:`Worker count (${e}) exceeds CPU count (${t}). May cause context switching overhead.`,suggestion:`Reduce to ${t} or lower for optimal performance.`,severity:"warning"}),CACHE_TTL_ZERO:{code:"warn-cache-ttl-zero",message:"Cache TTL is set to 0. Using driver default TTL (typically 24 hours).",suggestion:"Set explicit TTL if you need different cache expiration behavior.",severity:"warning"},INVALID_GLOB_PATTERN:(e,t)=>({code:"invalid-glob-pattern",message:`Glob pattern "${e}" is invalid. Error: ${t}.`,suggestion:"Check pattern syntax. Valid examples: 'src/**/*.ts', '**/*.{ts,html}'.",severity:"error"}),EMPTY_INCLUDE:{code:"empty-include",message:"No include patterns defined. Analysis will skip all files.",suggestion:"Add patterns like ['src/**/*.ts', 'src/**/*.html'] to enable analysis.",severity:"error"},EMPTY_EXCLUDE:{code:"warn-empty-exclude",message:"No exclude patterns defined. Performance may degrade.",suggestion:"Add common exclusions: ['node_modules/**', 'dist/**', '**/*.spec.ts'].",severity:"warning"},DUPLICATE_PATTERNS:(e,t)=>({code:"warn-duplicate-patterns",message:`Duplicate patterns found in "${e}": ${t.map(r=>`"${r}"`).join(", ")}.`,suggestion:"Remove duplicate entries to simplify configuration.",severity:"warning"}),EMPTY_GLOB_PATTERN:e=>({code:"empty-glob-pattern",message:`Empty string detected in "${e}" patterns.`,suggestion:"Remove empty strings from the pattern array.",severity:"error"}),TSCONFIG_ROOT_NOT_FOUND:e=>({code:"tsconfig-root-not-found",message:`TSConfig root directory not found: "${e}".`,suggestion:"Verify the directory exists and the path is correct relative to the config file.",severity:"error"}),TSCONFIG_PROJECT_NOT_FOUND:e=>({code:"tsconfig-project-not-found",message:`TSConfig file not found: "${e}".`,suggestion:"Verify the file exists and the path is relative to 'tsconfigRootDir' or config location.",severity:"error"}),OUTPUT_PATH_TRAVERSAL:e=>({code:"output-path-traversal",message:`Output path contains unsafe traversal (..): "${e}".`,suggestion:"Use absolute paths or paths without '..' to prevent security issues.",severity:"error"}),OUTPUT_PATH_SYSTEM_DIR:e=>({code:"output-path-system-dir",message:`Output path points to a system directory: "${e}".`,suggestion:"Choose a safe output location within your project directory.",severity:"error"}),OUTPUT_PATH_NOT_FOUND:e=>({code:"output-path-not-found",message:`Output directory does not exist: "${e}".`,suggestion:"Create the directory or update 'outputPath' to an existing location.",severity:"error"}),OUTPUT_PATH_NOT_WRITABLE:e=>({code:"output-path-not-writable",message:`Output directory is not writable: "${e}".`,suggestion:"Check directory permissions or choose a different output location.",severity:"error"}),CACHE_IN_NODE_MODULES:e=>({code:"cache-in-node-modules",message:`Cache location inside 'node_modules' is unsafe: "${e}". node_modules can be deleted, causing cache loss.`,suggestion:"Use a different directory like '.cache' or 'node_modules/.cache/ngcompass'.",severity:"error"}),CACHE_PARENT_NOT_FOUND:e=>({code:"warn-cache-parent-not-found",message:`Cache parent directory missing: "${e}". It will be created automatically.`,suggestion:"No action needed. Directory will be created on first cache write.",severity:"warning"}),INVALID_RULE_SEVERITY:(e,t)=>({code:"invalid-rule-severity",message:`Rule "${e}" has invalid severity: "${t}".`,suggestion:"Use one of: 'warn', 'error', or 'off'.",severity:"error"}),NO_RULES_CONFIGURED:{code:"warn-no-rules-configured",message:"No rules configured. Analysis effectively skips checks.",suggestion:"Add rules to enable analysis, or extend from a preset like 'recommended'.",severity:"warning"},EMPTY_RULE_NAME:{code:"empty-rule-name",message:"Empty rule name detected. Rule keys must be non-empty strings.",suggestion:"Remove empty keys from 'rules' configuration.",severity:"error"},PROFILE_CIRCULAR_INHERITANCE:e=>({code:"profile-circular-inheritance",message:`Circular profile inheritance detected: ${e.join(" \u2192 ")}.`,suggestion:"Break the circular dependency by removing one 'extends' reference.",severity:"error"}),PROFILE_EMPTY:{code:"warn-profile-empty",message:"Profiles section is defined but empty. Consider removing it.",suggestion:"Remove 'profiles: {}' or add at least one profile like 'dev' or 'ci'.",severity:"warning"},EXTENDS_NOT_FOUND:e=>({code:"extends-not-found",message:`Cannot resolve preset "${e}". Make sure the package is installed.`,suggestion:`Run: npm install --save-dev ${e}`,severity:"error"}),DEPRECATED_CACHE_LOCATION:{code:"warn-deprecated-cache-location",message:"'cacheLocation' is deprecated. Use 'cache.location' instead.",suggestion:`Replace 'cacheLocation: "..."' with 'cache: { location: "..." }'.`,severity:"warning"},DEPRECATED_CONCURRENCY:{code:"warn-deprecated-concurrency",message:"'concurrency' is deprecated. Use 'maxWorkers' instead.",suggestion:"Replace 'concurrency: N' with 'maxWorkers: N'.",severity:"warning"}};function U(e,t,r=[]){let i=[];if(e.maxWorkers!==void 0){let n=2*t.os.cpus().length;e.maxWorkers<1?i.push({...u.WORKERS_BELOW_MINIMUM,path:[...r,"maxWorkers"]}):e.maxWorkers>n&&i.push({...u.WORKERS_EXCESSIVE(e.maxWorkers,n),path:[...r,"maxWorkers"]});}if(e.cache&&typeof e.cache=="object"&&e.cache.ttl!==void 0){let{ttl:n}=e.cache;n<0&&i.push({...u.NEGATIVE_CACHE_TTL(n),path:[...r,"cache","ttl"]});}return {issues:i}}function oe(e,t,r=[]){let i=[];e.maxWarnings!==void 0&&e.maxWarnings<0&&i.push({...u.NEGATIVE_MAX_WARNINGS(e.maxWarnings),path:[...r,"maxWarnings"]});let{issues:n}=U(e,t,r);return i.push(...n),{issues:i}}function ie(e,t=[]){let r=[];return e&&typeof e=="object"&&("cacheLocation"in e&&e.cacheLocation!==void 0&&r.push({...u.DEPRECATED_CACHE_LOCATION,path:[...t,"cacheLocation"]}),"concurrency"in e&&e.concurrency!==void 0&&r.push({...u.DEPRECATED_CONCURRENCY,path:[...t,"concurrency"]})),{issues:r}}function se(e,t,r){let i=[];if(!e.extends)return {issues:i};let n=Array.isArray(e.extends),o=n?e.extends:[e.extends];for(let c=0;c<o.length;c++){let s=o[c];if(typeof s!="string"||s.trim()===""||s.startsWith(".")||O__namespace.default.isAbsolute(s)||s.includes(":")||(function(f,g){try{let p=O__namespace.default.join(g,"__resolve_anchor__.cjs");return module$1.createRequire(p).resolve(f)}catch{return null}})(s,r)!==null)continue;let a=[...t,"extends"];n&&a.push(c),i.push({...u.EXTENDS_NOT_FOUND(s),path:a});}return {issues:i}}var Me=/\/\/\//,We=/\{/g,Ve=/\}/g,Ge=/\[/g,He=/\]/g;function ae(e,t=[]){let r=[];for(let i of ["include","exclude","ignorePatterns"]){let n=e[i];if(!Array.isArray(n))continue;for(let c=0;c<n.length;c++)r.push(...(function(s,a,f,g){let p=[],m=[...g,s,f];if(!a||a.trim()==="")return p.push({...u.EMPTY_GLOB_PATTERN(s),path:m}),p;if((a.match(Ge)||[]).length!==(a.match(He)||[]).length)return p.push({...u.INVALID_GLOB_PATTERN(a,"unmatched character class brackets"),path:m}),p;if(Me.test(a)||a.startsWith("///"))return p.push({...u.INVALID_GLOB_PATTERN(a,"invalid path pattern with multiple slashes"),path:m}),p;(a.endsWith("\\")||a.endsWith("/"))&&p.push({...u.INVALID_GLOB_PATTERN(a,"trailing slash not allowed"),path:m}),(a.match(We)||[]).length!==(a.match(Ve)||[]).length&&p.push({...u.INVALID_GLOB_PATTERN(a,"unmatched braces"),path:m});try{minimatch.minimatch("sample.ts",a);}catch(d){let y=d instanceof Error?d.message:String(d);p.push({...u.INVALID_GLOB_PATTERN(a,y),path:m});}return p})(i,n[c],c,t));let o=(function(c){let s=new Set,a=new Set;for(let f of c)s.has(f)?a.add(f):s.add(f);return [...a]})(n);o.length>0&&r.push({...u.DUPLICATE_PATTERNS(i,o),path:[...t,i]});}return e.include&&e.include.length!==0||r.push({...u.EMPTY_INCLUDE,path:[...t,"include"]}),e.exclude&&e.exclude.length!==0||r.push({...u.EMPTY_EXCLUDE,path:[...t,"exclude"]}),{issues:r}}var Be=["/etc/","\\etc\\","/var/","\\var\\"],ce=/[\\/]/;function ue(e,t,r=[]){let i=[],n=o=>t.path.isAbsolute(o)?o:t.path.resolve(t.cwd,o);if(e.outputPath){let{outputPath:o}=e,c=[...r,"outputPath"];o.includes("..")&&i.push({...u.OUTPUT_PATH_TRAVERSAL(o),path:c}),Be.some(a=>o.includes(a))&&i.push({...u.OUTPUT_PATH_SYSTEM_DIR(o),path:c});let s=t.path.dirname(n(o));if(t.fs.existsSync(s))try{t.fs.accessSync(s,$__namespace.constants.W_OK);}catch{i.push({...u.OUTPUT_PATH_NOT_WRITABLE(s),path:c});}else i.push({...u.OUTPUT_PATH_NOT_FOUND(s),path:c});}if(e.cache&&typeof e.cache=="object"&&e.cache.enabled){let{location:o}=e.cache;if(o){let c,s,a=[...r,"cache","location"];o.split(ce).includes("node_modules")&&((s=(c=o.split(ce)).indexOf("node_modules"))===-1||c[s+1]!==".cache")&&i.push({...u.CACHE_IN_NODE_MODULES(o),path:a});let f=t.path.dirname(n(o));t.fs.existsSync(f)||i.push({...u.CACHE_PARENT_NOT_FOUND(f),path:a});}}if(e.parserOptions){let{project:o,tsconfigRootDir:c}=e.parserOptions;if(o){let s=n(o);t.fs.existsSync(s)||i.push({...u.TSCONFIG_PROJECT_NOT_FOUND(o),path:[...r,"parserOptions","project"]});}if(c){let s=n(c);t.fs.existsSync(s)||i.push({...u.TSCONFIG_ROOT_NOT_FOUND(c),path:[...r,"parserOptions","tsconfigRootDir"]});}}return {issues:i}}function fe(e,t){let r=[];if(!e.profiles||typeof e.profiles!="object")return {issues:r};let i=e.profiles,n=Object.keys(i);if(n.length===0)return r.push({...u.PROFILE_EMPTY,path:["profiles"]}),{issues:r};for(let[c,s]of Object.entries(i)){if(!s||typeof s!="object")continue;let{issues:a}=U(s,t,["profiles",c]);r.push(...a);}let o=new Set;for(let c of n)(function(s,a,f,g){let p=[],m=s;for(;m!==void 0;){if(f.has(m))return;if(p.includes(m)){for(let d of(g.push({...u.PROFILE_CIRCULAR_INHERITANCE([...p,m]),path:["profiles",p[0],"extends"]}),p))f.add(d);return}p.push(m),m=(function(d){if(!d||typeof d!="object")return;let y=d.extends;return typeof y=="string"?y:void 0})(a[m]);}for(let d of p)f.add(d);})(c,i,o,r);return {issues:r}}var pe=["warn","error","off"];function de(e,t=[]){var r;let i=[],n=Object.entries(e.rules||{});for(let[o,c]of(n.length>0||(Array.isArray(r=e.extends)?r.length>0:r)||i.push({...u.NO_RULES_CONFIGURED,path:[...t,"rules"]}),n)){if(!o||o.trim()===""){i.push({...u.EMPTY_RULE_NAME,path:[...t,"rules"]});continue}if(typeof c=="object"&&c!==null){let{severity:s}=c;s&&!pe.includes(s)&&i.push({...u.INVALID_RULE_SEVERITY(o,s),path:[...t,"rules",o,"severity"]});}}return {issues:i}}function j(e){return Ye__default.default.createHash("sha1").update(e).digest("hex")}function ge(e,t){let r=common.ASTUtils.parse(e,t);return common.ASTUtils.generateLocationMap(r)}async function qe(e,t,r,i){if(!r)return ge(e,t);let n=`v${common.CACHE_VERSION}:${i}`,o=await r.get(n);if(o&&(function(s){if(!s||typeof s!="object")return false;for(let a of Object.values(s))return !!(a&&typeof a=="object"&&"line"in a&&"column"in a);return true})(o.ast))return o.ast;let c=ge(e,t);return await r.set(n,{filePath:t,ast:c}),c}async function he(e,t,r,i,n){if(e.length===0)return;let o=n??j(t),c=await qe(t,r,i,o);for(let s of e){if(s.file||(s.file=r),!((!s.line||s.line===1)&&s.path))continue;let a=c[s.path.join(".")];a&&(s.line=a.line,s.column=a.column);}}var Xe=new Set(["recommended","strict","performance","reactivity","all"]);async function Je(e,t,r,i,n){if(r)return void await he(e,r,t,i,n);for(let o of e)o.file||(o.file=t);}function ye(e,t){let r,i=[...(r=new Set,e.filter(o=>{let c=o.path?o.path.join("."):"",s=`${o.code}:${o.message}:${c}`;return !r.has(s)&&(r.add(s),true)}))].sort((o,c)=>o.severity===c.severity?0:o.severity==="error"?-1:1),n=!i.some(o=>o.severity==="error");return {config:n?t:void 0,report:{valid:n,issues:i}}}async function H(e){let t,{config:r,context:i,basePath:n=[],filePath:o,fileContent:c,astCache:s,contentHash:a}=e,{issues:f,validated:g,success:p}=(t=re.safeParse(r)).success?{issues:[],validated:t.data,success:true}:{issues:t.error.issues.map(d=>({code:d.code.replace(/_/g,"-"),message:d.message,path:[...n,...d.path],severity:"error",file:o})),validated:r,success:false},m=[...f,...(function(d,y,E,h,S){let x=[];for(let T of [{name:"cross-fields",run:()=>oe(d,E,h).issues},{name:"glob-patterns",run:()=>ae(d,h).issues},{name:"paths",run:()=>ue(d,E,h).issues},{name:"rules",run:()=>de(d,h).issues},{name:"extends-chain",run:()=>se(d,h,E.cwd).issues},{name:"profiles",run:()=>fe(d,E).issues},{name:"deprecated",run:()=>ie(y,h).issues}])try{x.push(...T.run());}catch(C){let I=C instanceof Error?C.message:String(C);x.push({code:"check-failed",message:`Check "${T.name}" encountered an unexpected error: ${I}`,path:h,severity:"error",file:S});}return x})(g,r,i,n,o)];return o&&await Je(m,o,c,s,a),{issues:m,validated:p?g:void 0}}async function Ee(e,t=w(),r,i,n,o){let c={context:t,filePath:r,fileContent:i,astCache:n,contentHash:o},s=(function(p){if(!p||typeof p!="object")return {};let m=p.profiles;return m&&typeof m=="object"?m:{}})(e);if(t.profile){let p=s[t.profile];if(!p){var a;let E,h,S;return a=t.profile,E=Object.keys(s).join(", "),h=a.replace(/^ngcompass:/,""),S=Xe.has(h)?` "${a}" is a built-in preset, not a config profile. Use 'extends: "ngcompass:${h}"' in your config instead.`:"",{config:void 0,report:{valid:false,issues:[{code:"error-profile-not-found",message:`Profile "${a}" not found. Available: [${E}]${S}`,path:["profiles",a],severity:"error",file:r}]}}}let m=await H({...c,config:e}),d=defu.defu(p,e),y=await H({...c,config:d,basePath:["profiles",t.profile]});return ye([...m.issues,...y.issues],y.validated)}let{issues:f,validated:g}=await H({...c,config:e});return ye(f,g)}var _="ngcompass",rt=[`${_}.config.ts`,`${_}.config.js`,`${_}.config.mjs`,`${_}.config.cjs`,`${_}.config.json`,`.${_}rc`,`.${_}rc.json`,"package.json"],k=e=>{let t=url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)));return jiti.createJiti(e,{alias:{"@ngcompass/config":O__namespace.default.basename(t).startsWith("index.")?t:url.fileURLToPath(new URL("../index.ts",(typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))))}}).import(e).then(r=>r&&typeof r=="object"&&"default"in r?r.default??r:r)},_e=(e,t)=>JSON.parse(t.replace(/^\uFEFF/,"")),Se=async e=>{common.time("config-discovery"),common.debug("discovery",`Searching for config in: ${e}`);let t=lilconfig.lilconfig(_,{searchPlaces:rt,loaders:{".ts":k,".js":k,".mjs":k,".cjs":k,".json":_e,noExt:_e}}),r=await t.search(e);if(!r)return common.debug("discovery","No config file found"),common.timeEnd("config-discovery"),null;common.debug("discovery",`Found config: ${r.filepath}`);let i="",n="";common.time("content-hash");try{i=$__namespace.default.readFileSync(r.filepath,"utf-8"),n=j(i);let c=common.timeEnd("content-hash");common.debug("discovery",`Content hash: ${n.substring(0,8)}... (${c.toFixed(1)}ms)`);}catch(c){common.timeEnd("content-hash");let s=c instanceof Error?c.message:String(c);common.debug("discovery",`Failed to re-read config file for hashing: ${s}`);}let o=common.timeEnd("config-discovery");return common.debug("discovery",`Discovery complete: ${o.toFixed(1)}ms`),{config:r.config,filepath:r.filepath,content:i,contentHash:n,isEmpty:r.isEmpty}};var xe=async e=>{common.time("config-resolution");let{cwd:t,profile:r,cache:i}=e;common.debug("loader",`Starting config resolution (cwd: ${t}, profile: ${r||"none"})`);let n=await Se(t),{hash:o,cachedResult:c}=await st(n,r,i);if(c){let f=common.timeEnd("config-resolution");return common.debug("loader",`Cache HIT - returning cached result (${f.toFixed(1)}ms)`),c}common.debug("loader","Cache MISS - running validation");let s=await at(n,r,i);common.debug("loader",`Validation complete: ${s.report.valid?"valid":`invalid (${s.report.issues.length} issues)`}`),i&&o&&(await i.configs.set(o,s),common.debug("loader",`Cached validation result: key=${o.substring(0,8)}...`));let a=common.timeEnd("config-resolution");return common.debug("loader",`Config resolution complete: ${a.toFixed(1)}ms`),s};async function st(e,t,r){if(!r)return {};let i=[e?.contentHash??"",t??"",common.PACKAGE_VERSION,common.CACHE_VERSION].join("::"),n=r.computeHash(i);common.debug("loader",`Cache lookup: key=${n.substring(0,8)}...`);let o=await r.configs.get(n);return {hash:n,cachedResult:o}}async function at(e,t,r){return Ee(e?.config??{},w({profile:t}),e?.filepath,e?.content,r?.asts,e?.contentHash)}async function Or(e){try{return await xe(e)}catch(t){return {config:void 0,report:{valid:false,issues:[{code:"error-conf-semantic",message:t instanceof Error?t.message:String(t),path:[],severity:"error"}]}}}}var ct=(e={})=>{let t=e.include??v.include,r=e.exclude??v.exclude,i=t.map(o=>` '${o}',`).join(`
`),n=r.map(o=>` '${o}',`).join(`
`);return `import { defineConfig } from '@ngcompass/config';

@@ -13,3 +13,3 @@

exclude: [
${a}
${n}
],

@@ -24,6 +24,6 @@

});
`},at=async e=>{try{return await B__default.default.access(e),!0}catch(t){return common.debug("init",`Path does not exist or is inaccessible: ${e}`),common.debug("init",Y(t)),false}};async function lt(e){let t,r=O__namespace.default.join(e,"angular.json"),i=await ct(r);if(!i)return;let a=(function(s,u){try{let g=JSON.parse(s);return H(g)?g:void 0}catch(g){common.debug("init",`Angular workspace detection skipped for ${u}: ${Y(g)}`);return}})(i,r);if(!a)return;let o=H(t=a.projects)?t:void 0;if(!o)return;let l=(function(s){let u=[],g=new Set;for(let p of Object.values(s)){let m=(function(d){if(!H(d))return;let h=d.sourceRoot;if(typeof h=="string"&&h.trim()!=="")return Se(h);let y=d.root;if(typeof y=="string"&&y.trim()!=="")return Se(y)})(p);!m||g.has(m)||(g.add(m),u.push(m));}return u.sort((p,m)=>p.localeCompare(m))})(o);if(l.length!==0){var n=l;let s=[];for(let u of n)s.push(`${u}/**/*.ts`),s.push(`${u}/**/*.html`);return s}}async function Pr(e={}){let t=e.cwd??process.cwd(),r=O__namespace.default.join(t,"ngcompass.config.ts");if(!e.force&&await at(r))return {success:false,filePath:r,alreadyExists:true};let i=await lt(t);return await B__default.default.writeFile(r,st({include:i}),"utf-8"),{success:true,filePath:r}}async function ct(e){try{return await B__default.default.readFile(e,"utf-8")}catch(t){common.debug("init",`Angular workspace detection skipped for ${e}: ${Y(t)}`);return}}function Se(e){return e.replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"")}function H(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Y(e){return e instanceof Error?e.message:String(e)}function Ir(e){return e}var dt={typeCheckingEnabled:false,templateASTEnabled:true,cssASTEnabled:true},mt=async(e,t,r,i=dt)=>{if(e.length===0)return;common.debug("plugin-loader",`Initializing loader for ${e.length} plugin(s) at ${t}`);let a=module$1.createRequire(O__namespace.default.join(t,"package.json")),o=[];for(let l of e){let n=await gt(l,a,i,r);n&&o.push(`- "${l}": ${n}`);}if(o.length>0)throw Error(`[ngcompass] Plugin Load Failure:
`},lt=async e=>{try{return await B__default.default.access(e),!0}catch(t){return common.debug("init",`Path does not exist or is inaccessible: ${e}`),common.debug("init",q(t)),false}};async function ut(e){let t,r=O__namespace.default.join(e,"angular.json"),i=await Ce(r);if(!i)return;let n=Re(i,r);if(!n)return;let o=K(t=n.projects)?t:void 0;if(!o)return;let c=await ft(o,e);if(c.length!==0){var s=c;let a=[];for(let f of s)a.push(`${f}/**/*.ts`),a.push(`${f}/**/*.html`);return a}}async function $r(e={}){let t=e.cwd??process.cwd(),r=O__namespace.default.join(t,"ngcompass.config.ts");if(!e.force&&await lt(r))return {success:false,filePath:r,alreadyExists:true};let i=await ut(t);return await B__default.default.writeFile(r,ct({include:i}),"utf-8"),{success:true,filePath:r}}async function Ce(e){try{return await B__default.default.readFile(e,"utf-8")}catch(t){common.debug("init",`Angular workspace detection skipped for ${e}: ${q(t)}`);return}}function Re(e,t){try{let r=JSON.parse(e);return K(r)?r:void 0}catch(r){common.debug("init",`Angular workspace detection skipped for ${t}: ${q(r)}`);return}}async function ft(e,t){let r=[],i=new Set;for(let n of Object.values(e)){let o=await pt(n,t);!o||i.has(o)||(i.add(o),r.push(o));}return r.sort((n,o)=>n.localeCompare(o))}async function pt(e,t){return K(e)?(function(r){let i=r.sourceRoot;if(typeof i=="string"&&i.trim()!=="")return M(i);let n=r.root;if(typeof n=="string"&&n.trim()!=="")return M(n)})(e):typeof e=="string"&&e.trim()!==""?dt(e.trim(),t):void 0}async function dt(e,t){let r=O__namespace.default.join(t,e,"project.json"),i=await Ce(r);if(i){let n=Re(i,r);if(n){let o=n.sourceRoot;if(typeof o=="string"&&o.trim()!=="")return M(o)}}return M(`${e}/src`)}function M(e){return e.replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"")}function K(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function q(e){return e instanceof Error?e.message:String(e)}function Ur(e){return e}var yt={typeCheckingEnabled:false,templateASTEnabled:true,cssASTEnabled:true},Et=async(e,t,r,i=yt)=>{if(e.length===0)return;common.debug("plugin-loader",`Initializing loader for ${e.length} plugin(s) at ${t}`);let n=module$1.createRequire(O__namespace.default.join(t,"package.json")),o=[];for(let c of e){let s=await vt(c,n,i,r);s&&o.push(`- "${c}": ${s}`);}if(o.length>0)throw Error(`[ngcompass] Plugin Load Failure:
${o.join(`
`)}
Ensure plugins are installed and satisfy version requirements.`)};async function gt(e,t,r,i){try{let a=(function(s,u){try{return u.resolve(s)}catch{return s}})(e,t),o=await ht(a),l=Array.isArray(o)?o:[o],n=0;for(let s of l){if(!(function(u){if(!u||typeof u!="object")return !1;let g=u.handler;return typeof u.name=="string"&&u.name.length>0&&typeof g?.handle=="function"})(s)){common.warn("plugin-loader",`Plugin "${e}" exported an invalid structure. Skipping.`);continue}if(s.manifest){let u=(function(g,p){let m=(function(d,h,y,E){var A;let x,T=h.trim();if(!T||T==="*")return null;let C=K(d);if(!C)return null;let I=T.startsWith("^")?(x=K(A=T.slice(1)))?`>=${A} <${x[0]+1}.0.0`:null:T;if(!I)return null;for(let Oe of I.split(/\s+/).filter(Boolean)){let W=Oe.match(Et);if(!W)continue;let L=W[1],q=K(W[2]);if(!q)continue;let P=(function(z,X){for(let R=0;R<3;R++)if(z[R]!==X[R])return z[R]>X[R]?1:-1;return 0})(C,q);if(!(L===">="?P>=0:L==="<="?P<=0:L===">"?P>0:L==="<"?P<0:P===0))return `Plugin "${y}@${E}" requires engine "${h}", found "${d}".`}return null})(common.PACKAGE_VERSION.replace(/^v/,""),g.engineVersionRange,g.name,g.version);if(m)return m;for(let d of [{key:"requiresTypeInfo",current:p.typeCheckingEnabled,label:"Type Information"},{key:"requiresTemplateAST",current:p.templateASTEnabled,label:"Template AST"},{key:"requiresCssAST",current:p.cssASTEnabled,label:"CSS AST"}])if(g.capabilities?.[d.key]&&!d.current)return `Plugin "${g.name}@${g.version}" requires ${d.label} support, which is currently disabled.`;return null})(s.manifest,r);if(u)throw Error(u);common.debug("plugin-loader",`\u276F Validated: ${s.manifest.name}@${s.manifest.version}`);}else common.warn("plugin-loader",`Plugin "${e}" is missing a manifest. Please update for future compatibility.`);i.register(s),n++,common.debug("plugin-loader",`\u276F Registered Rule: ${s.name}`);}return common.debug("plugin-loader",`Plugin "${e}" processed: ${n} rules active.`),null}catch(a){return a instanceof Error?a.message:String(a)}}async function ht(e){let t=O__namespace.default.isAbsolute(e)?url.pathToFileURL(e).href:e,r=await import(t);return r.default??r}var yt=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/,Et=/^(>=|<=|>|<|=|==)(\d+\.\d+\.\d+.*)$/;function K(e){let t=e.trim().match(yt);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}exports.AnalyzerConfigSchema=ee;exports.DEFAULT_CACHE_OPTIONS=b;exports.DEFAULT_CONFIG=v;exports.MESSAGES=f;exports.ProfileConfigSchema=Ue;exports.VALID_RULE_SEVERITIES=ue;exports.createDefaultContext=w;exports.defineConfig=Ir;exports.detectAngularWorkspaceIncludes=lt;exports.findAndLoadConfig=Te;exports.getDefaultMaxWorkers=J;exports.initConfig=Pr;exports.loadPlugins=mt;exports.renderConfigTemplate=st;exports.resolveConfig=Ae;exports.validateConfig=Sr;exports.validateConfigBlock=U;exports.validateConfiguration=he;exports.validateCrossFields=te;exports.validateDeprecatedFields=re;exports.validateExtendsChain=ie;exports.validateGlobPatterns=ne;exports.validatePaths=le;exports.validateProfiles=ce;exports.validateRules=fe;//# sourceMappingURL=index.cjs.map
Ensure plugins are installed and satisfy version requirements.`)};async function vt(e,t,r,i){try{let n=(function(a,f){try{return f.resolve(a)}catch{return a}})(e,t),o=await Tt(n),c=Array.isArray(o)?o:[o],s=0;for(let a of c){if(!(function(f){if(!f||typeof f!="object")return !1;let g=f.handler;return typeof f.name=="string"&&f.name.length>0&&typeof g?.handle=="function"})(a)){common.warn("plugin-loader",`Plugin "${e}" exported an invalid structure. Skipping.`);continue}if(a.manifest){let f=(function(g,p){let m=(function(d,y,E,h){var S;let x,T=y.trim();if(!T||T==="*")return null;let C=z(d);if(!C)return null;let I=T.startsWith("^")?(x=z(S=T.slice(1)))?`>=${S} <${x[0]+1}.0.0`:null:T;if(!I)return null;for(let Pe of I.split(/\s+/).filter(Boolean)){let V=Pe.match(St);if(!V)continue;let L=V[1],X=z(V[2]);if(!X)continue;let P=(function(J,Z){for(let R=0;R<3;R++)if(J[R]!==Z[R])return J[R]>Z[R]?1:-1;return 0})(C,X);if(!(L===">="?P>=0:L==="<="?P<=0:L===">"?P>0:L==="<"?P<0:P===0))return `Plugin "${E}@${h}" requires engine "${y}", found "${d}".`}return null})(common.PACKAGE_VERSION.replace(/^v/,""),g.engineVersionRange,g.name,g.version);if(m)return m;for(let d of [{key:"requiresTypeInfo",current:p.typeCheckingEnabled,label:"Type Information"},{key:"requiresTemplateAST",current:p.templateASTEnabled,label:"Template AST"},{key:"requiresCssAST",current:p.cssASTEnabled,label:"CSS AST"}])if(g.capabilities?.[d.key]&&!d.current)return `Plugin "${g.name}@${g.version}" requires ${d.label} support, which is currently disabled.`;return null})(a.manifest,r);if(f)throw Error(f);common.debug("plugin-loader",`\u276F Validated: ${a.manifest.name}@${a.manifest.version}`);}else common.warn("plugin-loader",`Plugin "${e}" is missing a manifest. Please update for future compatibility.`);i.register(a),s++,common.debug("plugin-loader",`\u276F Registered Rule: ${a.name}`);}return common.debug("plugin-loader",`Plugin "${e}" processed: ${s} rules active.`),null}catch(n){return n instanceof Error?n.message:String(n)}}async function Tt(e){let t=O__namespace.default.isAbsolute(e)?url.pathToFileURL(e).href:e,r=await import(t);return r.default??r}var _t=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/,St=/^(>=|<=|>|<|=|==)(\d+\.\d+\.\d+.*)$/;function z(e){let t=e.trim().match(_t);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}exports.AnalyzerConfigSchema=re;exports.DEFAULT_CACHE_OPTIONS=b;exports.DEFAULT_CONFIG=v;exports.MESSAGES=u;exports.ProfileConfigSchema=De;exports.VALID_RULE_SEVERITIES=pe;exports.createDefaultContext=w;exports.defineConfig=Ur;exports.detectAngularWorkspaceIncludes=ut;exports.findAndLoadConfig=Se;exports.getDefaultMaxWorkers=Q;exports.initConfig=$r;exports.loadPlugins=Et;exports.renderConfigTemplate=ct;exports.resolveConfig=xe;exports.validateConfig=Or;exports.validateConfigBlock=U;exports.validateConfiguration=Ee;exports.validateCrossFields=oe;exports.validateDeprecatedFields=ie;exports.validateExtendsChain=se;exports.validateGlobPatterns=ae;exports.validatePaths=ue;exports.validateProfiles=fe;exports.validateRules=de;//# sourceMappingURL=index.cjs.map
//# sourceMappingURL=index.cjs.map

@@ -1,3 +0,3 @@

import {DEFAULT_INCLUDE_PATTERNS,time,debug,timeEnd,PACKAGE_VERSION,CACHE_VERSION,warn,ASTUtils}from'@ngcompass/common';import*as $ from'fs';import $__default from'fs';import*as O from'path';import O__default from'path';import Ie,{cpus}from'os';import Pe from'process';import {defu}from'defu';import {z}from'zod';import {createRequire}from'module';import {minimatch}from'minimatch';import He from'crypto';import {pathToFileURL,fileURLToPath}from'url';import {createJiti}from'jiti';import {lilconfig}from'lilconfig';import B from'fs/promises';function w(e={}){return {cwd:Pe.cwd(),fs:{existsSync:$.existsSync,accessSync:(t,r)=>$.accessSync(t,r)},os:{cpus:cpus},path:{dirname:O.dirname,resolve:O.resolve,isAbsolute:O.isAbsolute},...e}}var J=()=>Math.max(1,Math.min(4,Ie.cpus().length-1)),b={enabled:true,location:"node_modules/.cache/ngcompass",strategy:"local",ttl:864e5},v={outputFormat:"text",failOnSeverity:"error",maxWarnings:10,include:DEFAULT_INCLUDE_PATTERNS,exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.spec.ts","**/*.test.ts"]};var V=z.enum(["warn","error"]),Le=z.enum(["json","text","sarif","html"]),Z=z.union([V,z.literal("off"),z.object({severity:z.union([V,z.literal("off")]),options:z.record(z.string(),z.unknown()).optional()})]),$e=z.object({enabled:z.boolean().optional(),location:z.string().optional(),strategy:z.enum(["memory","local"]).optional(),ttl:z.number().optional()}),we=z.object({project:z.string().optional(),tsconfigRootDir:z.string().optional(),sourceType:z.enum(["module","commonjs"]).optional(),ecmaVersion:z.number().optional()}),Q=z.object({extends:z.union([z.string(),z.array(z.string())]).optional(),include:z.array(z.string()).default(()=>[...v.include]),exclude:z.array(z.string()).default(()=>[...v.exclude]),maxWorkers:z.number().optional(),concurrency:z.number().optional(),cache:z.union([z.boolean(),$e]).optional(),cacheLocation:z.string().optional(),outputFormat:Le.default(v.outputFormat),outputPath:z.string().optional(),failOnSeverity:V.default(v.failOnSeverity),maxWarnings:z.number().default(v.maxWarnings),ignorePatterns:z.array(z.string()).optional(),rules:z.record(z.string(),Z).optional(),overrides:z.array(z.object({files:z.union([z.string(),z.array(z.string())]),rules:z.record(z.string(),Z).optional()})).optional(),parserOptions:we.optional()}),Ue=z.lazy(()=>Q.partial()),ee=Q.extend({profiles:z.record(z.string(),Ue).optional()}).transform(e=>{let t,r=e.maxWorkers??e.concurrency??J();if(e.cache===false)t={...b,enabled:false};else if(e.cache===true||e.cache===void 0){let i=e.cacheLocation??b.location;t={...b,location:i};}else t={...b,...e.cache};return {...e,maxWorkers:r,cache:t,rules:e.rules??{},overrides:e.overrides??[],ignorePatterns:e.ignorePatterns??[]}});var f={NEGATIVE_MAX_WARNINGS:e=>({code:"negative-max-warnings",message:`Value for 'maxWarnings' must be non-negative. Received: ${e}.`,suggestion:"Set 'maxWarnings' to 0 or higher, or remove it to use default (10).",severity:"error"}),WORKERS_BELOW_MINIMUM:{code:"workers-below-minimum",message:"Value for 'maxWorkers' must be at least 1.",suggestion:"Set to 1 or higher, or remove to use default (CPU count - 1).",severity:"error"},NEGATIVE_CACHE_TTL:e=>({code:"negative-cache-ttl",message:`Cache TTL must be non-negative. Received: ${e}ms.`,suggestion:"Set to 0 (default TTL) or higher. Example: 86400000 for 24 hours.",severity:"error"}),WORKERS_EXCESSIVE:(e,t)=>({code:"warn-workers-excessive",message:`Worker count (${e}) exceeds CPU count (${t}). May cause context switching overhead.`,suggestion:`Reduce to ${t} or lower for optimal performance.`,severity:"warning"}),CACHE_TTL_ZERO:{code:"warn-cache-ttl-zero",message:"Cache TTL is set to 0. Using driver default TTL (typically 24 hours).",suggestion:"Set explicit TTL if you need different cache expiration behavior.",severity:"warning"},INVALID_GLOB_PATTERN:(e,t)=>({code:"invalid-glob-pattern",message:`Glob pattern "${e}" is invalid. Error: ${t}.`,suggestion:"Check pattern syntax. Valid examples: 'src/**/*.ts', '**/*.{ts,html}'.",severity:"error"}),EMPTY_INCLUDE:{code:"empty-include",message:"No include patterns defined. Analysis will skip all files.",suggestion:"Add patterns like ['src/**/*.ts', 'src/**/*.html'] to enable analysis.",severity:"error"},EMPTY_EXCLUDE:{code:"warn-empty-exclude",message:"No exclude patterns defined. Performance may degrade.",suggestion:"Add common exclusions: ['node_modules/**', 'dist/**', '**/*.spec.ts'].",severity:"warning"},DUPLICATE_PATTERNS:(e,t)=>({code:"warn-duplicate-patterns",message:`Duplicate patterns found in "${e}": ${t.map(r=>`"${r}"`).join(", ")}.`,suggestion:"Remove duplicate entries to simplify configuration.",severity:"warning"}),EMPTY_GLOB_PATTERN:e=>({code:"empty-glob-pattern",message:`Empty string detected in "${e}" patterns.`,suggestion:"Remove empty strings from the pattern array.",severity:"error"}),TSCONFIG_ROOT_NOT_FOUND:e=>({code:"tsconfig-root-not-found",message:`TSConfig root directory not found: "${e}".`,suggestion:"Verify the directory exists and the path is correct relative to the config file.",severity:"error"}),TSCONFIG_PROJECT_NOT_FOUND:e=>({code:"tsconfig-project-not-found",message:`TSConfig file not found: "${e}".`,suggestion:"Verify the file exists and the path is relative to 'tsconfigRootDir' or config location.",severity:"error"}),OUTPUT_PATH_TRAVERSAL:e=>({code:"output-path-traversal",message:`Output path contains unsafe traversal (..): "${e}".`,suggestion:"Use absolute paths or paths without '..' to prevent security issues.",severity:"error"}),OUTPUT_PATH_SYSTEM_DIR:e=>({code:"output-path-system-dir",message:`Output path points to a system directory: "${e}".`,suggestion:"Choose a safe output location within your project directory.",severity:"error"}),OUTPUT_PATH_NOT_FOUND:e=>({code:"output-path-not-found",message:`Output directory does not exist: "${e}".`,suggestion:"Create the directory or update 'outputPath' to an existing location.",severity:"error"}),OUTPUT_PATH_NOT_WRITABLE:e=>({code:"output-path-not-writable",message:`Output directory is not writable: "${e}".`,suggestion:"Check directory permissions or choose a different output location.",severity:"error"}),CACHE_IN_NODE_MODULES:e=>({code:"cache-in-node-modules",message:`Cache location inside 'node_modules' is unsafe: "${e}". node_modules can be deleted, causing cache loss.`,suggestion:"Use a different directory like '.cache' or 'node_modules/.cache/ngcompass'.",severity:"error"}),CACHE_PARENT_NOT_FOUND:e=>({code:"warn-cache-parent-not-found",message:`Cache parent directory missing: "${e}". It will be created automatically.`,suggestion:"No action needed. Directory will be created on first cache write.",severity:"warning"}),INVALID_RULE_SEVERITY:(e,t)=>({code:"invalid-rule-severity",message:`Rule "${e}" has invalid severity: "${t}".`,suggestion:"Use one of: 'warn', 'error', or 'off'.",severity:"error"}),NO_RULES_CONFIGURED:{code:"warn-no-rules-configured",message:"No rules configured. Analysis effectively skips checks.",suggestion:"Add rules to enable analysis, or extend from a preset like 'recommended'.",severity:"warning"},EMPTY_RULE_NAME:{code:"empty-rule-name",message:"Empty rule name detected. Rule keys must be non-empty strings.",suggestion:"Remove empty keys from 'rules' configuration.",severity:"error"},PROFILE_CIRCULAR_INHERITANCE:e=>({code:"profile-circular-inheritance",message:`Circular profile inheritance detected: ${e.join(" \u2192 ")}.`,suggestion:"Break the circular dependency by removing one 'extends' reference.",severity:"error"}),PROFILE_EMPTY:{code:"warn-profile-empty",message:"Profiles section is defined but empty. Consider removing it.",suggestion:"Remove 'profiles: {}' or add at least one profile like 'dev' or 'ci'.",severity:"warning"},EXTENDS_NOT_FOUND:e=>({code:"extends-not-found",message:`Cannot resolve preset "${e}". Make sure the package is installed.`,suggestion:`Run: npm install --save-dev ${e}`,severity:"error"}),DEPRECATED_CACHE_LOCATION:{code:"warn-deprecated-cache-location",message:"'cacheLocation' is deprecated. Use 'cache.location' instead.",suggestion:`Replace 'cacheLocation: "..."' with 'cache: { location: "..." }'.`,severity:"warning"},DEPRECATED_CONCURRENCY:{code:"warn-deprecated-concurrency",message:"'concurrency' is deprecated. Use 'maxWorkers' instead.",suggestion:"Replace 'concurrency: N' with 'maxWorkers: N'.",severity:"warning"}};function U(e,t,r=[]){let i=[];if(e.maxWorkers!==void 0){let a=2*t.os.cpus().length;e.maxWorkers<1?i.push({...f.WORKERS_BELOW_MINIMUM,path:[...r,"maxWorkers"]}):e.maxWorkers>a&&i.push({...f.WORKERS_EXCESSIVE(e.maxWorkers,a),path:[...r,"maxWorkers"]});}if(e.cache&&typeof e.cache=="object"&&e.cache.ttl!==void 0){let{ttl:a}=e.cache;a<0&&i.push({...f.NEGATIVE_CACHE_TTL(a),path:[...r,"cache","ttl"]});}return {issues:i}}function te(e,t,r=[]){let i=[];e.maxWarnings!==void 0&&e.maxWarnings<0&&i.push({...f.NEGATIVE_MAX_WARNINGS(e.maxWarnings),path:[...r,"maxWarnings"]});let{issues:a}=U(e,t,r);return i.push(...a),{issues:i}}function re(e,t=[]){let r=[];return e&&typeof e=="object"&&("cacheLocation"in e&&e.cacheLocation!==void 0&&r.push({...f.DEPRECATED_CACHE_LOCATION,path:[...t,"cacheLocation"]}),"concurrency"in e&&e.concurrency!==void 0&&r.push({...f.DEPRECATED_CONCURRENCY,path:[...t,"concurrency"]})),{issues:r}}function ie(e,t,r){let i=[];if(!e.extends)return {issues:i};let a=Array.isArray(e.extends),o=a?e.extends:[e.extends];for(let l=0;l<o.length;l++){let n=o[l];if(typeof n!="string"||n.trim()===""||n.startsWith(".")||O__default.isAbsolute(n)||n.includes(":")||(function(u,g){try{let p=O__default.join(g,"__resolve_anchor__.cjs");return createRequire(p).resolve(u)}catch{return null}})(n,r)!==null)continue;let s=[...t,"extends"];a&&s.push(l),i.push({...f.EXTENDS_NOT_FOUND(n),path:s});}return {issues:i}}var ke=/\/\/\//,Fe=/\{/g,Me=/\}/g,We=/\[/g,Ve=/\]/g;function ne(e,t=[]){let r=[];for(let i of ["include","exclude","ignorePatterns"]){let a=e[i];if(!Array.isArray(a))continue;for(let l=0;l<a.length;l++)r.push(...(function(n,s,u,g){let p=[],m=[...g,n,u];if(!s||s.trim()==="")return p.push({...f.EMPTY_GLOB_PATTERN(n),path:m}),p;if((s.match(We)||[]).length!==(s.match(Ve)||[]).length)return p.push({...f.INVALID_GLOB_PATTERN(s,"unmatched character class brackets"),path:m}),p;if(ke.test(s)||s.startsWith("///"))return p.push({...f.INVALID_GLOB_PATTERN(s,"invalid path pattern with multiple slashes"),path:m}),p;(s.endsWith("\\")||s.endsWith("/"))&&p.push({...f.INVALID_GLOB_PATTERN(s,"trailing slash not allowed"),path:m}),(s.match(Fe)||[]).length!==(s.match(Me)||[]).length&&p.push({...f.INVALID_GLOB_PATTERN(s,"unmatched braces"),path:m});try{minimatch("sample.ts",s);}catch(d){let h=d instanceof Error?d.message:String(d);p.push({...f.INVALID_GLOB_PATTERN(s,h),path:m});}return p})(i,a[l],l,t));let o=(function(l){let n=new Set,s=new Set;for(let u of l)n.has(u)?s.add(u):n.add(u);return [...s]})(a);o.length>0&&r.push({...f.DUPLICATE_PATTERNS(i,o),path:[...t,i]});}return e.include&&e.include.length!==0||r.push({...f.EMPTY_INCLUDE,path:[...t,"include"]}),e.exclude&&e.exclude.length!==0||r.push({...f.EMPTY_EXCLUDE,path:[...t,"exclude"]}),{issues:r}}var Ge=["/etc/","\\etc\\","/var/","\\var\\"],se=/[\\/]/;function le(e,t,r=[]){let i=[],a=o=>t.path.isAbsolute(o)?o:t.path.resolve(t.cwd,o);if(e.outputPath){let{outputPath:o}=e,l=[...r,"outputPath"];o.includes("..")&&i.push({...f.OUTPUT_PATH_TRAVERSAL(o),path:l}),Ge.some(s=>o.includes(s))&&i.push({...f.OUTPUT_PATH_SYSTEM_DIR(o),path:l});let n=t.path.dirname(a(o));if(t.fs.existsSync(n))try{t.fs.accessSync(n,$.constants.W_OK);}catch{i.push({...f.OUTPUT_PATH_NOT_WRITABLE(n),path:l});}else i.push({...f.OUTPUT_PATH_NOT_FOUND(n),path:l});}if(e.cache&&typeof e.cache=="object"&&e.cache.enabled){let{location:o}=e.cache;if(o){let l,n,s=[...r,"cache","location"];o.split(se).includes("node_modules")&&((n=(l=o.split(se)).indexOf("node_modules"))===-1||l[n+1]!==".cache")&&i.push({...f.CACHE_IN_NODE_MODULES(o),path:s});let u=t.path.dirname(a(o));t.fs.existsSync(u)||i.push({...f.CACHE_PARENT_NOT_FOUND(u),path:s});}}if(e.parserOptions){let{project:o,tsconfigRootDir:l}=e.parserOptions;if(o){let n=a(o);t.fs.existsSync(n)||i.push({...f.TSCONFIG_PROJECT_NOT_FOUND(o),path:[...r,"parserOptions","project"]});}if(l){let n=a(l);t.fs.existsSync(n)||i.push({...f.TSCONFIG_ROOT_NOT_FOUND(l),path:[...r,"parserOptions","tsconfigRootDir"]});}}return {issues:i}}function ce(e,t){let r=[];if(!e.profiles||typeof e.profiles!="object")return {issues:r};let i=e.profiles,a=Object.keys(i);if(a.length===0)return r.push({...f.PROFILE_EMPTY,path:["profiles"]}),{issues:r};for(let[l,n]of Object.entries(i)){if(!n||typeof n!="object")continue;let{issues:s}=U(n,t,["profiles",l]);r.push(...s);}let o=new Set;for(let l of a)(function(n,s,u,g){let p=[],m=n;for(;m!==void 0;){if(u.has(m))return;if(p.includes(m)){for(let d of(g.push({...f.PROFILE_CIRCULAR_INHERITANCE([...p,m]),path:["profiles",p[0],"extends"]}),p))u.add(d);return}p.push(m),m=(function(d){if(!d||typeof d!="object")return;let h=d.extends;return typeof h=="string"?h:void 0})(s[m]);}for(let d of p)u.add(d);})(l,i,o,r);return {issues:r}}var ue=["warn","error","off"];function fe(e,t=[]){var r;let i=[],a=Object.entries(e.rules||{});for(let[o,l]of(a.length>0||(Array.isArray(r=e.extends)?r.length>0:r)||i.push({...f.NO_RULES_CONFIGURED,path:[...t,"rules"]}),a)){if(!o||o.trim()===""){i.push({...f.EMPTY_RULE_NAME,path:[...t,"rules"]});continue}if(typeof l=="object"&&l!==null){let{severity:n}=l;n&&!ue.includes(n)&&i.push({...f.INVALID_RULE_SEVERITY(o,n),path:[...t,"rules",o,"severity"]});}}return {issues:i}}function D(e){return He.createHash("sha1").update(e).digest("hex")}function de(e,t){let r=ASTUtils.parse(e,t);return ASTUtils.generateLocationMap(r)}async function Ye(e,t,r,i){if(!r)return de(e,t);let a=`v${CACHE_VERSION}:${i}`,o=await r.get(a);if(o&&(function(n){if(!n||typeof n!="object")return false;for(let s of Object.values(n))return !!(s&&typeof s=="object"&&"line"in s&&"column"in s);return true})(o.ast))return o.ast;let l=de(e,t);return await r.set(a,{filePath:t,ast:l}),l}async function me(e,t,r,i,a){if(e.length===0)return;let o=a??D(t),l=await Ye(t,r,i,o);for(let n of e){if(n.file||(n.file=r),!((!n.line||n.line===1)&&n.path))continue;let s=l[n.path.join(".")];s&&(n.line=s.line,n.column=s.column);}}var qe=new Set(["recommended","strict","performance","reactivity","all"]);async function ze(e,t,r,i,a){if(r)return void await me(e,r,t,i,a);for(let o of e)o.file||(o.file=t);}function ge(e,t){let r,i=[...(r=new Set,e.filter(o=>{let l=o.path?o.path.join("."):"",n=`${o.code}:${o.message}:${l}`;return !r.has(n)&&(r.add(n),true)}))].sort((o,l)=>o.severity===l.severity?0:o.severity==="error"?-1:1),a=!i.some(o=>o.severity==="error");return {config:a?t:void 0,report:{valid:a,issues:i}}}async function G(e){let t,{config:r,context:i,basePath:a=[],filePath:o,fileContent:l,astCache:n,contentHash:s}=e,{issues:u,validated:g,success:p}=(t=ee.safeParse(r)).success?{issues:[],validated:t.data,success:true}:{issues:t.error.issues.map(d=>({code:d.code.replace(/_/g,"-"),message:d.message,path:[...a,...d.path],severity:"error",file:o})),validated:r,success:false},m=[...u,...(function(d,h,y,E,A){let x=[];for(let T of [{name:"cross-fields",run:()=>te(d,y,E).issues},{name:"glob-patterns",run:()=>ne(d,E).issues},{name:"paths",run:()=>le(d,y,E).issues},{name:"rules",run:()=>fe(d,E).issues},{name:"extends-chain",run:()=>ie(d,E,y.cwd).issues},{name:"profiles",run:()=>ce(d,y).issues},{name:"deprecated",run:()=>re(h,E).issues}])try{x.push(...T.run());}catch(C){let I=C instanceof Error?C.message:String(C);x.push({code:"check-failed",message:`Check "${T.name}" encountered an unexpected error: ${I}`,path:E,severity:"error",file:A});}return x})(g,r,i,a,o)];return o&&await ze(m,o,l,n,s),{issues:m,validated:p?g:void 0}}async function he(e,t=w(),r,i,a,o){let l={context:t,filePath:r,fileContent:i,astCache:a,contentHash:o},n=(function(p){if(!p||typeof p!="object")return {};let m=p.profiles;return m&&typeof m=="object"?m:{}})(e);if(t.profile){let p=n[t.profile];if(!p){var s;let y,E,A;return s=t.profile,y=Object.keys(n).join(", "),E=s.replace(/^ngcompass:/,""),A=qe.has(E)?` "${s}" is a built-in preset, not a config profile. Use 'extends: "ngcompass:${E}"' in your config instead.`:"",{config:void 0,report:{valid:false,issues:[{code:"error-profile-not-found",message:`Profile "${s}" not found. Available: [${y}]${A}`,path:["profiles",s],severity:"error",file:r}]}}}let m=await G({...l,config:e}),d=defu(p,e),h=await G({...l,config:d,basePath:["profiles",t.profile]});return ge([...m.issues,...h.issues],h.validated)}let{issues:u,validated:g}=await G({...l,config:e});return ge(u,g)}var _="ngcompass",et=[`${_}.config.ts`,`${_}.config.js`,`${_}.config.mjs`,`${_}.config.cjs`,`${_}.config.json`,`.${_}rc`,`.${_}rc.json`,"package.json"],k=e=>{let t=fileURLToPath(import.meta.url);return createJiti(e,{alias:{"@ngcompass/config":O__default.basename(t).startsWith("index.")?t:fileURLToPath(new URL("../index.ts",import.meta.url))}}).import(e).then(r=>r&&typeof r=="object"&&"default"in r?r.default??r:r)},ve=(e,t)=>JSON.parse(t.replace(/^\uFEFF/,"")),Te=async e=>{time("config-discovery"),debug("discovery",`Searching for config in: ${e}`);let t=lilconfig(_,{searchPlaces:et,loaders:{".ts":k,".js":k,".mjs":k,".cjs":k,".json":ve,noExt:ve}}),r=await t.search(e);if(!r)return debug("discovery","No config file found"),timeEnd("config-discovery"),null;debug("discovery",`Found config: ${r.filepath}`);let i="",a="";time("content-hash");try{i=$__default.readFileSync(r.filepath,"utf-8"),a=D(i);let l=timeEnd("content-hash");debug("discovery",`Content hash: ${a.substring(0,8)}... (${l.toFixed(1)}ms)`);}catch(l){timeEnd("content-hash");let n=l instanceof Error?l.message:String(l);debug("discovery",`Failed to re-read config file for hashing: ${n}`);}let o=timeEnd("config-discovery");return debug("discovery",`Discovery complete: ${o.toFixed(1)}ms`),{config:r.config,filepath:r.filepath,content:i,contentHash:a,isEmpty:r.isEmpty}};var Ae=async e=>{time("config-resolution");let{cwd:t,profile:r,cache:i}=e;debug("loader",`Starting config resolution (cwd: ${t}, profile: ${r||"none"})`);let a=await Te(t),{hash:o,cachedResult:l}=await it(a,r,i);if(l){let u=timeEnd("config-resolution");return debug("loader",`Cache HIT - returning cached result (${u.toFixed(1)}ms)`),l}debug("loader","Cache MISS - running validation");let n=await nt(a,r,i);debug("loader",`Validation complete: ${n.report.valid?"valid":`invalid (${n.report.issues.length} issues)`}`),i&&o&&(await i.configs.set(o,n),debug("loader",`Cached validation result: key=${o.substring(0,8)}...`));let s=timeEnd("config-resolution");return debug("loader",`Config resolution complete: ${s.toFixed(1)}ms`),n};async function it(e,t,r){if(!r)return {};let i=[e?.contentHash??"",t??"",PACKAGE_VERSION,CACHE_VERSION].join("::"),a=r.computeHash(i);debug("loader",`Cache lookup: key=${a.substring(0,8)}...`);let o=await r.configs.get(a);return {hash:a,cachedResult:o}}async function nt(e,t,r){return he(e?.config??{},w({profile:t}),e?.filepath,e?.content,r?.asts,e?.contentHash)}async function Sr(e){try{return await Ae(e)}catch(t){return {config:void 0,report:{valid:false,issues:[{code:"error-conf-semantic",message:t instanceof Error?t.message:String(t),path:[],severity:"error"}]}}}}var st=(e={})=>{let t=e.include??v.include,r=e.exclude??v.exclude,i=t.map(o=>` '${o}',`).join(`
`),a=r.map(o=>` '${o}',`).join(`
import {DEFAULT_INCLUDE_PATTERNS,time,debug,timeEnd,PACKAGE_VERSION,CACHE_VERSION,warn,ASTUtils}from'@ngcompass/common';import*as $ from'fs';import $__default from'fs';import*as O from'path';import O__default from'path';import $e,{cpus}from'os';import Ie from'process';import {defu}from'defu';import {z as z$1}from'zod';import {createRequire}from'module';import {minimatch}from'minimatch';import Ye from'crypto';import {pathToFileURL,fileURLToPath}from'url';import {createJiti}from'jiti';import {lilconfig}from'lilconfig';import B from'fs/promises';function w(e={}){return {cwd:Ie.cwd(),fs:{existsSync:$.existsSync,accessSync:(t,r)=>$.accessSync(t,r)},os:{cpus:cpus},path:{dirname:O.dirname,resolve:O.resolve,isAbsolute:O.isAbsolute},...e}}var Q=()=>Math.max(1,Math.min(4,$e.cpus().length-1)),b={enabled:true,location:"node_modules/.cache/ngcompass",strategy:"local",ttl:864e5},v={outputFormat:"text",failOnSeverity:"error",maxWarnings:10,include:DEFAULT_INCLUDE_PATTERNS,exclude:["**/node_modules/**","**/dist/**","**/build/**","**/*.spec.ts","**/*.test.ts"]};var G=z$1.enum(["warn","error"]),we=z$1.enum(["json","text","sarif","html"]),ee=z$1.union([G,z$1.literal("off"),z$1.object({severity:z$1.union([G,z$1.literal("off")]),options:z$1.record(z$1.string(),z$1.unknown()).optional()})]),Ue=z$1.object({enabled:z$1.boolean().optional(),location:z$1.string().optional(),strategy:z$1.enum(["memory","local"]).optional(),ttl:z$1.number().optional()}),je=z$1.object({project:z$1.string().optional(),tsconfigRootDir:z$1.string().optional(),sourceType:z$1.enum(["module","commonjs"]).optional(),ecmaVersion:z$1.number().optional()}),te=z$1.object({extends:z$1.union([z$1.string(),z$1.array(z$1.string())]).optional(),include:z$1.array(z$1.string()).default(()=>[...v.include]),exclude:z$1.array(z$1.string()).default(()=>[...v.exclude]),maxWorkers:z$1.number().optional(),concurrency:z$1.number().optional(),cache:z$1.union([z$1.boolean(),Ue]).optional(),cacheLocation:z$1.string().optional(),outputFormat:we.default(v.outputFormat),outputPath:z$1.string().optional(),failOnSeverity:G.default(v.failOnSeverity),maxWarnings:z$1.number().default(v.maxWarnings),ignorePatterns:z$1.array(z$1.string()).optional(),rules:z$1.record(z$1.string(),ee).optional(),overrides:z$1.array(z$1.object({files:z$1.union([z$1.string(),z$1.array(z$1.string())]),rules:z$1.record(z$1.string(),ee).optional()})).optional(),parserOptions:je.optional()}),De=z$1.lazy(()=>te.partial()),re=te.extend({profiles:z$1.record(z$1.string(),De).optional()}).transform(e=>{let t,r=e.maxWorkers??e.concurrency??Q();if(e.cache===false)t={...b,enabled:false};else if(e.cache===true||e.cache===void 0){let i=e.cacheLocation??b.location;t={...b,location:i};}else t={...b,...e.cache};return {...e,maxWorkers:r,cache:t,rules:e.rules??{},overrides:e.overrides??[],ignorePatterns:e.ignorePatterns??[]}});var u={NEGATIVE_MAX_WARNINGS:e=>({code:"negative-max-warnings",message:`Value for 'maxWarnings' must be non-negative. Received: ${e}.`,suggestion:"Set 'maxWarnings' to 0 or higher, or remove it to use default (10).",severity:"error"}),WORKERS_BELOW_MINIMUM:{code:"workers-below-minimum",message:"Value for 'maxWorkers' must be at least 1.",suggestion:"Set to 1 or higher, or remove to use default (CPU count - 1).",severity:"error"},NEGATIVE_CACHE_TTL:e=>({code:"negative-cache-ttl",message:`Cache TTL must be non-negative. Received: ${e}ms.`,suggestion:"Set to 0 (default TTL) or higher. Example: 86400000 for 24 hours.",severity:"error"}),WORKERS_EXCESSIVE:(e,t)=>({code:"warn-workers-excessive",message:`Worker count (${e}) exceeds CPU count (${t}). May cause context switching overhead.`,suggestion:`Reduce to ${t} or lower for optimal performance.`,severity:"warning"}),CACHE_TTL_ZERO:{code:"warn-cache-ttl-zero",message:"Cache TTL is set to 0. Using driver default TTL (typically 24 hours).",suggestion:"Set explicit TTL if you need different cache expiration behavior.",severity:"warning"},INVALID_GLOB_PATTERN:(e,t)=>({code:"invalid-glob-pattern",message:`Glob pattern "${e}" is invalid. Error: ${t}.`,suggestion:"Check pattern syntax. Valid examples: 'src/**/*.ts', '**/*.{ts,html}'.",severity:"error"}),EMPTY_INCLUDE:{code:"empty-include",message:"No include patterns defined. Analysis will skip all files.",suggestion:"Add patterns like ['src/**/*.ts', 'src/**/*.html'] to enable analysis.",severity:"error"},EMPTY_EXCLUDE:{code:"warn-empty-exclude",message:"No exclude patterns defined. Performance may degrade.",suggestion:"Add common exclusions: ['node_modules/**', 'dist/**', '**/*.spec.ts'].",severity:"warning"},DUPLICATE_PATTERNS:(e,t)=>({code:"warn-duplicate-patterns",message:`Duplicate patterns found in "${e}": ${t.map(r=>`"${r}"`).join(", ")}.`,suggestion:"Remove duplicate entries to simplify configuration.",severity:"warning"}),EMPTY_GLOB_PATTERN:e=>({code:"empty-glob-pattern",message:`Empty string detected in "${e}" patterns.`,suggestion:"Remove empty strings from the pattern array.",severity:"error"}),TSCONFIG_ROOT_NOT_FOUND:e=>({code:"tsconfig-root-not-found",message:`TSConfig root directory not found: "${e}".`,suggestion:"Verify the directory exists and the path is correct relative to the config file.",severity:"error"}),TSCONFIG_PROJECT_NOT_FOUND:e=>({code:"tsconfig-project-not-found",message:`TSConfig file not found: "${e}".`,suggestion:"Verify the file exists and the path is relative to 'tsconfigRootDir' or config location.",severity:"error"}),OUTPUT_PATH_TRAVERSAL:e=>({code:"output-path-traversal",message:`Output path contains unsafe traversal (..): "${e}".`,suggestion:"Use absolute paths or paths without '..' to prevent security issues.",severity:"error"}),OUTPUT_PATH_SYSTEM_DIR:e=>({code:"output-path-system-dir",message:`Output path points to a system directory: "${e}".`,suggestion:"Choose a safe output location within your project directory.",severity:"error"}),OUTPUT_PATH_NOT_FOUND:e=>({code:"output-path-not-found",message:`Output directory does not exist: "${e}".`,suggestion:"Create the directory or update 'outputPath' to an existing location.",severity:"error"}),OUTPUT_PATH_NOT_WRITABLE:e=>({code:"output-path-not-writable",message:`Output directory is not writable: "${e}".`,suggestion:"Check directory permissions or choose a different output location.",severity:"error"}),CACHE_IN_NODE_MODULES:e=>({code:"cache-in-node-modules",message:`Cache location inside 'node_modules' is unsafe: "${e}". node_modules can be deleted, causing cache loss.`,suggestion:"Use a different directory like '.cache' or 'node_modules/.cache/ngcompass'.",severity:"error"}),CACHE_PARENT_NOT_FOUND:e=>({code:"warn-cache-parent-not-found",message:`Cache parent directory missing: "${e}". It will be created automatically.`,suggestion:"No action needed. Directory will be created on first cache write.",severity:"warning"}),INVALID_RULE_SEVERITY:(e,t)=>({code:"invalid-rule-severity",message:`Rule "${e}" has invalid severity: "${t}".`,suggestion:"Use one of: 'warn', 'error', or 'off'.",severity:"error"}),NO_RULES_CONFIGURED:{code:"warn-no-rules-configured",message:"No rules configured. Analysis effectively skips checks.",suggestion:"Add rules to enable analysis, or extend from a preset like 'recommended'.",severity:"warning"},EMPTY_RULE_NAME:{code:"empty-rule-name",message:"Empty rule name detected. Rule keys must be non-empty strings.",suggestion:"Remove empty keys from 'rules' configuration.",severity:"error"},PROFILE_CIRCULAR_INHERITANCE:e=>({code:"profile-circular-inheritance",message:`Circular profile inheritance detected: ${e.join(" \u2192 ")}.`,suggestion:"Break the circular dependency by removing one 'extends' reference.",severity:"error"}),PROFILE_EMPTY:{code:"warn-profile-empty",message:"Profiles section is defined but empty. Consider removing it.",suggestion:"Remove 'profiles: {}' or add at least one profile like 'dev' or 'ci'.",severity:"warning"},EXTENDS_NOT_FOUND:e=>({code:"extends-not-found",message:`Cannot resolve preset "${e}". Make sure the package is installed.`,suggestion:`Run: npm install --save-dev ${e}`,severity:"error"}),DEPRECATED_CACHE_LOCATION:{code:"warn-deprecated-cache-location",message:"'cacheLocation' is deprecated. Use 'cache.location' instead.",suggestion:`Replace 'cacheLocation: "..."' with 'cache: { location: "..." }'.`,severity:"warning"},DEPRECATED_CONCURRENCY:{code:"warn-deprecated-concurrency",message:"'concurrency' is deprecated. Use 'maxWorkers' instead.",suggestion:"Replace 'concurrency: N' with 'maxWorkers: N'.",severity:"warning"}};function U(e,t,r=[]){let i=[];if(e.maxWorkers!==void 0){let n=2*t.os.cpus().length;e.maxWorkers<1?i.push({...u.WORKERS_BELOW_MINIMUM,path:[...r,"maxWorkers"]}):e.maxWorkers>n&&i.push({...u.WORKERS_EXCESSIVE(e.maxWorkers,n),path:[...r,"maxWorkers"]});}if(e.cache&&typeof e.cache=="object"&&e.cache.ttl!==void 0){let{ttl:n}=e.cache;n<0&&i.push({...u.NEGATIVE_CACHE_TTL(n),path:[...r,"cache","ttl"]});}return {issues:i}}function oe(e,t,r=[]){let i=[];e.maxWarnings!==void 0&&e.maxWarnings<0&&i.push({...u.NEGATIVE_MAX_WARNINGS(e.maxWarnings),path:[...r,"maxWarnings"]});let{issues:n}=U(e,t,r);return i.push(...n),{issues:i}}function ie(e,t=[]){let r=[];return e&&typeof e=="object"&&("cacheLocation"in e&&e.cacheLocation!==void 0&&r.push({...u.DEPRECATED_CACHE_LOCATION,path:[...t,"cacheLocation"]}),"concurrency"in e&&e.concurrency!==void 0&&r.push({...u.DEPRECATED_CONCURRENCY,path:[...t,"concurrency"]})),{issues:r}}function se(e,t,r){let i=[];if(!e.extends)return {issues:i};let n=Array.isArray(e.extends),o=n?e.extends:[e.extends];for(let c=0;c<o.length;c++){let s=o[c];if(typeof s!="string"||s.trim()===""||s.startsWith(".")||O__default.isAbsolute(s)||s.includes(":")||(function(f,g){try{let p=O__default.join(g,"__resolve_anchor__.cjs");return createRequire(p).resolve(f)}catch{return null}})(s,r)!==null)continue;let a=[...t,"extends"];n&&a.push(c),i.push({...u.EXTENDS_NOT_FOUND(s),path:a});}return {issues:i}}var Me=/\/\/\//,We=/\{/g,Ve=/\}/g,Ge=/\[/g,He=/\]/g;function ae(e,t=[]){let r=[];for(let i of ["include","exclude","ignorePatterns"]){let n=e[i];if(!Array.isArray(n))continue;for(let c=0;c<n.length;c++)r.push(...(function(s,a,f,g){let p=[],m=[...g,s,f];if(!a||a.trim()==="")return p.push({...u.EMPTY_GLOB_PATTERN(s),path:m}),p;if((a.match(Ge)||[]).length!==(a.match(He)||[]).length)return p.push({...u.INVALID_GLOB_PATTERN(a,"unmatched character class brackets"),path:m}),p;if(Me.test(a)||a.startsWith("///"))return p.push({...u.INVALID_GLOB_PATTERN(a,"invalid path pattern with multiple slashes"),path:m}),p;(a.endsWith("\\")||a.endsWith("/"))&&p.push({...u.INVALID_GLOB_PATTERN(a,"trailing slash not allowed"),path:m}),(a.match(We)||[]).length!==(a.match(Ve)||[]).length&&p.push({...u.INVALID_GLOB_PATTERN(a,"unmatched braces"),path:m});try{minimatch("sample.ts",a);}catch(d){let y=d instanceof Error?d.message:String(d);p.push({...u.INVALID_GLOB_PATTERN(a,y),path:m});}return p})(i,n[c],c,t));let o=(function(c){let s=new Set,a=new Set;for(let f of c)s.has(f)?a.add(f):s.add(f);return [...a]})(n);o.length>0&&r.push({...u.DUPLICATE_PATTERNS(i,o),path:[...t,i]});}return e.include&&e.include.length!==0||r.push({...u.EMPTY_INCLUDE,path:[...t,"include"]}),e.exclude&&e.exclude.length!==0||r.push({...u.EMPTY_EXCLUDE,path:[...t,"exclude"]}),{issues:r}}var Be=["/etc/","\\etc\\","/var/","\\var\\"],ce=/[\\/]/;function ue(e,t,r=[]){let i=[],n=o=>t.path.isAbsolute(o)?o:t.path.resolve(t.cwd,o);if(e.outputPath){let{outputPath:o}=e,c=[...r,"outputPath"];o.includes("..")&&i.push({...u.OUTPUT_PATH_TRAVERSAL(o),path:c}),Be.some(a=>o.includes(a))&&i.push({...u.OUTPUT_PATH_SYSTEM_DIR(o),path:c});let s=t.path.dirname(n(o));if(t.fs.existsSync(s))try{t.fs.accessSync(s,$.constants.W_OK);}catch{i.push({...u.OUTPUT_PATH_NOT_WRITABLE(s),path:c});}else i.push({...u.OUTPUT_PATH_NOT_FOUND(s),path:c});}if(e.cache&&typeof e.cache=="object"&&e.cache.enabled){let{location:o}=e.cache;if(o){let c,s,a=[...r,"cache","location"];o.split(ce).includes("node_modules")&&((s=(c=o.split(ce)).indexOf("node_modules"))===-1||c[s+1]!==".cache")&&i.push({...u.CACHE_IN_NODE_MODULES(o),path:a});let f=t.path.dirname(n(o));t.fs.existsSync(f)||i.push({...u.CACHE_PARENT_NOT_FOUND(f),path:a});}}if(e.parserOptions){let{project:o,tsconfigRootDir:c}=e.parserOptions;if(o){let s=n(o);t.fs.existsSync(s)||i.push({...u.TSCONFIG_PROJECT_NOT_FOUND(o),path:[...r,"parserOptions","project"]});}if(c){let s=n(c);t.fs.existsSync(s)||i.push({...u.TSCONFIG_ROOT_NOT_FOUND(c),path:[...r,"parserOptions","tsconfigRootDir"]});}}return {issues:i}}function fe(e,t){let r=[];if(!e.profiles||typeof e.profiles!="object")return {issues:r};let i=e.profiles,n=Object.keys(i);if(n.length===0)return r.push({...u.PROFILE_EMPTY,path:["profiles"]}),{issues:r};for(let[c,s]of Object.entries(i)){if(!s||typeof s!="object")continue;let{issues:a}=U(s,t,["profiles",c]);r.push(...a);}let o=new Set;for(let c of n)(function(s,a,f,g){let p=[],m=s;for(;m!==void 0;){if(f.has(m))return;if(p.includes(m)){for(let d of(g.push({...u.PROFILE_CIRCULAR_INHERITANCE([...p,m]),path:["profiles",p[0],"extends"]}),p))f.add(d);return}p.push(m),m=(function(d){if(!d||typeof d!="object")return;let y=d.extends;return typeof y=="string"?y:void 0})(a[m]);}for(let d of p)f.add(d);})(c,i,o,r);return {issues:r}}var pe=["warn","error","off"];function de(e,t=[]){var r;let i=[],n=Object.entries(e.rules||{});for(let[o,c]of(n.length>0||(Array.isArray(r=e.extends)?r.length>0:r)||i.push({...u.NO_RULES_CONFIGURED,path:[...t,"rules"]}),n)){if(!o||o.trim()===""){i.push({...u.EMPTY_RULE_NAME,path:[...t,"rules"]});continue}if(typeof c=="object"&&c!==null){let{severity:s}=c;s&&!pe.includes(s)&&i.push({...u.INVALID_RULE_SEVERITY(o,s),path:[...t,"rules",o,"severity"]});}}return {issues:i}}function j(e){return Ye.createHash("sha1").update(e).digest("hex")}function ge(e,t){let r=ASTUtils.parse(e,t);return ASTUtils.generateLocationMap(r)}async function qe(e,t,r,i){if(!r)return ge(e,t);let n=`v${CACHE_VERSION}:${i}`,o=await r.get(n);if(o&&(function(s){if(!s||typeof s!="object")return false;for(let a of Object.values(s))return !!(a&&typeof a=="object"&&"line"in a&&"column"in a);return true})(o.ast))return o.ast;let c=ge(e,t);return await r.set(n,{filePath:t,ast:c}),c}async function he(e,t,r,i,n){if(e.length===0)return;let o=n??j(t),c=await qe(t,r,i,o);for(let s of e){if(s.file||(s.file=r),!((!s.line||s.line===1)&&s.path))continue;let a=c[s.path.join(".")];a&&(s.line=a.line,s.column=a.column);}}var Xe=new Set(["recommended","strict","performance","reactivity","all"]);async function Je(e,t,r,i,n){if(r)return void await he(e,r,t,i,n);for(let o of e)o.file||(o.file=t);}function ye(e,t){let r,i=[...(r=new Set,e.filter(o=>{let c=o.path?o.path.join("."):"",s=`${o.code}:${o.message}:${c}`;return !r.has(s)&&(r.add(s),true)}))].sort((o,c)=>o.severity===c.severity?0:o.severity==="error"?-1:1),n=!i.some(o=>o.severity==="error");return {config:n?t:void 0,report:{valid:n,issues:i}}}async function H(e){let t,{config:r,context:i,basePath:n=[],filePath:o,fileContent:c,astCache:s,contentHash:a}=e,{issues:f,validated:g,success:p}=(t=re.safeParse(r)).success?{issues:[],validated:t.data,success:true}:{issues:t.error.issues.map(d=>({code:d.code.replace(/_/g,"-"),message:d.message,path:[...n,...d.path],severity:"error",file:o})),validated:r,success:false},m=[...f,...(function(d,y,E,h,S){let x=[];for(let T of [{name:"cross-fields",run:()=>oe(d,E,h).issues},{name:"glob-patterns",run:()=>ae(d,h).issues},{name:"paths",run:()=>ue(d,E,h).issues},{name:"rules",run:()=>de(d,h).issues},{name:"extends-chain",run:()=>se(d,h,E.cwd).issues},{name:"profiles",run:()=>fe(d,E).issues},{name:"deprecated",run:()=>ie(y,h).issues}])try{x.push(...T.run());}catch(C){let I=C instanceof Error?C.message:String(C);x.push({code:"check-failed",message:`Check "${T.name}" encountered an unexpected error: ${I}`,path:h,severity:"error",file:S});}return x})(g,r,i,n,o)];return o&&await Je(m,o,c,s,a),{issues:m,validated:p?g:void 0}}async function Ee(e,t=w(),r,i,n,o){let c={context:t,filePath:r,fileContent:i,astCache:n,contentHash:o},s=(function(p){if(!p||typeof p!="object")return {};let m=p.profiles;return m&&typeof m=="object"?m:{}})(e);if(t.profile){let p=s[t.profile];if(!p){var a;let E,h,S;return a=t.profile,E=Object.keys(s).join(", "),h=a.replace(/^ngcompass:/,""),S=Xe.has(h)?` "${a}" is a built-in preset, not a config profile. Use 'extends: "ngcompass:${h}"' in your config instead.`:"",{config:void 0,report:{valid:false,issues:[{code:"error-profile-not-found",message:`Profile "${a}" not found. Available: [${E}]${S}`,path:["profiles",a],severity:"error",file:r}]}}}let m=await H({...c,config:e}),d=defu(p,e),y=await H({...c,config:d,basePath:["profiles",t.profile]});return ye([...m.issues,...y.issues],y.validated)}let{issues:f,validated:g}=await H({...c,config:e});return ye(f,g)}var _="ngcompass",rt=[`${_}.config.ts`,`${_}.config.js`,`${_}.config.mjs`,`${_}.config.cjs`,`${_}.config.json`,`.${_}rc`,`.${_}rc.json`,"package.json"],k=e=>{let t=fileURLToPath(import.meta.url);return createJiti(e,{alias:{"@ngcompass/config":O__default.basename(t).startsWith("index.")?t:fileURLToPath(new URL("../index.ts",import.meta.url))}}).import(e).then(r=>r&&typeof r=="object"&&"default"in r?r.default??r:r)},_e=(e,t)=>JSON.parse(t.replace(/^\uFEFF/,"")),Se=async e=>{time("config-discovery"),debug("discovery",`Searching for config in: ${e}`);let t=lilconfig(_,{searchPlaces:rt,loaders:{".ts":k,".js":k,".mjs":k,".cjs":k,".json":_e,noExt:_e}}),r=await t.search(e);if(!r)return debug("discovery","No config file found"),timeEnd("config-discovery"),null;debug("discovery",`Found config: ${r.filepath}`);let i="",n="";time("content-hash");try{i=$__default.readFileSync(r.filepath,"utf-8"),n=j(i);let c=timeEnd("content-hash");debug("discovery",`Content hash: ${n.substring(0,8)}... (${c.toFixed(1)}ms)`);}catch(c){timeEnd("content-hash");let s=c instanceof Error?c.message:String(c);debug("discovery",`Failed to re-read config file for hashing: ${s}`);}let o=timeEnd("config-discovery");return debug("discovery",`Discovery complete: ${o.toFixed(1)}ms`),{config:r.config,filepath:r.filepath,content:i,contentHash:n,isEmpty:r.isEmpty}};var xe=async e=>{time("config-resolution");let{cwd:t,profile:r,cache:i}=e;debug("loader",`Starting config resolution (cwd: ${t}, profile: ${r||"none"})`);let n=await Se(t),{hash:o,cachedResult:c}=await st(n,r,i);if(c){let f=timeEnd("config-resolution");return debug("loader",`Cache HIT - returning cached result (${f.toFixed(1)}ms)`),c}debug("loader","Cache MISS - running validation");let s=await at(n,r,i);debug("loader",`Validation complete: ${s.report.valid?"valid":`invalid (${s.report.issues.length} issues)`}`),i&&o&&(await i.configs.set(o,s),debug("loader",`Cached validation result: key=${o.substring(0,8)}...`));let a=timeEnd("config-resolution");return debug("loader",`Config resolution complete: ${a.toFixed(1)}ms`),s};async function st(e,t,r){if(!r)return {};let i=[e?.contentHash??"",t??"",PACKAGE_VERSION,CACHE_VERSION].join("::"),n=r.computeHash(i);debug("loader",`Cache lookup: key=${n.substring(0,8)}...`);let o=await r.configs.get(n);return {hash:n,cachedResult:o}}async function at(e,t,r){return Ee(e?.config??{},w({profile:t}),e?.filepath,e?.content,r?.asts,e?.contentHash)}async function Or(e){try{return await xe(e)}catch(t){return {config:void 0,report:{valid:false,issues:[{code:"error-conf-semantic",message:t instanceof Error?t.message:String(t),path:[],severity:"error"}]}}}}var ct=(e={})=>{let t=e.include??v.include,r=e.exclude??v.exclude,i=t.map(o=>` '${o}',`).join(`
`),n=r.map(o=>` '${o}',`).join(`
`);return `import { defineConfig } from '@ngcompass/config';

@@ -13,3 +13,3 @@

exclude: [
${a}
${n}
],

@@ -24,6 +24,6 @@

});
`},at=async e=>{try{return await B.access(e),!0}catch(t){return debug("init",`Path does not exist or is inaccessible: ${e}`),debug("init",Y(t)),false}};async function lt(e){let t,r=O__default.join(e,"angular.json"),i=await ct(r);if(!i)return;let a=(function(s,u){try{let g=JSON.parse(s);return H(g)?g:void 0}catch(g){debug("init",`Angular workspace detection skipped for ${u}: ${Y(g)}`);return}})(i,r);if(!a)return;let o=H(t=a.projects)?t:void 0;if(!o)return;let l=(function(s){let u=[],g=new Set;for(let p of Object.values(s)){let m=(function(d){if(!H(d))return;let h=d.sourceRoot;if(typeof h=="string"&&h.trim()!=="")return Se(h);let y=d.root;if(typeof y=="string"&&y.trim()!=="")return Se(y)})(p);!m||g.has(m)||(g.add(m),u.push(m));}return u.sort((p,m)=>p.localeCompare(m))})(o);if(l.length!==0){var n=l;let s=[];for(let u of n)s.push(`${u}/**/*.ts`),s.push(`${u}/**/*.html`);return s}}async function Pr(e={}){let t=e.cwd??process.cwd(),r=O__default.join(t,"ngcompass.config.ts");if(!e.force&&await at(r))return {success:false,filePath:r,alreadyExists:true};let i=await lt(t);return await B.writeFile(r,st({include:i}),"utf-8"),{success:true,filePath:r}}async function ct(e){try{return await B.readFile(e,"utf-8")}catch(t){debug("init",`Angular workspace detection skipped for ${e}: ${Y(t)}`);return}}function Se(e){return e.replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"")}function H(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Y(e){return e instanceof Error?e.message:String(e)}function Ir(e){return e}var dt={typeCheckingEnabled:false,templateASTEnabled:true,cssASTEnabled:true},mt=async(e,t,r,i=dt)=>{if(e.length===0)return;debug("plugin-loader",`Initializing loader for ${e.length} plugin(s) at ${t}`);let a=createRequire(O__default.join(t,"package.json")),o=[];for(let l of e){let n=await gt(l,a,i,r);n&&o.push(`- "${l}": ${n}`);}if(o.length>0)throw Error(`[ngcompass] Plugin Load Failure:
`},lt=async e=>{try{return await B.access(e),!0}catch(t){return debug("init",`Path does not exist or is inaccessible: ${e}`),debug("init",q(t)),false}};async function ut(e){let t,r=O__default.join(e,"angular.json"),i=await Ce(r);if(!i)return;let n=Re(i,r);if(!n)return;let o=K(t=n.projects)?t:void 0;if(!o)return;let c=await ft(o,e);if(c.length!==0){var s=c;let a=[];for(let f of s)a.push(`${f}/**/*.ts`),a.push(`${f}/**/*.html`);return a}}async function $r(e={}){let t=e.cwd??process.cwd(),r=O__default.join(t,"ngcompass.config.ts");if(!e.force&&await lt(r))return {success:false,filePath:r,alreadyExists:true};let i=await ut(t);return await B.writeFile(r,ct({include:i}),"utf-8"),{success:true,filePath:r}}async function Ce(e){try{return await B.readFile(e,"utf-8")}catch(t){debug("init",`Angular workspace detection skipped for ${e}: ${q(t)}`);return}}function Re(e,t){try{let r=JSON.parse(e);return K(r)?r:void 0}catch(r){debug("init",`Angular workspace detection skipped for ${t}: ${q(r)}`);return}}async function ft(e,t){let r=[],i=new Set;for(let n of Object.values(e)){let o=await pt(n,t);!o||i.has(o)||(i.add(o),r.push(o));}return r.sort((n,o)=>n.localeCompare(o))}async function pt(e,t){return K(e)?(function(r){let i=r.sourceRoot;if(typeof i=="string"&&i.trim()!=="")return M(i);let n=r.root;if(typeof n=="string"&&n.trim()!=="")return M(n)})(e):typeof e=="string"&&e.trim()!==""?dt(e.trim(),t):void 0}async function dt(e,t){let r=O__default.join(t,e,"project.json"),i=await Ce(r);if(i){let n=Re(i,r);if(n){let o=n.sourceRoot;if(typeof o=="string"&&o.trim()!=="")return M(o)}}return M(`${e}/src`)}function M(e){return e.replace(/\\/g,"/").replace(/^\/+/,"").replace(/\/+$/,"")}function K(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function q(e){return e instanceof Error?e.message:String(e)}function Ur(e){return e}var yt={typeCheckingEnabled:false,templateASTEnabled:true,cssASTEnabled:true},Et=async(e,t,r,i=yt)=>{if(e.length===0)return;debug("plugin-loader",`Initializing loader for ${e.length} plugin(s) at ${t}`);let n=createRequire(O__default.join(t,"package.json")),o=[];for(let c of e){let s=await vt(c,n,i,r);s&&o.push(`- "${c}": ${s}`);}if(o.length>0)throw Error(`[ngcompass] Plugin Load Failure:
${o.join(`
`)}
Ensure plugins are installed and satisfy version requirements.`)};async function gt(e,t,r,i){try{let a=(function(s,u){try{return u.resolve(s)}catch{return s}})(e,t),o=await ht(a),l=Array.isArray(o)?o:[o],n=0;for(let s of l){if(!(function(u){if(!u||typeof u!="object")return !1;let g=u.handler;return typeof u.name=="string"&&u.name.length>0&&typeof g?.handle=="function"})(s)){warn("plugin-loader",`Plugin "${e}" exported an invalid structure. Skipping.`);continue}if(s.manifest){let u=(function(g,p){let m=(function(d,h,y,E){var A;let x,T=h.trim();if(!T||T==="*")return null;let C=K(d);if(!C)return null;let I=T.startsWith("^")?(x=K(A=T.slice(1)))?`>=${A} <${x[0]+1}.0.0`:null:T;if(!I)return null;for(let Oe of I.split(/\s+/).filter(Boolean)){let W=Oe.match(Et);if(!W)continue;let L=W[1],q=K(W[2]);if(!q)continue;let P=(function(z,X){for(let R=0;R<3;R++)if(z[R]!==X[R])return z[R]>X[R]?1:-1;return 0})(C,q);if(!(L===">="?P>=0:L==="<="?P<=0:L===">"?P>0:L==="<"?P<0:P===0))return `Plugin "${y}@${E}" requires engine "${h}", found "${d}".`}return null})(PACKAGE_VERSION.replace(/^v/,""),g.engineVersionRange,g.name,g.version);if(m)return m;for(let d of [{key:"requiresTypeInfo",current:p.typeCheckingEnabled,label:"Type Information"},{key:"requiresTemplateAST",current:p.templateASTEnabled,label:"Template AST"},{key:"requiresCssAST",current:p.cssASTEnabled,label:"CSS AST"}])if(g.capabilities?.[d.key]&&!d.current)return `Plugin "${g.name}@${g.version}" requires ${d.label} support, which is currently disabled.`;return null})(s.manifest,r);if(u)throw Error(u);debug("plugin-loader",`\u276F Validated: ${s.manifest.name}@${s.manifest.version}`);}else warn("plugin-loader",`Plugin "${e}" is missing a manifest. Please update for future compatibility.`);i.register(s),n++,debug("plugin-loader",`\u276F Registered Rule: ${s.name}`);}return debug("plugin-loader",`Plugin "${e}" processed: ${n} rules active.`),null}catch(a){return a instanceof Error?a.message:String(a)}}async function ht(e){let t=O__default.isAbsolute(e)?pathToFileURL(e).href:e,r=await import(t);return r.default??r}var yt=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/,Et=/^(>=|<=|>|<|=|==)(\d+\.\d+\.\d+.*)$/;function K(e){let t=e.trim().match(yt);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}export{ee as AnalyzerConfigSchema,b as DEFAULT_CACHE_OPTIONS,v as DEFAULT_CONFIG,f as MESSAGES,Ue as ProfileConfigSchema,ue as VALID_RULE_SEVERITIES,w as createDefaultContext,Ir as defineConfig,lt as detectAngularWorkspaceIncludes,Te as findAndLoadConfig,J as getDefaultMaxWorkers,Pr as initConfig,mt as loadPlugins,st as renderConfigTemplate,Ae as resolveConfig,Sr as validateConfig,U as validateConfigBlock,he as validateConfiguration,te as validateCrossFields,re as validateDeprecatedFields,ie as validateExtendsChain,ne as validateGlobPatterns,le as validatePaths,ce as validateProfiles,fe as validateRules};//# sourceMappingURL=index.js.map
Ensure plugins are installed and satisfy version requirements.`)};async function vt(e,t,r,i){try{let n=(function(a,f){try{return f.resolve(a)}catch{return a}})(e,t),o=await Tt(n),c=Array.isArray(o)?o:[o],s=0;for(let a of c){if(!(function(f){if(!f||typeof f!="object")return !1;let g=f.handler;return typeof f.name=="string"&&f.name.length>0&&typeof g?.handle=="function"})(a)){warn("plugin-loader",`Plugin "${e}" exported an invalid structure. Skipping.`);continue}if(a.manifest){let f=(function(g,p){let m=(function(d,y,E,h){var S;let x,T=y.trim();if(!T||T==="*")return null;let C=z(d);if(!C)return null;let I=T.startsWith("^")?(x=z(S=T.slice(1)))?`>=${S} <${x[0]+1}.0.0`:null:T;if(!I)return null;for(let Pe of I.split(/\s+/).filter(Boolean)){let V=Pe.match(St);if(!V)continue;let L=V[1],X=z(V[2]);if(!X)continue;let P=(function(J,Z){for(let R=0;R<3;R++)if(J[R]!==Z[R])return J[R]>Z[R]?1:-1;return 0})(C,X);if(!(L===">="?P>=0:L==="<="?P<=0:L===">"?P>0:L==="<"?P<0:P===0))return `Plugin "${E}@${h}" requires engine "${y}", found "${d}".`}return null})(PACKAGE_VERSION.replace(/^v/,""),g.engineVersionRange,g.name,g.version);if(m)return m;for(let d of [{key:"requiresTypeInfo",current:p.typeCheckingEnabled,label:"Type Information"},{key:"requiresTemplateAST",current:p.templateASTEnabled,label:"Template AST"},{key:"requiresCssAST",current:p.cssASTEnabled,label:"CSS AST"}])if(g.capabilities?.[d.key]&&!d.current)return `Plugin "${g.name}@${g.version}" requires ${d.label} support, which is currently disabled.`;return null})(a.manifest,r);if(f)throw Error(f);debug("plugin-loader",`\u276F Validated: ${a.manifest.name}@${a.manifest.version}`);}else warn("plugin-loader",`Plugin "${e}" is missing a manifest. Please update for future compatibility.`);i.register(a),s++,debug("plugin-loader",`\u276F Registered Rule: ${a.name}`);}return debug("plugin-loader",`Plugin "${e}" processed: ${s} rules active.`),null}catch(n){return n instanceof Error?n.message:String(n)}}async function Tt(e){let t=O__default.isAbsolute(e)?pathToFileURL(e).href:e,r=await import(t);return r.default??r}var _t=/^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/,St=/^(>=|<=|>|<|=|==)(\d+\.\d+\.\d+.*)$/;function z(e){let t=e.trim().match(_t);return t?[Number(t[1]),Number(t[2]),Number(t[3])]:null}export{re as AnalyzerConfigSchema,b as DEFAULT_CACHE_OPTIONS,v as DEFAULT_CONFIG,u as MESSAGES,De as ProfileConfigSchema,pe as VALID_RULE_SEVERITIES,w as createDefaultContext,Ur as defineConfig,ut as detectAngularWorkspaceIncludes,Se as findAndLoadConfig,Q as getDefaultMaxWorkers,$r as initConfig,Et as loadPlugins,ct as renderConfigTemplate,xe as resolveConfig,Or as validateConfig,U as validateConfigBlock,Ee as validateConfiguration,oe as validateCrossFields,ie as validateDeprecatedFields,se as validateExtendsChain,ae as validateGlobPatterns,ue as validatePaths,fe as validateProfiles,de as validateRules};//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map
{
"name": "@ngcompass/config",
"version": "0.1.9-beta",
"version": "0.2.0-beta",
"description": "Config loading, resolution and validation for ngcompass",

@@ -30,4 +30,4 @@ "sideEffects": false,

"zod-validation-error": "^5.0.0",
"@ngcompass/cache": "0.1.9-beta",
"@ngcompass/common": "0.1.9-beta"
"@ngcompass/cache": "0.2.0-beta",
"@ngcompass/common": "0.2.0-beta"
},

@@ -34,0 +34,0 @@ "peerDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display