Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cli-introduction #122

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: "test"

on:
pull_request:
branches:
- main
- master

jobs:
test-package:
runs-on: ubuntu-latest
strategy:
matrix:
dir:
- 'file-upload'
- 'interceptor'
- 'monitoring'
- 'temporal'

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4

- name: Install Dependencies for packages/common
run: npm ci
working-directory: packages/common

- name: Run tests
run: yarn run test
working-directory: packages/common/test/${{ matrix.dir }}

test-sample:
runs-on: ubuntu-latest
strategy:
matrix:
dir:
- 'sample/01-all-features'
- 'sample/02-monitoring'
- 'sample/03-response-formatting'
- 'sample/04-logging'
- 'sample/05-temporal-package'
- 'sample/06-file-upload'

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4

- name: Install Dependencies for ${{ matrix.dir }}
run: npm ci
working-directory: ${{ matrix.dir }}

- name: Run Tests
run: npm run test
working-directory: ${{ matrix.dir }}/test
2 changes: 1 addition & 1 deletion docs/docs/cli/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: Setup
install the package

```
npm install -g @soorajk1/stencil-cli
npm install -g @samagra-x/stencil-cli
```

## USAGE
Expand Down
26 changes: 17 additions & 9 deletions docs/docs/cli/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,24 @@ title: Introduction

# Introduction

While developing this cli, many custom schematics were created to assist the cli in file generation.
Developing a CLI (Command Line Interface) tool can be a complex and rewarding task. Many custom schematics were created to assist in the cli file generation process. These schematics can significantly enhance the user experience by automating manual setup processes, allowing users to focus more on their project's logic and less on boilerplate code.

The following new commands are available to the user if they wish to expedite a manual setup of their server
In this CLI tool, several new commands have been added to expedite the manual setup of a server environment. Let's delve deeper into each of these commands and understand how they can benefit users:

1. `service-prisma` : Creates a new `prisma.service.ts` and adds it as a provider to `app.module.ts`
2. `prisma` : Adds a sample `User` model to the `schema.prisma` file
3. `service-user` : Adds the necessary imports for `@techsavvyash/user-service` in `app.module.ts`
4. `fixtures` : Generate the docker related files along with the shell sciripts needed to run the `pre-commit` file in husky
5. `husky` : Creates the `pre-commit` file in the `.husky` folder
6. `github` : Creates a new `.github` folder and the `ISSUE_TEMPLATE` and `Workflow` subdirectory in it.
7. `devcontainer` : Generates the `devcontainer.json` in the .devcontainer directory.
1. `service-prisma`: This command creates a new prisma.service.ts file and adds it as a provider to app.module.ts. Prisma is a powerful ORM (Object-Relational Mapping) tool for Node.js and TypeScript, widely used for database operations. By automating the creation of the service file and its integration into the app module, developers can quickly set up Prisma in their projects, saving time and reducing the risk of errors.

2. `prisma`: Adding a sample User model to the schema.prisma file can be a common task when setting up a Prisma project. This command simplifies the process by automatically inserting the necessary code for a basic User model, allowing developers to start working with Prisma's data modeling features right away.

3. `service-user`: Integrating user service-related imports into app.module.ts can be repetitive and error-prone. This command streamlines the process by automatically adding the required imports, making it easier for developers to include user services in their applications.

4. `fixtures`: Docker-related files and shell scripts needed to run the pre-commit file in Husky can be cumbersome to create manually. This command generates these files, making it easier for developers to set up Docker environments and implement pre-commit hooks for code quality assurance.

5. `husky`: Setting up the pre-commit file in the .husky folder is essential for implementing pre-commit hooks. This command automates the creation of this file, ensuring that developers can easily integrate Husky into their projects for automated code checks before committing changes.

6. `github`: Creating a new .github folder and subdirectories like ISSUE_TEMPLATE and Workflow manually can be time-consuming. This command simplifies this process, helping developers set up GitHub repository templates and workflows more efficiently.

7. `devcontainer`: The devcontainer.json file in the .devcontainer directory is crucial for configuring development containers, especially in a Docker environment. This command generates the devcontainer.json file, making it easier for developers to set up their development environment within a container.

Overall, these commands enhance the usability of your CLI tool by automating repetitive and error-prone tasks, enabling developers to set up their server environments quickly and efficiently. By leveraging these custom schematics, developers can focus more on writing code and less on manual setup, ultimately improving productivity and code quality which is the prime goal for this setup.

</p>
Loading