@h3ravel/config 1.4.4 → 1.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -185,7 +185,7 @@ var ConfigServiceProvider = class extends __h3ravel_core.ServiceProvider {
185
185
  this.app.make("http.app").use((e) => {
186
186
  repo.set("app.url", e.url.origin);
187
187
  });
188
- this.commands([ConfigPublishCommand]);
188
+ this.registerCommands([ConfigPublishCommand]);
189
189
  }
190
190
  };
191
191
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["ConsoleCommand","path","Str","FileSystem","npath","Logger","app: Application","path","_app: Application","EnvParser","ServiceProvider","key"],"sources":["../src/Commands/ConfigPublishCommand.ts","../src/ConfigRepository.ts","../src/EnvLoader.ts","../src/Helpers.ts","../src/Providers/ConfigServiceProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class ConfigPublishCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `config:publish\n {name? : The name of the configuration file to publish}\n {--all : Publish all configuration files}\n {--force : Overwrite any existing configuration files}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Publish configuration files to your application'\n\n /**\n * List available config files\n */\n protected configs = [\n 'hashing'\n ] as const\n\n /**\n * Create a new seeder class\n */\n public async handle () {\n const all = this.option('all')\n if (all) {\n await Promise.all(this.configs.map(e => this.publish(e)))\n } else {\n const name = this.argument('name')\n if (!name) Logger.error('ERORR: enter a configuration name or pass the --all flag to publish all available configurations.')\n await this.publish(name)\n }\n }\n\n /**\n * Create a new seeder class\n */\n protected async publish (name: 'hashing') {\n const force = this.option('force')\n const path = base_path(`src/config/${Str.snake(name)}.ts`)\n\n // Check if the config already exists\n if (!force && await FileSystem.fileExists(path)) {\n this.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/config', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName(name))\n\n // Check if the stub exists\n if (!await FileSystem.fileExists(stubPath)) {\n this.error(`ERORR: Config [${name}] does not exist`)\n }\n\n await writeFile(path, await readFile(stubPath, 'utf-8'))\n\n this.info(\n `INFO: Config ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} published successfully.`\n )\n }\n\n /**\n * Get the configuration file to publish\n * \n * @param name \n * @returns \n */\n getStubName (name: 'hashing') {\n return `dist/stubs/${name}.stub`\n }\n}\n","import { Application, Registerer } from '@h3ravel/core'\nimport type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\nimport { safeDot, setNested } from '@h3ravel/support'\n\nimport path from 'node:path'\nimport { readdir } from 'node:fs/promises'\n\nexport class ConfigRepository {\n private loaded: boolean = false\n private configs: Record<string, Record<string, any>> = {}\n\n constructor(protected app: Application) { }\n\n // get<X extends Record<string, any>> (): X\n // get<X extends Record<string, any>, T extends Extract<keyof X, string>> (key: T): X[T]\n\n /**\n * Get the defined configurations\n */\n get<X extends Record<string, any>> (): X\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(this.configs, key) ?? def\n }\n\n /**\n * Modify the defined configurations\n */\n set<T extends string> (key: T, value: any): void {\n setNested(this.configs, key, value)\n }\n\n async load () {\n if (!this.loaded) {\n\n const configPath = this.app.getPath('config')\n\n globalThis.env = this.app.make('env')\n Registerer.register(this.app)\n\n const files = (await readdir(configPath)).filter((e) => {\n return !e.includes('.d.ts') && !e.includes('.d.cts') && !e.includes('.map')\n })\n\n for (let i = 0; i < files.length; i++) {\n const configModule = await import(path.join(configPath, files[i]))\n const name = files[i].replaceAll(/\\.ts|\\.js/g, '')\n if (typeof configModule.default === 'function') {\n this.configs[name] = configModule.default(this.app)\n }\n }\n\n this.loaded = true\n }\n return this\n }\n}\n","import type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\n\nimport { Application } from '@h3ravel/core'\nimport { EnvParser } from '@h3ravel/shared'\nimport { safeDot } from '@h3ravel/support'\n\nexport class EnvLoader {\n constructor(protected _app: Application) { }\n\n /**\n * Get the defined environment vars\n */\n get<X extends NodeJS.ProcessEnv> (): X\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(EnvParser.parse(process.env), key) ?? def\n }\n}\n","export class Helpers {\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { ConfigRepository, EnvLoader } from '..'\n\nimport { Bindings } from '@h3ravel/shared'\nimport { ConfigPublishCommand } from '../Commands/ConfigPublishCommand'\nimport { ServiceProvider } from '@h3ravel/core'\n\n/**\n * Loads configuration and environment files.\n * \n * Load .env and merge with config files.\n * Bind ConfigRepository to the container.\n * \n * Auto-Registered\n */\nexport class ConfigServiceProvider extends ServiceProvider {\n public static priority = 998\n // public static order = 'before:DatabaseServiceProvider';\n\n async register () {\n /**\n * Create singleton to load env\n */\n this.app.singleton('env', () => {\n const env = new EnvLoader(this.app).get\n globalThis.env = env\n return env\n })\n\n /**\n * Initialize the configuration through the repository\n */\n const repo = new ConfigRepository(this.app)\n await repo.load()\n\n /**\n * Create singleton to load configurations\n */\n this.app.singleton('config', () => {\n const config = {\n get: (key, def) => repo.get(key as any, def),\n set: repo.set\n } as Bindings['config']\n\n globalThis.config = ((key: string | Record<string, any>, def: any) => {\n if (!key || typeof key === 'string') {\n return config.get(key, def)\n }\n\n Object.entries(key).forEach(([key, value]) => {\n config.set(key, value)\n })\n }) as never\n\n return config\n })\n\n this.app.make('http.app').use(e => {\n repo.set('app.url', e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AK,MAAM;;;;AAKjB,OAAK,IAAI,UAAU,gBAAgB;GAC/B,MAAM,SAAS;IACX,MAAM,KAAK,QAAQ,KAAK,IAAI,KAAY,IAAI;IAC5C,KAAK,KAAK;IACb;AAED,cAAW,WAAW,KAAmC,QAAa;AAClE,QAAI,CAAC,OAAO,OAAO,QAAQ,SACvB,QAAO,OAAO,IAAI,KAAK,IAAI;AAG/B,WAAO,QAAQ,IAAI,CAAC,SAAS,CAACC,OAAK,WAAW;AAC1C,YAAO,IAAIA,OAAK,MAAM;MACxB;;AAGN,UAAO;IACT;AAEF,OAAK,IAAI,KAAK,WAAW,CAAC,KAAI,MAAK;AAC/B,QAAK,IAAI,WAAW,EAAE,IAAI,OAAO;IACnC;AAEF,OAAK,SAAS,CAAC,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.cjs","names":["ConsoleCommand","path","Str","FileSystem","npath","Logger","app: Application","path","_app: Application","EnvParser","ServiceProvider","key"],"sources":["../src/Commands/ConfigPublishCommand.ts","../src/ConfigRepository.ts","../src/EnvLoader.ts","../src/Helpers.ts","../src/Providers/ConfigServiceProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class ConfigPublishCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `config:publish\n {name? : The name of the configuration file to publish}\n {--all : Publish all configuration files}\n {--force : Overwrite any existing configuration files}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Publish configuration files to your application'\n\n /**\n * List available config files\n */\n protected configs = [\n 'hashing'\n ] as const\n\n /**\n * Create a new seeder class\n */\n public async handle () {\n const all = this.option('all')\n if (all) {\n await Promise.all(this.configs.map(e => this.publish(e)))\n } else {\n const name = this.argument('name')\n if (!name) Logger.error('ERORR: enter a configuration name or pass the --all flag to publish all available configurations.')\n await this.publish(name)\n }\n }\n\n /**\n * Create a new seeder class\n */\n protected async publish (name: 'hashing') {\n const force = this.option('force')\n const path = base_path(`src/config/${Str.snake(name)}.ts`)\n\n // Check if the config already exists\n if (!force && await FileSystem.fileExists(path)) {\n this.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/config', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName(name))\n\n // Check if the stub exists\n if (!await FileSystem.fileExists(stubPath)) {\n this.error(`ERORR: Config [${name}] does not exist`)\n }\n\n await writeFile(path, await readFile(stubPath, 'utf-8'))\n\n this.info(\n `INFO: Config ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} published successfully.`\n )\n }\n\n /**\n * Get the configuration file to publish\n * \n * @param name \n * @returns \n */\n getStubName (name: 'hashing') {\n return `dist/stubs/${name}.stub`\n }\n}\n","import { Application, Registerer } from '@h3ravel/core'\nimport type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\nimport { safeDot, setNested } from '@h3ravel/support'\n\nimport path from 'node:path'\nimport { readdir } from 'node:fs/promises'\n\nexport class ConfigRepository {\n private loaded: boolean = false\n private configs: Record<string, Record<string, any>> = {}\n\n constructor(protected app: Application) { }\n\n // get<X extends Record<string, any>> (): X\n // get<X extends Record<string, any>, T extends Extract<keyof X, string>> (key: T): X[T]\n\n /**\n * Get the defined configurations\n */\n get<X extends Record<string, any>> (): X\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(this.configs, key) ?? def\n }\n\n /**\n * Modify the defined configurations\n */\n set<T extends string> (key: T, value: any): void {\n setNested(this.configs, key, value)\n }\n\n async load () {\n if (!this.loaded) {\n\n const configPath = this.app.getPath('config')\n\n globalThis.env = this.app.make('env')\n Registerer.register(this.app)\n\n const files = (await readdir(configPath)).filter((e) => {\n return !e.includes('.d.ts') && !e.includes('.d.cts') && !e.includes('.map')\n })\n\n for (let i = 0; i < files.length; i++) {\n const configModule = await import(path.join(configPath, files[i]))\n const name = files[i].replaceAll(/\\.ts|\\.js/g, '')\n if (typeof configModule.default === 'function') {\n this.configs[name] = configModule.default(this.app)\n }\n }\n\n this.loaded = true\n }\n return this\n }\n}\n","import type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\n\nimport { Application } from '@h3ravel/core'\nimport { EnvParser } from '@h3ravel/shared'\nimport { safeDot } from '@h3ravel/support'\n\nexport class EnvLoader {\n constructor(protected _app: Application) { }\n\n /**\n * Get the defined environment vars\n */\n get<X extends NodeJS.ProcessEnv> (): X\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(EnvParser.parse(process.env), key) ?? def\n }\n}\n","export class Helpers {\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { ConfigRepository, EnvLoader } from '..'\n\nimport { Bindings } from '@h3ravel/shared'\nimport { ConfigPublishCommand } from '../Commands/ConfigPublishCommand'\nimport { ServiceProvider } from '@h3ravel/core'\n\n/**\n * Loads configuration and environment files.\n * \n * Load .env and merge with config files.\n * Bind ConfigRepository to the container.\n * \n * Auto-Registered\n */\nexport class ConfigServiceProvider extends ServiceProvider {\n public static priority = 998\n // public static order = 'before:DatabaseServiceProvider';\n\n async register () {\n /**\n * Create singleton to load env\n */\n this.app.singleton('env', () => {\n const env = new EnvLoader(this.app).get\n globalThis.env = env\n return env\n })\n\n /**\n * Initialize the configuration through the repository\n */\n const repo = new ConfigRepository(this.app)\n await repo.load()\n\n /**\n * Create singleton to load configurations\n */\n this.app.singleton('config', () => {\n const config = {\n get: (key, def) => repo.get(key as any, def),\n set: repo.set\n } as Bindings['config']\n\n globalThis.config = ((key: string | Record<string, any>, def: any) => {\n if (!key || typeof key === 'string') {\n return config.get(key, def)\n }\n\n Object.entries(key).forEach(([key, value]) => {\n config.set(key, value)\n })\n }) as never\n\n return config\n })\n\n this.app.make('http.app').use(e => {\n repo.set('app.url', e.url.origin)\n })\n\n this.registerCommands([ConfigPublishCommand])\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,IAAa,uBAAb,cAA0CA,8BAAe;;;;;;CAOrD,AAAU,YAAoB;;;;;;;;;;CAU9B,AAAU,cAAsB;;;;CAKhC,AAAU,UAAU,CAChB,UACH;;;;CAKD,MAAa,SAAU;AAEnB,MADY,KAAK,OAAO,MAAM,CAE1B,OAAM,QAAQ,IAAI,KAAK,QAAQ,KAAI,MAAK,KAAK,QAAQ,EAAE,CAAC,CAAC;OACtD;GACH,MAAM,OAAO,KAAK,SAAS,OAAO;AAClC,OAAI,CAAC,KAAM,yBAAO,MAAM,oGAAoG;AAC5H,SAAM,KAAK,QAAQ,KAAK;;;;;;CAOhC,MAAgB,QAAS,MAAiB;EACtC,MAAM,QAAQ,KAAK,OAAO,QAAQ;EAClC,MAAMC,SAAO,UAAU,cAAcC,sBAAI,MAAM,KAAK,CAAC,KAAK;AAG1D,MAAI,CAAC,SAAS,MAAMC,4BAAW,WAAWF,OAAK,CAC3C,MAAK,MAAM,UAAU,KAAK,iBAAiB;EAG/C,MAAM,YAAYE,4BAAW,cAAc,mBAAmB,KAAK,OAAO,IAAI,IAAI;EAClF,MAAM,WAAWC,kBAAM,KAAK,WAAW,KAAK,YAAY,KAAK,CAAC;AAG9D,MAAI,CAAC,MAAMD,4BAAW,WAAW,SAAS,CACtC,MAAK,MAAM,kBAAkB,KAAK,kBAAkB;AAGxD,wCAAgBF,QAAM,qCAAe,UAAU,QAAQ,CAAC;AAExD,OAAK,KACD,gBAAgBI,wBAAO,IAAI,IAAID,kBAAM,SAAS,QAAQ,KAAK,EAAEH,OAAK,CAAC,IAAI,QAAQ,MAAM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aAAa;GAC5B,MAAM,MAAM,IAAI,UAAU,KAAK,IAAI,CAAC;AACpC,cAAW,MAAM;AACjB,UAAO;IACT;;;;EAKF,MAAM,OAAO,IAAI,iBAAiB,KAAK,IAAI;AAC3C,QAAM,KAAK,MAAM;;;;AAKjB,OAAK,IAAI,UAAU,gBAAgB;GAC/B,MAAM,SAAS;IACX,MAAM,KAAK,QAAQ,KAAK,IAAI,KAAY,IAAI;IAC5C,KAAK,KAAK;IACb;AAED,cAAW,WAAW,KAAmC,QAAa;AAClE,QAAI,CAAC,OAAO,OAAO,QAAQ,SACvB,QAAO,OAAO,IAAI,KAAK,IAAI;AAG/B,WAAO,QAAQ,IAAI,CAAC,SAAS,CAACC,OAAK,WAAW;AAC1C,YAAO,IAAIA,OAAK,MAAM;MACxB;;AAGN,UAAO;IACT;AAEF,OAAK,IAAI,KAAK,WAAW,CAAC,KAAI,MAAK;AAC/B,QAAK,IAAI,WAAW,EAAE,IAAI,OAAO;IACnC;AAEF,OAAK,iBAAiB,CAAC,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -157,7 +157,7 @@ var ConfigServiceProvider = class extends ServiceProvider {
157
157
  this.app.make("http.app").use((e) => {
158
158
  repo.set("app.url", e.url.origin);
159
159
  });
160
- this.commands([ConfigPublishCommand]);
160
+ this.registerCommands([ConfigPublishCommand]);
161
161
  }
162
162
  };
