@orion-js/core 3.11.14 → 4.0.0-next.1
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/dist/build/compile.d.ts +3 -0
- package/dist/build/getOptions.d.ts +7 -0
- package/dist/build/index.d.ts +3 -0
- package/dist/create/index.d.ts +4 -0
- package/dist/fsevents-hj42pnne.node +0 -0
- package/dist/handleErrors.d.ts +1 -0
- package/dist/helpers/ensureDirectory.d.ts +2 -0
- package/dist/helpers/execute.d.ts +1 -0
- package/dist/helpers/getFileContents.d.ts +1 -0
- package/dist/helpers/getModulesToWatch.d.ts +1 -0
- package/dist/helpers/isPortInUse.d.ts +1 -0
- package/dist/helpers/runOnce.d.ts +1 -0
- package/dist/helpers/sleep.d.ts +2 -0
- package/dist/helpers/writeFile.d.ts +1 -0
- package/dist/index.cjs +196340 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +196332 -0
- package/dist/start/copyCursorRule/index.d.ts +1 -0
- package/dist/start/copyMCP/consts.d.ts +2 -0
- package/dist/start/copyMCP/index.d.ts +1 -0
- package/dist/start/copyMCP/isValidMCPRepo.d.ts +5 -0
- package/dist/start/index.d.ts +2 -0
- package/dist/start/runner/getArgs.d.ts +5 -0
- package/dist/start/runner/index.d.ts +12 -0
- package/dist/start/runner/startProcess.d.ts +1 -0
- package/dist/start/watchAndCompile/cleanDirectory.d.ts +1 -0
- package/dist/start/watchAndCompile/ensureConfigComplies.d.ts +1 -0
- package/dist/start/watchAndCompile/getConfigPath.d.ts +1 -0
- package/dist/start/watchAndCompile/getHost.d.ts +3 -0
- package/dist/start/watchAndCompile/index.d.ts +2 -0
- package/dist/start/watchAndCompile/reports.d.ts +2 -0
- package/dist/start/watchAndCompile/watchDeletes.d.ts +1 -0
- package/dist/start/watchAndCompile/writeEnvFile.d.ts +2 -0
- package/dist/start/watchAndCompile/writeIndex/index.d.ts +3 -0
- package/dist/test/index.d.ts +1 -0
- package/dist/version.d.ts +2 -0
- package/package.json +22 -10
- package/LICENSE +0 -21
- package/lib/build/compile.js +0 -28
- package/lib/build/getOptions.js +0 -36
- package/lib/build/index.js +0 -21
- package/lib/create/index.js +0 -20
- package/lib/handleErrors.js +0 -20
- package/lib/helpers/ensureDirectory.js +0 -15
- package/lib/helpers/execute.js +0 -16
- package/lib/helpers/getFileContents.js +0 -12
- package/lib/helpers/getModulesToWatch.js +0 -39
- package/lib/helpers/isPortInUse.js +0 -26
- package/lib/helpers/runOnce.js +0 -14
- package/lib/helpers/sleep.js +0 -3
- package/lib/helpers/writeFile.js +0 -12
- package/lib/index.js +0 -52
- package/lib/start/copyCursorRule/index.js +0 -66
- package/lib/start/copyMCP/consts.js +0 -6
- package/lib/start/copyMCP/index.js +0 -87
- package/lib/start/copyMCP/isValidMCPRepo.js +0 -56
- package/lib/start/index.js +0 -25
- package/lib/start/runner/getArgs.js +0 -19
- package/lib/start/runner/index.js +0 -42
- package/lib/start/runner/startProcess.js +0 -18
- package/lib/start/watchAndCompile/cleanDirectory.js +0 -34
- package/lib/start/watchAndCompile/ensureConfigComplies.js +0 -31
- package/lib/start/watchAndCompile/getConfigPath.js +0 -19
- package/lib/start/watchAndCompile/getHost.js +0 -38
- package/lib/start/watchAndCompile/index.js +0 -18
- package/lib/start/watchAndCompile/reports.js +0 -16
- package/lib/start/watchAndCompile/watchDeletes.js +0 -29
- package/lib/start/watchAndCompile/writeEnvFile.js +0 -22
- package/lib/start/watchAndCompile/writeIndex/index.js +0 -28
- package/lib/test/index.js +0 -12
- package/lib/version.js +0 -3
- package/moduleAlias.js.txt +0 -224
- package/tsconfig.json +0 -15
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyCursorRule(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyMCP(): Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface RunnerOptions {
|
|
2
|
+
shell: boolean;
|
|
3
|
+
clean: boolean;
|
|
4
|
+
omitCursorRule?: boolean;
|
|
5
|
+
omitMcpServer?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface Runner {
|
|
8
|
+
restart: () => void;
|
|
9
|
+
stop: () => void;
|
|
10
|
+
basePath: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function getRunner(options: RunnerOptions): Runner;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function startProcess(options: any): import("child_process").ChildProcess;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function cleanDirectory(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ensureConfigComplies(configPath: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getConfigPath(): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function watchDeletes(): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (): void;
|
package/package.json
CHANGED
|
@@ -1,22 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orion-js/core",
|
|
3
|
-
"version": "
|
|
4
|
-
"main": "index.
|
|
3
|
+
"version": "4.0.0-next.1",
|
|
4
|
+
"main": "./dist/index.cjs",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"files": [
|
|
7
|
+
"dist"
|
|
8
|
+
],
|
|
5
9
|
"author": "nicolaslopezj",
|
|
6
10
|
"license": "MIT",
|
|
7
11
|
"bin": {
|
|
8
|
-
"orion": "./
|
|
12
|
+
"orion": "./dist/index.js"
|
|
9
13
|
},
|
|
10
14
|
"scripts": {
|
|
11
15
|
"test": "exit 0",
|
|
12
|
-
"prepare": "
|
|
13
|
-
"clean": "rm -rf ./
|
|
14
|
-
"build": "
|
|
16
|
+
"prepare": "bun run build",
|
|
17
|
+
"clean": "rm -rf ./dist",
|
|
18
|
+
"build": "bun run build.ts",
|
|
15
19
|
"watch": "tsc -w",
|
|
16
20
|
"upgrade-interactive": "yarn upgrade-interactive"
|
|
17
21
|
},
|
|
18
22
|
"dependencies": {
|
|
19
|
-
"@orion-js/env": "
|
|
23
|
+
"@orion-js/env": "4.0.0-next.1",
|
|
20
24
|
"chokidar": "3.5.3",
|
|
21
25
|
"colors": "^1.4.0",
|
|
22
26
|
"commander": "^9.4.1",
|
|
@@ -36,10 +40,18 @@
|
|
|
36
40
|
"engines": {
|
|
37
41
|
"node": ">=14.0.0"
|
|
38
42
|
},
|
|
39
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "9d85ab24776533db109843c277324e42c65ddedd",
|
|
40
44
|
"devDependencies": {
|
|
41
45
|
"@shelf/jest-mongodb": "^2.1.0",
|
|
42
46
|
"@types/prompts": "^2.4.2",
|
|
43
|
-
"typescript": "^
|
|
47
|
+
"typescript": "^5.8.2",
|
|
48
|
+
"@types/bun": "^1.2.4"
|
|
49
|
+
},
|
|
50
|
+
"type": "module",
|
|
51
|
+
"module": "./dist/index.js",
|
|
52
|
+
"exports": {
|
|
53
|
+
"types": "./dist/index.d.ts",
|
|
54
|
+
"import": "./dist/index.js",
|
|
55
|
+
"require": "./dist/index.cjs"
|
|
44
56
|
}
|
|
45
|
-
}
|
|
57
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Orionjs Team
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/lib/build/compile.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.compile = void 0;
|
|
7
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
-
const getOptions_1 = require("./getOptions");
|
|
9
|
-
const safe_1 = __importDefault(require("colors/safe"));
|
|
10
|
-
const reports_1 = require("../start/watchAndCompile/reports");
|
|
11
|
-
function compile({ output }) {
|
|
12
|
-
const options = (0, getOptions_1.getOptions)({ output });
|
|
13
|
-
const program = typescript_1.default.createProgram(['./app/index.ts'], options);
|
|
14
|
-
const preEmitDiagnostics = typescript_1.default.getPreEmitDiagnostics(program);
|
|
15
|
-
if (preEmitDiagnostics.length > 0) {
|
|
16
|
-
console.log(safe_1.default.red(`\n==> Error builing Orion app\n`));
|
|
17
|
-
}
|
|
18
|
-
preEmitDiagnostics.forEach(reports_1.reportDiagnostic);
|
|
19
|
-
if (preEmitDiagnostics.length > 0) {
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
const emitResult = program.emit();
|
|
23
|
-
emitResult.diagnostics.forEach(reports_1.reportDiagnostic);
|
|
24
|
-
if (emitResult.emitSkipped) {
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.compile = compile;
|
package/lib/build/getOptions.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getOptions = exports.getCompilerOptionsJSONFollowExtends = void 0;
|
|
7
|
-
const typescript_1 = __importDefault(require("typescript"));
|
|
8
|
-
const getConfigPath_1 = require("../start/watchAndCompile/getConfigPath");
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const reports_1 = require("../start/watchAndCompile/reports");
|
|
11
|
-
function getCompilerOptionsJSONFollowExtends(filename) {
|
|
12
|
-
let compopts = {};
|
|
13
|
-
const config = typescript_1.default.readConfigFile(filename, typescript_1.default.sys.readFile).config;
|
|
14
|
-
if (config.extends) {
|
|
15
|
-
const rqrpath = require.resolve(config.extends);
|
|
16
|
-
compopts = getCompilerOptionsJSONFollowExtends(rqrpath);
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
...compopts,
|
|
20
|
-
...config.compilerOptions
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
exports.getCompilerOptionsJSONFollowExtends = getCompilerOptionsJSONFollowExtends;
|
|
24
|
-
function getOptions({ output }) {
|
|
25
|
-
const configPath = (0, getConfigPath_1.getConfigPath)();
|
|
26
|
-
const config = getCompilerOptionsJSONFollowExtends(configPath);
|
|
27
|
-
config.outDir = `${output}/app`;
|
|
28
|
-
config.incremental = false;
|
|
29
|
-
const { options, errors } = typescript_1.default.convertCompilerOptionsFromJson(config, path_1.default.dirname(configPath));
|
|
30
|
-
if (errors.length) {
|
|
31
|
-
errors.forEach(reports_1.reportDiagnostic);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
return options;
|
|
35
|
-
}
|
|
36
|
-
exports.getOptions = getOptions;
|
package/lib/build/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const safe_1 = __importDefault(require("colors/safe"));
|
|
7
|
-
const execute_1 = __importDefault(require("../helpers/execute"));
|
|
8
|
-
const writeIndex_1 = __importDefault(require("../start/watchAndCompile/writeIndex"));
|
|
9
|
-
const compile_1 = require("./compile");
|
|
10
|
-
async function default_1({ output }) {
|
|
11
|
-
if (!output) {
|
|
12
|
-
output = './build';
|
|
13
|
-
}
|
|
14
|
-
console.log(safe_1.default.bold(`Cleaning directory ${output}...`));
|
|
15
|
-
await (0, execute_1.default)(`rm -rf ${output}`);
|
|
16
|
-
console.log(safe_1.default.bold('Compiling your app...'));
|
|
17
|
-
(0, compile_1.compile)({ output });
|
|
18
|
-
(0, writeIndex_1.default)({ basePath: output });
|
|
19
|
-
console.log(safe_1.default.bold('Build created'));
|
|
20
|
-
}
|
|
21
|
-
exports.default = default_1;
|
package/lib/create/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const execute_1 = __importDefault(require("../helpers/execute"));
|
|
7
|
-
async function default_1({ name, kit }) {
|
|
8
|
-
if (!name) {
|
|
9
|
-
throw new Error('Please set the name of the app');
|
|
10
|
-
}
|
|
11
|
-
if (!kit) {
|
|
12
|
-
throw new Error('Please select which kit to use');
|
|
13
|
-
}
|
|
14
|
-
const repo = `https://github.com/siturra/boilerplate-orionjs-${kit}`;
|
|
15
|
-
console.log('Downloading starter kit...');
|
|
16
|
-
await (0, execute_1.default)(`git clone ${repo} ${name}`);
|
|
17
|
-
await (0, execute_1.default)(`cd ${name} && rm -rf .git`);
|
|
18
|
-
console.log('Your starter kit is ready');
|
|
19
|
-
}
|
|
20
|
-
exports.default = default_1;
|
package/lib/handleErrors.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const colors_1 = __importDefault(require("colors"));
|
|
7
|
-
process
|
|
8
|
-
.on('unhandledRejection', (error) => {
|
|
9
|
-
if (error.codeFrame) {
|
|
10
|
-
console.error(colors_1.default.red(error.message));
|
|
11
|
-
console.log(error.codeFrame);
|
|
12
|
-
}
|
|
13
|
-
else {
|
|
14
|
-
console.error(colors_1.default.red(error.message), colors_1.default.red('Unhandled promise rejection'));
|
|
15
|
-
}
|
|
16
|
-
})
|
|
17
|
-
.on('uncaughtException', error => {
|
|
18
|
-
console.error(colors_1.default.red(error.message));
|
|
19
|
-
process.exit(1);
|
|
20
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const ensureDirectory = function (filePath) {
|
|
9
|
-
const dirname = path_1.default.dirname(filePath);
|
|
10
|
-
if (fs_1.default.existsSync(dirname))
|
|
11
|
-
return true;
|
|
12
|
-
ensureDirectory(dirname);
|
|
13
|
-
fs_1.default.mkdirSync(dirname);
|
|
14
|
-
};
|
|
15
|
-
exports.default = ensureDirectory;
|
package/lib/helpers/execute.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const child_process_1 = require("child_process");
|
|
4
|
-
async function default_1(command) {
|
|
5
|
-
return new Promise(function (resolve, reject) {
|
|
6
|
-
(0, child_process_1.exec)(command, (error, stdout, stderr) => {
|
|
7
|
-
if (error) {
|
|
8
|
-
reject(error);
|
|
9
|
-
}
|
|
10
|
-
else {
|
|
11
|
-
resolve({ stdout, stderr });
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
exports.default = default_1;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
function readFile(filePath) {
|
|
8
|
-
if (!fs_1.default.existsSync(filePath))
|
|
9
|
-
return null;
|
|
10
|
-
return fs_1.default.readFileSync(filePath).toString();
|
|
11
|
-
}
|
|
12
|
-
exports.default = readFile;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const getDirectories = function (dir) {
|
|
8
|
-
return fs_1.default
|
|
9
|
-
.readdirSync(dir)
|
|
10
|
-
.map(file => `${dir}/${file}`)
|
|
11
|
-
.filter(file => {
|
|
12
|
-
const stats = fs_1.default.statSync(dir);
|
|
13
|
-
return stats.isDirectory();
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
const getSymlinks = function () {
|
|
17
|
-
const symlinks = [];
|
|
18
|
-
const dirs = getDirectories('./node_modules');
|
|
19
|
-
for (const dir of dirs) {
|
|
20
|
-
const stats = fs_1.default.statSync(dir);
|
|
21
|
-
const isSymlink = stats.isSymbolicLink();
|
|
22
|
-
if (isSymlink) {
|
|
23
|
-
symlinks.push(dir);
|
|
24
|
-
}
|
|
25
|
-
if (dir.includes('@orion-js')) {
|
|
26
|
-
const subDirs = getDirectories(dir);
|
|
27
|
-
for (const subDir of subDirs) {
|
|
28
|
-
symlinks.push(subDir + '/lib');
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return symlinks;
|
|
33
|
-
};
|
|
34
|
-
function default_1() {
|
|
35
|
-
const paths = ['node_modules'];
|
|
36
|
-
const symlinks = getSymlinks();
|
|
37
|
-
return [...paths, ...symlinks];
|
|
38
|
-
}
|
|
39
|
-
exports.default = default_1;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const net_1 = __importDefault(require("net"));
|
|
7
|
-
function default_1(port) {
|
|
8
|
-
return new Promise(function (resolve, reject) {
|
|
9
|
-
const tester = net_1.default
|
|
10
|
-
.createServer()
|
|
11
|
-
.once('error', function (err) {
|
|
12
|
-
if (err.code !== 'EADDRINUSE')
|
|
13
|
-
return reject(err);
|
|
14
|
-
resolve(true);
|
|
15
|
-
})
|
|
16
|
-
.once('listening', function () {
|
|
17
|
-
tester
|
|
18
|
-
.once('close', function () {
|
|
19
|
-
resolve(false);
|
|
20
|
-
})
|
|
21
|
-
.close();
|
|
22
|
-
})
|
|
23
|
-
.listen(port);
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
exports.default = default_1;
|
package/lib/helpers/runOnce.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
function default_1(func) {
|
|
4
|
-
let running = false;
|
|
5
|
-
return async function (...args) {
|
|
6
|
-
if (running)
|
|
7
|
-
return;
|
|
8
|
-
running = true;
|
|
9
|
-
const result = await func(...args);
|
|
10
|
-
running = false;
|
|
11
|
-
return result;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
exports.default = default_1;
|
package/lib/helpers/sleep.js
DELETED
package/lib/helpers/writeFile.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const ensureDirectory_1 = __importDefault(require("../helpers/ensureDirectory"));
|
|
8
|
-
async function default_1(path, content) {
|
|
9
|
-
(0, ensureDirectory_1.default)(path);
|
|
10
|
-
fs_1.default.writeFileSync(path, content);
|
|
11
|
-
}
|
|
12
|
-
exports.default = default_1;
|
package/lib/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
-
};
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
require("reflect-metadata");
|
|
8
|
-
const commander_1 = require("commander");
|
|
9
|
-
const start_1 = __importDefault(require("./start"));
|
|
10
|
-
const build_1 = __importDefault(require("./build"));
|
|
11
|
-
const create_1 = __importDefault(require("./create"));
|
|
12
|
-
const safe_1 = __importDefault(require("colors/safe"));
|
|
13
|
-
const test_1 = __importDefault(require("./test"));
|
|
14
|
-
require("./handleErrors");
|
|
15
|
-
const version_1 = __importDefault(require("./version"));
|
|
16
|
-
require("dotenv/config");
|
|
17
|
-
const program = new commander_1.Command();
|
|
18
|
-
const run = function (action) {
|
|
19
|
-
return async function (...args) {
|
|
20
|
-
try {
|
|
21
|
-
await action(...args);
|
|
22
|
-
}
|
|
23
|
-
catch (e) {
|
|
24
|
-
console.error(safe_1.default.red('Error: ' + e.message));
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
program
|
|
29
|
-
.command('start')
|
|
30
|
-
.description('Run the Orionjs app')
|
|
31
|
-
.option('--shell', 'Opens a shell in Chrome developer tools')
|
|
32
|
-
.option('--clean', 'Build the typescript project from scratch')
|
|
33
|
-
.option('--omit-cursor-rule', 'Omit the creation of the Orionjs Cursor rule')
|
|
34
|
-
.option('--omit-mcp-server', 'Omit the creation of the Orionjs MCP server')
|
|
35
|
-
.action(run(start_1.default));
|
|
36
|
-
program.command('test').allowUnknownOption().description('Deprecated command').action(run(test_1.default));
|
|
37
|
-
program
|
|
38
|
-
.command('build')
|
|
39
|
-
.description('Compiles an Orionjs app and exports it to a simple nodejs app')
|
|
40
|
-
.option('-o, --output [output]', 'Output directory')
|
|
41
|
-
.action(run(build_1.default));
|
|
42
|
-
program
|
|
43
|
-
.command('create')
|
|
44
|
-
.description('Creates a new Orionjs project')
|
|
45
|
-
.option('--name [name]', 'Name of the project')
|
|
46
|
-
.option('--kit [kit]', 'Which starter kit to use')
|
|
47
|
-
.action(run(create_1.default));
|
|
48
|
-
program.version(version_1.default, '-v --version');
|
|
49
|
-
program.parse(process.argv);
|
|
50
|
-
if (!process.argv.slice(2).length) {
|
|
51
|
-
program.outputHelp();
|
|
52
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.copyCursorRule = void 0;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
|
-
const https_1 = __importDefault(require("https"));
|
|
10
|
-
const safe_1 = __importDefault(require("colors/safe"));
|
|
11
|
-
const rules = [
|
|
12
|
-
'orionjs.mdx',
|
|
13
|
-
'orionjs-component.mdx',
|
|
14
|
-
'orionjs-repository.mdx',
|
|
15
|
-
'orionjs-schema.mdx',
|
|
16
|
-
'orionjs-services.mdx',
|
|
17
|
-
'orionjs-resolvers.mdx',
|
|
18
|
-
];
|
|
19
|
-
// Function to download the file content
|
|
20
|
-
const downloadFile = (url) => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
https_1.default.get(url, (response) => {
|
|
23
|
-
if (response.statusCode !== 200) {
|
|
24
|
-
reject(new Error(`Failed to download, status code: ${response.statusCode}`));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
let data = '';
|
|
28
|
-
response.on('data', (chunk) => {
|
|
29
|
-
data += chunk;
|
|
30
|
-
});
|
|
31
|
-
response.on('end', () => {
|
|
32
|
-
resolve(data);
|
|
33
|
-
});
|
|
34
|
-
response.on('error', (err) => {
|
|
35
|
-
reject(err);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
async function copyCursorRule() {
|
|
41
|
-
const baseUrl = `https://raw.githubusercontent.com/orionjs/orionjs/refs/heads/master/mdc`;
|
|
42
|
-
try {
|
|
43
|
-
// Create target directory if it doesn't exist
|
|
44
|
-
const targetDir = path_1.default.join(process.cwd(), '.cursor', 'rules');
|
|
45
|
-
await promises_1.default.mkdir(targetDir, { recursive: true });
|
|
46
|
-
// Process each rule file
|
|
47
|
-
for (const rule of rules) {
|
|
48
|
-
// Change extension from .mdx to .mdc
|
|
49
|
-
const targetFileName = rule.replace('.mdx', '.mdc');
|
|
50
|
-
const targetFile = path_1.default.join(targetDir, targetFileName);
|
|
51
|
-
// Construct source URL
|
|
52
|
-
const sourceUrl = `${baseUrl}/${rule}`;
|
|
53
|
-
// console.log(colors.gray(`=> ✨ Downloading ${colors.cyan(rule)} to ${colors.cyan(targetFileName)}...`))
|
|
54
|
-
// Download the file content
|
|
55
|
-
const content = await downloadFile(sourceUrl);
|
|
56
|
-
// Write the content to the target file
|
|
57
|
-
await promises_1.default.writeFile(targetFile, content, 'utf8');
|
|
58
|
-
console.log(safe_1.default.bold(`=> ✨ Successfully downloaded ${safe_1.default.cyan(targetFileName)}`));
|
|
59
|
-
}
|
|
60
|
-
console.log(safe_1.default.bold('=> ✨ All rule files have been successfully copied'));
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
console.error(safe_1.default.red(`Error copying rule files: ${error.message}`));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
exports.copyCursorRule = copyCursorRule;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VERSION_FILE = exports.MCP_VERSION = void 0;
|
|
4
|
-
// Define current MCP version - update this when a new version needs to be deployed
|
|
5
|
-
exports.MCP_VERSION = 'v1';
|
|
6
|
-
exports.VERSION_FILE = 'version.txt';
|