-
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.
fix(practs): upgrade to latest declapract-typescript-ehmpathy best pr…
…actices
- Loading branch information
1 parent
45a88fc
commit 752750a
Showing
34 changed files
with
28,162 additions
and
5,546 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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
ignores: | ||
- depcheck | ||
- declapract | ||
- declapract-typescript-ehmpathy | ||
- '@commitlint/config-conventional' | ||
- '@trivago/prettier-plugin-sort-imports' | ||
- '@tsconfig/node-lts-strictest' | ||
- core-js | ||
- ts-jest | ||
- ts-node | ||
- date-fns | ||
- husky |
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,17 @@ | ||
name: pr-release-on-main | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release-please: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: google-github-actions/release-please-action@v3 | ||
with: | ||
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }} | ||
release-type: node | ||
pull-request-title-pattern: 'chore(release): v${version} 🎉' | ||
changelog-path: changelog.md |
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,39 @@ | ||
name: deploy_on_tag | ||
|
||
on: | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
test_and_deploy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # we need all commits to test:commits | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
registry-url: 'https://registry.npmjs.org' | ||
cache: 'npm' | ||
|
||
- name: install | ||
run: npm ci | ||
|
||
- name: tests | ||
run: npm run test | ||
env: | ||
FORCE_COLOR: true # ensure colors are saved in jest snapshots, to be consistent with local development | ||
|
||
- name: publish | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_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,229 @@ | ||
name: test-on-commit | ||
|
||
on: | ||
push: | ||
branches: # run for any branch | ||
- '**' | ||
tags-ignore: # but not for releases, as deploy_on_tag will trigger for it | ||
- '**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
install: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: install | ||
run: npm ci | ||
|
||
- name: cache node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
# run tests in parallel | ||
test-commits: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 # we need all commits to test:commits | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:commits | ||
run: npm run test:commits | ||
|
||
test-types: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:types | ||
run: npm run test:types | ||
|
||
test-format: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:format | ||
run: npm run test:format | ||
|
||
test-lint: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:lint | ||
run: npm run test:lint | ||
|
||
test-unit: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:unit | ||
run: npm run test:unit | ||
env: | ||
FORCE_COLOR: true # ensure colors are saved in jest snapshots, to be consistent with local development | ||
|
||
test-integration: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:integration | ||
run: npm run test:integration | ||
env: | ||
FORCE_COLOR: true # ensure colors are saved in jest snapshots, to be consistent with local development | ||
|
||
test-acceptance-locally: | ||
runs-on: ubuntu-20.04 | ||
needs: [install] | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: read nvmrc | ||
id: nvmrc | ||
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc) | ||
|
||
- name: setup node | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }} | ||
cache: 'npm' | ||
|
||
- name: grab node_modules from cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ github.sha }} | ||
|
||
- name: test:acceptance:locally | ||
run: npm run test:acceptance:locally | ||
env: | ||
FORCE_COLOR: true # ensure colors are saved in jest snapshots, to be consistent with local development |
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,5 +1,8 @@ | ||
.artifact | ||
.env | ||
.serverless | ||
.terraform | ||
.terraform.lock | ||
coverage | ||
dist | ||
node_modules | ||
coverage | ||
.serverless | ||
.env |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx --no-install commitlint --edit "$1" |
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 @@ | ||
lts/* |
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 @@ | ||
*.md |
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,4 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { 'header-max-length': [1, 'always', 140] }, | ||
}; |
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 @@ | ||
# declapract.use.yml | ||
declarations: npm:declapract-typescript-ehmpathy | ||
useCase: npm-package # specify which use case your repo is following, see `declapract-typescript-ehmpathy:src/useCases.yml` for options | ||
variables: # specify the values of the variables to use against checks | ||
organizationName: 'whodis' | ||
projectName: 'simple-hmackey-auth' |
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 @@ | ||
import type { Config } from 'jest'; | ||
|
||
// https://jestjs.io/docs/configuration | ||
const config: Config = { | ||
verbose: true, | ||
testEnvironment: 'node', | ||
moduleFileExtensions: ['js', 'ts'], | ||
transform: { | ||
'^.+\\.tsx?$': 'ts-jest', // https://kulshekhar.github.io/ts-jest/docs/getting-started/presets | ||
}, | ||
testMatch: ['**/*.acceptance.test.ts'], | ||
setupFiles: ['core-js'], | ||
setupFilesAfterEnv: ['./jest.acceptance.env.ts'], | ||
}; | ||
|
||
// eslint-disable-next-line import/no-default-export | ||
export default config; |
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 +1,2 @@ | ||
// eslint-disable-next-line no-undef | ||
jest.setTimeout(90000); // we're calling downstream apis |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.