A tool to automatically sync themes from your local file system to your hosted Shopify shops.
I've used this tool for about 30 hours now and only had to restart the process once. However, it is still under development and may not be entirely stable. Use at your own peril.
-
Clone (then run
npm install
) or justnpm install
me onto your local machine or Cloud9IDE environment -
rename
config-example.json
toconfig.json
. -
edit the properties of
config.json
to match your Shopify shops' private app credentials (you can do this by going to https://{yourshop}.myshopify.com/admin/apps/private) then point the config file'sdirectory
property to your themes' folders. -
Run the command
npm start
(ornode app
) and start editing your Shopify templates!
Check config-example.json
for examples on applying these options. The defaults are:
{
"compress": {
// Enable this option for automatic file compression with Uglify.js
// Note: minification will only be applied to the uploaded file, the local file will not be modified.
"js": false // do not compress/minify JavaScript/JSON by default.
},
"ignoreDotFiles": true, // ignore dotfiles by default.
"interval": 500 // the default interval used when checking files for modification (in milliseconds)
}
You'll first need to install the template into your Shopify store then download and extract the zip file for the template.
For now, each template for your shop must be named after its template ID, e.g., 3981452
and 4870543
.
If your config file's directory
property is /home/websites/shopname/
you should have directory tree similar to:
/home/websites/shopname/3981452
./assets
./config
...etc
/home/websites/shopname/4870543
./assets
./config
...etc
- Add config option to automatically minify
JavaScript(done), CSS, and/or HTML (w/liquid), and optimize asset images on the fly. - Allow sub-directories within theme folders for better file organization. We can "fake" sub directories by replacing the "/" (forward slash) character with a magic string, like "DIR" (Shopify doesn't allow special characters in filenames, otherwise I'd just use a solidus
/
), i.e., the resourceassets/css/main.css
would be referenced and uploaded asassets__DIR__css__DIR__main.css
- Add config option to automatically download themes from a Shopify store to local disk.