@travetto/base
Advanced tools
Comparing version 0.0.80 to 0.0.81
@@ -22,3 +22,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.80" | ||
"version": "0.0.81" | ||
} |
@@ -16,10 +16,15 @@ import { bulkRequire } from './scan-fs'; | ||
load(priority?: number) { | ||
this.initializers = bulkRequire<{ init: Initializer }>([ | ||
new RegExp(`^node_modules\/@travetto\/.*\/phase[.]${this.scope}[.]ts$`), | ||
new RegExp(`^phase[.]${this.scope}[.]ts$`) | ||
]) | ||
.map(x => x.init) | ||
.map(x => ({ priority: PhaseManager.DEFAULT_PRIORITY, ...x })) | ||
.filter(x => priority === undefined || x.priority <= priority) | ||
.sort((a, b) => a.priority - b.priority); | ||
this.initializers = | ||
bulkRequire<{ init: Initializer }>([ | ||
new RegExp(`phase[.]${this.scope}[.]ts$`)], | ||
`${process.cwd()}/node_modules/@travetto` | ||
).concat( | ||
bulkRequire<{ init: Initializer }>([ | ||
new RegExp(`phase[.]${this.scope}[.]ts$`) | ||
], `${process.cwd()}/phase`) | ||
) | ||
.map(x => x.init) | ||
.map(x => ({ priority: PhaseManager.DEFAULT_PRIORITY, ...x })) | ||
.filter(x => priority === undefined || x.priority <= priority) | ||
.sort((a, b) => a.priority - b.priority); | ||
} | ||
@@ -26,0 +31,0 @@ |
30196
904