dlw-machine-setup 0.1.0 → 0.2.0
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/bin/installer.js +14 -74
- package/package.json +1 -1
package/bin/installer.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
var __create = Object.create;
|
|
4
3
|
var __defProp = Object.defineProperty;
|
|
@@ -3261,42 +3260,42 @@ var personas_default = {
|
|
|
3261
3260
|
id: "sapui5-developer",
|
|
3262
3261
|
name: "SAPUI5 Developer",
|
|
3263
3262
|
description: "Frontend development with SAP UI5 and Fiori",
|
|
3264
|
-
domains: ["SAPUI5"
|
|
3263
|
+
domains: ["SAPUI5"],
|
|
3265
3264
|
mcpServers: ["azure-devops", "context7", "playwright", "@ui5/mcp-server"]
|
|
3266
3265
|
},
|
|
3267
3266
|
{
|
|
3268
3267
|
id: "cap-developer",
|
|
3269
3268
|
name: "CAP Developer",
|
|
3270
3269
|
description: "Backend development with SAP Cloud Application Programming model",
|
|
3271
|
-
domains: ["CAP"
|
|
3270
|
+
domains: ["CAP"],
|
|
3272
3271
|
mcpServers: ["azure-devops", "context7", "cds-mcp"]
|
|
3273
3272
|
},
|
|
3274
3273
|
{
|
|
3275
3274
|
id: "abap-developer",
|
|
3276
3275
|
name: "ABAP Developer",
|
|
3277
3276
|
description: "ABAP and SAP backend development",
|
|
3278
|
-
domains: ["ABAP"
|
|
3277
|
+
domains: ["ABAP"],
|
|
3279
3278
|
mcpServers: ["azure-devops", "context7", "abap", "sap-researcher"]
|
|
3280
3279
|
},
|
|
3281
3280
|
{
|
|
3282
3281
|
id: "btp-developer",
|
|
3283
3282
|
name: "BTP Developer",
|
|
3284
3283
|
description: "SAP Business Technology Platform development",
|
|
3285
|
-
domains: ["BTP"
|
|
3284
|
+
domains: ["BTP"],
|
|
3286
3285
|
mcpServers: ["azure-devops", "context7"]
|
|
3287
3286
|
},
|
|
3288
3287
|
{
|
|
3289
3288
|
id: "sap-dm-developer",
|
|
3290
3289
|
name: "SAP Digital Manufacturing Developer",
|
|
3291
3290
|
description: "SAP Digital Manufacturing development",
|
|
3292
|
-
domains: ["SAP_DM"
|
|
3291
|
+
domains: ["SAP_DM"],
|
|
3293
3292
|
mcpServers: ["azure-devops", "context7"]
|
|
3294
3293
|
},
|
|
3295
3294
|
{
|
|
3296
3295
|
id: "forms-developer",
|
|
3297
3296
|
name: "Forms Developer",
|
|
3298
3297
|
description: "SAP Forms development",
|
|
3299
|
-
domains: ["FORMS"
|
|
3298
|
+
domains: ["FORMS"],
|
|
3300
3299
|
mcpServers: ["azure-devops", "context7"]
|
|
3301
3300
|
}
|
|
3302
3301
|
]
|
|
@@ -3773,51 +3772,6 @@ function buildMCPConfiguration(selectedItems, baseMcpServers2) {
|
|
|
3773
3772
|
var import_fs4 = require("fs");
|
|
3774
3773
|
var import_path4 = require("path");
|
|
3775
3774
|
var CONTEXTS_DIR = (0, import_path4.join)(process.cwd(), "contexts");
|
|
3776
|
-
function stripFrontmatter(content) {
|
|
3777
|
-
const match = content.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n*/);
|
|
3778
|
-
return match ? content.slice(match[0].length) : content;
|
|
3779
|
-
}
|
|
3780
|
-
function collectMarkdownFilesRecursive(dir, basePath, result) {
|
|
3781
|
-
const entries = (0, import_fs4.readdirSync)(dir, { withFileTypes: true });
|
|
3782
|
-
for (const entry of entries) {
|
|
3783
|
-
const fullPath = (0, import_path4.join)(dir, entry.name);
|
|
3784
|
-
const relPath = (0, import_path4.join)(basePath, entry.name);
|
|
3785
|
-
if (entry.isDirectory()) {
|
|
3786
|
-
collectMarkdownFilesRecursive(fullPath, relPath, result);
|
|
3787
|
-
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
3788
|
-
result.push({
|
|
3789
|
-
relativePath: relPath,
|
|
3790
|
-
content: stripFrontmatter((0, import_fs4.readFileSync)(fullPath, "utf-8")),
|
|
3791
|
-
priority: 1
|
|
3792
|
-
});
|
|
3793
|
-
}
|
|
3794
|
-
}
|
|
3795
|
-
}
|
|
3796
|
-
function collectInstructionFiles(domains) {
|
|
3797
|
-
const result = /* @__PURE__ */ new Map();
|
|
3798
|
-
for (const domain of domains) {
|
|
3799
|
-
const domainPath = (0, import_path4.join)(CONTEXTS_DIR, domain.toUpperCase());
|
|
3800
|
-
if (!(0, import_fs4.existsSync)(domainPath)) continue;
|
|
3801
|
-
const files = [];
|
|
3802
|
-
const instructionsMd = (0, import_path4.join)(domainPath, "core", "instructions.md");
|
|
3803
|
-
if ((0, import_fs4.existsSync)(instructionsMd)) {
|
|
3804
|
-
files.push({
|
|
3805
|
-
relativePath: "core/instructions.md",
|
|
3806
|
-
content: stripFrontmatter((0, import_fs4.readFileSync)(instructionsMd, "utf-8")),
|
|
3807
|
-
priority: 0
|
|
3808
|
-
});
|
|
3809
|
-
}
|
|
3810
|
-
const instructionsDir = (0, import_path4.join)(domainPath, "core", "instructions");
|
|
3811
|
-
if ((0, import_fs4.existsSync)(instructionsDir)) {
|
|
3812
|
-
collectMarkdownFilesRecursive(instructionsDir, "core/instructions", files);
|
|
3813
|
-
}
|
|
3814
|
-
files.sort((a, b) => a.priority - b.priority || a.relativePath.localeCompare(b.relativePath));
|
|
3815
|
-
if (files.length > 0) {
|
|
3816
|
-
result.set(domain, files);
|
|
3817
|
-
}
|
|
3818
|
-
}
|
|
3819
|
-
return result;
|
|
3820
|
-
}
|
|
3821
3775
|
function buildMCPSection(mcpConfig) {
|
|
3822
3776
|
const entries = Object.entries(mcpConfig);
|
|
3823
3777
|
if (entries.length === 0) return "";
|
|
@@ -3870,7 +3824,7 @@ function buildContextRefsSection(domains) {
|
|
|
3870
3824
|
lines2.push(``);
|
|
3871
3825
|
return lines2.join("\n");
|
|
3872
3826
|
}
|
|
3873
|
-
function buildCombinedInstructions(domains,
|
|
3827
|
+
function buildCombinedInstructions(domains, mcpConfig) {
|
|
3874
3828
|
const lines2 = [
|
|
3875
3829
|
`# AI Development Instructions`,
|
|
3876
3830
|
``,
|
|
@@ -3881,47 +3835,33 @@ function buildCombinedInstructions(domains, instructionFiles, mcpConfig) {
|
|
|
3881
3835
|
if (mcpConfig && Object.keys(mcpConfig).length > 0) {
|
|
3882
3836
|
lines2.push(buildMCPSection(mcpConfig));
|
|
3883
3837
|
}
|
|
3884
|
-
for (const domain of domains) {
|
|
3885
|
-
const files = instructionFiles.get(domain);
|
|
3886
|
-
if (!files || files.length === 0) continue;
|
|
3887
|
-
lines2.push(`## ${domain.toUpperCase()}`);
|
|
3888
|
-
lines2.push(``);
|
|
3889
|
-
for (const file of files) {
|
|
3890
|
-
lines2.push(file.content.trim());
|
|
3891
|
-
lines2.push(``);
|
|
3892
|
-
}
|
|
3893
|
-
}
|
|
3894
3838
|
return lines2.join("\n");
|
|
3895
3839
|
}
|
|
3896
3840
|
async function setupInstructions(config) {
|
|
3897
3841
|
const { domains, agent, mcpConfig } = config;
|
|
3898
|
-
const instructionFiles = collectInstructionFiles(domains);
|
|
3899
3842
|
switch (agent) {
|
|
3900
3843
|
case "claude-code": {
|
|
3901
|
-
const
|
|
3902
|
-
|
|
3903
|
-
(0, import_fs4.writeFileSync)(claudeMdPath, combinedContent, "utf-8");
|
|
3844
|
+
const content = buildCombinedInstructions(domains, mcpConfig);
|
|
3845
|
+
(0, import_fs4.writeFileSync)((0, import_path4.join)(process.cwd(), "CLAUDE.md"), content, "utf-8");
|
|
3904
3846
|
break;
|
|
3905
3847
|
}
|
|
3906
3848
|
case "github-copilot": {
|
|
3907
3849
|
const instructionsDir = (0, import_path4.join)(process.cwd(), ".github", "instructions");
|
|
3908
3850
|
if (!(0, import_fs4.existsSync)(instructionsDir)) (0, import_fs4.mkdirSync)(instructionsDir, { recursive: true });
|
|
3909
|
-
const
|
|
3851
|
+
const body = buildCombinedInstructions(domains, mcpConfig);
|
|
3910
3852
|
const withFrontmatter = `---
|
|
3911
3853
|
applyTo: "**"
|
|
3912
3854
|
---
|
|
3913
3855
|
|
|
3914
|
-
${
|
|
3915
|
-
|
|
3916
|
-
(0, import_fs4.writeFileSync)(filePath, withFrontmatter, "utf-8");
|
|
3856
|
+
${body}`;
|
|
3857
|
+
(0, import_fs4.writeFileSync)((0, import_path4.join)(instructionsDir, `instructions.instructions.md`), withFrontmatter, "utf-8");
|
|
3917
3858
|
break;
|
|
3918
3859
|
}
|
|
3919
3860
|
case "cursor": {
|
|
3920
3861
|
const cursorDir = (0, import_path4.join)(process.cwd(), ".cursor", "rules");
|
|
3921
3862
|
if (!(0, import_fs4.existsSync)(cursorDir)) (0, import_fs4.mkdirSync)(cursorDir, { recursive: true });
|
|
3922
|
-
const
|
|
3923
|
-
|
|
3924
|
-
(0, import_fs4.writeFileSync)(rulesPath, combinedBody, "utf-8");
|
|
3863
|
+
const body = buildCombinedInstructions(domains, mcpConfig);
|
|
3864
|
+
(0, import_fs4.writeFileSync)((0, import_path4.join)(cursorDir, `instructions.mdc`), body, "utf-8");
|
|
3925
3865
|
break;
|
|
3926
3866
|
}
|
|
3927
3867
|
default:
|