Giter Site home page Giter Site logo

grunt-shopify's Issues

Download is throttled

It appears the download side is throttled as well so when you try to do a theme download it ends up erroring out.

$ grunt shopify:download
...
>> [grunt-shopify] - File "assets/j..." saved to disk.
>> [grunt-shopify] - Downloading "...".
>> [grunt-shopify] - File "assets/..." saved to disk.
Warning: Request limit exceeded for the Shopify API Use --force to continue.

Aborted due to warnings.
$

So the call should be tied into the same rate_limit_delay setting as the upload side. I did a quick hack and added a sleep loop using the current time and then doing a while loop but it is ugly since I am still new to nodeJS. There should be something more elegant added to the theme download side.

I just made a function called sleep and added it after the shopify.download(path.join(basePath, asset.key), next); call in lib/shopify.js

// At the top
function sleep(callback) {
    var now = new Date().getTime();
    while(new Date().getTime() < now + 500) {
        // do nothing
    }
}

// In the shopify.downloadTheme = function(done) {
async.eachSeries(obj.assets, function(asset, next) {
shopify.download(path.join(basePath, asset.key), next);
sleep(function() {});

explanation of hard coded value '/admin/assets.json'

I haven't gotten this plugin to work and I don't know what question to ask yet.

That aside, I was just looking at the code and noticed that you've got /admin/assets.json hard-coded but no comments and I'm trying to understand what it's purpose is.

From a RESTful perspective I would expect that I PUT /templates/something.liquid to replace that file and DELETE /templates/something.liquid to destroy it. Yet it seems that you're using query parameters to specify a file?

Can you enlighten me as to what's going on? Possibly point me to the right docs on shopify?

Task doesn't do anything...

Hi there,

I would love to use this plugin but I don't seem to be able to get it to run.

this is my grunt task:

        shopify: {
            options: {
                api_key: '<%= shpfy.api_key %>',
                password: '<%= shpfy.password %>',
                url: '<%= shpfy.url %>',
                theme: '<%= shpfy.theme %>',
                base: './shopify/',
            },
        },

this is my watch:

            shopify: {
                files: [
                    './shopify/assets/**',
                    './shopify/config/**',
                    './shopify/snippets/**',
                    './shopify/layout/**',
                    './shopify/templates/**',
                ],
                tasks: [
                    'shopify',
                ],
            },

And this is the output I get:

>> File "shopify/assets/BSBLSC.0.0.1.min.css" changed.
Running "shopify" task

Done, without errors.

When I run grunt shopify:upload I get this:

Running "shopify:upload" task
>> [grunt-shopify] - Uploading "assets/BSBLSC.0.0.1.min.css"
>> [grunt-shopify] - File "assets/BSBLSC.0.0.1.min.css" uploaded.
>> [grunt-shopify] - Uploading "assets/BSBLSC.0.0.1.min.js"
>> [grunt-shopify] - File "assets/BSBLSC.0.0.1.min.js" uploaded.
>> [grunt-shopify] - Theme deploy complete.

Btw I am using a very fresh and updated node install. (Might be a new version that breaks compatibility?)

Any idea?

Updating just changed files?

Can this feature be added. In most cases you update just few files of theme and then re-upload them and with this support it would be much faster.

UPDATE: I created PR for this: #56

Wait until other processing is done

Works really well until you need to compile some CoffeeScript or SASS. The problem then is that it only uploads the original file that was altered not the eventually compiled version.

Something you're thinking about?

Easier hiding of API Key and Password

@wilr

You could pull in the API Key and Password from another file then encourage users to add that file to their .gitignore. This would also help teams use their own credentials with the same project.

I can do a fork and pull request if you want.

Deploy and Force deploy

Is there a way to deploy without having to use the watch task? For example after executing a copy or sync task? Also can we force deploying the whole theme like the desktop app does?

If not, I think those could be great additions. Thanks!

Deploy without images

Hey guys. I have a theme on shopify. And I'm deploying it with grunt shopify:upload. How can I configure grunt or grunt-shopify to upload all files from assets/ folder, except *.jpg ?

Not allowed by Shopify whitelist

In the past two weeks, grunt-shopify stopped being able to upload files, reporting the following error on every upload action:

[grunt-shopify] - File "shop/assets/global--above-fold.js" not allowed by Shopify whitelist

I've updated npm and grunt-shopify, to no avail. This has worked for me for 2 years straight without problem, up until about 2 weeks ago when it broke. Can't see anything I've done to break it.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

grunt watch:shopify not publishing despite successful status report

Running on:

Windows v8.1
grunt-cli v0.1.13
grunt v0.4.5
grunt-shopify v0.6.0

Shopify:

    options: {
        api_key: "------------------------------------",
        password: "------------------------------------",
        url: "------------------------------------",
        theme: "------------",
        base: "themes/main/"
    }

Watch:

    shopify: {
        files: [
            theme + "assets/**",
            theme + "layout/**",
            theme + "snippets/**",
            theme + "templates/**"
        ],
        tasks: ["shopify"]
    }

Theme:

grunt.option('theme', path.join(process.cwd(), 'themes/main/'));

Run:

When running grunt watch:shopify and changing a file:

$ grunt watch:shopify
Running "watch:shopify" (watch) task
Waiting...
>> File "themes\main\templates\cart.liquid" changed.
Running "shopify" task

Done, without errors.
Completed in 1.594s at Tue Jul 07 2015 14:47:39 GMT+0100 (GMT Summer Time) - Waiting...

The changed file however, has not been pushed to the Shopify server.

not in base path

Got this issue today in a new mac I started using. No matter which shopify I try to run, I get a "not in base path" error. It's really weird because the file IS in the base path.
For instance, when trying to do an upload or sync, or even when watching the files:

Running "shopify:sync" task
>> [grunt-shopify] - File "/XXX/assets/ajax-cart.js.liquid" not in base path
.
.
.

Suggestion: Ignore settings_data.json setting

A suggestion: A setting in the gruntfile that ignores the settings_data.json and doesn't upload it to the site if changes to it are detected.

I see there is an option for this on the upload command, but don't see a similar setting for the watch command.

upload to multiple stores?

Hey Will, do you know if it's possible to upload to more than one store? Would be really handy for theme developers, as the same theme has multiple demo stores.

Reports successful push even when it clearly failed.

After realizing uploads aren't working at all, I tried to diagnose a problem. Nothing I did could cause a failed upload notification, even when I tried altering the API password to something clearly wrong.
capture

How do i get the latest version

When I run

npm install grunt-shopify --save-dev

I get a different version of the tasks/shopify.js to the one on github. Should I just clone it or download it?

Thanks!

Not updating files

I'm saving template/index.liquid and in the console it detects the file change and grunt-shopify says it's "uploading" but I'm not seeing any changes reflected on the site. Any idea why this is happening? Does grunt-shopify even recognize the theme directory because some of the examples just jump right into a /javascript directory.

Grunt-Shopify runs twice?

I have the following setup: A folder named src with all my sass, images, template etc. organized in subdirectories. I use grunt-contrib-copy, grunt-watch and grunt-newer to “compile” this into a valid Shopify theme structure. Grunt-newer is used to only copy changed files. Let’s say I edit and save my theme.liquid in my src folder, I get the following response:

screen shot 2013-09-21 at 14 21 10

It looks like the grunt-shopify run twice. I tried to debug, but with no luck.
I tried to add a delay to grunt-shopify, but the same thing happens.

I guess grunt-shopify watch and looks for changes, and react immediately, before the file is done being copied with grunt-contrib-copy. I tried setting different options in watch like options.spawn and options.debounceDelay, but with no luck.

Both grunt-shopify and grunt-contrib-copy looks for changes in the app folder, but is it possible to somehow control the order in which they run?

My current watch setup:

watch: {
  copy: {
    files: '<%= project.src %>/**',
    tasks: ['newer:copy:shopify']
  },
  shopify: {
    files: ["app/**"],
    tasks: ["shopify"]
  }
}

Could it be that grunt-contrib-copy touches the files twice, and thereby trigger shopify-grunt twice?

In the end the file get’s uploaded and everything works fine, but the error really annoy me. And I can’t figure out why this happens.

shopify watch errors

According to the shopify docs there is a call limit to the shopify API, causing some errors when grunt watching with this task and at the same time executing something like touch snippets/* for uploading a set of liquid files.

For this reason I forked this repository (link to the fork) and added some changes:
I've added a queue from the caolan/async module with a concurrency of value 1 (only one upload at the same time) and a configurable delay between API requests (Shopify docs hinting is on 2 calls per second, so ~500ms delay in the best case).
This works now only on the watched files.

The purpose is to extend this to all the other interested pieces of code, but I'm pretty new to nodejs programming, and also insecure of this project guidelines.
It will be beautiful having feedback on my commits, and how to proceed if this enhancement can be useful :)

watch logic

ran into an issue when i have multiple watch targets and it would try to upload changed styl file. with latest shopify-api update to catch 404s this will return a decent error message but it shouldn't really be trying to upload anyways. on a side note the output is bit crazy.

watch: {
  package_update: {
    files: ['package.json'],
    tasks: ['stylus:style', 'rework:style']
  },
  style: {
    files: ['styl/**/*.styl'],
    tasks: ['stylus:style', 'rework:style']
  },
  shopify: {
    files: ['shop/**'],
    tasks: ['shopify']
  }
}

