# CPE Patterns

[![NPM version](https://img.shields.io/npm/v/cpe-patterns.svg)](https://www.npmjs.com/package/cpe-patterns)

> CPE's Pattern Library, powered by [11ty](https://www.11ty.dev/) (Originally built with [Drizzle](https://github.com/cloudfour/drizzle).)

## Usage

You can see the pattern library at https://cpe-patterns.netlify.app

To use the CPE patterns CSS or JS, you can get it via:

```
npm i cpe-patterns
```

## Documentation

- [Getting Started](docs#getting-started)
- [Toolkit Structure](docs#toolkit-structure)

## Development

Before running the project you'll need to install dependencies:

```zsh
npm ci
```

This will start running a local web server and reloading when you change files:

```zsh
npm start
```

## Publishing a new version

Make sure you have the latest npm version (`npm i -g npm`)

- `npm version <new version here>` (in a PR)
  - This will update the version number in `package.json`, `package-lock.json`, and `CHANGELOG.md`
- `npm publish` (on `master`, **after** PR is merged)

## Using your local version of `cpe-patterns` in another project

In your local `cpe-patterns` folder:

- `npm link` - registers the module globally
- `npm start` - starts watcher

In a repo that uses `cpe-patterns`:

- `npm link cpe-patterns` - This points `node_modules/cpe-patterns` to your local `cpe-patterns` folder

When you want to switch back to the published version of `cpe-patterns`, just run `npm i`
