feat: migrate to esm

This commit is contained in:
2023-03-16 01:58:13 +01:00
parent fd740b3091
commit 4df19e8c20
512 changed files with 3016 additions and 2222 deletions

View File

@@ -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;
}