@orion-js/core 4.2.5 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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 import_chalk13 = __toESM(require("chalk"), 1);
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((resolve, reject) => {
32
+ return new Promise((resolve2, 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
- resolve({ stdout, stderr });
37
+ resolve2({ stdout, stderr });
38
38
  }
39
39
  });
40
40
  });
@@ -83,19 +83,21 @@ 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
- function getArgs(_options, command) {
89
- const startCommand = "tsx";
90
- const args = [];
91
- args.push("watch", "--clear-screen=false");
92
- args.push(...command.args);
93
- args.push("./app/index.ts");
89
+ function getArgs(options, command) {
90
+ if (options.node) {
91
+ const startCommand2 = "tsx";
92
+ const args2 = ["watch", "--clear-screen=false", ...command.args, "./app/index.ts"];
93
+ return { startCommand: startCommand2, args: args2 };
94
+ }
95
+ const startCommand = "bun";
96
+ const args = ["--watch", ...command.args, "./app/index.ts"];
94
97
  return { startCommand, args };
95
98
  }
96
99
 
97
100
  // src/dev/runner/startProcess.ts
98
- var import_chalk = __toESM(require("chalk"), 1);
99
101
  function startProcess(options, command) {
100
102
  const { startCommand, args } = getArgs(options, command);
101
103
  console.log(import_chalk.default.bold(`=> Starting app with command: ${startCommand} ${args.join(" ")}...
@@ -103,7 +105,8 @@ function startProcess(options, command) {
103
105
  return (0, import_node_child_process2.spawn)(startCommand, args, {
104
106
  env: {
105
107
  ORION_DEV: "local",
106
- ...process.env
108
+ ...process.env,
109
+ ...options.repl ? { ORION_REPL: "true" } : {}
107
110
  },
108
111
  cwd: process.cwd(),
109
112
  stdio: "inherit",
@@ -321,24 +324,6 @@ Orionjs App ${import_chalk5.default.green(import_chalk5.default.bold("V4"))} Dev
321
324
  // src/prod/index.ts
322
325
  var import_chalk9 = __toESM(require("chalk"), 1);
323
326
 
324
- // src/prod/runProd.ts
325
- var import_node_child_process3 = require("child_process");
326
- function runProd(options, command) {
327
- const indexPath = `${options.path}/index.js`;
328
- const args = ["--import=tsx", ...command.args, indexPath];
329
- (0, import_node_child_process3.spawn)("node", args, {
330
- env: {
331
- NODE_ENV: "production",
332
- ...process.env
333
- },
334
- cwd: process.cwd(),
335
- stdio: "inherit",
336
- gid: process.getgid(),
337
- uid: process.getuid(),
338
- detached: false
339
- });
340
- }
341
-
342
327
  // src/build/index.ts
343
328
  var import_chalk8 = __toESM(require("chalk"), 1);
344
329
 
@@ -366,9 +351,9 @@ async function build2(options) {
366
351
 
367
352
  // src/build/checkTs.ts
368
353
  var import_chalk7 = __toESM(require("chalk"), 1);
369
- var import_node_child_process4 = require("child_process");
354
+ var import_node_child_process3 = require("child_process");
370
355
  var import_node_util = require("util");
371
- var execPromise = (0, import_node_util.promisify)(import_node_child_process4.exec);
356
+ var execPromise = (0, import_node_util.promisify)(import_node_child_process3.exec);
372
357
  async function checkTs() {
373
358
  try {
374
359
  console.log("Checking TypeScript...");
@@ -400,14 +385,49 @@ async function build_default(options) {
400
385
  console.log(import_chalk8.default.bold("Build completed"));
401
386
  }
402
387
 
388
+ // src/prod/runProd.ts
389
+ var import_node_child_process4 = require("child_process");
390
+ function runProd(options, command) {
391
+ if (options.node) {
392
+ const indexPath = `${options.path}/index.js`;
393
+ const args2 = ["--import=tsx", ...command.args, indexPath];
394
+ (0, import_node_child_process4.spawn)("node", args2, {
395
+ env: {
396
+ NODE_ENV: "production",
397
+ ...process.env
398
+ },
399
+ cwd: process.cwd(),
400
+ stdio: "inherit",
401
+ gid: process.getgid(),
402
+ uid: process.getuid(),
403
+ detached: false
404
+ });
405
+ return;
406
+ }
407
+ const args = [...command.args, "./app/index.ts"];
408
+ (0, import_node_child_process4.spawn)("bun", args, {
409
+ env: {
410
+ NODE_ENV: "production",
411
+ ...process.env
412
+ },
413
+ cwd: process.cwd(),
414
+ stdio: "inherit",
415
+ gid: process.getgid(),
416
+ uid: process.getuid(),
417
+ detached: false
418
+ });
419
+ }
420
+
403
421
  // src/prod/index.ts
404
422
  async function prod_default(options, command) {
405
423
  console.log(import_chalk9.default.bold(`
406
424
  Orionjs App ${import_chalk9.default.green(import_chalk9.default.bold("V4"))} Prod mode
407
425
  `));
408
- if (!options.path) {
409
- await build_default({ output: "./build" });
410
- options.path = "./build";
426
+ if (options.node) {
427
+ if (!options.path) {
428
+ await build_default({ output: "./build" });
429
+ options.path = "./build";
430
+ }
411
431
  }
412
432
  runProd(options, command);
413
433
  }
@@ -464,23 +484,103 @@ async function check_default() {
464
484
  console.log(import_chalk12.default.bold.green("Check passed\n"));
465
485
  }
466
486
 
487
+ // src/info.ts
488
+ var import_chalk13 = __toESM(require("chalk"), 1);
489
+ var import_node_child_process6 = require("child_process");
490
+ function detectRuntime() {
491
+ const runtimes = [];
492
+ try {
493
+ const bunVersion = (0, import_node_child_process6.execSync)("bun --version", { encoding: "utf-8" }).trim();
494
+ runtimes.push(`Bun ${bunVersion}`);
495
+ } catch {
496
+ }
497
+ runtimes.push(`Node ${process.versions.node}`);
498
+ return runtimes.join(", ");
499
+ }
500
+ function info() {
501
+ console.log(`Orion CLI v${version_default} \u2014 Available runtimes: ${import_chalk13.default.bold(detectRuntime())}`);
502
+ console.log(`Default runtime: ${import_chalk13.default.bold("Bun")} (use --node flag to switch to Node.js)`);
503
+ }
504
+
505
+ // src/repl/index.ts
506
+ var import_node_fs5 = require("fs");
507
+ var import_node_path3 = require("path");
508
+ var import_chalk14 = __toESM(require("chalk"), 1);
509
+ function resolvePort(options) {
510
+ if (options.port) {
511
+ return Number(options.port);
512
+ }
513
+ try {
514
+ const portFile = (0, import_node_path3.resolve)(process.cwd(), ".orion/port");
515
+ const port = (0, import_node_fs5.readFileSync)(portFile, "utf-8").trim();
516
+ return Number(port);
517
+ } catch {
518
+ }
519
+ if (process.env.PORT) {
520
+ return Number(process.env.PORT);
521
+ }
522
+ return 3e3;
523
+ }
524
+ async function repl(options) {
525
+ var _a;
526
+ const expression = options.expression;
527
+ if (!expression) {
528
+ console.error(import_chalk14.default.red('Error: expression is required. Use -e "<expression>"'));
529
+ process.exit(1);
530
+ }
531
+ const port = resolvePort(options);
532
+ try {
533
+ const response = await fetch(`http://localhost:${port}/__repl`, {
534
+ method: "POST",
535
+ headers: { "Content-Type": "application/json" },
536
+ body: JSON.stringify({ expression })
537
+ });
538
+ const data = await response.json();
539
+ if (!data.success) {
540
+ console.error(import_chalk14.default.red(`Error: ${data.error}`));
541
+ if (data.stack) {
542
+ console.error(import_chalk14.default.dim(data.stack));
543
+ }
544
+ process.exit(1);
545
+ }
546
+ if (data.result !== void 0) {
547
+ console.log(
548
+ typeof data.result === "string" ? data.result : JSON.stringify(data.result, null, 2)
549
+ );
550
+ }
551
+ } catch (error) {
552
+ if (error.code === "ECONNREFUSED" || ((_a = error.cause) == null ? void 0 : _a.code) === "ECONNREFUSED") {
553
+ console.error(
554
+ import_chalk14.default.red(
555
+ `Could not connect to dev server on port ${port}. Make sure "orion dev --repl" is running.`
556
+ )
557
+ );
558
+ } else {
559
+ console.error(import_chalk14.default.red(`Error: ${error.message}`));
560
+ }
561
+ process.exit(1);
562
+ }
563
+ }
564
+
467
565
  // src/index.ts
