skuid-grunt

  • 4
  • Praise
  • Updated 3 years ago
https://bitbucket.org/skuid/skuid-grunt

This will be amazing! Can't wait for the skuid page api.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 4
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Huh! What! When! DEEP DIVE?
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
exactly what I'm thinking!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Any plans for Gulp?
Photo of mB Andréas K.LeF

mB Andréas K.LeF

  • 1,244 Points 1k badge 2x thumb
For anyone looking to use gulp (as I have), just do the setup as normal, then import the task using gulp-grunt and run it as part of you gulp tasks
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
When is update 7 going to be released?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
We ran into some snags which has made Update 7 take longer than expected, but we're hoping for tomorrow afternoon.
Photo of Ben Hubbard

Ben Hubbard, Employee

  • 12,490 Points 10k badge 2x thumb
Update 7 is available now from the Skuid Releases page.
http://www.skuidify.com/skuidreleases
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Just took a cursory look at this and this is going to be incredible!  I've been planning on implementing something at the page level for a long time but there was no straightforward way to do this without SOQL to the Page SObject itself.  

An API, this is awesome!  And open source enabling contributions, even better!

In my current build process, I use dmc (https://www.npmjs.com/package/dmc) to manage org credentials and nforce & nforce-metadata to interact with SFDC.  Need to take a closer look at skuid-grunt but adding dmc as the credentials backbone would be a great way to improve credential management and avoid hardcoding creds in config file.  Another interim option would be to use environment variables.

Thank you!!
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
dmc looks interesting. Environment variables would definitely be recommended right now, and this would be ideal for using skuid-grunt within a Continuous Integration process as you could set environment variables differently for each CI build / deployment task, e.g.

var orgOptions = {
   clientId: process.env.SKUID_GRUNT_CLIENT_ID,
   clientSecret: process.env.SKUID_GRUNT_CLIENT_SECRET,
   username: process.env.SKUID_GRUNT_USERNAME,
   passowrd: process.env.SKUID_GRUNT_PASSWORD
};

Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Yep, exactly.  The environment variables would allow you to build grunt targets based on purpose rather than environment/purpose combo.

dmc has worked out really well for me thus far, although I'll admit to just starting to make the jump over to it.

dmc grew out of grunt-ant-sfdc (https://github.com/kevinohara80/grunt-ant-sfdc) which offered hardcoded and environment variable style configuration.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Ok, definitely feeling like this is awesome, but a bit over my head.

Trying to set this up, and I think I've successfully installed node.js, grunt, and skuid-grunt... but not sure how to create the gruntfile. where do I get my client id and client secret?

Can anyone point me to some resource which has detailed setup steps?
(Edited)
Photo of Ethan Rogers

Ethan Rogers

  • 272 Points 250 badge 2x thumb
Creating the Gruntfile is as easy creating a new file called Gruntfile.js and using the template from the README, which we updated yesterday with some additional information to help you get started.

There is a link about how to setup a Connected App and get your Client ID and Client Secret. 
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Photo of mB Roman Melnik

mB Roman Melnik

  • 2,802 Points 2k badge 2x thumb
Woah! This sounds incredible.
Gonna be a whole lotta fun to learn and implement!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Just got this working... and it's as amazing as expected.

Thanks, Skuid!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
OK, another question: do I have to install grunt and skuid-grunt to each project directory, or is there a way I can install grunt once and use it everywhere?
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Matt, it all depends on what you're trying to accomplish.

If you've got multiple Force.com projects / orgs that you're managing, and you've got these projects in source control / you want to be able to pull down and push changes to Skuid Pages separately for each of these projects / orgs, then the recommended approach would be to install skuid-grunt in each project directory. It will be much easier to manage your Skuid Pages relative to / in context of each Force.com project / org separately, rather than trying to have just one directory with a complex Gruntfile with multiple pull and push targets for each org, where you'd have to do grunt like this: grunt pull:sandbox1, dumping pages into sandbox1/skuidpages or something like that. Managing Skuid Pages in context of a Force.com project / org is highly recommended.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks, Zach.

If I have a central developer org that I'm using to push skuid pages to multiple production orgs, how would you recommend that I structure it?
Photo of Barry Schnell

Barry Schnell, Champion

  • 18,086 Points 10k badge 2x thumb
Hey Matt -

Installing grunt and using grunt are two different things :)  

You can install grunt globally (npm install -g grunt-cli) and then use it from any node js terminal/command window.

Taking from what Zach was recommending, once grunt is installed, you'd want to have skuid-grunt installed on a per project basis.  When installing npm plug-ins, you can use the "--save-dev" option and this will automatically update your packages.json file.  You'll then commit your gruntfile.js and packages.json in to your VCS.

In your particular situation, since you are only using a single DE Org and pushing to multiple prod orgs, I would do the following:

1) Install grunt globally (or choose to just install in the current directory)
2) Initialize a package file (npm init) in the project folder
3) Create gruntfile.js by hand or use the grunt-init module (http://gruntjs.com/project-scaffolding)
4) create a target for each of your deploy destinations

If you had multiple orgs/multiple projects in VCS, you would repeat 2-4 for each project

Note that when you pull down code from VCS to a new machine/folder, this will bring your packages.json and gruntfile.js with the pull.  From there, you can just run "npm install" and it will automatically install any node modules in the packages.json file.
Photo of Ethan Rogers

Ethan Rogers

  • 272 Points 250 badge 2x thumb
Matt- I will be updating the skuid-grunt repo with some example configurations sometime this morning. Keep an eye out. Hopefully it will help!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Thanks Barry and Ethan! Very helpful.
Photo of Ethan Rogers

Ethan Rogers

  • 272 Points 250 badge 2x thumb
For anyone interested in getting started with skuid-grunt, we've added a scaffolding project with a step-by-step walkthrough! 

https://bitbucket.org/skuid/skuid-grunt-starter
Photo of mB Andréas K.LeF

mB Andréas K.LeF

  • 1,244 Points 1k badge 2x thumb
beautiful! works like a charm. Could there be a section in there on pushing/pulling component packs as well?

edit: I love the environment variables. bravo!
(Edited)
Photo of Ethan Rogers

Ethan Rogers

  • 272 Points 250 badge 2x thumb
Thanks!

Component Packs are just Static Resources which Salesforce provides deployment tools for. There are Grunt plugins and node modules for deploying your Metadata that could be worked into your build/deployment workflow.
Photo of mB Andréas K.LeF

mB Andréas K.LeF

  • 1,244 Points 1k badge 2x thumb
figures.. Alrighty then, thanks!