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

forward-accelerator

v1.1.3

Published

A React Component library to enhance projects built on SFCC pwa-kit

Downloads

36

Readme

Introduction

This is the Forward Accelerator component library. It's a React Component library to enhance projects built on SFCC pwa-kit. It uses rollup and babel to bundle and transpile React code to ES6 and CommonJS bundles. This has a few advantages and disadvantages

Advantages

  • The transpiled code has flattened dependencies, so it cannot conflict with dependencies of the implementing project. Theoretically this means you can use different versions of dependencies in the implementing project compared to the library. For instance for the POC the demo implementation used Node version 14.17 while the library used Node version 19.3. However, to reduce the compiled size of the library, npm peerDependencies should be leveraged as much as possible.
  • The implementing project has no control over the components in the component library. It either has to use the components as is (although it can of course take full advantage of flexibility offered through the components by way of prop injection, composition and higher order components)
  • The transpiled code can be used in any project, doesn't have to be a pwa-kit or even React project

Disadvantages

  • The development flow is a lot more clunky, see section "How to test changes"
  • The transpiled code is very hard to debug, need to add log statements which is especially painful in combination with the previous issue

Installation

"generate": "cross-env-shell npm explore forward-accelerator -- plop -- --destinationPath $INIT_CWD"

TODOs

  1. Evaluate effort to convert library to Typescript
  2. ~~Fix linting errors (Currently all related to missing prop-types)~~
  3. Setup precommit hooks to prevent linting errors from being commited
  4. Analyze and add peerDependencies
  5. Add unit testing -> https://xploregroup.atlassian.net/browse/FCSP-3
  6. Setup team access on NPM
  7. Define version control and way of working with publishing and testing NPM packages -> https://xploregroup.atlassian.net/browse/FCSP-222
  8. Refactor buildLocals function to a hook or similar
  9. Research and test component structure, setup a POC with Higher Order Component
  10. Setup a POC with a custom page in the component library
  11. Setup a POC with Chakra theme in implementation extending or overwriting library theme -> https://xploregroup.atlassian.net/browse/FCSP-185
  12. Improve component styling
  13. Maybe come up with a way to pass site and locale through context without needing to pass it through props every time

How to test changes

  1. Switch to node version of forward-accelerator
  2. Update version property in package.json
  3. run 'npm run rollup'
  4. run 'npm publish'
  5. Go to project repository
  6. Switch to node version of project repository
  7. run 'npm install forward-accelerator@latest --save-dev'
  8. run 'npm run start'

References

How to Create and Publish a React Component Library Build a React Component Library Rollup-based dev environment for JavaScript (part 1)