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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ec-toolbox

v1.0.18

Published

Euroconsumers Components Toolbox

Readme

ec-toolbox

Introduction

Euroconsumers Toolbox is a React components library that allows code reuse and visual consistency across the Euroconsumers brands.

It also features Storybook, an isolated development environment and UI showcase that allows efficient component development and components discoverability.

Stack components

  • Storybook
  • React
  • React Intl
  • Styled Components
  • Polished
  • Babel (ES6/7)
  • Webpack
  • Jest + Enzyme
  • ESLint + Airbnb styleguide
  • Stylelint
  • Prettier

Scripts

  • Run in development mode: yarn start
  • Build storybook: yarn build:storybook
  • Build toolbox: yarn build:toolbox
  • Lint JS: yarn lint:js
  • Lint CSS: yarn lint:css
  • Run unit tests: yarn test
  • Run unit tests in watch mode: yarn test:watch
  • Generate test coverage report: yarn test:coverage

Project structure & conventions

Components folder

The src/components folder contains one folder per component. Ex: src/components/Button.

Colocation

Place related assets in the same folder. Ex, in src/components/Button:

  • index.jsx: component code
  • messages.js: component translations
  • images: images related to the component
  • [componentName].stories.jsx: component stories
  • [componentName].test.jsx: component unit tests

Naming conventions

  • Use Pascal case for component folder name (ex: src/components/DatePicker)
  • Name the component file index.jsx so it can be easily imported (ex: import Button from 'src/components/Button')
  • The files with .stories.jsx and .test.jsx extensions are automatically ran by Storybook and Jest, respectively

Code conventions

Code conventions are automatically enforced via ESLint using the Airbnb Style Guide for JavaScript and Stylelint for CSS.

Theming

The components can be styled according to Euroconsumers brands requirements. This is configured by using the <ThemeProvider> wrapper of Styled Components at the root of your application:

<ThemeProvider theme={testAchatsTheme}>
  <App />
</ThemeProvider>

To import a specific theme: import { testAchatsTheme } from 'ec-toolbox'.

If your application also uses a theme, you can merge the two using mergeThemes from ec-toolbox.

To prevent conflicts, a ecToolbox reserved prefix is used.

i18n & l10n

The components support internationalization and localization. This is configured by using the <IntlProvider> wrapper of React Intl at the root of your application:

<IntlProvider locale="pt-BR" messages={ptBrMessages}>
  <App />
</IntlProvider>

To import translations for a specific language: import { ptBrMessages } from 'ec-toolbox'.

If your application also uses translations, you can merge the two using mergeMessages from ec-toolbox.

To prevent conflicts, a ecToolbox reserved prefix is used.

Git pre-commit hook

To ensure that the codebase stays high quality, a pre-commit hook will run before every commit to perform 4 quality checks on the changeset:

  1. ESLint: ensures that JS code matches the Airbnb style guide
  2. Stylelint: ensures that CSS code matches recommended conventions
  3. Prettier: formats the code to make it easy to read and maintain
  4. Unit tests: ensures that tests are passing