2014-02-24_1440

New 'Sections' feature in themes

Is there anyway to make this work with new themes that use 'Sections'? Get an error message using Grunt saying 'sections/collection.liquid not allowed by Shopify Whitelist'. Thanks.

Doesn't reliably push

It works for the first couple of pushes but eventually will stop pushing, then I restart the watch task and it works. Any ideas as to why? There are no errors in the console or anything.

tracking grunt-next watch logic

grunt-next, is the next major version, will have watch built in from the looks. the watch event maybe dropped in favor of task.target.changed config being set.

this is just to track the upcoming changes.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8466884-tracking-grunt-next-watch-logic?utm_campaign=plugin&utm_content=tracker%2F432437&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F432437&utm_medium=issues&utm_source=github).

No support for multiple shops

I changed "options" to one shop name and put two objects in in. I was getting:

Fatal error: Cannot read property 'disable_growl_notifications' of undefined

Realized you cant change the properties of "shopify" task.

watch stopped working shopify:upload still works

I used the watch method to upload only the files that have changed. I don't know what happened, but it stopped working overnight. shopify:upload still works.

I didn't change anything on my end, so I'm wondering if Shopify changed something on their end.

I'm getting this line in my console:
>> [grunt-shopify] - Uploading "assets/myfile.css"

but I never get the:
>> [grunt-shopify] - File "assets/myfile" uploaded
unless I use shopify:upload