468
566
  var program = new import_commander.Command();
469
567
  var run = (action) => async (...args) => {
470
568
  try {
471
569
  await action(...args);
472
570
  } catch (e) {
473
- console.error(import_chalk13.default.red(`Error: ${e.message}`));
571
+ console.error(import_chalk15.default.red(`Error: ${e.message}`));
474
572
  }
475
573
  };
476
- program.command("dev").description("Run the Orionjs app in development mode").allowUnknownOption().action(run(dev_default));
574
+ 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));
477
575
  program.command("check").description("Runs a typescript check").action(run(check_default));
478
576
  program.command("build").description("Build the Orionjs app for production").option("--output [path]", "Path of the output file").action(run(build_default));
479
- program.command("prod").allowUnknownOption().option(
577
+ program.command("prod").allowUnknownOption().option("--node", "Use Node.js runtime instead of Bun").option(
480
578
  "--path [path]",
481
579
  "Path of the compiled Orionjs app. If not provided, the app will be compiled and then run"
482
580
  ).description("Run the Orionjs app in production mode").action(run(prod_default));
483
581
  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));
582
+ program.command("info").description("Print runtime and version info").action(run(info));
583
+ 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));
484
584
  program.version(version_default, "-v --version");
485
585
  program.parse(process.argv);
