alepha 0.14.1 → 0.14.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/README.md +3 -3
- package/dist/api/audits/index.d.ts +342 -342
- package/dist/api/audits/index.d.ts.map +1 -1
- package/dist/api/audits/index.js.map +1 -1
- package/dist/api/files/index.js.map +1 -1
- package/dist/api/jobs/index.d.ts +161 -161
- package/dist/api/jobs/index.js.map +1 -1
- package/dist/api/parameters/index.js.map +1 -1
- package/dist/api/users/index.d.ts +791 -791
- package/dist/api/users/index.d.ts.map +1 -1
- package/dist/api/users/index.js +4 -0
- package/dist/api/users/index.js.map +1 -1
- package/dist/api/verifications/index.d.ts +128 -128
- package/dist/api/verifications/index.d.ts.map +1 -1
- package/dist/batch/index.js.map +1 -1
- package/dist/cache/core/index.js.map +1 -1
- package/dist/cli/index.d.ts +173 -167
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +427 -409
- package/dist/cli/index.js.map +1 -1
- package/dist/command/index.d.ts +5 -5
- package/dist/command/index.js.map +1 -1
- package/dist/core/index.browser.js.map +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +7 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.native.js +7 -6
- package/dist/core/index.native.js.map +1 -1
- package/dist/datetime/index.js.map +1 -1
- package/dist/fake/index.js.map +1 -1
- package/dist/file/index.js.map +1 -1
- package/dist/lock/redis/index.js.map +1 -1
- package/dist/logger/index.js.map +1 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/orm/index.browser.js +26 -5
- package/dist/orm/index.browser.js.map +1 -1
- package/dist/orm/index.d.ts +115 -90
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +37 -12
- package/dist/orm/index.js.map +1 -1
- package/dist/redis/index.js.map +1 -1
- package/dist/retry/index.js.map +1 -1
- package/dist/router/index.js.map +1 -1
- package/dist/scheduler/index.d.ts +6 -6
- package/dist/scheduler/index.js.map +1 -1
- package/dist/security/index.d.ts +28 -28
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/index.js.map +1 -1
- package/dist/server/auth/index.d.ts +155 -155
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/cache/index.js.map +1 -1
- package/dist/server/cookies/index.browser.js.map +1 -1
- package/dist/server/cookies/index.js.map +1 -1
- package/dist/server/core/index.browser.js.map +1 -1
- package/dist/server/core/index.js.map +1 -1
- package/dist/server/health/index.d.ts +17 -17
- package/dist/server/helmet/index.js.map +1 -1
- package/dist/server/links/index.browser.js.map +1 -1
- package/dist/server/links/index.js.map +1 -1
- package/dist/server/multipart/index.js.map +1 -1
- package/dist/server/rate-limit/index.js.map +1 -1
- package/dist/server/security/index.d.ts +9 -9
- package/dist/server/security/index.js.map +1 -1
- package/dist/server/swagger/index.js.map +1 -1
- package/dist/thread/index.js.map +1 -1
- package/dist/topic/core/index.js.map +1 -1
- package/dist/vite/index.js.map +1 -1
- package/dist/websocket/index.browser.js.map +1 -1
- package/dist/websocket/index.d.ts +7 -7
- package/dist/websocket/index.js.map +1 -1
- package/package.json +3 -3
- package/src/api/users/index.ts +4 -0
- package/src/cli/apps/AlephaCli.ts +31 -14
- package/src/cli/apps/AlephaPackageBuilderCli.ts +2 -1
- package/src/cli/assets/appRouterTs.ts +1 -1
- package/src/cli/commands/{ViteCommands.ts → build.ts} +2 -105
- package/src/cli/commands/{ChangelogCommands.ts → changelog.ts} +7 -22
- package/src/cli/commands/clean.ts +14 -0
- package/src/cli/commands/{DrizzleCommands.ts → db.ts} +10 -117
- package/src/cli/commands/{DeployCommands.ts → deploy.ts} +1 -1
- package/src/cli/commands/dev.ts +57 -0
- package/src/cli/commands/format.ts +17 -0
- package/src/cli/commands/{CoreCommands.ts → init.ts} +2 -40
- package/src/cli/commands/lint.ts +17 -0
- package/src/cli/commands/root.ts +32 -0
- package/src/cli/commands/run.ts +24 -0
- package/src/cli/commands/test.ts +42 -0
- package/src/cli/commands/typecheck.ts +19 -0
- package/src/cli/commands/{VerifyCommands.ts → verify.ts} +1 -13
- package/src/cli/defineConfig.ts +10 -1
- package/src/cli/index.ts +16 -7
- package/src/cli/services/GitMessageParser.ts +1 -1
- package/src/core/Alepha.ts +7 -4
- package/src/orm/index.browser.ts +1 -1
- package/src/orm/index.ts +10 -6
- package/src/orm/providers/{PostgresTypeProvider.ts → DatabaseTypeProvider.ts} +25 -3
- package/src/cli/commands/BiomeCommands.ts +0 -29
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["keysToDelete: string[]"],"sources":["../../../src/cache/core/errors/CacheError.ts","../../../src/cache/core/providers/CacheProvider.ts","../../../src/cache/core/providers/MemoryCacheProvider.ts","../../../src/cache/core/primitives/$cache.ts","../../../src/cache/core/index.ts"],"sourcesContent":["import { AlephaError } from \"alepha\";\n\nexport class CacheError extends AlephaError {}\n","/**\n * Cache provider interface.\n *\n * All methods are asynchronous and return promises.\n * Values are stored as Uint8Array.\n */\nexport abstract class CacheProvider {\n /**\n * Get the value of a key.\n *\n * @param name Cache name, used to group keys. Should be Redis-like \"some:group:name\" format.\n * @param key The key of the value to get.\n *\n * @return The value of the key, or undefined if the key does not exist.\n */\n public abstract get(\n name: string,\n key: string,\n ): Promise<Uint8Array | undefined>;\n\n /**\n * Set the string value of a key.\n *\n * @param name Cache name, used to group keys. Should be Redis-like \"some:group:name\" format.\n * @param key The key of the value to set.\n * @param value The value to set.\n * @param ttl The time-to-live of the key, in milliseconds.\n *\n * @return The value of the key.\n */\n public abstract set(\n name: string,\n key: string,\n value: Uint8Array,\n ttl?: number,\n ): Promise<Uint8Array>;\n\n /**\n * Remove the specified keys.\n *\n * @param name Cache name, used to group keys. Should be Redis-like \"some:group:name\" format.\n * @param keys The keys to delete.\n */\n public abstract del(name: string, ...keys: string[]): Promise<void>;\n\n public abstract has(name: string, key: string): Promise<boolean>;\n\n public abstract keys(name: string, filter?: string): Promise<string[]>;\n\n /**\n * Remove all keys from all cache names.\n */\n public abstract clear(): Promise<void>;\n}\n","import { $inject } from \"alepha\";\nimport { DateTimeProvider, type Timeout } from \"alepha/datetime\";\nimport { $logger } from \"alepha/logger\";\nimport type { CacheProvider } from \"./CacheProvider.ts\";\n\ntype CacheName = string;\ntype CacheKey = string;\ntype CacheValue = {\n data?: Uint8Array;\n timeout?: Timeout;\n};\n\nexport class MemoryCacheProvider implements CacheProvider {\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly log = $logger();\n\n protected store: Record<CacheName, Record<CacheKey, CacheValue>> = {};\n\n public async get(name: string, key: string): Promise<Uint8Array | undefined> {\n return this.store[name]?.[key]?.data;\n }\n\n public async set(\n name: string,\n key: string,\n value: Uint8Array,\n ttl?: number,\n ): Promise<Uint8Array> {\n if (this.store[name] == null) {\n this.store[name] = {};\n }\n\n this.store[name][key] ??= {};\n this.store[name][key].data = value;\n\n this.log.debug(`Setting cache for name`, { name, key, ttl });\n\n // clear previous timeout if exists\n if (this.store[name][key].timeout) {\n this.dateTimeProvider.clearTimeout(this.store[name][key].timeout);\n this.store[name][key].timeout = undefined;\n }\n\n if (ttl) {\n this.store[name][key].timeout = this.dateTimeProvider.createTimeout(\n () => this.del(name, key),\n ttl,\n );\n }\n\n return this.store[name][key].data;\n }\n\n public async del(name: string, ...keys: string[]): Promise<void> {\n // delete all keys in name\n if (keys.length === 0) {\n this.log.debug(`Deleting all cache for name`, { name });\n\n if (this.store[name]) {\n for (const key of Object.keys(this.store[name])) {\n const timeout = this.store[name][key]?.timeout;\n if (timeout) {\n this.dateTimeProvider.clearTimeout(timeout);\n }\n }\n }\n delete this.store[name];\n return;\n }\n\n this.log.debug(`Deleting cache for name`, { name, keys });\n\n // delete specific keys in name\n for (const key of keys) {\n if (this.store[name] == null) break;\n\n const timeout = this.store[name][key]?.timeout;\n if (timeout) {\n this.dateTimeProvider.clearTimeout(timeout);\n }\n\n delete this.store[name][key];\n }\n\n if (Object.keys(this.store[name] ?? {}).length === 0) {\n // if name is empty, delete it\n delete this.store[name];\n }\n }\n\n public async has(name: string, key: string): Promise<boolean> {\n return this.store[name]?.[key]?.data != null;\n }\n\n public async keys(name: string, filter?: string): Promise<string[]> {\n const store = this.store[name] ?? {};\n const keys = Object.keys(store);\n if (filter) {\n return keys.filter((key) => key.startsWith(filter));\n }\n return keys;\n }\n\n public async clear(): Promise<void> {\n this.log.debug(\"Clearing all cache\");\n\n // Clear all timeouts before clearing the store\n for (const name of Object.keys(this.store)) {\n for (const key of Object.keys(this.store[name])) {\n const timeout = this.store[name][key]?.timeout;\n if (timeout) {\n this.dateTimeProvider.clearTimeout(timeout);\n }\n }\n }\n\n this.store = {};\n }\n}\n","import {\n $env,\n $inject,\n createPrimitive,\n type InstantiableClass,\n KIND,\n Primitive,\n t,\n} from \"alepha\";\nimport { DateTimeProvider, type DurationLike } from \"alepha/datetime\";\nimport { CacheError } from \"../errors/CacheError.ts\";\nimport { CacheProvider } from \"../providers/CacheProvider.ts\";\nimport { MemoryCacheProvider } from \"../providers/MemoryCacheProvider.ts\";\n\n/**\n * Creates a cache primitive for high-performance data caching with automatic management.\n *\n * Provides a caching layer that improves application performance by storing frequently accessed\n * data in memory or external stores like Redis, with support for both function result caching\n * and manual cache operations.\n *\n * **Key Features**\n * - Automatic function result caching based on input parameters\n * - Multiple storage backends (in-memory, Redis, custom providers)\n * - Intelligent serialization for JSON, strings, and binary data\n * - Configurable TTL with automatic expiration\n * - Pattern-based cache invalidation with wildcard support\n * - Environment controls to enable/disable caching\n *\n * **Storage Backends**\n * - Memory: Fast in-memory cache (default for development)\n * - Redis: Distributed cache for production environments\n * - Custom providers: Implement your own storage backend\n *\n * @example\n * ```ts\n * class DataService {\n * // Function result caching\n * getUserData = $cache({\n * name: \"user-data\",\n * ttl: [10, \"minutes\"],\n * handler: async (userId: string) => {\n * return await database.users.findById(userId);\n * }\n * });\n *\n * // Manual cache operations\n * sessionCache = $cache<UserSession>({\n * name: \"sessions\",\n * ttl: [1, \"hour\"]\n * });\n *\n * async storeSession(id: string, session: UserSession) {\n * await this.sessionCache.set(id, session);\n * }\n *\n * async invalidateUserSessions(userId: string) {\n * await this.sessionCache.invalidate(`user:${userId}:*`);\n * }\n * }\n * ```\n */\nexport const $cache = <TReturn = string, TParameter extends any[] = any[]>(\n options: CachePrimitiveOptions<TReturn, TParameter> = {},\n): CachePrimitiveFn<TReturn, TParameter> => {\n const instance = createPrimitive(\n CachePrimitive<TReturn, TParameter>,\n options,\n );\n const fn = (...args: TParameter): Promise<TReturn> => instance.run(...args);\n return Object.setPrototypeOf(fn, instance) as CachePrimitiveFn<\n TReturn,\n TParameter\n >;\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface CachePrimitiveOptions<\n TReturn = any,\n TParameter extends any[] = any[],\n> {\n /**\n * The cache name. This is useful for invalidating multiple caches at once.\n *\n * Store key as `cache:$name:$key`.\n *\n * @default Name of the key of the class.\n */\n name?: string;\n\n /**\n * Function which returns cached data.\n */\n handler?: (...args: TParameter) => TReturn;\n\n /**\n * The key generator for the cache.\n * If not provided, the arguments will be json.stringify().\n */\n key?: (...args: TParameter) => string;\n\n /**\n * The store provider for the cache.\n * If not provided, the default store provider will be used.\n */\n provider?: InstantiableClass<CacheProvider> | \"memory\";\n\n /**\n * The time-to-live for the cache in seconds.\n * Set 0 to skip expiration.\n *\n * @default 300 (5 minutes).\n */\n ttl?: DurationLike;\n\n /**\n * If the cache is disabled.\n */\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst envSchema = t.object({\n CACHE_ENABLED: t.boolean({ default: true }),\n CACHE_DEFAULT_TTL: t.number({\n default: 300, // 5 minutes\n description: \"The default time to live for cache entries. In seconds.\",\n }),\n});\n\nexport class CachePrimitive<\n TReturn = any,\n TParameter extends any[] = any[],\n> extends Primitive<CachePrimitiveOptions<TReturn, TParameter>> {\n protected readonly env = $env(envSchema);\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly provider = this.$provider();\n protected encoder: TextEncoder = new TextEncoder();\n protected decoder: TextDecoder = new TextDecoder();\n protected codes = {\n BINARY: 0x01,\n JSON: 0x02,\n STRING: 0x03,\n };\n\n public get container(): string {\n return (\n this.options.name ??\n `${this.config.service.name}:${this.config.propertyKey}`\n );\n }\n\n public async run(...args: TParameter): Promise<TReturn> {\n const handler = this.options.handler;\n if (!handler) {\n throw new Error(\"Cache handler is not defined.\");\n }\n\n const key = this.key(...args);\n const cached = await this.get(key);\n if (cached) {\n return cached;\n }\n\n const result = await handler(...args);\n // note: when exception occurs, don't cache the result\n\n await this.set(key, result);\n\n return result;\n }\n\n public key(...args: TParameter): string {\n return this.options.key ? this.options.key(...args) : JSON.stringify(args);\n }\n\n public async invalidate(...keys: string[]): Promise<void> {\n const keysToDelete: string[] = [];\n\n for (const key of keys) {\n if (key.endsWith(\"*\")) {\n const result = await this.provider.keys(\n this.container,\n key.slice(0, -1),\n );\n keysToDelete.push(...result);\n } else {\n keysToDelete.push(key);\n }\n }\n\n await this.provider.del(this.container, ...keysToDelete);\n }\n\n public async set(\n key: string,\n value: TReturn,\n ttl?: DurationLike,\n ): Promise<void> {\n const px = this.dateTimeProvider\n .duration(\n ttl ?? this.options.ttl ?? [this.env.CACHE_DEFAULT_TTL, \"seconds\"],\n )\n .as(\"milliseconds\");\n\n await this.provider.set(\n this.container,\n key,\n this.serialize(value),\n px > 0 ? px : undefined,\n );\n }\n\n public async get(key: string): Promise<TReturn | undefined> {\n if (\n !this.alepha.isStarted() ||\n this.options.disabled ||\n !this.env.CACHE_ENABLED\n ) {\n return undefined;\n }\n\n const data = await this.provider.get(this.container, key);\n if (data) {\n return await this.deserialize<TReturn>(data);\n }\n\n return undefined;\n }\n\n protected serialize<TReturn>(value: TReturn): Uint8Array {\n if (value instanceof Uint8Array) {\n return new Uint8Array([this.codes.BINARY, ...value]); // TODO: check if copy is ok?\n }\n\n if (typeof value === \"string\") {\n return new Uint8Array([this.codes.STRING, ...this.encoder.encode(value)]);\n }\n\n return new Uint8Array([\n this.codes.JSON,\n ...this.encoder.encode(JSON.stringify(value)),\n ]);\n }\n\n protected async deserialize<TReturn>(\n uint8Array: Uint8Array,\n ): Promise<TReturn> {\n const type = uint8Array[0];\n const payload = uint8Array.slice(1);\n\n if (type === this.codes.BINARY) {\n return payload as TReturn;\n }\n if (type === this.codes.JSON) {\n return JSON.parse(this.decoder.decode(payload)) as TReturn;\n }\n if (type === this.codes.STRING) {\n return this.decoder.decode(payload) as TReturn;\n }\n\n throw new CacheError(`Unknown serialization type: ${type}`);\n }\n\n protected $provider(): CacheProvider {\n if (!this.options.provider) {\n return this.alepha.inject(CacheProvider);\n }\n\n if (this.options.provider === \"memory\") {\n return this.alepha.inject(MemoryCacheProvider);\n }\n\n return this.alepha.inject(this.options.provider);\n }\n}\n\nexport interface CachePrimitiveFn<\n TReturn = any,\n TParameter extends any[] = any[],\n> extends CachePrimitive<TReturn, TParameter> {\n /**\n * Run the cache primitive with the provided arguments.\n */\n (...args: TParameter): Promise<TReturn>;\n}\n\n$cache[KIND] = CachePrimitive;\n","import { $module } from \"alepha\";\nimport { $cache } from \"./primitives/$cache.ts\";\nimport { CacheProvider } from \"./providers/CacheProvider.ts\";\nimport { MemoryCacheProvider } from \"./providers/MemoryCacheProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./primitives/$cache.ts\";\nexport * from \"./providers/CacheProvider.ts\";\nexport * from \"./providers/MemoryCacheProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Provides high-performance caching capabilities for Alepha applications with configurable TTL and multiple storage backends.\n *\n * The cache module enables declarative caching through the `$cache` primitive, allowing you to cache method results,\n * API responses, or computed values with automatic invalidation and type safety. It supports both in-memory and\n * persistent storage backends for different performance and durability requirements.\n *\n * @see {@link $cache}\n * @see {@link CacheProvider}\n * @module alepha.cache\n */\nexport const AlephaCache = $module({\n name: \"alepha.cache\",\n primitives: [$cache],\n services: [CacheProvider, MemoryCacheProvider],\n register: (alepha) =>\n alep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;;;;;;;;;;;;;ACzQf,MAAa,cAAc,QAAQ;CACjC,MAAM;CACN,YAAY,CAAC,OAAO;CACpB,UAAU,CAAC,eAAe,oBAAoB;CAC9C,WAAW,WACT,OAAO,KAAK;EACV,UAAU;EACV,SAAS;EACT,KAAK;EACN,CAAC;CACL,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/cache/core/errors/CacheError.ts","../../../src/cache/core/providers/CacheProvider.ts","../../../src/cache/core/providers/MemoryCacheProvider.ts","../../../src/cache/core/primitives/$cache.ts","../../../src/cache/core/index.ts"],"sourcesContent":["import { AlephaError } from \"alepha\";\n\nexport class CacheError extends AlephaError {}\n","/**\n * Cache provider interface.\n *\n * All methods are asynchronous and return promises.\n * Values are stored as Uint8Array.\n */\nexport abstract class CacheProvider {\n /**\n * Get the value of a key.\n *\n * @param name Cache name, used to group keys. Should be Redis-like \"some:group:name\" format.\n * @param key The key of the value to get.\n *\n * @return The value of the key, or undefined if the key does not exist.\n */\n public abstract get(\n name: string,\n key: string,\n ): Promise<Uint8Array | undefined>;\n\n /**\n * Set the string value of a key.\n *\n * @param name Cache name, used to group keys. Should be Redis-like \"some:group:name\" format.\n * @param key The key of the value to set.\n * @param value The value to set.\n * @param ttl The time-to-live of the key, in milliseconds.\n *\n * @return The value of the key.\n */\n public abstract set(\n name: string,\n key: string,\n value: Uint8Array,\n ttl?: number,\n ): Promise<Uint8Array>;\n\n /**\n * Remove the specified keys.\n *\n * @param name Cache name, used to group keys. Should be Redis-like \"some:group:name\" format.\n * @param keys The keys to delete.\n */\n public abstract del(name: string, ...keys: string[]): Promise<void>;\n\n public abstract has(name: string, key: string): Promise<boolean>;\n\n public abstract keys(name: string, filter?: string): Promise<string[]>;\n\n /**\n * Remove all keys from all cache names.\n */\n public abstract clear(): Promise<void>;\n}\n","import { $inject } from \"alepha\";\nimport { DateTimeProvider, type Timeout } from \"alepha/datetime\";\nimport { $logger } from \"alepha/logger\";\nimport type { CacheProvider } from \"./CacheProvider.ts\";\n\ntype CacheName = string;\ntype CacheKey = string;\ntype CacheValue = {\n data?: Uint8Array;\n timeout?: Timeout;\n};\n\nexport class MemoryCacheProvider implements CacheProvider {\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly log = $logger();\n\n protected store: Record<CacheName, Record<CacheKey, CacheValue>> = {};\n\n public async get(name: string, key: string): Promise<Uint8Array | undefined> {\n return this.store[name]?.[key]?.data;\n }\n\n public async set(\n name: string,\n key: string,\n value: Uint8Array,\n ttl?: number,\n ): Promise<Uint8Array> {\n if (this.store[name] == null) {\n this.store[name] = {};\n }\n\n this.store[name][key] ??= {};\n this.store[name][key].data = value;\n\n this.log.debug(`Setting cache for name`, { name, key, ttl });\n\n // clear previous timeout if exists\n if (this.store[name][key].timeout) {\n this.dateTimeProvider.clearTimeout(this.store[name][key].timeout);\n this.store[name][key].timeout = undefined;\n }\n\n if (ttl) {\n this.store[name][key].timeout = this.dateTimeProvider.createTimeout(\n () => this.del(name, key),\n ttl,\n );\n }\n\n return this.store[name][key].data;\n }\n\n public async del(name: string, ...keys: string[]): Promise<void> {\n // delete all keys in name\n if (keys.length === 0) {\n this.log.debug(`Deleting all cache for name`, { name });\n\n if (this.store[name]) {\n for (const key of Object.keys(this.store[name])) {\n const timeout = this.store[name][key]?.timeout;\n if (timeout) {\n this.dateTimeProvider.clearTimeout(timeout);\n }\n }\n }\n delete this.store[name];\n return;\n }\n\n this.log.debug(`Deleting cache for name`, { name, keys });\n\n // delete specific keys in name\n for (const key of keys) {\n if (this.store[name] == null) break;\n\n const timeout = this.store[name][key]?.timeout;\n if (timeout) {\n this.dateTimeProvider.clearTimeout(timeout);\n }\n\n delete this.store[name][key];\n }\n\n if (Object.keys(this.store[name] ?? {}).length === 0) {\n // if name is empty, delete it\n delete this.store[name];\n }\n }\n\n public async has(name: string, key: string): Promise<boolean> {\n return this.store[name]?.[key]?.data != null;\n }\n\n public async keys(name: string, filter?: string): Promise<string[]> {\n const store = this.store[name] ?? {};\n const keys = Object.keys(store);\n if (filter) {\n return keys.filter((key) => key.startsWith(filter));\n }\n return keys;\n }\n\n public async clear(): Promise<void> {\n this.log.debug(\"Clearing all cache\");\n\n // Clear all timeouts before clearing the store\n for (const name of Object.keys(this.store)) {\n for (const key of Object.keys(this.store[name])) {\n const timeout = this.store[name][key]?.timeout;\n if (timeout) {\n this.dateTimeProvider.clearTimeout(timeout);\n }\n }\n }\n\n this.store = {};\n }\n}\n","import {\n $env,\n $inject,\n createPrimitive,\n type InstantiableClass,\n KIND,\n Primitive,\n t,\n} from \"alepha\";\nimport { DateTimeProvider, type DurationLike } from \"alepha/datetime\";\nimport { CacheError } from \"../errors/CacheError.ts\";\nimport { CacheProvider } from \"../providers/CacheProvider.ts\";\nimport { MemoryCacheProvider } from \"../providers/MemoryCacheProvider.ts\";\n\n/**\n * Creates a cache primitive for high-performance data caching with automatic management.\n *\n * Provides a caching layer that improves application performance by storing frequently accessed\n * data in memory or external stores like Redis, with support for both function result caching\n * and manual cache operations.\n *\n * **Key Features**\n * - Automatic function result caching based on input parameters\n * - Multiple storage backends (in-memory, Redis, custom providers)\n * - Intelligent serialization for JSON, strings, and binary data\n * - Configurable TTL with automatic expiration\n * - Pattern-based cache invalidation with wildcard support\n * - Environment controls to enable/disable caching\n *\n * **Storage Backends**\n * - Memory: Fast in-memory cache (default for development)\n * - Redis: Distributed cache for production environments\n * - Custom providers: Implement your own storage backend\n *\n * @example\n * ```ts\n * class DataService {\n * // Function result caching\n * getUserData = $cache({\n * name: \"user-data\",\n * ttl: [10, \"minutes\"],\n * handler: async (userId: string) => {\n * return await database.users.findById(userId);\n * }\n * });\n *\n * // Manual cache operations\n * sessionCache = $cache<UserSession>({\n * name: \"sessions\",\n * ttl: [1, \"hour\"]\n * });\n *\n * async storeSession(id: string, session: UserSession) {\n * await this.sessionCache.set(id, session);\n * }\n *\n * async invalidateUserSessions(userId: string) {\n * await this.sessionCache.invalidate(`user:${userId}:*`);\n * }\n * }\n * ```\n */\nexport const $cache = <TReturn = string, TParameter extends any[] = any[]>(\n options: CachePrimitiveOptions<TReturn, TParameter> = {},\n): CachePrimitiveFn<TReturn, TParameter> => {\n const instance = createPrimitive(\n CachePrimitive<TReturn, TParameter>,\n options,\n );\n const fn = (...args: TParameter): Promise<TReturn> => instance.run(...args);\n return Object.setPrototypeOf(fn, instance) as CachePrimitiveFn<\n TReturn,\n TParameter\n >;\n};\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport interface CachePrimitiveOptions<\n TReturn = any,\n TParameter extends any[] = any[],\n> {\n /**\n * The cache name. This is useful for invalidating multiple caches at once.\n *\n * Store key as `cache:$name:$key`.\n *\n * @default Name of the key of the class.\n */\n name?: string;\n\n /**\n * Function which returns cached data.\n */\n handler?: (...args: TParameter) => TReturn;\n\n /**\n * The key generator for the cache.\n * If not provided, the arguments will be json.stringify().\n */\n key?: (...args: TParameter) => string;\n\n /**\n * The store provider for the cache.\n * If not provided, the default store provider will be used.\n */\n provider?: InstantiableClass<CacheProvider> | \"memory\";\n\n /**\n * The time-to-live for the cache in seconds.\n * Set 0 to skip expiration.\n *\n * @default 300 (5 minutes).\n */\n ttl?: DurationLike;\n\n /**\n * If the cache is disabled.\n */\n disabled?: boolean;\n}\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nconst envSchema = t.object({\n CACHE_ENABLED: t.boolean({ default: true }),\n CACHE_DEFAULT_TTL: t.number({\n default: 300, // 5 minutes\n description: \"The default time to live for cache entries. In seconds.\",\n }),\n});\n\nexport class CachePrimitive<\n TReturn = any,\n TParameter extends any[] = any[],\n> extends Primitive<CachePrimitiveOptions<TReturn, TParameter>> {\n protected readonly env = $env(envSchema);\n protected readonly dateTimeProvider = $inject(DateTimeProvider);\n protected readonly provider = this.$provider();\n protected encoder: TextEncoder = new TextEncoder();\n protected decoder: TextDecoder = new TextDecoder();\n protected codes = {\n BINARY: 0x01,\n JSON: 0x02,\n STRING: 0x03,\n };\n\n public get container(): string {\n return (\n this.options.name ??\n `${this.config.service.name}:${this.config.propertyKey}`\n );\n }\n\n public async run(...args: TParameter): Promise<TReturn> {\n const handler = this.options.handler;\n if (!handler) {\n throw new Error(\"Cache handler is not defined.\");\n }\n\n const key = this.key(...args);\n const cached = await this.get(key);\n if (cached) {\n return cached;\n }\n\n const result = await handler(...args);\n // note: when exception occurs, don't cache the result\n\n await this.set(key, result);\n\n return result;\n }\n\n public key(...args: TParameter): string {\n return this.options.key ? this.options.key(...args) : JSON.stringify(args);\n }\n\n public async invalidate(...keys: string[]): Promise<void> {\n const keysToDelete: string[] = [];\n\n for (const key of keys) {\n if (key.endsWith(\"*\")) {\n const result = await this.provider.keys(\n this.container,\n key.slice(0, -1),\n );\n keysToDelete.push(...result);\n } else {\n keysToDelete.push(key);\n }\n }\n\n await this.provider.del(this.container, ...keysToDelete);\n }\n\n public async set(\n key: string,\n value: TReturn,\n ttl?: DurationLike,\n ): Promise<void> {\n const px = this.dateTimeProvider\n .duration(\n ttl ?? this.options.ttl ?? [this.env.CACHE_DEFAULT_TTL, \"seconds\"],\n )\n .as(\"milliseconds\");\n\n await this.provider.set(\n this.container,\n key,\n this.serialize(value),\n px > 0 ? px : undefined,\n );\n }\n\n public async get(key: string): Promise<TReturn | undefined> {\n if (\n !this.alepha.isStarted() ||\n this.options.disabled ||\n !this.env.CACHE_ENABLED\n ) {\n return undefined;\n }\n\n const data = await this.provider.get(this.container, key);\n if (data) {\n return await this.deserialize<TReturn>(data);\n }\n\n return undefined;\n }\n\n protected serialize<TReturn>(value: TReturn): Uint8Array {\n if (value instanceof Uint8Array) {\n return new Uint8Array([this.codes.BINARY, ...value]); // TODO: check if copy is ok?\n }\n\n if (typeof value === \"string\") {\n return new Uint8Array([this.codes.STRING, ...this.encoder.encode(value)]);\n }\n\n return new Uint8Array([\n this.codes.JSON,\n ...this.encoder.encode(JSON.stringify(value)),\n ]);\n }\n\n protected async deserialize<TReturn>(\n uint8Array: Uint8Array,\n ): Promise<TReturn> {\n const type = uint8Array[0];\n const payload = uint8Array.slice(1);\n\n if (type === this.codes.BINARY) {\n return payload as TReturn;\n }\n if (type === this.codes.JSON) {\n return JSON.parse(this.decoder.decode(payload)) as TReturn;\n }\n if (type === this.codes.STRING) {\n return this.decoder.decode(payload) as TReturn;\n }\n\n throw new CacheError(`Unknown serialization type: ${type}`);\n }\n\n protected $provider(): CacheProvider {\n if (!this.options.provider) {\n return this.alepha.inject(CacheProvider);\n }\n\n if (this.options.provider === \"memory\") {\n return this.alepha.inject(MemoryCacheProvider);\n }\n\n return this.alepha.inject(this.options.provider);\n }\n}\n\nexport interface CachePrimitiveFn<\n TReturn = any,\n TParameter extends any[] = any[],\n> extends CachePrimitive<TReturn, TParameter> {\n /**\n * Run the cache primitive with the provided arguments.\n */\n (...args: TParameter): Promise<TReturn>;\n}\n\n$cache[KIND] = CachePrimitive;\n","import { $module } from \"alepha\";\nimport { $cache } from \"./primitives/$cache.ts\";\nimport { CacheProvider } from \"./providers/CacheProvider.ts\";\nimport { MemoryCacheProvider } from \"./providers/MemoryCacheProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\nexport * from \"./primitives/$cache.ts\";\nexport * from \"./providers/CacheProvider.ts\";\nexport * from \"./providers/MemoryCacheProvider.ts\";\n\n// ---------------------------------------------------------------------------------------------------------------------\n\n/**\n * Provides high-performance caching capabilities for Alepha applications with configurable TTL and multiple storage backends.\n *\n * The cache module enables declarative caching through the `$cache` primitive, allowing you to cache method results,\n * API responses, or computed values with automatic invalidation and type safety. It supports both in-memory and\n * persistent storage backends for different performance and durability requirements.\n *\n * @see {@link $cache}\n * @see {@link CacheProvider}\n * @module alepha.cache\n */\nexport const AlephaCache = $module({\n name: \"alepha.cache\",\n primitives: [$cache],\n services: [CacheProvider, MemoryCacheProvider],\n register: (alepha) =>\n alepha.with({\n optional: true,\n provide: CacheProvider,\n use: MemoryCacheProvider,\n }),\n});\n"],"mappings":";;;;;AAEA,IAAa,aAAb,cAAgC,YAAY;;;;;;;;;;ACI5C,I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WACT,OAAO,KAAK;EACV,UAAU;EACV,SAAS;EACT,KAAK;EACN,CAAC;CACL,CAAC"}
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { FileSystemProvider } from "alepha/file";
|
|
|
4
4
|
import * as alepha_command0 from "alepha/command";
|
|
5
5
|
import { CliProvider, CommandPrimitive, EnvUtils, RunnerMethod } from "alepha/command";
|
|
6
6
|
import * as alepha_logger5 from "alepha/logger";
|
|
7
|
+
import * as typebox0 from "typebox";
|
|
7
8
|
import { DatabaseProvider } from "alepha/orm";
|
|
8
9
|
|
|
9
10
|
//#region ../../src/cli/apps/AlephaCli.d.ts
|
|
@@ -25,6 +26,33 @@ declare class AlephaPackageBuilderCli {
|
|
|
25
26
|
}
|
|
26
27
|
declare function analyzeModules(srcDir: string, packageName: string): Promise<Module[]>;
|
|
27
28
|
//#endregion
|
|
29
|
+
//#region ../../src/cli/atoms/changelogOptions.d.ts
|
|
30
|
+
/**
|
|
31
|
+
* Default scopes to ignore in changelog generation.
|
|
32
|
+
* Commits with these scopes won't appear in release notes.
|
|
33
|
+
*/
|
|
34
|
+
declare const DEFAULT_IGNORE: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Changelog configuration atom.
|
|
37
|
+
*
|
|
38
|
+
* Configure in `alepha.config.ts`:
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { changelogOptions } from "alepha/cli";
|
|
41
|
+
*
|
|
42
|
+
* alepha.set(changelogOptions, {
|
|
43
|
+
* ignore: ["project", "release", "chore", "docs"],
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare const changelogOptions: alepha0.Atom<alepha0.TObject<{
|
|
48
|
+
/**
|
|
49
|
+
* Scopes to ignore (e.g., "project", "release", "chore").
|
|
50
|
+
* Commits like `feat(chore): ...` will be excluded from changelog.
|
|
51
|
+
*/
|
|
52
|
+
ignore: alepha0.TOptional<alepha0.TArray<alepha0.TString>>;
|
|
53
|
+
}>, "alepha.changelog">;
|
|
54
|
+
type ChangelogOptions = Static<typeof changelogOptions.schema>;
|
|
55
|
+
//#endregion
|
|
28
56
|
//#region ../../src/cli/services/AlephaCliUtils.d.ts
|
|
29
57
|
/**
|
|
30
58
|
* Utility service for common project operations used by CLI commands.
|
|
@@ -235,41 +263,19 @@ interface DependencyModes {
|
|
|
235
263
|
expo?: boolean;
|
|
236
264
|
}
|
|
237
265
|
//#endregion
|
|
238
|
-
//#region ../../src/cli/commands/
|
|
239
|
-
declare class
|
|
266
|
+
//#region ../../src/cli/commands/build.d.ts
|
|
267
|
+
declare class BuildCommand {
|
|
240
268
|
protected readonly log: alepha_logger5.Logger;
|
|
241
269
|
protected readonly utils: AlephaCliUtils;
|
|
242
|
-
readonly
|
|
243
|
-
|
|
270
|
+
readonly build: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
271
|
+
stats: alepha0.TOptional<alepha0.TBoolean>;
|
|
272
|
+
vercel: alepha0.TOptional<alepha0.TBoolean>;
|
|
273
|
+
cloudflare: alepha0.TOptional<alepha0.TBoolean>;
|
|
274
|
+
docker: alepha0.TOptional<alepha0.TBoolean>;
|
|
275
|
+
sitemap: alepha0.TOptional<alepha0.TString>;
|
|
276
|
+
}>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
244
277
|
}
|
|
245
278
|
//#endregion
|
|
246
|
-
//#region ../../src/cli/atoms/changelogOptions.d.ts
|
|
247
|
-
/**
|
|
248
|
-
* Default scopes to ignore in changelog generation.
|
|
249
|
-
* Commits with these scopes won't appear in release notes.
|
|
250
|
-
*/
|
|
251
|
-
declare const DEFAULT_IGNORE: string[];
|
|
252
|
-
/**
|
|
253
|
-
* Changelog configuration atom.
|
|
254
|
-
*
|
|
255
|
-
* Configure in `alepha.config.ts`:
|
|
256
|
-
* ```ts
|
|
257
|
-
* import { changelogOptions } from "alepha/cli";
|
|
258
|
-
*
|
|
259
|
-
* alepha.set(changelogOptions, {
|
|
260
|
-
* ignore: ["project", "release", "chore", "docs"],
|
|
261
|
-
* });
|
|
262
|
-
* ```
|
|
263
|
-
*/
|
|
264
|
-
declare const changelogOptions: alepha0.Atom<alepha0.TObject<{
|
|
265
|
-
/**
|
|
266
|
-
* Scopes to ignore (e.g., "project", "release", "chore").
|
|
267
|
-
* Commits like `feat(chore): ...` will be excluded from changelog.
|
|
268
|
-
*/
|
|
269
|
-
ignore: alepha0.TOptional<alepha0.TArray<alepha0.TString>>;
|
|
270
|
-
}>, "alepha.changelog">;
|
|
271
|
-
type ChangelogOptions = Static<typeof changelogOptions.schema>;
|
|
272
|
-
//#endregion
|
|
273
279
|
//#region ../../src/cli/services/GitMessageParser.d.ts
|
|
274
280
|
/**
|
|
275
281
|
* Service for parsing git commit messages into structured format.
|
|
@@ -301,7 +307,7 @@ declare class GitMessageParser {
|
|
|
301
307
|
parseCommit(line: string, config: ChangelogOptions): Commit | null;
|
|
302
308
|
}
|
|
303
309
|
//#endregion
|
|
304
|
-
//#region ../../src/cli/commands/
|
|
310
|
+
//#region ../../src/cli/commands/changelog.d.ts
|
|
305
311
|
/**
|
|
306
312
|
* Git provider for executing git commands.
|
|
307
313
|
* Can be substituted in tests with a mock implementation.
|
|
@@ -319,7 +325,6 @@ interface Commit {
|
|
|
319
325
|
interface ChangelogEntry {
|
|
320
326
|
features: Commit[];
|
|
321
327
|
fixes: Commit[];
|
|
322
|
-
breaking: Commit[];
|
|
323
328
|
}
|
|
324
329
|
/**
|
|
325
330
|
* Changelog command for generating release notes from git commits.
|
|
@@ -330,7 +335,7 @@ interface ChangelogEntry {
|
|
|
330
335
|
* - `alepha changelog --from=1.0.0 --to=1.1.0` - Show changes between two refs
|
|
331
336
|
* - `alepha changelog | tee -a CHANGELOG.md` - Append to file
|
|
332
337
|
*/
|
|
333
|
-
declare class
|
|
338
|
+
declare class ChangelogCommand {
|
|
334
339
|
protected readonly log: alepha_logger5.Logger;
|
|
335
340
|
protected readonly git: GitProvider;
|
|
336
341
|
protected readonly parser: GitMessageParser;
|
|
@@ -340,6 +345,7 @@ declare class ChangelogCommands {
|
|
|
340
345
|
/**
|
|
341
346
|
* Format a single commit line.
|
|
342
347
|
* Example: `- **cli**: add new command (\`abc1234\`)`
|
|
348
|
+
* Breaking changes are flagged: `- **cli**: add new command [BREAKING] (\`abc1234\`)`
|
|
343
349
|
*/
|
|
344
350
|
protected formatCommit(commit: Commit): string;
|
|
345
351
|
/**
|
|
@@ -374,143 +380,60 @@ declare class ChangelogCommands {
|
|
|
374
380
|
}>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
375
381
|
}
|
|
376
382
|
//#endregion
|
|
377
|
-
//#region ../../src/cli/commands/
|
|
378
|
-
declare class
|
|
379
|
-
protected readonly log: alepha_logger5.Logger;
|
|
380
|
-
protected readonly cli: CliProvider;
|
|
381
|
-
protected readonly utils: AlephaCliUtils;
|
|
382
|
-
/**
|
|
383
|
-
* Called when no command is provided
|
|
384
|
-
*/
|
|
385
|
-
readonly root: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
386
|
-
version: alepha0.TOptional<alepha0.TBoolean>;
|
|
387
|
-
}>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
383
|
+
//#region ../../src/cli/commands/clean.d.ts
|
|
384
|
+
declare class CleanCommand {
|
|
388
385
|
/**
|
|
389
386
|
* Clean the project, removing the "dist" directory
|
|
390
387
|
*/
|
|
391
|
-
readonly clean: alepha_command0.CommandPrimitive<
|
|
392
|
-
/**
|
|
393
|
-
* Ensure the project has the necessary Alepha configuration files.
|
|
394
|
-
* Add the correct dependencies to package.json and install them.
|
|
395
|
-
*/
|
|
396
|
-
readonly init: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
397
|
-
yarn: alepha0.TOptional<alepha0.TBoolean>;
|
|
398
|
-
pnpm: alepha0.TOptional<alepha0.TBoolean>;
|
|
399
|
-
npm: alepha0.TOptional<alepha0.TBoolean>;
|
|
400
|
-
bun: alepha0.TOptional<alepha0.TBoolean>;
|
|
401
|
-
react: alepha0.TOptional<alepha0.TBoolean>;
|
|
402
|
-
ui: alepha0.TOptional<alepha0.TBoolean>;
|
|
403
|
-
test: alepha0.TOptional<alepha0.TBoolean>;
|
|
404
|
-
}>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
388
|
+
readonly clean: alepha_command0.CommandPrimitive<typebox0.TObject<typebox0.TProperties>, typebox0.TSchema, typebox0.TObject<typebox0.TProperties>>;
|
|
405
389
|
}
|
|
406
390
|
//#endregion
|
|
407
|
-
//#region ../../src/cli/commands/
|
|
408
|
-
declare class
|
|
391
|
+
//#region ../../src/cli/commands/db.d.ts
|
|
392
|
+
declare class DbCommand {
|
|
409
393
|
protected readonly log: alepha_logger5.Logger;
|
|
410
394
|
protected readonly utils: AlephaCliUtils;
|
|
411
|
-
/**
|
|
412
|
-
* Deploy the project to a hosting platform (e.g., Vercel, Cloudflare, Surge)
|
|
413
|
-
*
|
|
414
|
-
* Deploy command can be overridden by creating a alepha.config.ts in the project root:
|
|
415
|
-
*
|
|
416
|
-
* ```ts
|
|
417
|
-
* import { defineConfig } from "alepha/cli";
|
|
418
|
-
*
|
|
419
|
-
* export default defineConfig({
|
|
420
|
-
* commands: {
|
|
421
|
-
* deploy: {
|
|
422
|
-
* handler: async ({ root, mode, flags }) => {
|
|
423
|
-
* // Custom deployment logic here
|
|
424
|
-
* },
|
|
425
|
-
* },
|
|
426
|
-
* },
|
|
427
|
-
* });
|
|
428
|
-
* ```
|
|
429
|
-
*/
|
|
430
|
-
readonly deploy: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
431
|
-
build: alepha0.TBoolean;
|
|
432
|
-
migrate: alepha0.TBoolean;
|
|
433
|
-
}>, alepha0.TSchema, alepha0.TObject<{
|
|
434
|
-
VERCEL_TOKEN: alepha0.TOptional<alepha0.TString>;
|
|
435
|
-
VERCEL_ORG_ID: alepha0.TOptional<alepha0.TString>;
|
|
436
|
-
VERCEL_PROJECT_ID: alepha0.TOptional<alepha0.TString>;
|
|
437
|
-
CLOUDFLARE_API_TOKEN: alepha0.TOptional<alepha0.TString>;
|
|
438
|
-
CLOUDFLARE_ACCOUNT_ID: alepha0.TOptional<alepha0.TString>;
|
|
439
|
-
}>>;
|
|
440
|
-
}
|
|
441
|
-
//#endregion
|
|
442
|
-
//#region ../../src/cli/commands/DrizzleCommands.d.ts
|
|
443
|
-
declare class DrizzleCommands {
|
|
444
|
-
log: alepha_logger5.Logger;
|
|
445
|
-
utils: AlephaCliUtils;
|
|
446
395
|
/**
|
|
447
396
|
* Check if database migrations are up to date.
|
|
448
397
|
*/
|
|
449
|
-
check: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
398
|
+
protected readonly check: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
450
399
|
provider: alepha0.TOptional<alepha0.TString>;
|
|
451
400
|
mode: alepha0.TOptional<alepha0.TString>;
|
|
452
401
|
}>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
453
402
|
/**
|
|
454
403
|
* Generate database migration files
|
|
455
|
-
*
|
|
456
|
-
* - Loads the Alepha instance from the specified entry file.
|
|
457
|
-
* - Retrieves all repository primitives to gather database models.
|
|
458
|
-
* - Creates temporary entity definitions based on the current database schema.
|
|
459
|
-
* - Writes these definitions to a temporary schema file. (node_modules/.db/entities.ts)
|
|
460
|
-
* - Invokes Drizzle Kit's CLI to generate migration files based on the current schema.
|
|
461
404
|
*/
|
|
462
|
-
generate: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
405
|
+
protected readonly generate: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
463
406
|
provider: alepha0.TOptional<alepha0.TString>;
|
|
464
407
|
mode: alepha0.TOptional<alepha0.TString>;
|
|
465
408
|
custom: alepha0.TOptional<alepha0.TString>;
|
|
466
409
|
}>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
467
410
|
/**
|
|
468
411
|
* Push database schema changes directly to the database
|
|
469
|
-
*
|
|
470
|
-
* - Loads the Alepha instance from the specified entry file.
|
|
471
|
-
* - Retrieves all repository primitives to gather database models.
|
|
472
|
-
* - Creates temporary entity definitions and Drizzle config.
|
|
473
|
-
* - Invokes Drizzle Kit's push command to apply schema changes directly.
|
|
474
412
|
*/
|
|
475
|
-
push: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
413
|
+
protected readonly push: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
476
414
|
provider: alepha0.TOptional<alepha0.TString>;
|
|
477
415
|
mode: alepha0.TOptional<alepha0.TString>;
|
|
478
416
|
}>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
479
417
|
/**
|
|
480
418
|
* Apply pending database migrations
|
|
481
|
-
*
|
|
482
|
-
* - Loads the Alepha instance from the specified entry file.
|
|
483
|
-
* - Retrieves all repository primitives to gather database models.
|
|
484
|
-
* - Creates temporary entity definitions and Drizzle config.
|
|
485
|
-
* - Invokes Drizzle Kit's migrate command to apply pending migrations.
|
|
486
419
|
*/
|
|
487
|
-
migrate: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
420
|
+
protected readonly migrate: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
488
421
|
provider: alepha0.TOptional<alepha0.TString>;
|
|
489
422
|
mode: alepha0.TOptional<alepha0.TString>;
|
|
490
423
|
}>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
491
424
|
/**
|
|
492
425
|
* Launch Drizzle Studio database browser
|
|
493
|
-
*
|
|
494
|
-
* - Loads the Alepha instance from the specified entry file.
|
|
495
|
-
* - Retrieves all repository primitives to gather database models.
|
|
496
|
-
* - Creates temporary entity definitions and Drizzle config.
|
|
497
|
-
* - Invokes Drizzle Kit's studio command to launch the web-based database browser.
|
|
498
426
|
*/
|
|
499
|
-
studio: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
427
|
+
protected readonly studio: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
500
428
|
provider: alepha0.TOptional<alepha0.TString>;
|
|
501
429
|
mode: alepha0.TOptional<alepha0.TString>;
|
|
502
430
|
}>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
503
431
|
/**
|
|
504
432
|
* Parent command for database operations.
|
|
505
433
|
*/
|
|
506
|
-
db: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
434
|
+
readonly db: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
507
435
|
/**
|
|
508
436
|
* Run a drizzle-kit command for all database providers in an Alepha instance.
|
|
509
|
-
*
|
|
510
|
-
* Iterates through all repository providers, prepares Drizzle config for each,
|
|
511
|
-
* and executes the specified drizzle-kit command.
|
|
512
|
-
*
|
|
513
|
-
* @param options - Configuration including command to run, flags, and logging
|
|
514
437
|
*/
|
|
515
438
|
runDrizzleKitCommand(options: {
|
|
516
439
|
root: string;
|
|
@@ -523,12 +446,6 @@ declare class DrizzleCommands {
|
|
|
523
446
|
}): Promise<void>;
|
|
524
447
|
/**
|
|
525
448
|
* Prepare Drizzle configuration files for a database provider.
|
|
526
|
-
*
|
|
527
|
-
* Creates temporary entities.js and drizzle.config.js files needed
|
|
528
|
-
* for Drizzle Kit commands to run properly.
|
|
529
|
-
*
|
|
530
|
-
* @param options - Configuration options including kit, provider info, and paths
|
|
531
|
-
* @returns Path to the generated drizzle.config.js file
|
|
532
449
|
*/
|
|
533
450
|
prepareDrizzleConfig(options: {
|
|
534
451
|
kit: any;
|
|
@@ -541,39 +458,45 @@ declare class DrizzleCommands {
|
|
|
541
458
|
}): Promise<string>;
|
|
542
459
|
}
|
|
543
460
|
//#endregion
|
|
544
|
-
//#region ../../src/cli/commands/
|
|
545
|
-
declare class
|
|
461
|
+
//#region ../../src/cli/commands/deploy.d.ts
|
|
462
|
+
declare class DeployCommand {
|
|
463
|
+
protected readonly log: alepha_logger5.Logger;
|
|
546
464
|
protected readonly utils: AlephaCliUtils;
|
|
547
465
|
/**
|
|
548
|
-
*
|
|
466
|
+
* Deploy the project to a hosting platform (e.g., Vercel, Cloudflare, Surge)
|
|
549
467
|
*
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
*
|
|
468
|
+
* Deploy command can be overridden by creating a alepha.config.ts in the project root:
|
|
469
|
+
*
|
|
470
|
+
* ```ts
|
|
471
|
+
* import { defineConfig } from "alepha/cli";
|
|
472
|
+
*
|
|
473
|
+
* export default defineConfig({
|
|
474
|
+
* commands: {
|
|
475
|
+
* deploy: {
|
|
476
|
+
* handler: async ({ root, mode, flags }) => {
|
|
477
|
+
* // Custom deployment logic here
|
|
478
|
+
* },
|
|
479
|
+
* },
|
|
480
|
+
* },
|
|
481
|
+
* });
|
|
482
|
+
* ```
|
|
563
483
|
*/
|
|
564
|
-
readonly
|
|
484
|
+
readonly deploy: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
485
|
+
build: alepha0.TBoolean;
|
|
486
|
+
migrate: alepha0.TBoolean;
|
|
487
|
+
}>, alepha0.TSchema, alepha0.TObject<{
|
|
488
|
+
VERCEL_TOKEN: alepha0.TOptional<alepha0.TString>;
|
|
489
|
+
VERCEL_ORG_ID: alepha0.TOptional<alepha0.TString>;
|
|
490
|
+
VERCEL_PROJECT_ID: alepha0.TOptional<alepha0.TString>;
|
|
491
|
+
CLOUDFLARE_API_TOKEN: alepha0.TOptional<alepha0.TString>;
|
|
492
|
+
CLOUDFLARE_ACCOUNT_ID: alepha0.TOptional<alepha0.TString>;
|
|
493
|
+
}>>;
|
|
565
494
|
}
|
|
566
495
|
//#endregion
|
|
567
|
-
//#region ../../src/cli/commands/
|
|
568
|
-
declare class
|
|
496
|
+
//#region ../../src/cli/commands/dev.d.ts
|
|
497
|
+
declare class DevCommand {
|
|
569
498
|
protected readonly log: alepha_logger5.Logger;
|
|
570
499
|
protected readonly utils: AlephaCliUtils;
|
|
571
|
-
protected readonly env: {
|
|
572
|
-
VITEST_ARGS: string;
|
|
573
|
-
};
|
|
574
|
-
readonly run: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
575
|
-
watch: alepha0.TOptional<alepha0.TBoolean>;
|
|
576
|
-
}>, alepha0.TString, alepha0.TObject<alepha0.TProperties>>;
|
|
577
500
|
/**
|
|
578
501
|
* Will run the project in watch mode.
|
|
579
502
|
*
|
|
@@ -581,13 +504,61 @@ declare class ViteCommands {
|
|
|
581
504
|
* - Otherwise, it will look for a server entry file and run it with tsx in watch mode.
|
|
582
505
|
*/
|
|
583
506
|
readonly dev: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TOptional<alepha0.TString>, alepha0.TObject<alepha0.TProperties>>;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
507
|
+
}
|
|
508
|
+
//#endregion
|
|
509
|
+
//#region ../../src/cli/commands/format.d.ts
|
|
510
|
+
declare class FormatCommand {
|
|
511
|
+
protected readonly utils: AlephaCliUtils;
|
|
512
|
+
readonly format: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region ../../src/cli/commands/init.d.ts
|
|
516
|
+
declare class InitCommand {
|
|
517
|
+
protected readonly utils: AlephaCliUtils;
|
|
518
|
+
/**
|
|
519
|
+
* Ensure the project has the necessary Alepha configuration files.
|
|
520
|
+
* Add the correct dependencies to package.json and install them.
|
|
521
|
+
*/
|
|
522
|
+
readonly init: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
523
|
+
yarn: alepha0.TOptional<alepha0.TBoolean>;
|
|
524
|
+
pnpm: alepha0.TOptional<alepha0.TBoolean>;
|
|
525
|
+
npm: alepha0.TOptional<alepha0.TBoolean>;
|
|
526
|
+
bun: alepha0.TOptional<alepha0.TBoolean>;
|
|
527
|
+
react: alepha0.TOptional<alepha0.TBoolean>;
|
|
528
|
+
ui: alepha0.TOptional<alepha0.TBoolean>;
|
|
529
|
+
test: alepha0.TOptional<alepha0.TBoolean>;
|
|
530
|
+
}>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
531
|
+
}
|
|
532
|
+
//#endregion
|
|
533
|
+
//#region ../../src/cli/commands/lint.d.ts
|
|
534
|
+
declare class LintCommand {
|
|
535
|
+
protected readonly utils: AlephaCliUtils;
|
|
536
|
+
readonly lint: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
537
|
+
}
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region ../../src/cli/commands/root.d.ts
|
|
540
|
+
declare class RootCommand {
|
|
541
|
+
protected readonly log: alepha_logger5.Logger;
|
|
542
|
+
protected readonly cli: CliProvider;
|
|
543
|
+
/**
|
|
544
|
+
* Called when no command is provided
|
|
545
|
+
*/
|
|
546
|
+
readonly root: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
547
|
+
version: alepha0.TOptional<alepha0.TBoolean>;
|
|
548
|
+
}>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
549
|
+
}
|
|
550
|
+
//#endregion
|
|
551
|
+
//#region ../../src/cli/commands/run.d.ts
|
|
552
|
+
declare class RunCommand {
|
|
553
|
+
protected readonly utils: AlephaCliUtils;
|
|
554
|
+
readonly run: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
555
|
+
watch: alepha0.TOptional<alepha0.TBoolean>;
|
|
556
|
+
}>, alepha0.TString, alepha0.TObject<alepha0.TProperties>>;
|
|
557
|
+
}
|
|
558
|
+
//#endregion
|
|
559
|
+
//#region ../../src/cli/commands/test.d.ts
|
|
560
|
+
declare class TestCommand {
|
|
561
|
+
protected readonly utils: AlephaCliUtils;
|
|
591
562
|
readonly test: alepha_command0.CommandPrimitive<alepha0.TObject<{
|
|
592
563
|
config: alepha0.TOptional<alepha0.TString>;
|
|
593
564
|
}>, alepha0.TSchema, alepha0.TObject<{
|
|
@@ -595,16 +566,51 @@ declare class ViteCommands {
|
|
|
595
566
|
}>>;
|
|
596
567
|
}
|
|
597
568
|
//#endregion
|
|
569
|
+
//#region ../../src/cli/commands/typecheck.d.ts
|
|
570
|
+
declare class TypecheckCommand {
|
|
571
|
+
protected readonly utils: AlephaCliUtils;
|
|
572
|
+
/**
|
|
573
|
+
* Run TypeScript type checking across the codebase with no emit.
|
|
574
|
+
*/
|
|
575
|
+
readonly typecheck: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
576
|
+
}
|
|
577
|
+
//#endregion
|
|
578
|
+
//#region ../../src/cli/commands/verify.d.ts
|
|
579
|
+
declare class VerifyCommand {
|
|
580
|
+
protected readonly utils: AlephaCliUtils;
|
|
581
|
+
/**
|
|
582
|
+
* Run a series of verification commands to ensure code quality and correctness.
|
|
583
|
+
*
|
|
584
|
+
* This command runs the following checks in order:
|
|
585
|
+
* - Clean the project
|
|
586
|
+
* - Format the code
|
|
587
|
+
* - Lint the code
|
|
588
|
+
* - Run tests (if Vitest is a dev dependency)
|
|
589
|
+
* - Check database migrations (if a migrations directory exists)
|
|
590
|
+
* - Type check the code
|
|
591
|
+
* - Build the project
|
|
592
|
+
* - Clean the project again
|
|
593
|
+
*/
|
|
594
|
+
readonly verify: alepha_command0.CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
595
|
+
}
|
|
596
|
+
//#endregion
|
|
598
597
|
//#region ../../src/cli/defineConfig.d.ts
|
|
599
598
|
type AlephaCliConfig = (alepha: Alepha) => {
|
|
600
599
|
commands?: Record<string, CommandPrimitive>;
|
|
600
|
+
services?: Array<any>;
|
|
601
601
|
};
|
|
602
602
|
declare const defineConfig: (config: AlephaCliConfig) => (alepha: Alepha) => {
|
|
603
603
|
[x: string]: CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
604
604
|
};
|
|
605
|
+
/**
|
|
606
|
+
* @alias defineConfig
|
|
607
|
+
*/
|
|
608
|
+
declare const defineAlephaConfig: (config: AlephaCliConfig) => (alepha: Alepha) => {
|
|
609
|
+
[x: string]: CommandPrimitive<alepha0.TObject<alepha0.TProperties>, alepha0.TSchema, alepha0.TObject<alepha0.TProperties>>;
|
|
610
|
+
};
|
|
605
611
|
//#endregion
|
|
606
612
|
//#region ../../src/cli/version.d.ts
|
|
607
613
|
declare const version: any;
|
|
608
614
|
//#endregion
|
|
609
|
-
export { AlephaCli, AlephaCliConfig, AlephaCliUtils, AlephaPackageBuilderCli,
|
|
615
|
+
export { AlephaCli, AlephaCliConfig, AlephaCliUtils, AlephaPackageBuilderCli, BuildCommand, ChangelogCommand, type ChangelogOptions, CleanCommand, Commit, DEFAULT_IGNORE, DbCommand, DependencyModes, DeployCommand, DevCommand, FormatCommand, GitMessageParser, GitProvider, InitCommand, LintCommand, RootCommand, RunCommand, TestCommand, TypecheckCommand, VerifyCommand, analyzeModules, changelogOptions, defineAlephaConfig, defineConfig, version };
|
|
610
616
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/cli/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/cli/apps/AlephaCli.ts","../../src/cli/apps/AlephaPackageBuilderCli.ts","../../src/cli/services/AlephaCliUtils.ts","../../src/cli/commands/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/cli/apps/AlephaCli.ts","../../src/cli/apps/AlephaPackageBuilderCli.ts","../../src/cli/atoms/changelogOptions.ts","../../src/cli/services/AlephaCliUtils.ts","../../src/cli/commands/build.ts","../../src/cli/services/GitMessageParser.ts","../../src/cli/commands/changelog.ts","../../src/cli/commands/clean.ts","../../src/cli/commands/db.ts","../../src/cli/commands/deploy.ts","../../src/cli/commands/dev.ts","../../src/cli/commands/format.ts","../../src/cli/commands/init.ts","../../src/cli/commands/lint.ts","../../src/cli/commands/root.ts","../../src/cli/commands/run.ts","../../src/cli/commands/test.ts","../../src/cli/commands/typecheck.ts","../../src/cli/commands/verify.ts","../../src/cli/defineConfig.ts","../../src/cli/version.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cA6Ca,WAAS,OAAA,CAAA,QAsBpB,OAAA,CAtBoB,MAAA;;;UCrCZ,MAAA;;;;;;;cAQG,uBAAA;;ED6BA,IAAA,EAAA,MAsBX;MChDE;QAEE,eAAA,CAAA,iBAAA,OAAA,CAAA,QAFF,OAAA,CAEE,WAAA,GAAA,OAAA,CAAA,OAAA,EAAA,OAAA,CAAA,QAAA,OAAA,CAAA,WAAA;;AAbI,iBAoQY,cAAA,CApQN,MAAA,EAAA,MAAA,EAAA,WAAA,EAAA,MAAA,CAAA,EAuQb,OAvQa,CAuQL,MAvQK,EAAA,CAAA;;;;;;;cCFH;;;;;AFuCb;;;;ACxCiD;AAWjD;;;AAKM,cCSO,gBDTP,ECSuB,OAAA,CAAA,IDTvB,SCSuB,ODTvB,CAAA;EAAA;;;;EAAA,MAAA,mBAAA,eAAA,CCqBJ,OAAA,CAAA,OAAA,CDrBI,CAAA;AAuPN,CAAA,CAAA,EAAsB,kBAAc,CAAA;KChOxB,gBAAA,GAAmB,cAAc,gBAAA,CAAiB;;;;;;;;;;AFC9D;;;cGfa,cAAA;EFtBH,mBAAM,GAAA,EEsBW,cAAA,CACH,MFvBR;EAQH,mBAAA,EAAA,EEgBU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