@el-j/magic-helix-plugins 4.0.0-beta.1 → 4.0.0-beta.3
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/architecture/codeowners.md +123 -0
- package/dist/architecture/monorepo.md +146 -0
- package/dist/architecture/nx.md +122 -0
- package/dist/architecture/turborepo.md +114 -0
- package/dist/ci/github-actions.md +268 -0
- package/dist/ci/gitlab-ci.md +330 -0
- package/dist/containers/docker-multistage.md +120 -0
- package/dist/containers/kubernetes-deploy.md +210 -0
- package/dist/cpp/index.cjs +79 -0
- package/dist/cpp/index.mjs +209 -0
- package/dist/csharp/index.cjs +2 -2
- package/dist/csharp/{index.js → index.mjs} +17 -11
- package/dist/csharp/templates/framework-aspnetcore.md +205 -0
- package/dist/csharp/templates/framework-blazor.md +271 -0
- package/dist/csharp/templates/lang-csharp.md +162 -0
- package/dist/devops/docker-compose.md +111 -0
- package/dist/devops/docker-dockerfile.md +94 -0
- package/dist/devops/github-actions.md +160 -0
- package/dist/devops/gitlab-ci.md +210 -0
- package/dist/generic/lang-typescript.md +57 -0
- package/dist/generic/state-redux.md +21 -0
- package/dist/generic/state-rxjs.md +6 -0
- package/dist/generic/style-mui.md +23 -0
- package/dist/generic/style-tailwind.md +76 -0
- package/dist/generic/test-cypress.md +21 -0
- package/dist/generic/test-jest.md +20 -0
- package/dist/generic/test-playwright.md +21 -0
- package/dist/generic/test-vitest.md +131 -0
- package/dist/go/index.cjs +3 -3
- package/dist/go/{index.js → index.mjs} +18 -15
- package/dist/go/templates/lang-go.md +571 -0
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +24 -0
- package/dist/java/index.cjs +2 -2
- package/dist/java/{index.js → index.mjs} +25 -19
- package/dist/java/templates/build-gradle.md +102 -0
- package/dist/java/templates/build-maven.md +86 -0
- package/dist/java/templates/framework-spring-boot.md +179 -0
- package/dist/java/templates/lang-java.md +78 -0
- package/dist/java/templates/lang-kotlin.md +88 -0
- package/dist/meta/magic-helix-meta.md +213 -0
- package/dist/meta/meta-debug.md +459 -0
- package/dist/meta/meta-implement.md +450 -0
- package/dist/meta/meta-roadmap.md +265 -0
- package/dist/nodejs/templates/angular-core.md +19 -0
- package/dist/nodejs/templates/lang-typescript.md +57 -0
- package/dist/nodejs/templates/nestjs-core.md +7 -0
- package/dist/nodejs/templates/react-core.md +677 -0
- package/dist/nodejs/templates/react-zustand.md +7 -0
- package/dist/nodejs/templates/state-redux.md +21 -0
- package/dist/nodejs/templates/state-rxjs.md +6 -0
- package/dist/nodejs/templates/style-primevue.md +6 -0
- package/dist/nodejs/templates/style-quasar.md +22 -0
- package/dist/nodejs/templates/style-tailwind.md +76 -0
- package/dist/nodejs/templates/test-cypress.md +21 -0
- package/dist/nodejs/templates/test-jest.md +20 -0
- package/dist/nodejs/templates/test-playwright.md +21 -0
- package/dist/nodejs/templates/test-vitest.md +131 -0
- package/dist/nodejs/templates/vue-core.md +108 -0
- package/dist/nodejs/templates/vue-pinia.md +5 -0
- package/dist/patterns/architecture/clean-architecture.md +469 -0
- package/dist/patterns/architecture/dependency-injection.md +517 -0
- package/dist/patterns/architecture/domain-driven-design.md +621 -0
- package/dist/patterns/architecture/layered-architecture.md +382 -0
- package/dist/patterns/architecture/repository-pattern.md +408 -0
- package/dist/patterns/domain-expertise/nextjs-rules.md +115 -0
- package/dist/patterns/domain-expertise/react-patterns.md +181 -0
- package/dist/patterns/domain-expertise/server-components.md +212 -0
- package/dist/patterns/domain-expertise/shadcn-ui.md +52 -0
- package/dist/patterns/domain-expertise/tailwind-patterns.md +52 -0
- package/dist/patterns/environment/container-awareness.md +17 -0
- package/dist/patterns/environment/ide-features.md +17 -0
- package/dist/patterns/environment/os-commands.md +17 -0
- package/dist/patterns/organization/heading-hierarchy.md +103 -0
- package/dist/patterns/organization/sequential-workflows.md +102 -0
- package/dist/patterns/organization/xml-rule-groups.md +64 -0
- package/dist/patterns/reasoning/agent-loop.md +151 -0
- package/dist/patterns/reasoning/confirmation-gates.md +141 -0
- package/dist/patterns/reasoning/dependency-analysis.md +132 -0
- package/dist/patterns/reasoning/one-tool-per-iteration.md +152 -0
- package/dist/patterns/reasoning/preview-before-action.md +194 -0
- package/dist/patterns/reasoning/reflection-checkpoints.md +166 -0
- package/dist/patterns/reasoning/result-verification.md +157 -0
- package/dist/patterns/reasoning/subtask-breakdown.md +131 -0
- package/dist/patterns/reasoning/thinking-tags.md +100 -0
- package/dist/patterns/role-definition/capability-declarations.md +72 -0
- package/dist/patterns/role-definition/expert-identity.md +45 -0
- package/dist/patterns/role-definition/scope-boundaries.md +61 -0
- package/dist/patterns/safety/code-safety-rules.md +17 -0
- package/dist/patterns/safety/credential-handling.md +17 -0
- package/dist/patterns/safety/destructive-warnings.md +17 -0
- package/dist/patterns/safety/refusal-messages.md +17 -0
- package/dist/patterns/tone/adaptive-tone.md +17 -0
- package/dist/patterns/tone/concise-communication.md +17 -0
- package/dist/patterns/tone/forbidden-phrases.md +17 -0
- package/dist/patterns/tool-guidelines/function-schemas.md +143 -0
- package/dist/patterns/tool-guidelines/parameter-examples.md +137 -0
- package/dist/patterns/tool-guidelines/usage-policies.md +105 -0
- package/dist/php/index.cjs +2 -2
- package/dist/php/{index.js → index.mjs} +12 -6
- package/dist/php/templates/framework-laravel.md +112 -0
- package/dist/php/templates/lang-php.md +94 -0
- package/dist/python/index.cjs +4 -4
- package/dist/python/{index.js → index.mjs} +10 -7
- package/dist/python/templates/lang-python.md +508 -0
- package/dist/ruby/index.cjs +2 -2
- package/dist/ruby/{index.js → index.mjs} +16 -10
- package/dist/ruby/templates/framework-rails.md +309 -0
- package/dist/ruby/templates/framework-sinatra.md +227 -0
- package/dist/ruby/templates/lang-ruby.md +216 -0
- package/dist/rust/index.cjs +3 -3
- package/dist/rust/{index.js → index.mjs} +24 -18
- package/dist/rust/templates/lang-rust.md +89 -0
- package/dist/swift/index.cjs +32 -0
- package/dist/swift/index.mjs +112 -0
- package/dist/swift/templates/framework-vapor.md +352 -0
- package/dist/swift/templates/lang-swift.md +291 -0
- package/package.json +31 -21
- package/dist/index.js +0 -20
- /package/dist/nodejs/{index.js → index.mjs} +0 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
# Kubernetes Deployment Guide
|
|
2
|
+
|
|
3
|
+
## Basic Deployment Structure
|
|
4
|
+
|
|
5
|
+
### Deployment Manifest
|
|
6
|
+
```yaml
|
|
7
|
+
apiVersion: apps/v1
|
|
8
|
+
kind: Deployment
|
|
9
|
+
metadata:
|
|
10
|
+
name: app-deployment
|
|
11
|
+
labels:
|
|
12
|
+
app: myapp
|
|
13
|
+
spec:
|
|
14
|
+
replicas: 3
|
|
15
|
+
selector:
|
|
16
|
+
matchLabels:
|
|
17
|
+
app: myapp
|
|
18
|
+
template:
|
|
19
|
+
metadata:
|
|
20
|
+
labels:
|
|
21
|
+
app: myapp
|
|
22
|
+
spec:
|
|
23
|
+
containers:
|
|
24
|
+
- name: app
|
|
25
|
+
image: myregistry/myapp:1.0.0
|
|
26
|
+
ports:
|
|
27
|
+
- containerPort: 8080
|
|
28
|
+
resources:
|
|
29
|
+
requests:
|
|
30
|
+
memory: "128Mi"
|
|
31
|
+
cpu: "100m"
|
|
32
|
+
limits:
|
|
33
|
+
memory: "512Mi"
|
|
34
|
+
cpu: "500m"
|
|
35
|
+
livenessProbe:
|
|
36
|
+
httpGet:
|
|
37
|
+
path: /health
|
|
38
|
+
port: 8080
|
|
39
|
+
initialDelaySeconds: 30
|
|
40
|
+
periodSeconds: 10
|
|
41
|
+
readinessProbe:
|
|
42
|
+
httpGet:
|
|
43
|
+
path: /ready
|
|
44
|
+
port: 8080
|
|
45
|
+
initialDelaySeconds: 10
|
|
46
|
+
periodSeconds: 5
|
|
47
|
+
env:
|
|
48
|
+
- name: DATABASE_URL
|
|
49
|
+
valueFrom:
|
|
50
|
+
secretKeyRef:
|
|
51
|
+
name: app-secrets
|
|
52
|
+
key: db-url
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Service Manifest
|
|
56
|
+
```yaml
|
|
57
|
+
apiVersion: v1
|
|
58
|
+
kind: Service
|
|
59
|
+
metadata:
|
|
60
|
+
name: app-service
|
|
61
|
+
spec:
|
|
62
|
+
selector:
|
|
63
|
+
app: myapp
|
|
64
|
+
ports:
|
|
65
|
+
- protocol: TCP
|
|
66
|
+
port: 80
|
|
67
|
+
targetPort: 8080
|
|
68
|
+
type: LoadBalancer
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### ConfigMap
|
|
72
|
+
```yaml
|
|
73
|
+
apiVersion: v1
|
|
74
|
+
kind: ConfigMap
|
|
75
|
+
metadata:
|
|
76
|
+
name: app-config
|
|
77
|
+
data:
|
|
78
|
+
LOG_LEVEL: "info"
|
|
79
|
+
API_TIMEOUT: "30s"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Secret
|
|
83
|
+
```yaml
|
|
84
|
+
apiVersion: v1
|
|
85
|
+
kind: Secret
|
|
86
|
+
metadata:
|
|
87
|
+
name: app-secrets
|
|
88
|
+
type: Opaque
|
|
89
|
+
data:
|
|
90
|
+
db-url: cG9zdGdyZXM6Ly9leGFtcGxl # base64 encoded
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Ingress Configuration
|
|
94
|
+
```yaml
|
|
95
|
+
apiVersion: networking.k8s.io/v1
|
|
96
|
+
kind: Ingress
|
|
97
|
+
metadata:
|
|
98
|
+
name: app-ingress
|
|
99
|
+
annotations:
|
|
100
|
+
cert-manager.io/cluster-issuer: letsencrypt-prod
|
|
101
|
+
spec:
|
|
102
|
+
ingressClassName: nginx
|
|
103
|
+
tls:
|
|
104
|
+
- hosts:
|
|
105
|
+
- myapp.example.com
|
|
106
|
+
secretName: app-tls
|
|
107
|
+
rules:
|
|
108
|
+
- host: myapp.example.com
|
|
109
|
+
http:
|
|
110
|
+
paths:
|
|
111
|
+
- path: /
|
|
112
|
+
pathType: Prefix
|
|
113
|
+
backend:
|
|
114
|
+
service:
|
|
115
|
+
name: app-service
|
|
116
|
+
port:
|
|
117
|
+
number: 80
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Horizontal Pod Autoscaler
|
|
121
|
+
```yaml
|
|
122
|
+
apiVersion: autoscaling/v2
|
|
123
|
+
kind: HorizontalPodAutoscaler
|
|
124
|
+
metadata:
|
|
125
|
+
name: app-hpa
|
|
126
|
+
spec:
|
|
127
|
+
scaleTargetRef:
|
|
128
|
+
apiVersion: apps/v1
|
|
129
|
+
kind: Deployment
|
|
130
|
+
name: app-deployment
|
|
131
|
+
minReplicas: 2
|
|
132
|
+
maxReplicas: 10
|
|
133
|
+
metrics:
|
|
134
|
+
- type: Resource
|
|
135
|
+
resource:
|
|
136
|
+
name: cpu
|
|
137
|
+
target:
|
|
138
|
+
type: Utilization
|
|
139
|
+
averageUtilization: 70
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## StatefulSet (for databases)
|
|
143
|
+
```yaml
|
|
144
|
+
apiVersion: apps/v1
|
|
145
|
+
kind: StatefulSet
|
|
146
|
+
metadata:
|
|
147
|
+
name: postgres
|
|
148
|
+
spec:
|
|
149
|
+
serviceName: postgres
|
|
150
|
+
replicas: 3
|
|
151
|
+
selector:
|
|
152
|
+
matchLabels:
|
|
153
|
+
app: postgres
|
|
154
|
+
template:
|
|
155
|
+
metadata:
|
|
156
|
+
labels:
|
|
157
|
+
app: postgres
|
|
158
|
+
spec:
|
|
159
|
+
containers:
|
|
160
|
+
- name: postgres
|
|
161
|
+
image: postgres:16-alpine
|
|
162
|
+
ports:
|
|
163
|
+
- containerPort: 5432
|
|
164
|
+
volumeMounts:
|
|
165
|
+
- name: data
|
|
166
|
+
mountPath: /var/lib/postgresql/data
|
|
167
|
+
volumeClaimTemplates:
|
|
168
|
+
- metadata:
|
|
169
|
+
name: data
|
|
170
|
+
spec:
|
|
171
|
+
accessModes: ["ReadWriteOnce"]
|
|
172
|
+
resources:
|
|
173
|
+
requests:
|
|
174
|
+
storage: 10Gi
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Best Practices
|
|
178
|
+
1. **Resource Limits**: Always set CPU/memory requests and limits
|
|
179
|
+
2. **Health Checks**: Implement liveness and readiness probes
|
|
180
|
+
3. **Rolling Updates**: Use `RollingUpdate` strategy with `maxSurge` and `maxUnavailable`
|
|
181
|
+
4. **Pod Disruption Budgets**: Ensure availability during node maintenance
|
|
182
|
+
5. **Network Policies**: Restrict pod-to-pod communication
|
|
183
|
+
6. **RBAC**: Use ServiceAccounts with minimal permissions
|
|
184
|
+
7. **Secrets Management**: Use external secret managers (Vault, AWS Secrets Manager)
|
|
185
|
+
8. **Monitoring**: Deploy Prometheus/Grafana stack
|
|
186
|
+
9. **Logging**: Use Fluentd/Fluent Bit for log aggregation
|
|
187
|
+
10. **GitOps**: Manage deployments with ArgoCD or Flux
|
|
188
|
+
|
|
189
|
+
## Common Commands
|
|
190
|
+
```bash
|
|
191
|
+
# Apply manifests
|
|
192
|
+
kubectl apply -f deployment.yaml
|
|
193
|
+
|
|
194
|
+
# Check status
|
|
195
|
+
kubectl get pods -l app=myapp
|
|
196
|
+
kubectl describe pod <pod-name>
|
|
197
|
+
kubectl logs <pod-name> -f
|
|
198
|
+
|
|
199
|
+
# Scale deployment
|
|
200
|
+
kubectl scale deployment app-deployment --replicas=5
|
|
201
|
+
|
|
202
|
+
# Update image
|
|
203
|
+
kubectl set image deployment/app-deployment app=myregistry/myapp:2.0.0
|
|
204
|
+
|
|
205
|
+
# Rollback
|
|
206
|
+
kubectl rollout undo deployment/app-deployment
|
|
207
|
+
|
|
208
|
+
# Port forwarding
|
|
209
|
+
kubectl port-forward svc/app-service 8080:80
|
|
210
|
+
```
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../BasePlugin-odQJAKA-.cjs");class m extends u.BasePlugin{constructor(){super(...arguments),this.name="cpp",this.displayName="C/C++",this.version="3.0.0",this.priority=85}async detect(t){const i=[],s={};let r,o=this.getProjectName(t);const e=await this.detectPlatformIO(t);if(e&&(i.push("platformio"),r="platformio.ini",e.board&&i.push(`board-${e.board}`),e.platform&&(i.push(`platform-${e.platform}`),e.platform.includes("espressif32")&&i.push("esp32"),e.platform.includes("espressif8266")&&i.push("esp8266"),e.platform.includes("atmelavr")&&i.push("arduino")),e.framework&&(i.push(`framework-${e.framework}`),e.framework==="arduino"&&i.push("arduino")),e.libs))for(const a of e.libs)s[a]="*";if(this.fileExists(t,"CMakeLists.txt")){i.push("cmake"),r||(r="CMakeLists.txt");const a=this.readFile(t,"CMakeLists.txt");if(a){const c=a.match(/project\s*\(\s*([^\s)]+)/i);c&&(o=c[1])}}return(this.fileExists(t,"Makefile")||this.fileExists(t,"makefile"))&&(i.push("makefile"),r||(r="Makefile")),await this.hasFiles(t,"*.ino")&&(i.push("arduino"),r||(r="*.ino")),await this.hasFiles(t,"**/*.{cpp,c,h,hpp}")&&(i.push("cpp"),r||(r="*.cpp")),i.length===0?null:{language:"C/C++",name:o,dependencies:s,manifestFile:r,projectPath:t,tags:i}}async detectPlatformIO(t){if(!this.fileExists(t,"platformio.ini"))return null;const i=this.readFile(t,"platformio.ini");if(!i)return null;const s={libs:[]},r=i.split(`
|
|
2
|
+
`);let o=!1,e=null;for(const p of r){const n=p.trim();if(n.startsWith("[env:")){o=!0,e=null;continue}if(n.startsWith("[")&&n.endsWith("]")){o=!1,e=null;continue}if(o||!s.board){const l=n.match(/^(\w+)\s*=\s*(.*)$/);if(l){const[,f,a]=l;switch(e=f,f){case"board":s.board=a.trim();break;case"platform":s.platform=a.trim();break;case"framework":s.framework=a.trim();break;case"lib_deps":a.trim()&&s.libs?.push(a.trim());break}}else e==="lib_deps"&&n&&!n.startsWith("[")&&s.libs?.push(n)}}return s.board||s.platform?s:null}getTemplates(){return[{name:"cpp-core",tags:["cpp"],content:this.getCppTemplate()},{name:"platformio-core",tags:["platformio"],content:this.getPlatformIOTemplate()},{name:"arduino-core",tags:["arduino"],content:this.getArduinoTemplate()}]}getDependencyTagMap(){return{boost:"boost",fmt:"fmt",spdlog:"spdlog",googletest:"gtest",catch2:"catch2","Adafruit GFX Library":"adafruit-gfx",WiFi:"wifi",ESP32:"esp32",FastLED:"fastled",ArduinoJson:"arduino-json"}}getConfigFileTagMap(){return{"platformio.ini":"platformio","CMakeLists.txt":"cmake",Makefile:"makefile",".clang-format":"clang-format",".clang-tidy":"clang-tidy"}}getCppTemplate(){return`# C/C++ Development Guidelines
|
|
3
|
+
|
|
4
|
+
This project uses C/C++.
|
|
5
|
+
|
|
6
|
+
## Project Structure
|
|
7
|
+
- Organize headers and implementation files clearly
|
|
8
|
+
- Use proper include guards or \`#pragma once\`
|
|
9
|
+
- Separate interface from implementation
|
|
10
|
+
|
|
11
|
+
## Code Style
|
|
12
|
+
- Follow modern C++ practices (C++11/14/17/20)
|
|
13
|
+
- Use RAII for resource management
|
|
14
|
+
- Prefer smart pointers over raw pointers
|
|
15
|
+
- Use const correctness
|
|
16
|
+
|
|
17
|
+
## Build System
|
|
18
|
+
- Use CMake or Makefile for build configuration
|
|
19
|
+
- Keep build files maintainable
|
|
20
|
+
- Document build dependencies
|
|
21
|
+
|
|
22
|
+
## Testing
|
|
23
|
+
- Write unit tests for core functionality
|
|
24
|
+
- Use GoogleTest, Catch2, or similar frameworks
|
|
25
|
+
- Test edge cases and error conditions
|
|
26
|
+
`}getPlatformIOTemplate(){return`# PlatformIO Development Guidelines
|
|
27
|
+
|
|
28
|
+
This is a PlatformIO embedded project.
|
|
29
|
+
|
|
30
|
+
## Project Structure
|
|
31
|
+
- Source code in \`src/\`
|
|
32
|
+
- Libraries in \`lib/\`
|
|
33
|
+
- Include files in \`include/\`
|
|
34
|
+
- Tests in \`test/\`
|
|
35
|
+
|
|
36
|
+
## Development Workflow
|
|
37
|
+
- Use PlatformIO CLI or IDE for building
|
|
38
|
+
- Test on hardware early and often
|
|
39
|
+
- Use serial monitor for debugging
|
|
40
|
+
- Manage dependencies via \`platformio.ini\`
|
|
41
|
+
|
|
42
|
+
## Code Practices
|
|
43
|
+
- Keep \`setup()\` and \`loop()\` focused
|
|
44
|
+
- Use proper pin definitions
|
|
45
|
+
- Handle interrupts carefully
|
|
46
|
+
- Consider power consumption
|
|
47
|
+
|
|
48
|
+
## Hardware Integration
|
|
49
|
+
- Document pin configurations
|
|
50
|
+
- Test hardware connections before coding
|
|
51
|
+
- Use appropriate voltage levels
|
|
52
|
+
- Follow manufacturer datasheets
|
|
53
|
+
`}getArduinoTemplate(){return`# Arduino Development Guidelines
|
|
54
|
+
|
|
55
|
+
This is an Arduino project.
|
|
56
|
+
|
|
57
|
+
## Project Structure
|
|
58
|
+
- Main sketch (.ino file)
|
|
59
|
+
- Additional tabs for organization
|
|
60
|
+
- Libraries in Arduino libraries folder
|
|
61
|
+
|
|
62
|
+
## Code Practices
|
|
63
|
+
- Use \`setup()\` for initialization
|
|
64
|
+
- Keep \`loop()\` non-blocking when possible
|
|
65
|
+
- Use \`delay()\` sparingly
|
|
66
|
+
- Free resources properly
|
|
67
|
+
|
|
68
|
+
## Hardware
|
|
69
|
+
- Document pin assignments
|
|
70
|
+
- Use proper resistor values
|
|
71
|
+
- Consider current limitations
|
|
72
|
+
- Test connections before powering
|
|
73
|
+
|
|
74
|
+
## Debugging
|
|
75
|
+
- Use Serial.print() for debugging
|
|
76
|
+
- Check Serial Monitor baud rate
|
|
77
|
+
- Validate sensor readings
|
|
78
|
+
- Test incrementally
|
|
79
|
+
`}}exports.CppPlugin=m;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { B as u } from "../BasePlugin-6wv0hYJ9.js";
|
|
2
|
+
class g extends u {
|
|
3
|
+
constructor() {
|
|
4
|
+
super(...arguments), this.name = "cpp", this.displayName = "C/C++", this.version = "3.0.0", this.priority = 85;
|
|
5
|
+
}
|
|
6
|
+
async detect(t) {
|
|
7
|
+
const i = [], s = {};
|
|
8
|
+
let r, n = this.getProjectName(t);
|
|
9
|
+
const e = await this.detectPlatformIO(t);
|
|
10
|
+
if (e && (i.push("platformio"), r = "platformio.ini", e.board && i.push(`board-${e.board}`), e.platform && (i.push(`platform-${e.platform}`), e.platform.includes("espressif32") && i.push("esp32"), e.platform.includes("espressif8266") && i.push("esp8266"), e.platform.includes("atmelavr") && i.push("arduino")), e.framework && (i.push(`framework-${e.framework}`), e.framework === "arduino" && i.push("arduino")), e.libs))
|
|
11
|
+
for (const a of e.libs)
|
|
12
|
+
s[a] = "*";
|
|
13
|
+
if (this.fileExists(t, "CMakeLists.txt")) {
|
|
14
|
+
i.push("cmake"), r || (r = "CMakeLists.txt");
|
|
15
|
+
const a = this.readFile(t, "CMakeLists.txt");
|
|
16
|
+
if (a) {
|
|
17
|
+
const c = a.match(/project\s*\(\s*([^\s)]+)/i);
|
|
18
|
+
c && (n = c[1]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return (this.fileExists(t, "Makefile") || this.fileExists(t, "makefile")) && (i.push("makefile"), r || (r = "Makefile")), await this.hasFiles(t, "*.ino") && (i.push("arduino"), r || (r = "*.ino")), await this.hasFiles(t, "**/*.{cpp,c,h,hpp}") && (i.push("cpp"), r || (r = "*.cpp")), i.length === 0 ? null : {
|
|
22
|
+
language: "C/C++",
|
|
23
|
+
name: n,
|
|
24
|
+
dependencies: s,
|
|
25
|
+
manifestFile: r,
|
|
26
|
+
projectPath: t,
|
|
27
|
+
tags: i
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse platformio.ini configuration
|
|
32
|
+
*/
|
|
33
|
+
async detectPlatformIO(t) {
|
|
34
|
+
if (!this.fileExists(t, "platformio.ini"))
|
|
35
|
+
return null;
|
|
36
|
+
const i = this.readFile(t, "platformio.ini");
|
|
37
|
+
if (!i) return null;
|
|
38
|
+
const s = {
|
|
39
|
+
libs: []
|
|
40
|
+
}, r = i.split(`
|
|
41
|
+
`);
|
|
42
|
+
let n = !1, e = null;
|
|
43
|
+
for (const p of r) {
|
|
44
|
+
const o = p.trim();
|
|
45
|
+
if (o.startsWith("[env:")) {
|
|
46
|
+
n = !0, e = null;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (o.startsWith("[") && o.endsWith("]")) {
|
|
50
|
+
n = !1, e = null;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
if (n || !s.board) {
|
|
54
|
+
const l = o.match(/^(\w+)\s*=\s*(.*)$/);
|
|
55
|
+
if (l) {
|
|
56
|
+
const [, f, a] = l;
|
|
57
|
+
switch (e = f, f) {
|
|
58
|
+
case "board":
|
|
59
|
+
s.board = a.trim();
|
|
60
|
+
break;
|
|
61
|
+
case "platform":
|
|
62
|
+
s.platform = a.trim();
|
|
63
|
+
break;
|
|
64
|
+
case "framework":
|
|
65
|
+
s.framework = a.trim();
|
|
66
|
+
break;
|
|
67
|
+
case "lib_deps":
|
|
68
|
+
a.trim() && s.libs?.push(a.trim());
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
} else e === "lib_deps" && o && !o.startsWith("[") && s.libs?.push(o);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return s.board || s.platform ? s : null;
|
|
75
|
+
}
|
|
76
|
+
getTemplates() {
|
|
77
|
+
return [
|
|
78
|
+
{
|
|
79
|
+
name: "cpp-core",
|
|
80
|
+
tags: ["cpp"],
|
|
81
|
+
content: this.getCppTemplate()
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
name: "platformio-core",
|
|
85
|
+
tags: ["platformio"],
|
|
86
|
+
content: this.getPlatformIOTemplate()
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: "arduino-core",
|
|
90
|
+
tags: ["arduino"],
|
|
91
|
+
content: this.getArduinoTemplate()
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
getDependencyTagMap() {
|
|
96
|
+
return {
|
|
97
|
+
// Common C++ libraries
|
|
98
|
+
boost: "boost",
|
|
99
|
+
fmt: "fmt",
|
|
100
|
+
spdlog: "spdlog",
|
|
101
|
+
googletest: "gtest",
|
|
102
|
+
catch2: "catch2",
|
|
103
|
+
// Arduino/PlatformIO libraries
|
|
104
|
+
"Adafruit GFX Library": "adafruit-gfx",
|
|
105
|
+
WiFi: "wifi",
|
|
106
|
+
ESP32: "esp32",
|
|
107
|
+
FastLED: "fastled",
|
|
108
|
+
ArduinoJson: "arduino-json"
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
getConfigFileTagMap() {
|
|
112
|
+
return {
|
|
113
|
+
"platformio.ini": "platformio",
|
|
114
|
+
"CMakeLists.txt": "cmake",
|
|
115
|
+
Makefile: "makefile",
|
|
116
|
+
".clang-format": "clang-format",
|
|
117
|
+
".clang-tidy": "clang-tidy"
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
getCppTemplate() {
|
|
121
|
+
return `# C/C++ Development Guidelines
|
|
122
|
+
|
|
123
|
+
This project uses C/C++.
|
|
124
|
+
|
|
125
|
+
## Project Structure
|
|
126
|
+
- Organize headers and implementation files clearly
|
|
127
|
+
- Use proper include guards or \`#pragma once\`
|
|
128
|
+
- Separate interface from implementation
|
|
129
|
+
|
|
130
|
+
## Code Style
|
|
131
|
+
- Follow modern C++ practices (C++11/14/17/20)
|
|
132
|
+
- Use RAII for resource management
|
|
133
|
+
- Prefer smart pointers over raw pointers
|
|
134
|
+
- Use const correctness
|
|
135
|
+
|
|
136
|
+
## Build System
|
|
137
|
+
- Use CMake or Makefile for build configuration
|
|
138
|
+
- Keep build files maintainable
|
|
139
|
+
- Document build dependencies
|
|
140
|
+
|
|
141
|
+
## Testing
|
|
142
|
+
- Write unit tests for core functionality
|
|
143
|
+
- Use GoogleTest, Catch2, or similar frameworks
|
|
144
|
+
- Test edge cases and error conditions
|
|
145
|
+
`;
|
|
146
|
+
}
|
|
147
|
+
getPlatformIOTemplate() {
|
|
148
|
+
return `# PlatformIO Development Guidelines
|
|
149
|
+
|
|
150
|
+
This is a PlatformIO embedded project.
|
|
151
|
+
|
|
152
|
+
## Project Structure
|
|
153
|
+
- Source code in \`src/\`
|
|
154
|
+
- Libraries in \`lib/\`
|
|
155
|
+
- Include files in \`include/\`
|
|
156
|
+
- Tests in \`test/\`
|
|
157
|
+
|
|
158
|
+
## Development Workflow
|
|
159
|
+
- Use PlatformIO CLI or IDE for building
|
|
160
|
+
- Test on hardware early and often
|
|
161
|
+
- Use serial monitor for debugging
|
|
162
|
+
- Manage dependencies via \`platformio.ini\`
|
|
163
|
+
|
|
164
|
+
## Code Practices
|
|
165
|
+
- Keep \`setup()\` and \`loop()\` focused
|
|
166
|
+
- Use proper pin definitions
|
|
167
|
+
- Handle interrupts carefully
|
|
168
|
+
- Consider power consumption
|
|
169
|
+
|
|
170
|
+
## Hardware Integration
|
|
171
|
+
- Document pin configurations
|
|
172
|
+
- Test hardware connections before coding
|
|
173
|
+
- Use appropriate voltage levels
|
|
174
|
+
- Follow manufacturer datasheets
|
|
175
|
+
`;
|
|
176
|
+
}
|
|
177
|
+
getArduinoTemplate() {
|
|
178
|
+
return `# Arduino Development Guidelines
|
|
179
|
+
|
|
180
|
+
This is an Arduino project.
|
|
181
|
+
|
|
182
|
+
## Project Structure
|
|
183
|
+
- Main sketch (.ino file)
|
|
184
|
+
- Additional tabs for organization
|
|
185
|
+
- Libraries in Arduino libraries folder
|
|
186
|
+
|
|
187
|
+
## Code Practices
|
|
188
|
+
- Use \`setup()\` for initialization
|
|
189
|
+
- Keep \`loop()\` non-blocking when possible
|
|
190
|
+
- Use \`delay()\` sparingly
|
|
191
|
+
- Free resources properly
|
|
192
|
+
|
|
193
|
+
## Hardware
|
|
194
|
+
- Document pin assignments
|
|
195
|
+
- Use proper resistor values
|
|
196
|
+
- Consider current limitations
|
|
197
|
+
- Test connections before powering
|
|
198
|
+
|
|
199
|
+
## Debugging
|
|
200
|
+
- Use Serial.print() for debugging
|
|
201
|
+
- Check Serial Monitor baud rate
|
|
202
|
+
- Validate sensor readings
|
|
203
|
+
- Test incrementally
|
|
204
|
+
`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
export {
|
|
208
|
+
g as CppPlugin
|
|
209
|
+
};
|
package/dist/csharp/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("node:path"),p=require("../BasePlugin-odQJAKA-.cjs");function l(n){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const t in n)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,a.get?a:{enumerable:!0,get:()=>n[t]})}}return e.default=n,Object.freeze(e)}const u=l(c);class g extends p.BasePlugin{constructor(){super(...arguments),this.name="csharp",this.displayName="C#",this.version="3.0.0",this.priority=60}async detect(e){const t=await this.findFiles(e,"*.csproj");if(t.length===0)return null;const a=t[0],s=this.readFile(e,a),r={};if(s){const o=s.matchAll(/<PackageReference\s+Include="([^"]+)"(?:\s+Version="([^"]+)")?/g);for(const i of o)r[i[1]]=i[2]||"*"}return{language:"C#",name:a.replace(".csproj",""),dependencies:r,manifestFile:a,projectPath:e}}getTemplates(){return[{name:"csharp-core",tags:["csharp","dotnet"],content:()=>this.loadTemplateFromFile(u.join(__dirname,"templates/lang-csharp.md")).then(e=>e||this.getCSharpFallbackTemplate())}]}getCSharpFallbackTemplate(){return`# C# / .NET Development Guidelines
|
|
2
2
|
|
|
3
3
|
This project uses C# and .NET.
|
|
4
4
|
|
|
@@ -15,4 +15,4 @@ This project uses C# and .NET.
|
|
|
15
15
|
## Testing
|
|
16
16
|
- Write xUnit/NUnit tests
|
|
17
17
|
- Use proper assertions
|
|
18
|
-
- Aim for good coverage`}
|
|
18
|
+
- Aim for good coverage`}getDependencyTagMap(){return{"Microsoft.AspNetCore":"aspnetcore",xunit:"xunit",NUnit:"nunit"}}}exports.CSharpPlugin=g;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as o from "node:path";
|
|
2
|
+
import { B as p } from "../BasePlugin-6wv0hYJ9.js";
|
|
3
|
+
class g extends p {
|
|
3
4
|
constructor() {
|
|
4
5
|
super(...arguments), this.name = "csharp", this.displayName = "C#", this.version = "3.0.0", this.priority = 60;
|
|
5
6
|
}
|
|
@@ -7,18 +8,18 @@ class l extends o {
|
|
|
7
8
|
const s = await this.findFiles(e, "*.csproj");
|
|
8
9
|
if (s.length === 0)
|
|
9
10
|
return null;
|
|
10
|
-
const t = s[0], n = this.readFile(e, t),
|
|
11
|
+
const t = s[0], n = this.readFile(e, t), a = {};
|
|
11
12
|
if (n) {
|
|
12
13
|
const i = n.matchAll(
|
|
13
14
|
/<PackageReference\s+Include="([^"]+)"(?:\s+Version="([^"]+)")?/g
|
|
14
15
|
);
|
|
15
|
-
for (const
|
|
16
|
-
r[
|
|
16
|
+
for (const r of i)
|
|
17
|
+
a[r[1]] = r[2] || "*";
|
|
17
18
|
}
|
|
18
19
|
return {
|
|
19
20
|
language: "C#",
|
|
20
21
|
name: t.replace(".csproj", ""),
|
|
21
|
-
dependencies:
|
|
22
|
+
dependencies: a,
|
|
22
23
|
manifestFile: t,
|
|
23
24
|
projectPath: e
|
|
24
25
|
};
|
|
@@ -28,7 +29,14 @@ class l extends o {
|
|
|
28
29
|
{
|
|
29
30
|
name: "csharp-core",
|
|
30
31
|
tags: ["csharp", "dotnet"],
|
|
31
|
-
content:
|
|
32
|
+
content: () => this.loadTemplateFromFile(
|
|
33
|
+
o.join(__dirname, "templates/lang-csharp.md")
|
|
34
|
+
).then((e) => e || this.getCSharpFallbackTemplate())
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
getCSharpFallbackTemplate() {
|
|
39
|
+
return `# C# / .NET Development Guidelines
|
|
32
40
|
|
|
33
41
|
This project uses C# and .NET.
|
|
34
42
|
|
|
@@ -45,9 +53,7 @@ This project uses C# and .NET.
|
|
|
45
53
|
## Testing
|
|
46
54
|
- Write xUnit/NUnit tests
|
|
47
55
|
- Use proper assertions
|
|
48
|
-
- Aim for good coverage
|
|
49
|
-
}
|
|
50
|
-
];
|
|
56
|
+
- Aim for good coverage`;
|
|
51
57
|
}
|
|
52
58
|
getDependencyTagMap() {
|
|
53
59
|
return {
|
|
@@ -58,5 +64,5 @@ This project uses C# and .NET.
|
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
export {
|
|
61
|
-
|
|
67
|
+
g as CSharpPlugin
|
|
62
68
|
};
|