-
Notifications
You must be signed in to change notification settings - Fork 47
Can't install / list building blocks #122
Comments
Hi @lundmorten, thanks for reporting this. It seems we have to change it to foundation-cli/lib/commands/blocks.js Line 25 in 731c0df
https://get.foundation/building-blocks/data/building-blocks.json |
@joeworkman It seems I do not have any rights on npmjs to publish a new release. Can you do that? Don't forget to increment it (patch version). |
Also ZURB should check the redirect: foundation.zurb.com/building-blocks/data/building-blocks.json doesn't load / redirect at all. |
This issue has been mentioned on Foundation Open Source Community. There might be relevant details there: https://foundation.discourse.group/t/building-blocks-error-using-cli-install/1361/2 |
So this is sorta a big issue and I just double checked and it's still an issue. The main issue right now as far as I can tell is that fetchUrl() function is returning an invalid url and the user isn't receiving the files they are making a request for. So my questions are:
Finally, I have a question on performance. Wouldn't it make more sense if we cached the foundation blocks and copied them from the cache into the project folder? Right now, the architecture makes the CLI read the directory, checks if there is src/, and either downloads a zip via a network request or makes a network request for the files, processes them as a stream and then writes them to the drive. Network request & R/W IO is always going to be the biggest bottleneck and we use both of them.. It just seems like it would be more efficient to stick with read/write & copy and avoid the network request all together, unless we have to. But if I'm wrong on that, do correct me... |
Probably not, and if it would take very long. We have a direct ZURB contact but the communication is not that easy. We have already some redirects regarding the forum and website but not for these. When we make a new release and people update the CLI it should work again. |
Probably not that feasible. People can run I have already updated the affected files, this is not a problem. But I have no permissions on npm afaik. cc @joeworkman |
Planned vor v7. See foundation/foundation-sites#11847 and other related issues. |
Not sure how we can check when we have to refetch. Normally we would need some hashes. CLI is not browsers so there are no native caches. And when we update the building blocks the latest avilable version should be fetched. |
I would not bundle them with the CLI as this would produce a pretty big cli package. Only ship what people need (the commands). |
I wasn't suggesting that because your right, its large enough as is. @DanielRuf What are your thoughts on a vscode extension as a more modern alternative? If you check out the mjml vscode extension and the way they fetch templates is probably a lot faster and more efficient than the current way. Instead of templates, we could just request some json in the building blocks repo for the list? |
Not everyone uses VSCode (at least I use VSCode), many use WebStorm, PhpStorm, Coda or other solutions. Makes not much sense to support only one IDE. |
This would break CLI installs as this is completely different then and requires more than a URL change. Besides this, VSCOde extens are also Node packages so we get the same result like in the CLI. In general: feels like yakshaving and too much effort for a small problem. Using npx is the recommended way in general. |
|
Roger Roger. |
I just released v2.2.6. |
Foundation cli version 2.2.5
Running
foundation blocks list
results in "error fetching file /building-blocks/data/building-blocks.json" ...
The same with
foundation blocks install [some block]
The text was updated successfully, but these errors were encountered: