browsersync-themekit
v0.0.11
Published
A small cli to surface a browsersync start to link to a previewed theme from themekit into a shopify store
Downloads
13
Maintainers
Readme
NOTES:
- This package is not supported by either Shopify or Browser-sync this is purely a helper for people needing livereload while developing shopify themes.
- This package has browsersync as a dependency not a peer dependency, this is to allow running via
npx
TLDR
- Install browsersync & this wrapper
npm install browsersync-themekit --save-dev
- Create a config
npx browsersync-themekit -n
- Enter your details
- Browsersync can now be started watching the notify file you specified.
Usage
This package is designed to be used in conjunction with your dev environment, so should be able to bolt along side a themekit only env as well as somethign more advanced.
You can use this directly from node scripts and I would suggest running a package like npm run all which make creating a single
script trigger multiple tasks in parallel eg: npm run dev
which starts compilation, themekit and browsersync.
Installation and setup
- Install browsersync & this wrapper
npm install browsersync-themekit --save-dev
This will install the wrapper and also browser-sync or you can implicitly install browser-sync in your project or gloablly. npm install browser-sync --save
if you need it in other places.
This is to make this portable.
- Add a config file to your build kit. ->
npx browsersync-themekit -n
2.1 Follow the steps, it will ask for your themeId, and shop domain. The shop is required, if you opt out of the themeId it will just load the main published theme. If a themeId is provided it will load the preview of that theme when started.
2.2 The setup will ask you to provide a path to a notfiy file theme kit has this as an option and it makes a chang to this file once it is updated. you can find out more under the section about liveReloading.
The rest of the questions purely give you some options but sane defaults are in place.
- Once a config is in place at the root of your project it will be called:
browsersync-themekit-config.json
you can either start it straight away or tie it into the rest of your tools.
Run it
If you have a browsersync-themekit-config.json
setup in your folder, you can start it up by adding a script to your package.json
package.json
{
"scripts: {
"bsync": "browsersync-themekit"
}
}
you can now run that directly npm run bsync
However you are likely to want to link this up with other scripts, such as your themekit start command and compilers for CSS and JS. I would achieve this withe the help of: npm run all
Roadmap (stuff I am lookign at)
- Extend the cli to allow values to be surfaced from .env files
- Extend cli with additional flags for shop and theme id