heymark 1.0.2 → 1.1.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/README.md +226 -226
- package/package.json +57 -57
- package/scripts/lib/config.js +73 -71
- package/scripts/lib/parser.js +82 -82
- package/scripts/lib/repo.js +80 -76
- package/scripts/sync.js +239 -237
- package/scripts/tools/claude.js +42 -42
- package/scripts/tools/codex.js +41 -24
- package/scripts/tools/copilot.js +41 -48
- package/scripts/tools/cursor.js +41 -41
package/scripts/tools/copilot.js
CHANGED
|
@@ -1,48 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
return cleaned;
|
|
47
|
-
},
|
|
48
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
name: "GitHub Copilot",
|
|
8
|
+
output: ".github/instructions/*.instructions.md",
|
|
9
|
+
|
|
10
|
+
generate(rules, projectRoot) {
|
|
11
|
+
const destDir = path.join(projectRoot, ".github", "instructions");
|
|
12
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
13
|
+
|
|
14
|
+
for (const rule of rules) {
|
|
15
|
+
const globs = rule.globs ? rule.globs.split(",").map((g) => g.trim()) : ["**"];
|
|
16
|
+
|
|
17
|
+
const applyToLines = globs.map((g) => ` - "${g}"`).join("\n");
|
|
18
|
+
const header = `applyTo:\n${applyToLines}\n---`;
|
|
19
|
+
|
|
20
|
+
const content = header + "\n\n" + rule.body + "\n";
|
|
21
|
+
fs.writeFileSync(path.join(destDir, `${rule.name}.instructions.md`), content);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return rules.length;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
clean(ruleNames, projectRoot) {
|
|
28
|
+
const cleaned = [];
|
|
29
|
+
const destDir = path.join(projectRoot, ".github", "instructions");
|
|
30
|
+
|
|
31
|
+
for (const name of ruleNames) {
|
|
32
|
+
const filePath = path.join(destDir, `${name}.instructions.md`);
|
|
33
|
+
if (fs.existsSync(filePath)) {
|
|
34
|
+
fs.unlinkSync(filePath);
|
|
35
|
+
cleaned.push(path.join(".github", "instructions", `${name}.instructions.md`));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return cleaned;
|
|
40
|
+
},
|
|
41
|
+
};
|
package/scripts/tools/cursor.js
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path");
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
name: "Cursor",
|
|
8
|
+
output: ".cursor/rules/*.mdc",
|
|
9
|
+
|
|
10
|
+
generate(rules, projectRoot) {
|
|
11
|
+
const destDir = path.join(projectRoot, ".cursor", "rules");
|
|
12
|
+
fs.mkdirSync(destDir, { recursive: true });
|
|
13
|
+
|
|
14
|
+
for (const rule of rules) {
|
|
15
|
+
const lines = ["---", `description: "${rule.description}"`];
|
|
16
|
+
if (rule.globs) lines.push(`globs: "${rule.globs}"`);
|
|
17
|
+
lines.push(`alwaysApply: ${rule.alwaysApply}`);
|
|
18
|
+
lines.push("---");
|
|
19
|
+
|
|
20
|
+
const content = lines.join("\n") + "\n\n" + rule.body + "\n";
|
|
21
|
+
fs.writeFileSync(path.join(destDir, `${rule.name}.mdc`), content);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return rules.length;
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
clean(ruleNames, projectRoot) {
|
|
28
|
+
const cleaned = [];
|
|
29
|
+
const destDir = path.join(projectRoot, ".cursor", "rules");
|
|
30
|
+
|
|
31
|
+
for (const name of ruleNames) {
|
|
32
|
+
const filePath = path.join(destDir, `${name}.mdc`);
|
|
33
|
+
if (fs.existsSync(filePath)) {
|
|
34
|
+
fs.unlinkSync(filePath);
|
|
35
|
+
cleaned.push(path.join(".cursor", "rules", `${name}.mdc`));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return cleaned;
|
|
40
|
+
},
|
|
41
|
+
};
|