Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/typeorm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"dedent": "^1.7.2",
"reflect-metadata": "^0.2.2",
"sql-highlight": "^6.1.0",
"tinyglobby": "^0.2.17",
"tslib": "^2.8.1",
"yargs": "^18.1.0"
},
Expand All @@ -110,7 +109,7 @@
"@types/gulp": "^4.0.18",
"@types/gulp-rename": "^2.0.7",
"@types/mocha": "^10.0.10",
"@types/node": "^20.19.43",
"@types/node": "^22.20.1",
"@types/sinon": "^22.0.0",
"@types/sinon-chai": "^4.0.0",
"@types/source-map-support": "^0.5.10",
Expand Down Expand Up @@ -208,7 +207,7 @@
}
},
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24.11.0"
"node": "^22.13.0 || >=24.11.0"
},
"publishConfig": {
"directory": "build/package"
Expand Down
11 changes: 7 additions & 4 deletions packages/typeorm/src/util/DirectoryExportedClassesLoader.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { globSync } from "tinyglobby"
import type { Logger } from "../logger/Logger"
import { PlatformTools } from "../platform/PlatformTools"
import { importOrRequireFile } from "./ImportUtils"
import { InstanceChecker } from "./InstanceChecker"
import { ObjectUtils } from "./ObjectUtils"
import { glob } from "node:fs/promises"

/**
* Loads all exported classes from the given directory.
Expand Down Expand Up @@ -42,9 +42,12 @@ export async function importClassesFromDirectories(
return allLoaded
}

const allFiles = directories.reduce((allDirs, dir) => {
return allDirs.concat(globSync(PlatformTools.pathNormalize(dir)))
}, [] as string[])
const allFiles = []
for (const dir of directories) {
for await (const file of glob(PlatformTools.pathNormalize(dir))) {
allFiles.push(file)
}
}

if (directories.length > 0 && allFiles.length === 0) {
logger.log(logLevel, `${classesNotFoundMessage} "${directories}"`)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { expect } from "chai"
import fs from "node:fs/promises"
import path from "node:path"
import { glob } from "tinyglobby"

import type { DataSource } from "../../../../src/data-source/DataSource"
import { filepathToName } from "../../../../src/util/PathUtils"
Expand Down Expand Up @@ -88,8 +87,9 @@ describe("multi-database > basic-functionality", () => {
beforeEach(() => reloadTestingDatabases(dataSources))
after(async () => {
await closeTestingConnections(dataSources)
const files = await glob(`${tempPath}/**/*.attach.db`)
await Promise.all(files.map((file) => fs.rm(file, { force: true })))
for await (const file of fs.glob(`${tempPath}/**/*.attach.db`)) {
await fs.rm(file, { force: true })
}
})

it("should correctly attach and create database files", () =>
Expand Down
149 changes: 73 additions & 76 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading