diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..2cb80674 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:base", + ":pinAllExceptPeerDependencies", + ":disableRateLimiting" + ], + "schedule": [ + "at any time" + ], + "packageRules": [ + { + "matchPackagePatterns": ["*"], + "matchUpdateTypes": ["patch", "minor"], + "groupName": "All non-major dependencies", + "groupSlug": "all-non-major-dependencies", + "automerge": true, + "labels": ["dependencies"] + }, + { + "matchPackagePatterns": ["*"], + "matchUpdateTypes": ["major"], + "groupName": "All major dependencies", + "groupSlug": "all-major-dependencies", + "labels": ["dependencies", "breaking"] + } + ] +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 692e3d25..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build - -on: - pull_request: - branches: - - '*' - push: - branches: - - main -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x, 16.x] - - steps: - - uses: actions/checkout@v2 - - - name: Setup Node - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - - name: Install dependencies - run: npm ci - - - name: Check Format - run: npm run format:check - - - name: Check Linter - run: npm run linter - - - name: Build - run: npm run build - - - name: Check Tests - run: npm run test:js:ci:coverage - - - name: Upload coverage to Codecov - uses: codecov/codecov-action@v2 - with: - token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f42b4c48 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,147 @@ +name: CI + +on: + pull_request: + branches: + - '*' + push: + branches: + - main + - develop + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v3 + + - name: Setup PNPM + uses: pnpm/action-setup@v2.2.2 + with: + version: 6 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + cache-dependency-path: package.json + + - name: Install dependencies + run: pnpm install + + - name: Build + run: pnpm build + + - name: Cache build + id: cache-build + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-build-${{ github.sha }} + + format: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v3 + + - name: Setup PNPM + uses: pnpm/action-setup@v2.2.2 + with: + version: 6 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + cache-dependency-path: package.json + + - name: Install dependencies + run: pnpm install + + - name: Check Format + run: pnpm format:check + + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v3 + + - name: Setup PNPM + uses: pnpm/action-setup@v2.2.2 + with: + version: 6 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + cache-dependency-path: package.json + + - name: Install dependencies + run: pnpm install + + - name: Check Linter + run: pnpm lint + + test: + runs-on: ubuntu-latest + needs: [build, format, lint] + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v3 + + - name: Setup PNPM + uses: pnpm/action-setup@v2.2.2 + with: + version: 6 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'pnpm' + cache-dependency-path: package.json + + - name: Install dependencies + run: pnpm install + + - name: Cache build + id: cache-build + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-build-${{ github.sha }} + + - name: Build + if: steps.cache-build.outputs.cache-hit != 'true' + run: pnpm build + + - name: Check Tests + run: pnpm test:js:ci:coverage + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 126c2a55..68893b25 100644 --- a/.gitignore +++ b/.gitignore @@ -29,9 +29,8 @@ lerna-debug.log* # IDE - VSCode .vscode/* -!.vscode/settings.json -!.vscode/tasks.json !.vscode/launch.json +!.vscode/tasks.json !.vscode/extensions.json # ENV @@ -43,3 +42,5 @@ reports/ ormconfig.json /config/ +/data +pnpm-lock.yaml diff --git a/jest.config.json b/jest.config.json index 07cdbb2a..8dcf575e 100644 --- a/jest.config.json +++ b/jest.config.json @@ -5,7 +5,8 @@ "collectCoverageFrom": ["**/*.ts"], "coveragePathIgnorePatterns": [ "/node_modules/", - "/fixtures/" + "/fixtures/", + "/model/" ], "coverageThreshold": { "global": { @@ -30,7 +31,8 @@ "collectCoverageFrom": ["**/*.ts"], "coveragePathIgnorePatterns": [ "/node_modules/", - "/fixtures/" + "/fixtures/", + "/model/" ], "coverageThreshold": { "global": { diff --git a/jest.js.config.json b/jest.js.config.json index 6698e2c5..a9187715 100644 --- a/jest.js.config.json +++ b/jest.js.config.json @@ -5,7 +5,8 @@ "collectCoverageFrom": ["**/*.js"], "coveragePathIgnorePatterns": [ "/node_modules/", - "/fixtures/" + "/fixtures/", + "/model/" ], "coverageThreshold": { "global": { @@ -19,15 +20,16 @@ "resolver": "/../jest-resolver.js", "rootDir": "dist", "testEnvironment": "node", - "testMatch": ["/**/*.spec.js"], - "testPathIgnorePatterns": ["/node_modules", ".int.spec.js"] + "testMatch": ["/**/*.int.spec.js"], + "testPathIgnorePatterns": ["/node_modules"] }, { "displayName": "Unit", "collectCoverageFrom": ["**/*.js"], "coveragePathIgnorePatterns": [ "/node_modules/", - "/fixtures/" + "/fixtures/", + "/model/" ], "coverageThreshold": { "global": { @@ -42,7 +44,7 @@ "rootDir": "dist", "testEnvironment": "node", "testMatch": ["/**/*.spec.js"], - "testPathIgnorePatterns": ["/node_modules"] + "testPathIgnorePatterns": ["/node_modules", ".int.spec.js"] } ] } diff --git a/package.json b/package.json index f57cf1ae..3002142b 100644 --- a/package.json +++ b/package.json @@ -8,11 +8,12 @@ "build:git:hook": "tsc -p tsconfig.build.gitHook.json", "format": "prettier --write \"src/**/*.ts\"", "format:check": "prettier --check \"src/**/*.ts\"", - "linter": "eslint 'src/**/*.ts'", - "linter:fix": "eslint --fix 'src/**/*.ts'", + "lint": "eslint 'src/**/*.ts'", + "lint:fix": "eslint --fix 'src/**/*.ts'", "start:dev": "tsc-watch -p tsconfig.build.json --onSuccess \"node --inspect=0.0.0.0:9229 dist/main.js\"", "start:prod": "node dist/main.js", "test": "jest", + "test:debug": "node --inspect-brk node_modules/jest/bin/jest.js --runInBand", "test:coverage": "npm test -- --coverage", "test:develop": "jest --changedSince=origin/develop", "test:previous": "jest --changedSince=HEAD~1", @@ -22,11 +23,6 @@ "test:js": "npm test -- --config=jest.js.config.json", "test:unit": "jest --selectProjects Unit", "test:unit:js": "npm run test:js -- --selectProjects Unit", - "typeorm": "node --require ts-node/register ./node_modules/typeorm/cli.js", - "migration:apply": "npm run typeorm -- migration:run", - "migration:create": "npm run typeorm -- migration:create -n", - "migration:generate": "npm run typeorm -- migration:generate -n", - "migration:revert": "npm run typeorm -- migration:revert", "prepare": "husky install" }, "author": "",