cerber-core 1.1.0 → 1.1.2
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/.cerber-example/{BIBLE.md → CERBER.md} +132 -132
- package/.cerber-example/CERBER_LAW.md +200 -200
- package/README.md +126 -90
- package/bin/cerber +1 -1
- package/dev/templates/BACKEND_SCHEMA.ts.tpl +48 -0
- package/dist/cli/contract-parser.d.ts.map +1 -1
- package/dist/cli/contract-parser.js +24 -0
- package/dist/cli/contract-parser.js.map +1 -1
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +55 -4
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/template-generator.d.ts +1 -0
- package/dist/cli/template-generator.d.ts.map +1 -1
- package/dist/cli/template-generator.js +25 -0
- package/dist/cli/template-generator.js.map +1 -1
- package/dist/cli/types.d.ts +9 -0
- package/dist/cli/types.d.ts.map +1 -1
- package/examples/backend-schema.ts +9 -2
- package/examples/frontend-schema.ts +9 -2
- package/examples/team-integration/README.md +347 -347
- package/package.json +1 -1
- package/solo/templates/BACKEND_SCHEMA.ts.tpl +48 -0
- package/team/README.md +327 -327
- package/team/config/team-contract.json +27 -27
- package/team/templates/BACKEND_SCHEMA.ts.tpl +48 -0
- package/team/templates/BIBLE_TEMPLATE.md +52 -52
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "2.0-team",
|
|
3
|
-
"extends": "cerber-core",
|
|
4
|
-
"team": {
|
|
5
|
-
"enabled": true,
|
|
6
|
-
"modulesPath": ".cerber/modules",
|
|
7
|
-
"connectionsPath": ".cerber/connections/contracts",
|
|
8
|
-
"biblePath": ".cerber/
|
|
9
|
-
},
|
|
10
|
-
"moduleValidation": {
|
|
11
|
-
"requireModuleMd": true,
|
|
12
|
-
"requireContract": true,
|
|
13
|
-
"requireDependencies": true,
|
|
14
|
-
"forbiddenCrossModuleImports": true
|
|
15
|
-
},
|
|
16
|
-
"focusMode": {
|
|
17
|
-
"enabled": true,
|
|
18
|
-
"outputPath": ".cerber/FOCUS_CONTEXT.md",
|
|
19
|
-
"includeContracts": true,
|
|
20
|
-
"includeDependencies": true
|
|
21
|
-
},
|
|
22
|
-
"connectionValidation": {
|
|
23
|
-
"requireBidirectional": true,
|
|
24
|
-
"checkBreakingChanges": true,
|
|
25
|
-
"detectCircular": true
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": "2.0-team",
|
|
3
|
+
"extends": "cerber-core",
|
|
4
|
+
"team": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"modulesPath": ".cerber/modules",
|
|
7
|
+
"connectionsPath": ".cerber/connections/contracts",
|
|
8
|
+
"biblePath": ".cerber/CERBER.md"
|
|
9
|
+
},
|
|
10
|
+
"moduleValidation": {
|
|
11
|
+
"requireModuleMd": true,
|
|
12
|
+
"requireContract": true,
|
|
13
|
+
"requireDependencies": true,
|
|
14
|
+
"forbiddenCrossModuleImports": true
|
|
15
|
+
},
|
|
16
|
+
"focusMode": {
|
|
17
|
+
"enabled": true,
|
|
18
|
+
"outputPath": ".cerber/FOCUS_CONTEXT.md",
|
|
19
|
+
"includeContracts": true,
|
|
20
|
+
"includeDependencies": true
|
|
21
|
+
},
|
|
22
|
+
"connectionValidation": {
|
|
23
|
+
"requireBidirectional": true,
|
|
24
|
+
"checkBreakingChanges": true,
|
|
25
|
+
"detectCircular": true
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ⚠️ CERBER TEMPLATE (NOT SOURCE OF TRUTH)
|
|
3
|
+
*
|
|
4
|
+
* This file is a starting point. Edit it to match YOUR architecture.
|
|
5
|
+
* The source of truth is CERBER.md.
|
|
6
|
+
*
|
|
7
|
+
* Generated by: npx cerber init
|
|
8
|
+
* Project: {{PROJECT_NAME}}
|
|
9
|
+
*
|
|
10
|
+
* See: https://github.com/Agaslez/cerber-core#guardian-configuration
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export const BACKEND_SCHEMA = {
|
|
14
|
+
version: "1.0.0",
|
|
15
|
+
|
|
16
|
+
// Your architecture rules (customize)
|
|
17
|
+
rules: [],
|
|
18
|
+
|
|
19
|
+
// Patterns that should never appear in your code
|
|
20
|
+
forbiddenPatterns: [
|
|
21
|
+
// Uncomment and customize based on your tech stack:
|
|
22
|
+
// {
|
|
23
|
+
// pattern: /password\s*=\s*['"][^'"]+['"]/i,
|
|
24
|
+
// name: "Hardcoded passwords",
|
|
25
|
+
// severity: "error"
|
|
26
|
+
// },
|
|
27
|
+
// {
|
|
28
|
+
// pattern: /api[_-]?key\s*=\s*['"][^'"]+['"]/i,
|
|
29
|
+
// name: "Hardcoded API keys",
|
|
30
|
+
// severity: "error"
|
|
31
|
+
// }
|
|
32
|
+
]
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default BACKEND_SCHEMA;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 💡 Next Steps:
|
|
39
|
+
*
|
|
40
|
+
* 1. Define your project structure in CERBER.md (single source of truth)
|
|
41
|
+
* 2. Add forbiddenPatterns for your tech stack
|
|
42
|
+
* 3. Add requiredImports rules for your architecture layers
|
|
43
|
+
* 4. Test with: npx cerber-guardian
|
|
44
|
+
*
|
|
45
|
+
* Full examples:
|
|
46
|
+
* - node_modules/cerber-core/examples/backend-schema.ts
|
|
47
|
+
* - node_modules/cerber-core/examples/frontend-schema.ts
|
|
48
|
+
*/
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# PROJECT
|
|
2
|
-
|
|
3
|
-
**Project:** [Project Name]
|
|
4
|
-
**Owner:** Stefan Pitek
|
|
5
|
-
**Last Updated:** YYYY-MM-DD
|
|
6
|
-
|
|
7
|
-
## Architecture Overview
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
┌─────────────────────────────────────────┐
|
|
11
|
-
│ Frontend (React/Next.js) │
|
|
12
|
-
└─────────────────┬───────────────────────┘
|
|
13
|
-
│
|
|
14
|
-
▼
|
|
15
|
-
┌─────────────────────────────────────────┐
|
|
16
|
-
│ API Layer (Express) │
|
|
17
|
-
└─────────────────┬───────────────────────┘
|
|
18
|
-
│
|
|
19
|
-
┌─────────┼─────────┐
|
|
20
|
-
▼ ▼ ▼
|
|
21
|
-
Module A Module B Module C
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Modules Index
|
|
25
|
-
|
|
26
|
-
### Core Modules
|
|
27
|
-
|
|
28
|
-
1. **module-a** - Purpose
|
|
29
|
-
- Owner: Name
|
|
30
|
-
- Status: Active
|
|
31
|
-
- Files: `src/modules/module-a/`
|
|
32
|
-
|
|
33
|
-
2. **module-b** - Purpose
|
|
34
|
-
- Owner: Name
|
|
35
|
-
- Status: Active
|
|
36
|
-
- Files: `src/modules/module-b/`
|
|
37
|
-
|
|
38
|
-
## Connections Map
|
|
39
|
-
|
|
40
|
-
- `module-a` → `module-b`: processData()
|
|
41
|
-
- `module-b` → `module-c`: validateInput()
|
|
42
|
-
|
|
43
|
-
## Team Responsibilities
|
|
44
|
-
|
|
45
|
-
- **Developer A**: module-a, module-d
|
|
46
|
-
- **Developer B**: module-b, module-c
|
|
47
|
-
|
|
48
|
-
## Tech Stack
|
|
49
|
-
|
|
50
|
-
- Backend: Node.js, Express, TypeScript
|
|
51
|
-
- Database: PostgreSQL, Redis
|
|
52
|
-
- Testing: Jest, Supertest
|
|
1
|
+
# PROJECT CERBER - Master Map
|
|
2
|
+
|
|
3
|
+
**Project:** [Project Name]
|
|
4
|
+
**Owner:** Stefan Pitek
|
|
5
|
+
**Last Updated:** YYYY-MM-DD
|
|
6
|
+
|
|
7
|
+
## Architecture Overview
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
┌─────────────────────────────────────────┐
|
|
11
|
+
│ Frontend (React/Next.js) │
|
|
12
|
+
└─────────────────┬───────────────────────┘
|
|
13
|
+
│
|
|
14
|
+
▼
|
|
15
|
+
┌─────────────────────────────────────────┐
|
|
16
|
+
│ API Layer (Express) │
|
|
17
|
+
└─────────────────┬───────────────────────┘
|
|
18
|
+
│
|
|
19
|
+
┌─────────┼─────────┐
|
|
20
|
+
▼ ▼ ▼
|
|
21
|
+
Module A Module B Module C
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Modules Index
|
|
25
|
+
|
|
26
|
+
### Core Modules
|
|
27
|
+
|
|
28
|
+
1. **module-a** - Purpose
|
|
29
|
+
- Owner: Name
|
|
30
|
+
- Status: Active
|
|
31
|
+
- Files: `src/modules/module-a/`
|
|
32
|
+
|
|
33
|
+
2. **module-b** - Purpose
|
|
34
|
+
- Owner: Name
|
|
35
|
+
- Status: Active
|
|
36
|
+
- Files: `src/modules/module-b/`
|
|
37
|
+
|
|
38
|
+
## Connections Map
|
|
39
|
+
|
|
40
|
+
- `module-a` → `module-b`: processData()
|
|
41
|
+
- `module-b` → `module-c`: validateInput()
|
|
42
|
+
|
|
43
|
+
## Team Responsibilities
|
|
44
|
+
|
|
45
|
+
- **Developer A**: module-a, module-d
|
|
46
|
+
- **Developer B**: module-b, module-c
|
|
47
|
+
|
|
48
|
+
## Tech Stack
|
|
49
|
+
|
|
50
|
+
- Backend: Node.js, Express, TypeScript
|
|
51
|
+
- Database: PostgreSQL, Redis
|
|
52
|
+
- Testing: Jest, Supertest
|