UNPKG

generator-pr

Version:
161 lines (126 loc) 6.15 kB
# generator-pr [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] > Tool for Planning and Retrospect I know it's common and might be even easier to use Excel to do this type of tracking. But as a programmer, I always want to store the data in plain text which is readable by any text editor and programmable later. In the next phase, I might write a web page, Eletron app to do the display, editing and reporting. Or you can help on that for me. ## Installation First, install [Yeoman](http://yeoman.io) and generator-pr using [npm](https://www.npmjs.com/) (we assume you have pre-installed [node.js](https://nodejs.org/)). ```bash npm install -g yo npm install -g generator-pr ``` ## Usage This generator helps your generate data files for your monthly, weekly and daily planning and retrospect, and so there are three commands for them separately. The data files are stored under the directory structure of `{YEAR}/{MONTH}`. ### Generate Monthly Plan At the beginning, we should come up a monthly plan. Sample data file is named `Month.js` under the aforementioned directory. Its content is like this: ```javascript module.exports = { month: 1, // Numeric value of the month items: [ { type: '', // Work/Grow/Family/Social/Retrospect/Health/Recreation name: '', // Name of the item you need to do desc: '', // More specific description whyDoingGood: '', // For retrospect: What is the area that I am doing good whyNoGoodEnough: '', // For retrospect: What is the area that I am not doing good enough followup: '', // For retrospect: The followup action I should take to do it better contributeToGoal: '', // The larger part of this item. What goal it fulfill? contributeToValue: '', // The even larger part of goal. What value it brings to me? weeklyProgressPlan: [ // You can optionally put four elements here which is used for weekly plan generation // Each element stands for that week's plan of the goal ] } ], goals: [], // It should capture all the goals you plan to achieve in this month. values: [] // The value you want to pursue and keep asking yourself } ``` The command to generate above data file is as below ```bash yo pr:month --month 10 --items "Work;Grow:Reading,Writing,Coding" ``` * Option `month`: Optional. If you omit it, it create monthly plan for next month. * Option `items`: Optional. The option allows you to provide the item type `Work;Grow` separated by `;` and the goals under each type `:Reading,Writing,Coding` followed by the `:` and separated by `,`. _Notes: If you provide the `items` option, it will ask you: "Do you want to save the provided items for default monthly items?" Once you say yes, this value will be kept using for following months so that you don't need to input again._ Once we have our monthly plan ready, we can go right in, do the planning, especially the `weeklyProgressPlan`. This field can help us later when generating the weekly plan. ### Generate Weekly Plan The sample command to generate weekly plan data file is as below: ```bash yo pr:week W1 --month 10 ``` * Parameter `W1`: Mandatory. Valid value to provide is W1, W2, W3 or W4 which stands for the week in the month. * Option `month`: Optional. If it's not specified, it's assumed planning for week of this month. The data file generated is named using the parameter you provide, for example `W1.js` and also under the aforementioned directory. File content is like this if you have generated your monthly plan. ```javascript module.exports = { "week": "W1", "items": [ { "type": "Work", "name": "", "desc": "", "whyDoingGood": "", "whyNoGoodEnough": "", "followup": "", "contributeToGoal": "", "contributeToValue": "", "weeklyProgressPlan": "", "isProgressMet": false }, { "type": "Grow", "name": "", "desc": "", "whyDoingGood": "", "whyNoGoodEnough": "", "followup": "", "contributeToGoal": "Reading", "contributeToValue": "", "weeklyProgressPlan": "Page 20 - 30", "isProgressMet": false } ] } ``` ### Generate Daily Plan The command to generate daily data file is as below. The data file is named with the day number, for example `20.js` and also under the aforementioned directory. ```bash yo pr:day --day 20 --style next ``` * Option `day`: Optional. If you don't provide this option, it will ask you: "What is your normal planning style, today or next day?" You can input "today" or "next" and it remembers for next time generation. * Option `style`: Optional. The valid value is "today" or "next". This is normally used when you want to override the value stored previously. Sample data file: ```javascript module.exports = { date: 17, items: [ { type: '', name: '', desc: '', plannedDuration: 0, actualDuration: 0, whyDoingGood: '', whyNoGoodEnough: '', followup: '', contributeToGoal: '', contributeToValue: '', status: '' // I-Important,E-Eliminate } ] } ``` You can put any value in `status` field for you to classify the item. For me, I simply use `I` which stands for `Important` and `E` which stands for `Eliminate`. ## Getting To Know Yeoman * Yeoman has a heart of gold. * Yeoman is a person with feelings and opinions, but is very easy to work with. * Yeoman can be too opinionated at times but is easily convinced not to be. * Feel free to [learn more about Yeoman](http://yeoman.io/). ## License MIT © [Ken Chen](http://www.thinkingincrowd.me) [npm-image]: https://badge.fury.io/js/generator-pr.svg [npm-url]: https://npmjs.org/package/generator-pr [travis-image]: https://travis-ci.org/kenspirit/generator-pr.svg?branch=master [travis-url]: https://travis-ci.org/kenspirit/generator-pr [daviddm-image]: https://david-dm.org/kenspirit/generator-pr.svg?theme=shields.io [daviddm-url]: https://david-dm.org/kenspirit/generator-pr