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

@financial-times/g-components

v11.2.0

Published

FT.com Page furniture used in interactive journalism projects, wrapped in React

Downloads

393

Readme

g-components

Reusable React components for building IG pages.

Adding to a project

There are two ways you can consume g-components:

  1. The full bundle
import { Accordion } from "@financial-times/g-components";
import from "@financial-times/g-components/styles.css";

This is the new way. It's easier and about as performant as the old way.

  1. Individual components
import Accordion from "@financial-times/g-components/accordion";
import from "@financial-times/g-components/styles.css";

If you're having performance issues, please try the old way of importing individual components.

Migrating to g-components v9

g-components v9 is lighter than previous versions and has a few significant API differences:

  1. You only need to import one CSS file regardless of whether you import individual components or the whole bundle:
import from "@financial-times/g-components/styles.css";
  1. The following components have been removed:
  • data-sonification
  • feature
  • html-head
  • progress
  • sticky-header
  • sticky

Please stay on v8 if you use any of these components.

Running the Storybook

You can see what components are available in Storybook:

$ npm run storybook

Development

To test components during development:

$ npm link ../g-components

Releasing

First make sure your local is up to date with the origin and that you're on the main branch:

$ git pull
$ git checkout main

Next, run npm version [major|minor|patch] to increment the version based on the type of changes in this release. We use Semantic Versioning to increment versions:

  • Breaking (non-backwards-compatible) changes should be a major release
  • New features (that are backwards-compatible) should be minor
  • Bug fixes should be a patch
  • Alternatively, you can use npm version vX.X.X to set the version yourself.

Finally, run git push --follow-tags to push the new version to GitHub, which will trigger the CircleCI pipeline that publishes the new version on NPM.

Pre-release ("canary") versions

If you'd like to release a pre-release version (e.g. to test or gradually roll out a new feature), you can create a new version like npm version v1.0.0-canary.0. The version number should represent the ultimate release this change will land in, while the final 0 can be incremented to make subsequent prerelease builds.

NPM can also generate this automatically for you, with npm version pre[major|minor|patch] --preid canary.

Licence

This software is published by the Financial Times under the MIT licence.

Please note the MIT licence only covers the software, and does not cover any FT content or branding incorporated into the software or made available using the software. FT content is copyright © The Financial Times Limited, and FT and 'Financial Times' are trademarks of The Financial Times Limited, all rights reserved. For more information about republishing FT content, please contact our republishing department.