Our development workflow is as follows (for themes)
"name": "Eberly ODL"
- All custom theme work happens in your _config directory
- Make my-theme.js, pull everything together, either in this directory or in a wcfactory
catalog of elements you've made
- Reference this in you _config/my-custom-elements.js element
- 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.
- Make a new site in the HAXcms UI
- Go to _sites/mynewsite and run polymer serve --npm --open --entrypoint dist/dev.html
- Adjust the URL that opens to only be the IP address with no path after it
- 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.
- 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
- edit your site's site.json manually to update the theme to point to the theme location your actively working on
- Develop away until it is to your liking
Shipping the theme
To ship the theme, you'll need to do a polymer build routine
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
- Go to the HAXcms project root
- run polymer build
- Copy the build directory and go to your site
- Delete the symlink and replace it with your build directory
- Now you can publish via the UI so long as you do not leverage a CDN
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.
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.