-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Showing
33 changed files
with
2,798 additions
and
133 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
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,153 @@ | ||
name: "@remark42/api" | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- ".github/workflows/ci-frontend-api.yml" | ||
- "frontend/packages/**" | ||
- "!**.md" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/ci-frontend-api.yml" | ||
- "frontend/packages/**" | ||
- "!**.md" | ||
|
||
jobs: | ||
type-check: | ||
name: Type check | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [16.15.1] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.0.1 | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- name: Setup pnpm cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm i | ||
working-directory: ./frontend | ||
|
||
- name: Run type check | ||
run: pnpm type-check:api | ||
working-directory: ./frontend | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [16.15.1] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.0.1 | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- name: Setup pnpm cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm i | ||
working-directory: ./frontend | ||
|
||
- name: Run linters | ||
run: pnpm lint:api | ||
working-directory: ./frontend/ | ||
|
||
test: | ||
name: Tests & Coverage | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node: [16.15.1] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2.0.1 | ||
id: pnpm-install | ||
with: | ||
version: 7 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
id: pnpm-cache | ||
run: | | ||
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)" | ||
- name: Setup pnpm cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm i | ||
working-directory: ./frontend | ||
|
||
- name: Test & Coverage | ||
run: pnpm coverage:api | ||
working-directory: ./frontend | ||
|
||
- name: Submit coverage | ||
run: ${{ github.workspace }}/frontend/apps/remark42/node_modules/.bin/codecov | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_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
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,2 @@ | ||
dist | ||
coverage |
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,22 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
'plugin:@typescript-eslint/strict', | ||
'plugin:prettier/recommended', | ||
], | ||
overrides: [], | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
project: './tsconfig.eslint.json', | ||
}, | ||
plugins: ['@typescript-eslint'], | ||
} |
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,5 @@ | ||
node_modules | ||
coverage | ||
dist | ||
**/*.js | ||
**/*.d.ts |
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,3 @@ | ||
module.exports = { | ||
'./**/*.ts': ['pnpm lint-staged:lint'], | ||
} |
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,17 @@ | ||
coverage/** | ||
dist/** | ||
node_modules/** | ||
src/** | ||
test/** | ||
.editorconfig | ||
.eslintrc.cjs | ||
.prettierrc | ||
files.txt | ||
jest.config.ts | ||
pnpm-lock.yaml | ||
postpublish.sh | ||
prepublish.sh | ||
tsconfig.common.json | ||
tsconfig.dev.json | ||
tsconfig.json | ||
|
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 @@ | ||
16.17.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"semi": false, | ||
"printWidth": 100, | ||
"quoteProps": "consistent", | ||
"singleQuote": true | ||
} |
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 @@ | ||
# @remark42/api | ||
|
||
Implementation of API methods for Remark42 | ||
|
||
## Development | ||
|
||
- If you don't have `pnpm` installed run `npm i -g pnpm` | ||
- Install dependencies `pnpm i` | ||
- Run development mode with `pnpm run dev` | ||
- Build lib with `pnpm run build` | ||
- Run tests with `pnpm run test` |
Oops, something went wrong.