Skip to content

Commit

Permalink
refactor: replace glob module
Browse files Browse the repository at this point in the history
  • Loading branch information
czy88840616 committed Jun 16, 2020
1 parent 413a4c6 commit d26899e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 16 deletions.
22 changes: 11 additions & 11 deletions README.md
Expand Up @@ -55,17 +55,17 @@ See [midway-examples](https://github.com/midwayjs/midway-examples).

midway is comprised of many specialized packages. This repository contains all these packages. Below you will find a summary of each package.

| Package | Version | Dependencies | DevDependencies | quality |
|--------|-------|------------|----------|----------|
| [`midway`] | [![midway-svg]][midway-ch] | [![midway-d-svg]][midway-d-link] | [![midway-dd-svg]][midway-dd-link] | [![midway-q-svg]][midway-q-link] |
| [`midway-web`] | [![web-svg]][web-ch] | [![web-d-svg]][web-d-link] | [![web-dd-svg]][web-dd-link] | [![web-q-svg]][web-q-link] |
| [`midway-core`] | [![core-svg]][core-ch] | [![core-d-svg]][core-d-link] | [![core-dd-svg]][core-dd-link] | [![core-q-svg]][core-q-link] |
| [`midway-mock`] | [![mock-svg]][mock-ch] | [![mock-d-svg]][mock-d-link] | [![mock-dd-svg]][mock-dd-link] | [![mock-q-svg]][mock-q-link] |
| [`midway-init`] | [![init-svg]][init-ch] | [![init-d-svg]][init-d-link] | [![init-dd-svg]][init-dd-link] | [![init-q-svg]][init-q-link] |
| [`midway-bin`] | [![bin-svg]][bin-ch] | [![bin-d-svg]][bin-d-link] | [![bin-dd-svg]][bin-dd-link] | [![bin-q-svg]][bin-q-link] |
| [`midway-schedule`] | [![sch-svg]][sch-ch] | [![sch-d-svg]][sch-d-link] | [![sch-dd-svg]][sch-dd-link] | [![sch-q-svg]][sch-q-link] |

Globally: [![Build Status](https://img.shields.io/travis/midwayjs/midway/master.svg?style=flat)](https://travis-ci.org/midwayjs/midway) [![devDependency Status](https://david-dm.org/midwayjs/midway/dev-status.svg)](https://david-dm.org/midwayjs/midway#info=devDependencies)
| Package | Version | quality |
|--------|-------|------------|
| [`midway`] | [![midway-svg]][midway-ch] | [![midway-q-svg]][midway-q-link] |
| [`midway-web`] | [![web-svg]][web-ch] | [![web-q-svg]][web-q-link] |
| [`midway-core`] | [![core-svg]][core-ch] | [![core-q-svg]][core-q-link] |
| [`midway-mock`] | [![mock-svg]][mock-ch] | [![mock-q-svg]][mock-q-link] |
| [`midway-init`] | [![init-svg]][init-ch] | [![init-q-svg]][init-q-link] |
| [`midway-bin`] | [![bin-svg]][bin-ch] | [![bin-q-svg]][bin-q-link] |
| [`midway-schedule`] | [![sch-svg]][sch-ch] | [![sch-q-svg]][sch-q-link] |

Globally: [![Build Status](https://img.shields.io/travis/midwayjs/midway/master.svg?style=flat)](https://travis-ci.org/midwayjs/midway)

## Contributors

Expand Down
2 changes: 1 addition & 1 deletion packages/midway-core/package.json
Expand Up @@ -29,9 +29,9 @@
},
"dependencies": {
"@midwayjs/decorator": "^1.18.6",
"@midwayjs/glob": "^1.0.2",
"camelcase": "^5.2.0",
"debug": "^4.1.1",
"globby": "^10.0.1",
"graphviz": "^0.0.8",
"injection": "^1.8.0",
"is-type-of": "^1.2.1"
Expand Down
7 changes: 3 additions & 4 deletions packages/midway-core/src/container.ts
@@ -1,5 +1,4 @@
import { CLASS_KEY_CONSTRUCTOR, CONFIG_KEY, LOGGER_KEY, PLUGIN_KEY } from '@midwayjs/decorator';
import * as globby from 'globby';
import {
Autowire,
Container,
Expand All @@ -23,6 +22,7 @@ import {
import * as is from 'is-type-of';
import * as path from 'path';
import { FUNCTION_INJECT_KEY, MidwayHandlerKey } from './constant';
import { run } from '@midwayjs/glob';

const graphviz = require('graphviz');
const camelcase = require('camelcase');
Expand Down Expand Up @@ -214,11 +214,10 @@ export class MidwayContainer extends Container implements IContainer {

// TODO set 鍘婚噸
for (const dir of loadDirs) {
const fileResults = globby.sync(['**/**.ts', '**/**.tsx', '**/**.js', '!**/**.d.ts'].concat(opts.pattern || []), {
const fileResults = run(['**/**.ts', '**/**.tsx', '**/**.js'].concat(opts.pattern || []), {
cwd: dir,
followSymbolicLinks: false,
ignore: [
'**/node_modules/**',
'**/**.d.ts',
'**/logs/**',
'**/run/**',
'**/public/**',
Expand Down

0 comments on commit d26899e

Please sign in to comment.