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

@ebanx/global-components

v1.12.2

Published

EBANX's global web components

Downloads

489

Readme

@ebanx/global-components

Global components for websites/webapps, built with Stencil.

@ebanx/global-components on npm

Built With Stencil

Release

:space_invader: Maintainers

If you need anything, those people below can help you:

:school_satchel: Requirements

In order to have the correct development experience, you need to install the following:

Using the components

The components depends on Gilroy and Open Sans fonts to render correctly - those fonts must be inside their host application to avoid double requests.

EBANX has a CDN to load Gilroy fonts, and Open Sans is available with Google Fonts.

:gem: Stack

This project is built with Stencil, a toolchain for building web components and design systems using the Web Components API. The actual project was created using the component started, offered by stencil-cli.

Stencil play as a compiler for the web components; and those components uses Angular under the hood - we can also create them in a functional style too. Stencil offers a great tooling, and the components were generated using stencil generate helper.

The styles are component-scoped, and the stylesheets are written in plain CSS.

As the package manager, it uses npm; prettier, husky and lint-staged are used to ensure code's patterns.

The project also uses semantic-release with commitizen to ensure a correct package versioning.

For testing, it uses jest with Stencil's abstractions - components are generated with default unit and e2e test specs.

:computer: Developing

First things first: clone the repo.
After clonning the repo, use the following commands to start developing:

# install dependencies
npm install

# start development server at http://localhost:3333
npm run start

# commiting changes to remote
npm run commit
# it will trigger git-cz to start, a helper used to ensure the correct commit message
# that will be used by semantic-release within the deploy workflow, in order to
# create the correct package versioning using sem-ver

# create a production build
npm run build

The project was created using npm but you can use yarn as your package manager and script runner without big worries as well. If you use yarn, you may find some issues with the lock files.

:open_file_folder: Project structure

If you're not familiar with Stencil's folder structure, here's a brief explanation:

  • /src: where the sources are;
    • /components: where our components live;
    • components.d.ts: Stencil generated file which contains information about our components;
    • index.ts: Stencil generated file which exports our components

For more information, take a look on Stencil's docs.

:name_badge: Naming Components

Components name's must be lower, dashed-case.

When creating new component tags, we recommend not using stencil in the component name (ex: <stencil-datepicker>). This is because the generated component has little to nothing to do with Stencil; it's just a web component!

Instead, use the prefix ebanx :rocket:

Like ebanx-cookie-disclaimer, ebanx-logo...

:microscope: Testing

Components are unit and e2e tested. To start the suite, run the following command:

npm run test

Test files can be found within components' folders.

:rocket: Build and Release

This project is release on npm with the help of semantic-release and GitHub Actions.

Every merged PR (pull request) into master branch will start the release workflow; if everything works fine, a new version will be automatically released within seconds.

The master branch is blocked. When working on this project create new, dedicated branches to your changes and always merge it into master.

Obs. To perform release correctly enter npm and git, we need to insert the fix: or feat: before the name of the commit.

:wrench: Using the components

There are two ways to use those components:

CDN

The easiest way to use those components in your web app is using a package CDN link in your HTML template - it can be used with CMSs (WordPress), page builders (HubSpot, Webflow) and any JS framework (React, Vue...).

To do so, put those tags in your template:

<!-- preferably before </body> -->
<script
  type="module"
  src="https://unpkg.com/@ebanx/global-components/dist/global-components/global-components.esm.js"
></script>
<script
  nomodule
  src="https://unpkg.com/@ebanx/global-components/dist/global-components/global-components.js"
></script>

All the components' styles are scoped within itself, so don't worry about colisions nor overridings.

And then you're able to use the components:

<ebanx-logo></ebanx-logo>

<ebanx-cookies-disclaimer></ebanx-cookies-disclaimer>

The above example shows the import using unpkg CDN. unpkg has a slightly better approach to use the package's latest version; jsDelivr CDN cache is a bit harder, even using the @latest flag on the version - so you can face some issues while using it.

Installing the package

You can also install this package as your project's dependency:

npm i @ebanx/global-components

After installing, you can import the components into your app's main file and use them. It's worthy to check Stencil's framework integrations!