@shrkcrft/presets 0.1.0-alpha.17 → 0.1.0-alpha.18

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.
@@ -1 +1 @@
1
- {"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/registry/recommend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,OAAO,EAAE,iBAAiB,GACzB,qBAAqB,EAAE,CA2CzB"}
1
+ {"version":3,"file":"recommend.d.ts","sourceRoot":"","sources":["../../src/registry/recommend.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,SAAS,OAAO,EAAE,EAC3B,OAAO,EAAE,iBAAiB,GACzB,qBAAqB,EAAE,CA8CzB"}
@@ -44,14 +44,18 @@ export function recommendPresets(presets, options) {
44
44
  }
45
45
  if (dq)
46
46
  continue;
47
+ // A targeted preset (it declares `appliesTo` requirements) that matched
48
+ // NONE of them is not a recommendation. Without this guard a vanilla JS
49
+ // repo gets every Angular preset, each "recommended" with the sole reason
50
+ // `missing profile: has-angular` — the agent then adopts framework
51
+ // conventions that don't apply. Universal presets (no `appliesTo`) survive.
52
+ if ((preset.appliesTo?.length ?? 0) > 0 && matchedCount === 0)
53
+ continue;
47
54
  if ((preset.appliesTo?.length ?? 0) === 0 && reasons.length === 0) {
48
55
  reasons.push('universal preset');
49
56
  }
50
57
  const confidence = score >= 15 ? 'high' : score >= 9 ? 'medium' : 'low';
51
58
  out.push({ preset, score, confidence, reasons });
52
- // matchedCount is reserved for future tie-breaking; surface in reasons
53
- // for now so the explanation captures it.
54
- void matchedCount;
55
59
  }
56
60
  out.sort((a, b) => b.score - a.score);
57
61
  const limit = options.limit ?? 5;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shrkcrft/presets",
3
- "version": "0.1.0-alpha.17",
3
+ "version": "0.1.0-alpha.18",
4
4
  "description": "SharkCraft presets: reusable project setups (knowledge/rules/paths/templates/pipelines/docs) that can be applied to a target repo through the CLI.",
5
5
  "license": "MIT",
6
6
  "author": "SharkCraft contributors",
@@ -42,9 +42,9 @@
42
42
  "typecheck": "tsc --noEmit -p tsconfig.json"
43
43
  },
44
44
  "dependencies": {
45
- "@shrkcrft/core": "^0.1.0-alpha.17",
46
- "@shrkcrft/knowledge": "^0.1.0-alpha.17",
47
- "@shrkcrft/workspace": "^0.1.0-alpha.17"
45
+ "@shrkcrft/core": "^0.1.0-alpha.18",
46
+ "@shrkcrft/knowledge": "^0.1.0-alpha.18",
47
+ "@shrkcrft/workspace": "^0.1.0-alpha.18"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"