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

@radio4000/components

v0.2.13

Published

Web components for radio4000.com

Downloads

323

Readme

Publish Package to npm

Web components for Radio4000

These components can be inserted in the HTML of any web pages, and are made to interact with Radio4000 through the use of its @radio4000/sdk, which talks to @radio4000/supabase.

Usage

Depending on whether you have a build system or not, you can either import the module from NPM, from a CDN or download it locally.

All methods are available on the imported sdk module.

With build system and NPM

import '@radio4000/components'
// use any <r4-component*> in your templates

With browser via CDN

<script type="module">
  import 'https://cdn.jsdelivr.net/npm/@radio4000/components'
  // use any <r4-*> component in your HTML
</script>

Changelog

See https://github.com/radio4000/components/releases

Development

  • The components are in the ./src folder
  • Inside ./examples you'll find demos of all components
  • The ./index.html file renders the <r4-app> component, which requires a SPA router.

If you'd like to help out, clone the repository, install dependencies and start the local server.

git clone [email protected]:radio4000/components.git radio4000-components
cd radio4000-components
npm install
npm run dev

Linting

Use npm run lint to check the project for potential code problems and style using eslint. It's configured to look out for web components, lit and jsdoc.

Themes

See the themes github repo

Build and releases

To release this package under @radio4000/components on NPM, bump the version in package.json, create a commit, tag it. Create a new release on Github and let the Github action publish it.

To make sure the build workflows:

  • npm run build
  • npm run dev
  • open - open http://localhost:4000/ and http://localhost:4000/tests/dist-test.html and click around, see if things work

Deploying to radio4000.com

To update radio4000.com, update the version of @radio4000/components on https://github.com/radio4000/radio4000.com.

Creating a new component

  • create a ./src/components/r4-*.js file
  • export default HTMLElement
  • import and export it in ./src/components/index.js
  • create an demo in ./examples/r4-*/index.html
  • reference the demo HTML page in ./vite.config.js

Connection to the Radio4000 database

All components use the @radio4000/sdk. The exact db is configured in https://github.com/radio4000/components/blob/main/src/libs/sdk.js.

Production

Currently deployed on cloudflare pages (which has the env vars manually added).

Github pages is not used because it does not support SPA redirects (like in the public folder for other hosting; @TODO: wait then migrate)