@routecraft/cli 0.1.1 → 0.2.0-canary.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.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {Command}from'commander';import {resolve,extname}from'path';import {logger,ContextBuilder}from'@routecraft/routecraft';import {config}from'dotenv';function f(o){if(o){let s=resolve(process.cwd(),o),r=config({path:s});return r.error?logger.info(`Could not load .env file from ${o}: ${r.error.message}`):r.parsed&&logger.debug(`Loaded ${Object.keys(r.parsed).length} environment variables from ${o}`),r}let e=config({path:resolve(process.cwd(),".env")});e.parsed?logger.debug(`Loaded ${Object.keys(e.parsed).length} environment variables from .env`):e.error&&logger.debug("No .env file found");let n=config({path:resolve(process.cwd(),".env.local"),override:true});return n.parsed&&logger.debug(`Loaded ${Object.keys(n.parsed).length} environment variables from .env.local`),n.parsed?n:e.parsed?e:n}function p(o){process.on("SIGINT",async()=>{o.logger.info("Shutting down (SIGINT)..."),await o.stop(),process.exit(0);}),process.on("SIGTERM",async()=>{o.logger.info("Shutting down (SIGTERM)..."),await o.stop(),process.exit(0);}),process.on("exit",()=>{o.logger.info("Cleanup complete");});}var m=[".mjs",".js",".cjs"];async function g(o){let e=resolve(process.cwd(),o),n=extname(e);if(!m.includes(n))return {success:false,code:1,message:`Error: Only the following file types are supported: ${m.join(", ")}`};if(n===".ts"||n===".tsx")return {success:false,code:1,message:"TypeScript files are not supported by 'craft run'. Compile to .js or use .mjs/.js/.cjs."};try{logger.info(`Loading file: ${e}`);let s=await import(e),r=new ContextBuilder;s.craftConfig&&(logger.info("Found craftConfig export, applying configuration"),r.with(s.craftConfig));let l=w(r,s.default);if(!l.success)return l;let d=r.build();return p(d),await d.start(),{success:!0}}catch(s){return s instanceof Error?(logger.error(`Failed to run ${e}: ${s.message}`),{success:false,code:1,message:s.message}):(logger.error(`Failed to run ${e}: Unknown error occurred`),{success:false,code:1,message:"Unknown error"})}}function w(o,e){let n=r=>typeof r=="object"&&r!==null&&"id"in r,s=r=>typeof r=="object"&&r!==null&&typeof r.build=="function";return e?n(e)||s(e)?(o.routes(e),logger.info("Loaded single route from default export"),{success:true}):Array.isArray(e)?e.every(r=>n(r)||s(r))?(e.forEach(r=>o.routes(r)),logger.info(`Loaded ${e.length} routes from default export array`),{success:true}):(logger.error("All items in default export array must be RouteDefinition or RouteBuilder"),{success:false,code:1,message:"Invalid items in default export array"}):(logger.error("Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those."),{success:false,code:1,message:"Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those."}):(logger.error("No default export found. Expected routes as default export."),{success:false,code:1,message:"No default export found"})}var a=new Command;a.name("craft").description("A modern routing framework for TypeScript").version("0.
|
|
2
|
+
import {Command}from'commander';import {resolve,extname}from'path';import {logger,ContextBuilder}from'@routecraft/routecraft';import {config}from'dotenv';function f(o){if(o){let s=resolve(process.cwd(),o),r=config({path:s});return r.error?logger.info(`Could not load .env file from ${o}: ${r.error.message}`):r.parsed&&logger.debug(`Loaded ${Object.keys(r.parsed).length} environment variables from ${o}`),r}let e=config({path:resolve(process.cwd(),".env")});e.parsed?logger.debug(`Loaded ${Object.keys(e.parsed).length} environment variables from .env`):e.error&&logger.debug("No .env file found");let n=config({path:resolve(process.cwd(),".env.local"),override:true});return n.parsed&&logger.debug(`Loaded ${Object.keys(n.parsed).length} environment variables from .env.local`),n.parsed?n:e.parsed?e:n}function p(o){process.on("SIGINT",async()=>{o.logger.info("Shutting down (SIGINT)..."),await o.stop(),process.exit(0);}),process.on("SIGTERM",async()=>{o.logger.info("Shutting down (SIGTERM)..."),await o.stop(),process.exit(0);}),process.on("exit",()=>{o.logger.info("Cleanup complete");});}var m=[".mjs",".js",".cjs"];async function g(o){let e=resolve(process.cwd(),o),n=extname(e);if(!m.includes(n))return {success:false,code:1,message:`Error: Only the following file types are supported: ${m.join(", ")}`};if(n===".ts"||n===".tsx")return {success:false,code:1,message:"TypeScript files are not supported by 'craft run'. Compile to .js or use .mjs/.js/.cjs."};try{logger.info(`Loading file: ${e}`);let s=await import(e),r=new ContextBuilder;s.craftConfig&&(logger.info("Found craftConfig export, applying configuration"),r.with(s.craftConfig));let l=w(r,s.default);if(!l.success)return l;let d=r.build();return p(d),await d.start(),{success:!0}}catch(s){return s instanceof Error?(logger.error(`Failed to run ${e}: ${s.message}`),{success:false,code:1,message:s.message}):(logger.error(`Failed to run ${e}: Unknown error occurred`),{success:false,code:1,message:"Unknown error"})}}function w(o,e){let n=r=>typeof r=="object"&&r!==null&&"id"in r,s=r=>typeof r=="object"&&r!==null&&typeof r.build=="function";return e?n(e)||s(e)?(o.routes(e),logger.info("Loaded single route from default export"),{success:true}):Array.isArray(e)?e.every(r=>n(r)||s(r))?(e.forEach(r=>o.routes(r)),logger.info(`Loaded ${e.length} routes from default export array`),{success:true}):(logger.error("All items in default export array must be RouteDefinition or RouteBuilder"),{success:false,code:1,message:"Invalid items in default export array"}):(logger.error("Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those."),{success:false,code:1,message:"Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those."}):(logger.error("No default export found. Expected routes as default export."),{success:false,code:1,message:"No default export found"})}var a=new Command;a.name("craft").description("A modern routing framework for TypeScript").version("0.2.0-canary.1").showSuggestionAfterError().showHelpAfterError().exitOverride(o=>{o.code==="commander.unknownCommand"&&process.exit(0);});process.argv.length<=2&&a.help({error:false});a.command("run").description("Run routes from a single TypeScript/JavaScript file").argument("<file>","Path to a file containing routes").option("--env <path>","Load environment variables from a .env file (default: .env)").action(async(o,e)=>{e.env!==void 0?f(e.env):f();let n=await g(o);n.success||(n.message&&console.error(n.message),process.exit(n.code??1));});a.parse();//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/util.ts","../src/run.ts","../src/index.ts"],"names":["loadEnvFile","path","envPath","resolve","result","loadDotenv","logger","envResult","envLocalResult","registerContextSignalHandlers","context","SUPPORTED_EXTENSIONS","runCommand","filePath","absFilePath","ext","extname","module","contextBuilder","ContextBuilder","configured","configureRoutes","error","defaultExport","isRouteDefinition","obj","isRouteBuilder","item","routeOrBuilder","program","Command","err","options"],"mappings":";0JAUO,SAASA,CAAAA,CAAYC,CAAAA,CAAe,CACzC,GAAIA,CAAAA,CAAM,CAER,IAAMC,CAAAA,CAAUC,OAAAA,CAAQ,OAAA,CAAQ,GAAA,GAAOF,CAAI,CAAA,CACrCG,CAAAA,CAASC,MAAAA,CAAW,CAAE,IAAA,CAAMH,CAAQ,CAAC,EAE3C,OAAIE,CAAAA,CAAO,KAAA,CACTE,MAAAA,CAAO,IAAA,CACL,CAAA,8BAAA,EAAiCL,CAAI,CAAA,EAAA,EAAKG,EAAO,KAAA,CAAM,OAAO,CAAA,CAChE,CAAA,CACSA,CAAAA,CAAO,MAAA,EAChBE,MAAAA,CAAO,KAAA,CACL,UAAU,MAAA,CAAO,IAAA,CAAKF,CAAAA,CAAO,MAAM,CAAA,CAAE,MAAM,CAAA,4BAAA,EAA+BH,CAAI,EAChF,CAAA,CAGKG,CACT,CAIA,IAAMG,CAAAA,CAAYF,MAAAA,CAAW,CAAE,IAAA,CAAMF,QAAQ,OAAA,CAAQ,GAAA,EAAI,CAAG,MAAM,CAAE,CAAC,CAAA,CACjEI,CAAAA,CAAU,OACZD,MAAAA,CAAO,KAAA,CACL,CAAA,OAAA,EAAU,MAAA,CAAO,IAAA,CAAKC,CAAAA,CAAU,MAAM,CAAA,CAAE,MAAM,CAAA,gCAAA,CAChD,CAAA,CACSA,CAAAA,CAAU,KAAA,EACnBD,MAAAA,CAAO,KAAA,CAAM,oBAAoB,CAAA,CAInC,IAAME,CAAAA,CAAiBH,MAAAA,CAAW,CAChC,IAAA,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DAA6D,CAAA,CACnE,CAAE,OAAA,CAAS,KAAA,CAAO,KAAM,CAAA,CAAG,OAAA,CAAS,yBAA0B,CAAA,CAkDzE,CClIA,IAAMuB,CAAAA,CAAU,IAAIC,QAEpBD,CAAAA,CACG,IAAA,CAAK,OAAO,CAAA,CACZ,WAAA,CAAY,2CAA2C,CAAA,CACvD,OAAA,CAAQ,OAAO,CAAA,CACf,wBAAA,EAAyB,CACzB,kBAAA,EAAmB,CACnB,YAAA,CAAcE,CAAAA,EAAQ,CACjBA,EAAI,IAAA,GAAS,0BAAA,EACf,OAAA,CAAQ,IAAA,CAAK,CAAC,EAElB,CAAC,CAAA,CAGC,QAAQ,IAAA,CAAK,MAAA,EAAU,CAAA,EACzBF,CAAAA,CAAQ,IAAA,CAAK,CAAE,KAAA,CAAO,KAAM,CAAC,CAAA,CAS/BA,CAAAA,CACG,OAAA,CAAQ,KAAK,CAAA,CACb,WAAA,CAAY,qDAAqD,CAAA,CACjE,SAAS,QAAA,CAAU,kCAAkC,CAAA,CACrD,MAAA,CACC,cAAA,CACA,6DACF,CAAA,CACC,MAAA,CAAO,MAAOhB,CAAAA,CAAUmB,CAAAA,GAAY,CAE/BA,CAAAA,CAAQ,GAAA,GAAQ,MAAA,CAClBhC,CAAAA,CAAYgC,CAAAA,CAAQ,GAAG,CAAA,CAEvBhC,CAAAA,EAAY,CAGd,IAAMI,CAAAA,CAAS,MAAMQ,CAAAA,CAAWC,CAAQ,EACnCT,CAAAA,CAAO,OAAA,GACNA,CAAAA,CAAO,OAAA,EAET,OAAA,CAAQ,KAAA,CAAMA,CAAAA,CAAO,OAAO,EAE9B,OAAA,CAAQ,IAAA,CAAKA,CAAAA,CAAO,IAAA,EAAQ,CAAC,CAAA,EAEjC,CAAC,CAAA,CAGHyB,EAAQ,KAAA,EAAM","file":"index.js","sourcesContent":["import { logger, CraftContext } from \"@routecraft/routecraft\";\nimport { resolve } from \"node:path\";\nimport { config as loadDotenv } from \"dotenv\";\n\n/**\n * Loads environment variables from .env files\n *\n * @param path Optional path to .env file. If not specified, loads .env and .env.local (if they exist)\n * @returns The parsed dotenv config result\n */\nexport function loadEnvFile(path?: string) {\n if (path) {\n // Explicit path provided - load that file only\n const envPath = resolve(process.cwd(), path);\n const result = loadDotenv({ path: envPath });\n\n if (result.error) {\n logger.info(\n `Could not load .env file from ${path}: ${result.error.message}`,\n );\n } else if (result.parsed) {\n logger.debug(\n `Loaded ${Object.keys(result.parsed).length} environment variables from ${path}`,\n );\n }\n\n return result;\n }\n\n // No path provided - load .env, then .env.local (with override)\n // Load .env first\n const envResult = loadDotenv({ path: resolve(process.cwd(), \".env\") });\n if (envResult.parsed) {\n logger.debug(\n `Loaded ${Object.keys(envResult.parsed).length} environment variables from .env`,\n );\n } else if (envResult.error) {\n logger.debug(`No .env file found`);\n }\n\n // Load .env.local next, allowing it to override .env values\n const envLocalResult = loadDotenv({\n path: resolve(process.cwd(), \".env.local\"),\n override: true,\n });\n if (envLocalResult.parsed) {\n logger.debug(\n `Loaded ${Object.keys(envLocalResult.parsed).length} environment variables from .env.local`,\n );\n }\n\n // Return the most successful result:\n // - If .env.local loaded successfully, return it\n // - If .env loaded successfully but .env.local failed (doesn't exist), return .env result\n // - If both failed, return the last error (from .env.local)\n if (envLocalResult.parsed) {\n return envLocalResult;\n }\n if (envResult.parsed) {\n return envResult;\n }\n return envLocalResult;\n}\n\n/**\n * Registers SIGINT, SIGTERM, and exit handlers for a CraftContext instance.\n * Ensures graceful shutdown and logging.\n *\n * @param context The CraftContext instance\n */\nexport function registerContextSignalHandlers(\n context: InstanceType<typeof CraftContext>,\n) {\n process.on(\"SIGINT\", async () => {\n context.logger.info(\"Shutting down (SIGINT)...\");\n await context.stop();\n process.exit(0);\n });\n process.on(\"SIGTERM\", async () => {\n context.logger.info(\"Shutting down (SIGTERM)...\");\n await context.stop();\n process.exit(0);\n });\n process.on(\"exit\", () => {\n context.logger.info(\"Cleanup complete\");\n });\n}\n","import { resolve, extname } from \"node:path\";\nimport {\n ContextBuilder,\n type RouteDefinition,\n type CraftConfig,\n logger,\n RouteBuilder,\n} from \"@routecraft/routecraft\";\nimport { registerContextSignalHandlers } from \"./util\";\n\nconst SUPPORTED_EXTENSIONS = [\".mjs\", \".js\", \".cjs\"] as const;\n\ntype RunResult =\n | { success: true }\n | { success: false; code?: number; message: string };\n\nexport async function runCommand(filePath: string): Promise<RunResult> {\n const absFilePath = resolve(process.cwd(), filePath);\n const ext = extname(absFilePath);\n\n // Validate file extension\n if (\n !SUPPORTED_EXTENSIONS.includes(ext as (typeof SUPPORTED_EXTENSIONS)[number])\n ) {\n return {\n success: false,\n code: 1,\n message: `Error: Only the following file types are supported: ${SUPPORTED_EXTENSIONS.join(\", \")}`,\n };\n }\n\n // Reject TypeScript files explicitly\n if (ext === \".ts\" || ext === \".tsx\") {\n return {\n success: false,\n code: 1,\n message:\n \"TypeScript files are not supported by 'craft run'. Compile to .js or use .mjs/.js/.cjs.\",\n };\n }\n\n try {\n logger.info(`Loading file: ${absFilePath}`);\n\n // Load the module with both default and named exports\n const module = await import(absFilePath);\n\n // Create context builder\n const contextBuilder = new ContextBuilder();\n\n // Check for optional craftConfig named export\n if (module.craftConfig) {\n logger.info(\"Found craftConfig export, applying configuration\");\n contextBuilder.with(module.craftConfig as CraftConfig);\n }\n\n // Handle routes from the default export\n const configured = configureRoutes(contextBuilder, module.default);\n if (!configured.success) {\n return configured;\n }\n\n // Build and start the context\n const context = contextBuilder.build();\n registerContextSignalHandlers(context);\n await context.start();\n\n return { success: true };\n } catch (error: unknown) {\n if (error instanceof Error) {\n logger.error(`Failed to run ${absFilePath}: ${error.message}`);\n return { success: false, code: 1, message: error.message };\n }\n logger.error(`Failed to run ${absFilePath}: Unknown error occurred`);\n return { success: false, code: 1, message: \"Unknown error\" };\n }\n}\n\nfunction configureRoutes(\n contextBuilder: InstanceType<typeof ContextBuilder>,\n defaultExport: unknown,\n): RunResult {\n // Type guards\n const isRouteDefinition = (obj: unknown): obj is RouteDefinition =>\n typeof obj === \"object\" && obj !== null && \"id\" in obj;\n\n const isRouteBuilder = (\n obj: unknown,\n ): obj is InstanceType<typeof RouteBuilder> =>\n typeof obj === \"object\" &&\n obj !== null &&\n typeof (obj as { build?: unknown }).build === \"function\";\n\n if (!defaultExport) {\n logger.error(\"No default export found. Expected routes as default export.\");\n return { success: false, code: 1, message: \"No default export found\" };\n }\n\n // Handle single route or RouteBuilder\n if (isRouteDefinition(defaultExport) || isRouteBuilder(defaultExport)) {\n contextBuilder.routes(\n defaultExport as RouteDefinition | InstanceType<typeof RouteBuilder>,\n );\n logger.info(\"Loaded single route from default export\");\n return { success: true };\n }\n\n // Handle array of routes\n if (Array.isArray(defaultExport)) {\n if (\n !defaultExport.every(\n (item) => isRouteDefinition(item) || isRouteBuilder(item),\n )\n ) {\n logger.error(\n \"All items in default export array must be RouteDefinition or RouteBuilder\",\n );\n return {\n success: false,\n code: 1,\n message: \"Invalid items in default export array\",\n };\n }\n\n defaultExport.forEach((routeOrBuilder) =>\n contextBuilder.routes(\n routeOrBuilder as RouteDefinition | InstanceType<typeof RouteBuilder>,\n ),\n );\n logger.info(\n `Loaded ${defaultExport.length} routes from default export array`,\n );\n return { success: true };\n }\n\n // Invalid default export\n logger.error(\n \"Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those.\",\n );\n return {\n success: false,\n code: 1,\n message:\n \"Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those.\",\n };\n}\n","#!/usr/bin/env node\n\n/**\n * Routecraft CLI Module\n *\n * This module provides the command-line interface for Routecraft.\n */\nimport { Command } from \"commander\";\nimport { runCommand } from \"./run.ts\";\nimport { loadEnvFile } from \"./util.ts\";\n\n/**\n * The main command program for the Routecraft CLI.\n * Built using the commander.js library.\n */\nconst program = new Command();\n\nprogram\n .name(\"craft\")\n .description(\"A modern routing framework for TypeScript\")\n .version(\"0.1.1\")\n .showSuggestionAfterError()\n .showHelpAfterError()\n .exitOverride((err) => {\n if (err.code === \"commander.unknownCommand\") {\n process.exit(0);\n }\n });\n\n// Show help by default if no arguments provided\nif (process.argv.length <= 2) {\n program.help({ error: false });\n}\n\n/**\n * The 'run' command executes routes from a single file.\n *\n * Example:\n * craft run ./my-routes.ts\n */\nprogram\n .command(\"run\")\n .description(\"Run routes from a single TypeScript/JavaScript file\")\n .argument(\"<file>\", \"Path to a file containing routes\")\n .option(\n \"--env <path>\",\n \"Load environment variables from a .env file (default: .env)\",\n )\n .action(async (filePath, options) => {\n // Load environment variables if specified or use default .env\n if (options.env !== undefined) {\n loadEnvFile(options.env);\n } else {\n loadEnvFile();\n }\n\n const result = await runCommand(filePath);\n if (!result.success) {\n if (result.message) {\n // eslint-disable-next-line no-console\n console.error(result.message);\n }\n process.exit(result.code ?? 1);\n }\n });\n\n// Parse the command line arguments and execute the appropriate command\nprogram.parse();\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/util.ts","../src/run.ts","../src/index.ts"],"names":["loadEnvFile","path","envPath","resolve","result","loadDotenv","logger","envResult","envLocalResult","registerContextSignalHandlers","context","SUPPORTED_EXTENSIONS","runCommand","filePath","absFilePath","ext","extname","module","contextBuilder","ContextBuilder","configured","configureRoutes","error","defaultExport","isRouteDefinition","obj","isRouteBuilder","item","routeOrBuilder","program","Command","err","options"],"mappings":";0JAUO,SAASA,CAAAA,CAAYC,CAAAA,CAAe,CACzC,GAAIA,CAAAA,CAAM,CAER,IAAMC,CAAAA,CAAUC,OAAAA,CAAQ,OAAA,CAAQ,GAAA,GAAOF,CAAI,CAAA,CACrCG,CAAAA,CAASC,MAAAA,CAAW,CAAE,IAAA,CAAMH,CAAQ,CAAC,EAE3C,OAAIE,CAAAA,CAAO,KAAA,CACTE,MAAAA,CAAO,IAAA,CACL,CAAA,8BAAA,EAAiCL,CAAI,CAAA,EAAA,EAAKG,EAAO,KAAA,CAAM,OAAO,CAAA,CAChE,CAAA,CACSA,CAAAA,CAAO,MAAA,EAChBE,MAAAA,CAAO,KAAA,CACL,UAAU,MAAA,CAAO,IAAA,C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AE/BA,CAAAA,CAAQ,GAAA,GAAQ,MAAA,CAClBhC,CAAAA,CAAYgC,CAAAA,CAAQ,GAAG,CAAA,CAEvBhC,CAAAA,EAAY,CAGd,IAAMI,CAAAA,CAAS,MAAMQ,CAAAA,CAAWC,CAAQ,EACnCT,CAAAA,CAAO,OAAA,GACNA,CAAAA,CAAO,OAAA,EAET,OAAA,CAAQ,KAAA,CAAMA,CAAAA,CAAO,OAAO,EAE9B,OAAA,CAAQ,IAAA,CAAKA,CAAAA,CAAO,IAAA,EAAQ,CAAC,CAAA,EAEjC,CAAC,CAAA,CAGHyB,EAAQ,KAAA,EAAM","file":"index.js","sourcesContent":["import { logger, CraftContext } from \"@routecraft/routecraft\";\nimport { resolve } from \"node:path\";\nimport { config as loadDotenv } from \"dotenv\";\n\n/**\n * Loads environment variables from .env files\n *\n * @param path Optional path to .env file. If not specified, loads .env and .env.local (if they exist)\n * @returns The parsed dotenv config result\n */\nexport function loadEnvFile(path?: string) {\n if (path) {\n // Explicit path provided - load that file only\n const envPath = resolve(process.cwd(), path);\n const result = loadDotenv({ path: envPath });\n\n if (result.error) {\n logger.info(\n `Could not load .env file from ${path}: ${result.error.message}`,\n );\n } else if (result.parsed) {\n logger.debug(\n `Loaded ${Object.keys(result.parsed).length} environment variables from ${path}`,\n );\n }\n\n return result;\n }\n\n // No path provided - load .env, then .env.local (with override)\n // Load .env first\n const envResult = loadDotenv({ path: resolve(process.cwd(), \".env\") });\n if (envResult.parsed) {\n logger.debug(\n `Loaded ${Object.keys(envResult.parsed).length} environment variables from .env`,\n );\n } else if (envResult.error) {\n logger.debug(`No .env file found`);\n }\n\n // Load .env.local next, allowing it to override .env values\n const envLocalResult = loadDotenv({\n path: resolve(process.cwd(), \".env.local\"),\n override: true,\n });\n if (envLocalResult.parsed) {\n logger.debug(\n `Loaded ${Object.keys(envLocalResult.parsed).length} environment variables from .env.local`,\n );\n }\n\n // Return the most successful result:\n // - If .env.local loaded successfully, return it\n // - If .env loaded successfully but .env.local failed (doesn't exist), return .env result\n // - If both failed, return the last error (from .env.local)\n if (envLocalResult.parsed) {\n return envLocalResult;\n }\n if (envResult.parsed) {\n return envResult;\n }\n return envLocalResult;\n}\n\n/**\n * Registers SIGINT, SIGTERM, and exit handlers for a CraftContext instance.\n * Ensures graceful shutdown and logging.\n *\n * @param context The CraftContext instance\n */\nexport function registerContextSignalHandlers(\n context: InstanceType<typeof CraftContext>,\n) {\n process.on(\"SIGINT\", async () => {\n context.logger.info(\"Shutting down (SIGINT)...\");\n await context.stop();\n process.exit(0);\n });\n process.on(\"SIGTERM\", async () => {\n context.logger.info(\"Shutting down (SIGTERM)...\");\n await context.stop();\n process.exit(0);\n });\n process.on(\"exit\", () => {\n context.logger.info(\"Cleanup complete\");\n });\n}\n","import { resolve, extname } from \"node:path\";\nimport {\n ContextBuilder,\n type RouteDefinition,\n type CraftConfig,\n logger,\n RouteBuilder,\n} from \"@routecraft/routecraft\";\nimport { registerContextSignalHandlers } from \"./util\";\n\nconst SUPPORTED_EXTENSIONS = [\".mjs\", \".js\", \".cjs\"] as const;\n\ntype RunResult =\n | { success: true }\n | { success: false; code?: number; message: string };\n\nexport async function runCommand(filePath: string): Promise<RunResult> {\n const absFilePath = resolve(process.cwd(), filePath);\n const ext = extname(absFilePath);\n\n // Validate file extension\n if (\n !SUPPORTED_EXTENSIONS.includes(ext as (typeof SUPPORTED_EXTENSIONS)[number])\n ) {\n return {\n success: false,\n code: 1,\n message: `Error: Only the following file types are supported: ${SUPPORTED_EXTENSIONS.join(\", \")}`,\n };\n }\n\n // Reject TypeScript files explicitly\n if (ext === \".ts\" || ext === \".tsx\") {\n return {\n success: false,\n code: 1,\n message:\n \"TypeScript files are not supported by 'craft run'. Compile to .js or use .mjs/.js/.cjs.\",\n };\n }\n\n try {\n logger.info(`Loading file: ${absFilePath}`);\n\n // Load the module with both default and named exports\n const module = await import(absFilePath);\n\n // Create context builder\n const contextBuilder = new ContextBuilder();\n\n // Check for optional craftConfig named export\n if (module.craftConfig) {\n logger.info(\"Found craftConfig export, applying configuration\");\n contextBuilder.with(module.craftConfig as CraftConfig);\n }\n\n // Handle routes from the default export\n const configured = configureRoutes(contextBuilder, module.default);\n if (!configured.success) {\n return configured;\n }\n\n // Build and start the context\n const context = contextBuilder.build();\n registerContextSignalHandlers(context);\n await context.start();\n\n return { success: true };\n } catch (error: unknown) {\n if (error instanceof Error) {\n logger.error(`Failed to run ${absFilePath}: ${error.message}`);\n return { success: false, code: 1, message: error.message };\n }\n logger.error(`Failed to run ${absFilePath}: Unknown error occurred`);\n return { success: false, code: 1, message: \"Unknown error\" };\n }\n}\n\nfunction configureRoutes(\n contextBuilder: InstanceType<typeof ContextBuilder>,\n defaultExport: unknown,\n): RunResult {\n // Type guards\n const isRouteDefinition = (obj: unknown): obj is RouteDefinition =>\n typeof obj === \"object\" && obj !== null && \"id\" in obj;\n\n const isRouteBuilder = (\n obj: unknown,\n ): obj is InstanceType<typeof RouteBuilder> =>\n typeof obj === \"object\" &&\n obj !== null &&\n typeof (obj as { build?: unknown }).build === \"function\";\n\n if (!defaultExport) {\n logger.error(\"No default export found. Expected routes as default export.\");\n return { success: false, code: 1, message: \"No default export found\" };\n }\n\n // Handle single route or RouteBuilder\n if (isRouteDefinition(defaultExport) || isRouteBuilder(defaultExport)) {\n contextBuilder.routes(\n defaultExport as RouteDefinition | InstanceType<typeof RouteBuilder>,\n );\n logger.info(\"Loaded single route from default export\");\n return { success: true };\n }\n\n // Handle array of routes\n if (Array.isArray(defaultExport)) {\n if (\n !defaultExport.every(\n (item) => isRouteDefinition(item) || isRouteBuilder(item),\n )\n ) {\n logger.error(\n \"All items in default export array must be RouteDefinition or RouteBuilder\",\n );\n return {\n success: false,\n code: 1,\n message: \"Invalid items in default export array\",\n };\n }\n\n defaultExport.forEach((routeOrBuilder) =>\n contextBuilder.routes(\n routeOrBuilder as RouteDefinition | InstanceType<typeof RouteBuilder>,\n ),\n );\n logger.info(\n `Loaded ${defaultExport.length} routes from default export array`,\n );\n return { success: true };\n }\n\n // Invalid default export\n logger.error(\n \"Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those.\",\n );\n return {\n success: false,\n code: 1,\n message:\n \"Invalid default export. Expected: RouteDefinition, RouteBuilder, or array of those.\",\n };\n}\n","#!/usr/bin/env node\n\n/**\n * Routecraft CLI Module\n *\n * This module provides the command-line interface for Routecraft.\n */\nimport { Command } from \"commander\";\nimport { runCommand } from \"./run.ts\";\nimport { loadEnvFile } from \"./util.ts\";\n\n/**\n * The main command program for the Routecraft CLI.\n * Built using the commander.js library.\n */\nconst program = new Command();\n\nprogram\n .name(\"craft\")\n .description(\"A modern routing framework for TypeScript\")\n .version(\"0.2.0-canary.1\")\n .showSuggestionAfterError()\n .showHelpAfterError()\n .exitOverride((err) => {\n if (err.code === \"commander.unknownCommand\") {\n process.exit(0);\n }\n });\n\n// Show help by default if no arguments provided\nif (process.argv.length <= 2) {\n program.help({ error: false });\n}\n\n/**\n * The 'run' command executes routes from a single file.\n *\n * Example:\n * craft run ./my-routes.ts\n */\nprogram\n .command(\"run\")\n .description(\"Run routes from a single TypeScript/JavaScript file\")\n .argument(\"<file>\", \"Path to a file containing routes\")\n .option(\n \"--env <path>\",\n \"Load environment variables from a .env file (default: .env)\",\n )\n .action(async (filePath, options) => {\n // Load environment variables if specified or use default .env\n if (options.env !== undefined) {\n loadEnvFile(options.env);\n } else {\n loadEnvFile();\n }\n\n const result = await runCommand(filePath);\n if (!result.success) {\n if (result.message) {\n // eslint-disable-next-line no-console\n console.error(result.message);\n }\n process.exit(result.code ?? 1);\n }\n });\n\n// Parse the command line arguments and execute the appropriate command\nprogram.parse();\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@routecraft/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-canary.1",
|
|
4
4
|
"description": "CLI for running RouteCraft routes",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@routecraft/routecraft": "^0.
|
|
19
|
+
"@routecraft/routecraft": "^0.2.0-canary.1",
|
|
20
20
|
"commander": "^14.0.2",
|
|
21
21
|
"dotenv": "^17.2.3"
|
|
22
22
|
},
|