Skip to content

Commit

Permalink
fix(practs): bump practs to latest best
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed Jul 14, 2024
1 parent 32dcbc0 commit c14fbc2
Show file tree
Hide file tree
Showing 16 changed files with 495 additions and 496 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,6 @@ module.exports = {
'@typescript-eslint/lines-between-class-members': 'off',
'no-return-await': 'off', // this does not help anything and actually leads to bugs if we subsequently wrap the return in a try catch without remembering to _then_ add await
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
},
};
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# exclude package-lock from git diff; https://stackoverflow.com/a/72834452/3068233
package-lock.json -diff
3 changes: 1 addition & 2 deletions .github/workflows/.publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
with:
registry-url: 'https://registry.npmjs.org/'
node-version-file: '.nvmrc'
cache: 'npm'

- name: node-modules cache get
uses: actions/cache/restore@v3
Expand All @@ -36,6 +35,6 @@ jobs:
run: npm run build

- name: publish
run: npm publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm-auth-token }}
12 changes: 2 additions & 10 deletions .github/workflows/.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: node-modules cache get
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -64,7 +63,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand All @@ -86,7 +84,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand All @@ -108,7 +105,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand All @@ -130,7 +126,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand All @@ -152,7 +147,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand All @@ -161,7 +155,7 @@ jobs:
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}

- name: test:unit
run: npm run test:unit
run: THOROUGH=true npm run test:unit

test-integration:
runs-on: ubuntu-latest
Expand All @@ -174,7 +168,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand Down Expand Up @@ -202,7 +195,7 @@ jobs:
run: npm run provision:integration-test-db --if-present

- name: test:integration
run: npm run test:integration
run: THOROUGH=true npm run test:integration

test-acceptance-locally:
runs-on: ubuntu-latest
Expand All @@ -215,7 +208,6 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'

- name: get node-modules from cache
uses: actions/cache/restore@v3
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: review

on:
pull_request:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
pullreq-title:
runs-on: ubuntu-latest
steps:
- name: test:pullreq:title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# https://github.com/commitizen/conventional-commit-types
types: |
fix
feat
chore
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.serverless
.terraform
.terraform.lock
.yalc
coverage
dist
node_modules
2 changes: 1 addition & 1 deletion .husky/check.lockfile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ changed () {
}

if changed 'package-lock.json'; then
echo "📦 package-lock.json changed. Run npm install to update your locally installed dependencies."
echo "📦 package-lock.json changed. Run 'npm install' to update your locally installed dependencies."
fi
7 changes: 7 additions & 0 deletions .husky/check.yalc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

# https://github.com/wclr/yalc
if [ "$(npx yalc check)" ]; then
echo "✋ package.json has yalc references. Run 'npx yalc remove --all' to remove these local testing references."
fi

4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname -- "$0")/_/husky.sh"

. "$(dirname -- "$0")/check.yalc.sh"
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
v20.12.2
3 changes: 3 additions & 0 deletions jest.acceptance.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { Config } from 'jest';

// ensure tests run in utc, like they will on cicd and on server; https://stackoverflow.com/a/56277249/15593329
process.env.TZ = 'UTC';

// https://jestjs.io/docs/configuration
const config: Config = {
verbose: true,
Expand Down
3 changes: 3 additions & 0 deletions jest.integration.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { Config } from 'jest';

// ensure tests run in utc, like they will on cicd and on server; https://stackoverflow.com/a/56277249/15593329
process.env.TZ = 'UTC';

// https://jestjs.io/docs/configuration
const config: Config = {
verbose: true,
Expand Down
2 changes: 1 addition & 1 deletion jest.integration.env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ if (
(process.env.NODE_ENV !== 'test' || process.env.STAGE) &&
process.env.I_KNOW_WHAT_IM_DOING !== 'true'
)
throw new Error(`unit-test is not targeting stage 'test'`);
throw new Error(`integration.test is not targeting stage 'test'`);
3 changes: 3 additions & 0 deletions jest.unit.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { Config } from 'jest';

// ensure tests run in utc, like they will on cicd and on server; https://stackoverflow.com/a/56277249/15593329
process.env.TZ = 'UTC';

// https://jestjs.io/docs/configuration
const config: Config = {
verbose: true,
Expand Down
Loading

0 comments on commit c14fbc2

Please sign in to comment.