mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: add re-exports for ts files (#7993)
This commit is contained in:
committed by
Manol Donev
parent
2412c0b6f5
commit
ae6c02258e
@@ -81,6 +81,13 @@ function processDefinitionFile(entry: EntryInfo) {
|
||||
}
|
||||
}
|
||||
|
||||
function processTypeScriptFile(entry: EntryInfo) {
|
||||
const relativeFilePathNoExt = entry.path.replace(/\.ts$/, "");
|
||||
|
||||
createReExportFile(relativeFilePathNoExt, ".ts");
|
||||
addTestImport(relativeFilePathNoExt);
|
||||
}
|
||||
|
||||
function createReExportFile(pathNoExt: string, ext: ".ts" | ".d.ts") {
|
||||
const outputFile = path.join(outputFolder, pathNoExt + ext);
|
||||
if (!fs.existsSync(outputFile)) {
|
||||
@@ -162,6 +169,11 @@ function generateExportsForPrivateModules() {
|
||||
// * .ts file with re-exports for the corresponding ts/js file (is such exists)
|
||||
await traverseInputDir(["*.d.ts"], processDefinitionFile);
|
||||
|
||||
console.log(" ------> GENERATING FILES FROM TYPESCRIPT");
|
||||
// Traverse all ts files which are not platform specific and create
|
||||
// * .ts file with re-exports for the corresponding ts file
|
||||
await traverseInputDir(["*(?<!\.(d|android|ios)).ts"], processTypeScriptFile);
|
||||
|
||||
generateExportsForPrivateModules();
|
||||
|
||||
// Generate tests in
|
||||
|
||||
Reference in New Issue
Block a user