SlideShare a Scribd company logo
1 of 42
Download to read offline
Getting to Know Grunt
By Writing Your Own Plugin
@jamiestrachan
1. Scaffold
2a. Develop
2b. Test
3. Publish
Scaffold
Scaffold Develop Test Publish
Scaffold Develop Test Publish
Running grunt-init
Running grunt-init
?
Scaffold Develop Test Publish
“This scaffolding task was always an odd-duck, and it really
deserves it’s own project. So, we’ve broken it into a separate
npm module, grunt-init … In the coming weeks, the Yeoman
team will be replacing this task entirely, using their rails-
inspired generator system.”
February 18, 2013
https://bocoup.com/weblog/tearing-grunt-apart/
Scaffold Develop Test Publish
Scaffold Develop Test Publish
README.md
Scaffolded plugin
package.json
Scaffolded plugin
Develop
Scaffold Develop Test Publish
Gruntfile.js
grunt-sass-version
tasks/sass_version.js
grunt-sass-version
Gruntfile.js
grunt-sass-version grunt-sass-version
tasks/sass_version.js
tasks/<plugin>.js
Scaffolded plugin
tasks/lib/_sass_version.js
grunt-sass-version
tasks/lib/_sass_version.js
grunt-sass-version
package.json
grunt-sass-version
Test
Scaffold Develop Test Publish
Scaffold Develop Test Publish
Code Quality
Scaffold Develop Test Publish
Unit Testing
Scaffold Develop Test Publish
Gruntfile.js
Scaffolded plugin
test/<plugin>_test.js
Scaffolded plugin
Scaffold Develop Test Publish
nodeunit tests
sass_version.js
lib/_sass_version.jsGrunt input Grunt output
success,
message
test/sass_version_test.js
grunt-sass-version
Integration Testing
Scaffold Develop Test Publish
package.json
{ "dependencies" : {
"til" : "~1.2",
"elf" : "^1.2.3",
"asd" : "http://asdf.com/asdf.tar.gz",
"gitproj" : "git://github.com/user/project.git#commit-ish",
"dyl" : "file:../dyl"
} }
Scaffold Develop Test Publish
npm link
Publish
Scaffold Develop Test Publish
npm publish
Scaffold Develop Test Publish
1. register at npmjs.com
2. npm adduser
7. (npm unpublish)
So what?
Scaffolding
solid tools available: grunt-init, Yeoman
saves time
avoids mistakes
makes dull work easier
you can find existing templates or make your own
Testing
develop with testing in mind
use an automated testing tool like nodeunit
Managing Dependencies
npm link for local dependencies
git repos for unregistered dependencies
create distributed projects with npm
Contributing
process is similar for:
gulp plugins
grunt-init templates
Yeoman generators
hubot scripts
Learn your tools
Thanks!
Getting to Know Grunt By Writing Your Own Plugin
@jamiestrachan

More Related Content

What's hot

iOS Developers Conference-iOS Automation with Cucumber, Appium and Saucelabs
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/ webpack
Lazy angular w/ webpackLazy angular w/ webpack
Lazy angular w/ webpackRich Snapp
 
Dyno cycling behavior of Heroku
Dyno cycling behavior of HerokuDyno cycling behavior of Heroku
Dyno cycling behavior of HerokuShunji Konishi
 
Dockerising Appium : London Appium Meetup
Dockerising Appium : London Appium MeetupDockerising Appium : London Appium Meetup
Dockerising Appium : London Appium MeetupShashikant Jagtap
 
Angular & rails
Angular & railsAngular & rails
Angular & railsneodynamic
 
Lifthub (#rpscala 26)
Lifthub (#rpscala 26)Lifthub (#rpscala 26)
Lifthub (#rpscala 26)k4200
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow soloviniciusban
 
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?Iván López Martín
 
MVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkMVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkCaesar Chi
 
What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017Matt Raible
 
Use groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsUse groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsFátima Casaú Pérez
 
C初心者がbyebugにPR出した話
C初心者がbyebugにPR出した話C初心者がbyebugにPR出した話
C初心者がbyebugにPR出した話tzm_freedom
 
APIテストあれこれ
APIテストあれこれAPIテストあれこれ
APIテストあれこれtzm_freedom
 
Node.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deploymentNode.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deploymentCaesar Chi
 
WebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみたWebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみたonozaty
 

What's hot (20)

iOS Developers Conference-iOS Automation with Cucumber, Appium and Saucelabs
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 Saucelabs
 
Lazy angular w/ webpack
Lazy angular w/ webpackLazy angular w/ webpack
Lazy angular w/ webpack
 
Dyno cycling behavior of Heroku
Dyno cycling behavior of HerokuDyno cycling behavior of Heroku
Dyno cycling behavior of Heroku
 
Dockerising Appium : London Appium Meetup
Dockerising Appium : London Appium MeetupDockerising Appium : London Appium Meetup
Dockerising Appium : London Appium Meetup
 
J hipster
J hipsterJ hipster
J hipster
 
Angular & rails
Angular & railsAngular & rails
Angular & rails
 
Swagger code motion talk
Swagger code motion talkSwagger code motion talk
Swagger code motion talk
 
Lifthub (#rpscala 26)
Lifthub (#rpscala 26)Lifthub (#rpscala 26)
Lifthub (#rpscala 26)
 
AngularJS
AngularJSAngularJS
AngularJS
 
Gitlab flow solo
Gitlab flow soloGitlab flow solo
Gitlab flow solo
 
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
GR8Conf 2015 - Spring Boot and Groovy. What more do you need?
 
Presentacion minitest
Presentacion minitestPresentacion minitest
Presentacion minitest
 
What grunt?
What grunt?What grunt?
What grunt?
 
MVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js frameworkMVC way to introduce Sails.js - node.js framework
MVC way to introduce Sails.js - node.js framework
 
What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017What's New in JHipsterLand - Devoxx Poland 2017
What's New in JHipsterLand - Devoxx Poland 2017
 
Use groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projectsUse groovy & grails in your spring boot projects
Use groovy & grails in your spring boot projects
 
C初心者がbyebugにPR出した話
C初心者がbyebugにPR出した話C初心者がbyebugにPR出した話
C初心者がbyebugにPR出した話
 
APIテストあれこれ
APIテストあれこれAPIテストあれこれ
APIテストあれこれ
 
Node.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deploymentNode.js x Azure, cli usage, website deployment
Node.js x Azure, cli usage, website deployment
 
WebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみたWebSocketでカメラの映像を共有してみた
WebSocketでカメラの映像を共有してみた
 

Similar to Getting to Know Grunt by Writing Your Own Plugin

Scripting Support in GFv3 Prelude - Full Version
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*なクラウド 雲のかなたに ショートバージョン
G*なクラウド 雲のかなたに ショートバージョンTsuyoshi Yamamoto
 
Grunt & Front-end Workflow
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!
Let Grunt do the work, focus on the fun!Dirk Ginader
 
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]Dirk Ginader
 
Workshop 3: JavaScript build tools
Workshop 3: JavaScript build toolsWorkshop 3: JavaScript build tools
Workshop 3: JavaScript build toolsVisual Engineering
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And MavenPerconaPerformance
 
Testing Drupal with Ghosts and Gherkin
Testing Drupal  with Ghosts and GherkinTesting Drupal  with Ghosts and Gherkin
Testing Drupal with Ghosts and GherkinPhase2
 
Grunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerGrunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerMohammed Arif
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new buildIgor Khotin
 
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』Ryo RKTM
 
Bundling Client Side Assets
Bundling Client Side AssetsBundling Client Side Assets
Bundling Client Side AssetsTimothy Oxley
 
2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und buildDaniel Fisher
 
Automating Front-End Workflow
Automating Front-End WorkflowAutomating Front-End Workflow
Automating Front-End WorkflowDimitris Tsironis
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 

Similar to Getting to Know Grunt by Writing Your Own Plugin (20)

Groovy Maven Builds
Groovy Maven BuildsGroovy Maven Builds
Groovy Maven Builds
 
Scripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full VersionScripting Support in GFv3 Prelude - Full Version
Scripting Support in GFv3 Prelude - Full Version
 
G*なクラウド 雲のかなたに ショートバージョン
G*なクラウド 雲のかなたに ショートバージョンG*なクラウド 雲のかなたに ショートバージョン
G*なクラウド 雲のかなたに ショートバージョン
 
Grunt
GruntGrunt
Grunt
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end Workflow
 
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!
Let Grunt do the work, focus on the fun!
 
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
Let Grunt do the work, focus on the fun! [Open Web Camp 2013]
 
Npm scripts
Npm scriptsNpm scripts
Npm scripts
 
Workshop 3: JavaScript build tools
Workshop 3: JavaScript build toolsWorkshop 3: JavaScript build tools
Workshop 3: JavaScript build tools
 
Automated Performance Testing With J Meter And Maven
Automated  Performance  Testing With  J Meter And  MavenAutomated  Performance  Testing With  J Meter And  Maven
Automated Performance Testing With J Meter And Maven
 
Testing Drupal with Ghosts and Gherkin
Testing Drupal  with Ghosts and GherkinTesting Drupal  with Ghosts and Gherkin
Testing Drupal with Ghosts and Gherkin
 
Grunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerGrunt - The JavaScript Task Runner
Grunt - The JavaScript Task Runner
 
Gradle - time for a new build
Gradle - time for a new buildGradle - time for a new build
Gradle - time for a new build
 
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
20091226 名古屋SGGAE/J勉強会発表資料『Lift on GAE/J』
 
Bundling Client Side Assets
Bundling Client Side AssetsBundling Client Side Assets
Bundling Client Side Assets
 
Yeoman Workflow
Yeoman WorkflowYeoman Workflow
Yeoman Workflow
 
2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build
 
GlassFish Embedded API
GlassFish Embedded APIGlassFish Embedded API
GlassFish Embedded API
 
Automating Front-End Workflow
Automating Front-End WorkflowAutomating Front-End Workflow
Automating Front-End Workflow
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 

Recently uploaded

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Recently uploaded (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

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