From e745e5a8985ad4b1c434db1eb050d55404a8e370 Mon Sep 17 00:00:00 2001 From: Long Nguyen Date: Wed, 30 Aug 2023 08:47:44 +0700 Subject: [PATCH] [#20] Extract the project architecture from the Contributing guideline page --- .github/wiki/Architecture-overview.md | 51 ++++++++++++++++++ .github/wiki/Contributing-guidelines.md | 54 +------------------ .github/wiki/Home.md | 2 +- .github/wiki/_Sidebar.md | 9 +++- .../diagram-complete.svg} | 0 5 files changed, 61 insertions(+), 55 deletions(-) create mode 100644 .github/wiki/Architecture-overview.md rename .github/wiki/assets/images/{diagram_complete.svg => architecture/diagram-complete.svg} (100%) diff --git a/.github/wiki/Architecture-overview.md b/.github/wiki/Architecture-overview.md new file mode 100644 index 00000000..ec61acf8 --- /dev/null +++ b/.github/wiki/Architecture-overview.md @@ -0,0 +1,51 @@ +This project uses TypeScript and [OCLIF](https://oclif.io/) to build the CLI, Jest for testing, and ESLint for code formatting and linting. + +### Dependencies and Prerequisites + +- [Node.js](https://nodejs.org/en/download/) 12.x or higher - 18.x LTS is recommended +- NPM is preferred to use with this project + +### Project structure + +The project has the following main files and folders: + +```bash +├── bin # the executable file for the CLI +│ ├── dev # the executable file for the CLI in development mode +│ └── run # the executable file for the CLI in production mode +├── skeleton # the skeleton files for the project +│ ├── addons # the skeleton files for common addons e.g. version control, CI/CD, etc. +│ │ ├── aws # the skeleton files for AWS modules +│ │ └── versionControl # the skeleton files for version control +│ └── core # the skeleton folders +│ ├── base # the skeleton files for the base folder +│ └── shared # the skeleton files for the shared folder +├── src # the source code of the CLI +│ ├── commands # the commands of the CLI +│ │ ├── generate +│ │ └── installAddon +│ ├── helpers # the helper functions of the CLI +│ │ ├── childProcess.ts +│ │ ├── file.ts +│ │ └── terraform.ts +│ ├── hooks # the hooks of the CLI +│ │ └── postProcess.ts +│ ├── index.ts # the entry point of the CLI +│ └── templates # the code to generate the templates +│ ├── addons # the code to generate the common addons e.g. version control, CI/CD, AWS, etc. +│ └── core # the code to generate the main Terraform files e.g. `main.tf`, `variables.tf`, etc. +└── test # the test helpers and configurations + └── matchers # the custom matchers for Jest + ├── file.ts + ├── index.d.ts + └── index.ts +``` + +> [!NOTE]\ +> The `skeleton` folder and the `templates` folder are the two main folders that are used to generate the project files + +- The `skeleton` folder contains the addon's files and folders ready to be directly copy-pasted into the generated project if the related addon has been selected. These files serve as a starting point or "skeleton" for the specific addon. + +- On the other hand, the `templates` folder houses the logic for determining which files need to be copied from the templates folder into the core project files. It includes instructions on what files should be formed based on the type of addon/module being added (common addons, AWS modules, or standard files). + +In summary, while the `skeleton` folder provides the files and folders needed for the addon, the `templates` folder handles the dynamic copying and integration of those files within the core project structure. \ No newline at end of file diff --git a/.github/wiki/Contributing-guidelines.md b/.github/wiki/Contributing-guidelines.md index 8e08cdc2..9a63a628 100644 --- a/.github/wiki/Contributing-guidelines.md +++ b/.github/wiki/Contributing-guidelines.md @@ -4,18 +4,13 @@ The following is a set of guidelines for contributing to this project. These are ## Introduction -This project uses TypeScript and [OCLIF](https://oclif.io/) to build the CLI, Jest for testing, and ESLint for code formatting and linting. - ## Issues and feature requests If you have any issues or feature requests, please create an issue in the [GitHub issues](https://github.com/nimblehq/infrastructure-templates/issues) page. ## Development -### Prerequisites - -- [Node.js](https://nodejs.org/en/download/) 12.x or higher - 18.x LTS is recommended -- NPM is preferred to use with this project +Please refer to the [[Architecture Overview]] to understand the project's architecture first. ### Install dependencies @@ -39,51 +34,6 @@ bin/dev generate {project-name} bin/dev install {addon-name} --project {project-name} ``` -### Project structure - -The project has the following main files and folders: - -```bash -├── bin # the executable file for the CLI -│ ├── dev # the executable file for the CLI in development mode -│ └── run # the executable file for the CLI in production mode -├── skeleton # the skeleton files for the project -│ ├── addons # the skeleton files for common addons e.g. version control, CI/CD, etc. -│ │ ├── aws # the skeleton files for AWS modules -│ │ └── versionControl # the skeleton files for version control -│ └── core # the skeleton folders -│ ├── base # the skeleton files for the base folder -│ └── shared # the skeleton files for the shared folder -├── src # the source code of the CLI -│ ├── commands # the commands of the CLI -│ │ ├── generate -│ │ └── installAddon -│ ├── helpers # the helper functions of the CLI -│ │ ├── childProcess.ts -│ │ ├── file.ts -│ │ └── terraform.ts -│ ├── hooks # the hooks of the CLI -│ │ └── postProcess.ts -│ ├── index.ts # the entry point of the CLI -│ └── templates # the code to generate the templates -│ ├── addons # the code to generate the common addons e.g. version control, CI/CD, AWS, etc. -│ └── core # the code to generate the main Terraform files e.g. `main.tf`, `variables.tf`, etc. -└── test # the test helpers and configurations - └── matchers # the custom matchers for Jest - ├── file.ts - ├── index.d.ts - └── index.ts -``` - -> [!NOTE]\ -> The `skeleton` folder and the `templates` folder are the two main folders that are used to generate the project files - -- The `skeleton` folder contains the addon's files and folders ready to be directly copy-pasted into the generated project if the related addon has been selected. These files serve as a starting point or "skeleton" for the specific addon. - -- On the other hand, the `templates` folder houses the logic for determining which files need to be copied from the templates folder into the core project files. It includes instructions on what files should be formed based on the type of addon/module being added (common addons, AWS modules, or standard files). - -In summary, while the `skeleton` folder provides the files and folders needed for the addon, the `templates` folder handles the dynamic copying and integration of those files within the core project structure. - ### Add a new command To add a new command, create a new folder in the `src/commands` and add the `index.ts` file. @@ -110,7 +60,7 @@ Inside the newly created addon/module folder, you can include the code required #### Using the Template as a Reference -To copy and include supporting modules from the template, you can follow these steps: +Follow these steps to copy and include supporting modules from the template: 1. Open the `src/templates` directory in your project. 2. Explore the code and structure of the existing addon or module that you want to reference. diff --git a/.github/wiki/Home.md b/.github/wiki/Home.md index 9a3c70f1..dbdb351f 100644 --- a/.github/wiki/Home.md +++ b/.github/wiki/Home.md @@ -6,4 +6,4 @@ An infrastructure template for web applications powered by Terraform. - A `Blank` flavor that generates a blank Terraform project. - The `Complete` flavor generates the following infrastructure: -![Diagram of the Complete Infrastructure](/assets/images/diagram_complete.svg?raw=true) +![Diagram of the Complete Infrastructure](assets/images/architecture/diagram_complete.svg?raw=true) diff --git a/.github/wiki/_Sidebar.md b/.github/wiki/_Sidebar.md index fae7f825..69b85c6d 100644 --- a/.github/wiki/_Sidebar.md +++ b/.github/wiki/_Sidebar.md @@ -1,5 +1,10 @@ ## Table of Contents - [[Home]] -- [[Getting-Started]] -- [[Contributing|Contributing-guidelines]] +- [[Getting Started]] + +## Architecture +- [[Architecture Overview]] + +## Contributing +- [[Contributing guidelines]] diff --git a/.github/wiki/assets/images/diagram_complete.svg b/.github/wiki/assets/images/architecture/diagram-complete.svg similarity index 100% rename from .github/wiki/assets/images/diagram_complete.svg rename to .github/wiki/assets/images/architecture/diagram-complete.svg