@viberails/types 0.1.0 → 0.2.0
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 +11 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,8 @@ function confidenceFromConsistency(consistency) {
|
|
|
39
39
|
// src/display-names.ts
|
|
40
40
|
var FRAMEWORK_NAMES = {
|
|
41
41
|
nextjs: "Next.js",
|
|
42
|
+
expo: "Expo",
|
|
43
|
+
"react-native": "React Native",
|
|
42
44
|
remix: "Remix",
|
|
43
45
|
nuxt: "Nuxt",
|
|
44
46
|
sveltekit: "SvelteKit",
|
|
@@ -62,7 +64,15 @@ var LIBRARY_NAMES = {
|
|
|
62
64
|
zod: "Zod",
|
|
63
65
|
trpc: "tRPC",
|
|
64
66
|
prisma: "Prisma",
|
|
65
|
-
drizzle: "Drizzle"
|
|
67
|
+
drizzle: "Drizzle",
|
|
68
|
+
expo: "Expo",
|
|
69
|
+
"react-native": "React Native",
|
|
70
|
+
nextjs: "Next.js",
|
|
71
|
+
react: "React",
|
|
72
|
+
sveltekit: "SvelteKit",
|
|
73
|
+
svelte: "Svelte",
|
|
74
|
+
astro: "Astro",
|
|
75
|
+
vue: "Vue"
|
|
66
76
|
};
|
|
67
77
|
var ROLE_DESCRIPTIONS = {
|
|
68
78
|
pages: "Pages / Routes",
|
package/dist/index.cjs.map
CHANGED
|
@@ -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 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 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 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};\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,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;
|
|
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":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -115,6 +115,26 @@ interface ViberailsConfig {
|
|
|
115
115
|
boundaries?: BoundaryRule[];
|
|
116
116
|
/** Workspace configuration for monorepo support (V1.1+). */
|
|
117
117
|
workspace?: WorkspaceConfig;
|
|
118
|
+
/** Per-package overrides for monorepo projects. Only packages that differ from global. */
|
|
119
|
+
packages?: PackageConfigOverrides[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Per-package configuration overrides for monorepo projects.
|
|
123
|
+
* Only fields that differ from the global config are included.
|
|
124
|
+
*/
|
|
125
|
+
interface PackageConfigOverrides {
|
|
126
|
+
/** Package name from package.json. */
|
|
127
|
+
name: string;
|
|
128
|
+
/** Relative path to the package (e.g. "apps/web"). */
|
|
129
|
+
path: string;
|
|
130
|
+
/** Override stack fields (only differences from global). */
|
|
131
|
+
stack?: Partial<ConfigStack>;
|
|
132
|
+
/** Override conventions (only differences from global). */
|
|
133
|
+
conventions?: Partial<ConfigConventions>;
|
|
134
|
+
/** Override rules (only differences from global). */
|
|
135
|
+
rules?: Partial<ConfigRules>;
|
|
136
|
+
/** Additional ignore patterns for this package (appended to global). */
|
|
137
|
+
ignore?: string[];
|
|
118
138
|
}
|
|
119
139
|
/**
|
|
120
140
|
* Workspace configuration for monorepo projects.
|
|
@@ -302,6 +322,32 @@ interface ScanResult {
|
|
|
302
322
|
statistics: CodebaseStatistics;
|
|
303
323
|
/** Detected workspace information for monorepo projects (V1.1+). */
|
|
304
324
|
workspace?: DetectedWorkspace;
|
|
325
|
+
/**
|
|
326
|
+
* Per-package scan results. Always has at least one entry.
|
|
327
|
+
* For single-package projects, contains one entry identical to the top-level fields.
|
|
328
|
+
* For monorepos, contains one entry per workspace package.
|
|
329
|
+
*/
|
|
330
|
+
packages: PackageScanResult[];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Scan results for a single package within a workspace,
|
|
334
|
+
* or the root of a single-package project.
|
|
335
|
+
*/
|
|
336
|
+
interface PackageScanResult {
|
|
337
|
+
/** Package name from package.json. */
|
|
338
|
+
name: string;
|
|
339
|
+
/** Absolute path to this package's root directory. */
|
|
340
|
+
root: string;
|
|
341
|
+
/** Path relative to the workspace root. Empty string for single-package projects. */
|
|
342
|
+
relativePath: string;
|
|
343
|
+
/** Detected technology stack for this package. */
|
|
344
|
+
stack: DetectedStack;
|
|
345
|
+
/** Detected directory structure within this package. */
|
|
346
|
+
structure: DetectedStructure;
|
|
347
|
+
/** Detected coding conventions for this package. */
|
|
348
|
+
conventions: Record<string, DetectedConvention>;
|
|
349
|
+
/** Quantitative statistics for this package. */
|
|
350
|
+
statistics: CodebaseStatistics;
|
|
305
351
|
}
|
|
306
352
|
/**
|
|
307
353
|
* Workspace information detected by scanning the project root
|
|
@@ -399,4 +445,4 @@ interface FileStatistic {
|
|
|
399
445
|
|
|
400
446
|
declare const VERSION = "0.1.0";
|
|
401
447
|
|
|
402
|
-
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, ROLE_DESCRIPTIONS, STYLING_NAMES, type ScanResult, type StackItem, VERSION, type ViberailsConfig, type WorkspaceConfig, type WorkspacePackage, confidenceFromConsistency };
|
|
448
|
+
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
|
@@ -115,6 +115,26 @@ interface ViberailsConfig {
|
|
|
115
115
|
boundaries?: BoundaryRule[];
|
|
116
116
|
/** Workspace configuration for monorepo support (V1.1+). */
|
|
117
117
|
workspace?: WorkspaceConfig;
|
|
118
|
+
/** Per-package overrides for monorepo projects. Only packages that differ from global. */
|
|
119
|
+
packages?: PackageConfigOverrides[];
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Per-package configuration overrides for monorepo projects.
|
|
123
|
+
* Only fields that differ from the global config are included.
|
|
124
|
+
*/
|
|
125
|
+
interface PackageConfigOverrides {
|
|
126
|
+
/** Package name from package.json. */
|
|
127
|
+
name: string;
|
|
128
|
+
/** Relative path to the package (e.g. "apps/web"). */
|
|
129
|
+
path: string;
|
|
130
|
+
/** Override stack fields (only differences from global). */
|
|
131
|
+
stack?: Partial<ConfigStack>;
|
|
132
|
+
/** Override conventions (only differences from global). */
|
|
133
|
+
conventions?: Partial<ConfigConventions>;
|
|
134
|
+
/** Override rules (only differences from global). */
|
|
135
|
+
rules?: Partial<ConfigRules>;
|
|
136
|
+
/** Additional ignore patterns for this package (appended to global). */
|
|
137
|
+
ignore?: string[];
|
|
118
138
|
}
|
|
119
139
|
/**
|
|
120
140
|
* Workspace configuration for monorepo projects.
|
|
@@ -302,6 +322,32 @@ interface ScanResult {
|
|
|
302
322
|
statistics: CodebaseStatistics;
|
|
303
323
|
/** Detected workspace information for monorepo projects (V1.1+). */
|
|
304
324
|
workspace?: DetectedWorkspace;
|
|
325
|
+
/**
|
|
326
|
+
* Per-package scan results. Always has at least one entry.
|
|
327
|
+
* For single-package projects, contains one entry identical to the top-level fields.
|
|
328
|
+
* For monorepos, contains one entry per workspace package.
|
|
329
|
+
*/
|
|
330
|
+
packages: PackageScanResult[];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Scan results for a single package within a workspace,
|
|
334
|
+
* or the root of a single-package project.
|
|
335
|
+
*/
|
|
336
|
+
interface PackageScanResult {
|
|
337
|
+
/** Package name from package.json. */
|
|
338
|
+
name: string;
|
|
339
|
+
/** Absolute path to this package's root directory. */
|
|
340
|
+
root: string;
|
|
341
|
+
/** Path relative to the workspace root. Empty string for single-package projects. */
|
|
342
|
+
relativePath: string;
|
|
343
|
+
/** Detected technology stack for this package. */
|
|
344
|
+
stack: DetectedStack;
|
|
345
|
+
/** Detected directory structure within this package. */
|
|
346
|
+
structure: DetectedStructure;
|
|
347
|
+
/** Detected coding conventions for this package. */
|
|
348
|
+
conventions: Record<string, DetectedConvention>;
|
|
349
|
+
/** Quantitative statistics for this package. */
|
|
350
|
+
statistics: CodebaseStatistics;
|
|
305
351
|
}
|
|
306
352
|
/**
|
|
307
353
|
* Workspace information detected by scanning the project root
|
|
@@ -399,4 +445,4 @@ interface FileStatistic {
|
|
|
399
445
|
|
|
400
446
|
declare const VERSION = "0.1.0";
|
|
401
447
|
|
|
402
|
-
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, ROLE_DESCRIPTIONS, STYLING_NAMES, type ScanResult, type StackItem, VERSION, type ViberailsConfig, type WorkspaceConfig, type WorkspacePackage, confidenceFromConsistency };
|
|
448
|
+
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
|
@@ -8,6 +8,8 @@ function confidenceFromConsistency(consistency) {
|
|
|
8
8
|
// src/display-names.ts
|
|
9
9
|
var FRAMEWORK_NAMES = {
|
|
10
10
|
nextjs: "Next.js",
|
|
11
|
+
expo: "Expo",
|
|
12
|
+
"react-native": "React Native",
|
|
11
13
|
remix: "Remix",
|
|
12
14
|
nuxt: "Nuxt",
|
|
13
15
|
sveltekit: "SvelteKit",
|
|
@@ -31,7 +33,15 @@ var LIBRARY_NAMES = {
|
|
|
31
33
|
zod: "Zod",
|
|
32
34
|
trpc: "tRPC",
|
|
33
35
|
prisma: "Prisma",
|
|
34
|
-
drizzle: "Drizzle"
|
|
36
|
+
drizzle: "Drizzle",
|
|
37
|
+
expo: "Expo",
|
|
38
|
+
"react-native": "React Native",
|
|
39
|
+
nextjs: "Next.js",
|
|
40
|
+
react: "React",
|
|
41
|
+
sveltekit: "SvelteKit",
|
|
42
|
+
svelte: "Svelte",
|
|
43
|
+
astro: "Astro",
|
|
44
|
+
vue: "Vue"
|
|
35
45
|
};
|
|
36
46
|
var ROLE_DESCRIPTIONS = {
|
|
37
47
|
pages: "Pages / Routes",
|
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 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};\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 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 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,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;
|
|
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":[]}
|