This guide covers multiple methods for installing the Architectural Discipline Package (ADP) in your projects.
The easiest way to add ADP to any project:
# Navigate to your project directory
cd /path/to/your/project
# Run the installer
npx @plures-adp/installer installThis works with:
- Node.js/TypeScript projects
- Deno projects
- PowerShell modules
- C# projects
- Rust projects
- And more!
npm create adp@latestFor Node.js/TypeScript projects:
# Using npm
npm install --save-dev @plures-adp/cli @plures-adp/core @plures-adp/eslint-plugin
# Using yarn
yarn add -D @plures-adp/cli @plures-adp/core @plures-adp/eslint-plugin
# Using pnpm
pnpm add -D @plures-adp/cli @plures-adp/core @plures-adp/eslint-pluginInstall the CLI globally:
npm install -g @plures-adp/cliThen use it anywhere:
architectural-discipline analyze
architectural-discipline recommendADP works with Deno out of the box using npm: specifiers:
Add to your deno.json:
{
"tasks": {
"adp:analyze": "deno run npm:@plures-adp/cli analyze",
"adp:recommend": "deno run npm:@plures-adp/cli recommend"
},
"imports": {
"@plures-adp/cli": "npm:@plures-adp/cli@^1.0.0"
}
}Then run:
deno task adp:analyzedeno run npm:@plures-adp/cli analyzeFor systems without internet access:
npx @plures-adp/installer download-offline -o adp-bundleThis creates a folder with:
- All ADP packages as tarballs
- Installation script
- Documentation
Copy the entire adp-bundle folder to your target system using approved transfer methods (USB drive, internal network, etc.)
cd adp-bundle
node install-offline.jsOr use the installer:
npx @plures-adp/installer install --offline# Install using the installer
npx @plures-adp/installer install
# This creates a PowerShell module at .adp/adp.psm1
# Import and use:
Import-Module ./.adp/adp.psm1
Invoke-ADPAnalysis -Path ./src# Install using the installer
npx @plures-adp/installer install
# This creates analysis scripts
# Run analysis:
./adp-analyze.shOr integrate with your build:
<!-- In your .csproj -->
<Target Name="ADPAnalysis" AfterTargets="Build">
<Exec Command="npx @plures-adp/cli analyze" />
</Target># Install using the installer
npx @plures-adp/installer install
# This adds Cargo aliases
# Run analysis:
cargo adp-analyze
cargo adp-recommendIf you prefer manual setup:
npm install --save-dev @plures-adp/cli @plures-adp/core @plures-adp/eslint-pluginCreate .adp-config.json:
{
"architectural-discipline": {
"version": "1.0.0",
"languages": {
"typescript": {
"maxLines": 300,
"maxComplexity": 10
}
},
"ignore": [
"**/node_modules/**",
"**/dist/**",
"**/*.test.*"
]
}
}{
"scripts": {
"adp:analyze": "architectural-discipline analyze",
"adp:recommend": "architectural-discipline recommend",
"adp:check": "architectural-discipline analyze --format json"
}
}Create eslint.config.js:
import architecturalDiscipline from '@plures-adp/eslint-plugin';
export default [
architecturalDiscipline.configs.recommended,
{
rules: {
'@plures-adp/max-lines': 'warn',
'@plures-adp/max-complexity': 'warn',
},
},
];# Using npm scripts (if configured)
npm run adp:analyze
# Direct CLI
npx architectural-discipline analyze
# With options
npx architectural-discipline analyze --path src --format jsonnpm run adp:recommend
# Or
npx architectural-discipline recommend --priority highnpx architectural-discipline create my-project --template web-appAfter installation:
- Run your first analysis:
npm run adp:analyze - Review recommendations:
npm run adp:recommend - Read the documentation: Check out the README and docs
- Configure for your needs: Edit
.adp-config.json - Integrate with CI/CD: Add analysis to your build pipeline
Problem: command not found: architectural-discipline
- Solution: Ensure packages are installed or use
npx architectural-discipline
Problem: Module not found errors
- Solution: Run
npm installto ensure all dependencies are installed
Problem: TypeScript errors
- Solution: Ensure
tsconfig.jsonis properly configured
Problem: Cannot find offline bundle
- Solution: Ensure the bundle path is correct, check common locations:
./adp-offline./.adp-offline~/.adp-offline
Problem: Permission denied on install script
- Solution: Make the script executable:
chmod +x install-offline.js
- Use the auto-installer for the easiest setup
- For CI/CD, prefer direct package installation for better caching
- For air-gapped environments, keep the offline bundle up to date
- Use project-specific
.adp-config.jsonto customize rules per project