163
163
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["app: Application","path","_app: Application","key"],"sources":["../src/Commands/ConfigPublishCommand.ts","../src/ConfigRepository.ts","../src/EnvLoader.ts","../src/Helpers.ts","../src/Providers/ConfigServiceProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class ConfigPublishCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `config:publish\n {name? : The name of the configuration file to publish}\n {--all : Publish all configuration files}\n {--force : Overwrite any existing configuration files}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Publish configuration files to your application'\n\n /**\n * List available config files\n */\n protected configs = [\n 'hashing'\n ] as const\n\n /**\n * Create a new seeder class\n */\n public async handle () {\n const all = this.option('all')\n if (all) {\n await Promise.all(this.configs.map(e => this.publish(e)))\n } else {\n const name = this.argument('name')\n if (!name) Logger.error('ERORR: enter a configuration name or pass the --all flag to publish all available configurations.')\n await this.publish(name)\n }\n }\n\n /**\n * Create a new seeder class\n */\n protected async publish (name: 'hashing') {\n const force = this.option('force')\n const path = base_path(`src/config/${Str.snake(name)}.ts`)\n\n // Check if the config already exists\n if (!force && await FileSystem.fileExists(path)) {\n this.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/config', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName(name))\n\n // Check if the stub exists\n if (!await FileSystem.fileExists(stubPath)) {\n this.error(`ERORR: Config [${name}] does not exist`)\n }\n\n await writeFile(path, await readFile(stubPath, 'utf-8'))\n\n this.info(\n `INFO: Config ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} published successfully.`\n )\n }\n\n /**\n * Get the configuration file to publish\n * \n * @param name \n * @returns \n */\n getStubName (name: 'hashing') {\n return `dist/stubs/${name}.stub`\n }\n}\n","import { Application, Registerer } from '@h3ravel/core'\nimport type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\nimport { safeDot, setNested } from '@h3ravel/support'\n\nimport path from 'node:path'\nimport { readdir } from 'node:fs/promises'\n\nexport class ConfigRepository {\n private loaded: boolean = false\n private configs: Record<string, Record<string, any>> = {}\n\n constructor(protected app: Application) { }\n\n // get<X extends Record<string, any>> (): X\n // get<X extends Record<string, any>, T extends Extract<keyof X, string>> (key: T): X[T]\n\n /**\n * Get the defined configurations\n */\n get<X extends Record<string, any>> (): X\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(this.configs, key) ?? def\n }\n\n /**\n * Modify the defined configurations\n */\n set<T extends string> (key: T, value: any): void {\n setNested(this.configs, key, value)\n }\n\n async load () {\n if (!this.loaded) {\n\n const configPath = this.app.getPath('config')\n\n globalThis.env = this.app.make('env')\n Registerer.register(this.app)\n\n const files = (await readdir(configPath)).filter((e) => {\n return !e.includes('.d.ts') && !e.includes('.d.cts') && !e.includes('.map')\n })\n\n for (let i = 0; i < files.length; i++) {\n const configModule = await import(path.join(configPath, files[i]))\n const name = files[i].replaceAll(/\\.ts|\\.js/g, '')\n if (typeof configModule.default === 'function') {\n this.configs[name] = configModule.default(this.app)\n }\n }\n\n this.loaded = true\n }\n return this\n }\n}\n","import type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\n\nimport { Application } from '@h3ravel/core'\nimport { EnvParser } from '@h3ravel/shared'\nimport { safeDot } from '@h3ravel/support'\n\nexport class EnvLoader {\n constructor(protected _app: Application) { }\n\n /**\n * Get the defined environment vars\n */\n get<X extends NodeJS.ProcessEnv> (): X\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(EnvParser.parse(process.env), key) ?? def\n }\n}\n","export class Helpers {\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { ConfigRepository, EnvLoader } from '..'\n\nimport { Bindings } from '@h3ravel/shared'\nimport { ConfigPublishCommand } from '../Commands/ConfigPublishCommand'\nimport { ServiceProvider } from '@h3ravel/core'\n\n/**\n * Loads configuration and environment files.\n * \n * Load .env and merge with config files.\n * Bind ConfigRepository to the container.\n * \n * Auto-Registered\n */\nexport class ConfigServiceProvider extends ServiceProvider {\n public static priority = 998\n // public static order = 'before:DatabaseServiceProvider';\n\n async register () {\n /**\n * Create singleton to load env\n */\n this.app.singleton('env', () => {\n const env = new EnvLoader(this.app).get\n globalThis.env = env\n return env\n })\n\n /**\n * Initialize the configuration through the repository\n */\n const repo = new ConfigRepository(this.app)\n await repo.load()\n\n /**\n * Create singleton to load configurations\n */\n this.app.singleton('config', () => {\n const config = {\n get: (key, def) => repo.get(key as any, def),\n set: repo.set\n } as Bindings['config']\n\n globalThis.config = ((key: string | Record<string, any>, def: any) => {\n if (!key || typeof key === 'string') {\n return config.get(key, def)\n }\n\n Object.entries(key).forEach(([key, value]) => {\n config.set(key, value)\n })\n }) as never\n\n return config\n })\n\n this.app.make('http.app').use(e => {\n repo.set('app.url', e.url.origin)\n })\n\n this.commands([ConfigPublishCommand])\n }\n}\n"],"mappings":";;;;;;;AAOA,IAAa,uBAAb,cAA0C,eAAe;;;;;;CAOrD,AAAU,YAAoB;;;;;;;;;;CAU9B,AAAU,cAAsB;;;;CAKhC,AAAU,UAAU,CAChB,UACH;;;;CAKD,MAAa,SAAU;AAEnB,MADY,KAAK,OAAO,MAAM,CAE1B,OAAM,QAAQ,IAAI,KAAK,QAAQ,KAAI,MAAK,KAAK,QAAQ,EAAE,CAAC,CAAC;OACtD;GACH,MAAM,OAAO,KAAK,SAAS,OAAO;AAClC,OAAI,CAAC,KAAM,QAAO,MAAM,oGAAoG;AAC5H,SAAM,KAAK,QAAQ,KAAK;;;;;;CAOhC,MAAgB,QAAS,MAAiB;EACtC,MAAM,QAAQ,KAAK,OAAO,QAAQ;EAClC,MAAM,OAAO,UAAU,cAAc,IAAI,MAAM,KAAK,CAAC,KAAK;AAG1D,MAAI,CAAC,SAAS,MAAM,WAAW,WAAW,KAAK,CAC3C,MAAK,MAAM,UAAU,KAAK,iBAAiB;EAG/C,MAAM,YAAY,WAAW,cAAc,mBAAmB,KAAK,OAAO,IAAI,IAAI;EAClF,MAAM,WAA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;;;AChDf,IAAa,YAAb,MAAuB;CACnB,YAAY,AAAUC,MAAmB;EAAnB;;CAOtB,IAA8D,KAAS,KAAgB;AACnF,SAAO,QAAQ,UAAU,MAAM,QAAQ,IAAI,EAAE,IAAI,IAAI;;;;;;ACf7D,IAAa,UAAb,MAAqB;;;;;;;;;;;;ACgBrB,IAAa,wBAAb,cAA2C,gBAAgB;CACvD,OAAc,WAAW;CAGzB,MAAM,WAAY;;;;AAId,OAAK,IAAI,UAAU,aAAa;GAC5B,MAAM,MAAM,IAAI,UAAU,KAAK,IAAI,CAAC;AACpC,cAAW,MAAM;AACjB,UAAO;IACT;;;;EAKF,MAAM,OAAO,IAAI,iBAAiB,KAAK,IAAI;AAC3C,QAAM,KAAK,MAAM;;;;AAKjB,OAAK,IAAI,UAAU,gBAAgB;GAC/B,MAAM,SAAS;IACX,MAAM,KAAK,QAAQ,KAAK,IAAI,KAAY,IAAI;IAC5C,KAAK,KAAK;IACb;AAED,cAAW,WAAW,KAAmC,QAAa;AAClE,QAAI,CAAC,OAAO,OAAO,QAAQ,SACvB,QAAO,OAAO,IAAI,KAAK,IAAI;AAG/B,WAAO,QAAQ,IAAI,CAAC,SAAS,CAACC,OAAK,WAAW;AAC1C,YAAO,IAAIA,OAAK,MAAM;MACxB;;AAGN,UAAO;IACT;AAEF,OAAK,IAAI,KAAK,WAAW,CAAC,KAAI,MAAK;AAC/B,QAAK,IAAI,WAAW,EAAE,IAAI,OAAO;IACnC;AAEF,OAAK,SAAS,CAAC,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","names":["app: Application","path","_app: Application","key"],"sources":["../src/Commands/ConfigPublishCommand.ts","../src/ConfigRepository.ts","../src/EnvLoader.ts","../src/Helpers.ts","../src/Providers/ConfigServiceProvider.ts"],"sourcesContent":["import { FileSystem, Logger } from '@h3ravel/shared'\nimport { readFile, writeFile } from 'node:fs/promises'\n\nimport { ConsoleCommand } from '@h3ravel/core'\nimport { Str } from '@h3ravel/support'\nimport npath from 'node:path'\n\nexport class ConfigPublishCommand extends ConsoleCommand {\n\n /**\n * The name and signature of the console command.\n *\n * @var string\n */\n protected signature: string = `config:publish\n {name? : The name of the configuration file to publish}\n {--all : Publish all configuration files}\n {--force : Overwrite any existing configuration files}\n `\n /**\n * The console command description.\n *\n * @var string\n */\n protected description: string = 'Publish configuration files to your application'\n\n /**\n * List available config files\n */\n protected configs = [\n 'hashing'\n ] as const\n\n /**\n * Create a new seeder class\n */\n public async handle () {\n const all = this.option('all')\n if (all) {\n await Promise.all(this.configs.map(e => this.publish(e)))\n } else {\n const name = this.argument('name')\n if (!name) Logger.error('ERORR: enter a configuration name or pass the --all flag to publish all available configurations.')\n await this.publish(name)\n }\n }\n\n /**\n * Create a new seeder class\n */\n protected async publish (name: 'hashing') {\n const force = this.option('force')\n const path = base_path(`src/config/${Str.snake(name)}.ts`)\n\n // Check if the config already exists\n if (!force && await FileSystem.fileExists(path)) {\n this.error(`ERORR: ${name} already exists`)\n }\n\n const dbPkgPath = FileSystem.findModulePkg('@h3ravel/config', this.kernel.cwd) ?? ''\n const stubPath = npath.join(dbPkgPath, this.getStubName(name))\n\n // Check if the stub exists\n if (!await FileSystem.fileExists(stubPath)) {\n this.error(`ERORR: Config [${name}] does not exist`)\n }\n\n await writeFile(path, await readFile(stubPath, 'utf-8'))\n\n this.info(\n `INFO: Config ${Logger.log(`[${npath.relative(process.cwd(), path)}]`, 'bold', false)} published successfully.`\n )\n }\n\n /**\n * Get the configuration file to publish\n * \n * @param name \n * @returns \n */\n getStubName (name: 'hashing') {\n return `dist/stubs/${name}.stub`\n }\n}\n","import { Application, Registerer } from '@h3ravel/core'\nimport type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\nimport { safeDot, setNested } from '@h3ravel/support'\n\nimport path from 'node:path'\nimport { readdir } from 'node:fs/promises'\n\nexport class ConfigRepository {\n private loaded: boolean = false\n private configs: Record<string, Record<string, any>> = {}\n\n constructor(protected app: Application) { }\n\n // get<X extends Record<string, any>> (): X\n // get<X extends Record<string, any>, T extends Extract<keyof X, string>> (key: T): X[T]\n\n /**\n * Get the defined configurations\n */\n get<X extends Record<string, any>> (): X\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends Record<string, any>, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(this.configs, key) ?? def\n }\n\n /**\n * Modify the defined configurations\n */\n set<T extends string> (key: T, value: any): void {\n setNested(this.configs, key, value)\n }\n\n async load () {\n if (!this.loaded) {\n\n const configPath = this.app.getPath('config')\n\n globalThis.env = this.app.make('env')\n Registerer.register(this.app)\n\n const files = (await readdir(configPath)).filter((e) => {\n return !e.includes('.d.ts') && !e.includes('.d.cts') && !e.includes('.map')\n })\n\n for (let i = 0; i < files.length; i++) {\n const configModule = await import(path.join(configPath, files[i]))\n const name = files[i].replaceAll(/\\.ts|\\.js/g, '')\n if (typeof configModule.default === 'function') {\n this.configs[name] = configModule.default(this.app)\n }\n }\n\n this.loaded = true\n }\n return this\n }\n}\n","import type { DotNestedKeys, DotNestedValue } from '@h3ravel/shared'\n\nimport { Application } from '@h3ravel/core'\nimport { EnvParser } from '@h3ravel/shared'\nimport { safeDot } from '@h3ravel/support'\n\nexport class EnvLoader {\n constructor(protected _app: Application) { }\n\n /**\n * Get the defined environment vars\n */\n get<X extends NodeJS.ProcessEnv> (): X\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key: K, def?: any): DotNestedValue<X, K>\n get<X extends NodeJS.ProcessEnv, K extends DotNestedKeys<X>> (key?: K, def?: any): any {\n return safeDot(EnvParser.parse(process.env), key) ?? def\n }\n}\n","export class Helpers {\n}\n","/// <reference path=\"../../../core/src/app.globals.d.ts\" />\n\nimport { ConfigRepository, EnvLoader } from '..'\n\nimport { Bindings } from '@h3ravel/shared'\nimport { ConfigPublishCommand } from '../Commands/ConfigPublishCommand'\nimport { ServiceProvider } from '@h3ravel/core'\n\n/**\n * Loads configuration and environment files.\n * \n * Load .env and merge with config files.\n * Bind ConfigRepository to the container.\n * \n * Auto-Registered\n */\nexport class ConfigServiceProvider extends ServiceProvider {\n public static priority = 998\n // public static order = 'before:DatabaseServiceProvider';\n\n async register () {\n /**\n * Create singleton to load env\n */\n this.app.singleton('env', () => {\n const env = new EnvLoader(this.app).get\n globalThis.env = env\n return env\n })\n\n /**\n * Initialize the configuration through the repository\n */\n const repo = new ConfigRepository(this.app)\n await repo.load()\n\n /**\n * Create singleton to load configurations\n */\n this.app.singleton('config', () => {\n const config = {\n get: (key, def) => repo.get(key as any, def),\n set: repo.set\n } as Bindings['config']\n\n globalThis.config = ((key: string | Record<string, any>, def: any) => {\n if (!key || typeof key === 'string') {\n return config.get(key, def)\n }\n\n Object.entries(key).forEach(([key, value]) => {\n config.set(key, value)\n })\n }) as never\n\n return config\n })\n\n this.app.make('http.app').use(e => {\n repo.set('app.url', e.url.origin)\n })\n\n this.registerCommands([ConfigPublishCommand])\n }\n}\n"],"mappings":";;;;;;;AAOA,IAAa,uBAAb,cAA0C,eAAe;;;;;;CAOrD,AAAU,YAAoB;;;;;;;;;;CAU9B,AAAU,cAAsB;;;;CAKhC,AAAU,UAAU,CAChB,UACH;;;;CAKD,MAAa,SAAU;AAEnB,MADY,KAAK,OAAO,MAAM,CAE1B,OAAM,QAAQ,IAAI,KAAK,QAAQ,KAAI,MAAK,KAAK,QAAQ,EAAE,CAAC,CAAC;OACtD;GACH,MAAM,OAAO,KAAK,SAAS,OAAO;AAClC,OAAI,CAAC,KAAM,QAAO,MAAM,oGAAoG;AAC5H,SAAM,KAAK,QAAQ,KAAK;;;;;;CAOhC,MAAgB,QAAS,MAAiB;EACtC,MAAM,QAAQ,KAAK,OAAO,QAAQ;EAClC,MAAM,OAAO,UAAU,cAAc,IAAI,MAAM,KAAK,CAAC,KAAK;AAG1D,MAAI,CAAC,SAAS,MAAM,WAAW,WAAW,KAAK,CAC3C,MAAK,MAAM,UAAU,KAAK,iBAAiB;EAG/C,MAAM,YA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,aAAa,QAAQ,KAAK,IAAI;;AAI3D,QAAK,SAAS;;AAElB,SAAO;;;;;;AChDf,IAAa,YAAb,MAAuB;CACnB,YAAY,AAAUC,MAAmB;EAAnB;;CAOtB,IAA8D,KAAS,KAAgB;AACnF,SAAO,QAAQ,UAAU,MAAM,QAAQ,IAAI,EAAE,IAAI,IAAI;;;;;;ACf7D,IAAa,UAAb,MAAqB;;;;;;;;;;;;ACgBrB,IAAa,wBAAb,cAA2C,gBAAgB;CACvD,OAAc,WAAW;CAGzB,MAAM,WAAY;;;;AAId,OAAK,IAAI,UAAU,aAAa;GAC5B,MAAM,MAAM,IAAI,UAAU,KAAK,IAAI,CAAC;AACpC,cAAW,MAAM;AACjB,UAAO;IACT;;;;EAKF,MAAM,OAAO,IAAI,iBAAiB,KAAK,IAAI;AAC3C,QAAM,KAAK,MAAM;;;;AAKjB,OAAK,IAAI,UAAU,gBAAgB;GAC/B,MAAM,SAAS;IACX,MAAM,KAAK,QAAQ,KAAK,IAAI,KAAY,IAAI;IAC5C,KAAK,KAAK;IACb;AAED,cAAW,WAAW,KAAmC,QAAa;AAClE,QAAI,CAAC,OAAO,OAAO,QAAQ,SACvB,QAAO,OAAO,IAAI,KAAK,IAAI;AAG/B,WAAO,QAAQ,IAAI,CAAC,SAAS,CAACC,OAAK,WAAW;AAC1C,YAAO,IAAIA,OAAK,MAAM;MACxB;;AAGN,UAAO;IACT;AAEF,OAAK,IAAI,KAAK,WAAW,CAAC,KAAI,MAAK;AAC/B,QAAK,IAAI,WAAW,EAAE,IAAI,OAAO;IACnC;AAEF,OAAK,iBAAiB,CAAC,qBAAqB,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "@h3ravel/config",
3
- "version": "1.4.4",
3
+ "version": "1.4.5",
4
4
  "description": "Environment/config loading and management system for H3ravel.",
5
+ "h3ravel": {
6
+ "providers": [
7
+ "ConfigServiceProvider"
8
+ ]
9
+ },
5
10
  "type": "module",
6
11
  "main": "./dist/index.js",
7
12
  "types": "./dist/index.d.ts",
@@ -36,13 +41,13 @@
36
41
  "laravel"
37
42
  ],
38
43
  "dependencies": {
39
- "@h3ravel/shared": "^0.22.1",
40
- "@h3ravel/support": "^0.14.0"
44
+ "@h3ravel/shared": "^0.22.2",
45
+ "@h3ravel/support": "^0.14.1"
41
46
  },
42
47
  "devDependencies": {
43
48
  "tsx": "^4.20.5",
44
49
  "typescript": "^5.9.2",
45
- "@h3ravel/core": "^1.15.0"
50
+ "@h3ravel/core": "^1.16.0"
46
51
  },
47
52
  "scripts": {
48
53
  "barrel": "barrelsby --directory src --delete --singleQuotes",