@clipboard-health/ai-rules 0.2.5 → 0.2.6
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 +1 -2
- package/scripts/sync.js +25 -0
- package/scripts/toErrorMessage.js +6 -0
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
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.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"bugs": "https://github.com/ClipboardHealth/core-utils/issues",
|
|
6
6
|
"devDependencies": {
|
|
7
|
-
"@clipboard-health/util-ts": "3.17.3",
|
|
8
7
|
"@intellectronica/ruler": "0.3.10"
|
|
9
8
|
},
|
|
10
9
|
"keywords": [
|
package/scripts/sync.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable unicorn/no-process-exit */
|
|
4
|
+
/* eslint-disable n/no-process-exit */
|
|
5
|
+
const promises_1 = require("node:fs/promises");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
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, "..");
|
|
10
|
+
async function sync() {
|
|
11
|
+
try {
|
|
12
|
+
// 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");
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
// Log error but exit gracefully to avoid breaking installs
|
|
18
|
+
console.error(`⚠️ @clipboard-health/ai-rules sync failed: ${(0, toErrorMessage_1.toErrorMessage)(error)}`);
|
|
19
|
+
process.exit(0);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line unicorn/prefer-top-level-await
|
|
23
|
+
void sync();
|
|
24
|
+
/* eslint-enable n/no-process-exit */
|
|
25
|
+
/* eslint-enable unicorn/no-process-exit */
|