Installation without composer


#1

Without composer, how can I install the theme sage?
My online test dev. hosting server does not allow users ssh access.
My local PC is MBP. How can I do for theme install?


#2

You can install on your workstation/build and upload all artifacts directly to production.


#3

As @strarsis suggests, you can do everything locally and then run yarn build:production before uploading the theme to your hosting server.

Just ensure that you exclude the node_modules folder from the upload.


#4

Even better, use a tool like DeployBot to build your theme automatically when you push it up to GitHub, and then have it SFTP everything into your server. It’s easy to setup.


#5

@Stephen. I’m thinking moving from Sage 8 to 9 and a lot of stuff are completely new to me (webpack, blade, composer). I’m thinking about when I have to publish the code / theme. I can do yarn run build:production and the upload the files via ftp (not a bid deal because it’s a one shot theme) but I’m thinking about how to handle the files on the web server.
I mean, have I to install composer? How can I know if it supports blade? Are these logical questions OR I just need to upload the theme folder without node_modules folder?


#6

@dghez, I’m going through the same process at the moment - the last theme I made was with Sage 8 and now I’m working on a new one with Sage 9. It’s a bit of a learning process with these new tools and the documentation is still not complete but with the forums, you should always be able to figure out what is needed.

All you need to do is upload the files in the theme folder. There’s no need to install Composer on your web server.

You can think of Composer as the PHP equivalent of Yarn - it manages and fetches the PHP dependencies and puts them in the vendor folder. The files will be there once you have run composer install (note: this will be done for you automatically if you set up your theme via the composer create-project roots/sage your-theme-name dev-master command).

It can be confusing at first but once you’ve done it a few times, it makes a lot more sense :slight_smile:

@JulienMelissas - DeployBot looks great but it might be overkill for this case (plus it costs at least $15/month). In the past I’ve used PHPloy with local Git repositories with good results. Or even simpler, I sometimes use Forklift to sync changes via SFTP.


#7

@Stephen thanks for the clarification about moving stuff online, I’ll test when I’ll be ready to release. :raised_hands:
Now I’m currently re-writing everything I’ve done on sage 8 (I started this prj a week ago) into sage 9 theme, I decided to rewrite everything to have consistency with the new approach, using blade templating markup. Thankfully I’ve wrote some snippet some time ago in handlebars so blade it’s not completely new because is similar in some aspects.

Btw, to be honest for now the most painful stuff was upgrade to php7. It took a lot of time to figure out how. :rofl:


#8

You’re welcome :slight_smile:

It’s a shame about the situation with Bower and Bootstrap but I think you’ll be in a good place once you’re comfortable with Sage 9.

Why was upgrading to PHP 7 so painful? Do you mean on the server or with your local development machine? I used Homebrew for my local PHP 7 installation and most of the web hosts I work with have it, so it was quite a smooth process. I remember in the past that wasn’t always the case!


#9

Yeah, but I mean. Bower is dead, we need to move forward. I think that in another way it’s a good thing, it force people to learn new staff. I’ve never used webpack, so finally it’s time to understand a bit how it works :slightly_smiling_face:

No way. I tried with brew install php70 as seen on on Medium but after the upgrade with homebrew i still see php 5.6. I solved using export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH" in the terminal when I need php 7. So technically my machine still run as default php 5.6 :sweat_smile:


#10

Totally agree, sometimes we just need a push :wink: If you’re learning Webpack, I’d recommend this video.

That’s strange, I didn’t need to do any of that… At least you got it to work! For me, the most pain I’ve had has been with Node / NPM versions…