@holo-js/kernel 0.3.23 → 0.3.25
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.d.ts +80 -1
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -123,6 +123,78 @@ declare function loadHoloPluginDefinitions(projectRoot: string, packageNames: re
|
|
|
123
123
|
declare function loadHoloPluginContributionModules(projectRoot: string, plugins: readonly LoadedHoloPluginDefinition[], scope: string, key: string, options?: PluginLoadOptions): Promise<readonly HoloPluginRuntimeModule[]>;
|
|
124
124
|
declare function loadHoloPluginBootModules(projectRoot: string, plugins: readonly LoadedHoloPluginDefinition[], options?: PluginLoadOptions): Promise<readonly HoloPluginRuntimeModule[]>;
|
|
125
125
|
|
|
126
|
+
type TransactionScopeKind = 'root' | 'transaction' | 'savepoint';
|
|
127
|
+
interface ConcurrencyOptions {
|
|
128
|
+
maxConcurrentQueries?: number;
|
|
129
|
+
queueLimit?: number;
|
|
130
|
+
workerThreads?: boolean;
|
|
131
|
+
}
|
|
132
|
+
interface QueryStartLog {
|
|
133
|
+
kind: 'query' | 'execute';
|
|
134
|
+
connectionName: string;
|
|
135
|
+
sql: string;
|
|
136
|
+
bindings: unknown[];
|
|
137
|
+
source?: string;
|
|
138
|
+
scope: TransactionScopeKind;
|
|
139
|
+
schedulingMode?: 'concurrent' | 'serialized' | 'worker';
|
|
140
|
+
}
|
|
141
|
+
interface QuerySuccessLog extends QueryStartLog {
|
|
142
|
+
durationMs: number;
|
|
143
|
+
rowCount?: number;
|
|
144
|
+
affectedRows?: number;
|
|
145
|
+
}
|
|
146
|
+
interface QueryErrorLog extends QueryStartLog {
|
|
147
|
+
durationMs: number;
|
|
148
|
+
error: unknown;
|
|
149
|
+
}
|
|
150
|
+
interface TransactionLog {
|
|
151
|
+
scope: Exclude<TransactionScopeKind, 'root'>;
|
|
152
|
+
depth: number;
|
|
153
|
+
savepointName?: string;
|
|
154
|
+
}
|
|
155
|
+
interface MigrationStartLog {
|
|
156
|
+
connectionName: string;
|
|
157
|
+
migrationName: string;
|
|
158
|
+
action: 'up' | 'down';
|
|
159
|
+
batch?: number;
|
|
160
|
+
}
|
|
161
|
+
interface MigrationSuccessLog extends MigrationStartLog {
|
|
162
|
+
durationMs: number;
|
|
163
|
+
}
|
|
164
|
+
interface MigrationErrorLog extends MigrationStartLog {
|
|
165
|
+
durationMs: number;
|
|
166
|
+
error: unknown;
|
|
167
|
+
}
|
|
168
|
+
interface SeederStartLog {
|
|
169
|
+
connectionName: string;
|
|
170
|
+
seederName: string;
|
|
171
|
+
quietly: boolean;
|
|
172
|
+
environment?: string;
|
|
173
|
+
}
|
|
174
|
+
interface SeederSuccessLog extends SeederStartLog {
|
|
175
|
+
durationMs: number;
|
|
176
|
+
}
|
|
177
|
+
interface SeederErrorLog extends SeederStartLog {
|
|
178
|
+
durationMs: number;
|
|
179
|
+
error: unknown;
|
|
180
|
+
}
|
|
181
|
+
interface DatabaseLogger {
|
|
182
|
+
onQueryStart?(entry: QueryStartLog): void | Promise<void>;
|
|
183
|
+
onQuerySuccess?(entry: QuerySuccessLog): void | Promise<void>;
|
|
184
|
+
onQueryError?(entry: QueryErrorLog): void | Promise<void>;
|
|
185
|
+
onTransactionStart?(entry: TransactionLog): void | Promise<void>;
|
|
186
|
+
onTransactionCommit?(entry: TransactionLog): void | Promise<void>;
|
|
187
|
+
onTransactionRollback?(entry: TransactionLog & {
|
|
188
|
+
error?: unknown;
|
|
189
|
+
}): void | Promise<void>;
|
|
190
|
+
onMigrationStart?(entry: MigrationStartLog): void | Promise<void>;
|
|
191
|
+
onMigrationSuccess?(entry: MigrationSuccessLog): void | Promise<void>;
|
|
192
|
+
onMigrationError?(entry: MigrationErrorLog): void | Promise<void>;
|
|
193
|
+
onSeederStart?(entry: SeederStartLog): void | Promise<void>;
|
|
194
|
+
onSeederSuccess?(entry: SeederSuccessLog): void | Promise<void>;
|
|
195
|
+
onSeederError?(entry: SeederErrorLog): void | Promise<void>;
|
|
196
|
+
}
|
|
197
|
+
|
|
126
198
|
type HoloDatabaseDriver = 'sqlite' | 'postgres' | 'mysql';
|
|
127
199
|
interface HoloProjectPaths {
|
|
128
200
|
models: string;
|
|
@@ -149,9 +221,16 @@ interface HoloProjectConnectionConfig {
|
|
|
149
221
|
filename?: string;
|
|
150
222
|
schema?: string;
|
|
151
223
|
ssl?: boolean | Record<string, unknown>;
|
|
224
|
+
max?: number;
|
|
225
|
+
connectionTimeoutMillis?: number;
|
|
226
|
+
idleTimeoutMillis?: number;
|
|
227
|
+
application_name?: string;
|
|
228
|
+
concurrency?: ConcurrencyOptions;
|
|
229
|
+
logger?: DatabaseLogger;
|
|
152
230
|
logging?: boolean;
|
|
153
231
|
security?: {
|
|
154
232
|
allowUnsafeRawSql?: boolean;
|
|
233
|
+
debugSqlInLogs?: boolean;
|
|
155
234
|
};
|
|
156
235
|
}
|
|
157
236
|
interface HoloProjectDatabaseConfig {
|
|
@@ -330,4 +409,4 @@ declare function resolveNormalizedRedisConnection(config: NormalizedHoloRedisCon
|
|
|
330
409
|
declare function normalizeRedisConfig(config?: HoloRedisConfig): NormalizedHoloRedisConfig;
|
|
331
410
|
declare function defineRedisConfig<TConfig extends HoloRedisConfig>(config: TConfig): Readonly<TConfig>;
|
|
332
411
|
|
|
333
|
-
export { DEFAULT_HOLO_PROJECT_PATHS, DEFAULT_REDIS_CONNECTION, DEFAULT_REDIS_DB, DEFAULT_REDIS_HOST, DEFAULT_REDIS_PORT, HOLO_PROJECT_PREPARE_API_VERSION, type HoloDatabaseDriver, type HoloGeneratedProjectArtifact, type HoloManagedProjectArtifact, type HoloPluginBroadcastContributions, type HoloPluginCacheContributions, type HoloPluginCliContributions, type HoloPluginConfigContributions, type HoloPluginContributions, type HoloPluginDefinition, type HoloPluginDependencyContributions, type HoloPluginFrameworkContribution, type HoloPluginFrameworkTsconfigKind, type HoloPluginMailContributions, type HoloPluginMigrationContributions, type HoloPluginNotificationContributions, type HoloPluginPackageManager, type HoloPluginProjectContributions, type HoloPluginQueueContributions, type HoloPluginRuntimeContributions, type HoloPluginRuntimeMapContributions, type HoloPluginRuntimeModule, type HoloProjectArtifactContents, type HoloProjectConfig, type HoloProjectConnectionConfig, type HoloProjectDatabaseConfig, type HoloProjectPaths, type HoloProjectPrepareChange, type HoloProjectPrepareChangeKind, type HoloProjectPrepareCommand, type HoloProjectPrepareContext, type HoloProjectPrepareDiagnostic, HoloProjectPrepareError, type HoloProjectPrepareFailure, type HoloProjectPrepareFramework, type HoloProjectPrepareFullRetry, type HoloProjectPrepareLogger, type HoloProjectPrepareModule, type HoloProjectPreparePlugin, type HoloProjectPrepareResult, type HoloProjectPrepareRun, type HoloProjectPrepareSource, type HoloProjectPrepareWatch, type HoloProjectPreparedResult, type HoloProjectPreparer, type HoloRedisClusterNodeConfig, type HoloRedisConfig, type HoloRedisConnectionConfig, type LoadedHoloPluginDefinition, type NormalizedHoloProjectConfig, type NormalizedHoloRedisClusterNodeConfig, type NormalizedHoloRedisConfig, type NormalizedHoloRedisConnectionConfig, type PluginLoadOptions, type RuntimeContribution, RuntimeLifecycle, type RuntimeLifecycleContext, createRuntimeLifecycle, defineHoloPlugin, defineHoloProject, defineHoloProjectPreparer, defineRedisConfig, holoRedisDefaults, loadHoloPluginBootModules, loadHoloPluginContributionModules, loadHoloPluginDefinitions, normalizeHoloPluginDefinition, normalizeHoloProjectConfig, normalizeRedisConfig, resolveHoloPluginModulePath, resolveNormalizedRedisConnection };
|
|
412
|
+
export { type ConcurrencyOptions, DEFAULT_HOLO_PROJECT_PATHS, DEFAULT_REDIS_CONNECTION, DEFAULT_REDIS_DB, DEFAULT_REDIS_HOST, DEFAULT_REDIS_PORT, type DatabaseLogger, HOLO_PROJECT_PREPARE_API_VERSION, type HoloDatabaseDriver, type HoloGeneratedProjectArtifact, type HoloManagedProjectArtifact, type HoloPluginBroadcastContributions, type HoloPluginCacheContributions, type HoloPluginCliContributions, type HoloPluginConfigContributions, type HoloPluginContributions, type HoloPluginDefinition, type HoloPluginDependencyContributions, type HoloPluginFrameworkContribution, type HoloPluginFrameworkTsconfigKind, type HoloPluginMailContributions, type HoloPluginMigrationContributions, type HoloPluginNotificationContributions, type HoloPluginPackageManager, type HoloPluginProjectContributions, type HoloPluginQueueContributions, type HoloPluginRuntimeContributions, type HoloPluginRuntimeMapContributions, type HoloPluginRuntimeModule, type HoloProjectArtifactContents, type HoloProjectConfig, type HoloProjectConnectionConfig, type HoloProjectDatabaseConfig, type HoloProjectPaths, type HoloProjectPrepareChange, type HoloProjectPrepareChangeKind, type HoloProjectPrepareCommand, type HoloProjectPrepareContext, type HoloProjectPrepareDiagnostic, HoloProjectPrepareError, type HoloProjectPrepareFailure, type HoloProjectPrepareFramework, type HoloProjectPrepareFullRetry, type HoloProjectPrepareLogger, type HoloProjectPrepareModule, type HoloProjectPreparePlugin, type HoloProjectPrepareResult, type HoloProjectPrepareRun, type HoloProjectPrepareSource, type HoloProjectPrepareWatch, type HoloProjectPreparedResult, type HoloProjectPreparer, type HoloRedisClusterNodeConfig, type HoloRedisConfig, type HoloRedisConnectionConfig, type LoadedHoloPluginDefinition, type MigrationErrorLog, type MigrationStartLog, type MigrationSuccessLog, type NormalizedHoloProjectConfig, type NormalizedHoloRedisClusterNodeConfig, type NormalizedHoloRedisConfig, type NormalizedHoloRedisConnectionConfig, type PluginLoadOptions, type QueryErrorLog, type QueryStartLog, type QuerySuccessLog, type RuntimeContribution, RuntimeLifecycle, type RuntimeLifecycleContext, type SeederErrorLog, type SeederStartLog, type SeederSuccessLog, type TransactionLog, type TransactionScopeKind, createRuntimeLifecycle, defineHoloPlugin, defineHoloProject, defineHoloProjectPreparer, defineRedisConfig, holoRedisDefaults, loadHoloPluginBootModules, loadHoloPluginContributionModules, loadHoloPluginDefinitions, normalizeHoloPluginDefinition, normalizeHoloProjectConfig, normalizeRedisConfig, resolveHoloPluginModulePath, resolveNormalizedRedisConnection };
|
package/dist/index.mjs
CHANGED
|
@@ -81,7 +81,7 @@ function createRuntimeLifecycle(contributions) {
|
|
|
81
81
|
|
|
82
82
|
// src/plugins.ts
|
|
83
83
|
import { createRequire } from "module";
|
|
84
|
-
import { readFile } from "fs/promises";
|
|
84
|
+
import { readFile, realpath } from "fs/promises";
|
|
85
85
|
import { dirname, isAbsolute, join, relative, resolve } from "path";
|
|
86
86
|
import { pathToFileURL } from "url";
|
|
87
87
|
function isRecord(value) {
|
|
@@ -176,7 +176,7 @@ async function loadHoloPluginDefinitions(projectRoot, packageNames, options = {}
|
|
|
176
176
|
}
|
|
177
177
|
const entry = normalizeString(manifest.holo.plugin);
|
|
178
178
|
assertPackageRelativePath(packageName, entry);
|
|
179
|
-
const packageRoot = dirname(packageJsonPath);
|
|
179
|
+
const packageRoot = await realpath(dirname(packageJsonPath));
|
|
180
180
|
const entryPath = resolve(packageRoot, entry);
|
|
181
181
|
const relativeEntry = relative(packageRoot, entryPath);
|
|
182
182
|
if (relativeEntry.startsWith("..") || isAbsolute(relativeEntry)) {
|