@mikro-orm/core 7.0.0-dev.20 → 7.0.0-dev.22
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/cache/FileCacheAdapter.js +2 -2
- package/metadata/MetadataDiscovery.js +2 -2
- package/package.json +5 -6
- package/utils/Utils.d.ts +2 -2
- package/utils/Utils.js +3 -3
- package/exports.d.ts +0 -24
- package/exports.js +0 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { globSync } from 'tinyglobby';
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync, unlinkSync } from 'node:fs';
|
|
3
3
|
import { Utils } from '../utils/Utils.js';
|
|
4
4
|
export class FileCacheAdapter {
|
|
@@ -51,7 +51,7 @@ export class FileCacheAdapter {
|
|
|
51
51
|
*/
|
|
52
52
|
clear() {
|
|
53
53
|
const path = this.path('*');
|
|
54
|
-
const files =
|
|
54
|
+
const files = globSync(path);
|
|
55
55
|
files.forEach(file => unlinkSync(file));
|
|
56
56
|
this.cache = {};
|
|
57
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { basename, extname } from 'node:path';
|
|
2
|
-
import
|
|
2
|
+
import { glob } from 'tinyglobby';
|
|
3
3
|
import { EntityMetadata, } from '../typings.js';
|
|
4
4
|
import { Utils } from '../utils/Utils.js';
|
|
5
5
|
import { MetadataValidator } from './MetadataValidator.js';
|
|
@@ -181,7 +181,7 @@ export class MetadataDiscovery {
|
|
|
181
181
|
}
|
|
182
182
|
async discoverDirectories(paths) {
|
|
183
183
|
paths = paths.map(path => Utils.normalizePath(path));
|
|
184
|
-
const files = await
|
|
184
|
+
const files = await glob(paths, { cwd: Utils.normalizePath(this.config.get('baseDir')) });
|
|
185
185
|
this.logger.log('discovery', `- processing ${colors.cyan('' + files.length)} files`);
|
|
186
186
|
const found = [];
|
|
187
187
|
for (const filepath of files) {
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.22",
|
|
5
5
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
8
|
-
".": "./index.js"
|
|
9
|
-
"./exports.js": "./exports.js"
|
|
8
|
+
".": "./index.js"
|
|
10
9
|
},
|
|
11
10
|
"repository": {
|
|
12
11
|
"type": "git",
|
|
@@ -55,8 +54,8 @@
|
|
|
55
54
|
"dataloader": "2.2.3",
|
|
56
55
|
"dotenv": "16.5.0",
|
|
57
56
|
"esprima": "4.0.1",
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
57
|
+
"mikro-orm": "7.0.0-dev.22",
|
|
58
|
+
"reflect-metadata": "0.2.2",
|
|
59
|
+
"tinyglobby": "0.2.13"
|
|
61
60
|
}
|
|
62
61
|
}
|
package/utils/Utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type GlobOptions } from 'tinyglobby';
|
|
2
2
|
import type { Dictionary, EntityData, EntityDictionary, EntityKey, EntityMetadata, EntityName, EntityProperty, IMetadataStorage, Primary } from '../typings.js';
|
|
3
3
|
import type { Collection } from '../entity/Collection.js';
|
|
4
4
|
import type { Platform } from '../platforms/Platform.js';
|
|
@@ -212,7 +212,7 @@ export declare class Utils {
|
|
|
212
212
|
static findDuplicates<T>(items: T[]): T[];
|
|
213
213
|
static removeDuplicates<T>(items: T[]): T[];
|
|
214
214
|
static randomInt(min: number, max: number): number;
|
|
215
|
-
static pathExists(path: string, options?:
|
|
215
|
+
static pathExists(path: string, options?: GlobOptions): Promise<boolean>;
|
|
216
216
|
/**
|
|
217
217
|
* Extracts all possible values of a TS enum. Works with both string and numeric enums.
|
|
218
218
|
*/
|
package/utils/Utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
|
-
import
|
|
2
|
+
import { glob, isDynamicPattern } from 'tinyglobby';
|
|
3
3
|
import { extname, isAbsolute, join, normalize, relative, resolve } from 'node:path';
|
|
4
4
|
import { platform } from 'node:os';
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
@@ -800,8 +800,8 @@ export class Utils {
|
|
|
800
800
|
return Math.round(Math.random() * (max - min)) + min;
|
|
801
801
|
}
|
|
802
802
|
static async pathExists(path, options = {}) {
|
|
803
|
-
if (
|
|
804
|
-
const found = await
|
|
803
|
+
if (isDynamicPattern(path)) {
|
|
804
|
+
const found = await glob(path, options);
|
|
805
805
|
return found.length > 0;
|
|
806
806
|
}
|
|
807
807
|
return this.pathExistsSync(path);
|
package/exports.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* @module core
|
|
4
|
-
*/
|
|
5
|
-
export { Constructor, ConnectionType, Dictionary, PrimaryKeyProp, Primary, IPrimaryKey, ObjectQuery, FilterQuery, IWrappedEntity, EntityName, EntityData, Highlighter, MaybePromise, AnyEntity, EntityClass, EntityProperty, EntityMetadata, QBFilterQuery, PopulateOptions, Populate, Loaded, New, LoadedReference, LoadedCollection, IMigrator, IMigrationGenerator, MigratorEvent, GetRepository, EntityRepositoryType, MigrationObject, DeepPartial, PrimaryProperty, Cast, IsUnknown, EntityDictionary, EntityDTO, MigrationDiff, GenerateOptions, FilterObject, IEntityGenerator, ISeedManager, EntityClassGroup, OptionalProps, EagerProps, HiddenProps, RequiredEntityData, CheckCallback, SimpleColumnMeta, Rel, Ref, ScalarRef, EntityRef, ISchemaGenerator, UmzugMigration, MigrateOptions, MigrationResult, MigrationRow, EntityKey, EntityValue, EntityDataValue, FilterKey, Opt, EntityType, FromEntityType, Selected, IsSubset, NoInfer, EntityProps, ExpandProperty, ExpandScalar, FilterItemValue, ExpandQuery, Scalar, ExpandHint, Hidden, FilterValue, MergeLoaded, MergeSelected, Config, DefineConfig, TypeConfig, ClearDatabaseOptions, CreateSchemaOptions, EnsureDatabaseOptions, UpdateSchemaOptions, DropSchemaOptions, RefreshDatabaseOptions, AutoPath, UnboxArray, MetadataProcessor, ImportsResolver, } from './typings.js';
|
|
6
|
-
export * from './enums.js';
|
|
7
|
-
export * from './errors.js';
|
|
8
|
-
export * from './exceptions.js';
|
|
9
|
-
export * from './entity/index.js';
|
|
10
|
-
export * from './serialization/index.js';
|
|
11
|
-
export * from './events/index.js';
|
|
12
|
-
export { CreateOptions, MergeOptions, ForkOptions } from './EntityManager.js';
|
|
13
|
-
export * from './unit-of-work/index.js';
|
|
14
|
-
export * from './utils/index.js';
|
|
15
|
-
export * from './logging/index.js';
|
|
16
|
-
export * from './hydration/index.js';
|
|
17
|
-
export * from './drivers/index.js';
|
|
18
|
-
export * from './connections/index.js';
|
|
19
|
-
export * from './platforms/index.js';
|
|
20
|
-
export * from './types/index.js';
|
|
21
|
-
export * from './naming-strategy/index.js';
|
|
22
|
-
export * from './metadata/index.js';
|
|
23
|
-
export * from './cache/index.js';
|
|
24
|
-
export * from './decorators/index.js';
|
package/exports.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @packageDocumentation
|
|
3
|
-
* @module core
|
|
4
|
-
*/
|
|
5
|
-
export { PrimaryKeyProp, EntityMetadata, EntityRepositoryType, OptionalProps, EagerProps, HiddenProps, Config, } from './typings.js';
|
|
6
|
-
export * from './enums.js';
|
|
7
|
-
export * from './errors.js';
|
|
8
|
-
export * from './exceptions.js';
|
|
9
|
-
export * from './entity/index.js';
|
|
10
|
-
export * from './serialization/index.js';
|
|
11
|
-
export * from './events/index.js';
|
|
12
|
-
export * from './unit-of-work/index.js';
|
|
13
|
-
export * from './utils/index.js';
|
|
14
|
-
export * from './logging/index.js';
|
|
15
|
-
export * from './hydration/index.js';
|
|
16
|
-
export * from './drivers/index.js';
|
|
17
|
-
export * from './connections/index.js';
|
|
18
|
-
export * from './platforms/index.js';
|
|
19
|
-
export * from './types/index.js';
|
|
20
|
-
export * from './naming-strategy/index.js';
|
|
21
|
-
export * from './metadata/index.js';
|
|
22
|
-
export * from './cache/index.js';
|
|
23
|
-
export * from './decorators/index.js';
|