mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
feat: migrate to esm
This commit is contained in:
@@ -12,12 +12,10 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {existsSync, PathLike} from 'fs';
|
||||
import {platform} from 'os';
|
||||
import path from 'path';
|
||||
import {Application, ProjectReflection} from 'typedoc';
|
||||
import {ModuleKind, ScriptTarget} from 'typescript';
|
||||
|
||||
/**
|
||||
* Get a project reflection from a path
|
||||
@@ -26,7 +24,7 @@ import {ModuleKind, ScriptTarget} from 'typescript';
|
||||
* @param excludeExternals Exclude external dependencies
|
||||
*/
|
||||
export function getProjectReflection(sourcePath: PathLike, excludeExternals = true): ProjectReflection {
|
||||
Logger.info(`Generating project reflection for ${sourcePath.toString()}.`);
|
||||
console.info(`Generating project reflection for ${sourcePath.toString()}.`);
|
||||
|
||||
const tsconfigPath = getTsconfigPath(sourcePath.toString());
|
||||
|
||||
@@ -37,8 +35,6 @@ export function getProjectReflection(sourcePath: PathLike, excludeExternals = tr
|
||||
excludeExternals: excludeExternals,
|
||||
ignoreCompilerErrors: true,
|
||||
includeDeclarations: true,
|
||||
module: ModuleKind.CommonJS,
|
||||
target: ScriptTarget.Latest,
|
||||
tsconfig: path.join(tsconfigPath, 'tsconfig.json'),
|
||||
});
|
||||
|
||||
@@ -85,7 +81,7 @@ export function getTsconfigPath(startPath: string): string {
|
||||
tsconfigPath = tsconfigPathParts.join(path.sep);
|
||||
}
|
||||
|
||||
Logger.info(`Using 'tsconfig.json' from ${tsconfigPath}.`);
|
||||
console.info(`Using 'tsconfig.json' from ${tsconfigPath}.`);
|
||||
|
||||
return tsconfigPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user