Presentation is loading. Please wait.

Presentation is loading. Please wait.

Getting to Know Grunt By Writing Your Own

Similar presentations


Presentation on theme: "Getting to Know Grunt By Writing Your Own"— Presentation transcript:

1 Getting to Know Grunt By Writing Your Own Plugin @jamiestrachan

2

3

4

5 1. Scaffold 2a. Develop 2b. Test 3. Publish

6 Scaffold DevelopTestPublish

7 ScaffoldDevelopTestPublish

8 Running grunt-init

9 ? ScaffoldDevelopTestPublish

10 “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/ ScaffoldDevelopTestPublish

11 ScaffoldDevelopTestPublish

12 ScaffoldDevelopTestPublish

13 README.md Scaffolded plugin

14 ScaffoldDevelopTestPublish

15 package.json Scaffolded plugin

16 Develop ScaffoldDevelopTestPublish

17 Gruntfile.js grunt-sass-version

18 tasks/sass_version.js grunt-sass-version

19 Gruntfile.js grunt-sass-version tasks/sass_version.js

20 tasks/.js Scaffolded plugin

21 Look for Examples scaffolded plugin concat uglify sass jshint ScaffoldDevelopTestPublish

22 tasks/lib/_sass_version.js grunt-sass-version

23 tasks/lib/_sass_version.js grunt-sass-version

24 package.json grunt-sass-version

25 Test ScaffoldDevelopTestPublish

26 ScaffoldDevelopTestPublish

27 Code Quality ScaffoldDevelopTestPublish

28 Unit Testing ScaffoldDevelopTestPublish

29 Gruntfile.js Scaffolded plugin

30 test/ _test.js Scaffolded plugin

31 ScaffoldDevelopTestPublish nodeunit tests sass_version.js lib/_sass_version.js Grunt inputGrunt output success, message

32 test/sass_version_test.js grunt-sass-version

33 Integration Testing ScaffoldDevelopTestPublish

34 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" } ScaffoldDevelopTestPublish

35 npm link

36 Publish ScaffoldDevelopTestPublish

37 npm publish ScaffoldDevelopTestPublish 1.register at npmjs.com 2. npm adduser 7.( npm unpublish )

38 So what?

39 Scaffolding solid tools available: grunt-init, Yeoman saves time avoids mistakes makes dull work easier you can find existing templates or make your own

40 Testing develop with testing in mind use an automated testing tool like nodeunit

41 Managing Dependencies npm link for local dependencies git repos for unregistered dependencies create distributed projects with npm

42 Contributing process is similar for: gulp plugins grunt-init templates Yeoman generators hubot scripts

43 Learn your tools

44 Thanks! Getting to Know Grunt By Writing Your Own Plugin @jamiestrachan


Download ppt "Getting to Know Grunt By Writing Your Own"

Similar presentations


Ads by Google