@stacksjs/auth 0.64.0 → 0.64.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js.map
CHANGED
|
@@ -406,7 +406,7 @@
|
|
|
406
406
|
"import { collect } from '@stacksjs/collections'\n\nexport * as kolorist from 'kolorist'\n\nexport {\n stripAnsi,\n centerAlign,\n rightAlign,\n leftAlign,\n align,\n box,\n colors,\n getColor,\n colorize,\n} from 'consola/utils'\n\nexport {\n ansi256Bg,\n bgBlack,\n bgBlue,\n bgCyan,\n bgGray,\n bgGreen,\n bgLightBlue,\n bgLightCyan,\n bgLightGray,\n bgLightGreen,\n bgLightMagenta,\n bgLightRed,\n bgLightYellow,\n bgMagenta,\n bgRed,\n bgWhite,\n bgYellow,\n black,\n blue,\n bold,\n cyan,\n dim,\n gray,\n green,\n hidden,\n inverse,\n italic,\n lightBlue,\n lightCyan,\n lightGray,\n lightGreen,\n lightMagenta,\n lightRed,\n lightYellow,\n link,\n magenta,\n red,\n reset,\n strikethrough,\n underline,\n white,\n yellow,\n ansi256,\n trueColor,\n trueColorBg,\n stripColors,\n} from 'kolorist'\n\nexport const quotes = collect([\n // could be queried from any API or database\n 'The best way to get started is to quit talking and begin doing.',\n 'The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.',\n 'Don’t let yesterday take up too much of today.',\n 'You learn more from failure than from success. Don’t let it stop you. Failure builds character.',\n 'It’s not whether you get knocked down, it’s whether you get up.',\n 'If you are working on something that you really care about, you don’t have to be pushed. The vision pulls you.',\n 'People who are crazy enough to think they can change the world, are the ones who do.',\n 'Failure will never overtake me if my determination to succeed is strong enough.',\n 'Entrepreneurs are great at dealing with uncertainty and also very good at minimizing risk. That’s the classic entrepreneur.',\n 'We may encounter many defeats but we must not be defeated.',\n 'Knowing is not enough; we must apply. Wishing is not enough; we must do.',\n 'Imagine your life is perfect in every respect; what would it look like?',\n 'We generate fears while we sit. We overcome them by action.',\n 'Whether you think you can or think you can’t, you’re right.',\n 'Security is mostly a superstition. Life is either a daring adventure or nothing.',\n])\n",
|
|
407
407
|
"import type { Result } from '@stacksjs/error-handling'\nimport type { CliOptions, CommandError, Subprocess } from '@stacksjs/types'\nimport { ExitCode } from '@stacksjs/types'\nimport { log } from './console'\nimport { exec, execSync } from './exec'\nimport { italic } from './utils'\n\n/**\n * Run a command.\n *\n * @param command The command to run.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n * @example\n * ```ts\n * const result = await runCommand('ls')\n *\n * if (result.isErr())\n * console.error(result.error)\n * else\n * console.log(result)\n * ```\n * @example\n * ```ts\n * const result = await runCommand('ls', { cwd: '/home' })\n *\n * if (result.isErr())\n * console.error(result.error)\n * else\n * console.log(result)\n * ```\n */\nexport async function runCommand(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>> {\n log.debug('runCommand:', command)\n log.debug('options:', options)\n\n return await exec(command, options)\n}\n\nexport async function runProcess(command: string, options?: CliOptions): Promise<Result<Subprocess, CommandError>> {\n log.debug('runProcess:', italic(command))\n log.debug('runProcess Options:', options)\n\n return await exec(command, options)\n}\n\n/**\n * Run a command.\n *\n * @param command The command to run.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n * @example\n * ```ts\n * const result = runCommandSync('ls')\n *\n * if (result.isErr())\n * console.error(result.error)\n * else\n * console.log(result)\n * ```\n * @example\n * ```ts\n * const result = runCommandSync('ls', { cwd: '/home' })\n *\n * if (result.isErr())\n * console.error(result.error)\n * else\n * console.log(result)\n * ```\n */\nexport async function runCommandSync(command: string, options?: CliOptions): Promise<string> {\n log.debug('runCommandSync:', italic(command))\n log.debug('runCommandSync Options:', options)\n\n const result = await execSync(command, options)\n\n // if (result.isErr())\n // return err(result.error)\n\n // return ok(result.value)\n\n return result\n}\n\n/**\n * Run many commands.\n *\n * @param commands The command to run.\n * @param options The options to pass to the command.\n * @returns The result of the command.\n */\nexport async function runCommands(commands: string[], options?: CliOptions) {\n const results = []\n\n for (const command of commands) {\n const result = await runCommand(command, options)\n\n if (result.isErr()) {\n log.error(result.error)\n process.exit(ExitCode.FatalError)\n }\n\n results.push(result)\n }\n\n return results\n}\n",
|
|
408
408
|
"import type { CliOptions } from '@stacksjs/types'\nimport { runCommand } from './run'\n\ntype CommandOptionTuple = [string, string, { default: boolean }]\ninterface CommandOptionObject {\n name: string\n description: string\n default: boolean | string\n}\ntype CommandOptions = CommandOptionTuple | CommandOptionObject[]\ninterface Options {\n name: string\n description: string\n active: boolean\n options: CommandOptions\n run: (options?: CliOptions) => Promise<any>\n onFail: (error: Error) => void\n onSuccess: () => void\n}\n\nexport class Command {\n name: Options['name']\n description: Options['description']\n options: Options['options']\n run: Options['run']\n onFail: Options['onFail']\n onSuccess: Options['onSuccess']\n\n constructor({ name, description, options, run, onFail, onSuccess }: Options) {\n this.name = name\n this.description = description\n this.options = options\n this.run = run\n this.onFail = onFail\n this.onSuccess = onSuccess\n }\n}\n\nexport const command = {\n run: async (command: string, options?: CliOptions) => {\n return await runCommand(command, options)\n },\n\n runSync: async (command: string, options?: CliOptions) => {\n return await runCommand(command, options)\n },\n}\n",
|
|
409
|
-
"import { handleError } from '@stacksjs/error-handling'\nimport { log } from '@stacksjs/logging'\nimport type { IntroOptions, OutroOptions } from '@stacksjs/types'\nimport { ExitCode } from '@stacksjs/types'\nimport { bgCyan, bold, cyan, dim, gray, green, italic } from 'kolorist'\nimport { version } from '../package.json'\n\n/**\n * Prints the intro message.\n */\nexport async function intro(command: string, options?: IntroOptions): Promise<number> {\n return new Promise((resolve) => {\n if (options?.quiet === false) {\n console.log()\n console.log(cyan(bold('Stacks CLI')) + dim(` v${version}`))\n console.log()\n }\n\n log.info(`Running ${bgCyan(italic(bold(` ${command} `)))}
|
|
409
|
+
"import { handleError } from '@stacksjs/error-handling'\nimport { log } from '@stacksjs/logging'\nimport type { IntroOptions, OutroOptions } from '@stacksjs/types'\nimport { ExitCode } from '@stacksjs/types'\nimport { bgCyan, bold, cyan, dim, gray, green, italic } from 'kolorist'\nimport { version } from '../package.json'\n\n/**\n * Prints the intro message.\n */\nexport async function intro(command: string, options?: IntroOptions): Promise<number> {\n return new Promise((resolve) => {\n if (options?.quiet === false) {\n console.log()\n console.log(cyan(bold('Stacks CLI')) + dim(` v${version}`))\n console.log()\n }\n\n log.info(`Running ${bgCyan(italic(bold(` ${command} `)))}`)\n\n if (options?.showPerformance === false || options?.quiet) return resolve(0)\n\n return resolve(performance.now())\n })\n}\n\n/**\n * Prints the outro message.\n */\nexport function outro(text: string, options?: OutroOptions, error?: Error | string) {\n const opts = {\n type: 'success',\n useSeconds: true,\n ...options,\n }\n\n opts.message = options?.message || text\n\n return new Promise((resolve) => {\n if (error) return handleError(error)\n\n if (opts?.startTime) {\n let time = performance.now() - opts.startTime\n\n if (opts.useSeconds) {\n time = time / 1000\n time = Math.round(time * 100) / 100 // https://stackoverflow.com/a/11832950/7811162\n }\n\n if (opts.quiet === true) return resolve(ExitCode.Success)\n\n if (error) log.error(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}] Failed`)\n else if (opts.type === 'info')\n log.info(`${dim(gray(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`))} ${opts.message ?? 'Complete'}`)\n else\n log.success(\n `${dim(gray(bold(`[${time.toFixed(2)}${opts.useSeconds ? 's' : 'ms'}]`)))} ${bold(\n green(opts.message ?? 'Complete'),\n )}`,\n )\n } else {\n if (opts?.type === 'info') log.info(text)\n // the following condition triggers in the case of \"Cleaned up\" messages\n else if (opts?.type === 'success' && opts?.quiet !== true) log.success(text)\n }\n\n return resolve(ExitCode.Success)\n })\n}\n",
|
|
410
410
|
"import process from 'node:process'\nimport { log } from '@stacksjs/logging'\n\ninterface ParsedArgv {\n args: string[]\n options: {\n [k: string]: string | boolean | number\n }\n}\n\nfunction isLongOption(arg?: string): boolean {\n if (!arg) return false\n\n return arg.startsWith('--')\n}\n\nfunction isShortOption(arg: string): boolean {\n return arg.startsWith('-') && !isLongOption(arg)\n}\n\nfunction parseValue(value: string): string | boolean | number {\n if (value === 'true') return true\n\n if (value === 'false') return false\n\n const numberValue = Number.parseFloat(value)\n if (!Number.isNaN(numberValue)) return numberValue\n\n return value.replace(/\"/g, '')\n}\n\nfunction parseLongOption(\n arg: string,\n argv: string[],\n index: number,\n options: { [k: string]: string | boolean | number },\n): number {\n const [key, value] = arg.slice(2).split('=')\n if (value !== undefined) {\n options[key as string] = parseValue(value)\n } else if (index + 1 < argv.length && !argv[index + 1]?.startsWith('-')) {\n options[key as string] = argv[index + 1] as string\n index++\n } else {\n options[key as string] = true\n }\n return index\n}\n\nfunction parseShortOption(\n arg: string,\n argv: string[],\n index: number,\n options: { [k: string]: string | boolean | number },\n): number {\n const [key, value] = arg.slice(1).split('=')\n\n // Check if key is undefined and handle it\n if (key === undefined) return index\n\n if (value !== undefined && key !== undefined) {\n for (let j = 0; j < key.length; j++) options[key[j] as string] = parseValue(value)\n } else {\n for (let j = 0; j < key.length; j++) {\n if (index + 1 < argv.length && j === key.length - 1 && !argv[index + 1]?.startsWith('-')) {\n options[key[j] as string] = parseValue(argv[index + 1] as string)\n index++\n } else {\n options[key[j] as string] = true\n }\n }\n }\n\n return index\n}\n\nexport function parseArgv(argv?: string[]): ParsedArgv {\n if (argv === undefined) argv = process.argv.slice(2)\n\n const args: string[] = []\n const options: { [k: string]: string | boolean | number } = {}\n\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i]\n if (!arg) continue\n if (isLongOption(arg)) i = parseLongOption(arg, argv, i, options)\n else if (isShortOption(arg)) i = parseShortOption(arg, argv, i, options)\n else args.push(arg)\n }\n\n return { args, options }\n}\n\nexport function parseArgs(argv?: string[]): string[] {\n if (argv === undefined) argv = process.argv.slice(2)\n\n return parseArgv(argv).args\n}\n\ninterface CliOptions {\n dryRun?: boolean\n quiet?: boolean\n verbose?: boolean\n [k: string]: string | boolean | number | undefined\n}\n\nexport function parseOptions(options?: CliOptions): CliOptions {\n options = options || {}\n const args = process.argv.slice(2)\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i]\n if (arg?.startsWith('--')) {\n const key = arg.substring(2) // remove the --\n const camelCaseKey = key.replace(\n /-([a-z])/gi,\n (g) => (g[1] ? g[1].toUpperCase() : ''), // convert kebab-case to camelCase\n )\n\n if (i + 1 < args.length) {\n // if the next arg exists\n if (args[i + 1] === 'true' || args[i + 1] === 'false') {\n // if the next arg is a boolean\n options[camelCaseKey] = args[i + 1] === 'true' // set the value to the boolean\n i++\n } else {\n options[camelCaseKey] = args[i + 1]\n i++\n }\n } else {\n options[camelCaseKey] = true\n }\n }\n }\n\n // if options has no keys, return undefined, e.g. `buddy release`\n if (Object.keys(options).length === 0) return { dryRun: false, quiet: false, verbose: false }\n\n // convert the string 'true' or 'false' to a boolean\n Object.keys(options).forEach((key) => {\n if (!options) return { dryRun: false, quiet: false, verbose: false }\n\n const value = options[key]\n\n if (value === 'true' || value === 'false') options[key] = value === 'true'\n })\n\n return options\n}\n// interface BuddyOptions {\n// dryRun?: boolean\n// verbose?: boolean\n// }\nexport function buddyOptions(options?: any): string {\n if (!options) {\n options = process.argv.slice(2)\n options = Array.from(new Set(options))\n // delete the 0 element if it does not start with a -\n // e.g. is used when buddy changelog --dry-run is used\n if (options[0] && !options[0].startsWith('-')) options.shift()\n }\n\n if (options?.verbose) {\n log.debug('process.argv', process.argv)\n log.debug('process.argv.slice(2)', process.argv.slice(2))\n log.debug('options inside buddyOptions', options)\n }\n\n return options.join(' ')\n}\n",
|
|
411
411
|
"export * from './actions'\nexport * from './cli'\nexport * from './command'\nexport * from './console'\nexport * from './helpers'\nexport * from './parse'\nexport * from './exec'\nexport * from './run'\nexport * from './spinner'\nexport * from './utils'\n",
|
|
412
412
|
"import os from 'node:os'\nimport {\n basename,\n delimiter,\n dirname,\n extname,\n isAbsolute,\n join,\n normalize,\n parse,\n relative,\n resolve,\n sep,\n toNamespacedPath,\n} from 'node:path'\nimport process from 'node:process'\nimport { runCommandSync } from '@stacksjs/cli'\nimport { log } from '@stacksjs/logging'\n\n/**\n * Returns the path to the `actions` directory. The `actions` directory\n * contains the core Stacks' actions.\n *\n * @param path - The relative path to the file or directory.\n * @returns The absolute path to the file or directory.\n * @example\n * ```ts\n * import { actionsPath } from '@stacksjs/paths'\n *\n * console.log(actionsPath('path/to/action.ts')) // Outputs the absolute path to 'path/to/action.ts' within the `actions` directory\n * ```\n */\nexport function actionsPath(path?: string): string {\n return corePath(`actions/${path || ''}`)\n}\n\nexport function relativeActionsPath(path?: string) {\n return relative(projectPath(), actionsPath(path))\n}\n\nexport function userActionsPath(path?: string) {\n return appPath(`Actions/${path || ''}`)\n}\n\nexport function builtUserActionsPath(path?: string) {\n return frameworkPath(`actions/${path || ''}`)\n}\n\nexport function userComponentsPath(path?: string) {\n return libsPath(`components/${path || ''}`)\n}\n\nexport function userViewsPath(path?: string) {\n return resourcesPath(`views/${path || ''}`)\n}\n\nexport function userFunctionsPath(path?: string) {\n return resourcesPath(`functions/${path || ''}`)\n}\n\n/**\n * Returns the path to the user-defined `Jobs` directory.\n *\n * @param path - The relative path to the file or directory within the `Jobs` directory.\n * @returns The absolute path to the specified file or directory within the user-defined `Jobs` directory.\n * @example\n * ```ts\n * import { userJobsPath } from '@stacksjs/paths'\n *\n * console.log(userJobsPath('MyJob.ts')) // Outputs the absolute path to 'MyJob.ts' within the user-defined `Jobs` directory.\n * ```\n */\nexport function userJobsPath(path?: string): string {\n return appPath(`Jobs/${path || ''}`)\n}\n\n/**\n * Returns the path to the user-defined `Listeners` directory.\n *\n * @param path - The relative path to the file or directory within the `Listeners` directory.\n * @returns The absolute path to the specified file or directory within the user-defined `Listeners` directory.\n * @example\n * ```ts\n * import { userListenersPath } from '@stacksjs/paths'\n *\n * console.log(userListenersPath('MyListener.ts')) // Outputs the absolute path to 'MyListener.ts' within the user-defined `Listeners` directory.\n * ```\n */\nexport function userListenersPath(path?: string): string {\n return appPath(`Listeners/${path || ''}`)\n}\n\n/**\n * Returns the path to the user-defined `Middleware` directory.\n *\n * @param path - The relative path to the file or directory within the Middleware directory.\n * @returns The absolute path to the specified file or directory within the user-defined Middleware directory.\n * @example\n * ```ts\n * import { userMiddlewarePath } from '@stacksjs/paths'\n *\n * console.log(userMiddlewarePath('MyMiddleware.ts')) // Outputs the absolute path to 'MyMiddleware.ts' within the user-defined Middleware directory.\n * ```\n */\nexport function userMiddlewarePath(path?: string) {\n return appPath(`Middleware/${path || ''}`)\n}\n\n/**\n * Returns the path to the user-defined `Models` directory.\n *\n * @param path - The relative path to the file or directory within the `Models` directory.\n * @returns The absolute path to the specified file or directory within the user-defined `Models` directory.\n * @example\n * ```ts\n * import { userModelsPath } from '@stacksjs/paths'\n *\n * console.log(userModelsPath('MyModel.ts')) // Outputs the absolute path to 'MyModel.ts' within the user-defined `Models` directory.\n * ```\n */\nexport function userModelsPath(path?: string): string {\n return appPath(`Models/${path || ''}`)\n}\n\n/**\n * Returns the path to the user-defined `Notifications` directory.\n *\n * @param path - The relative path to the file or directory within the `Notifications` directory.\n * @returns The absolute path to the specified file or directory within the user-defined `Notifications` directory.\n * @example\n * ```ts\n * import { userNotificationsPath } from '@stacksjs/paths'\n *\n * console.log(userNotificationsPath('MyNotification.ts')) // Outputs the absolute path to 'MyNotification.ts' within the user-defined `Notifications` directory.\n * ```\n */\nexport function userNotificationsPath(path?: string) {\n return appPath(`Notifications/${path || ''}`)\n}\n\nexport function userDatabasePath(path?: string) {\n return projectPath(`database/${path || ''}`)\n}\n\nexport function userMigrationsPath(path?: string) {\n return userDatabasePath(`migrations/${path || ''}`)\n}\n\n/**\n * Returns the path to the user-defined `Events.ts` file.\n *\n * @returns The absolute path to the `Events.ts` file within the user-defined directory.\n * @example\n * ```ts\n * import { userEventsPath } from '@stacksjs/paths'\n *\n * console.log(userEventsPath()) // Outputs the absolute path to 'Events.ts' within the user-defined directory.\n * ```\n */\nexport function userEventsPath(): string {\n return appPath(`Events.ts`)\n}\n\n/**\n * Returns the path to the `ai` directory. The AI directory\n * contains the core Stacks' AI logic which currently\n * is a wrapper of the OpenAI API.\n *\n * @param path - relative path to the file or directory\n * @returns string - absolute path to the file or directory\n *\n * @example\n * ```ts\n * import { aiPath } from '@stacksjs/paths'\n *\n * console.log(aiPath('src/drivers/example.ts')) // Outputs the absolute path to 'openai.ts' within the AI directory\n * ```\n */\nexport function aiPath(path?: string) {\n return corePath(`ai/${path || ''}`)\n}\n\n/**\n * Returns the path to the `assets` directory within the `resources` directory.\n *\n * @param path - The relative path to the file or directory within the `assets` directory.\n * @returns The absolute path to the specified file or directory within the `assets` directory.\n * @example\n * ```ts\n * import { assetsPath } from '@stacksjs/paths'\n *\n * console.log(assetsPath('images/logo.png')) // Outputs the absolute path to 'images/logo.png' within the `assets` directory.\n * ```\n */\nexport function assetsPath(path?: string) {\n return resourcesPath(`assets/${path || ''}`)\n}\n\n/**\n * Returns the path to the `alias` directory within the core directory.\n *\n * @returns The absolute path to the `alias` directory.\n * @example\n * ```ts\n * import { aliasPath } from '@stacksjs/paths'\n *\n * console.log(aliasPath()) // Outputs the absolute path to the `alias` directory.\n * ```\n */\nexport function aliasPath() {\n return corePath('alias/src/index.ts')\n}\n\n/**\n * Returns the path to the `buddy` directory, optionally relative to the current working directory.\n *\n * @param path - The relative path to the file or directory within the buddy directory.\n * @param options - Optional. An object containing configuration settings.\n * @param options.relative - If true, returns the path relative to the current working directory.\n * @returns The absolute or relative path to the specified file or directory within the buddy * @returns The absolute or relative path to the specified file or directory within the buddy directory.\n * @example\n * ```ts\n * import { buddyPath } from '@stacksjs/paths'\n *\n * console.log(buddyPath('config/buddy.json')) // Outputs the absolute path to 'config/buddy.json' within the buddy directory.\n * console.log(buddyPath('config/buddy.json', { relative: true })) // Outputs the relative path to 'config/buddy.json' within the buddy directory.\n * ```\n */\nexport function buddyPath(path?: string, options?: { relative?: boolean }) {\n const absolutePath = corePath(`buddy/${path || ''}`)\n\n if (options?.relative) return relative(process.cwd(), absolutePath)\n\n return absolutePath\n}\n\n/**\n * Returns the path to the `runtime` directory within the framework directory.\n *\n * @param path - The relative path to the file or directory within the runtime directory.\n * @returns The absolute path to the specified file or directory within the runtime directory.\n * @example\n * ```ts\n * import { runtimePath } from '@stacksjs/paths'\n *\n * console.log(runtimePath('runtime-config.json')) // Outputs the absolute path to 'runtime-config.json' within the runtime directory.\n * ```\n */\nexport function runtimePath(path?: string): string {\n return frameworkPath(`buddy/${path || ''}`)\n}\n\n/**\n * Returns the path to the `analytics` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `analytics` directory.\n * @returns The absolute path to the specified file or directory within the `analytics` directory.\n * @example\n * ```ts\n * import { analyticsPath } from '@stacksjs/paths'\n *\n * console.log(analyticsPath('data/report.csv')) // Outputs the absolute path to 'data/report.csv' within the `analytics` directory.\n * ```\n */\nexport function analyticsPath(path?: string): string {\n return corePath(`analytics/${path || ''}`)\n}\n\n/**\n * Returns the path to the `arrays` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `arrays` directory.\n * @returns The absolute path to the specified file or directory within the `arrays` directory.\n * @example\n * ```ts\n * import { arraysPath } from '@stacksjs/paths'\n *\n * console.log(arraysPath('list.txt')) // Outputs the absolute path to 'list.txt' within the `arrays` directory.\n * ```\n */\nexport function arraysPath(path?: string): string {\n return corePath(`arrays/${path || ''}`)\n}\n\n/**\n * Returns the path to the `app` directory, optionally relative to the project directory.\n *\n * @param path - The relative path to the file or directory within the app directory.\n * @returns The absolute path to the specified file or directory within the app directory.\n * @example\n * ```ts\n * import { appPath } from '@stacksjs/paths'\n *\n * console.log(appPath('Actions/DummyAction.ts')) // Outputs the absolute path to 'Actions/DummyAction.ts' within the app directory.\n * ```\n */\nexport function appPath(path?: string): string {\n return projectPath(`app/${path || ''}`)\n}\n\n/**\n * Returns the path to the `auth` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the auth directory.\n * @returns The absolute path to the specified file or directory within the auth directory.\n * @example\n * ```ts\n * import { authPath } from '@stacksjs/paths'\n *\n * console.log(authPath('login.ts')) // Outputs the absolute path to 'login.ts' within the auth directory.\n * ```\n */\nexport function authPath(path?: string): string {\n return corePath(`auth/${path || ''}`)\n}\n\n/**\n * Returns the path to the build directory. The build directory\n * contains Stacks' build engine & its tooling integrations.\n *\n * @param path string - relative path to the file or directory\n * @returns string - absolute path to the file or directory\n * @example\n * ```ts\n * buildPath('functions.stx')\n * buildPath('components.ts')\n * ```\n */\nexport function buildPath(path?: string) {\n return corePath(`build/${path || ''}`)\n}\n\n/**\n * Returns the path to the build engine directory.\n *\n * @param path - The relative path to the file or directory within the build engine directory.\n * @returns The absolute path to the specified file or directory within the build engine directory.\n */\nexport function buildEnginePath(path?: string): string {\n return buildPath(`${path || ''}`)\n}\n\n/**\n * Returns the path to the `libs` directory within the framework directory.\n *\n * @param path - The relative path to the file or directory within the `libs` directory.\n * @returns The absolute path to the specified file or directory within the `libs` directory.\n */\nexport function libsPath(path?: string): string {\n return frameworkPath(`libs/${path || ''}`)\n}\n\n/**\n * Returns the path to the user `libs` directory within the root project directory.\n *\n * @param path - The relative path to the file or directory within the `libs` directory.\n * @returns The absolute path to the specified file or directory within the `libs` directory.\n */\nexport function userLibsPath(path?: 'components' | 'functions' | string): string {\n return resourcesPath(`${path || ''}`)\n}\n\n/**\n * Returns the path to the `entries` directory within the `libs` directory.\n *\n * @param path - The relative path to the file or directory within the `entries` directory.\n * @returns The absolute path to the specified file or directory within the `entries` directory.\n */\nexport function libsEntriesPath(path?: string): string {\n return libsPath(`entries/${path || ''}`)\n}\n\n/**\n * Returns the path to the `cache` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the cache directory.\n * @returns The absolute path to the specified file or directory within the cache directory.\n */\nexport function cachePath(path?: string): string {\n return corePath(`cache/${path || ''}`)\n}\n\n/**\n * Returns the path to the `chat` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the chat directory.\n * @returns The absolute path to the specified file or directory within the chat directory.\n */\nexport function chatPath(path?: string): string {\n return corePath(`chat/${path || ''}`)\n}\n\n/**\n * Returns the path to the `cli` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the cli directory.\n * @returns The absolute path to the specified file or directory within the cli directory.\n */\nexport function cliPath(path?: string): string {\n return corePath(`cli/${path || ''}`)\n}\n\n/**\n * Returns the path to the `cloud` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the cloud directory.\n * @returns The absolute path to the specified file or directory within the cloud directory.\n */\nexport function cloudPath(path?: string): string {\n return corePath(`cloud/${path || ''}`)\n}\n\n/**\n * Returns the path to the `cloud` directory within the framework directory.\n *\n * @param path - The relative path to the file or directory within the framework cloud directory.\n * @returns The absolute path to the specified file or directory within the framework cloud directory.\n */\nexport function frameworkCloudPath(path?: string): string {\n return frameworkPath(`cloud/${path || ''}`)\n}\n\n/**\n * Returns the path to the `collections` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `collections` directory.\n * @returns The absolute path to the specified file or directory within the `collections` directory.\n */\nexport function collectionsPath(path?: string): string {\n return corePath(`collections/${path || ''}`)\n}\n\n/**\n * Returns the path to the `Commands` directory within the app directory.\n *\n * @param path - The relative path to the file or directory within the `Commands` directory.\n * @returns The absolute path to the specified file or directory within the `Commands` directory.\n */\nexport function commandsPath(path?: string): string {\n return appPath(`Commands/${path || ''}`)\n}\n\n/**\n * Returns the path to the `components` directory within the `resources` directory.\n *\n * @param path - The relative path to the file or directory within the `components` directory.\n * @returns The absolute path to the specified file or directory within the `components` directory.\n */\nexport function componentsPath(path?: string): string {\n return userLibsPath(`components/${path || ''}`)\n}\n\n/**\n * Returns the path to the `config` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the config directory.\n * @returns The absolute path to the specified file or directory within the config directory.\n */\nexport function configPath(path?: string): string {\n return corePath(`config/${path || ''}`)\n}\n\n/**\n * Returns the path to the `core` directory within the framework directory.\n *\n * @param path - The relative path to the file or directory within the core directory.\n * @returns The absolute path to the specified file or directory within the core directory.\n */\nexport function corePath(path?: string): string {\n return frameworkPath(`core/${path || ''}`)\n}\n\n/**\n * Returns the absolute path to the `custom-elements.json` file within the core directory.\n *\n * @returns The absolute path to the `custom-elements.json` file.\n */\nexport function customElementsDataPath(): string {\n return frameworkPath('core/custom-elements.json')\n}\n\n/**\n * Returns the path to the `database` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the database directory.\n * @returns The absolute path to the specified file or directory within the database directory.\n */\nexport function databasePath(path?: string): string {\n return corePath(`database/${path || ''}`)\n}\n\n/**\n * Returns the path to the `datetime` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the datetime directory.\n * @returns The absolute path to the specified file or directory within the datetime directory.\n */\nexport function datetimePath(path?: string): string {\n return corePath(`datetime/${path || ''}`)\n}\n\n/**\n * Returns the path to the `development` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the development directory.\n * @returns The absolute path to the specified file or directory within the development directory.\n */\nexport function developmentPath(path?: string): string {\n return corePath(`development/${path || ''}`)\n}\n\n/**\n * Returns the path to the `desktop` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the desktop directory.\n * @returns The absolute path to the specified file or directory within the desktop directory.\n */\nexport function desktopPath(path?: string): string {\n return corePath(`desktop/${path || ''}`)\n}\n\n/**\n * Returns the path to the `docs` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `docs` directory.\n * @returns The absolute path to the specified file or directory within the `docs` directory.\n */\nexport function docsPath(path?: string): string {\n return corePath(`docs/${path || ''}`)\n}\n\n/**\n * Returns the path to the `domains` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `domains` directory.\n * @returns The absolute path to the specified file or directory within the `domains` directory.\n */\nexport function dnsPath(path?: string): string {\n return corePath(`domains/${path || ''}`)\n}\n\n/**\n * Returns the path to the `email` directory within the `notifications` directory.\n *\n * @param path - The relative path to the file or directory within the email directory.\n * @returns The absolute path to the specified file or directory within the email directory.\n */\nexport function emailPath(path?: string): string {\n return notificationsPath(`email/${path || ''}`)\n}\n\n/**\n * Returns the path to the `enums` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `enums` directory.\n * @returns The absolute path to the specified file or directory within the `enums` directory.\n */\nexport function enumsPath(path?: string): string {\n return corePath(`enums/${path || ''}`)\n}\n\n/**\n * Returns the path to the `error-handling` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the error-handling directory.\n * @returns The absolute path to the specified file or directory within the error-handling directory.\n */\nexport function errorHandlingPath(path?: string): string {\n return corePath(`error-handling/${path || ''}`)\n}\n\n/**\n * Returns the path to the `events` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `events` directory.\n * @returns The absolute path to the specified file or directory within the `events` directory.\n */\nexport function eventsPath(path?: string): string {\n return corePath(`events/${path || ''}`)\n}\n\n/**\n * Returns the path to the `env` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the env directory.\n * @returns The absolute path to the specified file or directory within the env directory.\n */\nexport function coreEnvPath(path?: string): string {\n return corePath(`env/${path || ''}`)\n}\n\n/**\n * Returns the path to the `examples` directory within the framework directory, filtered by type.\n *\n * @param type - The type of examples to filter by ('vue-components' or 'web-components').\n * @returns The absolute path to the specified type of examples within the `examples` directory.\n */\nexport function examplesPath(type: 'vue-components' | 'web-components'): string {\n return frameworkPath(`examples/${type || ''}`)\n}\n\n/**\n * Returns the path to the `faker` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the faker directory.\n * @returns The absolute path to the specified file or directory within the faker directory.\n */\nexport function fakerPath(path?: string): string {\n return corePath(`faker/${path || ''}`)\n}\n\n/**\n * Returns the path to the framework directory, optionally relative to the current working directory.\n *\n * @param path - The relative path to the file or directory within the framework directory.\n * @param options - Optional. An object containing configuration settings.\n * @param options.relative - If true, returns the path relative to the current working directory.\n * @param options.cwd - Specifies a custom working directory.\n * @returns The absolute or relative path to the specified file or directory within the framework directory.\n */\nexport function frameworkPath(path?: string, options?: { relative?: boolean; cwd?: string }): string {\n const absolutePath = storagePath(`framework/${path || ''}`)\n\n if (options?.relative) return relative(options.cwd || process.cwd(), absolutePath)\n\n return absolutePath\n}\n\n/**\n * Returns the path to the `health` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the health directory.\n * @returns The absolute path to the specified file or directory within the health directory.\n */\nexport function healthPath(path?: string): string {\n return corePath(`health/${path || ''}`)\n}\n\n/**\n * Returns the path to the `functions` directory within the `resources` directory.\n *\n * @param path - The relative path to the file or directory within the `functions` directory.\n * @returns The absolute path to the specified file or directory within the `functions` directory.\n */\nexport function functionsPath(path?: string): string {\n return userLibsPath(`functions/${path || ''}`)\n}\n\n/**\n * Returns the path to the `git` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the git directory.\n * @returns The absolute path to the specified file or directory within the git directory.\n */\nexport function gitPath(path?: string): string {\n return corePath(`git/${path || ''}`)\n}\n\n/**\n * Returns the path to the `lang` directory, optionally relative to the project directory.\n *\n * @param path - The relative path to the file or directory within the lang directory.\n * @returns The absolute path to the specified file or directory within the lang directory.\n */\nexport function langPath(path?: string): string {\n return resourcesPath(`lang/${path || ''}`)\n}\n\n/**\n * Returns the path to the `layouts` directory within the `resources` directory, optionally relative to the current working directory.\n *\n * @param path - The relative path to the file or directory within the `layouts` directory.\n * @param options - Optional. An object containing configuration settings.\n * @param options.relative - If true, returns the path relative to the current working directory.\n * @returns The absolute or relative path to the specified file or directory within the `layouts` directory.\n */\nexport function layoutsPath(path?: string, options?: { relative?: boolean }): string {\n const absolutePath = resourcesPath(`layouts/${path || ''}`)\n\n if (options?.relative) return relative(process.cwd(), absolutePath)\n\n return absolutePath\n}\n\n/**\n * Returns the path to the library entry file, filtered by library type.\n *\n * @param type - The type of library ('vue-components', 'web-components', or 'functions').\n * @returns The absolute path to the specified library entry file.\n */\nexport type LibraryType = 'vue-components' | 'web-components' | 'functions'\nexport function libraryEntryPath(type: LibraryType): string {\n return libsEntriesPath(`${type}.ts`)\n}\n\n/**\n * Returns the path to the `lint` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the lint directory.\n * @returns The absolute path to the specified file or directory within the lint directory.\n */\nexport function lintPath(path?: string): string {\n return corePath(`lint/${path || ''}`)\n}\n\n/**\n * Returns the path to the `listeners` directory within the app directory.\n *\n * @param path - The relative path to the file or directory within the `listeners` directory.\n * @returns The absolute path to the specified file or directory within the `listeners` directory.\n */\nexport function listenersPath(path?: string): string {\n return appPath(`Listeners/${path || ''}`)\n}\n\n/**\n * Returns the path to the `jobs` directory within the app directory.\n *\n * @param path - The relative path to the file or directory within the `jobs` directory.\n * @returns The absolute path to the specified file or directory within the `jobs` directory.\n */\nexport function jobsPath(path?: string): string {\n return appPath(`Jobs/${path || ''}`)\n}\n\n/**\n * Returns the path to the `logging` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the logging directory.\n * @returns The absolute path to the specified file or directory within the logging directory.\n */\nexport function loggingPath(path?: string): string {\n return corePath(`logging/${path || ''}`)\n}\n\n/**\n * Returns the path to the `logs` directory within the project storage directory.\n *\n * @param path - The relative path to the file or directory within the `logs` directory.\n * @returns The absolute path to the specified file or directory within the `logs` directory.\n */\nexport function logsPath(path?: string): string {\n return storagePath(`logs/${path || ''}`)\n}\n\n/**\n * Returns the path to the `models` directory within the app directory.\n *\n * @param path - The relative path to the file or directory within the `models` directory.\n * @returns The absolute path to the specified file or directory within the `models` directory.\n */\nexport function modelsPath(path?: string): string {\n return appPath(`models/${path || ''}`)\n}\n\n/**\n * Returns the path to the `modules` directory within the `resources` directory.\n *\n * @param path - The relative path to the file or directory within the `modules` directory.\n * @returns The absolute path to the specified file or directory within the `modules` directory.\n */\nexport function modulesPath(path?: string): string {\n return resourcesPath(`modules/${path || ''}`)\n}\n\n/**\n * Returns the path to the `notifications` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `notifications` directory.\n * @returns The absolute path to the specified file or directory within the `notifications` directory.\n */\nexport function notificationsPath(path?: string): string {\n return corePath(`notifications/${path || ''}`)\n}\n\n/**\n * Returns the path to the `orm` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the orm directory.\n * @returns The absolute path to the specified file or directory within the orm directory.\n */\nexport function ormPath(path?: string): string {\n return corePath(`orm/${path || ''}`)\n}\n\n/**\n * Returns the path to the `objects` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `objects` directory.\n * @returns The absolute path to the specified file or directory within the `objects` directory.\n */\nexport function objectsPath(path?: string): string {\n return corePath(`objects/${path || ''}`)\n}\n\n/**\n * Returns the default path to the onboarding views within the project directory, or a specified path.\n *\n * @param path - The relative path to the file or directory within the project directory. Defaults to 'views/dashboard/onboarding'.\n * @returns The absolute path to the specified file or directory within the project directory.\n */\nexport function onboardingPath(path?: string): string {\n return projectPath(`${path || 'views/dashboard/onboarding'}`)\n}\n\n/**\n * Returns the path to the `package.json` file of a specified library type within the framework directory.\n *\n * @param type - The type of the library ('vue-components', 'web-components', or 'functions') for which to return the package.json path.\n * @returns The absolute path to the specified package.json file within the framework directory.\n */\nexport function packageJsonPath(type: 'vue-components' | 'web-components' | 'functions'): string {\n if (type === 'vue-components') return frameworkPath('libs/components/vue/package.json')\n\n if (type === 'web-components') return frameworkPath('libs/components/web/package.json')\n\n return frameworkPath(`libs/${type}/package.json`)\n}\n\n/**\n * Returns the path to the `views` directory within the `resources` directory.\n *\n * @param path - The relative path to the file or directory within the `views` directory.\n * @returns The absolute path to the specified file or directory within the `views` directory.\n */\nexport function viewsPath(path?: string): string {\n return resourcesPath(`views/${path || ''}`)\n}\n\n/**\n * Returns the path to the `path` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the path directory.\n * @returns The absolute path to the specified file or directory within the path directory.\n */\nexport function pathPath(path?: string): string {\n return corePath(`path/${path || ''}`)\n}\n\n/**\n * Returns the path to the `payments` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `payments` directory.\n * @returns The absolute path to the specified file or directory within the `payments` directory.\n */\nexport function paymentsPath(path?: string): string {\n return corePath(`payments/${path || ''}`)\n}\n\n/**\n * Returns the project path, resolving from the current working directory and moving up until the storage directory is no longer part of the path.\n *\n * @param filePath - The relative path to append to the project path. Defaults to an empty string.\n * @returns The absolute path to the specified file or directory within the project directory.\n */\nexport function projectPath(filePath = '', options?: { relative: boolean }): string {\n let path = process.cwd()\n\n while (path.includes('storage')) path = resolve(path, '..')\n\n const finalPath = resolve(path, filePath)\n\n // If the `relative` option is true, return the path relative to the current working directory\n if (options?.relative) return relative(process.cwd(), finalPath)\n\n return finalPath\n}\n\n/**\n * Finds and returns the absolute path of a specified project by name.\n *\n * @param project - The name of the project to find.\n * @returns The absolute path to the specified project.\n * @throws Error if the project with the specified name cannot be found.\n */\nexport async function findProjectPath(project: string): Promise<string> {\n const projectList = await runCommandSync('buddy projects:list --quiet')\n log.debug(`ProjectList in findProjectPath ${projectList}`)\n\n // get the list of all Stacks project paths (on the system)\n const projects = projectList\n .split('\\n')\n .filter((line: string) => line.startsWith(' - '))\n .map((line: string) => line.trim().substring(4))\n\n log.debug(`Projects in findProjectPath ${projects}`)\n\n // since we are targeting a specific project, find its path\n const projectPath = projects.find((proj: string) => proj.includes(project))\n\n if (!projectPath) throw new Error(`Could not find project with name: ${project}`)\n\n return projectPath.startsWith('/') ? projectPath : `/${projectPath}`\n}\n\n/**\n * Returns the path to the `config` directory within the project directory.\n *\n * @param path - The relative path to the file or directory within the config directory.\n * @returns The absolute path to the specified file or directory within the config directory.\n */\nexport function projectConfigPath(path?: string): string {\n return projectPath(`config/${path || ''}`)\n}\n\n/**\n * Returns the path to the `storage` directory within the project directory.\n *\n * @param path - The relative path to the file or directory within the storage directory.\n * @returns The absolute path to the specified file or directory within the storage directory.\n */\nexport function storagePath(path?: string): string {\n return projectPath(`storage/${path || ''}`)\n}\n\n/**\n * Returns the path to the `public` directory within the project directory.\n *\n * @param path - The relative path to the file or directory within the public directory.\n * @returns The absolute path to the specified file or directory within the public directory.\n */\nexport function publicPath(path?: string): string {\n return projectPath(`public/${path || ''}`)\n}\n\n/**\n * Returns the path to the `push` directory within the `notifications` directory.\n *\n * @param path - The relative path to the file or directory within the push directory.\n * @returns The absolute path to the specified file or directory within the push directory.\n */\nexport function pushPath(path?: string) {\n return notificationsPath(`push/${path || ''}`)\n}\n\n/**\n * Returns the path to the `query-builder` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the query-builder directory.\n * @returns The absolute path to the specified file or directory within the query-builder directory.\n */\nexport function queryBuilderPath(path?: string) {\n return corePath(`query-builder/${path || ''}`)\n}\n\n/**\n * Returns the path to the `queue` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the queue directory.\n * @returns The absolute path to the specified file or directory within the queue directory.\n */\nexport function queuePath(path?: string) {\n return corePath(`queue/${path || ''}`)\n}\n\n/**\n * Returns the path to the `realtime` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the realtime directory.\n * @returns The absolute path to the specified file or directory within the realtime directory.\n */\nexport function realtimePath(path?: string) {\n return corePath(`realtime/${path || ''}`)\n}\n\n/**\n * Returns the path to the `resources` directory within the project storage directory, with an option for relative paths.\n *\n * @param path - The relative path to the file or directory within the `resources` directory.\n * @param options - Optional. An object containing configuration settings.\n * @param options.relative - If true, returns the path relative to the current working directory.\n * @returns The absolute or relative path to the specified file or directory within the `resources` directory.\n */\nexport function resourcesPath(path?: string, options?: { relative?: boolean }) {\n if (options?.relative) {\n const absolutePath = projectPath(`resources/${path || ''}`)\n return relative(process.cwd(), absolutePath)\n }\n\n return projectPath(`resources/${path || ''}`)\n}\n\n/**\n * Returns the path to the `repl` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the repl directory.\n * @returns The absolute path to the specified file or directory within the repl directory.\n */\nexport function replPath(path?: string) {\n return corePath(`repl/${path || ''}`)\n}\n\n/**\n * Returns the path to the `router` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the router directory.\n * @returns The absolute path to the specified file or directory within the router directory.\n */\nexport function routerPath(path?: string) {\n return corePath(`router/${path || ''}`)\n}\n\n/**\n * Returns the path to the `routes` directory within the `resources` directory, with an option for relative paths.\n *\n * @param path - The relative path to the file or directory within the `routes` directory.\n * @param options - Optional. An object containing configuration settings.\n * @param options.relative - If true, returns the path relative to the current working directory.\n * @returns The absolute or relative path to the specified file or directory within the `routes` directory.\n */\nexport function routesPath(path?: string, options?: { relative?: boolean }) {\n const absolutePath = resourcesPath(`routes/${path || ''}`)\n\n if (options?.relative) return relative(process.cwd(), absolutePath)\n\n return projectPath(`routes/${path || ''}`)\n}\n\n/**\n * Returns the path to the `search-engine` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the search-engine directory.\n * @returns The absolute path to the specified file or directory within the search-engine directory.\n */\nexport function searchEnginePath(path?: string) {\n return corePath(`search-engine/${path || ''}`)\n}\n\n/**\n * Returns the path to the `settings` directory within the project directory, defaulting to the views/dashboard/settings directory.\n *\n * @param path - The relative path to the file or directory within the `settings` directory.\n * @returns The absolute path to the specified file or directory within the `settings` directory.\n */\nexport function settingsPath(path?: string) {\n return projectPath(`${path || 'views/dashboard/settings'}`)\n}\n\n/**\n * Returns the path to the `scripts` directory within the framework directory.\n *\n * @param path - The relative path to the file or directory within the `scripts` directory.\n * @returns The absolute path to the specified file or directory within the `scripts` directory.\n */\nexport function scriptsPath(path?: string) {\n return frameworkPath(`scripts/${path || ''}`)\n}\n\n/**\n * Returns the path to the `scheduler` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the scheduler directory.\n * @returns The absolute path to the specified file or directory within the scheduler directory.\n */\nexport function schedulerPath(path?: string) {\n return corePath(`scheduler/${path || ''}`)\n}\n\n/**\n * Returns the path to the `slug` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the slug directory.\n * @returns The absolute path to the specified file or directory within the slug directory.\n */\nexport function slugPath(path?: string) {\n return corePath(`slug/${path || ''}`)\n}\n\n/**\n * Returns the path to the `sms` directory within the `notifications` directory.\n *\n * @param path - The relative path to the file or directory within the `sms` directory.\n * @returns The absolute path to the specified file or directory within the `sms` directory.\n */\nexport function smsPath(path?: string) {\n return notificationsPath(`sms/${path || ''}`)\n}\n\n/**\n * Returns the path to the `storage` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the storage directory.\n * @returns The absolute path to the specified file or directory within the storage directory.\n */\nexport function coreStoragePath(path?: string) {\n return corePath(`storage/${path || ''}`)\n}\n\n/**\n * Returns the path to the `stores` directory within the `resources` directory.\n *\n * @param path - The relative path to the file or directory within the `stores` directory.\n * @returns The absolute path to the specified file or directory within the `stores` directory.\n */\nexport function storesPath(path?: string) {\n return resourcesPath(`stores/${path || ''}`)\n}\n\n/**\n * Returns the path to the `security` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the security directory.\n * @returns The absolute path to the specified file or directory within the security directory.\n */\nexport function securityPath(path?: string) {\n return corePath(`security/${path || ''}`)\n}\n\n/**\n * Returns the path to the `server` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the server directory.\n * @returns The absolute path to the specified file or directory within the server directory.\n */\nexport function serverPath(path?: string) {\n return corePath(`server/${path || ''}`)\n}\n\nexport function userServerPath(path?: string) {\n return frameworkPath(`server/${path || ''}`)\n}\n\n/**\n * Returns the path to the `serverless` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `serverless` directory.\n * @returns The absolute path to the specified file or directory within the `serverless` directory.\n */\nexport function serverlessPath(path?: string) {\n return corePath(`serverless/${path || ''}`)\n}\n\n/**\n * Returns the path to the specified directory or file within the framework's `src` directory.\n *\n * @param path - The relative path to the file or directory within the framework's `src` directory.\n * @returns The absolute path to the specified file or directory within the framework's `src` directory.\n */\nexport function stacksPath(path?: string) {\n return frameworkPath(`src/${path || ''}`)\n}\n\n/**\n * Returns the path to the `shell` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the shell directory.\n * @returns The absolute path to the specified file or directory within the shell directory.\n */\nexport function shellPath(path?: string) {\n return corePath(`shell/${path || ''}`)\n}\n\n/**\n * Returns the path to the `strings` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `strings` directory.\n * @returns The absolute path to the specified file or directory within the `strings` directory.\n */\nexport function stringsPath(path?: string) {\n return corePath(`strings/${path || ''}`)\n}\n\n/**\n * Returns the path to the `testing` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the testing directory.\n * @returns The absolute path to the specified file or directory within the testing directory.\n */\nexport function testingPath(path?: string) {\n return corePath(`testing/${path || ''}`)\n}\n\n/**\n * Returns the path to the `tinker` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the tinker directory.\n * @returns The absolute path to the specified file or directory within the tinker directory.\n */\nexport function tinkerPath(path?: string) {\n return corePath(`tinker/${path || ''}`)\n}\n\n/**\n * Returns the path to the `tests` directory within the framework directory.\n *\n * @param path - The relative path to the file or directory within the `tests` directory.\n * @returns The absolute path to the specified file or directory within the `tests` directory.\n */\nexport function testsPath(path?: string) {\n return frameworkPath(`tests/${path || ''}`)\n}\n\n/**\n * Returns the path to the `types` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `types` directory.\n * @returns The absolute path to the specified file or directory within the `types` directory.\n */\nexport function typesPath(path?: string) {\n return corePath(`types/${path || ''}`)\n}\n\n/**\n * Returns the path to the `ui` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the ui directory.\n * @returns The absolute path to the specified file or directory within the ui directory.\n */\nexport function uiPath(path?: string) {\n return corePath(`ui/${path || ''}`)\n}\n\n/**\n * Returns the path to the `utils` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the `utils` directory.\n * @returns The absolute path to the specified file or directory within the `utils` directory.\n */\nexport function utilsPath(path?: string) {\n return corePath(`utils/${path || ''}`)\n}\n\n/**\n * Returns the path to the `validation` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the validation directory.\n * @returns The absolute path to the specified file or directory within the validation directory.\n */\nexport function validationPath(path?: string) {\n return corePath(`validation/${path || ''}`)\n}\n\n/**\n * Returns the path to the `vite-config` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the vite-config directory.\n * @returns The absolute path to the specified file or directory within the vite-config directory.\n */\nexport function viteConfigPath(path?: string) {\n return corePath(`vite-config/${path || ''}`)\n}\n\n/**\n * Returns the path to the `vite-plugin` directory within the core directory.\n *\n * @param path - The relative path to the file or directory within the vite directory.\n * @returns The absolute path to the specified file or directory within the vite directory.\n */\nexport function vitePluginPath(path?: string) {\n return corePath(`vite-plugin/${path || ''}`)\n}\n\n/**\n * Returns the path to the `x-ray` directory within the `stacks` directory of the framework.\n *\n * @param path - The relative path to the file or directory within the x-ray directory.\n * @returns The absolute path to the specified file or directory within the x-ray directory.\n */\nexport function xRayPath(path?: string) {\n return frameworkPath(`stacks/x-ray/${path || ''}`)\n}\n\n/**\n * Returns the path to the home directory, optionally appending a given path.\n *\n * @param path - The relative path to append to the home directory path.\n * @returns The absolute path to the specified file or directory within the home directory.\n */\nexport function homeDir(path?: string) {\n return os.homedir() + (path ? (path.startsWith('/') ? '' : '/') + path : '~')\n}\n\nexport const path = {\n actionsPath,\n userActionsPath,\n builtUserActionsPath,\n userComponentsPath,\n userViewsPath,\n userFunctionsPath,\n aiPath,\n assetsPath,\n relativeActionsPath,\n aliasPath,\n analyticsPath,\n arraysPath,\n appPath,\n authPath,\n buddyPath,\n buildEnginePath,\n libsEntriesPath,\n buildPath,\n cachePath,\n chatPath,\n cliPath,\n cloudPath,\n frameworkCloudPath,\n collectionsPath,\n commandsPath,\n componentsPath,\n configPath,\n projectConfigPath,\n corePath,\n customElementsDataPath,\n databasePath,\n datetimePath,\n developmentPath,\n desktopPath,\n docsPath,\n dnsPath,\n emailPath,\n enumsPath,\n errorHandlingPath,\n eventsPath,\n coreEnvPath,\n healthPath,\n examplesPath,\n fakerPath,\n frameworkPath,\n storagePath,\n functionsPath,\n gitPath,\n langPath,\n layoutsPath,\n libsPath,\n userLibsPath,\n libraryEntryPath,\n lintPath,\n listenersPath,\n loggingPath,\n logsPath,\n jobsPath,\n modulesPath,\n ormPath,\n objectsPath,\n onboardingPath,\n notificationsPath,\n packageJsonPath,\n viewsPath,\n pathPath,\n paymentsPath,\n projectPath,\n findProjectPath,\n coreStoragePath,\n publicPath,\n pushPath,\n queryBuilderPath,\n queuePath,\n realtimePath,\n resourcesPath,\n replPath,\n routerPath,\n routesPath,\n runtimePath,\n searchEnginePath,\n schedulerPath,\n settingsPath,\n smsPath,\n slugPath,\n scriptsPath,\n securityPath,\n serverPath,\n userServerPath,\n serverlessPath,\n stacksPath,\n stringsPath,\n shellPath,\n storesPath,\n testingPath,\n testsPath,\n tinkerPath,\n typesPath,\n uiPath,\n userDatabasePath,\n userMigrationsPath,\n userEventsPath,\n userJobsPath,\n userListenersPath,\n userMiddlewarePath,\n userModelsPath,\n userNotificationsPath,\n utilsPath,\n validationPath,\n viteConfigPath,\n vitePluginPath,\n xRayPath,\n homeDir,\n\n // path utils\n basename,\n delimiter,\n dirname,\n extname,\n isAbsolute,\n join,\n normalize,\n relative,\n resolve,\n parse,\n sep,\n toNamespacedPath,\n}\n\nexport { basename, delimiter, dirname, extname, isAbsolute, join, normalize, relative, resolve, sep, toNamespacedPath }\n",
|