create-specfuse 0.2.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/README.md +203 -0
- package/bin/create-specfuse.js +2 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +3 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +103 -0
- package/dist/prompts.js.map +1 -0
- package/dist/scaffolder.d.ts +3 -0
- package/dist/scaffolder.d.ts.map +1 -0
- package/dist/scaffolder.js +233 -0
- package/dist/scaffolder.js.map +1 -0
- package/dist/stacks/bash.d.ts +5 -0
- package/dist/stacks/bash.d.ts.map +1 -0
- package/dist/stacks/bash.js +66 -0
- package/dist/stacks/bash.js.map +1 -0
- package/dist/stacks/cpp-cmake.d.ts +5 -0
- package/dist/stacks/cpp-cmake.d.ts.map +1 -0
- package/dist/stacks/cpp-cmake.js +74 -0
- package/dist/stacks/cpp-cmake.js.map +1 -0
- package/dist/stacks/detect.d.ts +11 -0
- package/dist/stacks/detect.d.ts.map +1 -0
- package/dist/stacks/detect.js +104 -0
- package/dist/stacks/detect.js.map +1 -0
- package/dist/stacks/dotnet.d.ts +5 -0
- package/dist/stacks/dotnet.d.ts.map +1 -0
- package/dist/stacks/dotnet.js +68 -0
- package/dist/stacks/dotnet.js.map +1 -0
- package/dist/stacks/elixir.d.ts +5 -0
- package/dist/stacks/elixir.d.ts.map +1 -0
- package/dist/stacks/elixir.js +68 -0
- package/dist/stacks/elixir.js.map +1 -0
- package/dist/stacks/go.d.ts +5 -0
- package/dist/stacks/go.d.ts.map +1 -0
- package/dist/stacks/go.js +68 -0
- package/dist/stacks/go.js.map +1 -0
- package/dist/stacks/index.d.ts +7 -0
- package/dist/stacks/index.d.ts.map +1 -0
- package/dist/stacks/index.js +84 -0
- package/dist/stacks/index.js.map +1 -0
- package/dist/stacks/java-gradle.d.ts +5 -0
- package/dist/stacks/java-gradle.d.ts.map +1 -0
- package/dist/stacks/java-gradle.js +69 -0
- package/dist/stacks/java-gradle.js.map +1 -0
- package/dist/stacks/java-maven.d.ts +5 -0
- package/dist/stacks/java-maven.d.ts.map +1 -0
- package/dist/stacks/java-maven.js +67 -0
- package/dist/stacks/java-maven.js.map +1 -0
- package/dist/stacks/kotlin.d.ts +5 -0
- package/dist/stacks/kotlin.d.ts.map +1 -0
- package/dist/stacks/kotlin.js +69 -0
- package/dist/stacks/kotlin.js.map +1 -0
- package/dist/stacks/php.d.ts +5 -0
- package/dist/stacks/php.d.ts.map +1 -0
- package/dist/stacks/php.js +68 -0
- package/dist/stacks/php.js.map +1 -0
- package/dist/stacks/python-fastapi.d.ts +5 -0
- package/dist/stacks/python-fastapi.d.ts.map +1 -0
- package/dist/stacks/python-fastapi.js +75 -0
- package/dist/stacks/python-fastapi.js.map +1 -0
- package/dist/stacks/ruby.d.ts +5 -0
- package/dist/stacks/ruby.d.ts.map +1 -0
- package/dist/stacks/ruby.js +69 -0
- package/dist/stacks/ruby.js.map +1 -0
- package/dist/stacks/rust.d.ts +5 -0
- package/dist/stacks/rust.d.ts.map +1 -0
- package/dist/stacks/rust.js +65 -0
- package/dist/stacks/rust.js.map +1 -0
- package/dist/stacks/scala-sbt.d.ts +5 -0
- package/dist/stacks/scala-sbt.d.ts.map +1 -0
- package/dist/stacks/scala-sbt.js +68 -0
- package/dist/stacks/scala-sbt.js.map +1 -0
- package/dist/stacks/schema.d.ts +91 -0
- package/dist/stacks/schema.d.ts.map +1 -0
- package/dist/stacks/schema.js +23 -0
- package/dist/stacks/schema.js.map +1 -0
- package/dist/stacks/swift.d.ts +5 -0
- package/dist/stacks/swift.d.ts.map +1 -0
- package/dist/stacks/swift.js +69 -0
- package/dist/stacks/swift.js.map +1 -0
- package/dist/stacks/typescript-react.d.ts +5 -0
- package/dist/stacks/typescript-react.d.ts.map +1 -0
- package/dist/stacks/typescript-react.js +73 -0
- package/dist/stacks/typescript-react.js.map +1 -0
- package/dist/templates/claude-md.d.ts +4 -0
- package/dist/templates/claude-md.d.ts.map +1 -0
- package/dist/templates/claude-md.js +241 -0
- package/dist/templates/claude-md.js.map +1 -0
- package/dist/templates/claude-settings.d.ts +3 -0
- package/dist/templates/claude-settings.d.ts.map +1 -0
- package/dist/templates/claude-settings.js +27 -0
- package/dist/templates/claude-settings.js.map +1 -0
- package/dist/templates/gitignore.d.ts +3 -0
- package/dist/templates/gitignore.d.ts.map +1 -0
- package/dist/templates/gitignore.js +39 -0
- package/dist/templates/gitignore.js.map +1 -0
- package/dist/templates/grill-me-skill.d.ts +2 -0
- package/dist/templates/grill-me-skill.d.ts.map +1 -0
- package/dist/templates/grill-me-skill.js +20 -0
- package/dist/templates/grill-me-skill.js.map +1 -0
- package/dist/templates/openspec-config.d.ts +3 -0
- package/dist/templates/openspec-config.d.ts.map +1 -0
- package/dist/templates/openspec-config.js +8 -0
- package/dist/templates/openspec-config.js.map +1 -0
- package/dist/types.d.ts +35 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/fs.d.ts +5 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +17 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/git.d.ts +4 -0
- package/dist/utils/git.d.ts.map +1 -0
- package/dist/utils/git.js +21 -0
- package/dist/utils/git.js.map +1 -0
- package/dist/utils/tools.d.ts +7 -0
- package/dist/utils/tools.d.ts.map +1 -0
- package/dist/utils/tools.js +82 -0
- package/dist/utils/tools.js.map +1 -0
- package/package.json +44 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const bashStack = {
|
|
2
|
+
id: 'bash',
|
|
3
|
+
label: 'Bash / Shell Script',
|
|
4
|
+
languages: ['Bash'],
|
|
5
|
+
architecture: 'Script-based / Pipeline',
|
|
6
|
+
commands: {
|
|
7
|
+
build: 'echo "No build step"',
|
|
8
|
+
test: 'bats tests/',
|
|
9
|
+
lint: 'shellcheck **/*.sh',
|
|
10
|
+
format: 'shfmt -w .',
|
|
11
|
+
},
|
|
12
|
+
errorHandling: 'set -euo pipefail + trap handlers',
|
|
13
|
+
concurrency: 'Background processes + GNU parallel',
|
|
14
|
+
permissions: [
|
|
15
|
+
'Bash(bats *)',
|
|
16
|
+
'Bash(shellcheck *)',
|
|
17
|
+
'Bash(shfmt *)',
|
|
18
|
+
'Bash(bash *)',
|
|
19
|
+
],
|
|
20
|
+
gitignorePatterns: [
|
|
21
|
+
'*.log',
|
|
22
|
+
'/tmp/',
|
|
23
|
+
],
|
|
24
|
+
openspecContext: `Tech stack: Bash / Shell scripts
|
|
25
|
+
Build: No build step
|
|
26
|
+
Testing: bats
|
|
27
|
+
Code style: shellcheck + shfmt
|
|
28
|
+
Architecture: Script-based / Pipeline
|
|
29
|
+
Error handling: set -euo pipefail + trap handlers
|
|
30
|
+
Concurrency: Background processes + GNU parallel`,
|
|
31
|
+
openspecRules: {
|
|
32
|
+
proposal: [
|
|
33
|
+
'Always include a "Non-goals" section to explicitly scope out what this change does NOT do',
|
|
34
|
+
'Include "Trade-offs" section with at least 2 alternative approaches considered',
|
|
35
|
+
'Must reference affected scripts/modules by name',
|
|
36
|
+
'Keep proposals under 800 words',
|
|
37
|
+
],
|
|
38
|
+
design: [
|
|
39
|
+
'Must include a dependency diagram (ASCII or mermaid) showing script relationships',
|
|
40
|
+
'Must specify public API surface (functions, script arguments, environment variables)',
|
|
41
|
+
'Must address error handling strategy for the change',
|
|
42
|
+
'Must address concurrency implications if applicable',
|
|
43
|
+
],
|
|
44
|
+
specs: [
|
|
45
|
+
'Each spec must be independently testable',
|
|
46
|
+
'Specs must define both success and failure behaviors',
|
|
47
|
+
'Include boundary conditions and edge cases',
|
|
48
|
+
'Reference specific scripts/functions, not vague descriptions',
|
|
49
|
+
],
|
|
50
|
+
tasks: [
|
|
51
|
+
'Break tasks into chunks of max 2 hours of work',
|
|
52
|
+
'Each task must have a clear "done" definition verifiable by running a command',
|
|
53
|
+
'Tasks must follow TDD order - write test first, then implement, then refactor',
|
|
54
|
+
'Every task must include a verification command (bats / specific test file)',
|
|
55
|
+
'Mark blocking dependencies explicitly between tasks',
|
|
56
|
+
],
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
export const bashDetectionConfig = {
|
|
60
|
+
stackId: 'bash',
|
|
61
|
+
markerFiles: ['.shellcheckrc', '.bats'],
|
|
62
|
+
markerDirs: [],
|
|
63
|
+
fileExtensions: ['.sh', '.bash'],
|
|
64
|
+
priority: 30,
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=bash.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bash.js","sourceRoot":"","sources":["../../src/stacks/bash.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,SAAS,GAAiB;IACrC,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,qBAAqB;IAC5B,SAAS,EAAE,CAAC,MAAM,CAAC;IACnB,YAAY,EAAE,yBAAyB;IACvC,QAAQ,EAAE;QACR,KAAK,EAAE,sBAAsB;QAC7B,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,oBAAoB;QAC1B,MAAM,EAAE,YAAY;KACrB;IACD,aAAa,EAAE,mCAAmC;IAClD,WAAW,EAAE,qCAAqC;IAClD,WAAW,EAAE;QACX,cAAc;QACd,oBAAoB;QACpB,eAAe;QACf,cAAc;KACf;IACD,iBAAiB,EAAE;QACjB,OAAO;QACP,OAAO;KACR;IACD,eAAe,EAAE;;;;;;iDAM8B;IAC/C,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,2FAA2F;YAC3F,gFAAgF;YAChF,iDAAiD;YACjD,gCAAgC;SACjC;QACD,MAAM,EAAE;YACN,mFAAmF;YACnF,sFAAsF;YACtF,qDAAqD;YACrD,qDAAqD;SACtD;QACD,KAAK,EAAE;YACL,0CAA0C;YAC1C,sDAAsD;YACtD,4CAA4C;YAC5C,8DAA8D;SAC/D;QACD,KAAK,EAAE;YACL,gDAAgD;YAChD,+EAA+E;YAC/E,+EAA+E;YAC/E,4EAA4E;YAC5E,qDAAqD;SACtD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAoB;IAClD,OAAO,EAAE,MAAM;IACf,WAAW,EAAE,CAAC,eAAe,EAAE,OAAO,CAAC;IACvC,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;IAChC,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpp-cmake.d.ts","sourceRoot":"","sources":["../../src/stacks/cpp-cmake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,aAAa,EAAE,YAiE3B,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,eAMrC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
export const cppCmakeStack = {
|
|
2
|
+
id: 'cpp-cmake',
|
|
3
|
+
label: 'C/C++ (CMake)',
|
|
4
|
+
languages: ['C', 'C++'],
|
|
5
|
+
architecture: 'Modular / Library-based',
|
|
6
|
+
commands: {
|
|
7
|
+
build: 'cmake --build build',
|
|
8
|
+
test: 'ctest --test-dir build --output-on-failure',
|
|
9
|
+
lint: 'clang-tidy src/**/*.cpp',
|
|
10
|
+
format: 'clang-format -i src/**/*.cpp src/**/*.h',
|
|
11
|
+
},
|
|
12
|
+
errorHandling: 'C++ exceptions + error codes + std::expected (C++23)',
|
|
13
|
+
concurrency: 'std::thread + std::async + std::mutex',
|
|
14
|
+
permissions: [
|
|
15
|
+
'Bash(cmake *)',
|
|
16
|
+
'Bash(ctest *)',
|
|
17
|
+
'Bash(make *)',
|
|
18
|
+
'Bash(clang-tidy *)',
|
|
19
|
+
'Bash(clang-format *)',
|
|
20
|
+
],
|
|
21
|
+
gitignorePatterns: [
|
|
22
|
+
'/build/',
|
|
23
|
+
'*.o',
|
|
24
|
+
'*.obj',
|
|
25
|
+
'*.a',
|
|
26
|
+
'*.so',
|
|
27
|
+
'*.dylib',
|
|
28
|
+
'*.exe',
|
|
29
|
+
'CMakeCache.txt',
|
|
30
|
+
'CMakeFiles/',
|
|
31
|
+
],
|
|
32
|
+
openspecContext: `Tech stack: C/C++ with CMake build system
|
|
33
|
+
Build: cmake --build build
|
|
34
|
+
Testing: ctest --test-dir build --output-on-failure
|
|
35
|
+
Code style: clang-tidy + clang-format
|
|
36
|
+
Architecture: Modular / Library-based
|
|
37
|
+
Error handling: C++ exceptions + error codes + std::expected (C++23)
|
|
38
|
+
Concurrency: std::thread + std::async + std::mutex`,
|
|
39
|
+
openspecRules: {
|
|
40
|
+
proposal: [
|
|
41
|
+
'Always include a "Non-goals" section to explicitly scope out what this change does NOT do',
|
|
42
|
+
'Include "Trade-offs" section with at least 2 alternative approaches considered',
|
|
43
|
+
'Must reference affected libraries/targets by name',
|
|
44
|
+
'Keep proposals under 800 words',
|
|
45
|
+
],
|
|
46
|
+
design: [
|
|
47
|
+
'Must include a dependency diagram (ASCII or mermaid) showing library/target relationships',
|
|
48
|
+
'Must specify public API surface (headers, class interfaces, function signatures)',
|
|
49
|
+
'Must address error handling strategy for the change',
|
|
50
|
+
'Must address concurrency implications if applicable',
|
|
51
|
+
],
|
|
52
|
+
specs: [
|
|
53
|
+
'Each spec must be independently testable',
|
|
54
|
+
'Specs must define both success and failure behaviors',
|
|
55
|
+
'Include boundary conditions and edge cases',
|
|
56
|
+
'Reference specific classes/functions/headers, not vague descriptions',
|
|
57
|
+
],
|
|
58
|
+
tasks: [
|
|
59
|
+
'Break tasks into chunks of max 2 hours of work',
|
|
60
|
+
'Each task must have a clear "done" definition verifiable by running a command',
|
|
61
|
+
'Tasks must follow TDD order - write test first, then implement, then refactor',
|
|
62
|
+
'Every task must include a verification command (ctest / specific test target)',
|
|
63
|
+
'Mark blocking dependencies explicitly between tasks',
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
export const cppCmakeDetectionConfig = {
|
|
68
|
+
stackId: 'cpp-cmake',
|
|
69
|
+
markerFiles: ['CMakeLists.txt'],
|
|
70
|
+
markerDirs: [],
|
|
71
|
+
fileExtensions: ['.cpp', '.cc', '.c', '.h', '.hpp'],
|
|
72
|
+
priority: 10,
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=cpp-cmake.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cpp-cmake.js","sourceRoot":"","sources":["../../src/stacks/cpp-cmake.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,aAAa,GAAiB;IACzC,EAAE,EAAE,WAAW;IACf,KAAK,EAAE,eAAe;IACtB,SAAS,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC;IACvB,YAAY,EAAE,yBAAyB;IACvC,QAAQ,EAAE;QACR,KAAK,EAAE,qBAAqB;QAC5B,IAAI,EAAE,4CAA4C;QAClD,IAAI,EAAE,yBAAyB;QAC/B,MAAM,EAAE,yCAAyC;KAClD;IACD,aAAa,EAAE,sDAAsD;IACrE,WAAW,EAAE,uCAAuC;IACpD,WAAW,EAAE;QACX,eAAe;QACf,eAAe;QACf,cAAc;QACd,oBAAoB;QACpB,sBAAsB;KACvB;IACD,iBAAiB,EAAE;QACjB,SAAS;QACT,KAAK;QACL,OAAO;QACP,KAAK;QACL,MAAM;QACN,SAAS;QACT,OAAO;QACP,gBAAgB;QAChB,aAAa;KACd;IACD,eAAe,EAAE;;;;;;mDAMgC;IACjD,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,2FAA2F;YAC3F,gFAAgF;YAChF,mDAAmD;YACnD,gCAAgC;SACjC;QACD,MAAM,EAAE;YACN,2FAA2F;YAC3F,kFAAkF;YAClF,qDAAqD;YACrD,qDAAqD;SACtD;QACD,KAAK,EAAE;YACL,0CAA0C;YAC1C,sDAAsD;YACtD,4CAA4C;YAC5C,sEAAsE;SACvE;QACD,KAAK,EAAE;YACL,gDAAgD;YAChD,+EAA+E;YAC/E,+EAA+E;YAC/E,+EAA+E;YAC/E,qDAAqD;SACtD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAoB;IACtD,OAAO,EAAE,WAAW;IACpB,WAAW,EAAE,CAAC,gBAAgB,CAAC;IAC/B,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC;IACnD,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DetectionConfig {
|
|
2
|
+
stackId: string;
|
|
3
|
+
markerFiles: string[];
|
|
4
|
+
markerDirs: string[];
|
|
5
|
+
fileExtensions: string[];
|
|
6
|
+
priority: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function registerDetectionConfigs(configs: DetectionConfig[]): void;
|
|
9
|
+
export declare function getDetectionConfigs(): DetectionConfig[];
|
|
10
|
+
export declare function detectStacks(targetDir: string): Promise<string[]>;
|
|
11
|
+
//# sourceMappingURL=detect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/stacks/detect.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAID,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,IAAI,CAEzE;AAED,wBAAgB,mBAAmB,IAAI,eAAe,EAAE,CAEvD;AAiFD,wBAAsB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAuBvE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { access, readdir } from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
let _configs = [];
|
|
4
|
+
export function registerDetectionConfigs(configs) {
|
|
5
|
+
_configs = configs;
|
|
6
|
+
}
|
|
7
|
+
export function getDetectionConfigs() {
|
|
8
|
+
return _configs;
|
|
9
|
+
}
|
|
10
|
+
async function exists(p) {
|
|
11
|
+
try {
|
|
12
|
+
await access(p);
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
async function detectByMarkers(targetDir, configs) {
|
|
20
|
+
const detected = new Set();
|
|
21
|
+
for (const config of configs) {
|
|
22
|
+
let found = false;
|
|
23
|
+
for (const marker of config.markerFiles) {
|
|
24
|
+
if (marker.includes('*')) {
|
|
25
|
+
try {
|
|
26
|
+
const entries = await readdir(targetDir);
|
|
27
|
+
const pattern = marker.replace('*', '');
|
|
28
|
+
if (entries.some(e => e.endsWith(pattern))) {
|
|
29
|
+
found = true;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else if (await exists(path.join(targetDir, marker))) {
|
|
38
|
+
found = true;
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (!found) {
|
|
43
|
+
for (const dir of config.markerDirs) {
|
|
44
|
+
if (await exists(path.join(targetDir, dir))) {
|
|
45
|
+
found = true;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (found) {
|
|
51
|
+
detected.add(config.stackId);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return Array.from(detected);
|
|
55
|
+
}
|
|
56
|
+
async function detectByExtensions(targetDir, configs) {
|
|
57
|
+
let entries;
|
|
58
|
+
try {
|
|
59
|
+
entries = await readdir(targetDir);
|
|
60
|
+
}
|
|
61
|
+
catch {
|
|
62
|
+
return [];
|
|
63
|
+
}
|
|
64
|
+
const extMap = new Map();
|
|
65
|
+
for (const config of configs) {
|
|
66
|
+
for (const ext of config.fileExtensions) {
|
|
67
|
+
if (!extMap.has(ext)) {
|
|
68
|
+
extMap.set(ext, config.stackId);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
const detected = new Set();
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
const ext = path.extname(entry).toLowerCase();
|
|
75
|
+
const stackId = extMap.get(ext);
|
|
76
|
+
if (stackId) {
|
|
77
|
+
detected.add(stackId);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return Array.from(detected);
|
|
81
|
+
}
|
|
82
|
+
export async function detectStacks(targetDir) {
|
|
83
|
+
try {
|
|
84
|
+
const configs = getDetectionConfigs();
|
|
85
|
+
if (configs.length === 0)
|
|
86
|
+
return [];
|
|
87
|
+
const markerResults = await detectByMarkers(targetDir, configs);
|
|
88
|
+
let detected;
|
|
89
|
+
if (markerResults.length > 0) {
|
|
90
|
+
detected = markerResults;
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
detected = await detectByExtensions(targetDir, configs);
|
|
94
|
+
}
|
|
95
|
+
const priorityMap = new Map();
|
|
96
|
+
configs.forEach((c, i) => priorityMap.set(c.stackId, c.priority * 1000 + i));
|
|
97
|
+
detected.sort((a, b) => (priorityMap.get(a) ?? 999) - (priorityMap.get(b) ?? 999));
|
|
98
|
+
return detected;
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return [];
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
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,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;QAEnF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnet.d.ts","sourceRoot":"","sources":["../../src/stacks/dotnet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,WAAW,EAAE,YA2DzB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAMnC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const dotnetStack = {
|
|
2
|
+
id: 'dotnet',
|
|
3
|
+
label: '.NET (C#)',
|
|
4
|
+
languages: ['C#'],
|
|
5
|
+
architecture: 'Clean Architecture / Onion',
|
|
6
|
+
commands: {
|
|
7
|
+
build: 'dotnet build',
|
|
8
|
+
test: 'dotnet test',
|
|
9
|
+
lint: 'dotnet format --verify-no-changes',
|
|
10
|
+
format: 'dotnet format',
|
|
11
|
+
},
|
|
12
|
+
errorHandling: 'C# exceptions + Result pattern + FluentValidation',
|
|
13
|
+
concurrency: 'C# async/await + Task + Channel + Parallel.ForEachAsync',
|
|
14
|
+
permissions: [
|
|
15
|
+
'Bash(dotnet *)',
|
|
16
|
+
'Bash(nuget *)',
|
|
17
|
+
],
|
|
18
|
+
gitignorePatterns: [
|
|
19
|
+
'/bin/',
|
|
20
|
+
'/obj/',
|
|
21
|
+
'*.user',
|
|
22
|
+
'*.suo',
|
|
23
|
+
'.vs/',
|
|
24
|
+
'*.nupkg',
|
|
25
|
+
],
|
|
26
|
+
openspecContext: `Tech stack: .NET (C#)
|
|
27
|
+
Build: dotnet build
|
|
28
|
+
Testing: dotnet test
|
|
29
|
+
Code style: dotnet format
|
|
30
|
+
Architecture: Clean Architecture / Onion
|
|
31
|
+
Error handling: C# exceptions + Result pattern + FluentValidation
|
|
32
|
+
Concurrency: C# async/await + Task + Channel + Parallel.ForEachAsync`,
|
|
33
|
+
openspecRules: {
|
|
34
|
+
proposal: [
|
|
35
|
+
'Always include a "Non-goals" section to explicitly scope out what this change does NOT do',
|
|
36
|
+
'Include "Trade-offs" section with at least 2 alternative approaches considered',
|
|
37
|
+
'Must reference affected projects/namespaces by name',
|
|
38
|
+
'Keep proposals under 800 words',
|
|
39
|
+
],
|
|
40
|
+
design: [
|
|
41
|
+
'Must include a dependency diagram (ASCII or mermaid) showing module relationships',
|
|
42
|
+
'Must specify public API surface (interfaces, class signatures)',
|
|
43
|
+
'Must address error handling strategy for the change',
|
|
44
|
+
'Must address concurrency implications if applicable',
|
|
45
|
+
],
|
|
46
|
+
specs: [
|
|
47
|
+
'Each spec must be independently testable',
|
|
48
|
+
'Specs must define both success and failure behaviors',
|
|
49
|
+
'Include boundary conditions and edge cases',
|
|
50
|
+
'Reference specific types/interfaces, not vague descriptions',
|
|
51
|
+
],
|
|
52
|
+
tasks: [
|
|
53
|
+
'Break tasks into chunks of max 2 hours of work',
|
|
54
|
+
'Each task must have a clear "done" definition verifiable by running a command',
|
|
55
|
+
'Tasks must follow TDD order - write test first, then implement, then refactor',
|
|
56
|
+
'Every task must include a verification command (dotnet test / specific test project)',
|
|
57
|
+
'Mark blocking dependencies explicitly between tasks',
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const dotnetDetectionConfig = {
|
|
62
|
+
stackId: 'dotnet',
|
|
63
|
+
markerFiles: ['*.csproj', '*.sln', '*.fsproj'],
|
|
64
|
+
markerDirs: [],
|
|
65
|
+
fileExtensions: ['.cs', '.fs'],
|
|
66
|
+
priority: 10,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=dotnet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dotnet.js","sourceRoot":"","sources":["../../src/stacks/dotnet.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,WAAW;IAClB,SAAS,EAAE,CAAC,IAAI,CAAC;IACjB,YAAY,EAAE,4BAA4B;IAC1C,QAAQ,EAAE;QACR,KAAK,EAAE,cAAc;QACrB,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,mCAAmC;QACzC,MAAM,EAAE,eAAe;KACxB;IACD,aAAa,EAAE,mDAAmD;IAClE,WAAW,EAAE,yDAAyD;IACtE,WAAW,EAAE;QACX,gBAAgB;QAChB,eAAe;KAChB;IACD,iBAAiB,EAAE;QACjB,OAAO;QACP,OAAO;QACP,QAAQ;QACR,OAAO;QACP,MAAM;QACN,SAAS;KACV;IACD,eAAe,EAAE;;;;;;qEAMkD;IACnE,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,2FAA2F;YAC3F,gFAAgF;YAChF,qDAAqD;YACrD,gCAAgC;SACjC;QACD,MAAM,EAAE;YACN,mFAAmF;YACnF,gEAAgE;YAChE,qDAAqD;YACrD,qDAAqD;SACtD;QACD,KAAK,EAAE;YACL,0CAA0C;YAC1C,sDAAsD;YACtD,4CAA4C;YAC5C,6DAA6D;SAC9D;QACD,KAAK,EAAE;YACL,gDAAgD;YAChD,+EAA+E;YAC/E,+EAA+E;YAC/E,sFAAsF;YACtF,qDAAqD;SACtD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAoB;IACpD,OAAO,EAAE,QAAQ;IACjB,WAAW,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,CAAC;IAC9C,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;IAC9B,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elixir.d.ts","sourceRoot":"","sources":["../../src/stacks/elixir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD,eAAO,MAAM,WAAW,EAAE,YA2DzB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,eAMnC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const elixirStack = {
|
|
2
|
+
id: 'elixir',
|
|
3
|
+
label: 'Elixir (Mix)',
|
|
4
|
+
languages: ['Elixir'],
|
|
5
|
+
architecture: 'OTP / Supervision tree / GenServer',
|
|
6
|
+
commands: {
|
|
7
|
+
build: 'mix compile',
|
|
8
|
+
test: 'mix test',
|
|
9
|
+
lint: 'mix credo --strict',
|
|
10
|
+
format: 'mix format',
|
|
11
|
+
},
|
|
12
|
+
errorHandling: 'Elixir pattern matching + {:ok, _}/{:error, _} tuples + supervisors',
|
|
13
|
+
concurrency: 'Elixir processes + GenServer + Task + OTP supervision trees',
|
|
14
|
+
permissions: [
|
|
15
|
+
'Bash(mix *)',
|
|
16
|
+
'Bash(iex *)',
|
|
17
|
+
'Bash(elixir *)',
|
|
18
|
+
],
|
|
19
|
+
gitignorePatterns: [
|
|
20
|
+
'/_build/',
|
|
21
|
+
'/deps/',
|
|
22
|
+
'/cover/',
|
|
23
|
+
'*.ez',
|
|
24
|
+
'.elixir_ls/',
|
|
25
|
+
],
|
|
26
|
+
openspecContext: `Tech stack: Elixir (Mix)
|
|
27
|
+
Build: mix compile
|
|
28
|
+
Testing: mix test
|
|
29
|
+
Code style: mix credo --strict + mix format
|
|
30
|
+
Architecture: OTP / Supervision tree / GenServer
|
|
31
|
+
Error handling: Elixir pattern matching + {:ok, _}/{:error, _} tuples + supervisors
|
|
32
|
+
Concurrency: Elixir processes + GenServer + Task + OTP supervision trees`,
|
|
33
|
+
openspecRules: {
|
|
34
|
+
proposal: [
|
|
35
|
+
'Always include a "Non-goals" section to explicitly scope out what this change does NOT do',
|
|
36
|
+
'Include "Trade-offs" section with at least 2 alternative approaches considered',
|
|
37
|
+
'Must reference affected applications/modules by name',
|
|
38
|
+
'Keep proposals under 800 words',
|
|
39
|
+
],
|
|
40
|
+
design: [
|
|
41
|
+
'Must include a dependency diagram (ASCII or mermaid) showing module relationships',
|
|
42
|
+
'Must specify public API surface (module functions, GenServer callbacks)',
|
|
43
|
+
'Must address error handling strategy for the change',
|
|
44
|
+
'Must address supervision tree implications if applicable',
|
|
45
|
+
],
|
|
46
|
+
specs: [
|
|
47
|
+
'Each spec must be independently testable',
|
|
48
|
+
'Specs must define both success and failure behaviors',
|
|
49
|
+
'Include boundary conditions and edge cases',
|
|
50
|
+
'Reference specific modules/functions, not vague descriptions',
|
|
51
|
+
],
|
|
52
|
+
tasks: [
|
|
53
|
+
'Break tasks into chunks of max 2 hours of work',
|
|
54
|
+
'Each task must have a clear "done" definition verifiable by running a command',
|
|
55
|
+
'Tasks must follow TDD order - write test first, then implement, then refactor',
|
|
56
|
+
'Every task must include a verification command (mix test / specific test module)',
|
|
57
|
+
'Mark blocking dependencies explicitly between tasks',
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const elixirDetectionConfig = {
|
|
62
|
+
stackId: 'elixir',
|
|
63
|
+
markerFiles: ['mix.exs', 'mix.lock'],
|
|
64
|
+
markerDirs: [],
|
|
65
|
+
fileExtensions: ['.ex', '.exs'],
|
|
66
|
+
priority: 10,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=elixir.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elixir.js","sourceRoot":"","sources":["../../src/stacks/elixir.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,WAAW,GAAiB;IACvC,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,CAAC,QAAQ,CAAC;IACrB,YAAY,EAAE,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AAiB,EAAE,eAM/B,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export const goStack = {
|
|
2
|
+
id: 'go',
|
|
3
|
+
label: 'Go',
|
|
4
|
+
languages: ['Go'],
|
|
5
|
+
architecture: 'Clean Architecture / Hexagonal (Ports & Adapters)',
|
|
6
|
+
commands: {
|
|
7
|
+
build: 'go build ./...',
|
|
8
|
+
test: 'go test ./...',
|
|
9
|
+
lint: 'golangci-lint run',
|
|
10
|
+
format: 'gofmt -w .',
|
|
11
|
+
},
|
|
12
|
+
errorHandling: 'Go explicit error returns (if err != nil)',
|
|
13
|
+
concurrency: 'Go goroutines + channels',
|
|
14
|
+
permissions: [
|
|
15
|
+
'Bash(go test *)',
|
|
16
|
+
'Bash(go build *)',
|
|
17
|
+
'Bash(go vet *)',
|
|
18
|
+
'Bash(golangci-lint *)',
|
|
19
|
+
'Bash(gofmt *)',
|
|
20
|
+
],
|
|
21
|
+
gitignorePatterns: [
|
|
22
|
+
'/bin/',
|
|
23
|
+
'/dist/',
|
|
24
|
+
'/vendor/',
|
|
25
|
+
],
|
|
26
|
+
openspecContext: `Tech stack: Go backend services
|
|
27
|
+
Build: go build
|
|
28
|
+
Testing: go test
|
|
29
|
+
Code style: gofmt + golangci-lint
|
|
30
|
+
Architecture: Clean Architecture / Hexagonal (ports & adapters)
|
|
31
|
+
Error handling: Go explicit error returns
|
|
32
|
+
Concurrency: Go goroutines + channels`,
|
|
33
|
+
openspecRules: {
|
|
34
|
+
proposal: [
|
|
35
|
+
'Always include a "Non-goals" section to explicitly scope out what this change does NOT do',
|
|
36
|
+
'Include "Trade-offs" section with at least 2 alternative approaches considered',
|
|
37
|
+
'Must reference affected packages by name',
|
|
38
|
+
'Keep proposals under 800 words',
|
|
39
|
+
],
|
|
40
|
+
design: [
|
|
41
|
+
'Must include a dependency diagram (ASCII or mermaid) showing package relationships',
|
|
42
|
+
'Must specify public API surface (interfaces, exported function signatures)',
|
|
43
|
+
'Must address error handling strategy for the change',
|
|
44
|
+
'Must address concurrency implications if applicable',
|
|
45
|
+
],
|
|
46
|
+
specs: [
|
|
47
|
+
'Each spec must be independently testable',
|
|
48
|
+
'Specs must define both success and failure behaviors',
|
|
49
|
+
'Include boundary conditions and edge cases',
|
|
50
|
+
'Reference specific interfaces/types, not vague descriptions',
|
|
51
|
+
],
|
|
52
|
+
tasks: [
|
|
53
|
+
'Break tasks into chunks of max 2 hours of work',
|
|
54
|
+
'Each task must have a clear "done" definition verifiable by running a command',
|
|
55
|
+
'Tasks must follow TDD order - write test first, then implement, then refactor',
|
|
56
|
+
'Every task must include a verification command (go test / specific test function)',
|
|
57
|
+
'Mark blocking dependencies explicitly between tasks',
|
|
58
|
+
],
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const goDetectionConfig = {
|
|
62
|
+
stackId: 'go',
|
|
63
|
+
markerFiles: ['go.mod', 'go.sum'],
|
|
64
|
+
markerDirs: [],
|
|
65
|
+
fileExtensions: ['.go'],
|
|
66
|
+
priority: 10,
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=go.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"go.js","sourceRoot":"","sources":["../../src/stacks/go.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,OAAO,GAAiB;IACnC,EAAE,EAAE,IAAI;IACR,KAAK,EAAE,IAAI;IACX,SAAS,EAAE,CAAC,IAAI,CAAC;IACjB,YAAY,EAAE,mDAAmD;IACjE,QAAQ,EAAE;QACR,KAAK,EAAE,gBAAgB;QACvB,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE,YAAY;KACrB;IACD,aAAa,EAAE,2CAA2C;IAC1D,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE;QACX,iBAAiB;QACjB,kBAAkB;QAClB,gBAAgB;QAChB,uBAAuB;QACvB,eAAe;KAChB;IACD,iBAAiB,EAAE;QACjB,OAAO;QACP,QAAQ;QACR,UAAU;KACX;IACD,eAAe,EAAE;;;;;;sCAMmB;IACpC,aAAa,EAAE;QACb,QAAQ,EAAE;YACR,2FAA2F;YAC3F,gFAAgF;YAChF,0CAA0C;YAC1C,gCAAgC;SACjC;QACD,MAAM,EAAE;YACN,oFAAoF;YACpF,4EAA4E;YAC5E,qDAAqD;YACrD,qDAAqD;SACtD;QACD,KAAK,EAAE;YACL,0CAA0C;YAC1C,sDAAsD;YACtD,4CAA4C;YAC5C,6DAA6D;SAC9D;QACD,KAAK,EAAE;YACL,gDAAgD;YAChD,+EAA+E;YAC/E,+EAA+E;YAC/E,mFAAmF;YACnF,qDAAqD;SACtD;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAoB;IAChD,OAAO,EAAE,IAAI;IACb,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACjC,UAAU,EAAE,EAAE;IACd,cAAc,EAAE,CAAC,KAAK,CAAC;IACvB,QAAQ,EAAE,EAAE;CACb,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StackProfile } from '../types.js';
|
|
2
|
+
import type { DetectionConfig } from './detect.js';
|
|
3
|
+
export declare function getBuiltinStacks(): StackProfile[];
|
|
4
|
+
export declare function getStack(id: string): StackProfile | undefined;
|
|
5
|
+
export declare function getDetectionConfigs(): DetectionConfig[];
|
|
6
|
+
export declare function loadCustomStack(filePath: string): Promise<StackProfile>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyCnD,wBAAgB,gBAAgB,IAAI,YAAY,EAAE,CAEjD;AAED,wBAAgB,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE7D;AAED,wBAAgB,mBAAmB,IAAI,eAAe,EAAE,CAEvD;AAED,wBAAsB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAoB7E"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { parse as parseYAML } from 'yaml';
|
|
3
|
+
import { stackProfileSchema } from './schema.js';
|
|
4
|
+
import { rustStack, rustDetectionConfig } from './rust.js';
|
|
5
|
+
import { goStack, goDetectionConfig } from './go.js';
|
|
6
|
+
import { typescriptReactStack, typescriptReactDetectionConfig } from './typescript-react.js';
|
|
7
|
+
import { pythonFastapiStack, pythonFastapiDetectionConfig } from './python-fastapi.js';
|
|
8
|
+
import { bashStack, bashDetectionConfig } from './bash.js';
|
|
9
|
+
import { javaMavenStack, javaMavenDetectionConfig } from './java-maven.js';
|
|
10
|
+
import { javaGradleStack, javaGradleDetectionConfig } from './java-gradle.js';
|
|
11
|
+
import { cppCmakeStack, cppCmakeDetectionConfig } from './cpp-cmake.js';
|
|
12
|
+
import { rubyStack, rubyDetectionConfig } from './ruby.js';
|
|
13
|
+
import { phpStack, phpDetectionConfig } from './php.js';
|
|
14
|
+
import { kotlinStack, kotlinDetectionConfig } from './kotlin.js';
|
|
15
|
+
import { swiftStack, swiftDetectionConfig } from './swift.js';
|
|
16
|
+
import { elixirStack, elixirDetectionConfig } from './elixir.js';
|
|
17
|
+
import { scalaSbtStack, scalaSbtDetectionConfig } from './scala-sbt.js';
|
|
18
|
+
import { dotnetStack, dotnetDetectionConfig } from './dotnet.js';
|
|
19
|
+
import { registerDetectionConfigs } from './detect.js';
|
|
20
|
+
const BUILTIN_STACKS = [
|
|
21
|
+
rustStack,
|
|
22
|
+
goStack,
|
|
23
|
+
typescriptReactStack,
|
|
24
|
+
pythonFastapiStack,
|
|
25
|
+
bashStack,
|
|
26
|
+
javaMavenStack,
|
|
27
|
+
javaGradleStack,
|
|
28
|
+
cppCmakeStack,
|
|
29
|
+
rubyStack,
|
|
30
|
+
phpStack,
|
|
31
|
+
kotlinStack,
|
|
32
|
+
swiftStack,
|
|
33
|
+
elixirStack,
|
|
34
|
+
scalaSbtStack,
|
|
35
|
+
dotnetStack,
|
|
36
|
+
];
|
|
37
|
+
const DETECTION_CONFIGS = [
|
|
38
|
+
rustDetectionConfig,
|
|
39
|
+
goDetectionConfig,
|
|
40
|
+
typescriptReactDetectionConfig,
|
|
41
|
+
pythonFastapiDetectionConfig,
|
|
42
|
+
bashDetectionConfig,
|
|
43
|
+
javaMavenDetectionConfig,
|
|
44
|
+
javaGradleDetectionConfig,
|
|
45
|
+
cppCmakeDetectionConfig,
|
|
46
|
+
rubyDetectionConfig,
|
|
47
|
+
phpDetectionConfig,
|
|
48
|
+
kotlinDetectionConfig,
|
|
49
|
+
swiftDetectionConfig,
|
|
50
|
+
elixirDetectionConfig,
|
|
51
|
+
scalaSbtDetectionConfig,
|
|
52
|
+
dotnetDetectionConfig,
|
|
53
|
+
];
|
|
54
|
+
// Register detection configs at module load time
|
|
55
|
+
registerDetectionConfigs(DETECTION_CONFIGS);
|
|
56
|
+
export function getBuiltinStacks() {
|
|
57
|
+
return BUILTIN_STACKS;
|
|
58
|
+
}
|
|
59
|
+
export function getStack(id) {
|
|
60
|
+
return BUILTIN_STACKS.find((s) => s.id === id);
|
|
61
|
+
}
|
|
62
|
+
export function getDetectionConfigs() {
|
|
63
|
+
return DETECTION_CONFIGS;
|
|
64
|
+
}
|
|
65
|
+
export async function loadCustomStack(filePath) {
|
|
66
|
+
const raw = await readFile(filePath, 'utf-8');
|
|
67
|
+
const ext = filePath.toLowerCase();
|
|
68
|
+
let data;
|
|
69
|
+
if (ext.endsWith('.json')) {
|
|
70
|
+
data = JSON.parse(raw);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
data = parseYAML(raw);
|
|
74
|
+
}
|
|
75
|
+
const result = stackProfileSchema.safeParse(data);
|
|
76
|
+
if (!result.success) {
|
|
77
|
+
const issues = result.error.issues
|
|
78
|
+
.map((i) => ` - ${i.path.join('.')}: ${i.message}`)
|
|
79
|
+
.join('\n');
|
|
80
|
+
throw new Error(`Invalid stack profile in ${filePath}:\n${issues}`);
|
|
81
|
+
}
|
|
82
|
+
return result.data;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,qBAAqB,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,eAAe,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM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