@orion-js/core 4.3.0 → 4.3.2
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/index.cjs +88 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +87 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -23,18 +23,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
));
|
|
24
24
|
|
|
25
25
|
// src/index.ts
|
|
26
|
-
var
|
|
26
|
+
var import_chalk15 = __toESM(require("chalk"), 1);
|
|
27
27
|
var import_commander = require("commander");
|
|
28
28
|
|
|
29
29
|
// src/helpers/execute.ts
|
|
30
30
|
var import_node_child_process = require("child_process");
|
|
31
31
|
async function execute_default(command) {
|
|
32
|
-
return new Promise((
|
|
32
|
+
return new Promise((resolve3, reject) => {
|
|
33
33
|
(0, import_node_child_process.exec)(command, (error, stdout, stderr) => {
|
|
34
34
|
if (error) {
|
|
35
35
|
reject(error);
|
|
36
36
|
} else {
|
|
37
|
-
|
|
37
|
+
resolve3({ stdout, stderr });
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
});
|
|
@@ -68,10 +68,10 @@ var import_node_fs2 = __toESM(require("fs"), 1);
|
|
|
68
68
|
var import_node_fs = __toESM(require("fs"), 1);
|
|
69
69
|
var import_node_path = __toESM(require("path"), 1);
|
|
70
70
|
var ensureDirectory = (filePath) => {
|
|
71
|
-
const
|
|
72
|
-
if (import_node_fs.default.existsSync(
|
|
73
|
-
ensureDirectory(
|
|
74
|
-
import_node_fs.default.mkdirSync(
|
|
71
|
+
const dirname2 = import_node_path.default.dirname(filePath);
|
|
72
|
+
if (import_node_fs.default.existsSync(dirname2)) return true;
|
|
73
|
+
ensureDirectory(dirname2);
|
|
74
|
+
import_node_fs.default.mkdirSync(dirname2);
|
|
75
75
|
};
|
|
76
76
|
var ensureDirectory_default = ensureDirectory;
|
|
77
77
|
|
|
@@ -83,6 +83,7 @@ async function writeFile_default(path3, content) {
|
|
|
83
83
|
|
|
84
84
|
// src/dev/runner/startProcess.ts
|
|
85
85
|
var import_node_child_process2 = require("child_process");
|
|
86
|
+
var import_chalk = __toESM(require("chalk"), 1);
|
|
86
87
|
|
|
87
88
|
// src/dev/runner/getArgs.ts
|
|
88
89
|
function getArgs(options, command) {
|
|
@@ -97,7 +98,6 @@ function getArgs(options, command) {
|
|
|
97
98
|
}
|
|
98
99
|
|
|
99
100
|
// src/dev/runner/startProcess.ts
|
|
100
|
-
var import_chalk = __toESM(require("chalk"), 1);
|
|
101
101
|
function startProcess(options, command) {
|
|
102
102
|
const { startCommand, args } = getArgs(options, command);
|
|
103
103
|
console.log(import_chalk.default.bold(`=> Starting app with command: ${startCommand} ${args.join(" ")}...
|
|
@@ -105,7 +105,8 @@ function startProcess(options, command) {
|
|
|
105
105
|
return (0, import_node_child_process2.spawn)(startCommand, args, {
|
|
106
106
|
env: {
|
|
107
107
|
ORION_DEV: "local",
|
|
108
|
-
...process.env
|
|
108
|
+
...process.env,
|
|
109
|
+
...options.repl ? { ORION_REPL: "true" } : {}
|
|
109
110
|
},
|
|
110
111
|
cwd: process.cwd(),
|
|
111
112
|
stdio: "inherit",
|
|
@@ -446,7 +447,21 @@ process.on("unhandledRejection", (error) => {
|
|
|
446
447
|
});
|
|
447
448
|
|
|
448
449
|
// src/version.ts
|
|
449
|
-
var
|
|
450
|
+
var import_node_fs5 = require("fs");
|
|
451
|
+
var import_node_path3 = require("path");
|
|
452
|
+
var import_node_url = require("url");
|
|
453
|
+
var import_meta = {};
|
|
454
|
+
function getVersion() {
|
|
455
|
+
try {
|
|
456
|
+
const dir = (0, import_node_path3.dirname)((0, import_node_url.fileURLToPath)(import_meta.url));
|
|
457
|
+
const pkgPath = (0, import_node_path3.resolve)(dir, "..", "package.json");
|
|
458
|
+
const pkg = JSON.parse((0, import_node_fs5.readFileSync)(pkgPath, "utf-8"));
|
|
459
|
+
return pkg.version;
|
|
460
|
+
} catch {
|
|
461
|
+
return "unknown";
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
var version_default = getVersion();
|
|
450
465
|
|
|
451
466
|
// src/index.ts
|
|
452
467
|
var import_config = require("dotenv/config");
|
|
@@ -501,16 +516,76 @@ function info() {
|
|
|
501
516
|
console.log(`Default runtime: ${import_chalk13.default.bold("Bun")} (use --node flag to switch to Node.js)`);
|
|
502
517
|
}
|
|
503
518
|
|
|
519
|
+
// src/repl/index.ts
|
|
520
|
+
var import_node_fs6 = require("fs");
|
|
521
|
+
var import_node_path4 = require("path");
|
|
522
|
+
var import_chalk14 = __toESM(require("chalk"), 1);
|
|
523
|
+
function resolvePort(options) {
|
|
524
|
+
if (options.port) {
|
|
525
|
+
return Number(options.port);
|
|
526
|
+
}
|
|
527
|
+
try {
|
|
528
|
+
const portFile = (0, import_node_path4.resolve)(process.cwd(), ".orion/port");
|
|
529
|
+
const port = (0, import_node_fs6.readFileSync)(portFile, "utf-8").trim();
|
|
530
|
+
return Number(port);
|
|
531
|
+
} catch {
|
|
532
|
+
}
|
|
533
|
+
if (process.env.PORT) {
|
|
534
|
+
return Number(process.env.PORT);
|
|
535
|
+
}
|
|
536
|
+
return 3e3;
|
|
537
|
+
}
|
|
538
|
+
async function repl(options) {
|
|
539
|
+
var _a;
|
|
540
|
+
const expression = options.expression;
|
|
541
|
+
if (!expression) {
|
|
542
|
+
console.error(import_chalk14.default.red('Error: expression is required. Use -e "<expression>"'));
|
|
543
|
+
process.exit(1);
|
|
544
|
+
}
|
|
545
|
+
const port = resolvePort(options);
|
|
546
|
+
try {
|
|
547
|
+
const response = await fetch(`http://localhost:${port}/__repl`, {
|
|
548
|
+
method: "POST",
|
|
549
|
+
headers: { "Content-Type": "application/json" },
|
|
550
|
+
body: JSON.stringify({ expression })
|
|
551
|
+
});
|
|
552
|
+
const data = await response.json();
|
|
553
|
+
if (!data.success) {
|
|
554
|
+
console.error(import_chalk14.default.red(`Error: ${data.error}`));
|
|
555
|
+
if (data.stack) {
|
|
556
|
+
console.error(import_chalk14.default.dim(data.stack));
|
|
557
|
+
}
|
|
558
|
+
process.exit(1);
|
|
559
|
+
}
|
|
560
|
+
if (data.result !== void 0) {
|
|
561
|
+
console.log(
|
|
562
|
+
typeof data.result === "string" ? data.result : JSON.stringify(data.result, null, 2)
|
|
563
|
+
);
|
|
564
|
+
}
|
|
565
|
+
} catch (error) {
|
|
566
|
+
if (error.code === "ECONNREFUSED" || ((_a = error.cause) == null ? void 0 : _a.code) === "ECONNREFUSED") {
|
|
567
|
+
console.error(
|
|
568
|
+
import_chalk14.default.red(
|
|
569
|
+
`Could not connect to dev server on port ${port}. Make sure "orion dev --repl" is running.`
|
|
570
|
+
)
|
|
571
|
+
);
|
|
572
|
+
} else {
|
|
573
|
+
console.error(import_chalk14.default.red(`Error: ${error.message}`));
|
|
574
|
+
}
|
|
575
|
+
process.exit(1);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
|
|
504
579
|
// src/index.ts
|
|
505
580
|
var program = new import_commander.Command();
|
|
506
581
|
var run = (action) => async (...args) => {
|
|
507
582
|
try {
|
|
508
583
|
await action(...args);
|
|
509
584
|
} catch (e) {
|
|
510
|
-
console.error(
|
|
585
|
+
console.error(import_chalk15.default.red(`Error: ${e.message}`));
|
|
511
586
|
}
|
|
512
587
|
};
|
|
513
|
-
program.command("dev").description("Run the Orionjs app in development mode").option("--node", "Use Node.js runtime instead of Bun").allowUnknownOption().action(run(dev_default));
|
|
588
|
+
program.command("dev").description("Run the Orionjs app in development mode").option("--node", "Use Node.js runtime instead of Bun").option("--repl", "Enable REPL endpoint for orion repl").allowUnknownOption().action(run(dev_default));
|
|
514
589
|
program.command("check").description("Runs a typescript check").action(run(check_default));
|
|
515
590
|
program.command("build").description("Build the Orionjs app for production").option("--output [path]", "Path of the output file").action(run(build_default));
|
|
516
591
|
program.command("prod").allowUnknownOption().option("--node", "Use Node.js runtime instead of Bun").option(
|
|
@@ -519,6 +594,7 @@ program.command("prod").allowUnknownOption().option("--node", "Use Node.js runti
|
|
|
519
594
|
).description("Run the Orionjs app in production mode").action(run(prod_default));
|
|
520
595
|
program.command("create").description("Creates a new Orionjs project").option("--name [name]", "Name of the project").option("--kit [kit]", "Which starter kit to use").action(run(create_default));
|
|
521
596
|
program.command("info").description("Print runtime and version info").action(run(info));
|
|
597
|
+
program.command("repl").description("Evaluate an expression against a running Orionjs dev server").requiredOption("-e, --expression <expression>", "Expression to evaluate").option("--port <port>", "Port of the dev server (default: auto-detect from .orion/port)").action(run(repl));
|
|
522
598
|
program.version(version_default, "-v --version");
|
|
523
599
|
program.parse(process.argv);
|
|
524
600
|
if (!process.argv.slice(2).length) {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/helpers/execute.ts","../src/create/index.ts","../src/dev/index.ts","../src/dev/runner/index.ts","../src/helpers/writeFile.ts","../src/helpers/ensureDirectory.ts","../src/dev/runner/startProcess.ts","../src/dev/runner/getArgs.ts","../src/dev/watchAndCompile/index.ts","../src/dev/watchAndCompile/cleanDirectory.ts","../src/dev/watchAndCompile/getHost.ts","../src/dev/watchAndCompile/getConfigPath.ts","../src/dev/watchAndCompile/ensureConfigComplies.ts","../src/helpers/getFileContents.ts","../src/dev/watchAndCompile/reports.ts","../src/dev/watchAndCompile/writeEnvFile.ts","../src/prod/index.ts","../src/build/index.ts","../src/build/build.ts","../src/build/checkTs.ts","../src/prod/runProd.ts","../src/handleErrors.ts","../src/version.ts","../src/check/index.ts","../src/check/checkTs.ts","../src/info.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk'\nimport {Command} from 'commander'\nimport create from './create'\nimport dev from './dev'\nimport prod from './prod'\nimport './handleErrors'\nimport version from './version'\nimport 'dotenv/config'\nimport build from './build'\nimport check from './check'\nimport info from './info'\n\nconst program = new Command()\n\nconst run =\n action =>\n async (...args) => {\n try {\n await action(...args)\n } catch (e) {\n console.error(chalk.red(`Error: ${e.message}`))\n }\n }\n\nprogram\n .command('dev')\n .description('Run the Orionjs app in development mode')\n .option('--node', 'Use Node.js runtime instead of Bun')\n .allowUnknownOption()\n .action(run(dev))\n\nprogram.command('check').description('Runs a typescript check').action(run(check))\n\nprogram\n .command('build')\n .description('Build the Orionjs app for production')\n .option('--output [path]', 'Path of the output file')\n .action(run(build))\n\nprogram\n .command('prod')\n .allowUnknownOption()\n .option('--node', 'Use Node.js runtime instead of Bun')\n .option(\n '--path [path]',\n 'Path of the compiled Orionjs app. If not provided, the app will be compiled and then run',\n )\n .description('Run the Orionjs app in production mode')\n .action(run(prod))\n\nprogram\n .command('create')\n .description('Creates a new Orionjs project')\n .option('--name [name]', 'Name of the project')\n .option('--kit [kit]', 'Which starter kit to use')\n .action(run(create))\n\nprogram.command('info').description('Print runtime and version info').action(run(info))\n\nprogram.version(version, '-v --version')\n\nprogram.parse(process.argv)\n\nif (!process.argv.slice(2).length) {\n program.outputHelp()\n}\n","import {exec} from 'node:child_process'\n\nexport default async function (command) {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error)\n } else {\n resolve({stdout, stderr})\n }\n })\n })\n}\n","import execute from '../helpers/execute'\n\nexport default async function ({name, kit}) {\n if (!name) {\n throw new Error('Please set the name of the app')\n }\n if (!kit) {\n throw new Error('Please select which kit to use')\n }\n const repo = `https://github.com/siturra/boilerplate-orionjs-${kit}`\n console.log('Downloading starter kit...')\n await execute(`git clone ${repo} ${name}`)\n await execute(`cd ${name} && rm -rf .git`)\n console.log('Your starter kit is ready')\n}\n","import chalk from 'chalk'\nimport {getRunner, RunnerOptions} from './runner'\nimport watchAndCompile from './watchAndCompile'\n\nexport default async function (options: RunnerOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Dev mode \\n`))\n\n const runner = getRunner(options, command)\n\n watchAndCompile(runner)\n}\n","import chalk from 'chalk'\nimport writeFile from '../../helpers/writeFile'\nimport {startProcess} from './startProcess'\n\nexport interface RunnerOptions {\n shell: boolean\n clean: boolean\n node: boolean\n}\n\nexport interface Runner {\n start: () => void\n restart: () => void\n stop: () => void\n}\n\nexport function getRunner(options: RunnerOptions, command: any): Runner {\n let appProcess = null\n\n if (options.clean) {\n console.log(chalk.bold('=> Cleaning directory...\\n'))\n }\n\n const startApp = () => {\n appProcess = startProcess(options, command)\n\n appProcess.on('exit', (code: number, signal: string) => {\n if (!code || code === 143 || code === 0 || signal === 'SIGTERM' || signal === 'SIGINT') {\n } else {\n console.log(chalk.bold(`=> Error running app. Exit code: ${code}`))\n }\n })\n\n writeFile('.orion/process', `${appProcess.pid}`)\n }\n\n const stop = () => {\n if (appProcess) {\n appProcess.kill()\n appProcess = null\n }\n }\n\n const restart = () => {\n console.log(chalk.bold('=> Restarting app...\\n'))\n stop()\n startApp()\n }\n\n const start = () => {\n // check if the app is already running\n if (appProcess) {\n // console.log(chalk.bold('=> App is already running. Restarting...\\n'))\n } else {\n startApp()\n }\n }\n\n return {\n restart,\n stop,\n start,\n }\n}\n","import fs from 'node:fs'\nimport ensureDirectory from '../helpers/ensureDirectory'\n\nexport default async function (path: string, content: string): Promise<void> {\n ensureDirectory(path)\n fs.writeFileSync(path, content)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst ensureDirectory = filePath => {\n const dirname = path.dirname(filePath)\n if (fs.existsSync(dirname)) return true\n ensureDirectory(dirname)\n fs.mkdirSync(dirname)\n}\n\nexport default ensureDirectory\n","import {spawn} from 'node:child_process'\nimport {getArgs} from './getArgs'\nimport {RunnerOptions} from './index'\nimport chalk from 'chalk'\n\nexport function startProcess(options: RunnerOptions, command: any) {\n const {startCommand, args} = getArgs(options, command)\n\n console.log(chalk.bold(`=> Starting app with command: ${startCommand} ${args.join(' ')}...\\n`))\n return spawn(startCommand, args, {\n env: {\n ORION_DEV: 'local',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n detached: false,\n })\n}\n","import {RunnerOptions} from './index'\n\nexport function getArgs(options: RunnerOptions, command: any) {\n if (options.node) {\n const startCommand = 'tsx'\n const args = ['watch', '--clear-screen=false', ...command.args, './app/index.ts']\n return {startCommand, args}\n }\n\n const startCommand = 'bun'\n const args = ['--watch', ...command.args, './app/index.ts']\n return {startCommand, args}\n}\n","import ts from 'typescript'\nimport {Runner} from '../runner'\nimport cleanDirectory from './cleanDirectory'\nimport {getHost} from './getHost'\nimport {watchEnvFile} from './writeEnvFile'\n\nexport default async function watchAndCompile(runner: Runner) {\n await cleanDirectory()\n const host = getHost(runner)\n ts.createWatchProgram(host)\n watchEnvFile(runner)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\n/**\n * Remove directory recursively\n * @param {string} dir_path\n * @see https://stackoverflow.com/a/42505874/3027390\n */\nfunction rimraf(dir_path: string) {\n if (fs.existsSync(dir_path)) {\n fs.readdirSync(dir_path).map(entry => {\n const entry_path = path.join(dir_path, entry)\n if (fs.lstatSync(entry_path).isDirectory()) {\n rimraf(entry_path)\n } else {\n fs.unlinkSync(entry_path)\n }\n })\n fs.rmdirSync(dir_path)\n }\n}\n\nexport default async function cleanDirectory(directory?: string) {\n try {\n const dirPath = directory ? directory : path.join(process.cwd(), '.orion', 'build')\n rimraf(dirPath)\n } catch (_) {\n // Ignore errors during cleanup\n }\n}\n","import ts from 'typescript'\nimport {getConfigPath} from './getConfigPath'\nimport {reportDiagnostic} from './reports'\nimport {Runner} from '../runner'\nimport chalk from 'chalk'\n\nexport function getHost(runner: Runner) {\n let isStopped = true\n const reportWatchStatusChanged = (diagnostic: ts.Diagnostic) => {\n if (diagnostic.category !== 3) return\n if (diagnostic.code === 6031 || diagnostic.code === 6032) {\n // file change detected, starting compilation\n // console.log(chalk.bold(`=> ${diagnostic.messageText}`))\n return\n }\n\n if (diagnostic.code === 6193) {\n runner.stop()\n isStopped = true\n return\n }\n\n if (diagnostic.code === 6194) {\n /**\n * Sometimes diagnostic code is 6194 even with errors\n */\n if (/^Found .+ errors?/.test(diagnostic.messageText.toString())) {\n if (!diagnostic.messageText.toString().includes('Found 0 errors.')) {\n runner.stop()\n isStopped = true\n return\n }\n }\n\n if (isStopped) {\n isStopped = false\n runner.start()\n }\n return\n }\n\n console.log(chalk.bold(`=> ${diagnostic.messageText} [${diagnostic.code}]`))\n }\n\n const configPath = getConfigPath()\n const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram\n\n const host = ts.createWatchCompilerHost(\n configPath,\n {},\n ts.sys,\n createProgram,\n reportDiagnostic,\n reportWatchStatusChanged,\n )\n\n return host\n}\n","import ts from 'typescript'\nimport {ensureConfigComplies} from './ensureConfigComplies'\n\nexport function getConfigPath() {\n const appBasePath = process.cwd()\n\n const configPath =\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.server.json') ||\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.json')\n\n if (!configPath) {\n throw new Error(\"Could not find a valid 'tsconfig.json'.\")\n }\n\n ensureConfigComplies(configPath)\n\n return configPath\n}\n","import {parse, stringify} from 'comment-json'\nimport getFileContents from '../../helpers/getFileContents'\nimport writeFile from '../../helpers/writeFile'\n\n// Define TypeScript config interface\ninterface TSConfig {\n compilerOptions?: {\n baseUrl?: string\n rootDir?: string\n rootDirs?: string[]\n [key: string]: any\n }\n [key: string]: any\n}\n\nexport function ensureConfigComplies(configPath: string) {\n try {\n const configJSON = getFileContents(configPath)\n const config = parse(configJSON) as TSConfig\n\n const newConfig = {\n ...config,\n compilerOptions: {\n ...config.compilerOptions,\n baseUrl: './',\n noEmit: true,\n },\n }\n\n if (!config.compilerOptions?.rootDir && !config.compilerOptions?.rootDirs) {\n newConfig.compilerOptions.rootDir = './app'\n }\n\n // are the same, no write\n if (JSON.stringify(config) === JSON.stringify(newConfig)) {\n return\n }\n\n writeFile(configPath, stringify(newConfig, null, 2))\n } catch (error) {\n console.log(`Error reading tsconfig: ${error.message}`)\n }\n}\n","import fs from 'node:fs'\n\nexport default function readFile(filePath: string) {\n if (!fs.existsSync(filePath)) return null\n\n return fs.readFileSync(filePath).toString()\n}\n","import ts from 'typescript'\n\nconst format = {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => ts.sys.newLine,\n}\nexport function reportDiagnostic(diagnostic: ts.Diagnostic) {\n console.log(ts.formatDiagnosticsWithColorAndContext([diagnostic], format))\n}\n","import {writeDtsFileFromConfigFile} from '@orion-js/env'\nimport chalk from 'chalk'\nimport chokidar from 'chokidar'\nimport {Runner} from '../runner'\n\nconst envFilePath = process.env.ORION_ENV_FILE_PATH\nconst dtsFilePath = './app/env.d.ts'\n\nexport const watchEnvFile = async (runner: Runner) => {\n if (!envFilePath) return\n\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n\n chokidar.watch(envFilePath, {ignoreInitial: true}).on('change', async () => {\n console.log(chalk.bold('=> Environment file changed. Restarting...'))\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n runner.restart()\n })\n}\n","import chalk from 'chalk'\nimport build from '../build'\nimport {runProd} from './runProd'\n\nexport interface ProdOptions {\n path?: string\n node?: boolean\n}\n\nexport default async function (options: ProdOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Prod mode\\n`))\n\n if (options.node) {\n if (!options.path) {\n await build({output: './build'})\n options.path = './build'\n }\n }\n\n runProd(options, command)\n}\n","import chalk from 'chalk'\nimport {build} from './build'\nimport cleanDirectory from '../dev/watchAndCompile/cleanDirectory'\nimport {checkTs} from './checkTs'\n\nexport default async function (options: {output?: string}) {\n console.log(chalk.bold(`Building Orionjs App ${chalk.green(chalk.bold('V4'))}...`))\n\n if (!options.output) {\n options.output = './build'\n }\n\n await cleanDirectory(options.output)\n\n await checkTs()\n await build(options)\n\n console.log(chalk.bold('Build completed'))\n}\n","import chalk from 'chalk'\nimport * as esbuild from 'esbuild'\n\nexport async function build(options: {output?: string}) {\n const {output} = options\n\n console.log(`Building with esbuild to ${output}`)\n\n await esbuild.build({\n entryPoints: ['./app/index.ts'],\n tsconfig: './tsconfig.json',\n format: 'esm',\n platform: 'node',\n outdir: output,\n bundle: true,\n target: 'node22',\n sourcemap: true,\n allowOverwrite: true,\n minify: true,\n packages: 'external',\n })\n\n console.log(chalk.green.bold('Build successful'))\n}\n","import chalk from 'chalk'\nimport {exec} from 'node:child_process'\nimport {promisify} from 'node:util'\n\nconst execPromise = promisify(exec)\n\nexport async function checkTs(): Promise<void> {\n try {\n console.log('Checking TypeScript...')\n await execPromise('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n })\n console.log(chalk.green.bold('TypeScript check passed'))\n } catch (error) {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n console.log(error.stderr || error.stdout || error.message)\n process.exit(1)\n }\n}\n","import {spawn} from 'node:child_process'\nimport {ProdOptions} from './index'\n\nexport function runProd(options: ProdOptions, command: any) {\n if (options.node) {\n const indexPath = `${options.path}/index.js`\n const args = ['--import=tsx', ...command.args, indexPath]\n spawn('node', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n return\n }\n\n const args = [...command.args, './app/index.ts']\n spawn('bun', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n}\n","import chalk from 'chalk'\n\ninterface ErrorWithCodeFrame extends Error {\n codeFrame?: string\n}\n\nprocess\n .on('unhandledRejection', (error: ErrorWithCodeFrame) => {\n if (error.codeFrame) {\n console.error(chalk.red(error.message))\n console.log(error.codeFrame)\n } else {\n console.error(chalk.red(error.message), chalk.red('Unhandled promise rejection'))\n }\n })\n .on('uncaughtException', (error: Error) => {\n console.error(chalk.red(error.message))\n process.exit(1)\n })\n","export default '3.0'\n","import chalk from 'chalk'\nimport {checkTs} from './checkTs'\n\nexport default async function () {\n console.log(chalk.bold(`Orionjs App ${chalk.green(chalk.bold('V4'))}\\n`))\n console.log('Checking typescript...')\n\n checkTs()\n\n console.log(chalk.bold.green('Check passed\\n'))\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\n\nexport function checkTs() {\n try {\n execSync('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n stdio: 'inherit',\n })\n } catch {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n process.exit(1)\n }\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\nimport version from './version'\n\nfunction detectRuntime(): string {\n const runtimes: string[] = []\n\n try {\n const bunVersion = execSync('bun --version', {encoding: 'utf-8'}).trim()\n runtimes.push(`Bun ${bunVersion}`)\n } catch {}\n\n runtimes.push(`Node ${process.versions.node}`)\n\n return runtimes.join(', ')\n}\n\nexport default function info() {\n console.log(`Orion CLI v${version} — Available runtimes: ${chalk.bold(detectRuntime())}`)\n console.log(`Default runtime: ${chalk.bold('Bun')} (use --node flag to switch to Node.js)`)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,iBAAkB;AAClB,uBAAsB;;;ACFtB,gCAAmB;AAEnB,eAAO,gBAAwB,SAAS;AACtC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,wCAAK,SAAS,CAAC,OAAO,QAAQ,WAAW;AACvC,UAAI,OAAO;AACT,eAAO,KAAK;AAAA,MACd,OAAO;AACL,gBAAQ,EAAC,QAAQ,OAAM,CAAC;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;;;ACVA,eAAO,eAAwB,EAAC,MAAM,IAAG,GAAG;AAC1C,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AACA,MAAI,C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k","import_chalk","import_chalk","import_node_fs","path","fs","path","fs","import_node_child_process","startCommand","args","chalk","chalk","import_typescript","import_node_fs","import_node_path","fs","path","import_typescript","import_node_fs","fs","ts","import_typescript","ts","import_chalk","chalk","ts","import_chalk","chokidar","chalk","ts","chalk","import_chalk","import_chalk","import_chalk","build","chalk","import_chalk","import_node_child_process","chalk","chalk","build","import_node_child_process","args","chalk","import_chalk","chalk","import_chalk","import_chalk","import_node_child_process","checkTs","chalk","chalk","checkTs","import_chalk","import_node_child_process","chalk","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/helpers/execute.ts","../src/create/index.ts","../src/dev/index.ts","../src/dev/runner/index.ts","../src/helpers/writeFile.ts","../src/helpers/ensureDirectory.ts","../src/dev/runner/startProcess.ts","../src/dev/runner/getArgs.ts","../src/dev/watchAndCompile/index.ts","../src/dev/watchAndCompile/cleanDirectory.ts","../src/dev/watchAndCompile/getHost.ts","../src/dev/watchAndCompile/getConfigPath.ts","../src/dev/watchAndCompile/ensureConfigComplies.ts","../src/helpers/getFileContents.ts","../src/dev/watchAndCompile/reports.ts","../src/dev/watchAndCompile/writeEnvFile.ts","../src/prod/index.ts","../src/build/index.ts","../src/build/build.ts","../src/build/checkTs.ts","../src/prod/runProd.ts","../src/handleErrors.ts","../src/version.ts","../src/check/index.ts","../src/check/checkTs.ts","../src/info.ts","../src/repl/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk'\nimport {Command} from 'commander'\nimport create from './create'\nimport dev from './dev'\nimport prod from './prod'\nimport './handleErrors'\nimport version from './version'\nimport 'dotenv/config'\nimport build from './build'\nimport check from './check'\nimport info from './info'\nimport repl from './repl'\n\nconst program = new Command()\n\nconst run =\n action =>\n async (...args) => {\n try {\n await action(...args)\n } catch (e) {\n console.error(chalk.red(`Error: ${e.message}`))\n }\n }\n\nprogram\n .command('dev')\n .description('Run the Orionjs app in development mode')\n .option('--node', 'Use Node.js runtime instead of Bun')\n .option('--repl', 'Enable REPL endpoint for orion repl')\n .allowUnknownOption()\n .action(run(dev))\n\nprogram.command('check').description('Runs a typescript check').action(run(check))\n\nprogram\n .command('build')\n .description('Build the Orionjs app for production')\n .option('--output [path]', 'Path of the output file')\n .action(run(build))\n\nprogram\n .command('prod')\n .allowUnknownOption()\n .option('--node', 'Use Node.js runtime instead of Bun')\n .option(\n '--path [path]',\n 'Path of the compiled Orionjs app. If not provided, the app will be compiled and then run',\n )\n .description('Run the Orionjs app in production mode')\n .action(run(prod))\n\nprogram\n .command('create')\n .description('Creates a new Orionjs project')\n .option('--name [name]', 'Name of the project')\n .option('--kit [kit]', 'Which starter kit to use')\n .action(run(create))\n\nprogram.command('info').description('Print runtime and version info').action(run(info))\n\nprogram\n .command('repl')\n .description('Evaluate an expression against a running Orionjs dev server')\n .requiredOption('-e, --expression <expression>', 'Expression to evaluate')\n .option('--port <port>', 'Port of the dev server (default: auto-detect from .orion/port)')\n .action(run(repl))\n\nprogram.version(version, '-v --version')\n\nprogram.parse(process.argv)\n\nif (!process.argv.slice(2).length) {\n program.outputHelp()\n}\n","import {exec} from 'node:child_process'\n\nexport default async function (command) {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error)\n } else {\n resolve({stdout, stderr})\n }\n })\n })\n}\n","import execute from '../helpers/execute'\n\nexport default async function ({name, kit}) {\n if (!name) {\n throw new Error('Please set the name of the app')\n }\n if (!kit) {\n throw new Error('Please select which kit to use')\n }\n const repo = `https://github.com/siturra/boilerplate-orionjs-${kit}`\n console.log('Downloading starter kit...')\n await execute(`git clone ${repo} ${name}`)\n await execute(`cd ${name} && rm -rf .git`)\n console.log('Your starter kit is ready')\n}\n","import chalk from 'chalk'\nimport {getRunner, RunnerOptions} from './runner'\nimport watchAndCompile from './watchAndCompile'\n\nexport default async function (options: RunnerOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Dev mode \\n`))\n\n const runner = getRunner(options, command)\n\n watchAndCompile(runner)\n}\n","import chalk from 'chalk'\nimport writeFile from '../../helpers/writeFile'\nimport {startProcess} from './startProcess'\n\nexport interface RunnerOptions {\n shell: boolean\n clean: boolean\n node: boolean\n repl: boolean\n}\n\nexport interface Runner {\n start: () => void\n restart: () => void\n stop: () => void\n}\n\nexport function getRunner(options: RunnerOptions, command: any): Runner {\n let appProcess = null\n\n if (options.clean) {\n console.log(chalk.bold('=> Cleaning directory...\\n'))\n }\n\n const startApp = () => {\n appProcess = startProcess(options, command)\n\n appProcess.on('exit', (code: number, signal: string) => {\n if (!code || code === 143 || code === 0 || signal === 'SIGTERM' || signal === 'SIGINT') {\n } else {\n console.log(chalk.bold(`=> Error running app. Exit code: ${code}`))\n }\n })\n\n writeFile('.orion/process', `${appProcess.pid}`)\n }\n\n const stop = () => {\n if (appProcess) {\n appProcess.kill()\n appProcess = null\n }\n }\n\n const restart = () => {\n console.log(chalk.bold('=> Restarting app...\\n'))\n stop()\n startApp()\n }\n\n const start = () => {\n // check if the app is already running\n if (appProcess) {\n // console.log(chalk.bold('=> App is already running. Restarting...\\n'))\n } else {\n startApp()\n }\n }\n\n return {\n restart,\n stop,\n start,\n }\n}\n","import fs from 'node:fs'\nimport ensureDirectory from '../helpers/ensureDirectory'\n\nexport default async function (path: string, content: string): Promise<void> {\n ensureDirectory(path)\n fs.writeFileSync(path, content)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst ensureDirectory = filePath => {\n const dirname = path.dirname(filePath)\n if (fs.existsSync(dirname)) return true\n ensureDirectory(dirname)\n fs.mkdirSync(dirname)\n}\n\nexport default ensureDirectory\n","import {spawn} from 'node:child_process'\nimport chalk from 'chalk'\nimport {getArgs} from './getArgs'\nimport {RunnerOptions} from './index'\n\nexport function startProcess(options: RunnerOptions, command: any) {\n const {startCommand, args} = getArgs(options, command)\n\n console.log(chalk.bold(`=> Starting app with command: ${startCommand} ${args.join(' ')}...\\n`))\n return spawn(startCommand, args, {\n env: {\n ORION_DEV: 'local',\n ...process.env,\n ...(options.repl ? {ORION_REPL: 'true'} : {}),\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n detached: false,\n })\n}\n","import {RunnerOptions} from './index'\n\nexport function getArgs(options: RunnerOptions, command: any) {\n if (options.node) {\n const startCommand = 'tsx'\n const args = ['watch', '--clear-screen=false', ...command.args, './app/index.ts']\n return {startCommand, args}\n }\n\n const startCommand = 'bun'\n const args = ['--watch', ...command.args, './app/index.ts']\n return {startCommand, args}\n}\n","import ts from 'typescript'\nimport {Runner} from '../runner'\nimport cleanDirectory from './cleanDirectory'\nimport {getHost} from './getHost'\nimport {watchEnvFile} from './writeEnvFile'\n\nexport default async function watchAndCompile(runner: Runner) {\n await cleanDirectory()\n const host = getHost(runner)\n ts.createWatchProgram(host)\n watchEnvFile(runner)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\n/**\n * Remove directory recursively\n * @param {string} dir_path\n * @see https://stackoverflow.com/a/42505874/3027390\n */\nfunction rimraf(dir_path: string) {\n if (fs.existsSync(dir_path)) {\n fs.readdirSync(dir_path).map(entry => {\n const entry_path = path.join(dir_path, entry)\n if (fs.lstatSync(entry_path).isDirectory()) {\n rimraf(entry_path)\n } else {\n fs.unlinkSync(entry_path)\n }\n })\n fs.rmdirSync(dir_path)\n }\n}\n\nexport default async function cleanDirectory(directory?: string) {\n try {\n const dirPath = directory ? directory : path.join(process.cwd(), '.orion', 'build')\n rimraf(dirPath)\n } catch (_) {\n // Ignore errors during cleanup\n }\n}\n","import ts from 'typescript'\nimport {getConfigPath} from './getConfigPath'\nimport {reportDiagnostic} from './reports'\nimport {Runner} from '../runner'\nimport chalk from 'chalk'\n\nexport function getHost(runner: Runner) {\n let isStopped = true\n const reportWatchStatusChanged = (diagnostic: ts.Diagnostic) => {\n if (diagnostic.category !== 3) return\n if (diagnostic.code === 6031 || diagnostic.code === 6032) {\n // file change detected, starting compilation\n // console.log(chalk.bold(`=> ${diagnostic.messageText}`))\n return\n }\n\n if (diagnostic.code === 6193) {\n runner.stop()\n isStopped = true\n return\n }\n\n if (diagnostic.code === 6194) {\n /**\n * Sometimes diagnostic code is 6194 even with errors\n */\n if (/^Found .+ errors?/.test(diagnostic.messageText.toString())) {\n if (!diagnostic.messageText.toString().includes('Found 0 errors.')) {\n runner.stop()\n isStopped = true\n return\n }\n }\n\n if (isStopped) {\n isStopped = false\n runner.start()\n }\n return\n }\n\n console.log(chalk.bold(`=> ${diagnostic.messageText} [${diagnostic.code}]`))\n }\n\n const configPath = getConfigPath()\n const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram\n\n const host = ts.createWatchCompilerHost(\n configPath,\n {},\n ts.sys,\n createProgram,\n reportDiagnostic,\n reportWatchStatusChanged,\n )\n\n return host\n}\n","import ts from 'typescript'\nimport {ensureConfigComplies} from './ensureConfigComplies'\n\nexport function getConfigPath() {\n const appBasePath = process.cwd()\n\n const configPath =\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.server.json') ||\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.json')\n\n if (!configPath) {\n throw new Error(\"Could not find a valid 'tsconfig.json'.\")\n }\n\n ensureConfigComplies(configPath)\n\n return configPath\n}\n","import {parse, stringify} from 'comment-json'\nimport getFileContents from '../../helpers/getFileContents'\nimport writeFile from '../../helpers/writeFile'\n\n// Define TypeScript config interface\ninterface TSConfig {\n compilerOptions?: {\n baseUrl?: string\n rootDir?: string\n rootDirs?: string[]\n [key: string]: any\n }\n [key: string]: any\n}\n\nexport function ensureConfigComplies(configPath: string) {\n try {\n const configJSON = getFileContents(configPath)\n const config = parse(configJSON) as TSConfig\n\n const newConfig = {\n ...config,\n compilerOptions: {\n ...config.compilerOptions,\n baseUrl: './',\n noEmit: true,\n },\n }\n\n if (!config.compilerOptions?.rootDir && !config.compilerOptions?.rootDirs) {\n newConfig.compilerOptions.rootDir = './app'\n }\n\n // are the same, no write\n if (JSON.stringify(config) === JSON.stringify(newConfig)) {\n return\n }\n\n writeFile(configPath, stringify(newConfig, null, 2))\n } catch (error) {\n console.log(`Error reading tsconfig: ${error.message}`)\n }\n}\n","import fs from 'node:fs'\n\nexport default function readFile(filePath: string) {\n if (!fs.existsSync(filePath)) return null\n\n return fs.readFileSync(filePath).toString()\n}\n","import ts from 'typescript'\n\nconst format = {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => ts.sys.newLine,\n}\nexport function reportDiagnostic(diagnostic: ts.Diagnostic) {\n console.log(ts.formatDiagnosticsWithColorAndContext([diagnostic], format))\n}\n","import {writeDtsFileFromConfigFile} from '@orion-js/env'\nimport chalk from 'chalk'\nimport chokidar from 'chokidar'\nimport {Runner} from '../runner'\n\nconst envFilePath = process.env.ORION_ENV_FILE_PATH\nconst dtsFilePath = './app/env.d.ts'\n\nexport const watchEnvFile = async (runner: Runner) => {\n if (!envFilePath) return\n\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n\n chokidar.watch(envFilePath, {ignoreInitial: true}).on('change', async () => {\n console.log(chalk.bold('=> Environment file changed. Restarting...'))\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n runner.restart()\n })\n}\n","import chalk from 'chalk'\nimport build from '../build'\nimport {runProd} from './runProd'\n\nexport interface ProdOptions {\n path?: string\n node?: boolean\n}\n\nexport default async function (options: ProdOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Prod mode\\n`))\n\n if (options.node) {\n if (!options.path) {\n await build({output: './build'})\n options.path = './build'\n }\n }\n\n runProd(options, command)\n}\n","import chalk from 'chalk'\nimport {build} from './build'\nimport cleanDirectory from '../dev/watchAndCompile/cleanDirectory'\nimport {checkTs} from './checkTs'\n\nexport default async function (options: {output?: string}) {\n console.log(chalk.bold(`Building Orionjs App ${chalk.green(chalk.bold('V4'))}...`))\n\n if (!options.output) {\n options.output = './build'\n }\n\n await cleanDirectory(options.output)\n\n await checkTs()\n await build(options)\n\n console.log(chalk.bold('Build completed'))\n}\n","import chalk from 'chalk'\nimport * as esbuild from 'esbuild'\n\nexport async function build(options: {output?: string}) {\n const {output} = options\n\n console.log(`Building with esbuild to ${output}`)\n\n await esbuild.build({\n entryPoints: ['./app/index.ts'],\n tsconfig: './tsconfig.json',\n format: 'esm',\n platform: 'node',\n outdir: output,\n bundle: true,\n target: 'node22',\n sourcemap: true,\n allowOverwrite: true,\n minify: true,\n packages: 'external',\n })\n\n console.log(chalk.green.bold('Build successful'))\n}\n","import chalk from 'chalk'\nimport {exec} from 'node:child_process'\nimport {promisify} from 'node:util'\n\nconst execPromise = promisify(exec)\n\nexport async function checkTs(): Promise<void> {\n try {\n console.log('Checking TypeScript...')\n await execPromise('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n })\n console.log(chalk.green.bold('TypeScript check passed'))\n } catch (error) {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n console.log(error.stderr || error.stdout || error.message)\n process.exit(1)\n }\n}\n","import {spawn} from 'node:child_process'\nimport {ProdOptions} from './index'\n\nexport function runProd(options: ProdOptions, command: any) {\n if (options.node) {\n const indexPath = `${options.path}/index.js`\n const args = ['--import=tsx', ...command.args, indexPath]\n spawn('node', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n return\n }\n\n const args = [...command.args, './app/index.ts']\n spawn('bun', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n}\n","import chalk from 'chalk'\n\ninterface ErrorWithCodeFrame extends Error {\n codeFrame?: string\n}\n\nprocess\n .on('unhandledRejection', (error: ErrorWithCodeFrame) => {\n if (error.codeFrame) {\n console.error(chalk.red(error.message))\n console.log(error.codeFrame)\n } else {\n console.error(chalk.red(error.message), chalk.red('Unhandled promise rejection'))\n }\n })\n .on('uncaughtException', (error: Error) => {\n console.error(chalk.red(error.message))\n process.exit(1)\n })\n","import {readFileSync} from 'node:fs'\nimport {dirname, resolve} from 'node:path'\nimport {fileURLToPath} from 'node:url'\n\nfunction getVersion(): string {\n try {\n const dir = dirname(fileURLToPath(import.meta.url))\n const pkgPath = resolve(dir, '..', 'package.json')\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))\n return pkg.version\n } catch {\n return 'unknown'\n }\n}\n\nexport default getVersion()\n","import chalk from 'chalk'\nimport {checkTs} from './checkTs'\n\nexport default async function () {\n console.log(chalk.bold(`Orionjs App ${chalk.green(chalk.bold('V4'))}\\n`))\n console.log('Checking typescript...')\n\n checkTs()\n\n console.log(chalk.bold.green('Check passed\\n'))\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\n\nexport function checkTs() {\n try {\n execSync('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n stdio: 'inherit',\n })\n } catch {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n process.exit(1)\n }\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\nimport version from './version'\n\nfunction detectRuntime(): string {\n const runtimes: string[] = []\n\n try {\n const bunVersion = execSync('bun --version', {encoding: 'utf-8'}).trim()\n runtimes.push(`Bun ${bunVersion}`)\n } catch {}\n\n runtimes.push(`Node ${process.versions.node}`)\n\n return runtimes.join(', ')\n}\n\nexport default function info() {\n console.log(`Orion CLI v${version} — Available runtimes: ${chalk.bold(detectRuntime())}`)\n console.log(`Default runtime: ${chalk.bold('Bun')} (use --node flag to switch to Node.js)`)\n}\n","import {readFileSync} from 'node:fs'\nimport {resolve} from 'node:path'\nimport chalk from 'chalk'\n\nexport interface ReplOptions {\n expression?: string\n port?: string\n}\n\nfunction resolvePort(options: ReplOptions): number {\n if (options.port) {\n return Number(options.port)\n }\n\n try {\n const portFile = resolve(process.cwd(), '.orion/port')\n const port = readFileSync(portFile, 'utf-8').trim()\n return Number(port)\n } catch {}\n\n if (process.env.PORT) {\n return Number(process.env.PORT)\n }\n\n return 3000\n}\n\nexport default async function repl(options: ReplOptions) {\n const expression = options.expression\n\n if (!expression) {\n console.error(chalk.red('Error: expression is required. Use -e \"<expression>\"'))\n process.exit(1)\n }\n\n const port = resolvePort(options)\n\n try {\n const response = await fetch(`http://localhost:${port}/__repl`, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({expression}),\n })\n\n const data = await response.json()\n\n if (!data.success) {\n console.error(chalk.red(`Error: ${data.error}`))\n if (data.stack) {\n console.error(chalk.dim(data.stack))\n }\n process.exit(1)\n }\n\n if (data.result !== undefined) {\n console.log(\n typeof data.result === 'string' ? data.result : JSON.stringify(data.result, null, 2),\n )\n }\n } catch (error) {\n if (error.code === 'ECONNREFUSED' || error.cause?.code === 'ECONNREFUSED') {\n console.error(\n chalk.red(\n `Could not connect to dev server on port ${port}. Make sure \"orion dev --repl\" is running.`,\n ),\n )\n } else {\n console.error(chalk.red(`Error: ${error.message}`))\n }\n process.exit(1)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,iBAAkB;AAClB,uBAAsB;;;ACFtB,gCAAmB;AAEnB,eAAO,gBAAwB,SAAS;AACtC,SAAO,IAAI,QAAQ,CAACC,UAAS,WAAW;AACtC,wCAAK,SAAS,CAAC,OAAO,QAAQ,WAAW;AACvC,UAAI,OAAO;AACT,eAAO,KAAK;AAAA,MACd,OAAO;AACL,QAAAA,SAAQ,EAAC,QAAQ,OAAM,CAAC;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;;;ACVA,eAAO,eAAwB,EAAC,MAAM,IAAG,GAAG;AAC1C,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AACA,MAAI,CAAC,KAAK;AACR,UAAM,IAA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WAAG,CAAC;AAElB,QAAQ,QAAQ,OAAO,EAAE,YAAY,yBAAyB,EAAE,OAAO,IAAI,aAAK,CAAC;AAEjF,QACG,QAAQ,OAAO,EACf,YAAY,sCAAsC,EAClD,OAAO,mBAAmB,yBAAyB,EACnD,OAAO,IAAI,aAAK,CAAC;AAEpB,QACG,QAAQ,MAAM,EACd,mBAAmB,EACnB,OAAO,UAAU,oCAAoC,EACrD;AAAA,EACC;AAAA,EACA;AACF,EACC,YAAY,wCAAwC,EACpD,OAAO,IAAI,YAAI,CAAC;AAEnB,QACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,OAAO,iBAAiB,qBAAqB,EAC7C,OAAO,eAAe,0BAA0B,EAChD,OAAO,IAAI,cAAM,CAAC;AAErB,QAAQ,QAAQ,MAAM,EAAE,YAAY,gCAAgC,EAAE,OAAO,IAAI,IAAI,CAAC;AAEtF,QACG,QAAQ,MAAM,EACd,YAAY,6DAA6D,EACzE,eAAe,iCAAiC,wBAAwB,EACxE,OAAO,iBAAiB,gEAAgE,EACxF,OAAO,IAAI,IAAI,CAAC;AAEnB,QAAQ,QAAQ,iBAAS,cAAc;AAEvC,QAAQ,MAAM,QAAQ,IAAI;AAE1B,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,WAAW;AACrB;","names":["import_chalk","resolve","import_chalk","import_chalk","import_node_fs","dirname","path","fs","path","fs","import_node_child_process","startCommand","args","chalk","chalk","import_typescript","import_node_fs","import_node_path","fs","path","import_typescript","import_node_fs","fs","ts","import_typescript","ts","import_chalk","chalk","ts","import_chalk","chokidar","chalk","ts","chalk","import_chalk","import_chalk","import_chalk","build","chalk","import_chalk","import_node_child_process","chalk","chalk","build","import_node_child_process","args","chalk","import_chalk","chalk","import_node_fs","import_node_path","import_chalk","import_chalk","import_node_child_process","checkTs","chalk","chalk","checkTs","import_chalk","import_node_child_process","chalk","import_node_fs","import_node_path","import_chalk","chalk","chalk"]}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// src/index.ts
|
|
4
|
-
import
|
|
4
|
+
import chalk15 from "chalk";
|
|
5
5
|
import { Command } from "commander";
|
|
6
6
|
|
|
7
7
|
// src/helpers/execute.ts
|
|
8
8
|
import { exec } from "child_process";
|
|
9
9
|
async function execute_default(command) {
|
|
10
|
-
return new Promise((
|
|
10
|
+
return new Promise((resolve3, reject) => {
|
|
11
11
|
exec(command, (error, stdout, stderr) => {
|
|
12
12
|
if (error) {
|
|
13
13
|
reject(error);
|
|
14
14
|
} else {
|
|
15
|
-
|
|
15
|
+
resolve3({ stdout, stderr });
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
});
|
|
@@ -46,10 +46,10 @@ import fs2 from "fs";
|
|
|
46
46
|
import fs from "fs";
|
|
47
47
|
import path from "path";
|
|
48
48
|
var ensureDirectory = (filePath) => {
|
|
49
|
-
const
|
|
50
|
-
if (fs.existsSync(
|
|
51
|
-
ensureDirectory(
|
|
52
|
-
fs.mkdirSync(
|
|
49
|
+
const dirname2 = path.dirname(filePath);
|
|
50
|
+
if (fs.existsSync(dirname2)) return true;
|
|
51
|
+
ensureDirectory(dirname2);
|
|
52
|
+
fs.mkdirSync(dirname2);
|
|
53
53
|
};
|
|
54
54
|
var ensureDirectory_default = ensureDirectory;
|
|
55
55
|
|
|
@@ -61,6 +61,7 @@ async function writeFile_default(path3, content) {
|
|
|
61
61
|
|
|
62
62
|
// src/dev/runner/startProcess.ts
|
|
63
63
|
import { spawn } from "child_process";
|
|
64
|
+
import chalk from "chalk";
|
|
64
65
|
|
|
65
66
|
// src/dev/runner/getArgs.ts
|
|
66
67
|
function getArgs(options, command) {
|
|
@@ -75,7 +76,6 @@ function getArgs(options, command) {
|
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
// src/dev/runner/startProcess.ts
|
|
78
|
-
import chalk from "chalk";
|
|
79
79
|
function startProcess(options, command) {
|
|
80
80
|
const { startCommand, args } = getArgs(options, command);
|
|
81
81
|
console.log(chalk.bold(`=> Starting app with command: ${startCommand} ${args.join(" ")}...
|
|
@@ -83,7 +83,8 @@ function startProcess(options, command) {
|
|
|
83
83
|
return spawn(startCommand, args, {
|
|
84
84
|
env: {
|
|
85
85
|
ORION_DEV: "local",
|
|
86
|
-
...process.env
|
|
86
|
+
...process.env,
|
|
87
|
+
...options.repl ? { ORION_REPL: "true" } : {}
|
|
87
88
|
},
|
|
88
89
|
cwd: process.cwd(),
|
|
89
90
|
stdio: "inherit",
|
|
@@ -424,7 +425,20 @@ process.on("unhandledRejection", (error) => {
|
|
|
424
425
|
});
|
|
425
426
|
|
|
426
427
|
// src/version.ts
|
|
427
|
-
|
|
428
|
+
import { readFileSync } from "fs";
|
|
429
|
+
import { dirname, resolve } from "path";
|
|
430
|
+
import { fileURLToPath } from "url";
|
|
431
|
+
function getVersion() {
|
|
432
|
+
try {
|
|
433
|
+
const dir = dirname(fileURLToPath(import.meta.url));
|
|
434
|
+
const pkgPath = resolve(dir, "..", "package.json");
|
|
435
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
436
|
+
return pkg.version;
|
|
437
|
+
} catch {
|
|
438
|
+
return "unknown";
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
var version_default = getVersion();
|
|
428
442
|
|
|
429
443
|
// src/index.ts
|
|
430
444
|
import "dotenv/config";
|
|
@@ -479,16 +493,76 @@ function info() {
|
|
|
479
493
|
console.log(`Default runtime: ${chalk13.bold("Bun")} (use --node flag to switch to Node.js)`);
|
|
480
494
|
}
|
|
481
495
|
|
|
496
|
+
// src/repl/index.ts
|
|
497
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
498
|
+
import { resolve as resolve2 } from "path";
|
|
499
|
+
import chalk14 from "chalk";
|
|
500
|
+
function resolvePort(options) {
|
|
501
|
+
if (options.port) {
|
|
502
|
+
return Number(options.port);
|
|
503
|
+
}
|
|
504
|
+
try {
|
|
505
|
+
const portFile = resolve2(process.cwd(), ".orion/port");
|
|
506
|
+
const port = readFileSync2(portFile, "utf-8").trim();
|
|
507
|
+
return Number(port);
|
|
508
|
+
} catch {
|
|
509
|
+
}
|
|
510
|
+
if (process.env.PORT) {
|
|
511
|
+
return Number(process.env.PORT);
|
|
512
|
+
}
|
|
513
|
+
return 3e3;
|
|
514
|
+
}
|
|
515
|
+
async function repl(options) {
|
|
516
|
+
var _a;
|
|
517
|
+
const expression = options.expression;
|
|
518
|
+
if (!expression) {
|
|
519
|
+
console.error(chalk14.red('Error: expression is required. Use -e "<expression>"'));
|
|
520
|
+
process.exit(1);
|
|
521
|
+
}
|
|
522
|
+
const port = resolvePort(options);
|
|
523
|
+
try {
|
|
524
|
+
const response = await fetch(`http://localhost:${port}/__repl`, {
|
|
525
|
+
method: "POST",
|
|
526
|
+
headers: { "Content-Type": "application/json" },
|
|
527
|
+
body: JSON.stringify({ expression })
|
|
528
|
+
});
|
|
529
|
+
const data = await response.json();
|
|
530
|
+
if (!data.success) {
|
|
531
|
+
console.error(chalk14.red(`Error: ${data.error}`));
|
|
532
|
+
if (data.stack) {
|
|
533
|
+
console.error(chalk14.dim(data.stack));
|
|
534
|
+
}
|
|
535
|
+
process.exit(1);
|
|
536
|
+
}
|
|
537
|
+
if (data.result !== void 0) {
|
|
538
|
+
console.log(
|
|
539
|
+
typeof data.result === "string" ? data.result : JSON.stringify(data.result, null, 2)
|
|
540
|
+
);
|
|
541
|
+
}
|
|
542
|
+
} catch (error) {
|
|
543
|
+
if (error.code === "ECONNREFUSED" || ((_a = error.cause) == null ? void 0 : _a.code) === "ECONNREFUSED") {
|
|
544
|
+
console.error(
|
|
545
|
+
chalk14.red(
|
|
546
|
+
`Could not connect to dev server on port ${port}. Make sure "orion dev --repl" is running.`
|
|
547
|
+
)
|
|
548
|
+
);
|
|
549
|
+
} else {
|
|
550
|
+
console.error(chalk14.red(`Error: ${error.message}`));
|
|
551
|
+
}
|
|
552
|
+
process.exit(1);
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
|
|
482
556
|
// src/index.ts
|
|
483
557
|
var program = new Command();
|
|
484
558
|
var run = (action) => async (...args) => {
|
|
485
559
|
try {
|
|
486
560
|
await action(...args);
|
|
487
561
|
} catch (e) {
|
|
488
|
-
console.error(
|
|
562
|
+
console.error(chalk15.red(`Error: ${e.message}`));
|
|
489
563
|
}
|
|
490
564
|
};
|
|
491
|
-
program.command("dev").description("Run the Orionjs app in development mode").option("--node", "Use Node.js runtime instead of Bun").allowUnknownOption().action(run(dev_default));
|
|
565
|
+
program.command("dev").description("Run the Orionjs app in development mode").option("--node", "Use Node.js runtime instead of Bun").option("--repl", "Enable REPL endpoint for orion repl").allowUnknownOption().action(run(dev_default));
|
|
492
566
|
program.command("check").description("Runs a typescript check").action(run(check_default));
|
|
493
567
|
program.command("build").description("Build the Orionjs app for production").option("--output [path]", "Path of the output file").action(run(build_default));
|
|
494
568
|
program.command("prod").allowUnknownOption().option("--node", "Use Node.js runtime instead of Bun").option(
|
|
@@ -497,6 +571,7 @@ program.command("prod").allowUnknownOption().option("--node", "Use Node.js runti
|
|
|
497
571
|
).description("Run the Orionjs app in production mode").action(run(prod_default));
|
|
498
572
|
program.command("create").description("Creates a new Orionjs project").option("--name [name]", "Name of the project").option("--kit [kit]", "Which starter kit to use").action(run(create_default));
|
|
499
573
|
program.command("info").description("Print runtime and version info").action(run(info));
|
|
574
|
+
program.command("repl").description("Evaluate an expression against a running Orionjs dev server").requiredOption("-e, --expression <expression>", "Expression to evaluate").option("--port <port>", "Port of the dev server (default: auto-detect from .orion/port)").action(run(repl));
|
|
500
575
|
program.version(version_default, "-v --version");
|
|
501
576
|
program.parse(process.argv);
|
|
502
577
|
if (!process.argv.slice(2).length) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/helpers/execute.ts","../src/create/index.ts","../src/dev/index.ts","../src/dev/runner/index.ts","../src/helpers/writeFile.ts","../src/helpers/ensureDirectory.ts","../src/dev/runner/startProcess.ts","../src/dev/runner/getArgs.ts","../src/dev/watchAndCompile/index.ts","../src/dev/watchAndCompile/cleanDirectory.ts","../src/dev/watchAndCompile/getHost.ts","../src/dev/watchAndCompile/getConfigPath.ts","../src/dev/watchAndCompile/ensureConfigComplies.ts","../src/helpers/getFileContents.ts","../src/dev/watchAndCompile/reports.ts","../src/dev/watchAndCompile/writeEnvFile.ts","../src/prod/index.ts","../src/build/index.ts","../src/build/build.ts","../src/build/checkTs.ts","../src/prod/runProd.ts","../src/handleErrors.ts","../src/version.ts","../src/check/index.ts","../src/check/checkTs.ts","../src/info.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk'\nimport {Command} from 'commander'\nimport create from './create'\nimport dev from './dev'\nimport prod from './prod'\nimport './handleErrors'\nimport version from './version'\nimport 'dotenv/config'\nimport build from './build'\nimport check from './check'\nimport info from './info'\n\nconst program = new Command()\n\nconst run =\n action =>\n async (...args) => {\n try {\n await action(...args)\n } catch (e) {\n console.error(chalk.red(`Error: ${e.message}`))\n }\n }\n\nprogram\n .command('dev')\n .description('Run the Orionjs app in development mode')\n .option('--node', 'Use Node.js runtime instead of Bun')\n .allowUnknownOption()\n .action(run(dev))\n\nprogram.command('check').description('Runs a typescript check').action(run(check))\n\nprogram\n .command('build')\n .description('Build the Orionjs app for production')\n .option('--output [path]', 'Path of the output file')\n .action(run(build))\n\nprogram\n .command('prod')\n .allowUnknownOption()\n .option('--node', 'Use Node.js runtime instead of Bun')\n .option(\n '--path [path]',\n 'Path of the compiled Orionjs app. If not provided, the app will be compiled and then run',\n )\n .description('Run the Orionjs app in production mode')\n .action(run(prod))\n\nprogram\n .command('create')\n .description('Creates a new Orionjs project')\n .option('--name [name]', 'Name of the project')\n .option('--kit [kit]', 'Which starter kit to use')\n .action(run(create))\n\nprogram.command('info').description('Print runtime and version info').action(run(info))\n\nprogram.version(version, '-v --version')\n\nprogram.parse(process.argv)\n\nif (!process.argv.slice(2).length) {\n program.outputHelp()\n}\n","import {exec} from 'node:child_process'\n\nexport default async function (command) {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error)\n } else {\n resolve({stdout, stderr})\n }\n })\n })\n}\n","import execute from '../helpers/execute'\n\nexport default async function ({name, kit}) {\n if (!name) {\n throw new Error('Please set the name of the app')\n }\n if (!kit) {\n throw new Error('Please select which kit to use')\n }\n const repo = `https://github.com/siturra/boilerplate-orionjs-${kit}`\n console.log('Downloading starter kit...')\n await execute(`git clone ${repo} ${name}`)\n await execute(`cd ${name} && rm -rf .git`)\n console.log('Your starter kit is ready')\n}\n","import chalk from 'chalk'\nimport {getRunner, RunnerOptions} from './runner'\nimport watchAndCompile from './watchAndCompile'\n\nexport default async function (options: RunnerOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Dev mode \\n`))\n\n const runner = getRunner(options, command)\n\n watchAndCompile(runner)\n}\n","import chalk from 'chalk'\nimport writeFile from '../../helpers/writeFile'\nimport {startProcess} from './startProcess'\n\nexport interface RunnerOptions {\n shell: boolean\n clean: boolean\n node: boolean\n}\n\nexport interface Runner {\n start: () => void\n restart: () => void\n stop: () => void\n}\n\nexport function getRunner(options: RunnerOptions, command: any): Runner {\n let appProcess = null\n\n if (options.clean) {\n console.log(chalk.bold('=> Cleaning directory...\\n'))\n }\n\n const startApp = () => {\n appProcess = startProcess(options, command)\n\n appProcess.on('exit', (code: number, signal: string) => {\n if (!code || code === 143 || code === 0 || signal === 'SIGTERM' || signal === 'SIGINT') {\n } else {\n console.log(chalk.bold(`=> Error running app. Exit code: ${code}`))\n }\n })\n\n writeFile('.orion/process', `${appProcess.pid}`)\n }\n\n const stop = () => {\n if (appProcess) {\n appProcess.kill()\n appProcess = null\n }\n }\n\n const restart = () => {\n console.log(chalk.bold('=> Restarting app...\\n'))\n stop()\n startApp()\n }\n\n const start = () => {\n // check if the app is already running\n if (appProcess) {\n // console.log(chalk.bold('=> App is already running. Restarting...\\n'))\n } else {\n startApp()\n }\n }\n\n return {\n restart,\n stop,\n start,\n }\n}\n","import fs from 'node:fs'\nimport ensureDirectory from '../helpers/ensureDirectory'\n\nexport default async function (path: string, content: string): Promise<void> {\n ensureDirectory(path)\n fs.writeFileSync(path, content)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst ensureDirectory = filePath => {\n const dirname = path.dirname(filePath)\n if (fs.existsSync(dirname)) return true\n ensureDirectory(dirname)\n fs.mkdirSync(dirname)\n}\n\nexport default ensureDirectory\n","import {spawn} from 'node:child_process'\nimport {getArgs} from './getArgs'\nimport {RunnerOptions} from './index'\nimport chalk from 'chalk'\n\nexport function startProcess(options: RunnerOptions, command: any) {\n const {startCommand, args} = getArgs(options, command)\n\n console.log(chalk.bold(`=> Starting app with command: ${startCommand} ${args.join(' ')}...\\n`))\n return spawn(startCommand, args, {\n env: {\n ORION_DEV: 'local',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n detached: false,\n })\n}\n","import {RunnerOptions} from './index'\n\nexport function getArgs(options: RunnerOptions, command: any) {\n if (options.node) {\n const startCommand = 'tsx'\n const args = ['watch', '--clear-screen=false', ...command.args, './app/index.ts']\n return {startCommand, args}\n }\n\n const startCommand = 'bun'\n const args = ['--watch', ...command.args, './app/index.ts']\n return {startCommand, args}\n}\n","import ts from 'typescript'\nimport {Runner} from '../runner'\nimport cleanDirectory from './cleanDirectory'\nimport {getHost} from './getHost'\nimport {watchEnvFile} from './writeEnvFile'\n\nexport default async function watchAndCompile(runner: Runner) {\n await cleanDirectory()\n const host = getHost(runner)\n ts.createWatchProgram(host)\n watchEnvFile(runner)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\n/**\n * Remove directory recursively\n * @param {string} dir_path\n * @see https://stackoverflow.com/a/42505874/3027390\n */\nfunction rimraf(dir_path: string) {\n if (fs.existsSync(dir_path)) {\n fs.readdirSync(dir_path).map(entry => {\n const entry_path = path.join(dir_path, entry)\n if (fs.lstatSync(entry_path).isDirectory()) {\n rimraf(entry_path)\n } else {\n fs.unlinkSync(entry_path)\n }\n })\n fs.rmdirSync(dir_path)\n }\n}\n\nexport default async function cleanDirectory(directory?: string) {\n try {\n const dirPath = directory ? directory : path.join(process.cwd(), '.orion', 'build')\n rimraf(dirPath)\n } catch (_) {\n // Ignore errors during cleanup\n }\n}\n","import ts from 'typescript'\nimport {getConfigPath} from './getConfigPath'\nimport {reportDiagnostic} from './reports'\nimport {Runner} from '../runner'\nimport chalk from 'chalk'\n\nexport function getHost(runner: Runner) {\n let isStopped = true\n const reportWatchStatusChanged = (diagnostic: ts.Diagnostic) => {\n if (diagnostic.category !== 3) return\n if (diagnostic.code === 6031 || diagnostic.code === 6032) {\n // file change detected, starting compilation\n // console.log(chalk.bold(`=> ${diagnostic.messageText}`))\n return\n }\n\n if (diagnostic.code === 6193) {\n runner.stop()\n isStopped = true\n return\n }\n\n if (diagnostic.code === 6194) {\n /**\n * Sometimes diagnostic code is 6194 even with errors\n */\n if (/^Found .+ errors?/.test(diagnostic.messageText.toString())) {\n if (!diagnostic.messageText.toString().includes('Found 0 errors.')) {\n runner.stop()\n isStopped = true\n return\n }\n }\n\n if (isStopped) {\n isStopped = false\n runner.start()\n }\n return\n }\n\n console.log(chalk.bold(`=> ${diagnostic.messageText} [${diagnostic.code}]`))\n }\n\n const configPath = getConfigPath()\n const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram\n\n const host = ts.createWatchCompilerHost(\n configPath,\n {},\n ts.sys,\n createProgram,\n reportDiagnostic,\n reportWatchStatusChanged,\n )\n\n return host\n}\n","import ts from 'typescript'\nimport {ensureConfigComplies} from './ensureConfigComplies'\n\nexport function getConfigPath() {\n const appBasePath = process.cwd()\n\n const configPath =\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.server.json') ||\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.json')\n\n if (!configPath) {\n throw new Error(\"Could not find a valid 'tsconfig.json'.\")\n }\n\n ensureConfigComplies(configPath)\n\n return configPath\n}\n","import {parse, stringify} from 'comment-json'\nimport getFileContents from '../../helpers/getFileContents'\nimport writeFile from '../../helpers/writeFile'\n\n// Define TypeScript config interface\ninterface TSConfig {\n compilerOptions?: {\n baseUrl?: string\n rootDir?: string\n rootDirs?: string[]\n [key: string]: any\n }\n [key: string]: any\n}\n\nexport function ensureConfigComplies(configPath: string) {\n try {\n const configJSON = getFileContents(configPath)\n const config = parse(configJSON) as TSConfig\n\n const newConfig = {\n ...config,\n compilerOptions: {\n ...config.compilerOptions,\n baseUrl: './',\n noEmit: true,\n },\n }\n\n if (!config.compilerOptions?.rootDir && !config.compilerOptions?.rootDirs) {\n newConfig.compilerOptions.rootDir = './app'\n }\n\n // are the same, no write\n if (JSON.stringify(config) === JSON.stringify(newConfig)) {\n return\n }\n\n writeFile(configPath, stringify(newConfig, null, 2))\n } catch (error) {\n console.log(`Error reading tsconfig: ${error.message}`)\n }\n}\n","import fs from 'node:fs'\n\nexport default function readFile(filePath: string) {\n if (!fs.existsSync(filePath)) return null\n\n return fs.readFileSync(filePath).toString()\n}\n","import ts from 'typescript'\n\nconst format = {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => ts.sys.newLine,\n}\nexport function reportDiagnostic(diagnostic: ts.Diagnostic) {\n console.log(ts.formatDiagnosticsWithColorAndContext([diagnostic], format))\n}\n","import {writeDtsFileFromConfigFile} from '@orion-js/env'\nimport chalk from 'chalk'\nimport chokidar from 'chokidar'\nimport {Runner} from '../runner'\n\nconst envFilePath = process.env.ORION_ENV_FILE_PATH\nconst dtsFilePath = './app/env.d.ts'\n\nexport const watchEnvFile = async (runner: Runner) => {\n if (!envFilePath) return\n\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n\n chokidar.watch(envFilePath, {ignoreInitial: true}).on('change', async () => {\n console.log(chalk.bold('=> Environment file changed. Restarting...'))\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n runner.restart()\n })\n}\n","import chalk from 'chalk'\nimport build from '../build'\nimport {runProd} from './runProd'\n\nexport interface ProdOptions {\n path?: string\n node?: boolean\n}\n\nexport default async function (options: ProdOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Prod mode\\n`))\n\n if (options.node) {\n if (!options.path) {\n await build({output: './build'})\n options.path = './build'\n }\n }\n\n runProd(options, command)\n}\n","import chalk from 'chalk'\nimport {build} from './build'\nimport cleanDirectory from '../dev/watchAndCompile/cleanDirectory'\nimport {checkTs} from './checkTs'\n\nexport default async function (options: {output?: string}) {\n console.log(chalk.bold(`Building Orionjs App ${chalk.green(chalk.bold('V4'))}...`))\n\n if (!options.output) {\n options.output = './build'\n }\n\n await cleanDirectory(options.output)\n\n await checkTs()\n await build(options)\n\n console.log(chalk.bold('Build completed'))\n}\n","import chalk from 'chalk'\nimport * as esbuild from 'esbuild'\n\nexport async function build(options: {output?: string}) {\n const {output} = options\n\n console.log(`Building with esbuild to ${output}`)\n\n await esbuild.build({\n entryPoints: ['./app/index.ts'],\n tsconfig: './tsconfig.json',\n format: 'esm',\n platform: 'node',\n outdir: output,\n bundle: true,\n target: 'node22',\n sourcemap: true,\n allowOverwrite: true,\n minify: true,\n packages: 'external',\n })\n\n console.log(chalk.green.bold('Build successful'))\n}\n","import chalk from 'chalk'\nimport {exec} from 'node:child_process'\nimport {promisify} from 'node:util'\n\nconst execPromise = promisify(exec)\n\nexport async function checkTs(): Promise<void> {\n try {\n console.log('Checking TypeScript...')\n await execPromise('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n })\n console.log(chalk.green.bold('TypeScript check passed'))\n } catch (error) {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n console.log(error.stderr || error.stdout || error.message)\n process.exit(1)\n }\n}\n","import {spawn} from 'node:child_process'\nimport {ProdOptions} from './index'\n\nexport function runProd(options: ProdOptions, command: any) {\n if (options.node) {\n const indexPath = `${options.path}/index.js`\n const args = ['--import=tsx', ...command.args, indexPath]\n spawn('node', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n return\n }\n\n const args = [...command.args, './app/index.ts']\n spawn('bun', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n}\n","import chalk from 'chalk'\n\ninterface ErrorWithCodeFrame extends Error {\n codeFrame?: string\n}\n\nprocess\n .on('unhandledRejection', (error: ErrorWithCodeFrame) => {\n if (error.codeFrame) {\n console.error(chalk.red(error.message))\n console.log(error.codeFrame)\n } else {\n console.error(chalk.red(error.message), chalk.red('Unhandled promise rejection'))\n }\n })\n .on('uncaughtException', (error: Error) => {\n console.error(chalk.red(error.message))\n process.exit(1)\n })\n","export default '3.0'\n","import chalk from 'chalk'\nimport {checkTs} from './checkTs'\n\nexport default async function () {\n console.log(chalk.bold(`Orionjs App ${chalk.green(chalk.bold('V4'))}\\n`))\n console.log('Checking typescript...')\n\n checkTs()\n\n console.log(chalk.bold.green('Check passed\\n'))\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\n\nexport function checkTs() {\n try {\n execSync('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n stdio: 'inherit',\n })\n } catch {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n process.exit(1)\n }\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\nimport version from './version'\n\nfunction detectRuntime(): string {\n const runtimes: string[] = []\n\n try {\n const bunVersion = execSync('bun --version', {encoding: 'utf-8'}).trim()\n runtimes.push(`Bun ${bunVersion}`)\n } catch {}\n\n runtimes.push(`Node ${process.versions.node}`)\n\n return runtimes.join(', ')\n}\n\nexport default function info() {\n console.log(`Orion CLI v${version} — Available runtimes: ${chalk.bold(detectRuntime())}`)\n console.log(`Default runtime: ${chalk.bold('Bun')} (use --node flag to switch to Node.js)`)\n}\n"],"mappings":";;;AACA,OAAOA,aAAW;AAClB,SAAQ,eAAc;;;ACFtB,SAAQ,YAAW;AAEnB,eAAO,gBAAwB,SAAS;AACtC,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACtC,SAAK,SAAS,CAAC,OAAO,QAAQ,WAAW;AACvC,UAAI,OAAO;AACT,eAAO,KAAK;AAAA,MACd,OAAO;AACL,gBAAQ,EAAC,QAAQ,OAAM,CAAC;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACH;;;ACVA,eAAO,eAAwB,EAAC,MAAM,IAAG,GAAG;AAC1C,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AACA,MAAI,CAAC,KAAK;AACR,UAAM,IAAI,MAAM,gCAAgC;AAAA,EAClD;AACA,QAAM,OAAO,kDAAkD,GAAG;AAClE,UAAQ,IAAI,4BAA4B;AACxC,QAAM,gBAAQ,aAAa,IAAI,IAAI,IAAI,EAAE;AACzC,QAAM,gBAAQ,MAAM,IAAI,iBAAiB;AACzC,UAAQ,IAAI,2BAA2B;AACzC;;;ACdA,OAAOC,YAAW;;;ACAlB,OAAOC,YAAW;;;ACAlB,OAAOC,SAAQ;;;ACAf,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,IAAM,kBAAkB,cAAY;AAClC,QAAM,UAAU,KAAK,QAAQ,QAAQ;AACrC,MAAI,GAAG,WAAW,OAAO,EAAG,QAAO;AACnC,kBAAgB,OAAO;AACvB,KAAG,UAAU,OAAO;AACtB;AAEA,IAAO,0BAAQ;;;ADPf,eAAO,kBAAwBC,OAAc,SAAgC;AAC3E,0BAAgBA,KAAI;AAC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A+B,EAC3C,OAAO,iBAAiB,qBAAqB,EAC7C,OAAO,eAAe,0BAA0B,EAChD,OAAO,IAAI,cAAM,CAAC;AAErB,QAAQ,QAAQ,MAAM,EAAE,YAAY,gCAAgC,EAAE,OAAO,IAAI,IAAI,CAAC;AAEtF,QAAQ,QAAQ,iBAAS,cAAc;AAEvC,QAAQ,MAAM,QAAQ,IAAI;AAE1B,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,WAAW;AACrB;","names":["chalk","chalk","chalk","fs","path","fs","startCommand","args","chalk","ts","fs","path","ts","fs","ts","chalk","ts","chalk","ts","chalk","chalk","chalk","chalk","build","chalk","exec","chalk","build","spawn","args","chalk","chalk","chalk","chalk","checkTs","chalk","checkTs","chalk","execSync","execSync","chalk","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/helpers/execute.ts","../src/create/index.ts","../src/dev/index.ts","../src/dev/runner/index.ts","../src/helpers/writeFile.ts","../src/helpers/ensureDirectory.ts","../src/dev/runner/startProcess.ts","../src/dev/runner/getArgs.ts","../src/dev/watchAndCompile/index.ts","../src/dev/watchAndCompile/cleanDirectory.ts","../src/dev/watchAndCompile/getHost.ts","../src/dev/watchAndCompile/getConfigPath.ts","../src/dev/watchAndCompile/ensureConfigComplies.ts","../src/helpers/getFileContents.ts","../src/dev/watchAndCompile/reports.ts","../src/dev/watchAndCompile/writeEnvFile.ts","../src/prod/index.ts","../src/build/index.ts","../src/build/build.ts","../src/build/checkTs.ts","../src/prod/runProd.ts","../src/handleErrors.ts","../src/version.ts","../src/check/index.ts","../src/check/checkTs.ts","../src/info.ts","../src/repl/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk'\nimport {Command} from 'commander'\nimport create from './create'\nimport dev from './dev'\nimport prod from './prod'\nimport './handleErrors'\nimport version from './version'\nimport 'dotenv/config'\nimport build from './build'\nimport check from './check'\nimport info from './info'\nimport repl from './repl'\n\nconst program = new Command()\n\nconst run =\n action =>\n async (...args) => {\n try {\n await action(...args)\n } catch (e) {\n console.error(chalk.red(`Error: ${e.message}`))\n }\n }\n\nprogram\n .command('dev')\n .description('Run the Orionjs app in development mode')\n .option('--node', 'Use Node.js runtime instead of Bun')\n .option('--repl', 'Enable REPL endpoint for orion repl')\n .allowUnknownOption()\n .action(run(dev))\n\nprogram.command('check').description('Runs a typescript check').action(run(check))\n\nprogram\n .command('build')\n .description('Build the Orionjs app for production')\n .option('--output [path]', 'Path of the output file')\n .action(run(build))\n\nprogram\n .command('prod')\n .allowUnknownOption()\n .option('--node', 'Use Node.js runtime instead of Bun')\n .option(\n '--path [path]',\n 'Path of the compiled Orionjs app. If not provided, the app will be compiled and then run',\n )\n .description('Run the Orionjs app in production mode')\n .action(run(prod))\n\nprogram\n .command('create')\n .description('Creates a new Orionjs project')\n .option('--name [name]', 'Name of the project')\n .option('--kit [kit]', 'Which starter kit to use')\n .action(run(create))\n\nprogram.command('info').description('Print runtime and version info').action(run(info))\n\nprogram\n .command('repl')\n .description('Evaluate an expression against a running Orionjs dev server')\n .requiredOption('-e, --expression <expression>', 'Expression to evaluate')\n .option('--port <port>', 'Port of the dev server (default: auto-detect from .orion/port)')\n .action(run(repl))\n\nprogram.version(version, '-v --version')\n\nprogram.parse(process.argv)\n\nif (!process.argv.slice(2).length) {\n program.outputHelp()\n}\n","import {exec} from 'node:child_process'\n\nexport default async function (command) {\n return new Promise((resolve, reject) => {\n exec(command, (error, stdout, stderr) => {\n if (error) {\n reject(error)\n } else {\n resolve({stdout, stderr})\n }\n })\n })\n}\n","import execute from '../helpers/execute'\n\nexport default async function ({name, kit}) {\n if (!name) {\n throw new Error('Please set the name of the app')\n }\n if (!kit) {\n throw new Error('Please select which kit to use')\n }\n const repo = `https://github.com/siturra/boilerplate-orionjs-${kit}`\n console.log('Downloading starter kit...')\n await execute(`git clone ${repo} ${name}`)\n await execute(`cd ${name} && rm -rf .git`)\n console.log('Your starter kit is ready')\n}\n","import chalk from 'chalk'\nimport {getRunner, RunnerOptions} from './runner'\nimport watchAndCompile from './watchAndCompile'\n\nexport default async function (options: RunnerOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Dev mode \\n`))\n\n const runner = getRunner(options, command)\n\n watchAndCompile(runner)\n}\n","import chalk from 'chalk'\nimport writeFile from '../../helpers/writeFile'\nimport {startProcess} from './startProcess'\n\nexport interface RunnerOptions {\n shell: boolean\n clean: boolean\n node: boolean\n repl: boolean\n}\n\nexport interface Runner {\n start: () => void\n restart: () => void\n stop: () => void\n}\n\nexport function getRunner(options: RunnerOptions, command: any): Runner {\n let appProcess = null\n\n if (options.clean) {\n console.log(chalk.bold('=> Cleaning directory...\\n'))\n }\n\n const startApp = () => {\n appProcess = startProcess(options, command)\n\n appProcess.on('exit', (code: number, signal: string) => {\n if (!code || code === 143 || code === 0 || signal === 'SIGTERM' || signal === 'SIGINT') {\n } else {\n console.log(chalk.bold(`=> Error running app. Exit code: ${code}`))\n }\n })\n\n writeFile('.orion/process', `${appProcess.pid}`)\n }\n\n const stop = () => {\n if (appProcess) {\n appProcess.kill()\n appProcess = null\n }\n }\n\n const restart = () => {\n console.log(chalk.bold('=> Restarting app...\\n'))\n stop()\n startApp()\n }\n\n const start = () => {\n // check if the app is already running\n if (appProcess) {\n // console.log(chalk.bold('=> App is already running. Restarting...\\n'))\n } else {\n startApp()\n }\n }\n\n return {\n restart,\n stop,\n start,\n }\n}\n","import fs from 'node:fs'\nimport ensureDirectory from '../helpers/ensureDirectory'\n\nexport default async function (path: string, content: string): Promise<void> {\n ensureDirectory(path)\n fs.writeFileSync(path, content)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\nconst ensureDirectory = filePath => {\n const dirname = path.dirname(filePath)\n if (fs.existsSync(dirname)) return true\n ensureDirectory(dirname)\n fs.mkdirSync(dirname)\n}\n\nexport default ensureDirectory\n","import {spawn} from 'node:child_process'\nimport chalk from 'chalk'\nimport {getArgs} from './getArgs'\nimport {RunnerOptions} from './index'\n\nexport function startProcess(options: RunnerOptions, command: any) {\n const {startCommand, args} = getArgs(options, command)\n\n console.log(chalk.bold(`=> Starting app with command: ${startCommand} ${args.join(' ')}...\\n`))\n return spawn(startCommand, args, {\n env: {\n ORION_DEV: 'local',\n ...process.env,\n ...(options.repl ? {ORION_REPL: 'true'} : {}),\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n detached: false,\n })\n}\n","import {RunnerOptions} from './index'\n\nexport function getArgs(options: RunnerOptions, command: any) {\n if (options.node) {\n const startCommand = 'tsx'\n const args = ['watch', '--clear-screen=false', ...command.args, './app/index.ts']\n return {startCommand, args}\n }\n\n const startCommand = 'bun'\n const args = ['--watch', ...command.args, './app/index.ts']\n return {startCommand, args}\n}\n","import ts from 'typescript'\nimport {Runner} from '../runner'\nimport cleanDirectory from './cleanDirectory'\nimport {getHost} from './getHost'\nimport {watchEnvFile} from './writeEnvFile'\n\nexport default async function watchAndCompile(runner: Runner) {\n await cleanDirectory()\n const host = getHost(runner)\n ts.createWatchProgram(host)\n watchEnvFile(runner)\n}\n","import fs from 'node:fs'\nimport path from 'node:path'\n\n/**\n * Remove directory recursively\n * @param {string} dir_path\n * @see https://stackoverflow.com/a/42505874/3027390\n */\nfunction rimraf(dir_path: string) {\n if (fs.existsSync(dir_path)) {\n fs.readdirSync(dir_path).map(entry => {\n const entry_path = path.join(dir_path, entry)\n if (fs.lstatSync(entry_path).isDirectory()) {\n rimraf(entry_path)\n } else {\n fs.unlinkSync(entry_path)\n }\n })\n fs.rmdirSync(dir_path)\n }\n}\n\nexport default async function cleanDirectory(directory?: string) {\n try {\n const dirPath = directory ? directory : path.join(process.cwd(), '.orion', 'build')\n rimraf(dirPath)\n } catch (_) {\n // Ignore errors during cleanup\n }\n}\n","import ts from 'typescript'\nimport {getConfigPath} from './getConfigPath'\nimport {reportDiagnostic} from './reports'\nimport {Runner} from '../runner'\nimport chalk from 'chalk'\n\nexport function getHost(runner: Runner) {\n let isStopped = true\n const reportWatchStatusChanged = (diagnostic: ts.Diagnostic) => {\n if (diagnostic.category !== 3) return\n if (diagnostic.code === 6031 || diagnostic.code === 6032) {\n // file change detected, starting compilation\n // console.log(chalk.bold(`=> ${diagnostic.messageText}`))\n return\n }\n\n if (diagnostic.code === 6193) {\n runner.stop()\n isStopped = true\n return\n }\n\n if (diagnostic.code === 6194) {\n /**\n * Sometimes diagnostic code is 6194 even with errors\n */\n if (/^Found .+ errors?/.test(diagnostic.messageText.toString())) {\n if (!diagnostic.messageText.toString().includes('Found 0 errors.')) {\n runner.stop()\n isStopped = true\n return\n }\n }\n\n if (isStopped) {\n isStopped = false\n runner.start()\n }\n return\n }\n\n console.log(chalk.bold(`=> ${diagnostic.messageText} [${diagnostic.code}]`))\n }\n\n const configPath = getConfigPath()\n const createProgram = ts.createEmitAndSemanticDiagnosticsBuilderProgram\n\n const host = ts.createWatchCompilerHost(\n configPath,\n {},\n ts.sys,\n createProgram,\n reportDiagnostic,\n reportWatchStatusChanged,\n )\n\n return host\n}\n","import ts from 'typescript'\nimport {ensureConfigComplies} from './ensureConfigComplies'\n\nexport function getConfigPath() {\n const appBasePath = process.cwd()\n\n const configPath =\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.server.json') ||\n ts.findConfigFile(appBasePath, ts.sys.fileExists, 'tsconfig.json')\n\n if (!configPath) {\n throw new Error(\"Could not find a valid 'tsconfig.json'.\")\n }\n\n ensureConfigComplies(configPath)\n\n return configPath\n}\n","import {parse, stringify} from 'comment-json'\nimport getFileContents from '../../helpers/getFileContents'\nimport writeFile from '../../helpers/writeFile'\n\n// Define TypeScript config interface\ninterface TSConfig {\n compilerOptions?: {\n baseUrl?: string\n rootDir?: string\n rootDirs?: string[]\n [key: string]: any\n }\n [key: string]: any\n}\n\nexport function ensureConfigComplies(configPath: string) {\n try {\n const configJSON = getFileContents(configPath)\n const config = parse(configJSON) as TSConfig\n\n const newConfig = {\n ...config,\n compilerOptions: {\n ...config.compilerOptions,\n baseUrl: './',\n noEmit: true,\n },\n }\n\n if (!config.compilerOptions?.rootDir && !config.compilerOptions?.rootDirs) {\n newConfig.compilerOptions.rootDir = './app'\n }\n\n // are the same, no write\n if (JSON.stringify(config) === JSON.stringify(newConfig)) {\n return\n }\n\n writeFile(configPath, stringify(newConfig, null, 2))\n } catch (error) {\n console.log(`Error reading tsconfig: ${error.message}`)\n }\n}\n","import fs from 'node:fs'\n\nexport default function readFile(filePath: string) {\n if (!fs.existsSync(filePath)) return null\n\n return fs.readFileSync(filePath).toString()\n}\n","import ts from 'typescript'\n\nconst format = {\n getCanonicalFileName: fileName => fileName,\n getCurrentDirectory: () => process.cwd(),\n getNewLine: () => ts.sys.newLine,\n}\nexport function reportDiagnostic(diagnostic: ts.Diagnostic) {\n console.log(ts.formatDiagnosticsWithColorAndContext([diagnostic], format))\n}\n","import {writeDtsFileFromConfigFile} from '@orion-js/env'\nimport chalk from 'chalk'\nimport chokidar from 'chokidar'\nimport {Runner} from '../runner'\n\nconst envFilePath = process.env.ORION_ENV_FILE_PATH\nconst dtsFilePath = './app/env.d.ts'\n\nexport const watchEnvFile = async (runner: Runner) => {\n if (!envFilePath) return\n\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n\n chokidar.watch(envFilePath, {ignoreInitial: true}).on('change', async () => {\n console.log(chalk.bold('=> Environment file changed. Restarting...'))\n writeDtsFileFromConfigFile(envFilePath, dtsFilePath)\n runner.restart()\n })\n}\n","import chalk from 'chalk'\nimport build from '../build'\nimport {runProd} from './runProd'\n\nexport interface ProdOptions {\n path?: string\n node?: boolean\n}\n\nexport default async function (options: ProdOptions, command: any) {\n console.log(chalk.bold(`\\nOrionjs App ${chalk.green(chalk.bold('V4'))} Prod mode\\n`))\n\n if (options.node) {\n if (!options.path) {\n await build({output: './build'})\n options.path = './build'\n }\n }\n\n runProd(options, command)\n}\n","import chalk from 'chalk'\nimport {build} from './build'\nimport cleanDirectory from '../dev/watchAndCompile/cleanDirectory'\nimport {checkTs} from './checkTs'\n\nexport default async function (options: {output?: string}) {\n console.log(chalk.bold(`Building Orionjs App ${chalk.green(chalk.bold('V4'))}...`))\n\n if (!options.output) {\n options.output = './build'\n }\n\n await cleanDirectory(options.output)\n\n await checkTs()\n await build(options)\n\n console.log(chalk.bold('Build completed'))\n}\n","import chalk from 'chalk'\nimport * as esbuild from 'esbuild'\n\nexport async function build(options: {output?: string}) {\n const {output} = options\n\n console.log(`Building with esbuild to ${output}`)\n\n await esbuild.build({\n entryPoints: ['./app/index.ts'],\n tsconfig: './tsconfig.json',\n format: 'esm',\n platform: 'node',\n outdir: output,\n bundle: true,\n target: 'node22',\n sourcemap: true,\n allowOverwrite: true,\n minify: true,\n packages: 'external',\n })\n\n console.log(chalk.green.bold('Build successful'))\n}\n","import chalk from 'chalk'\nimport {exec} from 'node:child_process'\nimport {promisify} from 'node:util'\n\nconst execPromise = promisify(exec)\n\nexport async function checkTs(): Promise<void> {\n try {\n console.log('Checking TypeScript...')\n await execPromise('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n })\n console.log(chalk.green.bold('TypeScript check passed'))\n } catch (error) {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n console.log(error.stderr || error.stdout || error.message)\n process.exit(1)\n }\n}\n","import {spawn} from 'node:child_process'\nimport {ProdOptions} from './index'\n\nexport function runProd(options: ProdOptions, command: any) {\n if (options.node) {\n const indexPath = `${options.path}/index.js`\n const args = ['--import=tsx', ...command.args, indexPath]\n spawn('node', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n return\n }\n\n const args = [...command.args, './app/index.ts']\n spawn('bun', args, {\n env: {\n NODE_ENV: 'production',\n ...process.env,\n },\n cwd: process.cwd(),\n stdio: 'inherit',\n gid: process.getgid(),\n uid: process.getuid(),\n detached: false,\n })\n}\n","import chalk from 'chalk'\n\ninterface ErrorWithCodeFrame extends Error {\n codeFrame?: string\n}\n\nprocess\n .on('unhandledRejection', (error: ErrorWithCodeFrame) => {\n if (error.codeFrame) {\n console.error(chalk.red(error.message))\n console.log(error.codeFrame)\n } else {\n console.error(chalk.red(error.message), chalk.red('Unhandled promise rejection'))\n }\n })\n .on('uncaughtException', (error: Error) => {\n console.error(chalk.red(error.message))\n process.exit(1)\n })\n","import {readFileSync} from 'node:fs'\nimport {dirname, resolve} from 'node:path'\nimport {fileURLToPath} from 'node:url'\n\nfunction getVersion(): string {\n try {\n const dir = dirname(fileURLToPath(import.meta.url))\n const pkgPath = resolve(dir, '..', 'package.json')\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'))\n return pkg.version\n } catch {\n return 'unknown'\n }\n}\n\nexport default getVersion()\n","import chalk from 'chalk'\nimport {checkTs} from './checkTs'\n\nexport default async function () {\n console.log(chalk.bold(`Orionjs App ${chalk.green(chalk.bold('V4'))}\\n`))\n console.log('Checking typescript...')\n\n checkTs()\n\n console.log(chalk.bold.green('Check passed\\n'))\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\n\nexport function checkTs() {\n try {\n execSync('tsc --noEmit', {\n cwd: process.cwd(),\n env: {\n ...process.env,\n },\n gid: process.getgid(),\n uid: process.getuid(),\n stdio: 'inherit',\n })\n } catch {\n console.log(chalk.red.bold('TypeScript compilation failed'))\n process.exit(1)\n }\n}\n","import chalk from 'chalk'\nimport {execSync} from 'node:child_process'\nimport version from './version'\n\nfunction detectRuntime(): string {\n const runtimes: string[] = []\n\n try {\n const bunVersion = execSync('bun --version', {encoding: 'utf-8'}).trim()\n runtimes.push(`Bun ${bunVersion}`)\n } catch {}\n\n runtimes.push(`Node ${process.versions.node}`)\n\n return runtimes.join(', ')\n}\n\nexport default function info() {\n console.log(`Orion CLI v${version} — Available runtimes: ${chalk.bold(detectRuntime())}`)\n console.log(`Default runtime: ${chalk.bold('Bun')} (use --node flag to switch to Node.js)`)\n}\n","import {readFileSync} from 'node:fs'\nimport {resolve} from 'node:path'\nimport chalk from 'chalk'\n\nexport interface ReplOptions {\n expression?: string\n port?: string\n}\n\nfunction resolvePort(options: ReplOptions): number {\n if (options.port) {\n return Number(options.port)\n }\n\n try {\n const portFile = resolve(process.cwd(), '.orion/port')\n const port = readFileSync(portFile, 'utf-8').trim()\n return Number(port)\n } catch {}\n\n if (process.env.PORT) {\n return Number(process.env.PORT)\n }\n\n return 3000\n}\n\nexport default async function repl(options: ReplOptions) {\n const expression = options.expression\n\n if (!expression) {\n console.error(chalk.red('Error: expression is required. Use -e \"<expression>\"'))\n process.exit(1)\n }\n\n const port = resolvePort(options)\n\n try {\n const response = await fetch(`http://localhost:${port}/__repl`, {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({expression}),\n })\n\n const data = await response.json()\n\n if (!data.success) {\n console.error(chalk.red(`Error: ${data.error}`))\n if (data.stack) {\n console.error(chalk.dim(data.stack))\n }\n process.exit(1)\n }\n\n if (data.result !== undefined) {\n console.log(\n typeof data.result === 'string' ? data.result : JSON.stringify(data.result, null, 2),\n )\n }\n } catch (error) {\n if (error.code === 'ECONNREFUSED' || error.cause?.code === 'ECONNREFUSED') {\n console.error(\n chalk.red(\n `Could not connect to dev server on port ${port}. Make sure \"orion dev --repl\" is running.`,\n ),\n )\n } else {\n console.error(chalk.red(`Error: ${error.message}`))\n }\n process.exit(1)\n }\n}\n"],"mappings":";;;AACA,OAAOA,aAAW;AAClB,SAAQ,eAAc;;;ACFtB,SAAQ,YAAW;AAEnB,eAAO,gBAAwB,SAAS;AACtC,SAAO,IAAI,QAAQ,CAACC,UAAS,WAAW;AACtC,SAAK,SAAS,CAAC,OAAO,QAAQ,WAAW;AACvC,UAAI,OAAO;AACT,eAAO,KAAK;AAAA,MACd,OAAO;AACL,QAAAA,SAAQ,EAAC,QAAQ,OAAM,CAAC;AAAA,MAC1B;AAAA,IACF,CAAC;AAAA,EACH,CAAC;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AI,aAAK,CAAC;AAEpB,QACG,QAAQ,MAAM,EACd,mBAAmB,EACnB,OAAO,UAAU,oCAAoC,EACrD;AAAA,EACC;AAAA,EACA;AACF,EACC,YAAY,wCAAwC,EACpD,OAAO,IAAI,YAAI,CAAC;AAEnB,QACG,QAAQ,QAAQ,EAChB,YAAY,+BAA+B,EAC3C,OAAO,iBAAiB,qBAAqB,EAC7C,OAAO,eAAe,0BAA0B,EAChD,OAAO,IAAI,cAAM,CAAC;AAErB,QAAQ,QAAQ,MAAM,EAAE,YAAY,gCAAgC,EAAE,OAAO,IAAI,IAAI,CAAC;AAEtF,QACG,QAAQ,MAAM,EACd,YAAY,6DAA6D,EACzE,eAAe,iCAAiC,wBAAwB,EACxE,OAAO,iBAAiB,gEAAgE,EACxF,OAAO,IAAI,IAAI,CAAC;AAEnB,QAAQ,QAAQ,iBAAS,cAAc;AAEvC,QAAQ,MAAM,QAAQ,IAAI;AAE1B,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,WAAW;AACrB;","names":["chalk","resolve","chalk","chalk","fs","dirname","path","fs","startCommand","args","chalk","ts","fs","path","ts","fs","ts","chalk","ts","chalk","ts","chalk","chalk","chalk","chalk","build","chalk","exec","chalk","build","spawn","args","chalk","chalk","chalk","chalk","checkTs","chalk","checkTs","chalk","execSync","execSync","chalk","readFileSync","resolve","chalk","chalk"]}
|