@spinajs/reflection
Advanced tools
Comparing version 2.0.61 to 2.0.62
@@ -1,11 +0,3 @@ | ||
import ts from 'typescript'; | ||
import { Exception } from '../../exceptions/lib/index.js'; | ||
export * from 'typescript-mix'; | ||
export declare function build(override?: { | ||
compilerOptions?: ts.CompilerOptions; | ||
include?: string[]; | ||
exclude?: string[]; | ||
files?: string[]; | ||
extends?: string; | ||
}, currentDir?: string): void; | ||
/** | ||
@@ -12,0 +4,0 @@ * Class info structure |
@@ -5,2 +5,3 @@ import * as fs from 'fs'; | ||
import ts from 'typescript'; | ||
import _ from 'lodash'; | ||
import { Configuration } from '@spinajs/configuration'; | ||
@@ -11,36 +12,2 @@ import { AsyncService, DI } from '@spinajs/di'; | ||
export * from 'typescript-mix'; | ||
export function build(override = {}, currentDir = process.cwd()) { | ||
const configFile = ts.findConfigFile(currentDir, (path) => { | ||
return ts.sys.fileExists(path); | ||
}, 'tsconfig.json'); | ||
if (!configFile) | ||
throw Error('tsconfig.json not found'); | ||
const { config } = ts.readConfigFile(configFile, (path) => { | ||
return ts.sys.readFile(path); | ||
}); | ||
config.compilerOptions = Object.assign({}, config.compilerOptions, override.compilerOptions); | ||
if (override.include) | ||
config.include = override.include; | ||
if (override.exclude) | ||
config.exclude = override.exclude; | ||
if (override.files) | ||
config.files = override.files; | ||
if (override.extends) | ||
config.files = override.extends; | ||
const { options, fileNames, errors } = ts.parseJsonConfigFileContent(config, ts.sys, currentDir); | ||
const program = ts.createProgram({ options, rootNames: fileNames, configFileParsingDiagnostics: errors }); | ||
const { diagnostics, emitSkipped } = program.emit(); | ||
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(diagnostics, errors); | ||
if (allDiagnostics.length) { | ||
const formatHost = { | ||
getCanonicalFileName: (path) => path, | ||
getCurrentDirectory: ts.sys.getCurrentDirectory, | ||
getNewLine: () => ts.sys.newLine, | ||
}; | ||
const message = ts.formatDiagnostics(allDiagnostics, formatHost); | ||
console.warn(message); | ||
} | ||
if (emitSkipped) | ||
process.exit(1); | ||
} | ||
/** | ||
@@ -148,3 +115,3 @@ * Class info structure | ||
// eslint-disable -next-line @typescript-eslint/await-thenable | ||
const fPromises = directories | ||
const fPromises = _.uniq(directories) | ||
.filter((d) => { | ||
@@ -151,0 +118,0 @@ /* eslint-disable */ |
{ | ||
"name": "@spinajs/reflection", | ||
"version": "2.0.61", | ||
"version": "2.0.62", | ||
"description": "SpinaJS reflection helpers", | ||
@@ -35,6 +35,6 @@ "exports": "./lib/index.js", | ||
"dependencies": { | ||
"@spinajs/configuration": "^2.0.61", | ||
"@spinajs/di": "^2.0.61", | ||
"@spinajs/exceptions": "^2.0.61", | ||
"@spinajs/log": "^2.0.61", | ||
"@spinajs/configuration": "^2.0.62", | ||
"@spinajs/di": "^2.0.62", | ||
"@spinajs/exceptions": "^2.0.62", | ||
"@spinajs/log": "^2.0.62", | ||
"glob": "^8.1.0", | ||
@@ -41,0 +41,0 @@ "lodash": "^4.17.21", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
14125
207
Updated@spinajs/di@^2.0.62
Updated@spinajs/exceptions@^2.0.62
Updated@spinajs/log@^2.0.62