contentful/create-contentful-app

Repository files navigation

This repository includes multiple npm packages to improve the development experience when writing Contentful Apps.

A CLI to easily bootstrap Contentful apps

More information

A CLI to perform recurrent operations for Contentful's App Framework.

More information

Toolkit for building a Contentful app in React.

More information

A new package version is automatically published to npm upon merging on the mainline branch.

To manually publish the package, run npm run publish.

This package has two main development streams: latest and canary. Canary releases are labeled as ${CANDIDATE_VERSION}-alpha.${BUILD_NUMBER} in npm.

Changes on the canary branch are automatically published. However, you can still manually make a canary release using npm run publish:canary.

The default and stable releases are always published under the latest tag (as per npm convention). The release under the canary tag is to be considered unstable and potentially breaking. You should not rely on it in production.

When creating or editing an example in the apps repo on a branch other than main, follow these steps to use that branch as a source for the CCA CLI:

  • Fetching Examples from the apps Branch
  • Cloning Examples from the apps Branch using tiged
  • Building the create-contentful-app package
  • Linking the create-contentful-app package
  • Running the create-contentful-app interactively

In the packages/contentful--create-contentful-app/src/getFolderNames.ts file change:

export const CONTENTFUL_APPS_EXAMPLE_FOLDER = 'https://api..com/repos/contentful/apps/contents/examples';

TO

export const CONTENTFUL_APPS_EXAMPLE_FOLDER = 'https://api..com/repos/contentful/apps/contents/examples?ref=<branchname>';

Where is the branch with the example under development

In the packages/contentful--create-contentful-app/template.ts file change:

const d = tiged(source, { mode: 'tar', disableCache: true });

TO

const d = tiged(`${source}#<branchname>`, { mode: 'tar', disableCache: true });

Where is the branch with the example under development

From root

cd packages/contentful--create-contentful-app
npm run build

From packages/contentful--create-contentful-app

npm link
cd ../create-contentful-app
npm link @contentful/create-contentful-app

From packages/create-contentful-app

node index