gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-core] branch master updated: fix sb config


From: gnunet
Subject: [taler-wallet-core] branch master updated: fix sb config
Date: Wed, 02 Jun 2021 16:01:23 +0200

This is an automated email from the git hooks/post-receive script.

sebasjm pushed a commit to branch master
in repository wallet-core.

The following commit(s) were added to refs/heads/master by this push:
     new 9f09f5a1 fix sb config
9f09f5a1 is described below

commit 9f09f5a1a5f0028bba1f76b4c8740734102cc0cf
Author: Sebastian <sebasjm@gmail.com>
AuthorDate: Wed Jun 2 10:41:00 2021 -0300

    fix sb config
---
 .../taler-wallet-webextension/.storybook/.babelrc  |  4 ++
 .../taler-wallet-webextension/.storybook/main.js   | 36 +++++++++----
 .../.storybook/preview.js                          | 60 +++++++++++-----------
 3 files changed, 59 insertions(+), 41 deletions(-)

diff --git a/packages/taler-wallet-webextension/.storybook/.babelrc 
b/packages/taler-wallet-webextension/.storybook/.babelrc
index d1f93f33..39829d50 100644
--- a/packages/taler-wallet-webextension/.storybook/.babelrc
+++ b/packages/taler-wallet-webextension/.storybook/.babelrc
@@ -19,4 +19,8 @@
  * @author Sebastian Javier Marchano (sebasjm)
  */
 {
+    //FIXME: check if we can remove this preset and just use default storybook 
presets
+    "presets": [
+        "preact-cli/babel"
+    ]
 }
\ No newline at end of file
diff --git a/packages/taler-wallet-webextension/.storybook/main.js 
b/packages/taler-wallet-webextension/.storybook/main.js
index d9f87eef..01765e00 100644
--- a/packages/taler-wallet-webextension/.storybook/main.js
+++ b/packages/taler-wallet-webextension/.storybook/main.js
@@ -22,18 +22,34 @@
 
 module.exports = {
   "stories": [
-    "../lib/**/*.stories.js"
+    "../src/**/*.stories.tsx",
   ],
   "addons": [
     "@storybook/addon-a11y",
-    "@storybook/addon-essentials" //docs, control, actions, viewpot, toolbar, 
background
+    "@storybook/addon-essentials" //docs, control, actions, viewport, toolbar, 
background
   ],
-  // webpackFinal: async (config, { configType }) => {
-  //   // `configType` has a value of 'DEVELOPMENT' or 'PRODUCTION'
-  //   // You can change the configuration based on that.
-  //   // 'PRODUCTION' is used when building the static version of storybook.
-  //   // Make whatever fine-grained changes you need
-  //   // Return the altered config
-  //   return config;
-  // },
+  // sb does not yet support new jsx transform by default
+  // https://github.com/storybookjs/storybook/issues/12881
+  // https://github.com/storybookjs/storybook/issues/12952
+  babel: async (options) => ({
+    ...options,
+    presets: [
+      ...options.presets,
+      [
+        '@babel/preset-react', {
+          runtime: 'automatic',
+        },
+        'preset-react-jsx-transform' 
+      ],
+    ],
+  }),
+  webpackFinal: (config) => {
+    // should be removed after storybook 6.3
+    // 
https://github.com/storybookjs/storybook/issues/12853#issuecomment-821576113
+    config.resolve.alias = {
+      react: "preact/compat",
+      "react-dom": "preact/compat",
+    };
+    return config;
+  },
 }
diff --git a/packages/taler-wallet-webextension/.storybook/preview.js 
b/packages/taler-wallet-webextension/.storybook/preview.js
index 2b685b36..c5740261 100644
--- a/packages/taler-wallet-webextension/.storybook/preview.js
+++ b/packages/taler-wallet-webextension/.storybook/preview.js
@@ -14,41 +14,39 @@
  GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
  */
 
-// import "../src/scss/main.scss"
-// import { ConfigContextProvider } from '../src/context/config'
-// import { TranslationProvider } from '../src/context/translation'
+import * as core from "@gnu-taler/taler-wallet-core";
 
 const mockConfig = {
   backendURL: 'http://demo.taler.net',
   currency: 'KUDOS'
 }
 
-// export const parameters = {
-//   controls: { expanded: true },
-//   actions: { argTypesRegex: "^on[A-Z].*" },
-// }
-
-// export const globalTypes = {
-//   locale: {
-//     name: 'Locale',
-//     description: 'Internationalization locale',
-//     defaultValue: 'en',
-//     toolbar: {
-//       icon: 'globe',
-//       items: [
-//         { value: 'en', right: 'πŸ‡ΊπŸ‡Έ', title: 'English' },
-//         { value: 'es', right: 'πŸ‡ͺπŸ‡Έ', title: 'Spanish' },
-//       ],
-//     },
-//   },
-// };
-
-// export const decorators = [
-//   (Story, { globals }) => {
-    
-//     return <TranslationProvider initial={globals.locale}>
-//       <Story />
-//     </TranslationProvider>
-//   },
+export const parameters = {
+  controls: { expanded: true },
+  actions: { argTypesRegex: "^on[A-Z].*" },
+}
+
+export const globalTypes = {
+  locale: {
+    name: 'Locale',
+    description: 'Internationalization locale',
+    defaultValue: 'en',
+    toolbar: {
+      icon: 'globe',
+      items: [
+        { value: 'en', right: 'πŸ‡ΊπŸ‡Έ', title: 'English' },
+        { value: 'es', right: 'πŸ‡ͺπŸ‡Έ', title: 'Spanish' },
+      ],
+    },
+  },
+};
+
+
+
+export const decorators = [
+  (Story, { globals }) => {
+    core.setupI18n(globals.locale);
+    return <Story />
+  },
 //   (Story) => <ConfigContextProvider value={mockConfig}> <Story /> 
</ConfigContextProvider>
-// ];
+];

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]