Our development workflow is as follows (for themes)

1. All custom theme work happens in your _config directory
2. Make my-theme.js, pull everything together, either in this directory or in a wcfactory catalog of elements you've made
3. Reference this in you _config/my-custom-elements.js element
4. Update the _config/config.json block that says themes to include something like...

This tells HAXcms UI that you can now select the theme (but don't yet, it won't be valid)

## Local development workflow during theme development

We use polymer cli to serve up and work on web components locally and while you don't have to, it's recommended as part of the WCFactory workflow.

1. Make a new site in the HAXcms UI
2. Go to _sites/mynewsite and run polymer serve --npm --open --entrypoint dist/dev.html
3. Adjust the URL that opens to only be the IP address with no path after it
4. You'll see your site open up for local development work, which will be leveraging any assets referenced in your node_modules directory at the HAXcms project root.
5. To add / install new assets run yarn (or npm) add @what/ever-you-want --save , just like you would any other project you work on in FE dev
6. edit your site's site.json manually to update the theme to point to the theme location your actively working on
7. Develop away until it is to your liking

## Shipping the theme

To ship the theme, you'll need to do a polymer build routine

### important note

This currently forks you from the original source of HAXcms core (because it will recompile the assets). If you're ok with this cool, just know we're trying to find ways around this involving rollup .

1. Go to the HAXcms project root
2. run polymer build
3. Copy the build directory and go to your site
4. Delete the symlink and replace it with your build directory
5. Now you can publish via the UI so long as you do not leverage a CDN

## The future

Admittedly, the full on custom theme / web component development workflow is rough. It's hard to maintain a built copy in a modular system without tooling. In the future we plan on having tooling workflows built directly into WCFactory that allow you to streamline the development and creation of HAXcms themes.

## Current limitations

You can't leverage existing CDNs (like webcomponents.psu.edu and whatever else is out there) that are pegged to the HAXcms project's source. You'll be creating a custom theme which then creates a custom build in effect so you'll want to ensure that you have some place that you can host the assets in order to power your site.