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

@contentful/integration-frontend-toolkit

v1.7.1

Published

> **Warning** > This library is under active development and is subject to significant changes. At any time code may be updated, depricated, or entirely removed based on our internal development of the [Apps](https://github.com/contentful/apps) repo.

Downloads

76

Readme

integration-frontend-toolkit

Warning This library is under active development and is subject to significant changes. At any time code may be updated, depricated, or entirely removed based on our internal development of the Apps repo.

This repository is a home to frontend tooling, primarily used to support integration (app) development.

The library itself offers the Integrations team a place to develop components outside of the app itself, as well as to house highly repeated code, to support reusability as well as customizability.

Local development

Ensure that your global npmrc has the following, or if you prefer, create a local npmrc in this repository with the same information:

//npm.pkg.github.com/:_authToken=<your token>
@contentful:registry=https://npm.pkg.github.com

This will allow you to successfully install the node_modules.

To install or update the app locally:

npm i

To run storybook locally:

npm run storybook

To run tests:

npm run test

Testing package locally

Option 1: Link the package using the global node module namespace

npm link 

and within the test application run

npm link @contentful/integration-frontend-toolkit

Option 2: Use npm pack to create a tgz file locally that mimics a fully packed library structure

npm build 
npm pack --pack-destination ~

import the packed file, i.e "file:~/contentful-integration-frontend-toolkit-0.0.0-semantic-release.tgz", into another library for testing

and within the testing library run:

npm install 

to actually install the tgz packed file.

You may need to continually update the version in your local package, and repack the tgz file, and reimport it with the new version, when updates are made.

Creating new submodule directories:

The current build of this toolkit creates build directories directly reflecting the directories under the src directory. You will notice upon building the toolkit, that these directories are created, and this supports submodule imports of the toolkit i.e:

import { HyperLink } from "@contentful/integration-frontend-toolkit/components" 
import { sentryMarketplaceAppsSDK } from "@contentful/integration-frontend-toolkit/sdks" 

When creating a new directory, you will need to add the directory name to the package.json "files" section in order for it to be exposed as a submodule.

Expectations of development

  1. Each new entity added to this library should be housed in its own directory
  2. Each new entity should be accompanied by a spec. file.
  3. Each new component created should be accompanied by a stories. file. Keep in mind the various iterations of an entity. Questions to ask: if it might be useful to create a story for each iteration? and if the story is self-explantory to other developers? Sometimes it is useful to add details, actions, decorators to describe the story and component.
  4. Each new entity needs to be added to the respective parent directory index.ts file.
  5. Directories are lower-cased unless they house a set of files related to a React component
  6. File names are lower-cased unless they house a React component

Commiting

Follow standard Semantic Versioning commit messages (when you squash or commit to master) in order to version the package correctly.

Examples commit messages:

  • Feat: A new feature, i.e feat(button): Add new button component
  • Fix: A bug fix
  • Docs: A documentation change
  • Style: A change that does not affect meaning of code (styling)
  • Refactor: A change that neither fixes a bug nor adds a feature
  • Perf: A code change that improves performance
  • Test: An adjustment to tests
  • Chore: A change to the build process of auxiliary tools and libraries

By default in this library right now, FIX is a patch release, FEATURE is a minor, and the label BREAKING CHANGE is a major release.

In progress improvements and known limitations:

  1. Currently it is challenging to create a directory that is just internal to the toolkit itself. For example, if we want to createa a directory that houses a helper function used in other methods across other directories, but do not intend on exposing this directory as part of the library, given how the build works now, we will need to experiment with how to implement this.
  2. Currently within the CI, we require Chromatic visual approvals of changes to components.

Other resources

Storybook Chromatic Semantic Release