From a35775e33f46a6f3424caa5713f789a03cbbede4 Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 13:04:17 -0700 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=93=A6=20Bump=20Version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/index.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dc4c0d7..1fe5c41 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "create-mern-application", - "version": "0.1.0", + "version": "0.2.0", "description": "A bootstrapper for creating a MERN application.", "bin": { "create-mern-application": "./index.js" diff --git a/src/index.ts b/src/index.ts index 1adc722..e8ad7e0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,7 +11,7 @@ const pkg = require("../package.json"); Sentry.init({ dsn: "https://44111e696abc456c959aef6dfc97f6a7@o202486.ingest.sentry.io/5262339", - release: "0.1.0", + release: "0.2.0", }); import { @@ -42,7 +42,7 @@ const main = async (): Promise => { * The program that parses the initial user input */ const program = new commander.Command("create-mern-application") - .version("0.1.0") + .version("0.2.0") .arguments("") .usage(`${chalk.blueBright("")} [options]`) .action((name) => { From d8643ed3568354f286333b01731c6dae00509e10 Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 13:04:54 -0700 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=93=9D=20Add=20v0.2.0=20to=20CHANGELO?= =?UTF-8?q?G?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 263d665..191db3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.2.0] - _Unreleased_ + +### Added + +### Changed + +### Removed + +### Fixed + ## [0.1.0] - 2020-06-03 ### 🚀 First Happy Path Solution From 5922a36a30e3c9eecd2a9afb2a8722fc81589d1b Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 13:19:12 -0700 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=93=9D=20Add=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ README.md | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 191db3f..8abbc16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- README + ### Changed ### Removed diff --git a/README.md b/README.md index c020bf7..6f8e582 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,88 @@ -# create-mern-application -A bootstrapper for creating a MERN application. +

+ + Logo +

+ +

create-mern-application

+ +
+ +[![NPM](https://img.shields.io/npm/v/create-mern-application.svg)](https://www.npmjs.com/package/create-mern-application) +[![GitHub Issues](https://img.shields.io/github/issues/alexlee-dev/create-mern-application)](https://github.com/alexlee-dev/create-mern-application/issues) +[![Dependencies](https://img.shields.io/david/alexlee-dev/create-mern-application)](https://github.com/alexlee-dev/create-mern-application) +[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE) + +
+ +--- + +

A bootstrapper for creating a MERN application. +
+

+ +## 📝 Table of Contents + +- [About](#about) +- [Getting Started](#getting_started) +- [Usage](#usage) +- [Built Using](#built_using) +- [Authors](#authors) +- [Acknowledgments](#acknowledgement) + +## 🧐 About + +I've made a lot of MERN applications lately, and I want to make that process easier for myself and for others, by creating a bootstrapper that mirrors the simplicity of starting a new application with [create-react-app](https://github.com/facebook/create-react-app). Thus, **create-mern-application** was born. + +### What is MERN? + +- **M**ongoDB - [MongoDB](https://www.mongodb.com/) - Database +- **E**xpressJS - [ExpressJS](https://expressjs.com/) - BackEnd +- **R**eact - [React](https://reactjs.org/) - FrontEnd +- **N**ode - [Node](https://nodejs.org/) - Runtime Environment + +## 🏁 Getting Started + +### Prerequisites + +- Node (>= v10.0.0) +- NPM + +### OS + +- [x] MacOS +- [x] Linux +- [x] Windows + +### Installing + +`npm install -g create-mern-application` + +## 🎈 Usage + +`create-mern-application cool-app-name` + +### Changing the Source Language + +By deafault, **create-mern-application** will create your application as a JavaScript project. You can pass the `--typescript` flag to create a TypeScript project instead. + +`create-mern-application cool-app-name --typescript` + +Want support for an additional language? Feel free to open a [new issue](https://github.com/alexlee-dev/create-mern-application/issues/new). + +### Interactive Mode + +You can choose to use the application in an interactive mode by passing the flag `--interactive`. + +This mode grants you several additinoal options. + +## ⛏️ Built Using + +## ✍️ Authors + +- [Alex Lee](https://github.com/alexlee-dev) - Application Developer + +## 🚀 Additional Features to Be Added + +## 🎉 Acknowledgements + +- Some inspiration from the developers behind [create-react-app](https://github.com/facebook/create-react-app). From c8136273bfc1e4d6312751600e5379b3182e1c61 Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 13:20:00 -0700 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=93=9D=20Add=20CONTRIBUTING?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + CONTRIBUTING.md | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 8abbc16..b64bfe9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - README +- CONTRIBUTING ### Changed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..1248a83 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,36 @@ +# Contributing Guide + +- Contributing to **create-mern-application** is fairly easy. This document shows you how to get started. + +## Submitting changes + +- Fork the repo + - +- Check out a new branch based and name it to what you intend to do: + - Example: + ``` + $ git checkout -b BRANCH_NAME + ``` + If you get an error, you may need to fetch first by using + ``` + $ git remote update && git fetch + ``` + - Use one branch per fix / feature +- Commit your changes + - Please provide a git message that explains what you've done + - Please make sure your commits follow the [conventions](https://gist.github.com/robertpainsi/b632364184e70900af4ab688decf6f53#file-commit-message-guidelines-md) + - Commit to the forked repository + - Example: + ``` + $ git commit -am 'Add some fooBar' + ``` +- Push to the branch + - Example: + ``` + $ git push origin BRANCH_NAME + ``` +- Make a pull request + - Make sure you send the PR to the fooBar branch + - Travis CI is watching you! + +If you follow these instructions, your PR will land pretty safely in the main repo! From 27ef32dcd19649993908ae4198a5434ca39e8bd4 Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 14:52:36 -0700 Subject: [PATCH 5/7] =?UTF-8?q?=E2=9C=A8=20Add=20to=20App=20Component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ src/init.ts | 7 +++++++ src/template/js/src/client/App.js | 16 ++++++++++++++-- src/template/js/src/client/index.css | 17 +++++++++++++++++ src/template/js/src/client/logo.svg | 1 + src/template/ts/index.d.ts | 1 + src/template/ts/src/client/App.tsx | 16 ++++++++++++++-- src/template/ts/src/client/index.css | 17 +++++++++++++++++ src/template/ts/src/client/logo.svg | 1 + 9 files changed, 74 insertions(+), 4 deletions(-) create mode 100644 src/template/js/src/client/logo.svg create mode 100644 src/template/ts/index.d.ts create mode 100644 src/template/ts/src/client/logo.svg diff --git a/CHANGELOG.md b/CHANGELOG.md index b64bfe9..5f0987b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Content on `` + ### Removed ### Fixed diff --git a/src/init.ts b/src/init.ts index 30864eb..5a89362 100644 --- a/src/init.ts +++ b/src/init.ts @@ -222,6 +222,13 @@ export const copyTemplateFiles = async ( }, ]; + if (language === "ts") { + requiredFilesToCopy.push({ + src: path.join(__dirname, `template/ts/index.d.ts`), + dest: path.join(root, "/index.d.ts"), + }); + } + // * Copy Template Files await Promise.all( requiredFilesToCopy.map( diff --git a/src/template/js/src/client/App.js b/src/template/js/src/client/App.js index 8f46454..2f9a567 100644 --- a/src/template/js/src/client/App.js +++ b/src/template/js/src/client/App.js @@ -1,9 +1,21 @@ import * as React from "react"; +import logo from "./logo.svg"; const App = () => { return ( -
-

APP

+
+ +

create-mern-application

+

+ Edit src/client/App.tsx and save to reload. +

+ + View Documentation +
); }; diff --git a/src/template/js/src/client/index.css b/src/template/js/src/client/index.css index e69de29..b11dccd 100644 --- a/src/template/js/src/client/index.css +++ b/src/template/js/src/client/index.css @@ -0,0 +1,17 @@ +body { + font-family: "Roboto", "Helvetica Neue", sans-serif; + margin: 0; +} + +#app { + align-items: center; + color: #0e0e0e; + display: flex; + flex-direction: column; + justify-content: center; + min-height: 100vh; +} + +#logo { + height: 300px; +} diff --git a/src/template/js/src/client/logo.svg b/src/template/js/src/client/logo.svg new file mode 100644 index 0000000..212d9ee --- /dev/null +++ b/src/template/js/src/client/logo.svg @@ -0,0 +1 @@ +deliveries \ No newline at end of file diff --git a/src/template/ts/index.d.ts b/src/template/ts/index.d.ts new file mode 100644 index 0000000..bff9471 --- /dev/null +++ b/src/template/ts/index.d.ts @@ -0,0 +1 @@ +declare module '*.svg'; diff --git a/src/template/ts/src/client/App.tsx b/src/template/ts/src/client/App.tsx index 52fa1f4..b7aca90 100644 --- a/src/template/ts/src/client/App.tsx +++ b/src/template/ts/src/client/App.tsx @@ -1,9 +1,21 @@ import * as React from "react"; +import logo from "./logo.svg"; const App: React.SFC<{}> = () => { return ( -
-

APP

+
+ +

create-mern-application

+

+ Edit src/client/App.tsx and save to reload. +

+ + View Documentation +
); }; diff --git a/src/template/ts/src/client/index.css b/src/template/ts/src/client/index.css index e69de29..b11dccd 100644 --- a/src/template/ts/src/client/index.css +++ b/src/template/ts/src/client/index.css @@ -0,0 +1,17 @@ +body { + font-family: "Roboto", "Helvetica Neue", sans-serif; + margin: 0; +} + +#app { + align-items: center; + color: #0e0e0e; + display: flex; + flex-direction: column; + justify-content: center; + min-height: 100vh; +} + +#logo { + height: 300px; +} diff --git a/src/template/ts/src/client/logo.svg b/src/template/ts/src/client/logo.svg new file mode 100644 index 0000000..212d9ee --- /dev/null +++ b/src/template/ts/src/client/logo.svg @@ -0,0 +1 @@ +deliveries \ No newline at end of file From bad0e6e6e6960528423dc17a14c0797095fa87f2 Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 14:53:16 -0700 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=93=9D=20Update=20CHANGELOG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f0987b..ecc1fa5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.2.0] - _Unreleased_ +## [0.2.0] - 2020-06-03 ### Added From b78376216e8a1e4c6d45feafc6c5fa0c7cf3e779 Mon Sep 17 00:00:00 2001 From: alexlee-dev Date: Wed, 3 Jun 2020 14:53:44 -0700 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=93=9D=20Update=20CHANGELOG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecc1fa5..1fa4c84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [0.2.0] - 2020-06-03 +### ✨ App Content + ### Added - README