Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"permissions": {
"allow": [],
"deny": []
},
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude UserPromptSubmit"
}
]
}
],
"PreToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude PreToolUse"
}
]
}
],
"PostToolUse": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude PostToolUse"
}
]
}
],
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude Notification"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude Stop"
}
]
}
],
"SubagentStop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude SubagentStop"
}
]
}
],
"PreCompact": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "conclaude PreCompact"
}
]
}
]
}
}
24 changes: 24 additions & 0 deletions .conclaude.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Conclaude YAML Configuration
# This configuration defines how conclaude handles Claude Code hook events

# Commands to run during Stop hook
# Each line is executed as a separate bash command
stop:
run: |
sh ./test-examples.sh

# Validation rules for hook processing
rules:
# Prevent Claude from creating or modifying files at the repository root
# Helps maintain clean project structure
preventRootAdditions: true

# Files that Claude cannot edit, using glob patterns
# Examples:
# - "./package.json" - specific files
# - "*.md" - file extensions
# - "src/**/*.ts" - nested patterns
# - ".env*" - environment files
# - "docs/**" - entire directories
# - "{package,tsconfig}.json" - multiple specific files
uneditableFiles: []
115 changes: 115 additions & 0 deletions doc/src/content/docs/reference/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,121 @@ protoc = {
| `protoc.includeDirectories` | list of strings | `["./proto"]` | Directories to include in the include path for imports |
| `protoc.files` | list of strings | `[]` | Specific proto files to compile (leave empty to compile all .proto files in source directories) |

### Per-Language File Configuration

Control exactly which proto files each language processes using `files` and `additionalFiles` options:

<Tabs>
<TabItem label="files (Override)">

Completely replaces global `protoc.files` for a specific language:

```nix
protoc.files = [
"./proto/common/v1/types.proto"
"./proto/api/v1/user.proto"
];

languages.go = {
# Override: Go processes only these files
files = [
"./proto/common/v1/types.proto"
"./proto/internal/v1/admin.proto"
];
};
# Result: Go ignores protoc.files, processes only the files listed above
```

</TabItem>
<TabItem label="additionalFiles (Extend)">

Adds files to global `protoc.files` for a specific language:

```nix
protoc.files = [
"./proto/common/v1/types.proto"
"./proto/api/v1/user.proto"
];

languages.js = {
# Extend: Add Google annotations for JavaScript
additionalFiles = [
"./proto/google/api/annotations.proto"
"./proto/google/api/http.proto"
];
};
# Result: JS processes protoc.files + additionalFiles
```

</TabItem>
<TabItem label="Smart Exclusions">

Prevent problematic or unnecessary code generation:

```nix
languages = {
go = {
# Backend: Only internal services + shared types
files = [
"./proto/common/v1/types.proto"
"./proto/internal/v1/user_service.proto"
# Exclude: Google annotations (causes Go linting errors)
];
grpc.enable = true;
};

js = {
# Frontend: Public APIs + Google annotations
additionalFiles = [
"./proto/api/v1/user_api.proto"
"./proto/google/api/annotations.proto"
# Exclude: Internal services (security boundary)
];
es.enable = true;
};
};
```

</TabItem>
</Tabs>

**Configuration Options:**

| Option | Type | Default | Description |
|--------|------|---------|-------------|
| `languages.*.files` | list of strings or null | `null` | Proto files for this language only. Overrides global `protoc.files` |
| `languages.*.additionalFiles` | list of strings | `[]` | Additional files to add to global `protoc.files` for this language |

**Use Cases:**

<CardGrid>
<Card title="Backend + Frontend Separation" icon="split">
**Problem**: Different services for different tiers
**Solution**: `go.files` for internal services, `js.additionalFiles` for public APIs
</Card>
<Card title="Google Annotations Linting" icon="shield">
**Problem**: Go + Google annotations = linting errors
**Solution**: Exclude Google annotations from Go, include in JavaScript
</Card>
<Card title="Security Boundaries" icon="lock">
**Problem**: Frontend accessing internal services
**Solution**: Use `files` to enforce strict separation at build time
</Card>
<Card title="Build Performance" icon="rocket">
**Problem**: All languages process all files
**Solution**: Each language processes only relevant files
</Card>
</CardGrid>

<Aside type="tip" title="Migration from Global Files">
**Backward Compatible**: Existing configurations work unchanged. Per-language files are opt-in enhancements.

**Migration Path**:
1. Start with global `protoc.files` (current behavior)
2. Add `additionalFiles` for language-specific extensions
3. Use `files` for complete per-language control
</Aside>

## Language Support

### Go Language Configuration
Expand Down
103 changes: 102 additions & 1 deletion doc/src/content/docs/reference/languages/cpp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: C++ Language Support
description: Complete Protocol Buffer support for C++ with gRPC, CMake integration, and embedded-friendly options.
---

import { Tabs, TabItem } from "@astrojs/starlight/components";
import { Tabs, TabItem, Badge, Card, CardGrid } from "@astrojs/starlight/components";
import { Code } from "astro:components";

# C++ Language Support
Expand Down Expand Up @@ -98,6 +98,107 @@ languages.cpp = {
};
```

## Per-Language Files

<Badge text="🆕 New Feature" variant="tip" />

Control exactly which proto files C++ processes using `files` and `additionalFiles`:

<Tabs>
<TabItem label="Embedded Systems">

**Use Case**: C++ embedded application needs only core protocol definitions.

```nix
languages.cpp = {
enable = true;
outputPath = "embedded/proto";
# Override: Only embedded-friendly, minimal protocols
files = [
"./proto/common/v1/types.proto"
"./proto/embedded/v1/sensor_data.proto"
"./proto/embedded/v1/control_messages.proto"
"./proto/embedded/v1/status_reports.proto"
# No complex APIs or large message definitions
];
nanopb.enable = true;
optimizeFor = "CODE_SIZE";
runtime = "lite";
};
```

</TabItem>
<TabItem label="Add System Libraries">

**Use Case**: Include system-level and third-party protocol definitions.

```nix
languages.cpp = {
enable = true;
standard = "c++20";
# Use global files + additional system-level dependencies
additionalFiles = [
"./proto/system/v1/logging.proto"
"./proto/third_party/opencensus/trace.proto"
"./proto/monitoring/v1/performance.proto"
"./proto/networking/v1/tcp_stats.proto"
];
grpc.enable = true;
arenaAllocation = true;
};
```

</TabItem>
<TabItem label="Game Engine Specific">

**Use Case**: C++ game engine processes only game-related protocols.

```nix
languages.cpp = {
enable = true;
outputPath = "game_engine/proto";
# Override: Only game engine protocols
files = [
"./proto/common/v1/types.proto"
"./proto/game/v1/player_state.proto"
"./proto/game/v1/world_updates.proto"
"./proto/game/v1/input_events.proto"
"./proto/networking/v1/multiplayer.proto"
# No web APIs or mobile-specific protocols
];
grpc.enable = true;
optimizeFor = "SPEED";
arenaAllocation = true;
};
```

</TabItem>
</Tabs>

### Configuration Options

| Option | Type | Description | Example |
|--------|------|-------------|---------|
| `files` | `list` | Override global files completely | Embedded system protocols |
| `additionalFiles` | `list` | Extend global files | Add system monitoring protos |

### Common C++ Use Cases

<CardGrid stagger>
<Card title="Embedded Systems" icon="chip">
Minimal protocols optimized for memory-constrained devices
</Card>
<Card title="High-Performance Computing" icon="lightning">
System-level protocols with performance optimizations
</Card>
<Card title="Game Development" icon="gamepad2">
Real-time protocols for game engines and multiplayer
</Card>
<Card title="System Programming" icon="server">
OS-level and network protocol definitions
</Card>
</CardGrid>

## C++ Standards Support

Bufrnix supports all modern C++ standards:
Expand Down
Loading