@clipboard-health/ai-rules 0.2.6 → 0.2.8

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clipboard-health/ai-rules",
3
3
  "description": "Pre-built AI agent rules for consistent coding standards.",
4
- "version": "0.2.6",
4
+ "version": "0.2.8",
5
5
  "bugs": "https://github.com/ClipboardHealth/core-utils/issues",
6
6
  "devDependencies": {
7
7
  "@intellectronica/ruler": "0.3.10"
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROFILES = exports.PATHS = void 0;
4
+ const node_path_1 = require("node:path");
5
+ const packageRoot = (0, node_path_1.join)(__dirname, "..");
6
+ exports.PATHS = {
7
+ packageRoot,
8
+ outputDirectory: (0, node_path_1.join)(packageRoot, "..", "..", "dist", "packages", "ai-rules"),
9
+ };
10
+ exports.PROFILES = {
11
+ frontend: ["common", "frontend"],
12
+ backend: ["common", "backend"],
13
+ fullstack: ["common", "frontend", "backend"],
14
+ common: ["common"],
15
+ };
package/scripts/sync.js CHANGED
@@ -4,14 +4,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  /* eslint-disable n/no-process-exit */
5
5
  const promises_1 = require("node:fs/promises");
6
6
  const node_path_1 = require("node:path");
7
+ const constants_1 = require("./constants");
7
8
  const toErrorMessage_1 = require("./toErrorMessage");
8
- const projectRoot = (0, node_path_1.join)(__dirname, "../../..");
9
- const AI_RULES_SOURCE = (0, node_path_1.join)(__dirname, "..");
9
+ const PATHS = {
10
+ projectRoot: (0, node_path_1.join)(__dirname, "../../.."),
11
+ rules: (0, node_path_1.join)(__dirname, ".."),
12
+ };
13
+ function getProfileFromArguments() {
14
+ const profile = process.argv[2];
15
+ if (!profile || !(profile in constants_1.PROFILES)) {
16
+ console.error("❌ Error: Invalid profile argument");
17
+ console.error(`Usage: npm run sync <profile>`);
18
+ console.error(`Available profiles: ${Object.keys(constants_1.PROFILES).join(", ")}`);
19
+ process.exit(1);
20
+ }
21
+ return profile;
22
+ }
10
23
  async function sync() {
11
24
  try {
25
+ const profile = getProfileFromArguments();
12
26
  // Force copy files; rely on `git` if it overwrites files.
13
- await (0, promises_1.cp)(AI_RULES_SOURCE, projectRoot, { recursive: true, force: true });
14
- console.log("✅ @clipboard-health/ai-rules sync complete");
27
+ await (0, promises_1.cp)((0, node_path_1.join)(PATHS.rules, profile), PATHS.projectRoot, { recursive: true, force: true });
28
+ console.log(`✅ @clipboard-health/ai-rules synced ${profile}`);
15
29
  }
16
30
  catch (error) {
17
31
  // Log error but exit gracefully to avoid breaking installs