diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
index f81e575..c7cb6eb 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -13,7 +13,7 @@ A clear description of the bug.
## Steps to Reproduce
1. Create config with...
-2. Run `archgate check`
+2. Run `layerguard check`
3. See error
## Expected Behavior
@@ -26,7 +26,7 @@ What actually happened.
## Environment
-- Archgate version:
+- Layerguard version:
- Node.js version:
- TypeScript version:
- OS:
@@ -34,7 +34,7 @@ What actually happened.
## Config File
```typescript
-// archgate.config.ts (redacted if needed)
+// layerguard.config.ts (redacted if needed)
```
## Additional Context
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 78e0ed9..810e34d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,12 +35,12 @@ jobs:
- name: Lint
run: pnpm lint
- - name: Run tests
- run: pnpm test
-
- name: Build
run: pnpm build
+ - name: Run tests
+ run: pnpm test
+
- name: Self-hosting test
run: pnpm test:self
@@ -63,6 +63,9 @@ jobs:
- name: Install dependencies
run: pnpm install --frozen-lockfile
+ - name: Build
+ run: pnpm build
+
- name: Run tests with coverage
run: pnpm test:coverage
diff --git a/.gitignore b/.gitignore
index b4c74fa..6aa138c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,8 +11,8 @@ dist/
*.swp
*.swo
-# Archgate cache
-.archgate-cache/
+# Layerguard cache
+.layerguard-cache/
# OS files
.DS_Store
@@ -30,7 +30,7 @@ npm-debug.log*
.cache/
coverage/
-archgate-report.html
+layerguard-report.html
# VS Code extension build artifacts
*.vsix
diff --git a/AGENTS.md b/AGENTS.md
index cea612b..c4de9d8 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -1,10 +1,10 @@
-# Archgate Development Guide for Agentic Coding Agents
+# Layerguard Development Guide for Agentic Coding Agents
-This guide provides essential information for agentic coding agents working with the Archgate codebase.
+This guide provides essential information for agentic coding agents working with the Layerguard codebase.
## Project Overview
-Archgate is a framework-agnostic CLI tool that enforces architectural layer boundaries in TypeScript/JavaScript projects. It helps maintain clean architecture by preventing inappropriate dependencies between layers.
+Layerguard is a framework-agnostic CLI tool that enforces architectural layer boundaries in TypeScript/JavaScript projects. It helps maintain clean architecture by preventing inappropriate dependencies between layers.
## Build Commands
@@ -41,7 +41,7 @@ pnpm test:watch
# Run tests with coverage report
pnpm test:coverage
-# Run self-check (archgate checking itself)
+# Run self-check (layerguard checking itself)
pnpm test:self
# Run a single test file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 5af0c9c..66ba1d6 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,13 +1,13 @@
-# Contributing to Archgate
+# Contributing to Layerguard
-Thank you for your interest in contributing to Archgate! This document provides guidelines and information for contributors.
+Thank you for your interest in contributing to Layerguard! This document provides guidelines and information for contributors.
## Development Setup
1. **Clone the repository**
```bash
- git clone https://github.com/yourusername/archgate.git
- cd archgate
+ git clone https://github.com/yourusername/layerguard.git
+ cd layerguard
```
2. **Install dependencies**
@@ -28,7 +28,7 @@ Thank you for your interest in contributing to Archgate! This document provides
## Project Structure
```
-archgate/
+layerguard/
src/
cli/ # CLI commands (check, init, show)
config/ # Config loading and validation
@@ -40,7 +40,7 @@ archgate/
unit/ # Unit tests
integration/ # Integration tests with fixtures
bin/
- archgate.js # CLI entry point
+ layerguard.js # CLI entry point
```
## Development Scripts
@@ -64,7 +64,7 @@ npm run test:coverage
# Type check without emitting
npm run typecheck
-# Run archgate on itself (self-hosting test)
+# Run layerguard on itself (self-hosting test)
npm run test:self
```
@@ -94,7 +94,7 @@ describe('parseFlowRules', () => {
## Adding a Framework Plugin
-Framework plugins help Archgate understand framework-specific conventions. To add a new plugin:
+Framework plugins help Layerguard understand framework-specific conventions. To add a new plugin:
1. **Create the plugin file** in `src/plugins/`:
@@ -195,7 +195,7 @@ test: add edge case tests for sublayer flow
When reporting issues, please include:
-1. **Archgate version** (`npx archgate --version`)
+1. **Layerguard version** (`npx layerguard --version`)
2. **Node.js version** (`node --version`)
3. **TypeScript version** (`npx tsc --version`)
4. **Your config file** (redacted if needed)
diff --git a/LICENSE b/LICENSE
index 712df3c..65d5531 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2024 Archgate Contributors
+Copyright (c) 2024 Layerguard Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index 4ac3646..f6d6e30 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,17 @@
-
-
-
-
+
+
+
+
-# Archgate
+# Layerguard
Architectural layer enforcement for TypeScript and JavaScript projects.
-Archgate prevents architectural violations before they happen. Define your layers, declare how dependencies can flow between them, and Archgate enforces those rules in CI, pre-commit hooks, or your editor.
+Layerguard prevents architectural violations before they happen. Define your layers, declare how dependencies can flow between them, and Layerguard enforces those rules in CI, pre-commit hooks, or your editor.
-## Why Archgate?
+## Why Layerguard?
- **Catch violations early** - Get instant feedback when code violates your architecture
- **Framework-agnostic** - Works with Next.js, Vite, Angular, Node backends, and more
@@ -48,14 +48,14 @@ Archgate prevents architectural violations before they happen. Define your layer
## Installation
```bash
-npm install --save-dev archgate
+npm install --save-dev layerguard
```
Or with your preferred package manager:
```bash
-pnpm add -D archgate
-yarn add -D archgate
+pnpm add -D layerguard
+yarn add -D layerguard
```
**Requirements:** Node.js 18.0.0 or higher, TypeScript 4.7.0 or higher
@@ -65,21 +65,21 @@ yarn add -D archgate
Run the interactive setup wizard:
```bash
-npx archgate init
+npx layerguard init
```
-The wizard detects your project structure, suggests layers, and generates `archgate.config.ts`.
+The wizard detects your project structure, suggests layers, and generates `layerguard.config.ts`.
Then validate your architecture:
```bash
-npx archgate check
+npx layerguard check
```
If code violates the rules:
```
-archgate check
+layerguard check
✗ 1 violation
@@ -91,10 +91,10 @@ archgate check
## Configuration
-Create `archgate.config.ts` in your project root:
+Create `layerguard.config.ts` in your project root:
```typescript
-import { defineConfig } from 'archgate'
+import { defineConfig } from 'layerguard'
export default defineConfig({
layers: {
@@ -273,7 +273,7 @@ tsconfig: ['tsconfig.app.json', 'tsconfig.server.json'],
Validate architecture rules:
```bash
-archgate check [options]
+layerguard check [options]
```
| Option | Description |
@@ -292,12 +292,12 @@ archgate check [options]
**Examples:**
```bash
-archgate check # Standard check
-archgate check --ci # GitHub Actions annotations
-archgate check --json # JSON output for tooling
-archgate check --watch # Watch mode
-archgate check --package apps/web # Check specific package
-archgate check --all # Check all packages in monorepo
+layerguard check # Standard check
+layerguard check --ci # GitHub Actions annotations
+layerguard check --json # JSON output for tooling
+layerguard check --watch # Watch mode
+layerguard check --package apps/web # Check specific package
+layerguard check --all # Check all packages in monorepo
```
### show
@@ -305,7 +305,7 @@ archgate check --all # Check all packages in monorepo
Display architecture diagram:
```bash
-archgate show [options]
+layerguard show [options]
```
| Option | Description |
@@ -318,7 +318,7 @@ archgate show [options]
Interactive setup wizard:
```bash
-archgate init [options]
+layerguard init [options]
```
| Option | Description |
@@ -330,12 +330,12 @@ archgate init [options]
Generate HTML or Markdown report:
```bash
-archgate report [options]
+layerguard report [options]
```
| Option | Description |
|--------|-------------|
-| `--output`, `-o` | Output file path (default: `archgate-report.html`) |
+| `--output`, `-o` | Output file path (default: `layerguard-report.html`) |
| `--markdown`, `--md` | Output as Markdown instead of HTML |
| `--stdout` | Print to stdout instead of file |
| `--from` | Load historical data from JSON for trend charts |
@@ -344,48 +344,48 @@ archgate report [options]
**Examples:**
```bash
-archgate report # Generate HTML report
-archgate report --markdown # Markdown summary
-archgate report -o reports/arch.html # Custom output path
-archgate report --from history.json # Include trend data
+layerguard report # Generate HTML report
+layerguard report --markdown # Markdown summary
+layerguard report -o reports/arch.html # Custom output path
+layerguard report --from history.json # Include trend data
```
## Monorepo Support
-Archgate detects pnpm, npm, and Yarn workspaces automatically.
+Layerguard detects pnpm, npm, and Yarn workspaces automatically.
### Per-package Configuration
-Each package can have its own `archgate.config.ts`:
+Each package can have its own `layerguard.config.ts`:
```
my-monorepo/
├── package.json # workspaces: ["packages/*", "apps/*"]
├── packages/
│ └── shared/
-│ └── archgate.config.ts
+│ └── layerguard.config.ts
└── apps/
└── web/
- └── archgate.config.ts
+ └── layerguard.config.ts
```
### Check Specific Package
```bash
# By name
-archgate check --package @myorg/web
+layerguard check --package @myorg/web
# By path
-archgate check --package apps/web
+layerguard check --package apps/web
```
### Check All Packages
```bash
-archgate check --all
+layerguard check --all
```
-This finds all packages with `archgate.config.ts` and checks them in sequence.
+This finds all packages with `layerguard.config.ts` and checks them in sequence.
### Cross-package Imports
@@ -423,7 +423,7 @@ export default defineConfig({
Framework detection enables:
- Entry point recognition (excluded from orphan detection)
- Framework-specific file patterns
-- Better layer suggestions in `archgate init`
+- Better layer suggestions in `layerguard init`
## ESLint Integration
@@ -431,15 +431,15 @@ Get inline editor feedback with the ESLint plugin:
```javascript
// eslint.config.js
-import archgate from 'archgate/eslint'
+import layerguard from 'layerguard/eslint'
export default [
- ...archgate.configs.recommended,
+ ...layerguard.configs.recommended,
// your other config...
]
```
-The plugin reads your `archgate.config.ts` and reports violations as you type.
+The plugin reads your `layerguard.config.ts` and reports violations as you type.
## GitHub Actions
@@ -451,7 +451,7 @@ name: Architecture Check
on: [push, pull_request]
jobs:
- archgate:
+ layerguard:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@@ -459,7 +459,7 @@ jobs:
with:
node-version: '20'
- run: npm ci
- - run: npx archgate check --ci
+ - run: npx layerguard check --ci
```
The `--ci` flag outputs GitHub Actions annotations, showing violations inline in the PR diff.
@@ -469,7 +469,7 @@ The `--ci` flag outputs GitHub Actions annotations, showing violations inline in
Post a summary comment on pull requests:
```yaml
-- run: npx archgate check --github-pr-comment
+- run: npx layerguard check --github-pr-comment
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
@@ -478,7 +478,7 @@ This requires the `gh` CLI (pre-installed on GitHub-hosted runners).
## VS Code Extension
-Install the [Archgate extension](https://marketplace.visualstudio.com/items?itemName=archgate.archgate-vscode) for:
+Install the [Layerguard extension](https://marketplace.visualstudio.com/items?itemName=layerguard.layerguard-vscode) for:
- Inline diagnostics showing violations as you type
- Quick fixes for common issues
@@ -486,12 +486,12 @@ Install the [Archgate extension](https://marketplace.visualstudio.com/items?item
## Programmatic API
-Use Archgate programmatically in your tools:
+Use Layerguard programmatically in your tools:
```typescript
-import { loadConfig, validateConfig } from 'archgate/config'
-import { buildDependencyGraph } from 'archgate/parser'
-import { createFlowChecker } from 'archgate/enforcer'
+import { loadConfig, validateConfig } from 'layerguard/config'
+import { buildDependencyGraph } from 'layerguard/parser'
+import { createFlowChecker } from 'layerguard/enforcer'
// Load and validate config
const { config } = await loadConfig(process.cwd())
@@ -519,12 +519,12 @@ console.log(`Found ${result.violations.length} violations`)
| Export | Description |
|--------|-------------|
-| `archgate` | Main entry point |
-| `archgate/config` | Config loading and validation |
-| `archgate/parser` | Dependency graph building |
-| `archgate/enforcer` | Violation checking |
-| `archgate/plugins` | Framework plugin interfaces |
-| `archgate/eslint` | ESLint plugin |
+| `layerguard` | Main entry point |
+| `layerguard/config` | Config loading and validation |
+| `layerguard/parser` | Dependency graph building |
+| `layerguard/enforcer` | Violation checking |
+| `layerguard/plugins` | Framework plugin interfaces |
+| `layerguard/eslint` | ESLint plugin |
## License
diff --git a/bin/archgate.js b/bin/layerguard.js
similarity index 60%
rename from bin/archgate.js
rename to bin/layerguard.js
index 69cb3eb..a4ca06d 100644
--- a/bin/archgate.js
+++ b/bin/layerguard.js
@@ -1,6 +1,6 @@
#!/usr/bin/env node
import('../dist/cli/index.js').catch((err) => {
- console.error('Failed to start archgate:', err.message)
+ console.error('Failed to start layerguard:', err.message)
process.exit(1)
})
diff --git a/archgate.config.ts b/layerguard.config.ts
similarity index 94%
rename from archgate.config.ts
rename to layerguard.config.ts
index bcf835b..76df026 100644
--- a/archgate.config.ts
+++ b/layerguard.config.ts
@@ -1,5 +1,5 @@
/**
- * Archgate configuration for the archgate project itself (dogfooding)
+ * Layerguard configuration for the layerguard project itself (dogfooding)
*/
import { defineConfig } from './src/config/types.js'
@@ -70,7 +70,7 @@ export default defineConfig({
// CLI entry point
'bin/**',
// Config file itself
- 'archgate.config.ts',
+ 'layerguard.config.ts',
// VS Code extension has its own architecture
'vscode-extension/**',
],
diff --git a/package.json b/package.json
index 2f7cf12..565c281 100644
--- a/package.json
+++ b/package.json
@@ -1,12 +1,12 @@
{
- "name": "archgate",
+ "name": "layerguard",
"version": "0.1.0",
"description": "Framework-agnostic CLI tool that enforces architectural layer boundaries in TypeScript/JavaScript projects",
"type": "module",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"bin": {
- "archgate": "./bin/archgate.js"
+ "layerguard": "./bin/layerguard.js"
},
"exports": {
".": {
@@ -43,11 +43,11 @@
},
"repository": {
"type": "git",
- "url": "git+https://github.com/caprado/archgate.git"
+ "url": "git+https://github.com/caprado/layerguard.git"
},
- "homepage": "https://github.com/caprado/archgate#readme",
+ "homepage": "https://github.com/caprado/layerguard#readme",
"bugs": {
- "url": "https://github.com/caprado/archgate/issues"
+ "url": "https://github.com/caprado/layerguard/issues"
},
"scripts": {
"build": "tsc -p tsconfig.build.json",
@@ -57,7 +57,7 @@
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:integration": "vitest run --config vitest.integration.config.ts",
- "test:self": "node bin/archgate.js check",
+ "test:self": "node bin/layerguard.js check",
"lint": "eslint src/",
"prepublishOnly": "npm run build"
},
diff --git a/src/cache/manager.ts b/src/cache/manager.ts
index 3b66a5d..3be9ecf 100644
--- a/src/cache/manager.ts
+++ b/src/cache/manager.ts
@@ -8,7 +8,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync, statSync, rmSync }
import { join, dirname } from 'node:path'
import { createHash } from 'node:crypto'
import type { DependencyGraph } from '../parser/graph.js'
-import type { ArchgateConfig } from '../config/types.js'
+import type { LayerguardConfig } from '../config/types.js'
import {
CACHE_VERSION,
CACHE_DIR,
@@ -40,7 +40,7 @@ export function getFileMtime(filePath: string): number | null {
/**
* Create a hash of the config for cache invalidation
*/
-export function hashConfig(config: ArchgateConfig): string {
+export function hashConfig(config: LayerguardConfig): string {
const configStr = JSON.stringify(config)
return createHash('md5').update(configStr).digest('hex')
}
@@ -112,7 +112,7 @@ export function validateCache(
cache: CacheData,
projectRoot: string,
currentFiles: string[],
- config: ArchgateConfig,
+ config: LayerguardConfig,
tsconfigPath?: string
): CacheValidation {
// Check version
@@ -188,7 +188,7 @@ export function validateCache(
*/
export function graphToCache(
graph: DependencyGraph,
- config: ArchgateConfig,
+ config: LayerguardConfig,
tsconfigPath?: string
): CacheData {
const files: Record = {}
diff --git a/src/cache/types.ts b/src/cache/types.ts
index 1b8c4b8..38df218 100644
--- a/src/cache/types.ts
+++ b/src/cache/types.ts
@@ -12,7 +12,7 @@ export const CACHE_VERSION = '1.0.0'
/**
* Default cache directory name
*/
-export const CACHE_DIR = '.archgate-cache'
+export const CACHE_DIR = '.layerguard-cache'
/**
* Cache file name
@@ -64,7 +64,7 @@ export interface CacheData {
tsconfigMtime?: number
/**
- * Hash of the archgate config (to invalidate on config changes)
+ * Hash of the layerguard config (to invalidate on config changes)
*/
configHash?: string
diff --git a/src/cli/check.ts b/src/cli/check.ts
index fce6604..d4c9141 100644
--- a/src/cli/check.ts
+++ b/src/cli/check.ts
@@ -1,5 +1,5 @@
/**
- * archgate check command
+ * layerguard check command
*
* Validates the project against architectural rules
*/
@@ -61,7 +61,7 @@ export interface CheckCommandOptions {
package?: string
/**
- * Check all workspace packages with archgate configs
+ * Check all workspace packages with layerguard configs
*/
all?: boolean
}
@@ -260,7 +260,7 @@ async function runWorkspaceCheck(options: CheckCommandOptions): Promise pc.package.name).join(', ')
- console.error(formatError(`Package "${packageFilter}" not found or has no archgate config.\nAvailable packages: ${available}`, { colors: !noColors }))
+ console.error(formatError(`Package "${packageFilter}" not found or has no layerguard config.\nAvailable packages: ${available}`, { colors: !noColors }))
return { passed: false, exitCode: 1, errorCount: 1, warningCount: 0, violations: [] }
}
packagesToCheck = [found]
diff --git a/src/cli/generator.ts b/src/cli/generator.ts
index 765aa4e..7848126 100644
--- a/src/cli/generator.ts
+++ b/src/cli/generator.ts
@@ -1,12 +1,12 @@
/**
* Config file generator
*
- * Generates archgate.config.ts/js files from config objects
+ * Generates layerguard.config.ts/js files from config objects
*/
import * as fs from 'node:fs'
import * as path from 'node:path'
-import type { ArchgateConfig, LayerConfig } from '../config/types.js'
+import type { LayerguardConfig, LayerConfig } from '../config/types.js'
/**
* Options for generating config
@@ -27,7 +27,7 @@ export interface GenerateOptions {
* Generate config file content
*/
export function generateConfigContent(
- config: ArchgateConfig,
+ config: LayerguardConfig,
options: GenerateOptions = {}
): string {
const { typescript = true, includeComments = true } = options
@@ -35,11 +35,11 @@ export function generateConfigContent(
// Import statement
if (typescript) {
- lines.push("import { defineConfig } from 'archgate'")
+ lines.push("import { defineConfig } from 'layerguard'")
} else {
lines.push(
"// @ts-check",
- "/** @type {import('archgate').ArchgateConfig} */"
+ "/** @type {import('layerguard').LayerguardConfig} */"
)
}
lines.push('')
@@ -197,11 +197,11 @@ function formatLayer(
*/
export function writeConfigFile(
projectRoot: string,
- config: ArchgateConfig,
+ config: LayerguardConfig,
options: GenerateOptions = {}
): string {
const { typescript = true } = options
- const filename = typescript ? 'archgate.config.ts' : 'archgate.config.js'
+ const filename = typescript ? 'layerguard.config.ts' : 'layerguard.config.js'
const filepath = path.join(projectRoot, filename)
const content = generateConfigContent(config, options)
@@ -215,10 +215,10 @@ export function writeConfigFile(
*/
export function configFileExists(projectRoot: string): string | null {
const candidates = [
- 'archgate.config.ts',
- 'archgate.config.js',
- 'archgate.config.mjs',
- 'archgate.config.cjs',
+ 'layerguard.config.ts',
+ 'layerguard.config.js',
+ 'layerguard.config.mjs',
+ 'layerguard.config.cjs',
]
for (const filename of candidates) {
diff --git a/src/cli/index.ts b/src/cli/index.ts
index a7d0f62..f38addd 100644
--- a/src/cli/index.ts
+++ b/src/cli/index.ts
@@ -1,5 +1,5 @@
/**
- * Archgate CLI entry point
+ * Layerguard CLI entry point
*/
import { runCheck } from './check.js'
@@ -155,17 +155,17 @@ export function parseArgs(args: string[]): ParsedArgs {
*/
export function printHelp(): void {
console.log(`
-archgate v${VERSION}
+layerguard v${VERSION}
Enforce architectural layer boundaries in TypeScript/JavaScript projects.
Usage:
- archgate [options]
+ layerguard [options]
Commands:
check Validate architecture rules, exit 1 on violations
show Print the architecture as a text diagram
- init Interactive setup to create archgate.config.ts
+ init Interactive setup to create layerguard.config.ts
report Generate HTML report of violations
Options:
@@ -180,7 +180,7 @@ Check options:
--watch, -w Watch mode: re-check on file changes
--no-cache Disable incremental caching, force full rescan
--package, -p Check a specific workspace package (name or path)
- --all Check all workspace packages with archgate configs
+ --all Check all workspace packages with layerguard configs
--github-pr-comment Post results as a PR comment (requires gh CLI)
--pr-number PR number for comment (auto-detected in GitHub Actions)
@@ -192,26 +192,26 @@ Init options:
-y, --yes Skip prompts and use defaults
Report options:
- --output, -o Output file path (default: archgate-report.html)
+ --output, -o Output file path (default: layerguard-report.html)
--markdown Output as Markdown instead of HTML
--stdout Print to stdout instead of file
--from Load historical data from JSON file for trends
--title Report title
Examples:
- archgate check Run validation
- archgate check --ci Run with GitHub Actions annotations
- archgate check --json Output as JSON
- archgate check --watch Watch for changes and re-check
- archgate check --package apps/web Check a specific package
- archgate check --all Check all packages in monorepo
- archgate show Display architecture diagram
- archgate show --ascii Display with ASCII characters
- archgate init Interactive setup wizard
- archgate init -y Quick setup with defaults
- archgate report Generate HTML report
- archgate report --markdown Generate Markdown summary
- archgate report -o report.html Save report to custom path
+ layerguard check Run validation
+ layerguard check --ci Run with GitHub Actions annotations
+ layerguard check --json Output as JSON
+ layerguard check --watch Watch for changes and re-check
+ layerguard check --package apps/web Check a specific package
+ layerguard check --all Check all packages in monorepo
+ layerguard show Display architecture diagram
+ layerguard show --ascii Display with ASCII characters
+ layerguard init Interactive setup wizard
+ layerguard init -y Quick setup with defaults
+ layerguard report Generate HTML report
+ layerguard report --markdown Generate Markdown summary
+ layerguard report -o report.html Save report to custom path
`)
}
@@ -219,7 +219,7 @@ Examples:
* Print version
*/
export function printVersion(): void {
- console.log(`archgate v${VERSION}`)
+ console.log(`layerguard v${VERSION}`)
}
/**
@@ -325,13 +325,13 @@ export async function main(argv: string[] = process.argv.slice(2)): Promise {
diff --git a/src/cli/init.ts b/src/cli/init.ts
index 76fe846..f720ac7 100644
--- a/src/cli/init.ts
+++ b/src/cli/init.ts
@@ -1,13 +1,13 @@
/**
- * archgate init command
+ * layerguard init command
*
- * Interactive setup to create archgate.config.ts
+ * Interactive setup to create layerguard.config.ts
*/
import * as p from '@clack/prompts'
import * as fs from 'node:fs'
import * as path from 'node:path'
-import type { ArchgateConfig, LayerConfig, SublayerConfig } from '../config/types.js'
+import type { LayerguardConfig, LayerConfig, SublayerConfig } from '../config/types.js'
import {
detectFramework,
scanForLayers,
@@ -47,7 +47,7 @@ export async function runInit(options: InitCommandOptions = {}): Promise {
// Check if config already exists
const existingConfig = configFileExists(cwd)
if (existingConfig) {
- p.intro('archgate init')
+ p.intro('layerguard init')
p.log.warn(`Config file already exists: ${existingConfig}`)
if (!yes) {
@@ -64,7 +64,7 @@ export async function runInit(options: InitCommandOptions = {}): Promise {
}
// Start the interactive flow
- p.intro('Welcome to archgate')
+ p.intro('Welcome to layerguard')
// Detect framework
const detection = detectFramework(cwd)
@@ -113,7 +113,7 @@ export async function runInit(options: InitCommandOptions = {}): Promise {
}
}
- let config: ArchgateConfig
+ let config: LayerguardConfig
if (usePreset && selectedPreset) {
// Use preset config
@@ -129,7 +129,7 @@ export async function runInit(options: InitCommandOptions = {}): Promise {
if (!yes) {
// Ask if they want to choose a preset or go custom
const presetChoice = await p.select({
- message: 'How would you like to set up archgate?',
+ message: 'How would you like to set up layerguard?',
options: [
{
value: 'scan',
@@ -230,8 +230,8 @@ export async function runInit(options: InitCommandOptions = {}): Promise {
p.outro(`Config written to ${path.basename(filepath)}`)
console.log('')
- console.log('Run `archgate check` to validate your architecture.')
- console.log('Run `archgate show` to visualize the architecture.')
+ console.log('Run `layerguard check` to validate your architecture.')
+ console.log('Run `layerguard show` to visualize the architecture.')
}
/**
@@ -240,7 +240,7 @@ export async function runInit(options: InitCommandOptions = {}): Promise {
async function runCustomSetup(
cwd: string,
framework?: DetectedFramework
-): Promise {
+): Promise {
// Scan for directories
const directories = scanForLayers(cwd)
@@ -425,7 +425,7 @@ async function runCustomSetup(
.filter((r) => r)
}
- const config: ArchgateConfig = {
+ const config: LayerguardConfig = {
layers,
flow,
}
diff --git a/src/cli/presets.ts b/src/cli/presets.ts
index 996aa7d..eb3ba44 100644
--- a/src/cli/presets.ts
+++ b/src/cli/presets.ts
@@ -2,7 +2,7 @@
* Preset templates for common project structures
*/
-import type { ArchgateConfig, LayerConfig, SublayerConfig } from '../config/types.js'
+import type { LayerguardConfig, LayerConfig, SublayerConfig } from '../config/types.js'
/**
* Preset template
@@ -31,7 +31,7 @@ export interface Preset {
/**
* Optional framework setting
*/
- framework?: ArchgateConfig['framework']
+ framework?: LayerguardConfig['framework']
}
/**
@@ -272,8 +272,8 @@ export function createCustomConfig(
sublayers?: Array<{ name: string; path: string; isolated?: boolean }>
}>,
flowRules: string[],
- framework?: ArchgateConfig['framework']
-): ArchgateConfig {
+ framework?: LayerguardConfig['framework']
+): LayerguardConfig {
const layersConfig: Record = {}
for (const layer of layers) {
@@ -295,7 +295,7 @@ export function createCustomConfig(
layersConfig[layer.name] = config
}
- const config: ArchgateConfig = {
+ const config: LayerguardConfig = {
layers: layersConfig,
flow: flowRules,
}
diff --git a/src/cli/report.ts b/src/cli/report.ts
index 10b6186..dc6402d 100644
--- a/src/cli/report.ts
+++ b/src/cli/report.ts
@@ -1,5 +1,5 @@
/**
- * archgate report command
+ * layerguard report command
*
* Generates HTML reports from check results or historical data
*/
@@ -26,7 +26,7 @@ export interface ReportCommandOptions {
cwd?: string
/**
- * Output file path (default: archgate-report.html)
+ * Output file path (default: layerguard-report.html)
*/
output?: string
@@ -92,12 +92,12 @@ export interface ReportResult {
export async function runReport(options: ReportCommandOptions = {}): Promise {
const {
cwd = process.cwd(),
- output = 'archgate-report.html',
+ output = 'layerguard-report.html',
format = 'html',
from,
typeOnlyImports = false,
noColors = false,
- title = 'Archgate Report',
+ title = 'Layerguard Report',
stdout = false,
} = options
@@ -232,7 +232,7 @@ function loadHistoricalData(path: string): HistoricalDataPoint[] {
}
}
} else if (data.history) {
- // Support archgate-history.json format
+ // Support layerguard-history.json format
for (const item of data.history) {
const point = parseHistoricalItem(item)
if (point) {
diff --git a/src/cli/show.ts b/src/cli/show.ts
index bf3b63f..3fe47e2 100644
--- a/src/cli/show.ts
+++ b/src/cli/show.ts
@@ -1,5 +1,5 @@
/**
- * archgate show command
+ * layerguard show command
*
* Displays the architecture diagram
*/
diff --git a/src/cli/watch.ts b/src/cli/watch.ts
index 8c922b0..415a5bd 100644
--- a/src/cli/watch.ts
+++ b/src/cli/watch.ts
@@ -1,5 +1,5 @@
/**
- * Watch mode for archgate
+ * Watch mode for layerguard
*
* Watches for file changes and re-runs checks incrementally
*/
@@ -124,7 +124,7 @@ export async function startWatch(options: WatchOptions = {}): Promise ` - ${p}`).join('\n')}\n\nRun 'archgate init' to create one.`
+ `No layerguard config file found. Searched for:\n${searchedPaths.map((p) => ` - ${p}`).join('\n')}\n\nRun 'layerguard init' to create one.`
)
this.name = 'ConfigNotFoundError'
}
@@ -60,7 +60,7 @@ export function findConfigFile(cwd: string): string | null {
}
/**
- * Load and parse the archgate config file
+ * Load and parse the layerguard config file
*
* @param cwd - The directory to search for the config file (defaults to process.cwd())
* @returns The loaded config and its path
@@ -82,7 +82,7 @@ export async function loadConfig(cwd: string = process.cwd()): Promise>
/**
* Helper function for type-safe config definition
*/
-export function defineConfig(config: ArchgateConfig): ArchgateConfig {
+export function defineConfig(config: LayerguardConfig): LayerguardConfig {
return config
}
diff --git a/src/config/validator.ts b/src/config/validator.ts
index 2b2e96f..b8d3b66 100644
--- a/src/config/validator.ts
+++ b/src/config/validator.ts
@@ -1,12 +1,12 @@
/**
* Config validator
*
- * Validates the archgate config structure and ensures all references are valid.
+ * Validates the layerguard config structure and ensures all references are valid.
*/
import { existsSync } from 'node:fs'
import { resolve } from 'node:path'
-import type { ArchgateConfig, LayerConfig, SublayerConfig } from './types.js'
+import type { LayerguardConfig, LayerConfig, SublayerConfig } from './types.js'
import { parseFlowRules, buildFlowGraph, findIsolatedLayers, type FlowParseError } from './parser.js'
import type { FlowGraph, ParsedFlowRule } from './types.js'
@@ -26,13 +26,13 @@ export interface ValidationResult {
}
/**
- * Validate the archgate config
+ * Validate the layerguard config
*
* @param config - The config to validate
* @param cwd - The project root directory for path validation
* @returns Validation result with errors, warnings, and parsed flow graph
*/
-export function validateConfig(config: ArchgateConfig, cwd: string): ValidationResult {
+export function validateConfig(config: LayerguardConfig, cwd: string): ValidationResult {
const errors: ValidationError[] = []
const warnings: ValidationError[] = []
let flowGraph: FlowGraph | null = null
@@ -352,7 +352,7 @@ function validateSublayerFlow(
/**
* Validate rules configuration
*/
-function validateRulesConfig(rules: NonNullable): ValidationError[] {
+function validateRulesConfig(rules: NonNullable): ValidationError[] {
const errors: ValidationError[] = []
if (rules.circular !== undefined) {
diff --git a/src/enforcer/advanced-rules.ts b/src/enforcer/advanced-rules.ts
index 317ab5c..6119901 100644
--- a/src/enforcer/advanced-rules.ts
+++ b/src/enforcer/advanced-rules.ts
@@ -8,7 +8,7 @@
* - maxImportsPerFile: Import count limits
*/
-import type { ArchgateConfig, LayerConfig } from '../config/types.js'
+import type { LayerguardConfig, LayerConfig } from '../config/types.js'
import type { DependencyGraph } from '../parser/graph.js'
import type { LayerMapper } from './mapper.js'
import {
@@ -126,7 +126,7 @@ function findLongestChain(
*/
export function checkPublicApi(
graph: DependencyGraph,
- config: ArchgateConfig,
+ config: LayerguardConfig,
mapper: LayerMapper
): PublicApiViolation[] {
const violations: PublicApiViolation[] = []
@@ -221,7 +221,7 @@ function normalizePathForComparison(path: string): string {
*/
export function checkDependentBudget(
graph: DependencyGraph,
- config: ArchgateConfig,
+ config: LayerguardConfig,
mapper: LayerMapper
): DependentBudgetViolation[] {
const violations: DependentBudgetViolation[] = []
@@ -306,7 +306,7 @@ export function checkImportCount(
*/
export function checkAdvancedRules(
graph: DependencyGraph,
- config: ArchgateConfig,
+ config: LayerguardConfig,
mapper: LayerMapper,
options: AdvancedRulesOptions = {}
): Violation[] {
diff --git a/src/enforcer/checker.ts b/src/enforcer/checker.ts
index dae1e6e..b067bcf 100644
--- a/src/enforcer/checker.ts
+++ b/src/enforcer/checker.ts
@@ -5,7 +5,7 @@
*/
import { join } from 'node:path'
-import type { ArchgateConfig } from '../config/types.js'
+import type { LayerguardConfig } from '../config/types.js'
import type { FlowGraph } from '../config/types.js'
import { parseFlowRules, buildFlowGraph, canImport } from '../config/parser.js'
import type { DependencyGraph, DependencyEdge } from '../parser/graph.js'
@@ -130,13 +130,13 @@ export interface EdgeCheckResult {
* Flow checker instance
*/
export class FlowChecker {
- private config: ArchgateConfig
+ private config: LayerguardConfig
private mapper: LayerMapper
private topLevelFlowGraph: FlowGraph
private sublayerFlowGraphs: Map = new Map()
private plugin: FrameworkPlugin | undefined
- constructor(config: ArchgateConfig) {
+ constructor(config: LayerguardConfig) {
this.config = config
this.mapper = new LayerMapper(config)
@@ -502,7 +502,7 @@ export class FlowChecker {
/**
* Create a flow checker from config
*/
-export function createFlowChecker(config: ArchgateConfig): FlowChecker {
+export function createFlowChecker(config: LayerguardConfig): FlowChecker {
return new FlowChecker(config)
}
@@ -511,7 +511,7 @@ export function createFlowChecker(config: ArchgateConfig): FlowChecker {
*/
export function checkDependencyGraph(
graph: DependencyGraph,
- config: ArchgateConfig,
+ config: LayerguardConfig,
options: CheckOptions = {}
): Violation[] {
const checker = createFlowChecker(config)
diff --git a/src/enforcer/mapper.ts b/src/enforcer/mapper.ts
index 251b8db..4c9e842 100644
--- a/src/enforcer/mapper.ts
+++ b/src/enforcer/mapper.ts
@@ -4,7 +4,7 @@
* Maps file paths to their corresponding layers and sublayers
*/
-import type { ArchgateConfig, LayerConfig, SublayerConfig } from '../config/types.js'
+import type { LayerguardConfig, LayerConfig, SublayerConfig } from '../config/types.js'
/**
* Result of mapping a file to a layer
@@ -69,14 +69,14 @@ interface ProcessedSublayer {
export class LayerMapper {
private layers: ProcessedLayer[] = []
- constructor(config: ArchgateConfig) {
+ constructor(config: LayerguardConfig) {
this.processConfig(config)
}
/**
* Process the config into an efficient structure for matching
*/
- private processConfig(config: ArchgateConfig): void {
+ private processConfig(config: LayerguardConfig): void {
for (const [layerName, layerConfig] of Object.entries(config.layers)) {
const processedLayer: ProcessedLayer = {
name: layerName,
@@ -249,6 +249,6 @@ export class LayerMapper {
/**
* Create a layer mapper from config
*/
-export function createLayerMapper(config: ArchgateConfig): LayerMapper {
+export function createLayerMapper(config: LayerguardConfig): LayerMapper {
return new LayerMapper(config)
}
diff --git a/src/eslint/config-cache.ts b/src/eslint/config-cache.ts
index 658a6f1..1845a44 100644
--- a/src/eslint/config-cache.ts
+++ b/src/eslint/config-cache.ts
@@ -1,7 +1,7 @@
/**
* Configuration cache for ESLint plugin
*
- * ESLint processes files individually, so we cache the archgate config
+ * ESLint processes files individually, so we cache the layerguard config
* to avoid reloading it for every file.
*/
@@ -22,7 +22,7 @@ const configCache = new Map()
const CACHE_TTL = 5 * 60 * 1000
/**
- * Get or load the archgate configuration for a file
+ * Get or load the layerguard configuration for a file
*
* @param filePath - The file being linted
* @returns The cached configuration or null if not found/invalid
@@ -85,7 +85,7 @@ export function getConfig(filePath: string): CachedConfig | null {
/**
* Find the project root for a file
*
- * Looks for package.json or archgate config file
+ * Looks for package.json or layerguard config file
*/
function findProjectRoot(filePath: string): string | null {
let dir = dirname(filePath)
@@ -105,7 +105,7 @@ function findProjectRoot(filePath: string): string | null {
while (!isRoot(dir)) {
// console.log('Checking directory:', dir)
- // Check for archgate config
+ // Check for layerguard config
try {
const result = loadConfigSync(dir)
// console.log('loadConfigSync result for', dir, ':', result)
@@ -113,8 +113,7 @@ function findProjectRoot(filePath: string): string | null {
// console.log('Found config at:', dir)
return dir
}
- } catch (error) {
- // console.log('loadConfigSync error for', dir, ':', error)
+ } catch {
// No config in this directory
}
diff --git a/src/eslint/index.ts b/src/eslint/index.ts
index 9c95998..69968c5 100644
--- a/src/eslint/index.ts
+++ b/src/eslint/index.ts
@@ -1,22 +1,22 @@
/**
- * Archgate ESLint Plugin
+ * Layerguard ESLint Plugin
*
* Provides ESLint rules for enforcing architectural boundaries defined
- * in archgate configuration.
+ * in layerguard configuration.
*
* Usage in eslint.config.js:
*
* ```js
- * import archgate from 'archgate/eslint'
+ * import layerguard from 'layerguard/eslint'
*
* export default [
* {
* plugins: {
- * archgate,
+ * layerguard,
* },
* rules: {
- * 'archgate/layer-boundaries': 'error',
- * 'archgate/unlayered-imports': 'warn',
+ * 'layerguard/layer-boundaries': 'error',
+ * 'layerguard/unlayered-imports': 'warn',
* },
* },
* ]
@@ -28,11 +28,11 @@ import layerBoundaries from './rules/layer-boundaries.js'
import unlayeredImports from './rules/unlayered-imports.js'
/**
- * Archgate ESLint plugin
+ * Layerguard ESLint plugin
*/
const plugin: ESLint.Plugin = {
meta: {
- name: 'archgate',
+ name: 'layerguard',
version: '0.1.0',
},
@@ -49,15 +49,15 @@ const plugin: ESLint.Plugin = {
*
* Usage:
* ```js
- * import archgate from 'archgate/eslint'
- * export default [archgate.configs.recommended]
+ * import layerguard from 'layerguard/eslint'
+ * export default [layerguard.configs.recommended]
* ```
*/
get recommended(): Linter.Config {
return {
- plugins: { archgate: plugin },
+ plugins: { layerguard: plugin },
rules: {
- 'archgate/layer-boundaries': 'error',
+ 'layerguard/layer-boundaries': 'error',
},
}
},
@@ -69,16 +69,16 @@ const plugin: ESLint.Plugin = {
*
* Usage:
* ```js
- * import archgate from 'archgate/eslint'
- * export default [archgate.configs.strict]
+ * import layerguard from 'layerguard/eslint'
+ * export default [layerguard.configs.strict]
* ```
*/
get strict(): Linter.Config {
return {
- plugins: { archgate: plugin },
+ plugins: { layerguard: plugin },
rules: {
- 'archgate/layer-boundaries': 'error',
- 'archgate/unlayered-imports': 'error',
+ 'layerguard/layer-boundaries': 'error',
+ 'layerguard/unlayered-imports': 'error',
},
}
},
@@ -90,4 +90,4 @@ export default plugin
// Named exports for convenience
export { layerBoundaries, unlayeredImports }
export { clearConfigCache, getCacheStats } from './config-cache.js'
-export type { CachedConfig, ArchgateRuleOptions } from './types.js'
+export type { CachedConfig, LayerguardRuleOptions } from './types.js'
diff --git a/src/eslint/rules/layer-boundaries.ts b/src/eslint/rules/layer-boundaries.ts
index 120ba8d..2e5b60d 100644
--- a/src/eslint/rules/layer-boundaries.ts
+++ b/src/eslint/rules/layer-boundaries.ts
@@ -1,7 +1,7 @@
/**
- * ESLint rule: archgate/layer-boundaries
+ * ESLint rule: layerguard/layer-boundaries
*
- * Flags imports that violate flow rules defined in archgate config.
+ * Flags imports that violate flow rules defined in layerguard config.
*/
import type { Rule } from 'eslint'
@@ -18,13 +18,13 @@ const rule: Rule.RuleModule = {
meta: {
type: 'problem',
docs: {
- description: 'Enforce architectural layer boundaries defined in archgate config',
+ description: 'Enforce architectural layer boundaries defined in layerguard config',
recommended: true,
},
messages: {
violation:
'Import from "{{importPath}}" violates layer boundaries: {{fromLayer}} cannot import from {{toLayer}}',
- noConfig: 'No archgate configuration found',
+ noConfig: 'No layerguard configuration found',
},
schema: [
{
@@ -32,7 +32,7 @@ const rule: Rule.RuleModule = {
properties: {
configPath: {
type: 'string',
- description: 'Path to archgate config file',
+ description: 'Path to layerguard config file',
},
},
additionalProperties: false,
diff --git a/src/eslint/rules/unlayered-imports.ts b/src/eslint/rules/unlayered-imports.ts
index 0bef8cd..30dc7fc 100644
--- a/src/eslint/rules/unlayered-imports.ts
+++ b/src/eslint/rules/unlayered-imports.ts
@@ -1,8 +1,8 @@
/**
- * ESLint rule: archgate/unlayered-imports
+ * ESLint rule: layerguard/unlayered-imports
*
* Flags imports from layered files to unlayered files when the
- * unlayeredImports rule is set to 'error' or 'warn' in archgate config.
+ * unlayeredImports rule is set to 'error' or 'warn' in layerguard config.
*/
import type { Rule } from 'eslint'
@@ -31,7 +31,7 @@ const rule: Rule.RuleModule = {
properties: {
configPath: {
type: 'string',
- description: 'Path to archgate config file',
+ description: 'Path to layerguard config file',
},
},
additionalProperties: false,
diff --git a/src/eslint/types.ts b/src/eslint/types.ts
index 29db933..518065d 100644
--- a/src/eslint/types.ts
+++ b/src/eslint/types.ts
@@ -3,16 +3,16 @@
*/
import type { Rule } from 'eslint'
-import type { ArchgateConfig } from '../config/types.js'
+import type { LayerguardConfig } from '../config/types.js'
/**
- * Cached archgate configuration for ESLint
+ * Cached layerguard configuration for ESLint
*/
export interface CachedConfig {
/**
- * The loaded archgate configuration
+ * The loaded layerguard configuration
*/
- config: ArchgateConfig
+ config: LayerguardConfig
/**
* Path to the config file
@@ -31,21 +31,21 @@ export interface CachedConfig {
}
/**
- * ESLint rule context with archgate extensions
+ * ESLint rule context with layerguard extensions
*/
-export interface ArchgateRuleContext extends Rule.RuleContext {
+export interface LayerguardRuleContext extends Rule.RuleContext {
/**
- * Get the archgate configuration
+ * Get the layerguard configuration
*/
- getArchgateConfig?: () => CachedConfig | null
+ getLayerguardConfig?: () => CachedConfig | null
}
/**
- * Rule options for archgate ESLint rules
+ * Rule options for layerguard ESLint rules
*/
-export interface ArchgateRuleOptions {
+export interface LayerguardRuleOptions {
/**
- * Path to archgate config file (optional, auto-detected if not specified)
+ * Path to layerguard config file (optional, auto-detected if not specified)
*/
configPath?: string
}
diff --git a/src/index.ts b/src/index.ts
index dd187a3..2901967 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -1,5 +1,5 @@
/**
- * Archgate - Framework-agnostic architectural layer enforcement
+ * Layerguard - Framework-agnostic architectural layer enforcement
*
* Public API for programmatic use
*/
@@ -7,7 +7,7 @@
// Config types and helpers
export {
defineConfig,
- type ArchgateConfig,
+ type LayerguardConfig,
type LayerConfig,
type SublayerConfig,
type RulesConfig,
diff --git a/src/output/diagram.ts b/src/output/diagram.ts
index 990ae53..25fceb9 100644
--- a/src/output/diagram.ts
+++ b/src/output/diagram.ts
@@ -4,7 +4,7 @@
* Creates text-based diagrams of the architecture
*/
-import type { ArchgateConfig } from '../config/types.js'
+import type { LayerguardConfig } from '../config/types.js'
import { parseFlowRules } from '../config/parser.js'
/**
@@ -63,13 +63,13 @@ const boxChars = {
/**
* Generate an architecture diagram from config
*/
-export function generateDiagram(config: ArchgateConfig, options: DiagramOptions = {}): string {
+export function generateDiagram(config: LayerguardConfig, options: DiagramOptions = {}): string {
const { unicode = true, showSublayers = true, showFlow = true } = options
const chars = unicode ? boxChars.unicode : boxChars.ascii
const lines: string[] = []
// Title
- lines.push('Archgate Architecture')
+ lines.push('Layerguard Architecture')
lines.push('')
// Parse flow rules to understand relationships
@@ -109,7 +109,7 @@ export function generateDiagram(config: ArchgateConfig, options: DiagramOptions
* Build a simple layer order based on flow rules
*/
function buildLayerOrder(
- config: ArchgateConfig,
+ config: LayerguardConfig,
parsedRules: Array<{ from: string; to: string; direction: string }>
): string[] {
const layers = Object.keys(config.layers)
@@ -204,7 +204,7 @@ function padRight(str: string, width: number): string {
/**
* Generate a simple flow summary
*/
-export function generateFlowSummary(config: ArchgateConfig): string {
+export function generateFlowSummary(config: LayerguardConfig): string {
const lines: string[] = []
lines.push('Layer dependencies:')
diff --git a/src/output/github.ts b/src/output/github.ts
index d854b40..53c1d8d 100644
--- a/src/output/github.ts
+++ b/src/output/github.ts
@@ -110,7 +110,7 @@ export function generatePrCommentBody(report: ViolationReport, options: {
const { showDetails = true, commitSha, workflowName } = options
const status = report.passed ? '✅ Passed' : '❌ Failed'
- let md = `## Archgate Architecture Check ${status}\n\n`
+ let md = `## Layerguard Architecture Check ${status}\n\n`
// Summary table
md += `| Metric | Count |\n`
@@ -165,19 +165,19 @@ export function generatePrCommentBody(report: ViolationReport, options: {
if (workflowName) {
md += `Workflow: ${workflowName}\n`
}
- md += `\n*Generated by [Archgate](https://github.com/caprado/archgate)*`
+ md += `\n*Generated by [Layerguard](https://github.com/caprado/layerguard)*`
return md
}
/**
- * Find existing Archgate comment on a PR
+ * Find existing Layerguard comment on a PR
*/
function findExistingComment(prNumber: number, repo?: string): string | undefined {
try {
const repoArg = repo ? `--repo ${repo}` : ''
const result = execSync(
- `gh pr view ${prNumber} ${repoArg} --json comments --jq '.comments[] | select(.body | contains("Archgate Architecture Check")) | .id' | head -1`,
+ `gh pr view ${prNumber} ${repoArg} --json comments --jq '.comments[] | select(.body | contains("Layerguard Architecture Check")) | .id' | head -1`,
{ encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }
)
const commentId = result.trim()
diff --git a/src/output/html.ts b/src/output/html.ts
index 5a90fd1..a0324bd 100644
--- a/src/output/html.ts
+++ b/src/output/html.ts
@@ -6,7 +6,7 @@
*/
import type { ViolationReport, Violation } from '../enforcer/violations.js'
-import type { ArchgateConfig } from '../config/types.js'
+import type { LayerguardConfig } from '../config/types.js'
/**
* Historical data point for trend analysis
@@ -68,9 +68,9 @@ export interface HtmlReportOptions {
history?: HistoricalDataPoint[]
/**
- * Archgate configuration (for layer info)
+ * Layerguard configuration (for layer info)
*/
- config?: ArchgateConfig
+ config?: LayerguardConfig
/**
* File and import counts
@@ -86,7 +86,7 @@ export interface HtmlReportOptions {
*/
export function generateHtmlReport(report: ViolationReport, options: HtmlReportOptions = {}): string {
const {
- title = 'Archgate Report',
+ title = 'Layerguard Report',
projectName = 'Project',
history = [],
stats,
@@ -527,7 +527,7 @@ export function generateHtmlReport(report: ViolationReport, options: HtmlReportO
` : ''}