Skip to content

Commit 3a3c0ec

Browse files
authored
Merge pull request #1 from tnramalho/main
Add Initial commit
2 parents b3874bc + 22201fb commit 3a3c0ec

File tree

475 files changed

+43628
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

475 files changed

+43628
-1
lines changed

.codacy.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
exclude_paths:
3+
- '**/node_modules/**'
4+
- '**/__mocks__/**'
5+
- '**/__stubs__/**'
6+
- '**/__fixtures__/**'
7+
- '**/**.spec.js'
8+
- '**/**.e2e-spec.js'
9+
- '.devcontainer/**'
10+
- '.github/**'
11+
- '.husky/**'
12+
- '.vscode/**'
13+
- 'docker/**'

.codecov.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ignore:
2+
- '**/node_modules/**'
3+
- '**/__mocks__/**'
4+
- '**/__stubs__/**'
5+
- '**/__fixtures__/**'
6+
- '**/**.spec.js'
7+
- '**/**.e2e-spec.js'
8+
- '.devcontainer'
9+
- '.github'
10+
- '.husky'
11+
- '.vscode'
12+
- 'docker'

.devcontainer/devcontainer.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.183.0/containers/docker-existing-docker-compose
3+
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
4+
{
5+
"name": "Existing Docker Compose (Extend)",
6+
7+
// Update the 'dockerComposeFile' list if you have more compose files or use different names.
8+
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make.
9+
"dockerComposeFile": [
10+
"docker-compose.yml"
11+
],
12+
13+
// The 'service' property is the name of the service for the container that VS Code should
14+
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
15+
"service": "rockets",
16+
17+
// The optional 'workspaceFolder' property is the path VS Code should open by default when
18+
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
19+
"workspaceFolder": "/workspace",
20+
21+
// Set *default* container specific settings.json values on container create.
22+
"settings": {},
23+
24+
// Add the IDs of extensions you want installed when the container is created.
25+
"extensions": [
26+
"gitlab.gitlab-workflow",
27+
"ms-azuretools.vscode-docker",
28+
"dbaeumer.vscode-eslint",
29+
"eamodio.gitlens",
30+
"ms-vsliveshare.vsliveshare",
31+
"ms-vsliveshare.vsliveshare-audio",
32+
"ms-vsliveshare.vsliveshare-pack",
33+
"esbenp.prettier-vscode"
34+
],
35+
36+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
37+
// "forwardPorts": [],
38+
39+
// Uncomment the next line if you want start specific services in your Docker Compose config.
40+
// "runServices": [],
41+
42+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
43+
// "shutdownAction": "none",
44+
45+
// Uncomment the next line to run commands after the container is created - for example installing curl.
46+
"postCreateCommand": "yarn install"
47+
48+
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
49+
// "remoteUser": "vscode"
50+
}

.devcontainer/docker-compose.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
version: '3.4'
2+
3+
volumes:
4+
rockets:
5+
6+
services:
7+
# Update this to the name of the service you want to work with in your docker-compose.yml file
8+
rockets:
9+
image: maz37/rockets-node
10+
11+
# If you want add a non-root user to your Dockerfile, you can use the "remoteUser"
12+
# property in devcontainer.json to cause VS Code its sub-processes (terminals, tasks,
13+
# debugging) to execute as the user. Uncomment the next line if you want the entire
14+
# container to run as this user instead. Note that, on Linux, you may need to
15+
# ensure the UID and GID of the container user you create matches your local user.
16+
# See https://aka.ms/vscode-remote/containers/non-root for details.
17+
#
18+
# user: vscode
19+
20+
# Uncomment if you want to override the service's Dockerfile to one in the .devcontainer
21+
# folder. Note that the path of the Dockerfile and context is relative to the *primary*
22+
# docker-compose.yml file (the first in the devcontainer.json "dockerComposeFile"
23+
# array). The sample below assumes your primary file is in the root of your project.
24+
#
25+
# build:
26+
# context: .
27+
# dockerfile: .devcontainer/Dockerfile
28+
29+
volumes:
30+
# Update this to wherever you want VS Code to mount the folder of your project
31+
- rockets:/workspace
32+
33+
# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
34+
# - /var/run/docker.sock:/var/run/docker.sock
35+
36+
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust.
37+
# cap_add:
38+
# - SYS_PTRACE
39+
# security_opt:
40+
# - seccomp:unconfined
41+
42+
environment:
43+
NODE_ENV: development
44+
45+
# Overrides default command so things don't shut down after the process ends.
46+
command: /bin/sh -c "while sleep 1000; do :; done"

