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

@agility/app-sdk

v2.1.0

Published

JavaScript library for building Agility CMS apps.

Downloads

314

Readme

Agility CMS App SDK

This is a React SDK for building UI Apps for Agility CMS.

Local Development

If you want to develop this SDK locally and test it in another project, follow these steps:

Step 1: Clone and Install Dependencies

First, clone the repository and install dependencies.

git clone https://github.com/agility/agility-cms-app-sdk.git
cd agility-cms-app-sdk
yarn install

Step 2: Build the SDK

Before using the SDK in your local project, build the package using the following command:

yarn build

This will clean, compile, and bundle the SDK, placing the output in the dist folder.

Step 3: Link the SDK for Local Development

To use the SDK in your local project, you can use yarn link. This allows your local project to reference the SDK directly without needing to publish it to npm.

cd agility-cms-app-sdk
yarn link

Step 4: Using the SDK in Your Project

Once the SDK is linked, you can link it to your project:

cd your-project
yarn link "@agility/app-sdk"

At this point, your project will use the local version of the SDK.

Step 5: Watching for Changes

If you're actively developing the SDK, you can start the watch mode for continuous builds:

cd agility-cms-app-sdk
yarn watch

This will watch for changes and rebuild the SDK as needed.

Avoiding React Linking:

To avoid conflicts between React versions, React is treated as a peer dependency and is not bundled with the SDK. This ensures that your project provides the React version, and you don't need to manually link React.

You may run into issues trying link to apps that are using Next.JS. If you can an error like that you can try to add the following to your next.config.js:

webpack: (config) => {
		config.resolve.alias = {
			...config.resolve.alias,
			react: path.resolve(__dirname, "node_modules/react"),
			"react-dom": path.resolve(__dirname, "node_modules/react-dom")
		}
		return config
	},

Notes On Peer Dependencies

  • Peer Dependencies: The SDK expects your project to provide its own version of react and react-dom that meets the version requirements specified in the SDK’s peerDependencies.
  • Shared React: As long as your project provides a compatible React version, everything will work without requiring manual linking.

This setup prevents version conflicts, avoids the need for linking React manually, and ensures that your project and the SDK share the same React instance.

Unlinking the SDK

To unlink the SDK from your project, run the following command:

In your project:

cd your-project
yarn unlink "@agility/app-sdk"

In the SDK:

cd agility-cms-app-sdk
yarn unlink

This will restore the original packages from npm in both your SDK and the project.

Example Apps

One of the best ways to learn a new SDK is to see some examples! Check out these sample apps to help you get started:

Google Analytics

A dashboard app that uses OAuth to connect to Google and pull Google Analytics data.

Google Translate

A sidebar app that translates and detects language for the current content item.

BigCommerce

A custom field app that allows selection of a product from BigCommerce. It includes a modal with a product listing and search component.