npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@oceanprotocol/dbs-ui-lib

v0.1.0

Published

Ocean Protocol DBS component library

Downloads

4

Readme

banner

Table of Contents

🏄 Get Started

The lib uses React + TypeScript + CSS modules and will connect to Ocean remote components by default.

Prerequisites:

  • Node.js (required). Check the .nvmrc file to make sure you are using the correct version of Node.js.
  • nvm (recommended). This is the recommend way to manage Node.js versions.
  • Git is required to follow the instructions below.

To start local development:

git clone [email protected]:oceanprotocol/dbs-ui-lib.git
cd dbs-ui-lib

# when using nvm to manage Node.js versions
nvm use

npm install
# in case of dependency errors, rather use:
# npm install --legacy-peer-deps

npm run build:watch 
# to build the library and watch for changes.

Run npm run build from the root folder to build the library. This creates dist folder which contains everything that would be published to npm.

if you encounter this error: Error: error:0308010C:digital envelope routines::unsupported

Run export NODE_OPTIONS=--openssl-legacy-provider before building.

🚀 Usage

Import and use the DBS UI components in your app:

import { DBSUploader } from '@oceanprotocol/dbs-ui-lib';

<DBSUploader 
   dbs_url={process.env.DBS_URL}
   dbs_account={process.env.DBS_ACCOUNT}
   infuraId={process.env.PUBLIC_INFURA_PROJECT_ID}
   walletConnectProjectId={process.env.PUBLIC_WALLETCONNECT_PROJECT_ID}
/>

To enable the functionality of the DBSUploader, the following setting variables need to be set:

| Variable | Description | |-------------------------|-------------------------------------------------------| | dbs_url | URL for DBS service communication | | dbs_account | Account info for DBS authentication | | infuraId | Project ID for Ethereum access via Infura | | walletConnectProjectId| Project ID for WalletConnect integration |

These variables are needed to interact with the DBS service, provide authentication credentials, access the Ethereum network through Infura, and enable integration with WalletConnect.

👩‍🎤 Storybook

Storybook helps us build UI components in isolation from our app's business logic, data, and context. That makes it easy to develop hard-to-reach states and save these UI states as stories to revisit during development, testing, or QA.

To start adding stories, create a index.stories.tsx inside the component's folder:

Starting up the Storybook server with this command will make it accessible under http://localhost:6006:

npm run storybook

If you want to build a portable static version under storybook-static/:

npm run storybook:build

🤖 Testing

Test runs utilize Jest as test runner and Testing Library for writing tests.

Executing a full test run:

npm test

During local development you can continuously get coverage report feedback in your console by running Jest in watch mode:

npm test:watch

✨ Code Style

Code style is automatically enforced through ESLint & Prettier rules:

For running linting and auto-formatting, you can use from the root of the project:

# linting check
npm run lint

# auto format all files in the project with prettier, taking all configs into account
npm run format

🛳 Production

To create a production build, run from the root of the project:

npm run build

⬆️ Deployment

TBD

💖 Contributing

We welcome contributions in form of bug reports, feature requests, code changes, or documentation improvements. Have a look at our contribution documentation for instructions and workflows:

🏛 License

Copyright 2023 Ocean Protocol Foundation Ltd.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.