@travetto/registry
Advanced tools
Comparing version 0.0.37 to 0.0.38
@@ -18,3 +18,3 @@ { | ||
"scripts": {}, | ||
"version": "0.0.37" | ||
"version": "0.0.38" | ||
} |
import { EventEmitter } from 'events'; | ||
import { Compiler } from '@travetto/compiler'; | ||
import { findAppFilesByExt } from '@travetto/base'; | ||
import { findAppFiles } from '@travetto/base'; | ||
@@ -77,4 +77,3 @@ import { Class } from '../model/types'; | ||
async init() { | ||
const entries = await findAppFilesByExt('.ts') | ||
.filter(x => x.file.includes(`/src/`)); | ||
const entries = await findAppFiles('.ts', f => f.includes('/src/')); | ||
@@ -81,0 +80,0 @@ const files = entries |
import * as ts from 'typescript'; | ||
import * as path from 'path'; | ||
import { AppEnv } from '@travetto/base/src/env'; | ||
import { TransformUtil, Import, State } from '@travetto/compiler'; | ||
const stringHash = require('string-hash'); | ||
const SEP = path.sep; | ||
const RE_SEP = SEP === '/' ? '\\/' : SEP; | ||
const SRC_RE = new RegExp(`([^/]+)${RE_SEP}src${RE_SEP}`, 'g'); | ||
const PATH_RE = new RegExp(RE_SEP, 'g'); | ||
type MethodHashes = { [key: string]: { hash: number, clsId: ts.Identifier } }; | ||
@@ -81,11 +77,11 @@ | ||
if (fileRoot.includes(process.cwd())) { | ||
fileRoot = file.fileName.split(process.cwd() + SEP)[1]; | ||
if (fileRoot.includes(AppEnv.cwd)) { | ||
fileRoot = fileRoot.split(AppEnv.cwd)[1].replace(/^[\\\/]+/, ''); | ||
ns = '@app'; | ||
if (fileRoot.startsWith(`node_modules${SEP}`)) { | ||
fileRoot = fileRoot.split(`node_modules${SEP}`).pop()!; | ||
if (fileRoot.startsWith('node_modules')) { | ||
fileRoot = fileRoot.split('node_modules').pop()!.replace(/^[\\\/]+/, ''); | ||
if (fileRoot.startsWith('@')) { | ||
const [ns1, ns2, ...rest] = fileRoot.split(SEP); | ||
const [ns1, ns2, ...rest] = fileRoot.split(/[\\\/]/); | ||
ns = `${ns1}.${ns2}`; | ||
fileRoot = rest.join(SEP); | ||
fileRoot = rest.join('.'); | ||
} | ||
@@ -96,3 +92,3 @@ } | ||
fileRoot = fileRoot | ||
.replace(PATH_RE, '.') | ||
.replace(/[\\\/]+/g, '.') | ||
.replace(/^\./, '') | ||
@@ -99,0 +95,0 @@ .replace(/\.(t|j)s$/, ''); |
@@ -14,3 +14,3 @@ console.log('Loading'); | ||
weight() { | ||
return 33; | ||
return 34; | ||
} | ||
@@ -17,0 +17,0 @@ namered() { |
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
17364
495