memorix 0.6.1 → 0.6.2
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/cli/index.js +17 -4
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1826,6 +1826,12 @@ var init_kiro = __esm({
|
|
|
1826
1826
|
return rules.map((rule, i) => {
|
|
1827
1827
|
const fm = {};
|
|
1828
1828
|
if (rule.description) fm.description = rule.description;
|
|
1829
|
+
if (rule.paths && rule.paths.length > 0) {
|
|
1830
|
+
fm.inclusion = "fileMatch";
|
|
1831
|
+
fm.fileMatchPattern = rule.paths.length === 1 ? rule.paths[0] : rule.paths;
|
|
1832
|
+
} else if (rule.alwaysApply) {
|
|
1833
|
+
fm.inclusion = "always";
|
|
1834
|
+
}
|
|
1829
1835
|
const fileName = rule.id.replace(/^kiro:/, "").replace(/[^a-zA-Z0-9-_]/g, "-") || `rule-${i}`;
|
|
1830
1836
|
const body = Object.keys(fm).length > 0 ? matter7.stringify(rule.content, fm) : rule.content;
|
|
1831
1837
|
return {
|
|
@@ -1838,15 +1844,22 @@ var init_kiro = __esm({
|
|
|
1838
1844
|
const { data, content: body } = matter7(content);
|
|
1839
1845
|
const trimmed = body.trim();
|
|
1840
1846
|
if (!trimmed) return [];
|
|
1841
|
-
const
|
|
1842
|
-
const alwaysApply =
|
|
1847
|
+
const inclusion = data.inclusion ?? "always";
|
|
1848
|
+
const alwaysApply = inclusion === "always" || inclusion === "auto";
|
|
1849
|
+
let paths;
|
|
1850
|
+
if (inclusion === "fileMatch" && data.fileMatchPattern) {
|
|
1851
|
+
paths = Array.isArray(data.fileMatchPattern) ? data.fileMatchPattern : [data.fileMatchPattern];
|
|
1852
|
+
}
|
|
1853
|
+
let scope = "project";
|
|
1854
|
+
if (alwaysApply) scope = "global";
|
|
1855
|
+
else if (paths && paths.length > 0) scope = "path-specific";
|
|
1843
1856
|
return [{
|
|
1844
1857
|
id: generateRuleId("kiro", filePath),
|
|
1845
1858
|
content: trimmed,
|
|
1846
1859
|
description: data.description,
|
|
1847
1860
|
source: "kiro",
|
|
1848
|
-
scope
|
|
1849
|
-
paths
|
|
1861
|
+
scope,
|
|
1862
|
+
paths,
|
|
1850
1863
|
alwaysApply,
|
|
1851
1864
|
priority: alwaysApply ? 10 : 5,
|
|
1852
1865
|
hash: hashContent(trimmed)
|