[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-wallet-core] branch master updated: demobank-ui: avoid experiment
From: |
gnunet |
Subject: |
[taler-wallet-core] branch master updated: demobank-ui: avoid experimental nodejs API |
Date: |
Mon, 31 Oct 2022 12:26:24 +0100 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-core.
The following commit(s) were added to refs/heads/master by this push:
new 402ecb1a1 demobank-ui: avoid experimental nodejs API
402ecb1a1 is described below
commit 402ecb1a14276cc064a738f02c2b5014f34e6f5b
Author: Florian Dold <florian@dold.me>
AuthorDate: Mon Oct 31 12:26:21 2022 +0100
demobank-ui: avoid experimental nodejs API
---
packages/demobank-ui/build.mjs | 58 ++++++++----------------------------------
1 file changed, 11 insertions(+), 47 deletions(-)
diff --git a/packages/demobank-ui/build.mjs b/packages/demobank-ui/build.mjs
index 03664a7c8..6350804fb 100755
--- a/packages/demobank-ui/build.mjs
+++ b/packages/demobank-ui/build.mjs
@@ -74,52 +74,14 @@ function git_hash() {
// FIXME: Put this into some helper library.
function copyFilesPlugin(options) {
- const getDigest = (string) => {
- const hash = crypto.createHash("md5");
- const data = hash.update(string, "utf-8");
-
- return data.digest("hex");
- };
-
- const getFileDigest = (path) => {
- if (!fs.existsSync(path)) {
- return null;
- }
-
- if (fs.statSync(path).isDirectory()) {
- return null;
- }
-
- return getDigest(fs.readFileSync(path));
- };
-
- function filter(src, dest) {
- if (!fs.existsSync(dest)) {
- return true;
- }
-
- if (fs.statSync(dest).isDirectory()) {
- return true;
- }
-
- return getFileDigest(src) !== getFileDigest(dest);
- }
-
return {
name: "copy-files",
setup(build) {
- let src = options.src || "./static";
- let dest = options.dest || "./dist";
- build.onEnd(() =>
- fs.cpSync(src, dest, {
- dereference: options.dereference || true,
- errorOnExist: options.errorOnExist || false,
- filter: options.filter || filter,
- force: options.force || true,
- preserveTimestamps: options.preserveTimestamps || true,
- recursive: options.recursive || true,
- }),
- );
+ build.onEnd(() => {
+ for (const fop of options) {
+ fs.copyFileSync(fop.src, fop.dest);
+ }
+ });
},
};
}
@@ -147,10 +109,12 @@ export const buildConfig = {
plugins: [
preactCompatPlugin,
sassPlugin(),
- copyFilesPlugin({
- src: "static/index.html",
- dest: "dist/index.html",
- }),
+ copyFilesPlugin([
+ {
+ src: "static/index.html",
+ dest: "dist/index.html",
+ },
+ ]),
],
};
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-wallet-core] branch master updated: demobank-ui: avoid experimental nodejs API,
gnunet <=