Skip to content

Commit

Permalink
Adds a dev setup and dev workflow guide to CONTRIBUTIING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
gnaaruag committed Jul 8, 2024
1 parent f75e48f commit 2a2ea0e
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# Contributing Guide
* [Ways to Contribute](#ways-to-contribute)
* [Find an Issue](#find-an-issue)
* [Pull Request Lifecycle](#pull-request-lifecycle)
* [Development Environment Setup](#development-environment-setup)
- [Contributing Guide](#contributing-guide)
- [Repository Structure](#repository-structure)
- [Development Setup](#development-setup)
- [Development workflow](#development-workflow)
- [For features/bug fixing](#for-featuresbug-fixing)
- [Writing and running tests](#writing-and-running-tests)
- [Pre-commit checklist](#pre-commit-checklist)
- [Ways to Contribute](#ways-to-contribute)
- [Community Issue Assignment Policy](#community-issue-assignment-policy)
- [Guidelines](#guidelines)
- [Resources](#resources)


## Repository Structure
Expand All @@ -25,6 +32,45 @@
- `docs` this folder contains the documentation for the framework. This is a docusaurus app which can be started for easy reference.


## Development Setup

To set up Stencil in your local development environment; follow the steps listed below

1. Fork the stencil repo
2. Clone your fork into any folder of your choice via `git clone https://github.com/<USERNAME>/stencil.git`
3. The `packages/common` folder corresponds to the npm package `@samagra-x/stencil`
4. Any features additoins or bug fixes are to be done here
5. Corresponding to every functionality in the `common` folder you can find an example application in the `sample` folder
6. Here's where you can realise changes made to the package and test your changes

## Development workflow

Once the repository is setup your workflow will look like the following.

### For features/bug fixing
1. Initially make changes to `packages/common/src`
2. Once changes have been made to the `src` folder you are supposed to build the package via `npm run build`. This is to be done inside the `packages/common` directory
3. Once changes are made run `npm link` in the `packages/common` directory (this creates a [symlink](https://docs.npmjs.com/cli/v9/commands/npm-link) of your modified package in the node globals and the published package is overriden)
4. Then navigate to the example app in `sample` which corresponds to the changes you have made run `npm install` to set up the dependencies. After setting up the dependencies run `npm link @samagra-x/stencil` (this lets the project know you want to use the modified package and not the published package)
5. Once the feature runs as expected continue to writing tests

### Writing and running tests

1. To write tests find the `/test`
2. In the `packages/common` you will find two kinds of tests
3. One is a `service-spec` test, where the service layer tests are defined
4. The other is an `app.e2e` test, here the application controllers are tested
5. To run the `service-spec` tests run `npm run test` and to run the `app.e2e` tests run `npm run test:e2e`
6. For every new feature or bug fix you are supposed to either write new tests or modify current test suites

### Pre-commit checklist

Before commiting and submitting pull request follow the given steps

1. Lint your code with `prettier` before your commit via `npm run lint`
2. Make sure all test suites are passing before you make your commit/pull request
3. Use `npm run test` and `npm run test:e2e` and make sure all tests are passing before making your commit

## Ways to Contribute

- As a first time contributor, navigating through the project, it can be quite daunting for you. Please make sure to go through the [repository structure](#repository-structure) to understand the project a bit better, if you want to understand the project better.
Expand Down

0 comments on commit 2a2ea0e

Please sign in to comment.