@orion-js/core 3.11.11 → 3.11.13
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.
|
@@ -8,42 +8,58 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
9
|
const https_1 = __importDefault(require("https"));
|
|
10
10
|
const safe_1 = __importDefault(require("colors/safe"));
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
const rules = [
|
|
12
|
+
'orionjs.mdx',
|
|
13
|
+
'orionjs-component.mdx',
|
|
14
|
+
'orionjs-repository.mdx',
|
|
15
|
+
'orionjs-schema.mdx',
|
|
16
|
+
'orionjs-services.mdx',
|
|
17
|
+
];
|
|
18
|
+
// Function to download the file content
|
|
19
|
+
const downloadFile = (url) => {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
https_1.default.get(url, (response) => {
|
|
22
|
+
if (response.statusCode !== 200) {
|
|
23
|
+
reject(new Error(`Failed to download, status code: ${response.statusCode}`));
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
let data = '';
|
|
27
|
+
response.on('data', (chunk) => {
|
|
28
|
+
data += chunk;
|
|
29
|
+
});
|
|
30
|
+
response.on('end', () => {
|
|
31
|
+
resolve(data);
|
|
32
|
+
});
|
|
33
|
+
response.on('error', (err) => {
|
|
31
34
|
reject(err);
|
|
32
35
|
});
|
|
33
36
|
});
|
|
34
|
-
};
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
async function copyCursorRule() {
|
|
40
|
+
const baseUrl = `https://raw.githubusercontent.com/orionjs/orionjs/refs/heads/master/mdc`;
|
|
35
41
|
try {
|
|
36
|
-
//
|
|
42
|
+
// Create target directory if it doesn't exist
|
|
43
|
+
const targetDir = path_1.default.join(process.cwd(), '.cursor', 'rules');
|
|
37
44
|
await promises_1.default.mkdir(targetDir, { recursive: true });
|
|
38
|
-
//
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
// Process each rule file
|
|
46
|
+
for (const rule of rules) {
|
|
47
|
+
// Change extension from .mdx to .mdc
|
|
48
|
+
const targetFileName = rule.replace('.mdx', '.mdc');
|
|
49
|
+
const targetFile = path_1.default.join(targetDir, targetFileName);
|
|
50
|
+
// Construct source URL
|
|
51
|
+
const sourceUrl = `${baseUrl}/${rule}`;
|
|
52
|
+
// console.log(colors.gray(`=> ✨ Downloading ${colors.cyan(rule)} to ${colors.cyan(targetFileName)}...`))
|
|
53
|
+
// Download the file content
|
|
54
|
+
const content = await downloadFile(sourceUrl);
|
|
55
|
+
// Write the content to the target file
|
|
56
|
+
await promises_1.default.writeFile(targetFile, content, 'utf8');
|
|
57
|
+
console.log(safe_1.default.bold(`=> ✨ Successfully downloaded ${safe_1.default.cyan(targetFileName)}`));
|
|
58
|
+
}
|
|
59
|
+
console.log(safe_1.default.bold('=> ✨ All rule files have been successfully copied'));
|
|
43
60
|
}
|
|
44
61
|
catch (error) {
|
|
45
|
-
console.error(
|
|
46
|
-
throw error;
|
|
62
|
+
console.error(safe_1.default.red(`Error copying rule files: ${error.message}`));
|
|
47
63
|
}
|
|
48
64
|
}
|
|
49
65
|
exports.copyCursorRule = copyCursorRule;
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION_FILE = exports.MCP_VERSION = void 0;
|
|
4
4
|
// Define current MCP version - update this when a new version needs to be deployed
|
|
5
|
-
exports.MCP_VERSION = '
|
|
5
|
+
exports.MCP_VERSION = 'v1';
|
|
6
6
|
exports.VERSION_FILE = 'version.txt';
|
|
@@ -41,9 +41,13 @@ async function copyMCP() {
|
|
|
41
41
|
// Create version file
|
|
42
42
|
await promises_1.default.writeFile(path_1.default.join(targetDir, consts_1.VERSION_FILE), consts_1.MCP_VERSION, 'utf-8');
|
|
43
43
|
console.log(safe_1.default.bold(`=> ✨ Successfully downloaded MCP documentation v${consts_1.MCP_VERSION} to .orion/mcp`));
|
|
44
|
+
// Install dependencies in the MCP directory
|
|
45
|
+
console.log(safe_1.default.bold(`=> ✨ Installing MCP dependencies...`));
|
|
46
|
+
await (0, execute_1.default)(`cd ${targetDir} && npm install`);
|
|
47
|
+
console.log(safe_1.default.bold(`=> ✨ Successfully installed MCP dependencies`));
|
|
44
48
|
const mcpServerConfig = {
|
|
45
49
|
"mcpServers": {
|
|
46
|
-
"
|
|
50
|
+
"Orionjs documentation search": {
|
|
47
51
|
"command": "node",
|
|
48
52
|
"args": [
|
|
49
53
|
path_1.default.join(targetDir, 'src', 'index.js')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/core",
|
|
3
|
-
"version": "3.11.
|
|
3
|
+
"version": "3.11.13",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"author": "nicolaslopezj",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"engines": {
|
|
37
37
|
"node": ">=14.0.0"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "4f56bc06ef1167bfa8c7a7a04c34e97ce70fae7c",
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@shelf/jest-mongodb": "^2.1.0",
|
|
42
42
|
"@types/prompts": "^2.4.2",
|