-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3acebfd
commit 283e211
Showing
17 changed files
with
7,268 additions
and
4,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,11 @@ | ||
module.exports = { | ||
"env": { | ||
"browser": false, | ||
"es6": true, | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"project": [ | ||
"tsconfig.json", | ||
"tsconfig.test.json" | ||
extends: './node_modules/@restorecommerce/dev/.eslintrc.cjs', | ||
parserOptions: { | ||
project: [ | ||
'tsconfig.json', | ||
], | ||
"sourceType": "module" | ||
}, | ||
"plugins": [ | ||
"@typescript-eslint", | ||
"@typescript-eslint/eslint-plugin", | ||
"prefer-arrow-functions" | ||
], | ||
"rules": { | ||
"@typescript-eslint/adjacent-overload-signatures": "error", | ||
"@typescript-eslint/naming-convention": [ | ||
"error", | ||
{ | ||
"selector": "class", | ||
"format": ["PascalCase"] | ||
}, | ||
{ | ||
"selector": "interface", | ||
"format": ["PascalCase"] | ||
} | ||
], | ||
"@typescript-eslint/indent": ["error", 2], | ||
"@typescript-eslint/member-delimiter-style": [ | ||
"error", | ||
{ | ||
"multiline": { | ||
"delimiter": "semi", | ||
"requireLast": true | ||
}, | ||
"singleline": { | ||
"delimiter": "semi", | ||
"requireLast": false | ||
} | ||
} | ||
], | ||
"@typescript-eslint/no-inferrable-types": "error", | ||
"@typescript-eslint/no-use-before-define": [2, {"functions": true, "classes": true}], | ||
"@typescript-eslint/prefer-namespace-keyword": "error", | ||
"@typescript-eslint/semi": [ | ||
"error", | ||
"always" | ||
], | ||
"@typescript-eslint/type-annotation-spacing": "error", | ||
"arrow-parens": [ | ||
"off", | ||
"as-needed" | ||
], | ||
"capitalized-comments": 0, | ||
"quotes": ["error", "single", { "allowTemplateLiterals": true }], | ||
"no-trailing-spaces": "error", | ||
"no-var": "error", | ||
"object-shorthand": "error", | ||
"prefer-arrow-functions/prefer-arrow-functions": [ | ||
"warn", | ||
{ | ||
"classPropertiesAllowed": false, | ||
"disallowPrototype": false, | ||
"returnStyle": "unchanged", | ||
"singleReturnOnly": false | ||
} | ||
], | ||
"prefer-arrow-callback": "error", | ||
"quote-props": [ | ||
"error", | ||
"as-needed" | ||
], | ||
"spaced-comment": "error" | ||
rules: { | ||
'@typescript-eslint/consistent-type-imports': 0 | ||
} | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: "Lint PR" | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: pr-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,35 @@ | ||
name: release | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
contents: write | ||
issues: write | ||
pull-requests: write | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
- uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
- uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- uses: docker/setup-buildx-action@v1 | ||
- uses: docker/setup-buildx-action@v3 | ||
with: | ||
install: true | ||
|
||
|
@@ -34,28 +38,26 @@ jobs: | |
run: | | ||
echo ::set-output name=repo_name::$(echo ${GITHUB_REPOSITORY#*/*}) | ||
- name: Docker meta | ||
- uses: docker/metadata-action@v5 | ||
id: docker_meta | ||
uses: crazy-max/ghaction-docker-meta@v1 | ||
with: | ||
images: | | ||
${{ github.repository }} | ||
ghcr.io/${{ github.repository }} | ||
tag-sha: true | ||
tag-semver: | | ||
{{version}} | ||
{{major}}.{{minor}} | ||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
images: ${{ github.repository }} | ||
|
||
- uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64 | ||
push: true | ||
load: true | ||
build-args: | | ||
APP_HOME=/home/node/${{ steps.vars.outputs.repo_name }} | ||
cache-from: | | ||
${{ github.repository }}:latest | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
tags: ${{ github.repository }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Install Dependencies | ||
run: npm clean-install | ||
|
||
- run: npx [email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extension": [ | ||
"ts" | ||
], | ||
"spec": "test/**/*.spec.ts", | ||
"require": "ts-node/register", | ||
"node-option": [ | ||
"experimental-specifier-resolution=node", | ||
"loader=ts-node/esm" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Contributing Guidelines | ||
|
||
## Commit Messages | ||
|
||
This repository uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and [commitlint](https://commitlint.js.org) | ||
to standardize the commit messages. | ||
|
||
## Development Flow | ||
|
||
This repository follows a gitflow-style development. | ||
|
||
The `main`/`master` branch is locked, and only allows pull requests. | ||
Any change in the `main`/`master` branch gets automatically released via [semantic-release](https://github.com/semantic-release/semantic-release). | ||
|
||
The `next` branch gets merged into `main`/`master` on an unscheduled basis. | ||
|
||
Any change to the repository requires a new branch from the `next` branch, which then gets merged back into it with a pull request. | ||
|
||
The pull request title must follow the same rules as commit messages and it gets linted. | ||
|
||
The following diagram visualizes the development flow: | ||
|
||
![development flow](./.github/development-flow.png) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.