/decoupled-kit-js

Pantheon's home for JavaScript SDKs, starter examples, and published npm packages. It makes decoupled on Pantheon feel like magic!

Primary LanguageCSSGNU General Public License v3.0GPL-3.0

Pantheon Systems Decoupled Kits

CircleCI

Prerequisites

To configure the monorepo for development, the following should be installed locally:

  • Nodejs version 16 LTS. We recomemnd using nvm

  • npm version 8.x.x

  • pnpm version 7.1.0

    We recommend using npm. Run the following command to install:

    npm install -g pnpm@7.1.0

Getting Started

  1. Fork this repo.
  2. Clone your fork to your local machine.
  3. Install dependencies for all packages and starters using the following command:
    pnpm install
    
  4. Install the husky pre-commit hooks. Run the following command:
    pnpm husky install
    

Useful Scripts

There are several scripts you can use on your monorepo.

  • Test all projects in the monorepo that have a test script:

    pnpm test
  • Build all packages in the monorepo:

    pnpm build:pkgs
  • Build all starters in the monorepo:

    pnpm build:starters
  • Build all projects in the monorepo:

    pnpm build:all
  • Run commands in a targeted project, folder, or workspace, using the pnpm filter flag.

    For example, to start the Gatsby starter from the root of the monorepo (filter by namespace):

    pnpm --filter './starters/gatsby-wordpress-starter' develop
  • Lint in the starters and filter by directory:

    pnpm --filter './starters/**' lint
  • Run documentation:

    pnpm --filter './web start'

Versions and Releases

Generating a Changeset

To generate a new changeset, run pnpm changeset in the root of the repository. The generated Markdown files in the .changeset directory should be committed to the repository.

Creating a New Version

  • To increase the versions of the packages and dependencies previously specified with pnpm changeset and update the changelog files, run the following command:

    pnpm changeset version
    
  • Run pnpm install. This will update the lockfile and rebuild packages.

  • Commit the changes.

Publishing a New Version

  • Confirm your publishing scope by running the following command in pantheon-systems:

    pnpm config get scope
    

    Alternatively, you can use the command pnpm config set scope @pantheon-systems.

  • To publish all public packages that have versions that are not currently in the registry, use the following command:

    pnpm publish -r --access public
    

Bug Reports and Feature Requests

  • Is the code in this repository not working as expected? Open a bug report here

  • Is there something you would like to see added to this project? Open a feature request here

Further Reading

For more information on contributing to this project, see CONTRIBUTING.md