Skip to content

Commit

Permalink
Merge pull request #23 from nmicht/develop
Browse files Browse the repository at this point in the history
v1.0.0
  • Loading branch information
nmicht authored Feb 1, 2019
2 parents a290cab + 23eb505 commit 221238e
Show file tree
Hide file tree
Showing 47 changed files with 1,034 additions and 428 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/*
.env
.idea
create-nodejs-settings.json
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "10"
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 1.0.0
* Settings is a global object handle from an accessible json file.
* Includes some unit tests
* Added CI with travis

## 0.2.0
* Generate license file

Expand Down
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<img width="75px" height="75px" align="right" alt="Create NodeJS Project Logo" src="https://raw.githubusercontent.com/nmicht/create-nodejs-project/master/assets/create-nodejs-project.png" title="Create NodeJS Project"/>

# Node Project Initializer
# Node.js Project Initializer

[![License][license-image]][license-url] [![version][npm-image]][npm-url]
[![License][license-image]][license-url] [![version][npm-image]][npm-url] [![coverage][coverage-image]][coverage-url] [![downloads][downloads-image]][downloads-url]

An [npm initializer][npm/init] to scaffold a node project and include basic tools like lint, testing, etc.

Expand All @@ -13,7 +13,7 @@ An [npm initializer][npm/init] to scaffold a node project and include basic tool
## Requirements

- `npm >= 6.5`
- `node >= 10.1.0`
- `node >= 10.12.0`

## Usage

Expand All @@ -22,7 +22,11 @@ An [npm initializer][npm/init] to scaffold a node project and include basic tool
npm install -g create-nodejs-project
```

2. You will be prompted for your Github information
2. Run the setup configuration
```
npm setup
```
You will be prompted for your Github information
If you do not have the information at the moment, you can keep it empty.
In order to create projects with Github integration, you will need to add the authentication information later. See [Github Auth](#configure-Github-authentication)

Expand All @@ -34,11 +38,10 @@ npm init nodejs-project path/to/new/project
## What it does

1. Create the folder for the new project
1. Guide you through a questionnarie to setup the project
1. Guide you through a questionnaire to setup the project
2. Initialize a git repository
3. Copy the template files (src, eslintrc, gitignore, readme, etc)
4. Can create a Github repository
5. Handle the Github tokens for multiple accounts/users
4. Create a Github repository
5. Install eslint dependencies
5. Install the selected testing dependencies
6. Generate package.json with all the project details
Expand All @@ -47,22 +50,22 @@ npm init nodejs-project path/to/new/project

## About this package

The motivation started as a **DRY** thing.
Every time that I start a new project in Node.js, I hate to go to other project folder, copy files like eslintrc, editorconfig; install the same dependencies, create folder structure, etc.

I'm not expert with NodeJS, but every time that I start a new project, I hate to go to other project, copy files like eslintrc, editorconfig, install the same dependencies, create folder structure, etc.
With this in mind, the motivation to build this package started as a **DRY** (Do not repeat yourself) thing.

So, the idea is to have an automated way to initialize new NodeJS projects and with this have a new folder with everything ready to work in what really matters.
This package is intended to automated the initialization of new Node.js projects and with this have a new folder with everything ready to work, basically an scaffolding tool.


## Future features

1. Unit testing
7. Options to create the project with params instead of questionnaire
7. Options to create the project with parameters instead of questionnaire
10. A good error handler
11. Color for the console messages
12. Improve the template structure (the one that is generated in the new project) to include unit test
18. Option to questionnaire with all the default values
2. Logic to handle multiple auth files and multiple github accounts
2. Logic to handle multiple authentication files and multiple Github accounts

## Configure Github Authentication

Expand All @@ -84,20 +87,16 @@ If you are planning to allow this script to create your Github repositories, is
5. Open Terminal and add the Github token.

```
# nano ~/create-nodejs-project.json
{
"github": [
{
"user": "YOUR_USER",
"token": "YOUR_TOKEN"
},
{
"user": "OTHER_USER",
"token": "OTHER_TOKEN"
}
]
}
# nano /YOUR-NODE_MODULES-PATH/create-nodejs-project/create-nodejs-settings.json
...
...
"githubAuth": {
"user": "YOUR_USER",
"token": "YOUR_TOKEN"
}
...
...
```


Expand All @@ -109,3 +108,9 @@ If you are planning to allow this script to create your Github repositories, is
[npm-image]: https://img.shields.io/npm/v/create-nodejs-project.svg?style=for-the-badge&logo=npm

[npm/init]: https://docs.npmjs.com/cli/init#description

[downloads-url]: https://www.npmjs.com/package/create-nodejs-project
[downloads-image]: https://img.shields.io/npm/dt/create-nodejs-project.svg?style=for-the-badge

[coverage-url]: https://coveralls.io/github/nmicht/create-nodejs-project?branch=master
[coverage-image]: https://img.shields.io/coveralls/github/nmicht/create-nodejs-project.svg?style=for-the-badge
12 changes: 0 additions & 12 deletions create-nodejs-project-example.json

This file was deleted.

40 changes: 40 additions & 0 deletions create-nodejs-settings-example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"licenses": [
"GNU AGPLv3",
"GNU GPLv3",
"GNU LGPLv3",
"Mozilla Public License 2.0",
"Apache License 2.0",
"MIT License",
"ISC License"
],
"githubAuth": {
"user": "YOUR_USER",
"token": "YOUR_TOKEN"
},
"lintPkgs": [
"eslint",
"eslint-plugin-node",
"eslint-config-airbnb",
"eslint-plugin-import",
"eslint-plugin-jsx-a11y",
"eslint-plugin-react"
],
"testingPkgs": [
"jest",
"mocha",
"chai",
"sinon",
"nock"
],
"defaults": {
"license": "GNU GPLv3",
"version": "0.1.0"
},
"templates": [
"nodejs-project",
],
"settingsPath": "/YOUR_PATH/create-nodejs-project/create-nodejs-settings.json",
"templatesPath": "/YOUR_PATH/create-nodejs-project/templates",
"licensesPath": "/YOUR_PATH/create-nodejs-project/templates/licenses"
}
34 changes: 0 additions & 34 deletions install/index.js

This file was deleted.

Loading

0 comments on commit 221238e

Please sign in to comment.