authup 1.0.0-beta.28 → 1.0.0-beta.29

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.mjs CHANGED
@@ -403,7 +403,8 @@ async function createCLIEntryPointCommand() {
403
403
  args: {
404
404
  command: {
405
405
  type: 'positional',
406
- description: 'The command which should be forwarded to the package.'
406
+ description: 'The command which should be forwarded to the package.',
407
+ required: true
407
408
  },
408
409
  package: {
409
410
  type: 'positional',
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/packages/client-web/config/parse.ts","../src/packages/client-web/config/build.ts","../src/packages/client-web/config/read/env.ts","../src/packages/client-web/config/read/fs.ts","../src/packages/client-web/config/read/module.ts","../src/utils/line-breaks.ts","../src/utils/process-output.ts","../src/utils/stringify-object-args.ts","../src/utils/shell.ts","../src/constants.ts","../src/utils/modules-path.ts","../src/packages/constants.ts","../src/packages/client-web/module.ts","../src/packages/server-core/module.ts","../src/packages/execute.ts","../src/packages/normalize.ts","../src/module.ts","../src/index.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport zod from 'zod';\nimport type { ClientWebConfigInput } from './type';\n\nexport function parseClientWebConfig(input: unknown = {}) : ClientWebConfigInput {\n const schema = zod.object({\n port: zod.number().nonnegative().optional(),\n host: zod.string().optional(),\n apiUrl: zod.string().url().optional(),\n publicUrl: zod.string().url().optional(),\n });\n\n return schema.parse(input);\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { extendObject, makeURLPublicAccessible } from '@authup/kit';\nimport { defineGetter, dycraft } from 'dycraft';\nimport { parseClientWebConfig } from './parse';\nimport type { ClientWebConfig, ClientWebConfigInput } from './type';\n\nexport function buildClientWebConfig(raw: ClientWebConfigInput): ClientWebConfig {\n const config = dycraft({\n defaults: {\n port: 3000,\n host: '0.0.0.0',\n apiUrl: 'http://127.0.0.1:3001/',\n },\n getters: {\n publicUrl: defineGetter((\n context,\n ) => `http://${makeURLPublicAccessible(context.get('host'))}:${context.get('port')}/`),\n },\n });\n\n return extendObject(config, parseClientWebConfig(raw));\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { oneOf, read, readInt } from 'envix';\nimport type { ClientWebConfigInput } from '../type';\n\nexport function readClientWebConfigFromEnv() : ClientWebConfigInput {\n const config : ClientWebConfigInput = {};\n\n const port = oneOf([\n readInt('UI_PORT'),\n readInt('NITRO_UI_PORT'),\n readInt('NUXT_UI_PORT'),\n readInt('NUXT_PUBLIC_UI_PORT'),\n readInt('PORT'),\n readInt('NITRO_PORT'),\n readInt('NUXT_PORT'),\n readInt('NUXT_PUBLIC_PORT'),\n ]);\n\n if (typeof port !== 'undefined') {\n config.port = port;\n }\n\n const host = oneOf([\n read('HOST'),\n read('NITRO_HOST'),\n read('NUXT_HOST'),\n ]);\n\n if (host) {\n config.host = host;\n }\n\n const apiUrl = oneOf([\n read('API_URL'),\n read('NUXT_API_URL'),\n read('NUXT_PUBLIC_API_URL'),\n ]);\n\n if (apiUrl) {\n config.apiUrl = apiUrl;\n }\n\n const publicURL = oneOf([\n read('PUBLIC_URL'),\n read('NUXT_PUBLIC_URL'),\n read('NUXT_PUBLIC_PUBLIC_URL'),\n ]);\n\n if (publicURL) {\n config.publicUrl = publicURL;\n }\n\n return config;\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { makeURLPublicAccessible } from '@authup/kit';\nimport { Container } from 'confinity';\nimport type { ClientWebConfigInput } from '../type';\n\nexport type ClientWebConfigReadFsOptions = {\n cwd?: string,\n file?: string | string[]\n};\n\nexport async function readClientWebConfigFromFS(options: ClientWebConfigReadFsOptions = {}) : Promise<ClientWebConfigInput> {\n const container = new Container({\n prefix: 'authup',\n cwd: options.cwd,\n });\n\n if (options.file) {\n await container.loadFile(options.file);\n } else {\n await container.load();\n }\n\n const clientRaw = container.get('client.web') || {};\n const serverRaw = container.get('server.core') || {};\n if (serverRaw) {\n if (\n !clientRaw.apiUrl &&\n typeof serverRaw.publicUrl === 'string'\n ) {\n clientRaw.apiUrl = makeURLPublicAccessible(serverRaw.publicUrl);\n }\n\n if (\n !clientRaw.publicUrl &&\n typeof serverRaw.authorizeRedirectUrl === 'string'\n ) {\n clientRaw.apiUrl = makeURLPublicAccessible(serverRaw.authorizeRedirectUrl);\n }\n }\n\n return clientRaw;\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { merge } from 'smob';\nimport type { ClientWebConfigInput } from '../type';\nimport { readClientWebConfigFromEnv } from './env';\nimport type { ClientWebConfigReadFsOptions } from './fs';\nimport { readClientWebConfigFromFS } from './fs';\n\nexport type ClientWebConfigRawReadOptions = {\n fs?: boolean | ClientWebConfigReadFsOptions,\n env?: boolean,\n};\n\nexport async function readClientWebConfigRaw(options: ClientWebConfigRawReadOptions = {}) : Promise<ClientWebConfigInput> {\n if (options.fs && options.env) {\n const fsOptions = boolableToObject(options.fs);\n const fs = await readClientWebConfigFromFS(fsOptions);\n const env = readClientWebConfigFromEnv();\n\n return merge(env, fs);\n }\n\n if (options.fs) {\n const fsOptions = boolableToObject(options.fs);\n return readClientWebConfigFromFS(fsOptions);\n }\n\n if (options.env) {\n return readClientWebConfigFromEnv();\n }\n\n return {};\n}\n\nfunction boolableToObject<T>(input: T | boolean) : T {\n if (typeof input === 'boolean') {\n return {} as T;\n }\n\n return input;\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function removeLineBreaks(input: string) {\n return input.replace(/(\\r\\n|\\n|\\r)/gm, '');\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty, isObject } from '@authup/kit';\nimport { removeLineBreaks } from './line-breaks';\n\nexport function parseProcessOutputData(input: unknown) : string[] {\n if (typeof input !== 'string') {\n return [];\n }\n\n const lines = input\n .split(/\\r?\\n/)\n .filter((element) => element);\n\n const items : string[] = [];\n\n for (let i = 0; i < lines.length; i++) {\n const line = removeLineBreaks(lines[i]).trim();\n if (line.length === 0) {\n continue;\n }\n\n try {\n const parsed = JSON.parse(line);\n\n if (\n isObject(parsed) &&\n hasOwnProperty(parsed, 'message') &&\n typeof parsed.message === 'string'\n ) {\n items.push(parsed.message);\n continue;\n }\n } catch (e) {\n // no json :/\n }\n\n items.push(line);\n }\n\n return items;\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function stringifyObjectArgs(ob: Record<string, any>) {\n const parts : string[] = [];\n\n const keys = Object.keys(ob);\n for (let i = 0; i < keys.length; i++) {\n parts.push(`--${keys[i]} ${ob[keys[i]]}`);\n }\n\n return parts.join(' ');\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ChildProcess } from 'node:child_process';\nimport { exec } from 'node:child_process';\nimport process from 'node:process';\nimport { parseProcessOutputData } from './process-output';\nimport { stringifyObjectArgs } from './stringify-object-args';\n\nexport type ShellCommandExecOptions = {\n configFile?: string,\n configDirectory?: string,\n\n env?: Record<string, string | undefined>,\n envFromProcess?: boolean,\n args?: Record<string, any>,\n logErrorStream?: (content: string) => void,\n logDataStream?: (content: string) => void\n};\n\nexport async function execShellCommand(\n command: string,\n ctx: ShellCommandExecOptions = {},\n) {\n return new Promise<ChildProcess>((resolve, reject) => {\n const childProcess = exec(`${command} ${stringifyObjectArgs(ctx.args || {})}`, {\n env: {\n PATH: process.env.PATH,\n ...(ctx.envFromProcess ? process.env : {}),\n ...(ctx.env ? ctx.env : {}),\n },\n });\n\n childProcess.on('error', (data) => {\n reject(data);\n });\n\n childProcess.on('spawn', () => {\n resolve(childProcess);\n });\n\n if (childProcess.stderr) {\n childProcess.stderr.setEncoding('utf-8');\n childProcess.stderr.on('data', (data) => {\n if (typeof data !== 'string' || data.length === 0) {\n return;\n }\n\n if (ctx.logErrorStream) {\n ctx.logErrorStream(data);\n }\n });\n }\n if (childProcess.stdout) {\n childProcess.stdout.on('data', (data) => {\n if (typeof data !== 'string' || data.length === 0) {\n return;\n }\n\n if (!ctx.logDataStream) {\n return;\n }\n\n const lines = parseProcessOutputData(data);\n for (let i = 0; i < lines.length; i++) {\n ctx.logDataStream(lines[i]);\n }\n });\n }\n });\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport path from 'node:path';\n\nexport const PACKAGE_DIRECTORY = path.join(__dirname, '..');\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport process from 'node:process';\nimport findUpPackagePath from 'resolve-package-path';\nimport { PACKAGE_DIRECTORY } from '../constants';\n\nexport function findModulePath(module: string) : string | undefined {\n let modulePath = findUpPackagePath(module, PACKAGE_DIRECTORY);\n if (PACKAGE_DIRECTORY !== process.cwd()) {\n modulePath = findUpPackagePath(module, process.cwd());\n }\n\n if (!modulePath) {\n return undefined;\n }\n\n return modulePath;\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum PackageName {\n CLIENT_WEB = '@authup/client-web',\n SERVER_CORE = '@authup/server-core',\n}\n\nexport enum PackageID {\n CLIENT_WEB = 'client.web',\n SERVER_CORE = 'server.core',\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport consola from 'consola';\nimport type { ChildProcess } from 'node:child_process';\nimport path from 'node:path';\nimport { execShellCommand, findModulePath } from '../../utils';\nimport { PackageID, PackageName } from '../constants';\nimport type { Package, PackageExecuteOptions } from '../types';\nimport { buildClientWebConfig, readClientWebConfigRaw } from './config';\n\nexport class ClientWebPackage implements Package {\n async execute(command: string, options: PackageExecuteOptions = {}) : Promise<ChildProcess> {\n const shellCommand = await this.buildShellCommand();\n const env = await this.buildEnv({\n configDirectory: options.configDirectory,\n configFile: options.configFile,\n });\n\n return execShellCommand(shellCommand, {\n env,\n logDataStream(line) {\n consola.info(`${PackageID.CLIENT_WEB}: ${line}`);\n },\n logErrorStream(line) {\n consola.warn(`${PackageID.CLIENT_WEB}: ${line}`);\n },\n });\n }\n\n protected async buildShellCommand() {\n let shellCommand : string;\n\n const modulePath = findModulePath(PackageName.CLIENT_WEB);\n if (typeof modulePath === 'string') {\n const directory = path.dirname(modulePath);\n const outputPath = path.join(directory, '.output', 'server', 'index.mjs');\n shellCommand = `node ${outputPath}`;\n } else {\n shellCommand = `npx ${PackageName.CLIENT_WEB}`;\n }\n\n return shellCommand;\n }\n\n protected async buildEnv(ctx: PackageExecuteOptions) {\n const env : Record<string, any> = {};\n\n const configRaw = await readClientWebConfigRaw({\n fs: {\n file: ctx.configFile,\n cwd: ctx.configDirectory,\n },\n });\n const config = buildClientWebConfig(configRaw);\n\n if (config.host) {\n env.HOST = config.host;\n }\n\n if (config.port) {\n env.PORT = `${config.port}`;\n }\n\n if (config.apiUrl) {\n env.API_URL = config.apiUrl;\n }\n\n if (config.publicUrl) {\n env.PUBLIC_URL = config.publicUrl;\n }\n\n return this.extendEnvKeys(env);\n }\n\n extendEnvKeys(input: Record<string, string | undefined>) {\n const env : Record<string, any> = {};\n\n const keys = Object.keys(input);\n for (let i = 0; i < keys.length; i++) {\n env[keys[i]] = input[keys[i]];\n\n if (!keys[i].match(/^(?:NUXT|NITRO)_.*$/)) {\n env[`NUXT_PUBLIC_${keys[i]}`] = input[keys[i]];\n }\n }\n\n return env;\n }\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport consola from 'consola';\nimport path from 'node:path';\nimport type { ShellCommandExecOptions } from '../../utils';\nimport { execShellCommand, findModulePath } from '../../utils';\nimport { PackageID, PackageName } from '../constants';\nimport type { Package, PackageExecuteOptions } from '../types';\n\nexport class ServerCorePackage implements Package {\n async execute(command: string, options: PackageExecuteOptions = {}) {\n const shellCommand = await this.buildShellCommand(command, {\n configDirectory: options.configDirectory,\n configFile: options.configFile,\n });\n\n return execShellCommand(shellCommand, {\n logDataStream(line) {\n consola.info(`${PackageID.SERVER_CORE}: ${line}`);\n },\n logErrorStream(line) {\n consola.warn(`${PackageID.SERVER_CORE}: ${line}`);\n },\n });\n }\n\n protected async buildShellCommand(command: string, options: ShellCommandExecOptions) {\n const parts : string[] = [];\n\n const modulePath = findModulePath(PackageName.SERVER_CORE);\n if (typeof modulePath === 'string') {\n const directory = path.dirname(modulePath);\n const outputPath = path.join(directory, 'dist', 'cli', 'index.js');\n parts.push(`node ${outputPath}`);\n } else {\n parts.push(`npx ${PackageName.SERVER_CORE}`);\n }\n\n parts.push(command);\n\n if (options.configFile) {\n parts.push(`--configFile=${options.configFile}`);\n }\n\n if (options.configDirectory) {\n parts.push(`--configDirectory=${options.configDirectory}`);\n }\n\n return parts.join(' ');\n }\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ChildProcess } from 'node:child_process';\nimport { ClientWebPackage } from './client-web';\nimport { PackageID } from './constants';\nimport { ServerCorePackage } from './server-core';\nimport type { PackageExecuteOptions } from './types';\n\nexport async function executePackageCommand(\n pkg: string,\n command: string,\n options: PackageExecuteOptions = {},\n) : Promise<ChildProcess> {\n switch (pkg) {\n case PackageID.CLIENT_WEB: {\n const serverCore = new ClientWebPackage();\n\n return serverCore.execute(\n command,\n options,\n );\n }\n case PackageID.SERVER_CORE: {\n const serverCore = new ServerCorePackage();\n\n return serverCore.execute(\n command,\n options,\n );\n }\n }\n\n throw new Error(`The package ${pkg} is not supported.`);\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { PackageID } from './constants';\n\nexport function normalizePackageID(input: string) : `${PackageID}` | null {\n const value = input.trim().toLowerCase();\n\n switch (value) {\n case 'client.web':\n case 'client/web':\n case 'client-web': {\n return PackageID.CLIENT_WEB;\n }\n case 'server.core':\n case 'server/core':\n case 'server-core': {\n return PackageID.SERVER_CORE;\n }\n }\n\n return null;\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { defineCommand } from 'citty';\nimport type { ChildProcess } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { PackageID, executePackageCommand, normalizePackageID } from './packages';\n\nexport async function createCLIEntryPointCommand() {\n const pkgRaw = await fs.promises.readFile(\n path.join(process.cwd(), 'package.json'),\n { encoding: 'utf8' },\n );\n const pkg = JSON.parse(pkgRaw);\n\n return defineCommand({\n meta: {\n name: pkg.name,\n version: pkg.version,\n description: pkg.description,\n },\n args: {\n command: {\n type: 'positional',\n description: 'The command which should be forwarded to the package.',\n },\n package: {\n type: 'positional',\n description: 'The package, which should be targeted.',\n required: false,\n },\n configDirectory: {\n type: 'string',\n description: 'Config directory path',\n alias: 'cD',\n },\n configFile: {\n type: 'string',\n description: 'Name of one or more configuration files.',\n alias: 'cF',\n },\n },\n async run(ctx) {\n let packages = ctx.args.package ?\n ctx.args.package.split(',') :\n [];\n\n if (packages.length > 0) {\n packages = packages\n .map((pkg) => normalizePackageID(pkg))\n .filter((pkg) => Boolean(pkg))\n .map((pkg) => `${pkg}`);\n }\n\n if (packages.length === 0) {\n packages = Object.values(PackageID);\n }\n\n const promises : Promise<ChildProcess>[] = [];\n for (let i = 0; i < packages.length; i++) {\n promises.push(executePackageCommand(\n packages[i],\n ctx.args.command,\n {\n configFile: ctx.args.configFile,\n configDirectory: ctx.args.configDirectory,\n },\n ));\n }\n\n await Promise.all(promises);\n },\n });\n}\n","#!/usr/bin/env node\n\nimport { runMain } from 'citty';\nimport { createCLIEntryPointCommand } from './module';\n\nPromise.resolve()\n .then(() => createCLIEntryPointCommand())\n .then((command) => runMain(command));\n"],"names":["port","apiUrl","publicUrl","config","cwd","clientRaw","items","parts","childProcess","ctx","PackageName","PackageID","configDirectory","configFile","env","logDataStream","logErrorStream","shellCommand","file","extendEnvKeys","name","version","description","packages","Promise"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUO;;AAECA;;AAEAC;AACAC;AACJ;;AAGJ;;ACPO;AACH;;;;;AAKI;;AAEIA;AAGJ;AACJ;;AAGJ;;ACjBO;AACH;AAEA;;;;;;;;;AASC;;AAGGC;AACJ;AAEA;;;;AAIC;AAED;AACIA;AACJ;AAEA;;;;AAIC;AAED;AACIA;AACJ;AAEA;;;;AAIC;AAED;AACIA;AACJ;;AAGJ;;AC3CO;;;AAGCC;AACJ;;AAGI;;AAEA;AACJ;AAEA;AACA;AACA;;AAKQC;AACJ;;AAMIA;AACJ;AACJ;;AAGJ;;AC7BO;AACH;;;AAGI;AAEA;AACJ;;;AAII;AACJ;;;AAIA;AAEA;AACJ;AAEA;;AAEQ;AACJ;;AAGJ;;AC7CA;;;;;;;AASA;;ACCO;;AAEC;AACJ;;AAMA;AAEA;AACI;;AAEI;AACJ;;;;;AAWQ;AACJ;AACJ;;AAEA;AAEAC;AACJ;;AAGJ;;AC9CA;;;;;;AAQI;;AAGA;AACIC;AACJ;;AAGJ;;ACQO;;AAKC;;;AAGQ;AACA;AACJ;AACJ;;;AAIA;;;AAIA;;;AAIIC;AACI;AACI;AACJ;;AAGIC;AACJ;AACJ;AACJ;;AAEID;AACI;AACI;AACJ;;AAGI;AACJ;AAEA;AACA;AACIC;AACJ;AACJ;AACJ;AACJ;AACJ;;ACjEO;;ACEA;;;;AAIH;AAEA;;AAEA;;AAGJ;;ACtBA;;;;;;;;AAOYC;AAGX;AAEM;;;AAAKC;AAGX;;ACAM;AACH;AACI;AACA;AACIC;AACAC;AACJ;AAEA;AACIC;AACAC;;AAEA;AACAC;;AAEA;AACJ;AACJ;AAEA;;;;;AAMQ;;;AAGAC;AACJ;;AAGJ;;AAGI;;;AAIQC;AACAd;AACJ;AACJ;AACA;;;AAIA;;AAGIU;AACJ;;;AAIA;;;AAIA;;AAGJ;AAEAK;AACI;;AAGA;;AAGI;AACIL;AACJ;AACJ;;AAGJ;AACJ;;AC/EO;AACH;AACI;AACIF;AACAC;AACJ;AAEA;AACIE;;AAEA;AACAC;;AAEA;AACJ;AACJ;AAEA;AACI;;;;AAKI;AACAT;;AAEAA;AACJ;AAEAA;;AAGIA;AACJ;;AAGIA;AACJ;;AAGJ;AACJ;;AC1CO;;AAMC;AAA2B;AACvB;;AAMJ;AACA;AAA4B;AACxB;;AAMJ;AACJ;AAEA;AACJ;;AC7BO;AACH;;;;;AAKuB;AACf;AACJ;;;;AAGoB;AAChB;AACJ;AACJ;;AAGJ;;ACZO;AACH;;AAEuB;;AAIvB;;AAEQa;AACAC;AACAC;AACJ;;;;;AAKI;;;;;AAKA;;;;;AAKA;;;;;AAKA;AACJ;AACA;AACI;;AAKIC;AAIJ;;;AAIA;AAEA;AACA;;;;AAOQ;AAER;;AAGJ;AACJ;AACJ;;AC1EAC"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/packages/client-web/config/parse.ts","../src/packages/client-web/config/build.ts","../src/packages/client-web/config/read/env.ts","../src/packages/client-web/config/read/fs.ts","../src/packages/client-web/config/read/module.ts","../src/utils/line-breaks.ts","../src/utils/process-output.ts","../src/utils/stringify-object-args.ts","../src/utils/shell.ts","../src/constants.ts","../src/utils/modules-path.ts","../src/packages/constants.ts","../src/packages/client-web/module.ts","../src/packages/server-core/module.ts","../src/packages/execute.ts","../src/packages/normalize.ts","../src/module.ts","../src/index.ts"],"sourcesContent":["/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport zod from 'zod';\nimport type { ClientWebConfigInput } from './type';\n\nexport function parseClientWebConfig(input: unknown = {}) : ClientWebConfigInput {\n const schema = zod.object({\n port: zod.number().nonnegative().optional(),\n host: zod.string().optional(),\n apiUrl: zod.string().url().optional(),\n publicUrl: zod.string().url().optional(),\n });\n\n return schema.parse(input);\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { extendObject, makeURLPublicAccessible } from '@authup/kit';\nimport { defineGetter, dycraft } from 'dycraft';\nimport { parseClientWebConfig } from './parse';\nimport type { ClientWebConfig, ClientWebConfigInput } from './type';\n\nexport function buildClientWebConfig(raw: ClientWebConfigInput): ClientWebConfig {\n const config = dycraft({\n defaults: {\n port: 3000,\n host: '0.0.0.0',\n apiUrl: 'http://127.0.0.1:3001/',\n },\n getters: {\n publicUrl: defineGetter((\n context,\n ) => `http://${makeURLPublicAccessible(context.get('host'))}:${context.get('port')}/`),\n },\n });\n\n return extendObject(config, parseClientWebConfig(raw));\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { oneOf, read, readInt } from 'envix';\nimport type { ClientWebConfigInput } from '../type';\n\nexport function readClientWebConfigFromEnv() : ClientWebConfigInput {\n const config : ClientWebConfigInput = {};\n\n const port = oneOf([\n readInt('UI_PORT'),\n readInt('NITRO_UI_PORT'),\n readInt('NUXT_UI_PORT'),\n readInt('NUXT_PUBLIC_UI_PORT'),\n readInt('PORT'),\n readInt('NITRO_PORT'),\n readInt('NUXT_PORT'),\n readInt('NUXT_PUBLIC_PORT'),\n ]);\n\n if (typeof port !== 'undefined') {\n config.port = port;\n }\n\n const host = oneOf([\n read('HOST'),\n read('NITRO_HOST'),\n read('NUXT_HOST'),\n ]);\n\n if (host) {\n config.host = host;\n }\n\n const apiUrl = oneOf([\n read('API_URL'),\n read('NUXT_API_URL'),\n read('NUXT_PUBLIC_API_URL'),\n ]);\n\n if (apiUrl) {\n config.apiUrl = apiUrl;\n }\n\n const publicURL = oneOf([\n read('PUBLIC_URL'),\n read('NUXT_PUBLIC_URL'),\n read('NUXT_PUBLIC_PUBLIC_URL'),\n ]);\n\n if (publicURL) {\n config.publicUrl = publicURL;\n }\n\n return config;\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { makeURLPublicAccessible } from '@authup/kit';\nimport { Container } from 'confinity';\nimport type { ClientWebConfigInput } from '../type';\n\nexport type ClientWebConfigReadFsOptions = {\n cwd?: string,\n file?: string | string[]\n};\n\nexport async function readClientWebConfigFromFS(options: ClientWebConfigReadFsOptions = {}) : Promise<ClientWebConfigInput> {\n const container = new Container({\n prefix: 'authup',\n cwd: options.cwd,\n });\n\n if (options.file) {\n await container.loadFile(options.file);\n } else {\n await container.load();\n }\n\n const clientRaw = container.get('client.web') || {};\n const serverRaw = container.get('server.core') || {};\n if (serverRaw) {\n if (\n !clientRaw.apiUrl &&\n typeof serverRaw.publicUrl === 'string'\n ) {\n clientRaw.apiUrl = makeURLPublicAccessible(serverRaw.publicUrl);\n }\n\n if (\n !clientRaw.publicUrl &&\n typeof serverRaw.authorizeRedirectUrl === 'string'\n ) {\n clientRaw.apiUrl = makeURLPublicAccessible(serverRaw.authorizeRedirectUrl);\n }\n }\n\n return clientRaw;\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { merge } from 'smob';\nimport type { ClientWebConfigInput } from '../type';\nimport { readClientWebConfigFromEnv } from './env';\nimport type { ClientWebConfigReadFsOptions } from './fs';\nimport { readClientWebConfigFromFS } from './fs';\n\nexport type ClientWebConfigRawReadOptions = {\n fs?: boolean | ClientWebConfigReadFsOptions,\n env?: boolean,\n};\n\nexport async function readClientWebConfigRaw(options: ClientWebConfigRawReadOptions = {}) : Promise<ClientWebConfigInput> {\n if (options.fs && options.env) {\n const fsOptions = boolableToObject(options.fs);\n const fs = await readClientWebConfigFromFS(fsOptions);\n const env = readClientWebConfigFromEnv();\n\n return merge(env, fs);\n }\n\n if (options.fs) {\n const fsOptions = boolableToObject(options.fs);\n return readClientWebConfigFromFS(fsOptions);\n }\n\n if (options.env) {\n return readClientWebConfigFromEnv();\n }\n\n return {};\n}\n\nfunction boolableToObject<T>(input: T | boolean) : T {\n if (typeof input === 'boolean') {\n return {} as T;\n }\n\n return input;\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function removeLineBreaks(input: string) {\n return input.replace(/(\\r\\n|\\n|\\r)/gm, '');\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty, isObject } from '@authup/kit';\nimport { removeLineBreaks } from './line-breaks';\n\nexport function parseProcessOutputData(input: unknown) : string[] {\n if (typeof input !== 'string') {\n return [];\n }\n\n const lines = input\n .split(/\\r?\\n/)\n .filter((element) => element);\n\n const items : string[] = [];\n\n for (let i = 0; i < lines.length; i++) {\n const line = removeLineBreaks(lines[i]).trim();\n if (line.length === 0) {\n continue;\n }\n\n try {\n const parsed = JSON.parse(line);\n\n if (\n isObject(parsed) &&\n hasOwnProperty(parsed, 'message') &&\n typeof parsed.message === 'string'\n ) {\n items.push(parsed.message);\n continue;\n }\n } catch (e) {\n // no json :/\n }\n\n items.push(line);\n }\n\n return items;\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function stringifyObjectArgs(ob: Record<string, any>) {\n const parts : string[] = [];\n\n const keys = Object.keys(ob);\n for (let i = 0; i < keys.length; i++) {\n parts.push(`--${keys[i]} ${ob[keys[i]]}`);\n }\n\n return parts.join(' ');\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ChildProcess } from 'node:child_process';\nimport { exec } from 'node:child_process';\nimport process from 'node:process';\nimport { parseProcessOutputData } from './process-output';\nimport { stringifyObjectArgs } from './stringify-object-args';\n\nexport type ShellCommandExecOptions = {\n configFile?: string,\n configDirectory?: string,\n\n env?: Record<string, string | undefined>,\n envFromProcess?: boolean,\n args?: Record<string, any>,\n logErrorStream?: (content: string) => void,\n logDataStream?: (content: string) => void\n};\n\nexport async function execShellCommand(\n command: string,\n ctx: ShellCommandExecOptions = {},\n) {\n return new Promise<ChildProcess>((resolve, reject) => {\n const childProcess = exec(`${command} ${stringifyObjectArgs(ctx.args || {})}`, {\n env: {\n PATH: process.env.PATH,\n ...(ctx.envFromProcess ? process.env : {}),\n ...(ctx.env ? ctx.env : {}),\n },\n });\n\n childProcess.on('error', (data) => {\n reject(data);\n });\n\n childProcess.on('spawn', () => {\n resolve(childProcess);\n });\n\n if (childProcess.stderr) {\n childProcess.stderr.setEncoding('utf-8');\n childProcess.stderr.on('data', (data) => {\n if (typeof data !== 'string' || data.length === 0) {\n return;\n }\n\n if (ctx.logErrorStream) {\n ctx.logErrorStream(data);\n }\n });\n }\n if (childProcess.stdout) {\n childProcess.stdout.on('data', (data) => {\n if (typeof data !== 'string' || data.length === 0) {\n return;\n }\n\n if (!ctx.logDataStream) {\n return;\n }\n\n const lines = parseProcessOutputData(data);\n for (let i = 0; i < lines.length; i++) {\n ctx.logDataStream(lines[i]);\n }\n });\n }\n });\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport path from 'node:path';\n\nexport const PACKAGE_DIRECTORY = path.join(__dirname, '..');\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport process from 'node:process';\nimport findUpPackagePath from 'resolve-package-path';\nimport { PACKAGE_DIRECTORY } from '../constants';\n\nexport function findModulePath(module: string) : string | undefined {\n let modulePath = findUpPackagePath(module, PACKAGE_DIRECTORY);\n if (PACKAGE_DIRECTORY !== process.cwd()) {\n modulePath = findUpPackagePath(module, process.cwd());\n }\n\n if (!modulePath) {\n return undefined;\n }\n\n return modulePath;\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport enum PackageName {\n CLIENT_WEB = '@authup/client-web',\n SERVER_CORE = '@authup/server-core',\n}\n\nexport enum PackageID {\n CLIENT_WEB = 'client.web',\n SERVER_CORE = 'server.core',\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport consola from 'consola';\nimport type { ChildProcess } from 'node:child_process';\nimport path from 'node:path';\nimport { execShellCommand, findModulePath } from '../../utils';\nimport { PackageID, PackageName } from '../constants';\nimport type { Package, PackageExecuteOptions } from '../types';\nimport { buildClientWebConfig, readClientWebConfigRaw } from './config';\n\nexport class ClientWebPackage implements Package {\n async execute(command: string, options: PackageExecuteOptions = {}) : Promise<ChildProcess> {\n const shellCommand = await this.buildShellCommand();\n const env = await this.buildEnv({\n configDirectory: options.configDirectory,\n configFile: options.configFile,\n });\n\n return execShellCommand(shellCommand, {\n env,\n logDataStream(line) {\n consola.info(`${PackageID.CLIENT_WEB}: ${line}`);\n },\n logErrorStream(line) {\n consola.warn(`${PackageID.CLIENT_WEB}: ${line}`);\n },\n });\n }\n\n protected async buildShellCommand() {\n let shellCommand : string;\n\n const modulePath = findModulePath(PackageName.CLIENT_WEB);\n if (typeof modulePath === 'string') {\n const directory = path.dirname(modulePath);\n const outputPath = path.join(directory, '.output', 'server', 'index.mjs');\n shellCommand = `node ${outputPath}`;\n } else {\n shellCommand = `npx ${PackageName.CLIENT_WEB}`;\n }\n\n return shellCommand;\n }\n\n protected async buildEnv(ctx: PackageExecuteOptions) {\n const env : Record<string, any> = {};\n\n const configRaw = await readClientWebConfigRaw({\n fs: {\n file: ctx.configFile,\n cwd: ctx.configDirectory,\n },\n });\n const config = buildClientWebConfig(configRaw);\n\n if (config.host) {\n env.HOST = config.host;\n }\n\n if (config.port) {\n env.PORT = `${config.port}`;\n }\n\n if (config.apiUrl) {\n env.API_URL = config.apiUrl;\n }\n\n if (config.publicUrl) {\n env.PUBLIC_URL = config.publicUrl;\n }\n\n return this.extendEnvKeys(env);\n }\n\n extendEnvKeys(input: Record<string, string | undefined>) {\n const env : Record<string, any> = {};\n\n const keys = Object.keys(input);\n for (let i = 0; i < keys.length; i++) {\n env[keys[i]] = input[keys[i]];\n\n if (!keys[i].match(/^(?:NUXT|NITRO)_.*$/)) {\n env[`NUXT_PUBLIC_${keys[i]}`] = input[keys[i]];\n }\n }\n\n return env;\n }\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport consola from 'consola';\nimport path from 'node:path';\nimport type { ShellCommandExecOptions } from '../../utils';\nimport { execShellCommand, findModulePath } from '../../utils';\nimport { PackageID, PackageName } from '../constants';\nimport type { Package, PackageExecuteOptions } from '../types';\n\nexport class ServerCorePackage implements Package {\n async execute(command: string, options: PackageExecuteOptions = {}) {\n const shellCommand = await this.buildShellCommand(command, {\n configDirectory: options.configDirectory,\n configFile: options.configFile,\n });\n\n return execShellCommand(shellCommand, {\n logDataStream(line) {\n consola.info(`${PackageID.SERVER_CORE}: ${line}`);\n },\n logErrorStream(line) {\n consola.warn(`${PackageID.SERVER_CORE}: ${line}`);\n },\n });\n }\n\n protected async buildShellCommand(command: string, options: ShellCommandExecOptions) {\n const parts : string[] = [];\n\n const modulePath = findModulePath(PackageName.SERVER_CORE);\n if (typeof modulePath === 'string') {\n const directory = path.dirname(modulePath);\n const outputPath = path.join(directory, 'dist', 'cli', 'index.js');\n parts.push(`node ${outputPath}`);\n } else {\n parts.push(`npx ${PackageName.SERVER_CORE}`);\n }\n\n parts.push(command);\n\n if (options.configFile) {\n parts.push(`--configFile=${options.configFile}`);\n }\n\n if (options.configDirectory) {\n parts.push(`--configDirectory=${options.configDirectory}`);\n }\n\n return parts.join(' ');\n }\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ChildProcess } from 'node:child_process';\nimport { ClientWebPackage } from './client-web';\nimport { PackageID } from './constants';\nimport { ServerCorePackage } from './server-core';\nimport type { PackageExecuteOptions } from './types';\n\nexport async function executePackageCommand(\n pkg: string,\n command: string,\n options: PackageExecuteOptions = {},\n) : Promise<ChildProcess> {\n switch (pkg) {\n case PackageID.CLIENT_WEB: {\n const serverCore = new ClientWebPackage();\n\n return serverCore.execute(\n command,\n options,\n );\n }\n case PackageID.SERVER_CORE: {\n const serverCore = new ServerCorePackage();\n\n return serverCore.execute(\n command,\n options,\n );\n }\n }\n\n throw new Error(`The package ${pkg} is not supported.`);\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { PackageID } from './constants';\n\nexport function normalizePackageID(input: string) : `${PackageID}` | null {\n const value = input.trim().toLowerCase();\n\n switch (value) {\n case 'client.web':\n case 'client/web':\n case 'client-web': {\n return PackageID.CLIENT_WEB;\n }\n case 'server.core':\n case 'server/core':\n case 'server-core': {\n return PackageID.SERVER_CORE;\n }\n }\n\n return null;\n}\n","/*\n * Copyright (c) 2024-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { defineCommand } from 'citty';\nimport type { ChildProcess } from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport process from 'node:process';\nimport { PackageID, executePackageCommand, normalizePackageID } from './packages';\n\nexport async function createCLIEntryPointCommand() {\n const pkgRaw = await fs.promises.readFile(\n path.join(process.cwd(), 'package.json'),\n { encoding: 'utf8' },\n );\n const pkg = JSON.parse(pkgRaw);\n\n return defineCommand({\n meta: {\n name: pkg.name,\n version: pkg.version,\n description: pkg.description,\n },\n args: {\n command: {\n type: 'positional',\n description: 'The command which should be forwarded to the package.',\n required: true,\n },\n package: {\n type: 'positional',\n description: 'The package, which should be targeted.',\n required: false,\n },\n configDirectory: {\n type: 'string',\n description: 'Config directory path',\n alias: 'cD',\n },\n configFile: {\n type: 'string',\n description: 'Name of one or more configuration files.',\n alias: 'cF',\n },\n },\n async run(ctx) {\n let packages = ctx.args.package ?\n ctx.args.package.split(',') :\n [];\n\n if (packages.length > 0) {\n packages = packages\n .map((pkg) => normalizePackageID(pkg))\n .filter((pkg) => Boolean(pkg))\n .map((pkg) => `${pkg}`);\n }\n\n if (packages.length === 0) {\n packages = Object.values(PackageID);\n }\n\n const promises : Promise<ChildProcess>[] = [];\n for (let i = 0; i < packages.length; i++) {\n promises.push(executePackageCommand(\n packages[i],\n ctx.args.command,\n {\n configFile: ctx.args.configFile,\n configDirectory: ctx.args.configDirectory,\n },\n ));\n }\n\n await Promise.all(promises);\n },\n });\n}\n","#!/usr/bin/env node\n\nimport { runMain } from 'citty';\nimport { createCLIEntryPointCommand } from './module';\n\nPromise.resolve()\n .then(() => createCLIEntryPointCommand())\n .then((command) => runMain(command));\n"],"names":["port","apiUrl","publicUrl","config","cwd","clientRaw","items","parts","childProcess","ctx","PackageName","PackageID","configDirectory","configFile","env","logDataStream","logErrorStream","shellCommand","file","extendEnvKeys","name","version","description","packages","Promise"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUO;;AAECA;;AAEAC;AACAC;AACJ;;AAGJ;;ACPO;AACH;;;;;AAKI;;AAEIA;AAGJ;AACJ;;AAGJ;;ACjBO;AACH;AAEA;;;;;;;;;AASC;;AAGGC;AACJ;AAEA;;;;AAIC;AAED;AACIA;AACJ;AAEA;;;;AAIC;AAED;AACIA;AACJ;AAEA;;;;AAIC;AAED;AACIA;AACJ;;AAGJ;;AC3CO;;;AAGCC;AACJ;;AAGI;;AAEA;AACJ;AAEA;AACA;AACA;;AAKQC;AACJ;;AAMIA;AACJ;AACJ;;AAGJ;;AC7BO;AACH;;;AAGI;AAEA;AACJ;;;AAII;AACJ;;;AAIA;AAEA;AACJ;AAEA;;AAEQ;AACJ;;AAGJ;;AC7CA;;;;;;;AASA;;ACCO;;AAEC;AACJ;;AAMA;AAEA;AACI;;AAEI;AACJ;;;;;AAWQ;AACJ;AACJ;;AAEA;AAEAC;AACJ;;AAGJ;;AC9CA;;;;;;AAQI;;AAGA;AACIC;AACJ;;AAGJ;;ACQO;;AAKC;;;AAGQ;AACA;AACJ;AACJ;;;AAIA;;;AAIA;;;AAIIC;AACI;AACI;AACJ;;AAGIC;AACJ;AACJ;AACJ;;AAEID;AACI;AACI;AACJ;;AAGI;AACJ;AAEA;AACA;AACIC;AACJ;AACJ;AACJ;AACJ;AACJ;;ACjEO;;ACEA;;;;AAIH;AAEA;;AAEA;;AAGJ;;ACtBA;;;;;;;;AAOYC;AAGX;AAEM;;;AAAKC;AAGX;;ACAM;AACH;AACI;AACA;AACIC;AACAC;AACJ;AAEA;AACIC;AACAC;;AAEA;AACAC;;AAEA;AACJ;AACJ;AAEA;;;;;AAMQ;;;AAGAC;AACJ;;AAGJ;;AAGI;;;AAIQC;AACAd;AACJ;AACJ;AACA;;;AAIA;;AAGIU;AACJ;;;AAIA;;;AAIA;;AAGJ;AAEAK;AACI;;AAGA;;AAGI;AACIL;AACJ;AACJ;;AAGJ;AACJ;;AC/EO;AACH;AACI;AACIF;AACAC;AACJ;AAEA;AACIE;;AAEA;AACAC;;AAEA;AACJ;AACJ;AAEA;AACI;;;;AAKI;AACAT;;AAEAA;AACJ;AAEAA;;AAGIA;AACJ;;AAGIA;AACJ;;AAGJ;AACJ;;AC1CO;;AAMC;AAA2B;AACvB;;AAMJ;AACA;AAA4B;AACxB;;AAMJ;AACJ;AAEA;AACJ;;AC7BO;AACH;;;;;AAKuB;AACf;AACJ;;;;AAGoB;AAChB;AACJ;AACJ;;AAGJ;;ACZO;AACH;;AAEuB;;AAIvB;;AAEQa;AACAC;AACAC;AACJ;;;;;;AAMI;;;;;AAKA;;;;;AAKA;;;;;AAKA;AACJ;AACA;AACI;;AAKIC;AAIJ;;;AAIA;AAEA;AACA;;;;AAOQ;AAER;;AAGJ;AACJ;AACJ;;AC3EAC"}
package/dist/module.d.ts CHANGED
@@ -1,22 +1,23 @@
1
1
  export declare function createCLIEntryPointCommand(): Promise<import("citty").CommandDef<{
2
- command: {
3
- type: "positional";
4
- description: string;
2
+ readonly command: {
3
+ readonly type: "positional";
4
+ readonly description: "The command which should be forwarded to the package.";
5
+ readonly required: true;
5
6
  };
6
- package: {
7
- type: "positional";
8
- description: string;
9
- required: false;
7
+ readonly package: {
8
+ readonly type: "positional";
9
+ readonly description: "The package, which should be targeted.";
10
+ readonly required: false;
10
11
  };
11
- configDirectory: {
12
- type: "string";
13
- description: string;
14
- alias: string;
12
+ readonly configDirectory: {
13
+ readonly type: "string";
14
+ readonly description: "Config directory path";
15
+ readonly alias: "cD";
15
16
  };
16
- configFile: {
17
- type: "string";
18
- description: string;
19
- alias: string;
17
+ readonly configFile: {
18
+ readonly type: "string";
19
+ readonly description: "Name of one or more configuration files.";
20
+ readonly alias: "cF";
20
21
  };
21
22
  }>>;
22
23
  //# sourceMappingURL=module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAcA,wBAAsB,0BAA0B;;;;;;;;;;;;;;;;;;;;IAiE/C"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAcA,wBAAsB,0BAA0B;;;;;;;;;;;;;;;;;;;;;IAkE/C"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "authup",
3
3
  "type": "module",
4
- "version": "1.0.0-beta.28",
4
+ "version": "1.0.0-beta.29",
5
5
  "description": "This is the CLI for the authup ecosystem.",
6
6
  "license": "Apache-2.0",
7
7
  "exports": {
@@ -45,11 +45,11 @@
45
45
  },
46
46
  "homepage": "https://github.com/authup/authup#readme",
47
47
  "dependencies": {
48
- "@authup/client-web": "^1.0.0-beta.28",
49
- "@authup/kit": "^1.0.0-beta.28",
50
- "@authup/core-kit": "^1.0.0-beta.28",
51
- "@authup/server-core": "^1.0.0-beta.28",
52
- "citty": "^0.1.6",
48
+ "@authup/client-web": "^1.0.0-beta.29",
49
+ "@authup/kit": "^1.0.0-beta.29",
50
+ "@authup/core-kit": "^1.0.0-beta.29",
51
+ "@authup/server-core": "^1.0.0-beta.29",
52
+ "citty": "^0.2.0",
53
53
  "chalk": "^5.6.2",
54
54
  "confinity": "^1.0.0-beta.1",
55
55
  "consola": "^3.4.0",
@@ -57,7 +57,7 @@
57
57
  "envix": "^1.5.0",
58
58
  "resolve-package-path": "^4.0.3",
59
59
  "smob": "^1.5.0",
60
- "zod": "^4.3.5"
60
+ "zod": "^4.3.6"
61
61
  },
62
62
  "publishConfig": {
63
63
  "access": "public"