.eslintrc.js

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
sourceType: 'module',
5+
tsconfigRootDir: __dirname,
6+
project: ['./tsconfig.eslint.json'],
7+
},
8+
plugins: [
9+
'import',
10+
'tsdoc',
11+
],
12+
extends: [
13+
'@concepta/eslint-config/nest',
14+
'plugin:jsdoc/recommended-typescript',
15+
],
16+
ignorePatterns: [
17+
'packages/*/dist/**',
18+
'**/node_modules/**',
19+
'**/.eslintrc.js',
20+
'**/.eslintrc.spec.js',
21+
'**/tsconfig.json',
22+
'**/tsconfig.eslint.json',
23+
'**/commitlint.config.js',
24+
],
25+
settings: {
26+
jsdoc: {
27+
mode: 'typescript',
28+
},
29+
},
30+
rules: {
31+
'import/no-extraneous-dependencies': 'error',
32+
'@darraghor/nestjs-typed/param-decorator-name-matches-route-param': 'off',
33+
'jsdoc/tag-lines': ['error', 'any', { startLines: 1 }],
34+
'tsdoc/syntax': 'error',
35+
},
36+
overrides: [
37+
{
38+
files: ['*.json'],
39+
parser: 'jsonc-eslint-parser',
40+
parserOptions: {
41+
jsonSyntax: 'JSON',
42+
},
43+
},
44+
{
45+
files: ['*.ts'],
46+
rules: {
47+
'jsdoc/require-jsdoc': 'off',
48+
'jsdoc/require-param': 'off',
49+
'jsdoc/require-returns': 'off',
50+
},
51+
},
52+
{
53+
files: ['*.spec.ts', '*.fixture.ts'],
54+
rules: {
55+
'@darraghor/nestjs-typed/controllers-should-supply-api-tags': 'off',
56+
'@darraghor/nestjs-typed/api-method-should-specify-api-response': 'off',
57+
'plugin:jsdoc/recommended-typescript': 'off',
58+
'jsdoc/tag-lines': 'off',
59+
'tsdoc/syntax': 'off',
60+
},
61+
},
62+
],
63+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 🚀 Feature request
2+
description: Suggest a new feature for an existing package.
3+
body:
4+
- type: textarea
5+
attributes:
6+
label: Use case
7+
description: |
8+
Please tell us the problem you are running into that led to you wanting
9+
a new feature.
10+
11+
Is your feature request related to a problem? Please give a clear and
12+
concise description of what the problem is.
13+
validations:
14+
required: true
15+
- type: textarea
16+
attributes:
17+
label: Proposal
18+
description: |
19+
Briefly but precisely describe what you would like this package to be able to do.
20+
21+
Consider attaching something showing what you are imagining:
22+
* images
23+
* videos
24+
* code samples (remember to use code blocks)
25+
validations:
26+
required: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: 📦 New Package Proposal
2+
description: Propose a new NestJS package for the monorepo
3+
body:
4+
- type: textarea
5+
attributes:
6+
label: Problem Statement
7+
description: |
8+
Please describe the general problem or need that this package would address.
9+
10+
What common challenges or patterns have you identified that could benefit from
11+
a reusable NestJS package solution?
12+
validations:
13+
required: true
14+
- type: textarea
15+
attributes:
16+
label: Package Proposal
17+
description: |
18+
Describe your vision for this package:
19+
- What would be its core functionality?
20+
- How would it integrate with NestJS?
21+
- What abstract interfaces or patterns would it implement?
22+
- How could it be reused across different projects?
23+
24+
Consider including:
25+
* High-level architecture diagrams
26+
* Example usage code blocks
27+
* Similar existing solutions (and how this would differ)
28+
validations:
29+
required: true
30+
- type: textarea
31+
attributes:
32+
label: Implementation Approach
33+
description: |
34+
Outline your thoughts on how this package could be implemented:
35+
- What dependencies might it require?
36+
- How would it maintain abstraction and flexibility?
37+
validations:
38+
required: true

.github/workflows/ci-merge.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: ci-merge
2+
on:
3+
push:
4+
branches: ["main"]
5+
workflow_dispatch:
6+
branches: ["main"]
7+
jobs:
8+
ci:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
node-version: [18.x]
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Enable Corepack
16+
run: corepack enable
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v2
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
22+
- uses: actions/cache@v3
23+
with:
24+
path: "**/node_modules"
25+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
26+
27+
- name: Install
28+
run: yarn --immutable
29+
- name: Build
30+
run: yarn build
31+
- name: Unit tests
32+
run: yarn test:ci
33+
- name: Process Test Results
34+
uses: dorny/test-reporter@v1
35+
with:
36+
name: Jest Tests
37+
path: "junit.xml"
38+
reporter: jest-junit
39+
- name: Upload coverage to Codecov
40+
uses: codecov/codecov-action@v2
41+
with:
42+
files: ./coverage/coverage-final.json
43+
verbose: true
44+
- name: Upload coverage to Code Climate
45+
uses: paambaati/codeclimate-action@v3.0.0
46+
env:
47+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
48+
with:
49+
coverageLocations: |
50+
${{ github.workspace }}/coverage/lcov.info:lcov
51+
- name: Upload coverage to Codacy
52+
uses: codacy/codacy-coverage-reporter-action@v1.3.0
53+
with:
54+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
55+
coverage-reports: ./coverage/lcov.info

.github/workflows/ci-pr-report.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: ci-pr-report
2+
on:
3+
workflow_run:
4+
workflows: ['ci-pr-test']
5+
types:
6+
- completed
7+
jobs:
8+
test-report:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
ref: ${{ github.event.workflow_run.head_sha }}
15+
- name: Process Test Results
16+
uses: dorny/test-reporter@v1
17+
with:
18+
artifact: test-results
19+
name: Jest Tests
20+
path: 'junit.xml'
21+
reporter: jest-junit
22+
coverage-report:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
with:
28+
ref: ${{ github.event.workflow_run.head_sha }}
29+
- name: Download artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
workflow: ci-pr-test.yml
33+
name: test-results
34+
- name: Get PR Number
35+
id: vars
36+
run: echo ::set-output name=pr_num::$(cat pr_num.txt)
37+
- name: Upload to Codecov
38+
uses: codecov/codecov-action@v2
39+
with:
40+
files: ${{ github.workspace }}/coverage/coverage-final.json
41+
override_pr: ${{ steps.vars.outputs.pr_num }}
42+
verbose: true
43+
- name: Upload coverage to Codacy
44+
uses: codacy/codacy-coverage-reporter-action@v1.3.0
45+
with:
46+
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
47+
coverage-reports: ${{ github.workspace }}/coverage/lcov.info
48+
- name: Upload coverage to Code Climate
49+
uses: paambaati/codeclimate-action@v3.0.0
50+
env:
51+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
52+
with:
53+
coverageLocations: |
54+
${{ github.workspace }}/coverage/lcov.info:lcov

0 commit comments

Comments
 (0)