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

[93] feat: pdf generation service #155

Draft
wants to merge 15 commits into
base: feat/pdf
Choose a base branch
from
Draft
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
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "test"

on:
pull_request:
branches:
- main
- dev

push:
branches:
- '*'

jobs:
test-package:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/[email protected]

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

- name: Install Dependencies for packages/common
run: yarn install --frozen-lockfile
working-directory: packages/common

- name: Unit tests for packages/common
run: yarn run test
working-directory: packages/common/test/

test-sample:
runs-on: ubuntu-latest
strategy:
matrix:
dir:
- '02-monitoring'
- '03-response-formatting'
- '04-logging'
- '05-temporal-package'
- '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: yarn install
working-directory: sample/${{ matrix.dir }}

- name: Run Unit Tests
run: yarn run test
working-directory: sample/${{ matrix.dir }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*


*.pdf
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
11 changes: 11 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
['ci', 'chore', 'docs', 'ticket', 'feat', 'fix', 'perf', 'refactor', 'revert', 'style'],
],
},
};

Loading