From ae6c02258e242e4cd7e3afe4f52ce3b57be7cdf2 Mon Sep 17 00:00:00 2001 From: Alexander Vakrilov Date: Tue, 22 Oct 2019 16:57:32 +0300 Subject: [PATCH] chore: add re-exports for ts files (#7993) --- build/generate-tns-compat.ts | 12 + .../app/generated-tests/tests.ts | 244 ++++++++++++++++++ e2e/scoped-packages/package.json | 2 +- 3 files changed, 257 insertions(+), 1 deletion(-) diff --git a/build/generate-tns-compat.ts b/build/generate-tns-compat.ts index f2b4ea837..480034eb4 100644 --- a/build/generate-tns-compat.ts +++ b/build/generate-tns-compat.ts @@ -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(["*(?