update
Be scalable. Update is a new developer framework and CLI for automating updates of any kind in code projects.
TOC
- What does it do?
- Why update?
- Who should use Update?
- Getting started
- Init
- Features
- Discovering updaters
- Discovering plugins
- Authoring updaters
- More information
- Community
- Related projects
- Contributing
- Running tests
- Author
- License
(TOC generated by verb using markdown-toc)
Please read our contributing guide if you'd like to learn more about contributing to this project.
What does it do?
All updating is accomplished using plugins called updaters, which are run by command line or API, and can be installed globally, locally, or created in a local updatefile.js
.
You can create your own updaters using Update's API, or install updaters using npm, to do things like:
- enforce conventions across all of your projects
- instantly update an old or inherited project to your latest personal preferences (convert tabs to spaces, convert from
jshint
toeslint
or the other way around, or any other detail) - reformat code to meet your standards
- convert a config file to a different format (json to yaml, yaml to json, etc)
- update files that are typically excluded from build cycles, and are often forgotten about after they're created. For example:
- fix dates in copyrights, licenses and banners
- remove deprecated fields from project manifests
- update settings in runtime config files, preferences in dotfiles
- after initializing a new project with a project generator, like generate or Google's Yeoman, you can "normalize" all of the generated files to use your own preferences
Why update?
- be more productive: Update makes you more productive by eliminating time spent on things that can be automated, but typically aren't since they don't need to be done often, don't fit into the build cycle or a project's deliverables, or they're usually updated by hand. As code projects mature, time spent on these things tend to stay linear or increase as the size of a community grows. And this only compounds which each new project under your stewardship.
- your way, instantly: updaters can be published to and installed from npm, but you can also easily create your own personal updaters. Once you're updaters are setup, projects under your maintenance will convert to the the conventions you prefer in milliseconds.
- plugin ecosystem: any plugins that work with Base applications will work with Update. Which means you can use assemble, verb, and generate plugins, to name a few.
Who should use Update?
- anyone who cares about having consistency across all of their projects
- developers or organizations with many projects under their stewardship
- agencies or consultants who maintain and/or create client projects and would like to reduce time spent on maintainance
Getting started
The following instructions are intended to provide a basic demonstration of how Update works. Visit the links after this section for more information.
1. Install update
To use Update's CLI, update
must first be installed globally with npm:
$ npm install --global update
This adds the update
command to your system path, allowing it to be run from anywhere.
2. Install an "updater"
To see how updaters work, install updater-example
:
$ npm install --global updater-example
3. Create "example.txt"
In the current working directory, create an empty file named example.txt
.
4. Run
As a habit, when using update
make sure your work is committed, then run:
$ update example
This appends the string foo
to the contents of example.txt
. Visit the updater-example project for additional steps and guidance.
Next steps
- Browse the documentation
- Learn about updaters
- Learn about the built-in updaters
Init
Tell Update's CLI to automatically run certain updaters every time the update
command is given:
$ update init
You can run this command whenever you want to update your preferences, like after installing new updaters.
$ update help
Usage: update <command> [options]
Command: updater or tasks to run
Options:
--config, -c Save a configuration value to the `update` object in package.json
--cwd Set or display the current working directory
--data, -d Define data. API equivalent of `app.data()`
--disable Disable an option. API equivalent of "app.disable('foo')"
--enable Enable an option. API equivalent of "app.enable('foo')"
--global, -g Save a global configuration value to use as a default
--help, -h Display this help menu
--init, -i Prompts for configuration values and stores the answers
--option, -o Define options. API equivalent of `app.option()`
--run Force tasks to run regardless of command line flags used
--silent, -S Silence all tasks and updaters in the terminal
--show <key> Display the value of <key>
--version, -V Display the current version of update
--verbose, -v Display all verbose logging messages
Examples:
# run updater "foo"
$ update foo
# run task "bar" from updater "foo"
$ update foo:bar
# run multiple tasks from updater "foo"
$ update foo:bar,baz,qux
# run a sub-generator from updater "foo"
$ update foo.abc
# run task "xyz" from sub-generator "foo.abc"
$ update foo.abc:xyz
Update attempts to automatically determine if "foo" is a task or updater.
If there is a conflict, you can force update to run updater "foo"
by specifying its default task. Example: `$ update foo:default`
Features
- unparalleled flow control: through the use of updaters, sub-updaters and tasks
- templates, scaffolds and boilerplates: update a single file, initialize an entire project, or provide ad-hoc "components" throughout the duration of a project using any combination of templates, scaffolds and boilerplates.
- any engine: use any template engine to render templates, including handlebars, lodash, swig and pug
- prompts: asks you for data when it can't find what it needs, and it's easy to customize prompts for any data you want.
- data: gathers data from the user's environment to populate "hints" in user prompts and render templates
- streams: interact with the file system, with full support for gulp and assemble plugins
- smart plugins: Update is built on base, so any "smart" plugin can be used
- stores: persist configuration settings, global defaults, project-specific defaults, answers to prompts, and so on.
- much more!
Discovering updaters
- Find updaters to install by searching npm for packages with the keyword
updateupdater
- Visit Update's GitHub org to see the updaters maintained by the core team
Discovering plugins
Plugins from any applications built on base should work with Update (and can be used in your updater):
-
base: find base plugins on npm using the
baseplugin
keyword -
assemble: find assemble plugins on npm using the
assembleplugin
keyword -
generate: find generate plugins on npm using the
generateplugin
keyword -
templates: find templates plugins on npm using the
templatesplugin
keyword - [update][update-plugin]: find update plugins on npm using the
updateplugin
keyword -
verb: find verb plugins on npm using the
verbplugin
keyword
Authoring updaters
Visit the updater documentation guide to learn how to use, author and publish updaters.
More information
Community
Are you using Update in your project? Have you published an updater? Want to share your Update project with the world? Here are some suggestions:
- If you get like Update and want to tweet about it, please use the hashtag
#updatejs
- Get implementation help on StackOverflow (pluse use the
update
tag in questions) - Gitter Discuss Update with us on Gitter
- If you publish an updater, thank you! To make your project as discoverable as possible, please add the keyword
updateupdater
to package.json.
Related projects
You might also be interested in these projects:
- assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
- base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | homepage
- generate: The Santa Claus machine for GitHub projects. Scaffolds out new projects, or creates any kind… more | homepage
- verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Please read the contributing guide for avice on opening issues, pull requests, and coding standards.
Running tests
Install dev dependencies:
$ npm install -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on July 01, 2016.