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

@wral/studio-ui.misc.seed

v0.3.5

Published

This is a seed project for creating web components using the Lit framework. It includes configurations for building, linting, testing, and documentation generation, as well as a basic example component.

Downloads

5

Readme

@wral/studio-ui.misc.seed

This is a seed project for creating web components using the Lit framework. It includes configurations for building, linting, testing, and documentation generation, as well as a basic example component.

Table of Contents

Installation

Clone this repository and install the dependencies:

git clone https://github.com/your-repo-url.git
cd your-repo
npm install

Usage

Initialize Project

To replicate the files and structure of this repository into your current directory, use the following command:

npx @wral/studio-ui.misc.seed init

Development

To start the development server, run:

npm run dev

Building

To build the project, run:

npm run build

This will create the production-ready files in the dist directory.

Testing

To run the tests, use:

npm run test

This will run the tests using Web Test Runner.

Generating Documentation

To generate documentation using JSDoc, run:

npm run build:docs

The documentation will be generated in the docs directory.

Files

  • index.html The main HTML file for the project.
  • vite.config.js Configuration for Vite, including build settings.
  • .gitignore Specifies files to ignore in the repository.
  • jsdoc.json Configuration for JSDoc to generate documentation.
  • README.md This file.
  • eslint.config.js Configuration for ESLint, including rules and settings.
  • .vimrc Vim configuration for the project.
  • .npmrc NPM configuration, including authentication token.
  • package.json Project metadata and dependencies.
  • bitbucket-pipelines.yml Configuration for Bitbucket CI/CD pipelines.
  • web-test-runner.config.mjs Configuration for Web Test Runner.
  • src/ Source directory containing the component code and tests.

Contributing

Contributions are welcome! Please follow these steps to contribute:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature/your-feature-name).
  3. Make your changes.
  4. Commit your changes (git commit -am 'Add some feature').
  5. Push to the branch (git push origin feature/your-feature-name).
  6. Create a new Pull Request.

Releases

Use npm version (major|minor|patch) to tag a new version and git push --tags.

Our CI/CD pipeline will handle testing and building.

License

This project is licensed under the ISC License. See the LICENSE file for details.

Example Component

src/hello-world.mjs

This is a simple example of a web component built with Lit.

import { LitElement, html, css } from 'lit';

/**
 * `hello-world` is a simple web component that displays a "Hello, World!"
 * message.
 *
 * @customElement
 * @extends LitElement
 */
class HelloWorld extends LitElement {
  static styles = css`
    :host {
      display: block;
      padding: 16px;
      background-color: lightgrey;
      border: 1px solid black;
    }
  `;

  render() {
    return html`
      <h1>Hello, World!</h1>
    `;
  }
}

customElements.define('hello-world', HelloWorld);

src/hello-world.test.mjs

This is an example test for the hello-world component.

import { fixture, html, expect } from '@open-wc/testing';
import '../src/hello-world.mjs';

describe('HelloWorld', () => {
  it('renders a message', async () => {
    const el = await fixture(html`<hello-world></hello-world>`);
    const h1 = el.shadowRoot.querySelector('h1');
    expect(h1).to.exist;
    expect(h1.textContent).to.equal('Hello, World!');
  });
});

CI/CD

This repository is configured to use Bitbucket Pipelines for Continuous Integration and Continuous Deployment (CI/CD). The pipeline configuration is defined in the bitbucket-pipelines.yml file.

The pipeline includes the following steps:

  • Lint: Checks code syntax using ESLint.
  • Test: Runs tests and generates coverage reports.
  • Build: Builds the project for production.
  • Publish: Publishes the package to NPM and deploys to a CDN.

Contact

For any questions or issues, please open an issue on the repository or contact the maintainer directly.


Happy coding!