@el-j/magic-helix-core 4.0.0-beta.2 → 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/index-B88j4AyE.js +13 -0
- package/dist/index-B88j4AyE.js.map +1 -0
- package/dist/index-CY-pQbuu.cjs +2 -0
- package/dist/index-CY-pQbuu.cjs.map +1 -0
- package/dist/index.cjs +75 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +2234 -51
- package/dist/index.mjs.map +1 -1
- package/dist/pattern-combiner.d.ts +1 -1
- package/dist/plugin-loader.d.ts +2 -1
- package/package.json +4 -4
- package/dist/BasePlugin-6wv0hYJ9.js +0 -98
- package/dist/BasePlugin-6wv0hYJ9.js.map +0 -1
- package/dist/BasePlugin-odQJAKA-.cjs +0 -2
- package/dist/BasePlugin-odQJAKA-.cjs.map +0 -1
- package/dist/builtin-plugins/base/BasePlugin.d.ts +0 -69
- package/dist/builtin-plugins/cpp/index.d.ts +0 -46
- package/dist/builtin-plugins/csharp/index.d.ts +0 -20
- package/dist/builtin-plugins/go/index.d.ts +0 -23
- package/dist/builtin-plugins/index.d.ts +0 -16
- package/dist/builtin-plugins/java/index.d.ts +0 -22
- package/dist/builtin-plugins/nodejs/index.d.ts +0 -44
- package/dist/builtin-plugins/php/index.d.ts +0 -20
- package/dist/builtin-plugins/python/index.d.ts +0 -27
- package/dist/builtin-plugins/ruby/index.d.ts +0 -20
- package/dist/builtin-plugins/rust/index.d.ts +0 -53
- package/dist/builtin-plugins/swift/index.d.ts +0 -22
- package/dist/default_templates/angular/angular-core.md +0 -19
- package/dist/default_templates/architecture/codeowners.md +0 -123
- package/dist/default_templates/architecture/monorepo.md +0 -146
- package/dist/default_templates/architecture/nx.md +0 -122
- package/dist/default_templates/architecture/turborepo.md +0 -114
- package/dist/default_templates/ci/github-actions.md +0 -268
- package/dist/default_templates/ci/gitlab-ci.md +0 -330
- package/dist/default_templates/containers/docker-multistage.md +0 -120
- package/dist/default_templates/containers/kubernetes-deploy.md +0 -210
- package/dist/default_templates/devops/docker-compose.md +0 -111
- package/dist/default_templates/devops/docker-dockerfile.md +0 -94
- package/dist/default_templates/devops/github-actions.md +0 -160
- package/dist/default_templates/devops/gitlab-ci.md +0 -210
- package/dist/default_templates/dotnet/framework-aspnetcore.md +0 -205
- package/dist/default_templates/dotnet/framework-blazor.md +0 -271
- package/dist/default_templates/dotnet/lang-csharp.md +0 -162
- package/dist/default_templates/generic/lang-typescript.md +0 -57
- package/dist/default_templates/generic/state-redux.md +0 -21
- package/dist/default_templates/generic/state-rxjs.md +0 -6
- package/dist/default_templates/generic/style-mui.md +0 -23
- package/dist/default_templates/generic/style-tailwind.md +0 -76
- package/dist/default_templates/generic/test-cypress.md +0 -21
- package/dist/default_templates/generic/test-jest.md +0 -20
- package/dist/default_templates/generic/test-playwright.md +0 -21
- package/dist/default_templates/generic/test-vitest.md +0 -131
- package/dist/default_templates/go/lang-go.md +0 -571
- package/dist/default_templates/java/build-gradle.md +0 -102
- package/dist/default_templates/java/build-maven.md +0 -86
- package/dist/default_templates/java/framework-spring-boot.md +0 -179
- package/dist/default_templates/java/lang-java.md +0 -78
- package/dist/default_templates/java/lang-kotlin.md +0 -88
- package/dist/default_templates/meta/magic-helix-meta.md +0 -213
- package/dist/default_templates/meta/meta-debug.md +0 -459
- package/dist/default_templates/meta/meta-implement.md +0 -450
- package/dist/default_templates/meta/meta-roadmap.md +0 -265
- package/dist/default_templates/nestjs/nestjs-core.md +0 -7
- package/dist/default_templates/patterns/architecture/clean-architecture.md +0 -469
- package/dist/default_templates/patterns/architecture/dependency-injection.md +0 -517
- package/dist/default_templates/patterns/architecture/domain-driven-design.md +0 -621
- package/dist/default_templates/patterns/architecture/layered-architecture.md +0 -382
- package/dist/default_templates/patterns/architecture/repository-pattern.md +0 -408
- package/dist/default_templates/patterns/domain-expertise/nextjs-rules.md +0 -115
- package/dist/default_templates/patterns/domain-expertise/react-patterns.md +0 -181
- package/dist/default_templates/patterns/domain-expertise/server-components.md +0 -212
- package/dist/default_templates/patterns/domain-expertise/shadcn-ui.md +0 -52
- package/dist/default_templates/patterns/domain-expertise/tailwind-patterns.md +0 -52
- package/dist/default_templates/patterns/environment/container-awareness.md +0 -17
- package/dist/default_templates/patterns/environment/ide-features.md +0 -17
- package/dist/default_templates/patterns/environment/os-commands.md +0 -17
- package/dist/default_templates/patterns/organization/heading-hierarchy.md +0 -103
- package/dist/default_templates/patterns/organization/sequential-workflows.md +0 -102
- package/dist/default_templates/patterns/organization/xml-rule-groups.md +0 -64
- package/dist/default_templates/patterns/reasoning/agent-loop.md +0 -151
- package/dist/default_templates/patterns/reasoning/confirmation-gates.md +0 -141
- package/dist/default_templates/patterns/reasoning/dependency-analysis.md +0 -132
- package/dist/default_templates/patterns/reasoning/one-tool-per-iteration.md +0 -152
- package/dist/default_templates/patterns/reasoning/preview-before-action.md +0 -194
- package/dist/default_templates/patterns/reasoning/reflection-checkpoints.md +0 -166
- package/dist/default_templates/patterns/reasoning/result-verification.md +0 -157
- package/dist/default_templates/patterns/reasoning/subtask-breakdown.md +0 -131
- package/dist/default_templates/patterns/reasoning/thinking-tags.md +0 -100
- package/dist/default_templates/patterns/role-definition/capability-declarations.md +0 -72
- package/dist/default_templates/patterns/role-definition/expert-identity.md +0 -45
- package/dist/default_templates/patterns/role-definition/scope-boundaries.md +0 -61
- package/dist/default_templates/patterns/safety/code-safety-rules.md +0 -17
- package/dist/default_templates/patterns/safety/credential-handling.md +0 -17
- package/dist/default_templates/patterns/safety/destructive-warnings.md +0 -17
- package/dist/default_templates/patterns/safety/refusal-messages.md +0 -17
- package/dist/default_templates/patterns/tone/adaptive-tone.md +0 -17
- package/dist/default_templates/patterns/tone/concise-communication.md +0 -17
- package/dist/default_templates/patterns/tone/forbidden-phrases.md +0 -17
- package/dist/default_templates/patterns/tool-guidelines/function-schemas.md +0 -143
- package/dist/default_templates/patterns/tool-guidelines/parameter-examples.md +0 -137
- package/dist/default_templates/patterns/tool-guidelines/usage-policies.md +0 -105
- package/dist/default_templates/php/framework-laravel.md +0 -112
- package/dist/default_templates/php/lang-php.md +0 -94
- package/dist/default_templates/python/lang-python.md +0 -508
- package/dist/default_templates/react/react-core.md +0 -677
- package/dist/default_templates/react/react-zustand.md +0 -7
- package/dist/default_templates/ruby/framework-rails.md +0 -309
- package/dist/default_templates/ruby/framework-sinatra.md +0 -227
- package/dist/default_templates/ruby/lang-ruby.md +0 -216
- package/dist/default_templates/rust/lang-rust.md +0 -89
- package/dist/default_templates/swift/framework-vapor.md +0 -352
- package/dist/default_templates/swift/lang-swift.md +0 -291
- package/dist/default_templates/vue/style-primevue.md +0 -6
- package/dist/default_templates/vue/style-quasar.md +0 -22
- package/dist/default_templates/vue/vue-core.md +0 -108
- package/dist/default_templates/vue/vue-pinia.md +0 -5
- package/dist/index-0GK4RlUx.js +0 -1748
- package/dist/index-0GK4RlUx.js.map +0 -1
- package/dist/index-AkVwRl-r.js +0 -92
- package/dist/index-AkVwRl-r.js.map +0 -1
- package/dist/index-B6BeG1yT.cjs +0 -68
- package/dist/index-B6BeG1yT.cjs.map +0 -1
- package/dist/index-B8pyjKdF.js +0 -94
- package/dist/index-B8pyjKdF.js.map +0 -1
- package/dist/index-BQ6v041y.js +0 -13
- package/dist/index-BQ6v041y.js.map +0 -1
- package/dist/index-Baxb1vI_.js +0 -210
- package/dist/index-Baxb1vI_.js.map +0 -1
- package/dist/index-Bg8DD8ku.js +0 -216
- package/dist/index-Bg8DD8ku.js.map +0 -1
- package/dist/index-BqTqxCpG.cjs +0 -89
- package/dist/index-BqTqxCpG.cjs.map +0 -1
- package/dist/index-Bv4Q1Pr7.cjs +0 -33
- package/dist/index-Bv4Q1Pr7.cjs.map +0 -1
- package/dist/index-CN8J45Nc.cjs +0 -24
- package/dist/index-CN8J45Nc.cjs.map +0 -1
- package/dist/index-CPbv2Od1.js +0 -62
- package/dist/index-CPbv2Od1.js.map +0 -1
- package/dist/index-Cf-MC6Al.js +0 -63
- package/dist/index-Cf-MC6Al.js.map +0 -1
- package/dist/index-DDPXXXDy.cjs +0 -19
- package/dist/index-DDPXXXDy.cjs.map +0 -1
- package/dist/index-DO30AzDe.cjs +0 -19
- package/dist/index-DO30AzDe.cjs.map +0 -1
- package/dist/index-DkvW5yBY.js +0 -2249
- package/dist/index-DkvW5yBY.js.map +0 -1
- package/dist/index-Dn1ehjIj.cjs +0 -80
- package/dist/index-Dn1ehjIj.cjs.map +0 -1
- package/dist/index-DqHvgoXJ.cjs +0 -19
- package/dist/index-DqHvgoXJ.cjs.map +0 -1
- package/dist/index-K39pdw94.cjs +0 -31
- package/dist/index-K39pdw94.cjs.map +0 -1
- package/dist/index-OT2XAJkc.js +0 -117
- package/dist/index-OT2XAJkc.js.map +0 -1
- package/dist/index-TPAX4XKg.cjs +0 -30
- package/dist/index-TPAX4XKg.cjs.map +0 -1
- package/dist/index-WmVSB57y.js +0 -107
- package/dist/index-WmVSB57y.js.map +0 -1
- package/dist/index-mYXvc3Fs.js +0 -68
- package/dist/index-mYXvc3Fs.js.map +0 -1
- package/dist/index-nioXOg4m.cjs +0 -76
- package/dist/index-nioXOg4m.cjs.map +0 -1
- package/dist/index-okhY3fWD.cjs +0 -2
- package/dist/index-okhY3fWD.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-B8pyjKdF.js","sources":["../src/builtin-plugins/go/index.ts"],"sourcesContent":["/**\n * Go Language Plugin\n *\n * Detects Go projects via go.mod file\n * Parses module dependencies from go.mod\n */\n\nimport type { ProjectMetadata, TemplateDefinition } from '../../types';\nimport { BasePlugin } from '../base/BasePlugin';\n\nexport class GoPlugin extends BasePlugin {\n name = 'go';\n displayName = 'Go';\n version = '3.0.0';\n priority = 90;\n\n async detect(projectPath: string): Promise<ProjectMetadata | null> {\n if (!this.fileExists(projectPath, 'go.mod')) {\n return null;\n }\n\n const content = this.readFile(projectPath, 'go.mod');\n if (!content) {\n return {\n language: 'Go',\n name: this.getProjectName(projectPath),\n dependencies: {},\n manifestFile: 'go.mod',\n projectPath,\n };\n }\n\n const moduleMatch = content.match(/module\\s+([^\\s\\n]+)/);\n const deps: Record<string, string> = {};\n\n // Parse dependencies\n const lines = content.split('\\n');\n let inRequire = false;\n for (const line of lines) {\n if (line.trim().startsWith('require (')) {\n inRequire = true;\n continue;\n }\n if (inRequire) {\n if (line.trim() === ')') break;\n const depMatch = line.match(/^\\s*([^\\s]+)\\s+v([^\\s]+)/);\n if (depMatch) {\n deps[depMatch[1]] = depMatch[2];\n }\n } else if (line.trim().startsWith('require ')) {\n const depMatch = line.match(/require\\s+([^\\s]+)\\s+v([^\\s]+)/);\n if (depMatch) {\n deps[depMatch[1]] = depMatch[2];\n }\n }\n }\n\n return {\n language: 'Go',\n name: moduleMatch?.[1] || this.getProjectName(projectPath),\n dependencies: deps,\n manifestFile: 'go.mod',\n projectPath,\n };\n }\n\n getTemplates(): TemplateDefinition[] {\n return [\n {\n name: 'go-core',\n tags: ['go'],\n content: this.getGoTemplate(),\n },\n ];\n }\n\n getDependencyTagMap() {\n return {\n 'github.com/gin-gonic/gin': 'gin',\n 'github.com/gofiber/fiber': 'fiber',\n 'github.com/labstack/echo': 'echo',\n 'gorm.io/gorm': 'gorm',\n };\n }\n\n private getGoTemplate(): string {\n return `# Go Development Guidelines\n\nThis project uses Go.\n\n## Project Structure\n- Follow standard Go project layout\n- Organize code in packages\n- Use proper module management\n\n## Code Style\n- Follow Go conventions and idioms\n- Use \\`gofmt\\` for formatting\n- Run \\`golint\\` and \\`go vet\\`\n\n## Error Handling\n- Handle errors explicitly\n- Don't ignore errors\n- Provide meaningful error messages\n\n## Testing\n- Write table-driven tests\n- Use \\`testing\\` package\n- Aim for good test coverage\n\n## Dependencies\n- Use Go modules (\\`go.mod\\`)\n- Keep dependencies minimal\n- Review dependency licenses`;\n }\n}\n"],"names":["GoPlugin","BasePlugin","projectPath","content","moduleMatch","deps","lines","inRequire","line","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ACL;AAAA,QACE,MAAM;AAAA,QACN,MAAM,CAAC,IAAI;AAAA,QACX,SAAS,KAAK,cAAA;AAAA,MAAc;AAAA,IAC9B;AAAA,EAEJ;AAAA,EAEA,sBAAsB;AACpB,WAAO;AAAA,MACL,4BAA4B;AAAA,MAC5B,4BAA4B;AAAA,MAC5B,4BAA4B;AAAA,MAC5B,gBAAgB;AAAA,IAAA;AAAA,EAEpB;AAAA,EAEQ,gBAAwB;AAC9B,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4BT;AACF;"}
|
package/dist/index-BQ6v041y.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { C as a, D as i, G as s, a as u, b as g, M as l, P as o, c as t, R as e } from "./index-DkvW5yBY.js";
|
|
2
|
-
export {
|
|
3
|
-
a as CodeOwnersPlugin,
|
|
4
|
-
i as DockerPlugin,
|
|
5
|
-
s as GitHubActionsPlugin,
|
|
6
|
-
u as GitLabCIPlugin,
|
|
7
|
-
g as GolangPlugin,
|
|
8
|
-
l as MonorepoPlugin,
|
|
9
|
-
o as PHPPlugin,
|
|
10
|
-
t as PythonPlugin,
|
|
11
|
-
e as RustPlugin
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=index-BQ6v041y.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BQ6v041y.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index-Baxb1vI_.js
DELETED
|
@@ -1,210 +0,0 @@
|
|
|
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
|
-
};
|
|
210
|
-
//# sourceMappingURL=index-Baxb1vI_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Baxb1vI_.js","sources":["../src/builtin-plugins/cpp/index.ts"],"sourcesContent":["/**\n * C/C++ Language Plugin\n *\n * Detects C/C++ projects via:\n * - platformio.ini (PlatformIO/ESP32/Arduino)\n * - CMakeLists.txt (CMake)\n * - Makefile\n * - *.ino files (Arduino sketches)\n * - .cpp/.h files\n */\n\nimport type { ProjectMetadata, TemplateDefinition } from '../../types';\nimport { BasePlugin } from '../base/BasePlugin';\n\ninterface PlatformIOConfig {\n board?: string;\n platform?: string;\n framework?: string;\n libs?: string[];\n}\n\nexport class CppPlugin extends BasePlugin {\n name = 'cpp';\n displayName = 'C/C++';\n version = '3.0.0';\n priority = 85;\n\n async detect(projectPath: string): Promise<ProjectMetadata | null> {\n const tags: string[] = [];\n const dependencies: Record<string, string> = {};\n let manifestFile: string | undefined;\n let projectName = this.getProjectName(projectPath);\n\n // Detect PlatformIO project\n const platformioConfig = await this.detectPlatformIO(projectPath);\n if (platformioConfig) {\n tags.push('platformio');\n manifestFile = 'platformio.ini';\n\n if (platformioConfig.board) {\n tags.push(`board-${platformioConfig.board}`);\n }\n if (platformioConfig.platform) {\n tags.push(`platform-${platformioConfig.platform}`);\n\n // Common platforms\n if (platformioConfig.platform.includes('espressif32')) {\n tags.push('esp32');\n }\n if (platformioConfig.platform.includes('espressif8266')) {\n tags.push('esp8266');\n }\n if (platformioConfig.platform.includes('atmelavr')) {\n tags.push('arduino');\n }\n }\n if (platformioConfig.framework) {\n tags.push(`framework-${platformioConfig.framework}`);\n if (platformioConfig.framework === 'arduino') {\n tags.push('arduino');\n }\n }\n if (platformioConfig.libs) {\n for (const lib of platformioConfig.libs) {\n dependencies[lib] = '*';\n }\n }\n }\n\n // Detect CMake project\n const hasCMake = this.fileExists(projectPath, 'CMakeLists.txt');\n if (hasCMake) {\n tags.push('cmake');\n if (!manifestFile) manifestFile = 'CMakeLists.txt';\n\n // Try to extract project name from CMakeLists.txt\n const cmakeContent = this.readFile(projectPath, 'CMakeLists.txt');\n if (cmakeContent) {\n const projectMatch = cmakeContent.match(/project\\s*\\(\\s*([^\\s)]+)/i);\n if (projectMatch) {\n projectName = projectMatch[1];\n }\n }\n }\n\n // Detect Makefile\n const hasMakefile =\n this.fileExists(projectPath, 'Makefile') ||\n this.fileExists(projectPath, 'makefile');\n if (hasMakefile) {\n tags.push('makefile');\n if (!manifestFile) manifestFile = 'Makefile';\n }\n\n // Detect Arduino sketches\n const hasIno = await this.hasFiles(projectPath, '*.ino');\n if (hasIno) {\n tags.push('arduino');\n if (!manifestFile) manifestFile = '*.ino';\n }\n\n // Detect C++ source files\n const hasCpp = await this.hasFiles(projectPath, '**/*.{cpp,c,h,hpp}');\n if (hasCpp) {\n tags.push('cpp');\n if (!manifestFile) manifestFile = '*.cpp';\n }\n\n // Must have at least one C++ indicator\n if (tags.length === 0) {\n return null;\n }\n\n return {\n language: 'C/C++',\n name: projectName,\n dependencies,\n manifestFile,\n projectPath,\n tags,\n };\n }\n\n /**\n * Parse platformio.ini configuration\n */\n private async detectPlatformIO(\n projectPath: string,\n ): Promise<PlatformIOConfig | null> {\n if (!this.fileExists(projectPath, 'platformio.ini')) {\n return null;\n }\n\n const content = this.readFile(projectPath, 'platformio.ini');\n if (!content) return null;\n\n const config: PlatformIOConfig = {\n libs: [],\n };\n\n const lines = content.split('\\n');\n let inEnv = false;\n let currentKey: string | null = null;\n\n for (const line of lines) {\n const trimmed = line.trim();\n\n // Detect environment section\n if (trimmed.startsWith('[env:')) {\n inEnv = true;\n currentKey = null;\n continue;\n }\n if (trimmed.startsWith('[') && trimmed.endsWith(']')) {\n inEnv = false;\n currentKey = null;\n continue;\n }\n\n if (inEnv || !config.board) {\n // Parse key-value pairs\n const match = trimmed.match(/^(\\w+)\\s*=\\s*(.*)$/);\n if (match) {\n const [, key, value] = match;\n currentKey = key;\n switch (key) {\n case 'board':\n config.board = value.trim();\n break;\n case 'platform':\n config.platform = value.trim();\n break;\n case 'framework':\n config.framework = value.trim();\n break;\n case 'lib_deps':\n // lib_deps can be multiline, value might be empty if libs are on next lines\n if (value.trim()) {\n config.libs?.push(value.trim());\n }\n break;\n }\n } else if (\n currentKey === 'lib_deps' &&\n trimmed &&\n !trimmed.startsWith('[')\n ) {\n // Continuation line for lib_deps (indented library names)\n config.libs?.push(trimmed);\n }\n }\n }\n\n return config.board || config.platform ? config : null;\n }\n\n getTemplates(): TemplateDefinition[] {\n return [\n {\n name: 'cpp-core',\n tags: ['cpp'],\n content: this.getCppTemplate(),\n },\n {\n name: 'platformio-core',\n tags: ['platformio'],\n content: this.getPlatformIOTemplate(),\n },\n {\n name: 'arduino-core',\n tags: ['arduino'],\n content: this.getArduinoTemplate(),\n },\n ];\n }\n\n getDependencyTagMap() {\n return {\n // Common C++ libraries\n boost: 'boost',\n fmt: 'fmt',\n spdlog: 'spdlog',\n googletest: 'gtest',\n catch2: 'catch2',\n\n // Arduino/PlatformIO libraries\n 'Adafruit GFX Library': 'adafruit-gfx',\n WiFi: 'wifi',\n ESP32: 'esp32',\n FastLED: 'fastled',\n ArduinoJson: 'arduino-json',\n };\n }\n\n getConfigFileTagMap() {\n return {\n 'platformio.ini': 'platformio',\n 'CMakeLists.txt': 'cmake',\n Makefile: 'makefile',\n '.clang-format': 'clang-format',\n '.clang-tidy': 'clang-tidy',\n };\n }\n\n private getCppTemplate(): string {\n return `# C/C++ Development Guidelines\n\nThis project uses C/C++.\n\n## Project Structure\n- Organize headers and implementation files clearly\n- Use proper include guards or \\`#pragma once\\`\n- Separate interface from implementation\n\n## Code Style\n- Follow modern C++ practices (C++11/14/17/20)\n- Use RAII for resource management\n- Prefer smart pointers over raw pointers\n- Use const correctness\n\n## Build System\n- Use CMake or Makefile for build configuration\n- Keep build files maintainable\n- Document build dependencies\n\n## Testing\n- Write unit tests for core functionality\n- Use GoogleTest, Catch2, or similar frameworks\n- Test edge cases and error conditions\n`;\n }\n\n private getPlatformIOTemplate(): string {\n return `# PlatformIO Development Guidelines\n\nThis is a PlatformIO embedded project.\n\n## Project Structure\n- Source code in \\`src/\\`\n- Libraries in \\`lib/\\`\n- Include files in \\`include/\\`\n- Tests in \\`test/\\`\n\n## Development Workflow\n- Use PlatformIO CLI or IDE for building\n- Test on hardware early and often\n- Use serial monitor for debugging\n- Manage dependencies via \\`platformio.ini\\`\n\n## Code Practices\n- Keep \\`setup()\\` and \\`loop()\\` focused\n- Use proper pin definitions\n- Handle interrupts carefully\n- Consider power consumption\n\n## Hardware Integration\n- Document pin configurations\n- Test hardware connections before coding\n- Use appropriate voltage levels\n- Follow manufacturer datasheets\n`;\n }\n\n private getArduinoTemplate(): string {\n return `# Arduino Development Guidelines\n\nThis is an Arduino project.\n\n## Project Structure\n- Main sketch (.ino file)\n- Additional tabs for organization\n- Libraries in Arduino libraries folder\n\n## Code Practices\n- Use \\`setup()\\` for initialization\n- Keep \\`loop()\\` non-blocking when possible\n- Use \\`delay()\\` sparingly\n- Free resources properly\n\n## Hardware\n- Document pin assignments\n- Use proper resistor values\n- Consider current limitations\n- Test connections before powering\n\n## Debugging\n- Use Serial.print() for debugging\n- Check Serial Monitor baud rate\n- Validate sensor readings\n- Test incrementally\n`;\n }\n}\n"],"names":["CppPlugin","BasePlugin","projectPath","tags","dependencies","manifestFile","projectName","platformioConfig","lib","cmakeContent","projectMatch","content","config","lines","inEnv","currentKey","line","trimmed","match","key","value"],"mappings":";AAqBO,MAAMA,UAAkBC,EAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA,GACL,KAAA,OAAO,OACP,KAAA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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA4BT;AAAA,EAEQ,qBAA6B;AACnC,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2BT;AACF;"}
|
package/dist/index-Bg8DD8ku.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
import * as t from "node:path";
|
|
2
|
-
import { B as r } from "./BasePlugin-6wv0hYJ9.js";
|
|
3
|
-
class c extends r {
|
|
4
|
-
constructor() {
|
|
5
|
-
super(...arguments), this.name = "nodejs", this.displayName = "Node.js", this.version = "3.0.0", this.priority = 100;
|
|
6
|
-
}
|
|
7
|
-
// High priority - very common
|
|
8
|
-
async detect(e) {
|
|
9
|
-
if (!this.fileExists(e, "package.json"))
|
|
10
|
-
return null;
|
|
11
|
-
const s = this.readJSON(e, "package.json");
|
|
12
|
-
if (!s)
|
|
13
|
-
return {
|
|
14
|
-
language: "JavaScript/TypeScript",
|
|
15
|
-
name: this.getProjectName(e),
|
|
16
|
-
dependencies: {},
|
|
17
|
-
manifestFile: "package.json",
|
|
18
|
-
projectPath: e
|
|
19
|
-
};
|
|
20
|
-
const a = this.parseDependencies(
|
|
21
|
-
s,
|
|
22
|
-
"dependencies",
|
|
23
|
-
"devDependencies"
|
|
24
|
-
), n = {
|
|
25
|
-
language: "JavaScript/TypeScript",
|
|
26
|
-
name: s.name || this.getProjectName(e),
|
|
27
|
-
description: s.description,
|
|
28
|
-
dependencies: a,
|
|
29
|
-
manifestFile: "package.json",
|
|
30
|
-
projectPath: e
|
|
31
|
-
}, i = this.extractWorkspaces(s);
|
|
32
|
-
return i.length > 0 && (n.workspaceMembers = i), n;
|
|
33
|
-
}
|
|
34
|
-
getTemplates() {
|
|
35
|
-
return [
|
|
36
|
-
{
|
|
37
|
-
name: "lang-typescript",
|
|
38
|
-
tags: ["typescript"],
|
|
39
|
-
content: () => this.loadTemplateFromFile(
|
|
40
|
-
t.join(__dirname, "templates/lang-typescript.md")
|
|
41
|
-
).then((e) => e || this.getTypescriptTemplate())
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: "react-core",
|
|
45
|
-
tags: ["react"],
|
|
46
|
-
content: () => this.loadTemplateFromFile(
|
|
47
|
-
t.join(__dirname, "templates/react-core.md")
|
|
48
|
-
).then((e) => e || this.getReactTemplate())
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: "react-zustand",
|
|
52
|
-
tags: ["zustand"],
|
|
53
|
-
content: () => this.loadTemplateFromFile(
|
|
54
|
-
t.join(__dirname, "templates/react-zustand.md")
|
|
55
|
-
).then((e) => e || this.getReactZustandTemplate())
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "vue-core",
|
|
59
|
-
tags: ["vue"],
|
|
60
|
-
content: () => this.loadTemplateFromFile(
|
|
61
|
-
t.join(__dirname, "templates/vue-core.md")
|
|
62
|
-
).then((e) => e || this.getVueTemplate())
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
name: "vue-pinia",
|
|
66
|
-
tags: ["pinia"],
|
|
67
|
-
content: () => this.loadTemplateFromFile(
|
|
68
|
-
t.join(__dirname, "templates/vue-pinia.md")
|
|
69
|
-
).then((e) => e || this.getVuePiniaTemplate())
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: "nestjs-core",
|
|
73
|
-
tags: ["nestjs"],
|
|
74
|
-
content: () => this.loadTemplateFromFile(
|
|
75
|
-
t.join(__dirname, "templates/nestjs-core.md")
|
|
76
|
-
).then((e) => e || this.getNestJSTemplate())
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: "style-tailwind",
|
|
80
|
-
tags: ["tailwind"],
|
|
81
|
-
content: () => this.loadTemplateFromFile(
|
|
82
|
-
t.join(__dirname, "templates/style-tailwind.md")
|
|
83
|
-
).then((e) => e || this.getTailwindTemplate())
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: "test-vitest",
|
|
87
|
-
tags: ["vitest"],
|
|
88
|
-
content: () => this.loadTemplateFromFile(
|
|
89
|
-
t.join(__dirname, "templates/test-vitest.md")
|
|
90
|
-
).then((e) => e || this.getVitestTemplate())
|
|
91
|
-
}
|
|
92
|
-
];
|
|
93
|
-
}
|
|
94
|
-
getDependencyTagMap() {
|
|
95
|
-
return {
|
|
96
|
-
react: "react",
|
|
97
|
-
"react-dom": "react",
|
|
98
|
-
vue: "vue",
|
|
99
|
-
"@vue/runtime-core": "vue",
|
|
100
|
-
pinia: "pinia",
|
|
101
|
-
"@nestjs/core": "nestjs",
|
|
102
|
-
tailwindcss: "tailwind",
|
|
103
|
-
vitest: "vitest",
|
|
104
|
-
zustand: "zustand",
|
|
105
|
-
typescript: "typescript"
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
getConfigFileTagMap() {
|
|
109
|
-
return {
|
|
110
|
-
"tailwind.config.js": "tailwind",
|
|
111
|
-
"tailwind.config.ts": "tailwind",
|
|
112
|
-
"vitest.config.js": "vitest",
|
|
113
|
-
"vitest.config.ts": "vitest",
|
|
114
|
-
"tsconfig.json": "typescript"
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
// Private helper methods
|
|
118
|
-
extractWorkspaces(e) {
|
|
119
|
-
return e.workspaces ? (Array.isArray(e.workspaces) ? e.workspaces : e.workspaces.packages || []).map((a) => a.replace(/\/\*$/, "")) : [];
|
|
120
|
-
}
|
|
121
|
-
// Fallback template content (if files don't exist)
|
|
122
|
-
getTypescriptTemplate() {
|
|
123
|
-
return `# TypeScript Guidelines
|
|
124
|
-
|
|
125
|
-
This project uses TypeScript for type safety.
|
|
126
|
-
|
|
127
|
-
## Type Safety
|
|
128
|
-
- Use strict type checking
|
|
129
|
-
- Avoid \`any\` types
|
|
130
|
-
- Prefer interfaces over types for objects
|
|
131
|
-
|
|
132
|
-
## Best Practices
|
|
133
|
-
- Enable all strict compiler options
|
|
134
|
-
- Use proper type inference
|
|
135
|
-
- Leverage utility types`;
|
|
136
|
-
}
|
|
137
|
-
getReactTemplate() {
|
|
138
|
-
return `# React Development Guidelines
|
|
139
|
-
|
|
140
|
-
This project uses React.
|
|
141
|
-
|
|
142
|
-
## Component Structure
|
|
143
|
-
- Use functional components with hooks
|
|
144
|
-
- Keep components focused and reusable
|
|
145
|
-
- Follow React best practices
|
|
146
|
-
|
|
147
|
-
## State Management
|
|
148
|
-
- Use appropriate state management for complexity
|
|
149
|
-
- Consider component composition
|
|
150
|
-
- Leverage React context when needed`;
|
|
151
|
-
}
|
|
152
|
-
getReactZustandTemplate() {
|
|
153
|
-
return `# Zustand State Management
|
|
154
|
-
|
|
155
|
-
This project uses Zustand for state management.
|
|
156
|
-
|
|
157
|
-
## Store Structure
|
|
158
|
-
- Create focused, modular stores
|
|
159
|
-
- Use selectors to prevent unnecessary re-renders
|
|
160
|
-
- Follow Zustand best practices`;
|
|
161
|
-
}
|
|
162
|
-
getVueTemplate() {
|
|
163
|
-
return `# Vue.js Development Guidelines
|
|
164
|
-
|
|
165
|
-
This project uses Vue.js.
|
|
166
|
-
|
|
167
|
-
## Component Structure
|
|
168
|
-
- Use Composition API
|
|
169
|
-
- Follow Vue.js style guide
|
|
170
|
-
- Keep components composable and reusable`;
|
|
171
|
-
}
|
|
172
|
-
getVuePiniaTemplate() {
|
|
173
|
-
return `# Pinia State Management
|
|
174
|
-
|
|
175
|
-
This project uses Pinia for state management.
|
|
176
|
-
|
|
177
|
-
## Store Structure
|
|
178
|
-
- Create modular stores
|
|
179
|
-
- Use composition stores pattern
|
|
180
|
-
- Follow Pinia best practices`;
|
|
181
|
-
}
|
|
182
|
-
getNestJSTemplate() {
|
|
183
|
-
return `# NestJS Development Guidelines
|
|
184
|
-
|
|
185
|
-
This project uses NestJS framework.
|
|
186
|
-
|
|
187
|
-
## Architecture
|
|
188
|
-
- Follow modular architecture
|
|
189
|
-
- Use dependency injection
|
|
190
|
-
- Implement proper error handling`;
|
|
191
|
-
}
|
|
192
|
-
getTailwindTemplate() {
|
|
193
|
-
return `# Tailwind CSS Guidelines
|
|
194
|
-
|
|
195
|
-
This project uses Tailwind CSS.
|
|
196
|
-
|
|
197
|
-
## Styling Approach
|
|
198
|
-
- Use utility-first classes
|
|
199
|
-
- Create reusable components
|
|
200
|
-
- Follow Tailwind best practices`;
|
|
201
|
-
}
|
|
202
|
-
getVitestTemplate() {
|
|
203
|
-
return `# Vitest Testing Guidelines
|
|
204
|
-
|
|
205
|
-
This project uses Vitest for testing.
|
|
206
|
-
|
|
207
|
-
## Testing Strategy
|
|
208
|
-
- Write unit tests for utilities
|
|
209
|
-
- Use component testing
|
|
210
|
-
- Follow testing best practices`;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
export {
|
|
214
|
-
c as NodeJSPlugin
|
|
215
|
-
};
|
|
216
|
-
//# sourceMappingURL=index-Bg8DD8ku.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-Bg8DD8ku.js","sources":["../src/builtin-plugins/nodejs/index.ts"],"sourcesContent":["/**\n * Node.js Language Plugin\n *\n * Detects Node.js/JavaScript/TypeScript projects via package.json\n * Supports npm workspaces for monorepo detection\n */\n\nimport * as path from 'node:path';\nimport type { ProjectMetadata, TemplateDefinition } from '../../types';\nimport { BasePlugin } from '../base/BasePlugin';\n\ninterface PackageJson {\n name?: string;\n description?: string;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n workspaces?: string[] | { packages: string[] };\n}\n\nexport class NodeJSPlugin extends BasePlugin {\n name = 'nodejs';\n displayName = 'Node.js';\n version = '3.0.0';\n priority = 100; // High priority - very common\n\n async detect(projectPath: string): Promise<ProjectMetadata | null> {\n if (!this.fileExists(projectPath, 'package.json')) {\n return null;\n }\n\n const pkg = this.readJSON<PackageJson>(projectPath, 'package.json');\n if (!pkg) {\n // package.json exists but couldn't parse - still consider it a Node.js project\n return {\n language: 'JavaScript/TypeScript',\n name: this.getProjectName(projectPath),\n dependencies: {},\n manifestFile: 'package.json',\n projectPath,\n };\n }\n\n const deps = this.parseDependencies(\n pkg as Record<string, unknown>,\n 'dependencies',\n 'devDependencies',\n );\n\n const metadata: ProjectMetadata = {\n language: 'JavaScript/TypeScript',\n name: pkg.name || this.getProjectName(projectPath),\n description: pkg.description,\n dependencies: deps,\n manifestFile: 'package.json',\n projectPath,\n };\n\n // Check for workspaces (monorepo support)\n const workspaces = this.extractWorkspaces(pkg);\n if (workspaces.length > 0) {\n metadata.workspaceMembers = workspaces;\n }\n\n return metadata;\n }\n\n getTemplates(): TemplateDefinition[] {\n return [\n {\n name: 'lang-typescript',\n tags: ['typescript'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/lang-typescript.md'),\n ).then((c) => c || this.getTypescriptTemplate()),\n },\n {\n name: 'react-core',\n tags: ['react'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/react-core.md'),\n ).then((c) => c || this.getReactTemplate()),\n },\n {\n name: 'react-zustand',\n tags: ['zustand'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/react-zustand.md'),\n ).then((c) => c || this.getReactZustandTemplate()),\n },\n {\n name: 'vue-core',\n tags: ['vue'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/vue-core.md'),\n ).then((c) => c || this.getVueTemplate()),\n },\n {\n name: 'vue-pinia',\n tags: ['pinia'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/vue-pinia.md'),\n ).then((c) => c || this.getVuePiniaTemplate()),\n },\n {\n name: 'nestjs-core',\n tags: ['nestjs'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/nestjs-core.md'),\n ).then((c) => c || this.getNestJSTemplate()),\n },\n {\n name: 'style-tailwind',\n tags: ['tailwind'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/style-tailwind.md'),\n ).then((c) => c || this.getTailwindTemplate()),\n },\n {\n name: 'test-vitest',\n tags: ['vitest'],\n content: () =>\n this.loadTemplateFromFile(\n path.join(__dirname, 'templates/test-vitest.md'),\n ).then((c) => c || this.getVitestTemplate()),\n },\n ];\n }\n\n getDependencyTagMap() {\n return {\n react: 'react',\n 'react-dom': 'react',\n vue: 'vue',\n '@vue/runtime-core': 'vue',\n pinia: 'pinia',\n '@nestjs/core': 'nestjs',\n tailwindcss: 'tailwind',\n vitest: 'vitest',\n zustand: 'zustand',\n typescript: 'typescript',\n };\n }\n\n getConfigFileTagMap() {\n return {\n 'tailwind.config.js': 'tailwind',\n 'tailwind.config.ts': 'tailwind',\n 'vitest.config.js': 'vitest',\n 'vitest.config.ts': 'vitest',\n 'tsconfig.json': 'typescript',\n };\n }\n\n // Private helper methods\n\n private extractWorkspaces(pkg: PackageJson): string[] {\n if (!pkg.workspaces) return [];\n\n const workspacePatterns = Array.isArray(pkg.workspaces)\n ? pkg.workspaces\n : pkg.workspaces.packages || [];\n\n // Convert glob patterns to actual paths (simplified - just remove wildcards)\n return workspacePatterns.map((pattern) => pattern.replace(/\\/\\*$/, ''));\n }\n\n // Fallback template content (if files don't exist)\n\n private getTypescriptTemplate(): string {\n return `# TypeScript Guidelines\n\nThis project uses TypeScript for type safety.\n\n## Type Safety\n- Use strict type checking\n- Avoid \\`any\\` types\n- Prefer interfaces over types for objects\n\n## Best Practices\n- Enable all strict compiler options\n- Use proper type inference\n- Leverage utility types`;\n }\n\n private getReactTemplate(): string {\n return `# React Development Guidelines\n\nThis project uses React.\n\n## Component Structure\n- Use functional components with hooks\n- Keep components focused and reusable\n- Follow React best practices\n\n## State Management\n- Use appropriate state management for complexity\n- Consider component composition\n- Leverage React context when needed`;\n }\n\n private getReactZustandTemplate(): string {\n return `# Zustand State Management\n\nThis project uses Zustand for state management.\n\n## Store Structure\n- Create focused, modular stores\n- Use selectors to prevent unnecessary re-renders\n- Follow Zustand best practices`;\n }\n\n private getVueTemplate(): string {\n return `# Vue.js Development Guidelines\n\nThis project uses Vue.js.\n\n## Component Structure\n- Use Composition API\n- Follow Vue.js style guide\n- Keep components composable and reusable`;\n }\n\n private getVuePiniaTemplate(): string {\n return `# Pinia State Management\n\nThis project uses Pinia for state management.\n\n## Store Structure\n- Create modular stores\n- Use composition stores pattern\n- Follow Pinia best practices`;\n }\n\n private getNestJSTemplate(): string {\n return `# NestJS Development Guidelines\n\nThis project uses NestJS framework.\n\n## Architecture\n- Follow modular architecture\n- Use dependency injection\n- Implement proper error handling`;\n }\n\n private getTailwindTemplate(): string {\n return `# Tailwind CSS Guidelines\n\nThis project uses Tailwind CSS.\n\n## Styling Approach\n- Use utility-first classes\n- Create reusable components\n- Follow Tailwind best practices`;\n }\n\n private getVitestTemplate(): string {\n return `# Vitest Testing Guidelines\n\nThis project uses Vitest for testing.\n\n## Testing Strategy\n- Write unit tests for utilities\n- Use component testing\n- Follow testing best practices`;\n }\n}\n"],"names":["NodeJSPlugin","BasePlugin","projectPath","pkg","deps","metadata","workspaces","path","c","pattern"],"mappings":";;AAmBO,MAAMA,UAAqBC,EAAW;AAAA,EAAtC,cAAA;AAAA,UAAA,GAAA,SAAA,GACL,KAAA,OAAO,UACP,KAAA,cAAc,WACd,KAAA,UAAU,SACV,KAAA,WAAW;AAAA,EAAA;AAAA;AAAA,EAEX,MAAM,OAAOC,GAAsD;AACjE,QAAI,CAAC,KAAK,WAAWA,GAAa,cAAc;AAC9C,aAAO;AAGT,UAAMC,IAAM,KAAK,SAAsBD,GAAa,cAAc;AAClE,QAAI,CAACC;AAEH,aAAO;AAAA,QACL,UAAU;AAAA,QACV,MAAM,KAAK,eAAeD,CAAW;AAAA,QACrC,cAAc,CAAA;AAAA,QACd,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