Obviously this is a huge issue since I don't want to have to manually upload every single one of my theme files when I make a change to one of them.

Livereload is trigger prematurely

When grunt-shopify is set up as a watched task with livereload enabled it will do the following:

  • detect changed file
  • begin uploading changed file
  • live reload the browser
  • finish uploading file

It appears that it is sending some sort of premature completion signal back to grunt-contrib-watch instead of signalling completion when the file is actually done uploading.

Here's the relevant part of Gruntfile.coffee.

shopify:
  options:
    base: "deploy/"
watch:
  configFiles:
    files: ["Gruntfile.coffee"]
    options:
      reload: true
  shopify:
    files: ["deploy/**"]
    tasks: ["shopify"]
    options:
      livereload: true

grunt.log says file updated, but not working

@wilr

I've read the documentation page and I have my task set up correctly as far as I can tell. I'm using watch, the task runs and I see an "OK" message in grunt.log but nothing is updated at the store. For a test I tried putting in an invalid api_key and it still says uploaded "OK."

I'm using Shopify 2, but I don't think that makes a difference.

Is there anything I can do to troubleshoot this?

"Loading "shopify.js" tasks...ERROR" after updating to 1.0.1 from 1.0.0

After updating to the latest version, I receive this error when running a watch tasks with [email protected]:

Loading "shopify.js" tasks...ERROR

Rolling back to 1.0.0 fixed this issue.

"devDependencies": { "glob": "~3.2.3", "growl": "^1.7.0", "grunt": "^1.0.1", "grunt-contrib-jshint": "^1.1.0", "grunt-contrib-nodeunit": "^1.0.0", "grunt-contrib-uglify": "^3.0.1", "grunt-contrib-watch": "^1.0.0", "grunt-shopify": "^1.0.0" }

Support for Theme ID?

New to your grunt-shopify project and looking forward to adding it to our workflow.

Until now, we've been building on one hand and using shopify_theme on the other. Having everything under one roof is definitely very nice!

Wondering if its possible to support themeid, so one could upload to an unpublished theme using this plugin. We use unpublished themes as development areas since all the store info is there. Not a biggie to get around using shopify_theme, but def would be a nice feature to keep everything clean and in one place in our Gruntfile.

I saw in lieu of donations you recommend Charity Water, our pleasure to support them. Thank you, and keep up the great work!

404 Not Found

Hi there. How can it be that shopify:themes command works (in fact it works without the Api key but just the password) and shopify:download hands the following error?

Warning: Request failed with "HTTP 404 Not Found" from the Shopify API Use --force to continue.

the other commands do not show any warning but still do not manage to complete the tasks. (e.g. upload, which does not change anything).

Any idea?

Gulp equivalent of grunt-shopify

Grunt-shopify works perfectly fine. But can you please provide a gulp equivalent for the same as configuring with gulp is quite simpler compared to grunt?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.