@orion-js/core 3.11.11 → 3.11.12

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
- async function copyCursorRule() {
12
- const sourceUrl = 'https://raw.githubusercontent.com/orionjs/orionjs/refs/heads/master/.cursor/rules/orionjs.mdc';
13
- const targetDir = path_1.default.join(process.cwd(), '.cursor', 'rules');
14
- const targetFile = path_1.default.join(targetDir, 'orionjs.mdc');
15
- // Function to download the file content
16
- const downloadFile = (url) => {
17
- return new Promise((resolve, reject) => {
18
- https_1.default.get(url, (response) => {
19
- if (response.statusCode !== 200) {
20
- reject(new Error(`Failed to download, status code: ${response.statusCode}`));
21
- return;
22
- }
23
- let data = '';
24
- response.on('data', (chunk) => {
25
- data += chunk;
26
- });
27
- response.on('end', () => {
28
- resolve(data);
29
- });
30
- }).on('error', (err) => {
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
- // Ensure the directory exists
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
- // Download the file content
39
- const content = await downloadFile(sourceUrl);
40
- // Write the content to the target file
41
- await promises_1.default.writeFile(targetFile, content, 'utf8');
42
- console.log(safe_1.default.bold(`=> ✨ Updated cursor rules to the latest versions`));
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('=> ✨ Error copying cursor rules:', 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;
@@ -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
- "orionjs": {
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.11",
3
+ "version": "3.11.12",
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": "a1524557edf2cdc5f28ce1f0b52de7ba28b86c3a",
39
+ "gitHead": "35293b72df2bdd2009a969e024be6367a4921e2d",
40
40
  "devDependencies": {
41
41
  "@shelf/jest-mongodb": "^2.1.0",
42
42
  "@types/prompts": "^2.4.2",