@mikro-orm/core 7.0.0-dev.20 → 7.0.0-dev.21

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.
@@ -1,4 +1,4 @@
1
- import globby from 'globby';
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 = globby.sync(path);
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 globby from 'globby';
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 globby(paths, { cwd: Utils.normalizePath(this.config.get('baseDir')) });
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,7 +1,7 @@
1
1
  {
2
2
  "name": "@mikro-orm/core",
3
3
  "type": "module",
4
- "version": "7.0.0-dev.20",
4
+ "version": "7.0.0-dev.21",
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",
@@ -55,8 +55,8 @@
55
55
  "dataloader": "2.2.3",
56
56
  "dotenv": "16.5.0",
57
57
  "esprima": "4.0.1",
58
- "globby": "11.1.0",
59
- "mikro-orm": "7.0.0-dev.20",
60
- "reflect-metadata": "0.2.2"
58
+ "mikro-orm": "7.0.0-dev.21",
59
+ "reflect-metadata": "0.2.2",
60
+ "tinyglobby": "0.2.13"
61
61
  }
62
62
  }
package/utils/Utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { type GlobbyOptions } from 'globby';
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?: GlobbyOptions): Promise<boolean>;
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 globby from 'globby';
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 (globby.hasMagic(path)) {
804
- const found = await globby(path, options);
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);