javascript – Importing a component library using react in Storybook

I have two projects: one is a component library called simply ‘@loonslanding/components’. The other is a storybook project. Inside of the components library, I have the following in src/index.js:

import React, { Component } from 'react';

class Button extends Component {
  render () {
    return (
      <button>{props.label}</button>
    );
  }
}

export default Button;

I build this using webpack and babel with the following webpack.config.js:

const path = require('path');

module.exports = {
  entry: './src/index.js',
  mode: 'development',
  output: {
    filename: 'index.bundle.js',
    path: path.resolve(__dirname, 'dist'),
  },
  module: {
    rules: (
      {
        test: /.m?js$/,
        exclude: /(node_modules|bower_components)/,
        use: {
          loader: 'babel-loader',
          options: {
            presets: ('@babel/preset-env', '@babel/preset-react')
          }
        }
      },
      {
        test: /.s(ac)ss$/i,
        use: (
          // Creates `style` nodes from JS strings
          'style-loader',
          // Translates CSS into CommonJS
          'css-loader',
          // Compiles Sass to CSS
          'sass-loader',
        ),
      }
    )
  }
};

I then link my js module using yarn link in the components directory and run yarn link @loonslanding/components in my storybook directory. I have a single story in storybook, called button.stories.js:

import Button from "@loonslanding/components";

import { action } from '@storybook/addon-actions';

import React from 'react';

export default {
  component: Button,
  title: `Atoms/Button`
};

export const Standard = () => <Button onClick={action('clicked')} label={"Standard Button"}></Button>;

When I run yarn storybook, I get the following error message:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Check the render method of `storyFn`.

This seems like a pretty common error, and I’ve researched it over the past few hours, but I don’t think I’ve actually mixed up named and default exports/imports. When I attempt to import the components project into a different project (e.g. a react application other than Storybook), it gives me a similar exception. This leads me to believe that something is wonky with how Babel is transpiling the components module. Thoughts on what I might be doing incorrectly?

When importing a wallet from private key or seed phrase, how do you guess the correct address format

I am building a bitcoin wallet, i can derive addresses using the derivation paths. how do i determine the derivation path for the seed when importing it.

import – Importing a CSV file hangs up

Ver.12.1.0.0 hangs up when I do “Import” a csv file
that contain an entry “”000000000000000000000000000000000000000053253943D755066515000057”,
while this csv file can be read by EXCEL and Mathematical allows Import
of the resulting xlsx file.
What can I do, other than reporting this to the Mathematica support?

feeds – Single Image field importing as Multiple Values

I’ve created a CSV feed via Views Export that exports out data for a content type. I’m then using Feeds to import that onto another Drupal site.

Everything except the images are working, when I run import it’s stating

Failed importing 2 RSS Item items.

The content failed to validate with the following errors:
Image (field_image): Image: this field cannot hold more than 1 values.
Please check your mappings.

The field in question on Site A has a single limited value of 1, and checking the CSV export it’s only showing one value, the absolute url of the image on Site A.

I’ve attempted to use Feeds Tamper and use all the plugins I can think of to fix this, but due to my freshness to Feeds and Feeds Tamper I’m not sure if this is a bug or misconfig on my part. Everything else is importing as expected onto Site B.

How can I get the import running successfully?

python – Strictly only importing modules in subdirectories: is this a good rule?

I’m making my 1st official project. It’s written in Python, is open-sources, and I’d like people to be able to freely and easily fork and modify the code. The project name is “shelf” and the main script/executable is shelf.py.

I’m trying to make everything modular. The main script shelf.py should be the only thing the end-user manually interact with.

My file structure and import hierarchy:

shelf.py
├── src
│   ├── config
│   │   └── configure.py
│   ├── data
│   │   └── database.py
│   ├── downloading
│   │   └── download.py
│   ├── system
│   │   ├── fileio.py
│   │   ├── rw
│   │   │   ├── open.py
│   │   │   └── save.py
│   │   └── reader.py
│   └── ui
│       ├── cli.py
│       ├── gtk.py
│       └── events
│           └── user_input.py
└── tests

Here, shelf.py is in the root of the directory.

"""shelf.py"""

