thepolicylab-projectportals / project-portal-theme

Gatsby Theme for the Project Portals
MIT License
1 stars 0 forks source link

Project Portal Theme

Repository Contents

Getting Started with Development

Important:

Install Dependencies

You can install the dependencies (including node 18 and yarn berry) by running:

brew bundle

Install the node-dependencies and the workspaces:

yarn install

Develop Site in Workspace

Run the example site in develop mode:

yarn workspace example-site develop

If you want to run the Decap CMS backend, then you need to start the Decap server in a separate terminal window.

In the packages/example-site directory run:

npx decap-server

In the packages/example-site/static/config.yml file, change the local_backend parameter to:

local_backend: true

Then load the https://localhost:8000/admin/ to view the Decap CMS UI.

Develop Storybook in Workspace

Run the Storybook in develop mode:

yarn workspace storybook develop

Updated components in ๐Ÿ“gatsby-theme-project-portal will be shown in the Storybook.

Release Process

The release process is automated using GitHub Actions.

GitHub actions will run to create and publish NPM packages. Check in GitHub actions whether the process runs without errors and fix any errors which occur.

Test the theme

Test installing and building the theme using the test-packaging scripts, where you load the theme and other plugins from the registry instead of the local directory:

source test-packaging.sh
package-and-install -t "packages/example-site/" -w @thepolicylab-projectportals/gatsby-theme-project-portal,@thepolicylab-projectportals/project-portal-content-decap

This script simulates the package release and build process that the sites undergo during deployment via Netlify. This script is helpful when debugging strange errors in the build process, i.e. when errors only occur during deployment.

Use Prettier Code Formatter in WebStorm

To set up the prettier code formatter, first install the dependencies (yarn install) and then ensure that prettier is activated in the dialog box: WebStorm > Preferences > Languages and Frameworks > JavaScript > Prettier.

The settings should be: