Skip to content

Commit ae6c022

Browse files
Alexander Vakrilovmanoldonev
authored andcommitted
chore: add re-exports for ts files (#7993)
1 parent 2412c0b commit ae6c022

File tree

3 files changed

+257
-1
lines changed

3 files changed

+257
-1
lines changed

build/generate-tns-compat.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ function processDefinitionFile(entry: EntryInfo) {
8181
}
8282
}
8383

84+
function processTypeScriptFile(entry: EntryInfo) {
85+
const relativeFilePathNoExt = entry.path.replace(/\.ts$/, "");
86+
87+
createReExportFile(relativeFilePathNoExt, ".ts");
88+
addTestImport(relativeFilePathNoExt);
89+
}
90+
8491
function createReExportFile(pathNoExt: string, ext: ".ts" | ".d.ts") {
8592
const outputFile = path.join(outputFolder, pathNoExt + ext);
8693
if (!fs.existsSync(outputFile)) {
@@ -162,6 +169,11 @@ function generateExportsForPrivateModules() {
162169
// * .ts file with re-exports for the corresponding ts/js file (is such exists)
163170
await traverseInputDir(["*.d.ts"], processDefinitionFile);
164171

172+
console.log(" ------> GENERATING FILES FROM TYPESCRIPT");
173+
// Traverse all ts files which are not platform specific and create
174+
// * .ts file with re-exports for the corresponding ts file
175+
await traverseInputDir(["*(?<!\.(d|android|ios)).ts"], processTypeScriptFile);
176+
165177
generateExportsForPrivateModules();
166178

167179
// Generate tests in

0 commit comments

Comments
 (0)