@travetto/compiler
Advanced tools
Comparing version 0.2.0 to 0.2.2
@@ -7,3 +7,3 @@ { | ||
"dependencies": { | ||
"@travetto/base": "^0.2.0", | ||
"@travetto/base": "^0.2.2", | ||
"@types/source-map-support": "^0.4.1", | ||
@@ -34,3 +34,4 @@ "source-map-support": "^0.5.6", | ||
}, | ||
"version": "0.2.0" | ||
"version": "0.2.2", | ||
"gitHead": "14b93bc88216ca2baacfe20af1b0bd1b407b35b0" | ||
} |
@@ -58,8 +58,7 @@ import * as path from 'path'; | ||
init() { | ||
const rootFiles = ScanApp.findFiles('.ts', x => /(^src\/)|\/src\/|\/index.ts$/.test(x) && this.validFile(x)) | ||
const SRC_RE = Env.e2e ? /^((e2e|src)\/.*|index)$/ : /^(src\/.*|index)$/; | ||
const rootFiles = ScanApp.findFiles('.ts', x => SRC_RE.test(x) && this.validFile(x)) // Only watch own files | ||
.filter(x => !(x.file in require.cache)) // Pre-loaded items are fundamental and non-reloadable | ||
.map(x => x.file); | ||
console.debug('Watching files', rootFiles.length); | ||
for (const fileName of rootFiles) { | ||
@@ -70,4 +69,7 @@ this.files.set(fileName, { version: 0 }); | ||
if (this.watch) { | ||
this.buildWatcher(path.join(this.cwd, 'src'), [{ testFile: x => this.validFile(x) && x.endsWith('.ts') }]); | ||
if (this.watch) { // Start watching after startup | ||
setTimeout(() => { | ||
console.debug('Watching files', rootFiles.length); | ||
this.buildWatcher(path.join(this.cwd, 'src'), [{ testFile: x => this.validFile(x) && x.endsWith('.ts') }]); | ||
}, 1000); | ||
} | ||
@@ -74,0 +76,0 @@ } |
@@ -1,2 +0,2 @@ | ||
import { ScanApp } from '@travetto/base'; | ||
import { ScanApp, Util } from '@travetto/base'; | ||
@@ -11,3 +11,2 @@ export class TransformerManager { | ||
const transformers: { [key: string]: any } = {}; | ||
let i = 2; | ||
@@ -20,3 +19,2 @@ for (const trns of ScanApp.requireFiles('.ts', x => /transformer[.].*?[.]ts$/.test(x))) { | ||
} | ||
item.priority = item.priority === undefined ? ++i : item.priority; | ||
item.name = item.name || key; | ||
@@ -27,8 +25,13 @@ transformers[item.phase].push(item); | ||
for (const key of Object.keys(transformers)) { | ||
transformers[key] = (transformers[key] as any[]) | ||
.sort((a, b) => a.priority - b.priority) | ||
.map(x => x.transformer); | ||
transformers[key] = Util.computeOrdering(transformers[key] as { | ||
transformer: any, | ||
before: string | string[], | ||
key: string | ||
}[]); | ||
console.debug('Configured Transformers', key, transformers[key].map((x: any) => x.key)); | ||
transformers[key] = transformers[key].map((x: any) => x.transformer); | ||
} | ||
this.transformers = transformers; | ||
} | ||
} |
export const init = { | ||
key: 'compiler', | ||
after: ['config', 'base'], | ||
action: async () => { | ||
@@ -7,4 +9,3 @@ const compiler = require('../src/compiler').Compiler; | ||
return res; | ||
}, | ||
priority: 1 | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39166
18
1017
Updated@travetto/base@^0.2.2