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

@bsk-test/base

v1.0.0

Published

This is a starter structure for creating a component library.

Downloads

9

Readme

Component Library Starter

This is a starter structure for creating a component library.

Index

Getting started


  1. Clone this repo.

  2. Rename the package name in package.json. Make sure to leave the organisation name as is (@bsky/) to keep out packages within the organisation. eg

    {
      name: @bsky/headers,
      ...
    }
  3. install all of the dependencies with npm install

  4. Remove unused components from components directory and components index

Development

To start developing the library run npm run dev or npm start and build the components in a single file component structure.

Deployment

To deploy, merge into the master/main branch (this can be configured in the publish_to_npm.yml workflow file).

Deployment can also be run manually from the actions tab. See Manually running a workflow - Github Actions Docs

Once deployed

If this project has already been published to npm then it would be wise to start using feature branches for new components and mergin with pull requests via github.

Importing into another project

To import this into another project, simply run npm insatll @bsky/{library_name} --save and then insert import libraryName from "@bsky/library_name" and add it to your vue projects main.js

Importing - Example

// Example simple main.js =================================
import { createApp } from 'vue'
import App from './App.vue'
import BskHeaders from "@bsk-test/headers"; // Import here

createApp(App)
  .use(BskHeaders) // Use here
  .mount('#app')

Structure


Component Types

While developing components for a library you will find that there are 2 types of components

  • Private components - Not usable in parent projects
  • Public components - Usable in parent projects

Both of these export in some way, but only public components can be used directly by the parent project. They will still be exported but will only be used within other components.

Component Types - Example

If you have header with some icons in it, the icons can remain private as they are only split into seperate files for a more effective structure.

This way they are more encapsulated which prevents conflics with other libraries that may have another component with the same name.

Prefix

Namespace all public components with the Bsk prefix so there is minimal room for clashing component names.

How to use

All public components mus be added into the src/components/index.js file. If they aren't added, they wont be exported to the library.

Merging/pushing your changes into the master/main branch on github will automatically build the library and push it up to npm.

The progress of this can be seen in the actions tab in the github repo as 'Build and Publish to NPM registry'.

Errors

If you come accross some errors when pushing to github, the console should tell you potential reasons and how to fix them.

At the moment only versioning issues are tested for which can usually be fixed by changing the version number in the package.json to make sure that the version number is the newest.

Otherwise it may be that there is no package published under the name that you give it and the first publish will have to be done manually by running npm run build and npm publish.

if this is no longer an error and the output messege is changed to

✅ Version Number Check: Passed ..................................
   Package not yet published on NPM 

rather than

 ⛔ Version Number Check: Failed ..................................
 💔 Possible causes:
      - Package not yet published on NPM 
 🔨 To Fix:
      - Make sure package with name '{package-name}' is published to NPM

becuase I found a way to automatically publish the package please fix this in this documentation or send me (James Manning) a slack messege so I can update this.)