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

@zywave/create-web-components-project

v0.0.5

Published

A template to create a web components monorepo project

Downloads

2

Readme

Create Web Components Project

Basic setup

Prerequisites:

  • NodeJS > 16
  1. Install the template

    Recommend running install each time a new project is created, in case template package was updated

npm install --global @zywave/create-web-components-project
  1. From your project directory run
create-web-components-project
  1. Follow the prompts to setup both a new monorepo project and your first web component

    This will create a monorepo to manage multiple packages (web components) and their respective package.json's, and a packages directory with your newly made web component

  2. To add more web components run command below, from your monorepo project directory (where the root level package.json is)

create-web-components-project component
  1. This runs through web components prompts, and output's the component to a packages directory

  2. Setup a project token for Changesets merge request bot

    • Once newly created project repo is on Gitlab, lets add a "project access token"
      • Settings > Access Tokens > Project Access Tokens
      • Fill out fields as so:
        • Token name: Changesets_Bot
        • Clear the expiration date
        • Select a role: Reporter
        • Select scopes: API
      • Copy the generated token value to clipboard, you only will see this value once
    • Add the token as a project variable
      • Settings > CI/CD > Variables > Add variable
      • Fill out fields as so:
        • Key: Changesets_Bot
        • Value: (paste your token value)
        • Protect variable: unchecked
        • Mask variable: checked
      • Add variable
    • Changesets is vital to semver bumping packages when they're updated and is needed to release package updates, and this token we setup is for a bot as a failsafe to teach people how to use changesets if it's missing (or even needed) for a merge request
      • See your newly created project's README for additional release and Changesets info

CLI documentation

Commands

Default (no command)

Default (no command) example:

create-web-components-project

Project is setup in current working directory

Default (no command) with --output option example:

create-web-components-project --output=../my/relative/path-dir

Project is setup relative to output value given, this directory must already exist

For either configuration default command will setup:

  • A monorepo project
  • A web component
    • Behind the scenes the component command is invoked, more details on: component command
  • Installs NPM dependencies
  • Builds project

component command

Prerequisites:

  1. The default command was executed to setup a monorepo project
  2. Always run the component command from the monorepo root directory (where the root level package.json is)

Component example:

create-web-components-project component

A component is added to the monorepo project, defaulting to the packages directory

Component with --output option example:

create-web-components-project component --output=my/custom-packages/dir

A component is added to the monorepo project, relative to output value given, this directory must already exist