486
586
  if (!process.argv.slice(2).length) {
@@ -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/prod/runProd.ts","../src/build/index.ts","../src/build/build.ts","../src/build/checkTs.ts","../src/handleErrors.ts","../src/version.ts","../src/check/index.ts","../src/check/checkTs.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'\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 .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(\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.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}\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 '.'\n\nexport function getArgs(_options: RunnerOptions, command: any) {\n const startCommand = 'tsx'\n\n const args = []\n\n args.push('watch', '--clear-screen=false')\n\n args.push(...command.args)\n\n args.push('./app/index.ts')\n\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 {runProd} from './runProd'\nimport build from '../build'\n\nexport interface ProdOptions {\n path?: string\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.path) {\n await build({output: './build'})\n options.path = './build'\n }\n\n runProd(options, command)\n}\n","import {spawn} from 'node:child_process'\nimport {ProdOptions} from './index'\n\nexport function runProd(options: ProdOptions, command: any) {\n const indexPath = `${options.path}/index.js`\n\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}\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 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"],"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,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,IAAAC,gBAAkB;;;ACAlB,IAAAC,gBAAkB;;;ACAlB,IAAAC,kBAAe;;;ACAf,qBAAe;AACf,uBAAiB;AAEjB,IAAM,kBAAkB,cAAY;A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AAQ;AAER,UAAQ,IAAI,eAAAD,QAAM,KAAK,MAAM,gBAAgB,CAAC;AAChD;;;AxBEA,IAAM,UAAU,IAAI,yBAAQ;AAE5B,IAAM,MACJ,YACA,UAAU,SAAS;AACjB,MAAI;AACF,UAAM,OAAO,GAAG,IAAI;AAAA,EACtB,SAAS,GAAG;AACV,YAAQ,MAAM,eAAAE,QAAM,IAAI,UAAU,EAAE,OAAO,EAAE,CAAC;AAAA,EAChD;AACF;AAEF,QACG,QAAQ,KAAK,EACb,YAAY,yCAAyC,EACrD,mBAAmB,EACnB,OAAO,IAAI,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;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,iBAAS,cAAc;AAEvC,QAAQ,MAAM,QAAQ,IAAI;AAE1B,IAAI,CAAC,QAAQ,KAAK,MAAM,CAAC,EAAE,QAAQ;AACjC,UAAQ,WAAW;AACrB;","names":["import_chalk","import_chalk","import_chalk","import_node_fs","path","fs","path","fs","import_node_child_process","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_node_child_process","import_chalk","import_chalk","build","chalk","import_chalk","import_node_child_process","chalk","chalk","build","chalk","import_chalk","chalk","import_chalk","import_chalk","import_node_child_process","checkTs","chalk","chalk","checkTs","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","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","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,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,IAAAC,gBAAkB;;;ACAlB,IAAAC,gBAAkB;;;ACAlB,IAAAC,kBAAe;;;ACAf,qBAAe;AACf,uBAAiB;AAEjB,IAAM,kBAAkB,cAAY;AAClC,QAAM,UAAU,iBAAAC,QAAK,QAAQ,QAAQ;AACrC,MAAI,eAAAC,QAAG,WAAW,OAAO,EAAG,QAAO;AACnC,kBAAgB,OAAO;AACvB,iBAAAA,QAAG,UAAU,OAAO;AACtB;AAEA,IAAO,0BAAQ;;;ADPf,eA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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","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 chalk13 from "chalk";
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((resolve, reject) => {
10
+ return new Promise((resolve2, reject) => {
11
11
  exec(command, (error, stdout, stderr) => {
12
12
  if (error) {
13
13
  reject(error);
14
14
  } else {
15
- resolve({ stdout, stderr });
15
+ resolve2({ stdout, stderr });
16
16
  }
17
17
  });
18
18
  });
@@ -61,19 +61,21 @@ 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
- function getArgs(_options, command) {
67
- const startCommand = "tsx";
68
- const args = [];
69
- args.push("watch", "--clear-screen=false");
70
- args.push(...command.args);
71
- args.push("./app/index.ts");
67
+ function getArgs(options, command) {
68
+ if (options.node) {
69
+ const startCommand2 = "tsx";
70
+ const args2 = ["watch", "--clear-screen=false", ...command.args, "./app/index.ts"];
71
+ return { startCommand: startCommand2, args: args2 };
72
+ }
73
+ const startCommand = "bun";
74
+ const args = ["--watch", ...command.args, "./app/index.ts"];
72
75
  return { startCommand, args };
73
76
  }
74
77
 
75
78
  // src/dev/runner/startProcess.ts
76
- import chalk from "chalk";
77
79
  function startProcess(options, command) {
78
80
  const { startCommand, args } = getArgs(options, command);
79
81
  console.log(chalk.bold(`=> Starting app with command: ${startCommand} ${args.join(" ")}...
@@ -81,7 +83,8 @@ function startProcess(options, command) {
81
83
  return spawn(startCommand, args, {
82
84
  env: {
83
85
  ORION_DEV: "local",
84
- ...process.env
86
+ ...process.env,
87
+ ...options.repl ? { ORION_REPL: "true" } : {}
85
88
  },
86
89
  cwd: process.cwd(),
87
90
  stdio: "inherit",
@@ -299,24 +302,6 @@ Orionjs App ${chalk5.green(chalk5.bold("V4"))} Dev mode
299
302
  // src/prod/index.ts
300
303
  import chalk9 from "chalk";
301
304
 
302
- // src/prod/runProd.ts
303
- import { spawn as spawn2 } from "child_process";
304
- function runProd(options, command) {
305
- const indexPath = `${options.path}/index.js`;
306
- const args = ["--import=tsx", ...command.args, indexPath];
307
- spawn2("node", args, {
308
- env: {
309
- NODE_ENV: "production",
310
- ...process.env
311
- },
312
- cwd: process.cwd(),
313
- stdio: "inherit",
314
- gid: process.getgid(),
315
- uid: process.getuid(),
316
- detached: false
317
- });
318
- }
319
-
320
305
  // src/build/index.ts
321
306
  import chalk8 from "chalk";
322
307
 
@@ -378,14 +363,49 @@ async function build_default(options) {
378
363
  console.log(chalk8.bold("Build completed"));
379
364
  }
380
365
 
366
+ // src/prod/runProd.ts
367
+ import { spawn as spawn2 } from "child_process";
368
+ function runProd(options, command) {
369
+ if (options.node) {
370
+ const indexPath = `${options.path}/index.js`;
371
+ const args2 = ["--import=tsx", ...command.args, indexPath];
372
+ spawn2("node", args2, {
373
+ env: {
374
+ NODE_ENV: "production",
375
+ ...process.env
376
+ },
377
+ cwd: process.cwd(),
378
+ stdio: "inherit",
379
+ gid: process.getgid(),
380
+ uid: process.getuid(),
381
+ detached: false
382
+ });
383
+ return;
384
+ }
385
+ const args = [...command.args, "./app/index.ts"];
386
+ spawn2("bun", args, {
387
+ env: {
388
+ NODE_ENV: "production",
389
+ ...process.env
390
+ },
391
+ cwd: process.cwd(),
392
+ stdio: "inherit",
393
+ gid: process.getgid(),
394
+ uid: process.getuid(),
395
+ detached: false
396
+ });
397
+ }
398
+
381
399
  // src/prod/index.ts
382
400
  async function prod_default(options, command) {
383
401
  console.log(chalk9.bold(`
384
402
  Orionjs App ${chalk9.green(chalk9.bold("V4"))} Prod mode
385
403
  `));
386
- if (!options.path) {
387
- await build_default({ output: "./build" });
388
- options.path = "./build";
404
+ if (options.node) {
405
+ if (!options.path) {
406
+ await build_default({ output: "./build" });
407
+ options.path = "./build";
408
+ }
389
409
  }
390
410
  runProd(options, command);
391
411
  }
@@ -442,23 +462,103 @@ async function check_default() {
442
462
  console.log(chalk12.bold.green("Check passed\n"));
443
463
  }
444
464
 
465
+ // src/info.ts
466
+ import chalk13 from "chalk";
467
+ import { execSync as execSync2 } from "child_process";
468
+ function detectRuntime() {
469
+ const runtimes = [];
470
+ try {
471
+ const bunVersion = execSync2("bun --version", { encoding: "utf-8" }).trim();
472
+ runtimes.push(`Bun ${bunVersion}`);
473
+ } catch {
474
+ }
475
+ runtimes.push(`Node ${process.versions.node}`);
476
+ return runtimes.join(", ");
477
+ }
478
+ function info() {
479
+ console.log(`Orion CLI v${version_default} \u2014 Available runtimes: ${chalk13.bold(detectRuntime())}`);
480
+ console.log(`Default runtime: ${chalk13.bold("Bun")} (use --node flag to switch to Node.js)`);
481
+ }
482
+
483
+ // src/repl/index.ts
484
+ import { readFileSync } from "fs";
485
+ import { resolve } from "path";
486
+ import chalk14 from "chalk";
487
+ function resolvePort(options) {
488
+ if (options.port) {
489
+ return Number(options.port);
490
+ }
491
+ try {
492
+ const portFile = resolve(process.cwd(), ".orion/port");
493
+ const port = readFileSync(portFile, "utf-8").trim();
494
+ return Number(port);
495
+ } catch {
496
+ }
497
+ if (process.env.PORT) {
498
+ return Number(process.env.PORT);
499
+ }
500
+ return 3e3;
501
+ }
502
+ async function repl(options) {
503
+ var _a;
504
+ const expression = options.expression;
505
+ if (!expression) {
506
+ console.error(chalk14.red('Error: expression is required. Use -e "<expression>"'));
507
+ process.exit(1);
508
+ }
509
+ const port = resolvePort(options);
510
+ try {
511
+ const response = await fetch(`http://localhost:${port}/__repl`, {
512
+ method: "POST",
513
+ headers: { "Content-Type": "application/json" },
514
+ body: JSON.stringify({ expression })
515
+ });
516
+ const data = await response.json();
517
+ if (!data.success) {
518
+ console.error(chalk14.red(`Error: ${data.error}`));
519
+ if (data.stack) {
520
+ console.error(chalk14.dim(data.stack));
521
+ }
522
+ process.exit(1);
523
+ }
524
+ if (data.result !== void 0) {
525
+ console.log(
526
+ typeof data.result === "string" ? data.result : JSON.stringify(data.result, null, 2)
527
+ );
528
+ }
529
+ } catch (error) {
530
+ if (error.code === "ECONNREFUSED" || ((_a = error.cause) == null ? void 0 : _a.code) === "ECONNREFUSED") {
531
+ console.error(
532
+ chalk14.red(
533
+ `Could not connect to dev server on port ${port}. Make sure "orion dev --repl" is running.`
534
+ )
535
+ );
536
+ } else {
537
+ console.error(chalk14.red(`Error: ${error.message}`));
538
+ }
539
+ process.exit(1);
540
+ }
541
+ }
542
+
445
543
  // src/index.ts
446
544
  var program = new Command();
447
545
  var run = (action) => async (...args) => {
448
546
  try {
449
547
  await action(...args);
450
548
  } catch (e) {
451
- console.error(chalk13.red(`Error: ${e.message}`));
549
+ console.error(chalk15.red(`Error: ${e.message}`));
452
550
  }
453
551
  };
454
- program.command("dev").description("Run the Orionjs app in development mode").allowUnknownOption().action(run(dev_default));
552
+ 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));
455
553
  program.command("check").description("Runs a typescript check").action(run(check_default));
456
554
  program.command("build").description("Build the Orionjs app for production").option("--output [path]", "Path of the output file").action(run(build_default));
457
- program.command("prod").allowUnknownOption().option(
555
+ program.command("prod").allowUnknownOption().option("--node", "Use Node.js runtime instead of Bun").option(
458
556
  "--path [path]",
459
557
  "Path of the compiled Orionjs app. If not provided, the app will be compiled and then run"
460
558
  ).description("Run the Orionjs app in production mode").action(run(prod_default));
461
559
  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));
