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

@sendcloud/checkout-plugin-ui

v2.4.2

Published

A package for rendering custom shipping options in a shop system during the checkout process

Downloads

679

Readme

Checkout plugin UI

A package for rendering custom shipping options in a shop system during the checkout process (e.g. service point picker, delivery date picker for nominated day delivery) or the Sendcloud platform.

Links

Content

Documentation

The project documentation is available at sendcloud.gitlab.io/frontend/checkout-plugin-ui.

Development

Important: Before contributing to this project, one must read Technical specification: checkout plugin UI. The checkout plugin UI package is implemented based on this specification. Significant changes made to the package must be documented in the technical specification. All releasing changes must be documented in the changelog section.

Requirements

You must have Node.js version 18 or above installed.

Installing dependencies

npm install

Starting a local development server

npm start

A local development server will be available at localhost:3000/public.

Running tests

npm test

Versioning

Read Versioning.

Releasing a new package version

The general workflow is described in Releasing a new package version.

Specifically for the checkout-plugin-ui package, a few extra rules apply:

  • Before releasing a new package version, the document docs/changelog.md needs to be manually updated.
  • For breaking changes, a major package version must be released. Since the shop system plugins that use this package refer to it using minor version ranges (e.g. @^1.0.0), their implementation needs to be updated after a major version release (e.g. references to @^1.0.0 need to be changed to @^2.0.0). Also, the “cache:purge” job in the .gitlab-ci.yml file needs to be updated accordingly.

Back-porting changes from the default branch into a pre-release branch

Read Keeping pre-release branches up-to-date with a project’s default branch.

Verify browserslist configuration

Open the babel.config.js file and copy the value of the targets configuration and run npx browserslist $targets like this:

npx browserslist '> 1% in my stats and not ie <= 11'

This will result in an output like this:

and_chr 89
android 81
chrome 88
chrome 87
chrome 86
chrome 85
chrome 84
chrome 83
chrome 81
chrome 80
edge 85
edge 84
edge 18
firefox 86
firefox 85
firefox 84
firefox 83
firefox 82
firefox 81
firefox 80
firefox 79
firefox 78
firefox 77
firefox 76

Project documentation

All project documentation can be found under the docs/ directory. Make sure to update related documentation whenever possible. All documentation is published using Gitlab pages. You can preview a merge request’s changes to the documentation website using GitLab review environments. Wait for the MR’s CI pipeline to complete and click the “Deploy” button:

Review environment image

Note: The View latest app action will point to an older version of the deployed documentation for a particular merge request. In the example above, new changes were introduced in the merge request and not deployed yet.

Setting the type field to module in package.json

(Last updated/checked: 2021-12-01)

Currently, this package doesn’t include "type": "module", in its package.json file. Setting it marks the package as a true ES module package. However, this cannot currently be done because Jest isn’t ready for it. Following https://jestjs.io/docs/ecmascript-modules leads to the following, unexpected issues:

  • [has no workaround] https://github.com/facebook/jest/issues/12145: Mocking the implementation of a function fn that is imported into the test via import * as alias from './module.js leads to the error “TypeError: Cannot assign to read only property 'fn' of object '[object Module]'”.
  • [has workaround] https://github.com/facebook/jest/issues/10025: Mocking the implementation of an entire module using jest.doMock breaks completely. To mock a native ES module, a new mockModule function is to be introduced that will solve this issue. For now jest.unstable_mockModule will do the job.