├── .github
├── ISSUE_TEMPLATE
│ └── feature_request.md
└── pull_request_template.md
├── .gitignore
├── Contribute.md
├── LICENSE
├── README.md
├── bin
└── generate-app.js
├── package-lock.json
├── package.json
└── utils
├── index.js
└── logger.js
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ## Description
11 | > Write your description
12 |
13 | ## Progress
14 | - [ ] todo1
15 | - [ ] todo2
16 | - [ ] todo3
17 |
18 | ## Reference
19 | - not required
20 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | ## Description
2 | > Brief description of the changes and additional descriptions
3 |
4 | ## Issue Number
5 | Write resolved issue number
6 |
7 | ## Modification History
8 | - [ ] modifications 1
9 | - [ ] modifications 2
10 | - [ ] modifications 3
11 |
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | .DS_Store
3 |
--------------------------------------------------------------------------------
/Contribute.md:
--------------------------------------------------------------------------------
1 | 
2 | 
3 |
4 |
5 | # dev-portfolio-cli-command Contributing Guide
6 |
7 | This document is intended for contributors and is draw to help them contribute.
8 | This document contains information about issue generation, fork and code modification, and create pull request.
9 |
10 | Thank you for contributing to our project! 👏
11 |
12 |
13 | ## How to contribute our project
14 | Now, let me explain how to contribute to our project.
15 | ## Issues
16 | If you find a problem when the using project, please create an issue.
17 |
18 | ### create New issue
19 | First, check the open and closed issues. Another contributor may be correcting the problem you found, or you may have already completed the correction.
20 |
21 | If you have a new issue, click New Issue and write script using the issue template created.
22 | 
23 |
24 |
25 | ### solved the issue
26 | After you resolve the issue, close the issue you created.
27 |
28 |
29 | ## Fork the Repository
30 | Click the Fork button in the upper right corner of the dev-portfolio-cli-command repository. A replica of our repository will be created in your github account.
31 | 
32 |
33 |
34 |
35 | ## Clone the Repository
36 | Clone the forked repository in local. Click the code button and click the Copy to Clipboard icon next to url.
37 |
38 |
39 |
40 | ### caution
41 | - You need to get clone url from your fork repository.
42 |
43 |
44 | ### Open the terminal and run this command
45 | ```
46 | git clone
47 | ```
48 | When executing this command, our repository will be replicated locally. Now solve the issue there.
49 |
50 |
51 |
52 | ## Contribution reflected
53 | ### Commit your update
54 | If you have resolving the issue, please commit your corrections.
55 |
56 | ### Create Pull Request
57 | When you're finished with the changes, create a pull request, also known as a PR.
58 | - Please create a pull request with the **develop** branch.
59 | - Create a pull request and select administrator as the reviewer.
60 | - Administrator List : [woorim960](https://github.com/woorim960), [seohyunsim](https://github.com/seohyunsim), [soonki-98](https://github.com/soonki-98), [jisu3817](https://github.com/jisu3817)
61 | - If you add it as a reviewer, the administrator will review your PR.
62 |
63 | 
64 |
65 |
66 |
67 | ## Congratulations! 🎉
68 | Your PR is merged.
69 |
70 | Thank you for contributing to the improvement of dev-portfolio-cli-command.
71 |
72 | Now you are a contributor to our project!
73 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 모던 애자일
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # dev-portfolio-cli-command
2 |
3 | [](https://badge.fury.io/js/create-dev-portfolio)
4 | [](http://commitizen.github.io/cz-cli/)
5 | 
6 |
7 | ---
8 |
9 | ## Getting Started
10 |
11 | dev-portfolio-cli-command is a comfortable environment for generate web portfolio.
12 |
13 | To create a project, run:
14 |
15 | ```bash
16 | $ npx create-dev-portfolio [YOUR APP NAME]
17 | ```
18 |
19 | If you don't type [YOUR APP NAME], 'dev-portfolio' is default.
20 |
21 | Running `npx create-dev-portfolio` will result in the following five processes.
22 |
23 | 1. Check if folder exist named same as [YOUR APP NAME]. ( _in the case folder named same as [YOUR APP NAME] exist , it'll be causes error_ )
24 | 2. Check if five necessary dependencies exist below. ( _if you don't have more than one dependency, we warn you_ )
25 | - **docker**
26 | - **docker-compose**
27 | - **node**
28 | - **npm**
29 | - **bash**
30 | 3. Cloning [create-dev-portfolio](https://github.com/modern-agile-team/create-dev-portfolio).
31 | 4. Installing dependencies for `create-dev-portfolio`.
32 | 5. Removing useless files like `.git`.
33 |
34 | After above five processes, run:
35 |
36 | ```bash
37 | $ cd [YOUR APP NAME]
38 | $ npm run start:all
39 | ```
40 |
41 | ---
42 |
43 | ## Refers
44 |
45 | ### Connected Projects
46 |
47 | [dev-portfolio](https://github.com/modern-agile-team/dev-portfolio)
48 | [create-dev-portfolio](https://github.com/modern-agile-team/create-dev-portfolio)
49 |
50 | ### License
51 |
52 | [MIT](https://github.com/modern-agile-team/dev-portfolio-cli-command/blob/master/LICENSE)
53 |
54 | ### Contributors
55 |
56 | - [soonki-98](https://github.com/soonki-98)
57 | - [woorim960](https://github.com/woorim960)
58 | - [seohyunsim](https://github.com/seohyunsim)
59 | - [jisu3817](https://github.com/jisu3817)
60 |
--------------------------------------------------------------------------------
/bin/generate-app.js:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env node
2 |
3 | import { execSync } from "child_process";
4 | import path from "path";
5 | import fs from "fs";
6 | import { logger } from "../utils/index.js";
7 |
8 | const projectName = process.argv[2] || "dev-portfolio";
9 | const currentPath = process.cwd();
10 | const projectPath = path.join(currentPath, projectName);
11 | const GIT_REPO = "https://github.com/modern-agile-team/create-dev-portfolio.git";
12 |
13 | if (projectName !== ".") {
14 | try {
15 | fs.mkdirSync(projectPath);
16 | } catch (err) {
17 | if (err.code === "EEXIST") {
18 | logger.error(`The file ${projectName} already exist in the current directory, please give it another name.`);
19 | } else {
20 | logger.error(err);
21 | }
22 | process.exit(1);
23 | }
24 | }
25 |
26 | const requiredDependencies = [];
27 |
28 | const checkIsDependencyExist = (system) => {
29 | try {
30 | execSync(`which ${system}`).toString();
31 | } catch (err) {
32 | requiredDependencies.push(system);
33 | }
34 | };
35 |
36 | async function main() {
37 | try {
38 | checkIsDependencyExist("docker");
39 | checkIsDependencyExist("docker-compose");
40 | checkIsDependencyExist("node");
41 | checkIsDependencyExist("npm");
42 | checkIsDependencyExist("bash");
43 |
44 | logger.tagging("info", "Cloning dev-portfolio...");
45 | execSync(`git clone --depth 1 ${GIT_REPO} ${projectPath}`); // 우리의 보일러 플레이트를 clone!
46 |
47 | if (projectName !== ".") {
48 | process.chdir(`${projectPath}`); // cd입니다 clone을 마친 후 projectPath로 진입
49 | }
50 |
51 | logger.tagging("info", "Installing dependencies...");
52 | execSync("npm run bootstrap"); // package.json에 있는 의존성 설치
53 |
54 | // 이제 보일러플레이트 git과 관련된 내용 제거
55 | logger.tagging("info", "Removing useless files...");
56 | execSync("npx rimraf ./.git");
57 | execSync("npx rimraf ./client/.github");
58 |
59 | if (requiredDependencies.length > 0) {
60 | logger.tagging("required", "Required dependencies below\n");
61 | for (const dependency of requiredDependencies) {
62 | logger.warn(`${dependency} is required\n`);
63 | }
64 | } else {
65 | logger.log("bgGreenBright", "The installation is done, this is ready to use!\n");
66 | logger.log("bgGreenBright", "Start dev-portfilio by typing the following command in your terminal!\n");
67 | logger.log("yellowBright", "$ cd dev-portfolio or cd YOUR_APP_NAME");
68 | logger.log("yellowBright", "$ npm run start:all\n");
69 | }
70 | } catch (error) {
71 | logger.error(error);
72 | }
73 | }
74 |
75 | main();
76 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "create-dev-portfolio",
3 | "version": "v2.2.1",
4 | "lockfileVersion": 2,
5 | "requires": true,
6 | "packages": {
7 | "": {
8 | "name": "create-dev-portfolio",
9 | "version": "v2.2.1",
10 | "license": "MIT",
11 | "dependencies": {
12 | "chalk": "^5.1.1"
13 | },
14 | "bin": {
15 | "create-dev-portfolio": "bin/generate-app.js"
16 | }
17 | },
18 | "node_modules/chalk": {
19 | "version": "5.1.2",
20 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz",
21 | "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ==",
22 | "engines": {
23 | "node": "^12.17.0 || ^14.13 || >=16.0.0"
24 | },
25 | "funding": {
26 | "url": "https://github.com/chalk/chalk?sponsor=1"
27 | }
28 | }
29 | },
30 | "dependencies": {
31 | "chalk": {
32 | "version": "5.1.2",
33 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.1.2.tgz",
34 | "integrity": "sha512-E5CkT4jWURs1Vy5qGJye+XwCkNj7Od3Af7CP6SujMetSMkLs8Do2RWJK5yx1wamHV/op8Rz+9rltjaTQWDnEFQ=="
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "create-dev-portfolio",
3 | "version": "v2.2.2",
4 | "description": "",
5 | "main": "index.js",
6 | "type": "module",
7 | "exports": {
8 | "./utils/*": "./utils/*.js"
9 | },
10 | "scripts": {
11 | "test": "echo \"Error: no test specified\" && exit 1"
12 | },
13 | "bin": {
14 | "create-dev-portfolio": "./bin/generate-app.js"
15 | },
16 | "keywords": [
17 | "portfolio",
18 | "dev-portfolio",
19 | "react"
20 | ],
21 | "author": "",
22 | "license": "MIT",
23 | "repository": {
24 | "type": "git",
25 | "url": "https://github.com/modern-agile-team/dev-portfolio-app.git"
26 | },
27 | "dependencies": {
28 | "chalk": "^5.1.1"
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/utils/index.js:
--------------------------------------------------------------------------------
1 | export { default as logger } from "./logger.js";
2 |
--------------------------------------------------------------------------------
/utils/logger.js:
--------------------------------------------------------------------------------
1 | import chalk from "chalk";
2 |
3 | const logger = {
4 | /**
5 | *
6 | * @param {*} color bgGreenBright | bgYellowBright | bgBlueBright | yellowBright
7 | * @param {*} message text
8 | */
9 | log(color, message) {
10 | console.log(chalk[color](message));
11 | },
12 | warn(message) {
13 | console.log(chalk.bold.yellow("[WARN] ") + message);
14 | },
15 | error(message) {
16 | console.error(chalk.bold.red("[ERROR] ") + chalk.redBright(message));
17 | },
18 | tagging(tag, message) {
19 | console.info(chalk.bold.gray(`[${tag.toUpperCase()}] `) + chalk.cyanBright(message));
20 | },
21 | };
22 |
23 | export default logger;
24 |
--------------------------------------------------------------------------------