560
+ program.command("info").description("Print runtime and version info").action(run(info));
561
+ 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));
462
562
  program.version(version_default, "-v --version");
463
563
  program.parse(process.argv);
464
564
  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/prod/runProd.ts","../src/build/index.ts","../src/build/build.ts","../src/build/checkTs.ts","../src/handleErrors.ts","../src/version.ts","../src/check/index.ts","../src/check/checkTs.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'\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 .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(\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.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}\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 '.'\n\nexport function getArgs(_options: RunnerOptions, command: any) {\n const startCommand = 'tsx'\n\n const args = []\n\n args.push('watch', '--clear-screen=false')\n\n args.push(...command.args)\n\n args.push('./app/index.ts')\n\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 {runProd} from './runProd'\nimport build from '../build'\n\nexport interface ProdOptions {\n path?: string\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.path) {\n await build({output: './build'})\n options.path = './build'\n }\n\n runProd(options, command)\n}\n","import {spawn} from 'node:child_process'\nimport {ProdOptions} from './index'\n\nexport function runProd(options: ProdOptions, command: any) {\n const indexPath = `${options.path}/index.js`\n\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}\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 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"],"mappings":";;;AACA,OA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O,iBAAiB,qBAAqB,EAC7C,OAAO,eAAe,0BAA0B,EAChD,OAAO,IAAI,cAAM,CAAC;AAErB,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","chalk","ts","fs","path","ts","fs","ts","chalk","ts","chalk","ts","chalk","chalk","spawn","chalk","chalk","build","chalk","exec","chalk","build","chalk","chalk","chalk","chalk","checkTs","chalk","checkTs","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","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","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;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;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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","chalk"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orion-js/core",
