aboutsummaryrefslogtreecommitdiff
path: root/packages/merchant-backoffice-ui/build.mjs
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-12-16 16:59:37 -0300
committerSebastian <sebasjm@gmail.com>2022-12-16 16:59:37 -0300
commit39b02d6878c91da0aa0809d57179779381656a3e (patch)
tree8715ae42cc3a5073c4f9659cf54a7a55e8c8147b /packages/merchant-backoffice-ui/build.mjs
parentf1f8f818dbe631fbeeba64af9dfcae1aa7842615 (diff)
downloadwallet-core-39b02d6878c91da0aa0809d57179779381656a3e.tar.xz
update copy header
Diffstat (limited to 'packages/merchant-backoffice-ui/build.mjs')
-rwxr-xr-xpackages/merchant-backoffice-ui/build.mjs26
1 files changed, 24 insertions, 2 deletions
diff --git a/packages/merchant-backoffice-ui/build.mjs b/packages/merchant-backoffice-ui/build.mjs
index c93b4eb67..3bc1916b5 100755
--- a/packages/merchant-backoffice-ui/build.mjs
+++ b/packages/merchant-backoffice-ui/build.mjs
@@ -1,7 +1,7 @@
#!/usr/bin/env node
/*
This file is part of GNU Taler
- (C) 2022 Taler Systems S.A.
+ (C) 2021-2023 Taler Systems S.A.
GNU Taler is free software; you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
@@ -44,7 +44,29 @@ const preactCompatPlugin = {
},
};
-const entryPoints = ["src/index.tsx", "src/stories.tsx"];
+function getFilesInDirectory(startPath, regex) {
+ if (!fs.existsSync(startPath)) {
+ return;
+ }
+ const files = fs.readdirSync(startPath);
+ const result = files.flatMap(file => {
+ const filename = path.join(startPath, file);
+
+ const stat = fs.lstatSync(filename);
+ if (stat.isDirectory()) {
+ return getFilesInDirectory(filename, regex);
+ }
+ else if (regex.test(filename)) {
+ return filename
+ }
+ }).filter(x => !!x)
+
+ return result
+}
+
+const allTestFiles = getFilesInDirectory(path.join(BASE, 'src'), /.test.ts$/)
+
+const entryPoints = ["src/index.tsx", "src/stories.tsx", ...allTestFiles];
let GIT_ROOT = BASE;
while (!fs.existsSync(path.join(GIT_ROOT, ".git")) && GIT_ROOT !== "/") {