@viberails/types 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -41,14 +41,17 @@ var FRAMEWORK_NAMES = {
41
41
  nextjs: "Next.js",
42
42
  expo: "Expo",
43
43
  "react-native": "React Native",
44
+ angular: "Angular",
44
45
  remix: "Remix",
45
46
  nuxt: "Nuxt",
46
47
  sveltekit: "SvelteKit",
47
48
  astro: "Astro",
48
49
  vite: "Vite",
49
50
  gatsby: "Gatsby",
51
+ nestjs: "NestJS",
50
52
  express: "Express",
51
53
  fastify: "Fastify",
54
+ koa: "Koa",
52
55
  hono: "Hono"
53
56
  };
54
57
  var STYLING_NAMES = {
@@ -87,7 +90,7 @@ var ROLE_DESCRIPTIONS = {
87
90
  };
88
91
 
89
92
  // src/index.ts
90
- var VERSION = "0.1.0";
93
+ var VERSION = "0.2.3";
91
94
  // Annotate the CommonJS export names for ESM import in node:
92
95
  0 && (module.exports = {
93
96
  FRAMEWORK_NAMES,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/confidence.ts","../src/display-names.ts"],"sourcesContent":["export const VERSION = '0.1.0';\n\nexport type { BoundaryRule, BoundaryViolation } from './boundary.js';\nexport type { CheckResult, CheckRule, CheckViolation } from './check-result.js';\nexport type { Confidence, DetectedConvention } from './confidence.js';\nexport { confidenceFromConsistency } from './confidence.js';\nexport type {\n ConfigConventions,\n ConfigRules,\n ConfigStack,\n ConfigStructure,\n ConventionValue,\n PackageConfigOverrides,\n ViberailsConfig,\n WorkspaceConfig,\n} from './config.js';\nexport {\n FRAMEWORK_NAMES,\n LIBRARY_NAMES,\n ROLE_DESCRIPTIONS,\n STYLING_NAMES,\n} from './display-names.js';\nexport type {\n ImportEdge,\n ImportGraph,\n ImportGraphNode,\n ImportKind,\n WorkspacePackage,\n} from './graph.js';\nexport type {\n CodebaseStatistics,\n DetectedStack,\n DetectedStructure,\n DetectedWorkspace,\n DirectoryInfo,\n DirectoryRole,\n FileStatistic,\n PackageScanResult,\n ScanResult,\n StackItem,\n} from './scan-result.js';\n","/**\n * Confidence level for a detected convention or pattern.\n *\n * - `'high'` — ≥90% consistency across analyzed files. Enforced by default.\n * - `'medium'` — 70–89% consistency. Included in config but not enforced.\n * - `'low'` — <70% consistency. Omitted from config entirely.\n */\nexport type Confidence = 'high' | 'medium' | 'low';\n\n/**\n * A convention or pattern detected by the scanner, with metadata\n * about how confidently it was identified.\n *\n * @typeParam T - The type of the detected value. Defaults to `string`.\n */\nexport interface DetectedConvention<T = string> {\n /** The detected value (e.g. a naming pattern, file extension, or path). */\n value: T;\n\n /** How confident the scanner is in this detection. */\n confidence: Confidence;\n\n /** Number of files analyzed to determine this convention. */\n sampleSize: number;\n\n /** Percentage (0–100) of files that follow this convention. */\n consistency: number;\n}\n\n/**\n * Derives a confidence level from a consistency percentage.\n *\n * @param consistency - A number from 0 to 100 representing the percentage\n * of files that follow a given convention.\n * @returns The corresponding confidence level:\n * - `'high'` for consistency ≥ 90\n * - `'medium'` for consistency ≥ 70 and < 90\n * - `'low'` for consistency < 70\n */\nexport function confidenceFromConsistency(consistency: number): Confidence {\n if (consistency >= 90) return 'high';\n if (consistency >= 70) return 'medium';\n return 'low';\n}\n","/** Display names for framework identifiers. */\nexport const FRAMEWORK_NAMES: Record<string, string> = {\n nextjs: 'Next.js',\n expo: 'Expo',\n 'react-native': 'React Native',\n remix: 'Remix',\n nuxt: 'Nuxt',\n sveltekit: 'SvelteKit',\n astro: 'Astro',\n vite: 'Vite',\n gatsby: 'Gatsby',\n express: 'Express',\n fastify: 'Fastify',\n hono: 'Hono',\n};\n\n/** Display names for styling libraries. */\nexport const STYLING_NAMES: Record<string, string> = {\n tailwindcss: 'Tailwind CSS',\n 'css-modules': 'CSS Modules',\n 'styled-components': 'styled-components',\n emotion: 'Emotion',\n sass: 'Sass',\n};\n\n/** Display names for notable libraries. */\nexport const LIBRARY_NAMES: Record<string, string> = {\n 'react-query': 'React Query',\n 'tanstack-query': 'TanStack Query',\n zod: 'Zod',\n trpc: 'tRPC',\n prisma: 'Prisma',\n drizzle: 'Drizzle',\n expo: 'Expo',\n 'react-native': 'React Native',\n nextjs: 'Next.js',\n react: 'React',\n sveltekit: 'SvelteKit',\n svelte: 'Svelte',\n astro: 'Astro',\n vue: 'Vue',\n};\n\n/** Display names for directory roles. */\nexport const ROLE_DESCRIPTIONS: Record<string, string> = {\n pages: 'Pages / Routes',\n components: 'Components',\n hooks: 'Hooks',\n utils: 'Utilities',\n types: 'Type definitions',\n tests: 'Tests',\n styles: 'Styles',\n api: 'API routes',\n config: 'Configuration',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuCO,SAAS,0BAA0B,aAAiC;AACzE,MAAI,eAAe,GAAI,QAAO;AAC9B,MAAI,eAAe,GAAI,QAAO;AAC9B,SAAO;AACT;;;AC1CO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AACP;AAGO,IAAM,oBAA4C;AAAA,EACvD,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AACV;;;AFtDO,IAAM,UAAU;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/confidence.ts","../src/display-names.ts"],"sourcesContent":["declare const __PACKAGE_VERSION__: string;\nexport const VERSION: string = __PACKAGE_VERSION__;\n\nexport type { BoundaryRule, BoundaryViolation } from './boundary.js';\nexport type { CheckResult, CheckRule, CheckViolation } from './check-result.js';\nexport type { Confidence, DetectedConvention } from './confidence.js';\nexport { confidenceFromConsistency } from './confidence.js';\nexport type {\n ConfigConventions,\n ConfigRules,\n ConfigStack,\n ConfigStructure,\n ConventionValue,\n PackageConfigOverrides,\n ViberailsConfig,\n WorkspaceConfig,\n} from './config.js';\nexport {\n FRAMEWORK_NAMES,\n LIBRARY_NAMES,\n ROLE_DESCRIPTIONS,\n STYLING_NAMES,\n} from './display-names.js';\nexport type {\n ImportEdge,\n ImportGraph,\n ImportGraphNode,\n ImportKind,\n WorkspacePackage,\n} from './graph.js';\nexport type {\n CodebaseStatistics,\n DetectedStack,\n DetectedStructure,\n DetectedWorkspace,\n DirectoryInfo,\n DirectoryRole,\n FileStatistic,\n PackageScanResult,\n ScanResult,\n StackItem,\n} from './scan-result.js';\n","/**\n * Confidence level for a detected convention or pattern.\n *\n * - `'high'` — ≥90% consistency across analyzed files. Enforced by default.\n * - `'medium'` — 70–89% consistency. Included in config but not enforced.\n * - `'low'` — <70% consistency. Omitted from config entirely.\n */\nexport type Confidence = 'high' | 'medium' | 'low';\n\n/**\n * A convention or pattern detected by the scanner, with metadata\n * about how confidently it was identified.\n *\n * @typeParam T - The type of the detected value. Defaults to `string`.\n */\nexport interface DetectedConvention<T = string> {\n /** The detected value (e.g. a naming pattern, file extension, or path). */\n value: T;\n\n /** How confident the scanner is in this detection. */\n confidence: Confidence;\n\n /** Number of files analyzed to determine this convention. */\n sampleSize: number;\n\n /** Percentage (0–100) of files that follow this convention. */\n consistency: number;\n}\n\n/**\n * Derives a confidence level from a consistency percentage.\n *\n * @param consistency - A number from 0 to 100 representing the percentage\n * of files that follow a given convention.\n * @returns The corresponding confidence level:\n * - `'high'` for consistency ≥ 90\n * - `'medium'` for consistency ≥ 70 and < 90\n * - `'low'` for consistency < 70\n */\nexport function confidenceFromConsistency(consistency: number): Confidence {\n if (consistency >= 90) return 'high';\n if (consistency >= 70) return 'medium';\n return 'low';\n}\n","/** Display names for framework identifiers. */\nexport const FRAMEWORK_NAMES: Record<string, string> = {\n nextjs: 'Next.js',\n expo: 'Expo',\n 'react-native': 'React Native',\n angular: 'Angular',\n remix: 'Remix',\n nuxt: 'Nuxt',\n sveltekit: 'SvelteKit',\n astro: 'Astro',\n vite: 'Vite',\n gatsby: 'Gatsby',\n nestjs: 'NestJS',\n express: 'Express',\n fastify: 'Fastify',\n koa: 'Koa',\n hono: 'Hono',\n};\n\n/** Display names for styling libraries. */\nexport const STYLING_NAMES: Record<string, string> = {\n tailwindcss: 'Tailwind CSS',\n 'css-modules': 'CSS Modules',\n 'styled-components': 'styled-components',\n emotion: 'Emotion',\n sass: 'Sass',\n};\n\n/** Display names for notable libraries. */\nexport const LIBRARY_NAMES: Record<string, string> = {\n 'react-query': 'React Query',\n 'tanstack-query': 'TanStack Query',\n zod: 'Zod',\n trpc: 'tRPC',\n prisma: 'Prisma',\n drizzle: 'Drizzle',\n expo: 'Expo',\n 'react-native': 'React Native',\n nextjs: 'Next.js',\n react: 'React',\n sveltekit: 'SvelteKit',\n svelte: 'Svelte',\n astro: 'Astro',\n vue: 'Vue',\n};\n\n/** Display names for directory roles. */\nexport const ROLE_DESCRIPTIONS: Record<string, string> = {\n pages: 'Pages / Routes',\n components: 'Components',\n hooks: 'Hooks',\n utils: 'Utilities',\n types: 'Type definitions',\n tests: 'Tests',\n styles: 'Styles',\n api: 'API routes',\n config: 'Configuration',\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACuCO,SAAS,0BAA0B,aAAiC;AACzE,MAAI,eAAe,GAAI,QAAO;AAC9B,MAAI,eAAe,GAAI,QAAO;AAC9B,SAAO;AACT;;;AC1CO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,KAAK;AAAA,EACL,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AACP;AAGO,IAAM,oBAA4C;AAAA,EACvD,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AACV;;;AFxDO,IAAM,UAAkB;","names":[]}
package/dist/index.d.cts CHANGED
@@ -227,6 +227,12 @@ interface ConfigRules {
227
227
  * @default 300
228
228
  */
229
229
  maxFileLines: number;
230
+ /**
231
+ * Maximum number of lines allowed per test file.
232
+ * Set to 0 to exempt test files from size checks.
233
+ * @default 0
234
+ */
235
+ maxTestFileLines: number;
230
236
  /**
231
237
  * Maximum number of lines allowed per function.
232
238
  * @default 50
@@ -447,6 +453,6 @@ interface FileStatistic {
447
453
  lines: number;
448
454
  }
449
455
 
450
- declare const VERSION = "0.1.0";
456
+ declare const VERSION: string;
451
457
 
452
458
  export { type BoundaryRule, type BoundaryViolation, type CheckResult, type CheckRule, type CheckViolation, type CodebaseStatistics, type Confidence, type ConfigConventions, type ConfigRules, type ConfigStack, type ConfigStructure, type ConventionValue, type DetectedConvention, type DetectedStack, type DetectedStructure, type DetectedWorkspace, type DirectoryInfo, type DirectoryRole, FRAMEWORK_NAMES, type FileStatistic, type ImportEdge, type ImportGraph, type ImportGraphNode, type ImportKind, LIBRARY_NAMES, type PackageConfigOverrides, type PackageScanResult, ROLE_DESCRIPTIONS, STYLING_NAMES, type ScanResult, type StackItem, VERSION, type ViberailsConfig, type WorkspaceConfig, type WorkspacePackage, confidenceFromConsistency };
package/dist/index.d.ts CHANGED
@@ -227,6 +227,12 @@ interface ConfigRules {
227
227
  * @default 300
228
228
  */
229
229
  maxFileLines: number;
230
+ /**
231
+ * Maximum number of lines allowed per test file.
232
+ * Set to 0 to exempt test files from size checks.
233
+ * @default 0
234
+ */
235
+ maxTestFileLines: number;
230
236
  /**
231
237
  * Maximum number of lines allowed per function.
232
238
  * @default 50
@@ -447,6 +453,6 @@ interface FileStatistic {
447
453
  lines: number;
448
454
  }
449
455
 
450
- declare const VERSION = "0.1.0";
456
+ declare const VERSION: string;
451
457
 
452
458
  export { type BoundaryRule, type BoundaryViolation, type CheckResult, type CheckRule, type CheckViolation, type CodebaseStatistics, type Confidence, type ConfigConventions, type ConfigRules, type ConfigStack, type ConfigStructure, type ConventionValue, type DetectedConvention, type DetectedStack, type DetectedStructure, type DetectedWorkspace, type DirectoryInfo, type DirectoryRole, FRAMEWORK_NAMES, type FileStatistic, type ImportEdge, type ImportGraph, type ImportGraphNode, type ImportKind, LIBRARY_NAMES, type PackageConfigOverrides, type PackageScanResult, ROLE_DESCRIPTIONS, STYLING_NAMES, type ScanResult, type StackItem, VERSION, type ViberailsConfig, type WorkspaceConfig, type WorkspacePackage, confidenceFromConsistency };
package/dist/index.js CHANGED
@@ -10,14 +10,17 @@ var FRAMEWORK_NAMES = {
10
10
  nextjs: "Next.js",
11
11
  expo: "Expo",
12
12
  "react-native": "React Native",
13
+ angular: "Angular",
13
14
  remix: "Remix",
14
15
  nuxt: "Nuxt",
15
16
  sveltekit: "SvelteKit",
16
17
  astro: "Astro",
17
18
  vite: "Vite",
18
19
  gatsby: "Gatsby",
20
+ nestjs: "NestJS",
19
21
  express: "Express",
20
22
  fastify: "Fastify",
23
+ koa: "Koa",
21
24
  hono: "Hono"
22
25
  };
23
26
  var STYLING_NAMES = {
@@ -56,7 +59,7 @@ var ROLE_DESCRIPTIONS = {
56
59
  };
57
60
 
58
61
  // src/index.ts
59
- var VERSION = "0.1.0";
62
+ var VERSION = "0.2.3";
60
63
  export {
61
64
  FRAMEWORK_NAMES,
62
65
  LIBRARY_NAMES,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/confidence.ts","../src/display-names.ts","../src/index.ts"],"sourcesContent":["/**\n * Confidence level for a detected convention or pattern.\n *\n * - `'high'` — ≥90% consistency across analyzed files. Enforced by default.\n * - `'medium'` — 70–89% consistency. Included in config but not enforced.\n * - `'low'` — <70% consistency. Omitted from config entirely.\n */\nexport type Confidence = 'high' | 'medium' | 'low';\n\n/**\n * A convention or pattern detected by the scanner, with metadata\n * about how confidently it was identified.\n *\n * @typeParam T - The type of the detected value. Defaults to `string`.\n */\nexport interface DetectedConvention<T = string> {\n /** The detected value (e.g. a naming pattern, file extension, or path). */\n value: T;\n\n /** How confident the scanner is in this detection. */\n confidence: Confidence;\n\n /** Number of files analyzed to determine this convention. */\n sampleSize: number;\n\n /** Percentage (0–100) of files that follow this convention. */\n consistency: number;\n}\n\n/**\n * Derives a confidence level from a consistency percentage.\n *\n * @param consistency - A number from 0 to 100 representing the percentage\n * of files that follow a given convention.\n * @returns The corresponding confidence level:\n * - `'high'` for consistency ≥ 90\n * - `'medium'` for consistency ≥ 70 and < 90\n * - `'low'` for consistency < 70\n */\nexport function confidenceFromConsistency(consistency: number): Confidence {\n if (consistency >= 90) return 'high';\n if (consistency >= 70) return 'medium';\n return 'low';\n}\n","/** Display names for framework identifiers. */\nexport const FRAMEWORK_NAMES: Record<string, string> = {\n nextjs: 'Next.js',\n expo: 'Expo',\n 'react-native': 'React Native',\n remix: 'Remix',\n nuxt: 'Nuxt',\n sveltekit: 'SvelteKit',\n astro: 'Astro',\n vite: 'Vite',\n gatsby: 'Gatsby',\n express: 'Express',\n fastify: 'Fastify',\n hono: 'Hono',\n};\n\n/** Display names for styling libraries. */\nexport const STYLING_NAMES: Record<string, string> = {\n tailwindcss: 'Tailwind CSS',\n 'css-modules': 'CSS Modules',\n 'styled-components': 'styled-components',\n emotion: 'Emotion',\n sass: 'Sass',\n};\n\n/** Display names for notable libraries. */\nexport const LIBRARY_NAMES: Record<string, string> = {\n 'react-query': 'React Query',\n 'tanstack-query': 'TanStack Query',\n zod: 'Zod',\n trpc: 'tRPC',\n prisma: 'Prisma',\n drizzle: 'Drizzle',\n expo: 'Expo',\n 'react-native': 'React Native',\n nextjs: 'Next.js',\n react: 'React',\n sveltekit: 'SvelteKit',\n svelte: 'Svelte',\n astro: 'Astro',\n vue: 'Vue',\n};\n\n/** Display names for directory roles. */\nexport const ROLE_DESCRIPTIONS: Record<string, string> = {\n pages: 'Pages / Routes',\n components: 'Components',\n hooks: 'Hooks',\n utils: 'Utilities',\n types: 'Type definitions',\n tests: 'Tests',\n styles: 'Styles',\n api: 'API routes',\n config: 'Configuration',\n};\n","export const VERSION = '0.1.0';\n\nexport type { BoundaryRule, BoundaryViolation } from './boundary.js';\nexport type { CheckResult, CheckRule, CheckViolation } from './check-result.js';\nexport type { Confidence, DetectedConvention } from './confidence.js';\nexport { confidenceFromConsistency } from './confidence.js';\nexport type {\n ConfigConventions,\n ConfigRules,\n ConfigStack,\n ConfigStructure,\n ConventionValue,\n PackageConfigOverrides,\n ViberailsConfig,\n WorkspaceConfig,\n} from './config.js';\nexport {\n FRAMEWORK_NAMES,\n LIBRARY_NAMES,\n ROLE_DESCRIPTIONS,\n STYLING_NAMES,\n} from './display-names.js';\nexport type {\n ImportEdge,\n ImportGraph,\n ImportGraphNode,\n ImportKind,\n WorkspacePackage,\n} from './graph.js';\nexport type {\n CodebaseStatistics,\n DetectedStack,\n DetectedStructure,\n DetectedWorkspace,\n DirectoryInfo,\n DirectoryRole,\n FileStatistic,\n PackageScanResult,\n ScanResult,\n StackItem,\n} from './scan-result.js';\n"],"mappings":";AAuCO,SAAS,0BAA0B,aAAiC;AACzE,MAAI,eAAe,GAAI,QAAO;AAC9B,MAAI,eAAe,GAAI,QAAO;AAC9B,SAAO;AACT;;;AC1CO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AACP;AAGO,IAAM,oBAA4C;AAAA,EACvD,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AACV;;;ACtDO,IAAM,UAAU;","names":[]}
1
+ {"version":3,"sources":["../src/confidence.ts","../src/display-names.ts","../src/index.ts"],"sourcesContent":["/**\n * Confidence level for a detected convention or pattern.\n *\n * - `'high'` — ≥90% consistency across analyzed files. Enforced by default.\n * - `'medium'` — 70–89% consistency. Included in config but not enforced.\n * - `'low'` — <70% consistency. Omitted from config entirely.\n */\nexport type Confidence = 'high' | 'medium' | 'low';\n\n/**\n * A convention or pattern detected by the scanner, with metadata\n * about how confidently it was identified.\n *\n * @typeParam T - The type of the detected value. Defaults to `string`.\n */\nexport interface DetectedConvention<T = string> {\n /** The detected value (e.g. a naming pattern, file extension, or path). */\n value: T;\n\n /** How confident the scanner is in this detection. */\n confidence: Confidence;\n\n /** Number of files analyzed to determine this convention. */\n sampleSize: number;\n\n /** Percentage (0–100) of files that follow this convention. */\n consistency: number;\n}\n\n/**\n * Derives a confidence level from a consistency percentage.\n *\n * @param consistency - A number from 0 to 100 representing the percentage\n * of files that follow a given convention.\n * @returns The corresponding confidence level:\n * - `'high'` for consistency ≥ 90\n * - `'medium'` for consistency ≥ 70 and < 90\n * - `'low'` for consistency < 70\n */\nexport function confidenceFromConsistency(consistency: number): Confidence {\n if (consistency >= 90) return 'high';\n if (consistency >= 70) return 'medium';\n return 'low';\n}\n","/** Display names for framework identifiers. */\nexport const FRAMEWORK_NAMES: Record<string, string> = {\n nextjs: 'Next.js',\n expo: 'Expo',\n 'react-native': 'React Native',\n angular: 'Angular',\n remix: 'Remix',\n nuxt: 'Nuxt',\n sveltekit: 'SvelteKit',\n astro: 'Astro',\n vite: 'Vite',\n gatsby: 'Gatsby',\n nestjs: 'NestJS',\n express: 'Express',\n fastify: 'Fastify',\n koa: 'Koa',\n hono: 'Hono',\n};\n\n/** Display names for styling libraries. */\nexport const STYLING_NAMES: Record<string, string> = {\n tailwindcss: 'Tailwind CSS',\n 'css-modules': 'CSS Modules',\n 'styled-components': 'styled-components',\n emotion: 'Emotion',\n sass: 'Sass',\n};\n\n/** Display names for notable libraries. */\nexport const LIBRARY_NAMES: Record<string, string> = {\n 'react-query': 'React Query',\n 'tanstack-query': 'TanStack Query',\n zod: 'Zod',\n trpc: 'tRPC',\n prisma: 'Prisma',\n drizzle: 'Drizzle',\n expo: 'Expo',\n 'react-native': 'React Native',\n nextjs: 'Next.js',\n react: 'React',\n sveltekit: 'SvelteKit',\n svelte: 'Svelte',\n astro: 'Astro',\n vue: 'Vue',\n};\n\n/** Display names for directory roles. */\nexport const ROLE_DESCRIPTIONS: Record<string, string> = {\n pages: 'Pages / Routes',\n components: 'Components',\n hooks: 'Hooks',\n utils: 'Utilities',\n types: 'Type definitions',\n tests: 'Tests',\n styles: 'Styles',\n api: 'API routes',\n config: 'Configuration',\n};\n","declare const __PACKAGE_VERSION__: string;\nexport const VERSION: string = __PACKAGE_VERSION__;\n\nexport type { BoundaryRule, BoundaryViolation } from './boundary.js';\nexport type { CheckResult, CheckRule, CheckViolation } from './check-result.js';\nexport type { Confidence, DetectedConvention } from './confidence.js';\nexport { confidenceFromConsistency } from './confidence.js';\nexport type {\n ConfigConventions,\n ConfigRules,\n ConfigStack,\n ConfigStructure,\n ConventionValue,\n PackageConfigOverrides,\n ViberailsConfig,\n WorkspaceConfig,\n} from './config.js';\nexport {\n FRAMEWORK_NAMES,\n LIBRARY_NAMES,\n ROLE_DESCRIPTIONS,\n STYLING_NAMES,\n} from './display-names.js';\nexport type {\n ImportEdge,\n ImportGraph,\n ImportGraphNode,\n ImportKind,\n WorkspacePackage,\n} from './graph.js';\nexport type {\n CodebaseStatistics,\n DetectedStack,\n DetectedStructure,\n DetectedWorkspace,\n DirectoryInfo,\n DirectoryRole,\n FileStatistic,\n PackageScanResult,\n ScanResult,\n StackItem,\n} from './scan-result.js';\n"],"mappings":";AAuCO,SAAS,0BAA0B,aAAiC;AACzE,MAAI,eAAe,GAAI,QAAO;AAC9B,MAAI,eAAe,GAAI,QAAO;AAC9B,SAAO;AACT;;;AC1CO,IAAM,kBAA0C;AAAA,EACrD,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AAAA,EACP,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,KAAK;AAAA,EACL,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,aAAa;AAAA,EACb,eAAe;AAAA,EACf,qBAAqB;AAAA,EACrB,SAAS;AAAA,EACT,MAAM;AACR;AAGO,IAAM,gBAAwC;AAAA,EACnD,eAAe;AAAA,EACf,kBAAkB;AAAA,EAClB,KAAK;AAAA,EACL,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,KAAK;AACP;AAGO,IAAM,oBAA4C;AAAA,EACvD,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AAAA,EACL,QAAQ;AACV;;;ACxDO,IAAM,UAAkB;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@viberails/types",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Shared type definitions for viberails",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",