3
- "version": "4.2.5",
3
+ "version": "4.3.1",
4
4
  "main": "./dist/index.cjs",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [
@@ -11,8 +11,16 @@
11
11
  "bin": {
12
12
  "orion": "./dist/index.js"
13
13
  },
14
+ "scripts": {
15
+ "test": "bun test",
16
+ "prepare": "bun run build",
17
+ "clean": "rm -rf ./dist",
18
+ "build": "tsup",
19
+ "dev": "tsup --watch"
20
+ },
14
21
  "dependencies": {
15
22
  "@jgoz/esbuild-plugin-typecheck": "^4.0.3",
23
+ "@orion-js/env": "4.3.0",
16
24
  "chalk": "^4.1.2",
17
25
  "chokidar": "3.5.3",
18
26
  "commander": "^9.4.1",
@@ -21,12 +29,16 @@
21
29
  "esbuild": "^0.25.1",
22
30
  "prompts": "^2.4.2",
23
31
  "typescript": "^5.4.5",
24
- "yaml": "^2.2.1",
25
- "@orion-js/env": "4.2.2"
32
+ "yaml": "^2.2.1"
26
33
  },
27
34
  "peerDependencies": {
28
- "tsx": "*",
29
- "@orion-js/logger": "4.2.0"
35
+ "@orion-js/logger": "4.3.0",
36
+ "tsx": "*"
37
+ },
38
+ "peerDependenciesMeta": {
39
+ "tsx": {
40
+ "optional": true
41
+ }
30
42
  },
31
43
  "publishConfig": {
32
44
  "access": "public"
@@ -38,8 +50,7 @@
38
50
  "devDependencies": {
39
51
  "@types/node": "^18.0.0",
40
52
  "@types/prompts": "^2.4.2",
41
- "tsup": "^8.0.1",
42
- "vitest": "^3.0.8"
53
+ "tsup": "^8.0.1"
43
54
  },
44
55
  "type": "module",
45
56
  "module": "./dist/index.js",
@@ -47,12 +58,5 @@
47
58
  "types": "./dist/index.d.ts",
48
59
  "import": "./dist/index.js",
49
60
  "require": "./dist/index.cjs"
50
- },
51
- "scripts": {
52
- "test": "vitest run",
53
- "clean": "rm -rf ./dist",
54
- "build": "tsup",
55
- "upgrade-interactive": "pnpm upgrade --interactive",
56
- "dev": "tsup --watch"
57
61
  }
58
- }
62
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2022 Orionjs Team
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.