Skip to content

Commit 9caa93f

Browse files
committed
♻️ replaced glob with tiny-glob. Fixed glob check path #2317
1 parent 292591f commit 9caa93f

File tree

3 files changed

+51
-32
lines changed

3 files changed

+51
-32
lines changed

package-lock.json

Lines changed: 45 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@
120120
"find-up": "^5.0.0",
121121
"fs-extra": "^10.0.0",
122122
"get-port": "^5.1.1",
123-
"glob-promise": "^4.2.2",
124123
"hasha": "^5.2.0",
125124
"image-type": "^4.1.0",
126125
"is-url-superb": "^5.0.0",
@@ -154,6 +153,7 @@
154153
"swagger-ui-express": "^4.1.4",
155154
"tcp-port-used": "^1.0.1",
156155
"terminal-link": "^2.1.1",
156+
"tiny-glob": "^0.2.9",
157157
"tree-kill": "^1.2.2",
158158
"ts-json-schema-generator": "^0.95.0",
159159
"ts-morph": "^12.0.0",

src/cli/collections.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ import {
77
makeConverter,
88
} from 'typeconv'
99
import * as fs from 'fs'
10-
import glob from 'glob-promise'
10+
import glob = require('tiny-glob');
11+
import * as path from 'path';
12+
13+
1114

1215
export const collections = {}
1316

@@ -91,7 +94,7 @@ export const getTypeSchemas : any = async () => {
9194
const { convert } = makeConverter( reader, writer, {
9295
simplify: true
9396
});
94-
const s = (await Promise.all([...(await glob('../**/*.d.ts')),...(await glob('../**/message.js')), ...(await glob('../**/chat.js'))])).filter(f=>!f.includes('node_modules'))
97+
const s = (await Promise.all([...(await glob(path.resolve(__dirname,'../**/*.d.ts'))),...(await glob(path.resolve(__dirname,'../**/message.js'))), ...(await glob(path.resolve(__dirname,'../**/chat.js')))])).filter(f=>!f.includes('node_modules'))
9598
const res = {};
9699
await Promise.all(s.map(async x=>{
97100
const {data} = await convert({ data: fs.readFileSync(x, 'utf8') } );

0 commit comments

Comments
 (0)