Getting to Know Grunt by Writing Your Own Plugin

Manager, Software Development at Loopio
Sep. 16, 2015
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
Getting to Know Grunt by Writing Your Own Plugin
1 of 42

More Related Content

What's hot

iOS Developers Conference-iOS Automation with Cucumber, Appium and SaucelabsiOS Developers Conference-iOS Automation with Cucumber, Appium and Saucelabs
iOS Developers Conference-iOS Automation with Cucumber, Appium and SaucelabsShashikant Jagtap
Lazy angular w/ webpackLazy angular w/ webpack
Lazy angular w/ webpackRich Snapp
Dyno cycling behavior of HerokuDyno cycling behavior of Heroku
Dyno cycling behavior of HerokuShunji Konishi
Dockerising Appium : London Appium MeetupDockerising Appium : London Appium Meetup
Dockerising Appium : London Appium MeetupShashikant Jagtap
J hipsterJ hipster
J hipsterRasmita Jena
Angular & railsAngular & rails
Angular & railsneodynamic

Similar to Getting to Know Grunt by Writing Your Own Plugin

Groovy Maven BuildsGroovy Maven Builds
Groovy Maven BuildsEvgeny Goldin
Scripting Support in GFv3 Prelude - Full VersionScripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionEduardo Pelegri-Llopart
G*なクラウド 雲のかなたに ショートバージョンG*なクラウド 雲のかなたに ショートバージョン
G*なクラウド 雲のかなたに ショートバージョンTsuyoshi Yamamoto
GruntGrunt
GruntAndrii Siusko
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end WorkflowPagepro
Let Grunt do the work, focus on the fun!Let Grunt do the work, focus on the fun!
Let Grunt do the work, focus on the fun!Dirk Ginader

Recently uploaded

Data Integrity TrendsData Integrity Trends
Data Integrity TrendsPrecisely
How to DAO?How to DAO?
How to DAO?Liveplex
Metadata & Discovery Group Conference 2023 - Day 1 ProgrammeMetadata & Discovery Group Conference 2023 - Day 1 Programme
Metadata & Discovery Group Conference 2023 - Day 1 ProgrammeCILIP MDG
Swiss Re Reinsurance Solutions - Automated Claims Experience – Insurer Innova...Swiss Re Reinsurance Solutions - Automated Claims Experience – Insurer Innova...
Swiss Re Reinsurance Solutions - Automated Claims Experience – Insurer Innova...The Digital Insurer
class and object in c++.pptxclass and object in c++.pptx
class and object in c++.pptxAdarsh College, Hingoli
BuilderAI Proposal_MalesniakBuilderAI Proposal_Malesniak
BuilderAI Proposal_MalesniakMichael Lesniak

Getting to Know Grunt by Writing Your Own Plugin

Editor's Notes

  1. workflow problem using Sass and Grunt (ruby + node) grunt-sass-version to ensure Sass version since it can't be directly managed by npm
  2. workflow problem using Sass and Grunt (ruby + node) grunt-sass-version to ensure Sass version since it can't be directly managed by npm
  3. you publishing a plugin isn’t the point I got a lot out of the process of building one that I’ve used in other projects and wanted to share I went into the process looking at these tools as black boxes and benefited from getting better understanding I want you to think about your tool and consider what you could get out of investigating them more deeply
  4. not that complicated really, 1-4 are just scaffolding, 5 is build, 6 is publish
  5. not that complicated really, 1-4 are just scaffolding, 5 is build, 6 is publish
  6. not that complicated really, 1-4 are just scaffolding, 5 is build, 6 is publish
  7. sounds a lot like Yeoman
  8. grunt-init is kind of replaced by Yeoman but both work point is that scaffolding projects is really useful but the tool isn’t that important grunt-init seems simpler but Yeoman has more community support
  9. *highlight grunt.loadTasks('tasks');* this is the line that actually includes your plugin code I don’t like “black magic” code where things happen because of naming convention etc…
  10. Start of my plugin this.options and this.data are how you talk to a plugin
  11. The options object is used to override the default value you identify in your plugin Any key/value pairs provided in the task get passed into this.data
  12. *collapse warnings* don’t need to go into too much detail here but a quick read makes it clear that this if file I/O maybe fine for your plugin but not for mine
  13. my plugin gets expected version generated regex for testing based on options runs `sass –v` to get available Sass version compares available version to regex and return result object
  14. need to include shelljs which means it’s a dependency for the module
  15. devDependencies are what you need when you `git clone` dependencies are what you need when you `npm install` peerDependencies are required for a plugin relationship
  16. don’t follow the order of this presentation think about testing with or before development, not after https://www.flickr.com/photos/catherinekolodziej/8866489274 I wish: https://www.flickr.com/photos/37423935@N00/10373620734
  17. included in scaffolding nice sanity check for your js make sure it’s checking all your js files
  18. *show clean, webu, nodeunit tasks and registering test task* scaffolded Gruntfile.js sets up way to run the plugin itself, identifies the tests, then created the test task
  19. scaffolded test/plugin_test.js runs tests against created output files using ‘fixtures’ and ‘expected’
  20. my tests call on _sass_version which is my library
  21. Catch-22 don’t want to publish module until it’s testing can’t test until published (at least with normal way of using npm)
  22. we can acquire dependencies by version number, tarball, git URL, or local path
  23. npm link creates a symbolic link to a local dependency
  24. Started as scratching my own itch Became about contributing to something bigger But ultimately was a powerful opportunity to “level up” my skills You can read the docs and browse the code but building something is the best way to learn