@alpha.consultings/eloquent-orm.js 1.0.10 → 1.1.0
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/CHANGELOG.md +16 -0
- package/PACKAGE-UPDATE-SUMMARY.md +10 -10
- package/README.md +5 -5
- package/dist/Model.d.ts +1 -1
- package/dist/Model.js +3 -3
- package/dist/cli/commands/cacheClear.js +12 -12
- package/dist/cli/commands/cacheStats.js +12 -12
- package/dist/cli/commands/dbSeed.d.ts +1 -1
- package/dist/cli/commands/dbSeed.js +23 -23
- package/dist/cli/commands/dbSeedBootstrapPrecheck.d.ts +1 -1
- package/dist/cli/commands/dbSeedBootstrapPrecheck.js +2 -2
- package/dist/cli/commands/dbSeedFresh.d.ts +1 -1
- package/dist/cli/commands/dbSeedFresh.js +10 -10
- package/dist/cli/commands/demoScenario.js +11 -11
- package/dist/cli/commands/factoryStatus.js +13 -13
- package/dist/cli/commands/makeController.js +11 -11
- package/dist/cli/commands/makeFactory.js +21 -21
- package/dist/cli/commands/makeMigration.d.ts +1 -1
- package/dist/cli/commands/makeMigration.js +19 -17
- package/dist/cli/commands/makeModel.js +30 -30
- package/dist/cli/commands/makeRegistry.d.ts +5 -8
- package/dist/cli/commands/makeRegistry.js +18 -68
- package/dist/cli/commands/makeScenario.js +49 -43
- package/dist/cli/commands/makeSeed.js +12 -9
- package/dist/cli/commands/makeService.js +10 -10
- package/dist/cli/commands/migrateFresh.d.ts +1 -1
- package/dist/cli/commands/migrateFresh.js +14 -14
- package/dist/cli/commands/migrateReset.d.ts +1 -1
- package/dist/cli/commands/migrateReset.js +4 -4
- package/dist/cli/commands/migrateRollback.d.ts +1 -1
- package/dist/cli/commands/migrateRollback.js +36 -36
- package/dist/cli/commands/migrateRun.d.ts +2 -2
- package/dist/cli/commands/migrateRun.js +34 -34
- package/dist/cli/commands/migrateStatus.d.ts +1 -1
- package/dist/cli/commands/migrateStatus.js +16 -16
- package/dist/cli/eloquent.d.ts +1 -1
- package/dist/cli/eloquent.js +30 -30
- package/dist/cli/utils/ArtifactRoutingReport.d.ts +1 -1
- package/dist/cli/utils/ArtifactRoutingReport.js +3 -3
- package/dist/cli/utils/ArtifactStorage.d.ts +2 -2
- package/dist/cli/utils/ArtifactStorage.js +30 -17
- package/dist/cli/utils/AuditTrail.js +2 -2
- package/dist/cli/utils/CliBootstrapSupport.d.ts +1 -1
- package/dist/cli/utils/CliCommandTargets.d.ts +2 -2
- package/dist/cli/utils/CliCommandTargets.js +2 -2
- package/dist/cli/utils/CliMakeArtifactCommandRegistration.js +15 -15
- package/dist/cli/utils/CliMigrationCommandRegistration.js +29 -29
- package/dist/cli/utils/CliProductionGuards.d.ts +1 -1
- package/dist/cli/utils/CliProductionGuards.js +6 -6
- package/dist/cli/utils/CliScaffoldCommandRegistration.js +13 -13
- package/dist/cli/utils/CliSeedScenarioCommandRegistration.js +23 -23
- package/dist/cli/utils/CliSupportCommandRegistration.js +8 -8
- package/dist/cli/utils/ImportResolver.d.ts +12 -3
- package/dist/cli/utils/ImportResolver.js +76 -17
- package/dist/cli/utils/ModelIntrospector.d.ts +1 -1
- package/dist/cli/utils/ModelIntrospector.js +4 -4
- package/dist/cli/utils/ScaffoldGeneratorSupport.js +2 -2
- package/dist/cli/utils/ScenarioMorphAliasRouting.js +8 -8
- package/dist/cli/utils/SeedBootstrapPrecheck.d.ts +1 -1
- package/dist/cli/utils/SeedBootstrapPrecheck.js +10 -10
- package/dist/cli/utils/TemplateEngine.js +2 -2
- package/dist/cli/utils/factories/Factory.d.ts +1 -1
- package/dist/cli/utils/factories/FactoryDisplay.d.ts +1 -1
- package/dist/cli/utils/factories/FactoryGraph.js +5 -5
- package/dist/cli/utils/factories/FactoryLoader.d.ts +1 -1
- package/dist/cli/utils/factories/FactoryLoader.js +4 -4
- package/dist/cli/utils/factories/FactoryRegistry.d.ts +3 -3
- package/dist/cli/utils/factories/FactoryRegistry.js +10 -10
- package/dist/cli/utils/migrations/MigrationLockStrategy.d.ts +1 -1
- package/dist/cli/utils/migrations/MigrationLockStrategy.js +2 -2
- package/dist/cli/utils/migrations/MigrationTracker.d.ts +2 -2
- package/dist/cli/utils/migrations/MigrationTracker.js +6 -6
- package/dist/cli/utils/migrations/MongoMigrationTracker.js +3 -3
- package/dist/cli/utils/resolveConnectionFlags.d.ts +1 -1
- package/dist/cli/utils/resolveConnectionFlags.js +3 -3
- package/dist/cli/utils/resolveSqlConnectionFlags.d.ts +1 -1
- package/dist/cli/utils/typescript/BaseCommand.d.ts +1 -1
- package/dist/cli/utils/typescript/BaseCommand.js +3 -3
- package/dist/cli/utils/typescript/TypeScriptCompiler.js +0 -1
- package/dist/cli/utils/typescript/tsRuntime.js +26 -4
- package/dist/config/database.js +9 -9
- package/dist/core/cache/CacheFallbackManager.d.ts +1 -1
- package/dist/core/cache/CacheManager.d.ts +1 -1
- package/dist/core/cache/CacheManager.js +2 -2
- package/dist/core/cache/CacheRegistry.js +4 -4
- package/dist/core/cache/drivers/FileCacheDriver.d.ts +1 -1
- package/dist/core/cache/drivers/FileCacheDriver.js +2 -2
- package/dist/core/cache/drivers/MemcachedCacheDriver.d.ts +1 -1
- package/dist/core/cache/drivers/MemcachedCacheDriver.js +2 -2
- package/dist/core/cache/drivers/MemoryCacheDriver.d.ts +1 -1
- package/dist/core/cache/drivers/MemoryCacheDriver.js +2 -2
- package/dist/core/cache/setupCache.js +12 -12
- package/dist/core/connection/ConnectionFactory.d.ts +2 -2
- package/dist/core/connection/ConnectionFactory.js +9 -9
- package/dist/core/connection/DatabaseConnection.d.ts +2 -2
- package/dist/core/connection/DatabaseConnection.js +4 -4
- package/dist/core/connection/DriverAdapter.d.ts +1 -1
- package/dist/core/connection/DriverAdapter.js +2 -2
- package/dist/core/connection/resolveConnectionName.d.ts +1 -1
- package/dist/core/connection/resolveConnectionName.js +7 -7
- package/dist/core/model/BaseModel.d.ts +31 -30
- package/dist/core/model/BaseModel.js +38 -38
- package/dist/core/model/BaseModelSafeFinderStatics.d.ts +1 -1
- package/dist/core/model/BaseModelSafeFinderStatics.js +19 -19
- package/dist/core/model/CoreModel.d.ts +6 -4
- package/dist/core/model/CoreModel.js +28 -28
- package/dist/core/model/CoreModelPersistenceState.d.ts +1 -1
- package/dist/core/model/CoreModelSafeFinderSupport.d.ts +2 -2
- package/dist/core/model/CoreModelSafeFinderSupport.js +2 -2
- package/dist/core/model/CoreModelValidationEvents.d.ts +2 -2
- package/dist/core/model/CoreModelValidationEvents.js +2 -2
- package/dist/core/model/SafeFinder.d.ts +1 -1
- package/dist/core/model/SafeFinder.js +2 -2
- package/dist/core/orm/mixins/CastsMixin.js +2 -2
- package/dist/core/orm/mixins/HooksMixin.js +8 -8
- package/dist/core/orm/mixins/MorphableMixin.js +4 -4
- package/dist/core/orm/mixins/PivotHelperMixin.js +3 -3
- package/dist/core/orm/mixins/QueryCacheMixin.js +20 -20
- package/dist/core/orm/mixins/ScopeMixin.js +2 -2
- package/dist/core/orm/mixins/SoftDeletesMixin.js +2 -2
- package/dist/core/orm/mixins/utils/HookStore.d.ts +1 -1
- package/dist/core/orm/mixins/utils/HookStore.js +2 -2
- package/dist/core/orm/mixins/utils/modelRegistration.d.ts +1 -1
- package/dist/core/orm/mixins/utils/modelRegistration.js +6 -6
- package/dist/core/orm/relations/BelongsTo.d.ts +1 -1
- package/dist/core/orm/relations/BelongsTo.js +2 -2
- package/dist/core/orm/relations/BelongsToMany.d.ts +1 -1
- package/dist/core/orm/relations/BelongsToMany.js +2 -2
- package/dist/core/orm/relations/HasMany.d.ts +1 -1
- package/dist/core/orm/relations/HasMany.js +2 -2
- package/dist/core/orm/relations/HasOne.d.ts +1 -1
- package/dist/core/orm/relations/HasOne.js +2 -2
- package/dist/core/orm/relations/MorphMany.d.ts +1 -1
- package/dist/core/orm/relations/MorphMany.js +2 -2
- package/dist/core/orm/relations/MorphOne.d.ts +1 -1
- package/dist/core/orm/relations/MorphOne.js +2 -2
- package/dist/core/orm/relations/MorphTo.d.ts +1 -1
- package/dist/core/orm/relations/MorphTo.js +5 -5
- package/dist/core/schema/SchemaBlueprint.d.ts +21 -0
- package/dist/core/schema/SchemaBuilder.d.ts +16 -3
- package/dist/core/schema/SchemaBuilder.js +191 -48
- package/dist/core/schema/SchemaValidator.d.ts +1 -1
- package/dist/core/security/AbstractSecurity.d.ts +1 -1
- package/dist/core/security/EnvKeySecurity.d.ts +1 -1
- package/dist/core/security/EnvKeySecurity.js +2 -2
- package/dist/core/security/NoSecurity.d.ts +1 -1
- package/dist/core/security/NoSecurity.js +2 -2
- package/dist/core/security/SecurityFactory.d.ts +1 -1
- package/dist/core/security/SecurityFactory.js +4 -4
- package/dist/core/security/index.d.ts +5 -5
- package/dist/core/security/index.js +5 -5
- package/dist/index.d.ts +10 -10
- package/dist/index.js +30 -30
- package/esm/Factory.mjs +113 -136
- package/esm/Model.mjs +4 -0
- package/esm/index.mjs +23 -28
- package/package.json +14 -5
- package/src/cli/templates/factory.tpl +1 -1
- package/src/cli/templates/seed.tpl +1 -1
package/esm/Factory.mjs
CHANGED
|
@@ -1,143 +1,120 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const base = this.definition(index);
|
|
8
|
-
const merged = { ...base, ...attrs };
|
|
9
|
-
|
|
10
|
-
if (this.beforeCreate) {
|
|
11
|
-
const modified = await this.beforeCreate(merged, index);
|
|
12
|
-
if (modified && typeof modified === "object") {
|
|
13
|
-
Object.assign(merged, modified);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
let instance = new this.model();
|
|
18
|
-
|
|
19
|
-
if (this.#hasInstanceCreate(instance)) {
|
|
20
|
-
const created = await instance.create(merged);
|
|
21
|
-
if (created) {
|
|
22
|
-
instance = created;
|
|
23
|
-
}
|
|
24
|
-
} else if (this.#hasStaticCreate(this.model)) {
|
|
25
|
-
return this.model.create(merged);
|
|
26
|
-
} else if (this.#hasInstanceSave(instance)) {
|
|
27
|
-
Object.assign(instance, merged);
|
|
28
|
-
await instance.save();
|
|
29
|
-
} else {
|
|
30
|
-
throw new Error(`Model '${this.model.name}' has no valid create/save method.`);
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
let cachedFaker;
|
|
4
|
+
function getFaker() {
|
|
5
|
+
if (!cachedFaker) {
|
|
6
|
+
cachedFaker = require("@faker-js/faker").faker;
|
|
31
7
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return instance;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async createMany(count, callback, concurrency = 1) {
|
|
41
|
-
const results = [];
|
|
42
|
-
|
|
43
|
-
const executeCreate = async (index) => {
|
|
44
|
-
const model = await this.create({}, index);
|
|
45
|
-
if (callback) {
|
|
46
|
-
await callback(model, index);
|
|
47
|
-
}
|
|
48
|
-
results[index] = model;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
if (concurrency <= 1) {
|
|
52
|
-
for (let index = 0; index < count; index += 1) {
|
|
53
|
-
await executeCreate(index);
|
|
54
|
-
}
|
|
55
|
-
return results;
|
|
8
|
+
return cachedFaker;
|
|
9
|
+
}
|
|
10
|
+
export class Factory {
|
|
11
|
+
get faker() {
|
|
12
|
+
return getFaker();
|
|
56
13
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
14
|
+
async create(attrs = {}, index = 0) {
|
|
15
|
+
const base = this.definition(index);
|
|
16
|
+
const merged = { ...base, ...attrs };
|
|
17
|
+
if (this.beforeCreate) {
|
|
18
|
+
const modified = await this.beforeCreate(merged, index);
|
|
19
|
+
if (modified && typeof modified === "object") {
|
|
20
|
+
Object.assign(merged, modified);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
let instance = new this.model();
|
|
24
|
+
if (this.hasInstanceCreate(instance)) {
|
|
25
|
+
const created = await instance.create(merged);
|
|
26
|
+
if (created) {
|
|
27
|
+
instance = created;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (this.hasStaticCreate(this.model)) {
|
|
31
|
+
return this.model.create(merged);
|
|
32
|
+
}
|
|
33
|
+
else if (this.hasInstanceSave(instance)) {
|
|
34
|
+
Object.assign(instance, merged);
|
|
35
|
+
await instance.save();
|
|
67
36
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const next = () => {
|
|
71
|
-
if (settled) {
|
|
72
|
-
return;
|
|
37
|
+
else {
|
|
38
|
+
throw new Error(`Model '${this.model.name}' has no valid create/save method.`);
|
|
73
39
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const currentIndex = index++;
|
|
77
|
-
active += 1;
|
|
78
|
-
|
|
79
|
-
void executeCreate(currentIndex)
|
|
80
|
-
.catch((error) => {
|
|
81
|
-
if (settled) {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
settled = true;
|
|
85
|
-
reject(error);
|
|
86
|
-
})
|
|
87
|
-
.finally(() => {
|
|
88
|
-
active -= 1;
|
|
89
|
-
if (settled) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
next();
|
|
93
|
-
});
|
|
40
|
+
if (this.afterCreate) {
|
|
41
|
+
await this.afterCreate(instance);
|
|
94
42
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
43
|
+
return instance;
|
|
44
|
+
}
|
|
45
|
+
async createMany(count, callback, concurrency = 1) {
|
|
46
|
+
const results = [];
|
|
47
|
+
const executeCreate = async (itemIndex) => {
|
|
48
|
+
const model = await this.create({}, itemIndex);
|
|
49
|
+
if (callback) {
|
|
50
|
+
await callback(model, itemIndex);
|
|
51
|
+
}
|
|
52
|
+
results[itemIndex] = model;
|
|
53
|
+
};
|
|
54
|
+
if (concurrency <= 1) {
|
|
55
|
+
for (let itemIndex = 0; itemIndex < count; itemIndex += 1) {
|
|
56
|
+
await executeCreate(itemIndex);
|
|
57
|
+
}
|
|
58
|
+
return results;
|
|
59
|
+
}
|
|
60
|
+
let active = 0;
|
|
61
|
+
let itemIndex = 0;
|
|
62
|
+
let settled = false;
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
const maybeResolve = () => {
|
|
65
|
+
if (!settled && itemIndex >= count && active === 0) {
|
|
66
|
+
settled = true;
|
|
67
|
+
resolve(results);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const next = () => {
|
|
71
|
+
if (settled) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
while (active < concurrency && itemIndex < count && !settled) {
|
|
75
|
+
const currentIndex = itemIndex++;
|
|
76
|
+
active += 1;
|
|
77
|
+
void executeCreate(currentIndex)
|
|
78
|
+
.catch((error) => {
|
|
79
|
+
if (settled) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
settled = true;
|
|
83
|
+
reject(error);
|
|
84
|
+
})
|
|
85
|
+
.finally(() => {
|
|
86
|
+
active -= 1;
|
|
87
|
+
if (settled) {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
next();
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
maybeResolve();
|
|
94
|
+
};
|
|
95
|
+
next();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
async related(factoryOrCtor, count = 1) {
|
|
99
|
+
const factory = typeof factoryOrCtor === "function"
|
|
100
|
+
? new factoryOrCtor()
|
|
101
|
+
: factoryOrCtor;
|
|
102
|
+
if (count === 1) {
|
|
103
|
+
return factory.create();
|
|
104
|
+
}
|
|
105
|
+
return factory.createMany(count);
|
|
106
|
+
}
|
|
107
|
+
async relatedPivot(factory, pivotTable, foreignKey, relatedKey, foreignId, relatedIds, extraPivotAttrs) {
|
|
108
|
+
await factory.createPivot(foreignId, relatedIds, extraPivotAttrs);
|
|
109
|
+
console.log(`[Pivot Attached] Table "${pivotTable}" (${foreignKey} -> ${relatedKey})`);
|
|
110
|
+
}
|
|
111
|
+
hasInstanceCreate(obj) {
|
|
112
|
+
return typeof obj.create === "function";
|
|
113
|
+
}
|
|
114
|
+
hasStaticCreate(ctor) {
|
|
115
|
+
return typeof ctor.create === "function";
|
|
116
|
+
}
|
|
117
|
+
hasInstanceSave(obj) {
|
|
118
|
+
return typeof obj.save === "function";
|
|
111
119
|
}
|
|
112
|
-
|
|
113
|
-
return factory.createMany(count);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
async relatedPivot(
|
|
117
|
-
factory,
|
|
118
|
-
pivotTable,
|
|
119
|
-
foreignKey,
|
|
120
|
-
relatedKey,
|
|
121
|
-
foreignId,
|
|
122
|
-
relatedIds,
|
|
123
|
-
extraPivotAttrs
|
|
124
|
-
) {
|
|
125
|
-
await factory.createPivot(foreignId, relatedIds, extraPivotAttrs);
|
|
126
|
-
|
|
127
|
-
console.log(
|
|
128
|
-
`[Pivot Attached] Table "${pivotTable}" (${foreignKey} -> ${relatedKey})`
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
#hasInstanceCreate(obj) {
|
|
133
|
-
return typeof obj?.create === "function";
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
#hasStaticCreate(ctor) {
|
|
137
|
-
return typeof ctor?.create === "function";
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
#hasInstanceSave(obj) {
|
|
141
|
-
return typeof obj?.save === "function";
|
|
142
|
-
}
|
|
143
120
|
}
|
package/esm/Model.mjs
ADDED
package/esm/index.mjs
CHANGED
|
@@ -1,32 +1,27 @@
|
|
|
1
1
|
import cjsPackage from "../dist/index.js";
|
|
2
2
|
import { Factory } from "./Factory.mjs";
|
|
3
|
-
|
|
4
|
-
export { Factory };
|
|
5
|
-
|
|
6
|
-
export const {
|
|
7
|
-
BaseModel,
|
|
8
|
-
Model,
|
|
9
|
-
SqlModel,
|
|
10
|
-
MongoModel,
|
|
11
|
-
MorphRegistry,
|
|
12
|
-
PivotHelperMixin,
|
|
13
|
-
CoreModel,
|
|
14
|
-
column,
|
|
15
|
-
validate,
|
|
16
|
-
relation,
|
|
17
|
-
mixin,
|
|
18
|
-
validateSchema,
|
|
19
|
-
SchemaValidator,
|
|
20
|
-
SchemaBuilder,
|
|
21
|
-
CacheManager,
|
|
22
|
-
setupCache,
|
|
23
|
-
registerModels,
|
|
24
|
-
isModelRegistered,
|
|
25
|
-
setModelRegistryStrictMode,
|
|
26
|
-
isModelRegistryStrictMode,
|
|
27
|
-
} = cjsPackage;
|
|
28
|
-
|
|
3
|
+
const { BaseModel, Model, SqlModel, MongoModel, MorphRegistry, PivotHelperMixin, CoreModel, column, validate, relation, mixin, validateSchema, SchemaValidator, SchemaBuilder, CacheManager, setupCache, registerModels, isModelRegistered, setModelRegistryStrictMode, isModelRegistryStrictMode, } = cjsPackage;
|
|
4
|
+
export { BaseModel, Model, SqlModel, MongoModel, MorphRegistry, PivotHelperMixin, CoreModel, column, validate, relation, mixin, validateSchema, SchemaValidator, SchemaBuilder, CacheManager, setupCache, registerModels, isModelRegistered, setModelRegistryStrictMode, isModelRegistryStrictMode, Factory, };
|
|
29
5
|
export default {
|
|
30
|
-
|
|
31
|
-
|
|
6
|
+
BaseModel,
|
|
7
|
+
Model,
|
|
8
|
+
SqlModel,
|
|
9
|
+
MongoModel,
|
|
10
|
+
MorphRegistry,
|
|
11
|
+
PivotHelperMixin,
|
|
12
|
+
CoreModel,
|
|
13
|
+
column,
|
|
14
|
+
validate,
|
|
15
|
+
relation,
|
|
16
|
+
mixin,
|
|
17
|
+
validateSchema,
|
|
18
|
+
SchemaValidator,
|
|
19
|
+
SchemaBuilder,
|
|
20
|
+
CacheManager,
|
|
21
|
+
setupCache,
|
|
22
|
+
registerModels,
|
|
23
|
+
isModelRegistered,
|
|
24
|
+
setModelRegistryStrictMode,
|
|
25
|
+
isModelRegistryStrictMode,
|
|
26
|
+
Factory,
|
|
32
27
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alpha.consultings/eloquent-orm.js",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "A Laravel Eloquent-inspired ORM Multi Driver SQL & NoSQL and Cache System and Artisan CLI like for Node.js Lovers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"orm",
|
|
@@ -58,8 +58,9 @@
|
|
|
58
58
|
},
|
|
59
59
|
"./Model": {
|
|
60
60
|
"types": "./dist/Model.d.ts",
|
|
61
|
+
"import": "./esm/Model.mjs",
|
|
61
62
|
"require": "./dist/Model.js",
|
|
62
|
-
"default": "./
|
|
63
|
+
"default": "./esm/Model.mjs"
|
|
63
64
|
},
|
|
64
65
|
"./package.json": "./package.json"
|
|
65
66
|
},
|
|
@@ -78,9 +79,11 @@
|
|
|
78
79
|
"docs:sync-package-metadata": "node scripts/sync-package-metadata.cjs",
|
|
79
80
|
"docs:sync-supported": "node scripts/sync-supported-versions.cjs",
|
|
80
81
|
"docs:sync-config": "node scripts/sync-mintlify-configs.cjs",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
82
|
+
"audit:nodenext-blockers": "node scripts/generate-nodenext-blocker-inventory.cjs",
|
|
83
|
+
"clean": "node -e \"const fs=require('fs'); fs.rmSync('dist', { recursive: true, force: true }); fs.rmSync('esm', { recursive: true, force: true })\"",
|
|
84
|
+
"build": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run clean && tsc -p tsconfig.build.json && tsc -p tsconfig.esm.json && node scripts/patch-dist-cjs-factory-entry.cjs",
|
|
83
85
|
"typecheck": "tsc -p . --noEmit --skipLibCheck",
|
|
86
|
+
"typecheck:nodenext": "tsc -p . --noEmit --skipLibCheck",
|
|
84
87
|
"docs:dev": "npm run docs:sync-package-metadata && npm run docs:sync-config && node scripts/run-mintlify.cjs dev",
|
|
85
88
|
"docs:build": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run docs:sync-config && node scripts/run-mintlify.cjs validate",
|
|
86
89
|
"docs:validate": "npm run docs:sync-package-metadata && npm run docs:sync-supported && npm run docs:sync-config && node scripts/run-mintlify.cjs validate",
|
|
@@ -91,7 +94,8 @@
|
|
|
91
94
|
"coverage:misses": "npm run test:coverage && node scripts/coverage-misses.cjs",
|
|
92
95
|
"test:critical": "jest --runInBand src/lab_test/cli.integration.scenario.lifecycle.test.ts src/lab_test/cli.integration.make-migration.targeting.test.ts src/lab_test/cli.integration.migrate.targeting.test.ts src/lab_test/cli.integration.seed-and-demo.targeting.test.ts src/lab_test/cli.integration.factory-status.targeting.test.ts src/lab_test/migration.tracker.logic.test.ts src/lab_test/cache.commands.logic.test.ts",
|
|
93
96
|
"test:pack-smoke": "npm run build && node scripts/pack-smoke.js",
|
|
94
|
-
"test:
|
|
97
|
+
"test:coverage:docker": "docker compose -f docker-compose.coverage-debug.yml build --no-cache coverage-debug && docker compose -f docker-compose.coverage-debug.yml run --rm coverage-debug",
|
|
98
|
+
"test:pack-smoke:docker": "docker compose -f docker-compose.coverage-debug.yml build --no-cache pack-smoke && docker compose -f docker-compose.coverage-debug.yml run --rm pack-smoke",
|
|
95
99
|
"dev": "ts-node src/index.ts",
|
|
96
100
|
"cli": "ts-node bin/eloquent.ts",
|
|
97
101
|
"release": "npm run docs:sync-package-metadata && npm run docs:sync-supported && semantic-release"
|
|
@@ -128,5 +132,10 @@
|
|
|
128
132
|
"jest": "^30.2.0",
|
|
129
133
|
"semantic-release": "^24.2.9",
|
|
130
134
|
"ts-jest": "^29.4.5"
|
|
135
|
+
},
|
|
136
|
+
"overrides": {
|
|
137
|
+
"@mintlify/link-rot": {
|
|
138
|
+
"@mintlify/scraping": "4.0.688"
|
|
139
|
+
}
|
|
131
140
|
}
|
|
132
141
|
}
|