dev-init

0.0.15 • Public • Published

dev-init

Build Test Coverage Downloads Version Dependency Status Kiril approved

This project will get you started and automate a whole bunch of little things you need to do to every new project in order to work sanely with a team or accept contributions from other members of the open-source community. Since there are so many little steps, they take time and you always end up forgetting something and needing to make a bunch of tweaks later on. You should skip all of that, and just use this module to get up and running quickly.

Sweet, how do I install it?

I appreciate your enthusiasm.

npm install -g dev-init

How do I use it?

Easy:

mkdir my-cool-lib
cd my-cool-lib
dev-init

So what happens?

git init

The regular git init command is run for the module, to create all the necessary git bits.

.gitignore

A default .gitignore file is used, suitable for NodeJS module and application development on macOS, Windows, and Linux. If you already have one of these files (perhaps you want to run this module on an existing repo), the values from this list will be merged into your existing file.

.gitattributes

A default .gitattributes file is used, to standardize file checkouts across macOS, Windows, and Linux. This will ensure things like linting will never be broken on operating systems that you might not be using, but other members on your team are. If this file already exists, this will be skipped by default.

.brackets.json

Kiril approves of Brackets. So a configuration file is created to correctly set up Brackets. If you already have this file, the settings will be merged into your existing file.

There is an option here to select your preferred linter:

dev-init --linter ESLint

You can define as many linters as you would like to use:

dev-init --linter ESLint --linter JSHint --linter JSCS

You can also configure the number of spaces to use for indentation, although I strongly encourage you to stick to 4.

dev-init --spaces 2

.editorconfig

Kiril also approves of other IDEs. An .editorconfig file will be created to configure a whole plethora of other IDEs. If your favorite IDE does not support it natively, there is probably a plugin for it. If you already have this file, the settings will be merged into your existing file.

Like with .brackets.json, spaces are configurable.

dev-init --spaces 2

README.md

An empty readme file will be created, to get you started and remind you that writing a readme is important. If a README already exists, this will be skipped by default.

Whoa, merging files! Is that safe?

I'd like to think it is. I did a great job writing it. And, just so you know, if there is a merge error, your existing files will be safe. However, if you don't trust me, there is a flag for that.

dev-init --safe

With this flag, existing files will be left untouched.

You mentioned something about some files being skipped?

Yeah. Not all files can be merged at this time. For those, I will respect your existing settings and leave them alone (until I can figure out a good way to merge them, anyway).

If you do want to use the files from this module, however, there is a flag for that too:

dev-init --force

This flag will replace all of the skipped files with the ones generated by this module. Files that are usually merged will still be merged.

What if I want to run only some of the tasks?

Well, this is your lucky day, because you have options:

  • dev-init --include list of tasks

    You can use the --include flag, followed by a space-separated list of task names, as a whitelist for which tasks to run.

  • dev-init --exclude list of tasks

    You can use the --exclude flag, followed by a space-separated list of task names, as a blacklist for tasks to skip.

You can also combine these, but they apply on top of one another (i.e. the exclude list will exclude tasks that were explicitly included in the include list).

  • dev-init select

    You can use the select command to enter an interactrive menu, where you can visually select the tasks to run.

But what are the task names?

That's easy too:

dev-init list

And if that is too much typing:

dev-init ls

I don't like your settings.

That's not really a question, but it is also okay. Not everyone has to make the correct choices. You can still use this project though, to configure and enforce the settings you do prefer. Feel free to clone it and make all the changes you would like to the files in the fixtures folder.

You can set it up in your dev environment as such:

git clone git@github.com:catdad/dev-init.git
cd dev-init
npm install
npm link

Now you can make changes and use the dev-init cli command with your local version.

License

ISC

Readme

Keywords

none

Package Sidebar

Install

npm i dev-init

Weekly Downloads

2

Version

0.0.15

License

ISC

Unpacked Size

42.2 kB

Total Files

32

Last publish

Collaborators

  • kirilv