import src.config.configure as configure
import src.data.database as database
import src.downloading.download as download
import src.system.fileio as fileio
import src.system.reader as reader
import src.ui.cli as cli
import src.ui.events as events

# ...
"""fileio.py"""

import rw.open
import rw.save

# ...

The rule I’ve made is that a script can only ever import scripts (modules) in a subdirectory. open.py may not import save.py, and vice-versa. Coupling of these modules is all done in the parent module, which is fileio.py for open.py and save.py.

This rule is made to avoid circular dependencies and modularize all the functions as much as possible. Most functions will be pure functions.

Is this rule of “import only modules in a subdirectory” viable for development?

Importing hundreds of CSV’s into postgres (non-sequential naming)

https://gis.stackexchange.com/questions/132569/loading-multiple-csv-files-into-postgresql-table

Looked at links like this, but it doesn’t really make sense to me. Is there any way anyone could dumb this down for me? I’m using ubuntu btw. Thank you!

watch only – Why Bitcoin Core does not support importing extended public keys directly?

I’m trying to create a watch-only wallet importing the extended public key from a Ledger Nano (as an example) but is not to easy to do directly to my Node, I should do it through electrum personal server or something like that.
I was trying to find a clear (like 5 years old) explanation of what is the reason for that.
I was trying to do that in the mainnet and from the regtest following the next command in order to get the checksum but all the time a message said that the key is not valid.

bitcoin-cli –regtest getdescriptorinfo “wpkh(vpub5UwuWtLWaprMvQBpnZeufhRAqYsgrYf7ZMxr6Kf7N41aa9M7UzZJ1e7HMwzdxGnfer5g2PaFgcvmNU7iRZAasNXz6EdDW6FGdcKf8m4oF7b/*)”

And there are plans to allow this import function?, I think so it’s a very convenience feature.

importing – Unity Re-import doesn’t re-import fbx

So I have an fbx file with animations and materials on it. Simple stuff.

But when I change something on the fbx, like adjusting some animation, then re-export as fbx, Unity does not re-import the fbx when I do RMB -> Re-Import. It shows the loading bar but doesn’t actually effect the current mesh by re-importing.

Is this normal?

Is there a way to re-import the fbx while keeping the modification I made on the mesh. Like, I changed the Scale Factor and some other things, so I want to keep these while re-importing.

enter image description here

bitcoin core – Missing Checksum error when importing multisig wallet via descriptor

I’m trying to import a multisig wallet on regtest, but getting a strange error. What am I doing wrong? I’ve tried it with xpubs, tpubs, and Vpubs (converted here) and get the same error for all.

Command:

bitcoin-cli -regtest importmulti '({"desc": "wsh(multi(2,tpubDDgGUQsV9M7N5DD3WQmkqkq9UXkSvfHvyefNDx2b7KwmukE6FfuFk3JfncmjCNnG9scWcdz6MEeNPZXHArkGFuTXTsZNr4288ULxuTDjB6u/0/0/*,tpubDCDw2UcGohVP3rK8kPW8g9hwBojpwzYdjLxQ6AnnuRvThH7q1vwGneGAUkfZYqJo9eKFGzuP4WwaKsQkEqqnwLd1eT2CtpAKQispgxadHWB/0/0/*))", "range": (0,10), "watchonly":true, "timestamp":"now"})'

Error:

(
  {
    "success": false,
    "error": {
      "code": -5,
      "message": "Missing checksum"
    }
  }
)

Importing a Cell’s value only once in google sheets

Let’s say I have two google sheets spreadsheets.

Spreadsheet A has a list of average prices, displayed by each calender day, going back 7 days. Every day, the oldest date is removed, and the new day is added.

In spreadsheet B I would like to keep a historical list of these prices, listing all the dates and their respective prices since the date I began tracking.

The issue I am having is I know how to import the data from one sheet to another, but it is a reference to the cell, so when the cell is removed in Spreadsheet A, it is also removed in Spreadsheet B, which I do not want.

Is there a way to only import the value one time, and never check again for an updated value, or a way to import only the data value of the cell, not a reference to the cell at all?

I do not own or control spreadsheet A and therefore can not make any modifications to how it works.