Skip to content

Commit

Permalink
feat!: drop node 14
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Mar 16, 2023
1 parent 3e11f07 commit eaec32a
Show file tree
Hide file tree
Showing 192 changed files with 592 additions and 600 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/push-renovate-pob_root.yml
Expand Up @@ -3,7 +3,7 @@ name: Commit changes on @pob/root update
on:
push:
branches:
- 'renovate/pob-root-**'
- "renovate/pob-root-**"

jobs:
run-install-and-commit-modified-files:
Expand All @@ -13,17 +13,6 @@ jobs:
with:
token: ${{ secrets.GH_TOKEN }}

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
.yarn/unplugged
.yarn/install-state.gz
key: v2-dependencies--${{ matrix.node-version }}-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}
restore-keys: |
v2-dependencies--${{ matrix.node-version }}-${{ runner.OS }}-
v2-dependencies--${{ matrix.node-version }}-
- name: Install Dependencies
# no immutable here
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-renovate-prettier.yml
Expand Up @@ -3,7 +3,7 @@ name: Run Prettier on renovate update
on:
push:
branches:
- 'renovate/prettier-**'
- "renovate/prettier-**"

jobs:
run-prettier:
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/push.yml
@@ -1,4 +1,4 @@
name: Node CI
name: Push CI

on: [push]

Expand All @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
node-version: [16.x]
node-version: [18.x]

steps:
- uses: actions/checkout@v3
Expand All @@ -17,7 +17,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
run: yarn install --immutable --immutable-cache
Expand All @@ -27,33 +27,32 @@ jobs:

- name: Build
run: yarn run build
if: startsWith(matrix.node-version, '16.')
if: startsWith(matrix.node-version, '18.')

- name: Prettier
run: yarn run lint:prettier
if: startsWith(matrix.node-version, '16.')
if: startsWith(matrix.node-version, '18.')

- name: Typescript
run: yarn run tsc
if: startsWith(matrix.node-version, '16.')
if: startsWith(matrix.node-version, '18.')

- name: Eslint
run: yarn run lint:eslint
if: startsWith(matrix.node-version, '16.')
if: startsWith(matrix.node-version, '18.')

- name: Test
run: yarn run test
env:
CI: true

- name: Check nothing was forgotten before commit
if: startsWith(matrix.node-version, '16.')
if: startsWith(matrix.node-version, '18.')
run: yarn run repository-check-dirty

- uses: GoogleCloudPlatform/release-please-action@v3
if: ${{ startsWith(matrix.node-version, '16.') && github.ref == 'refs/heads/main' }}
if: ${{ startsWith(matrix.node-version, '18.') && github.ref == 'refs/heads/main' }}
id: release
with:
token: ${{ secrets.GH_TOKEN }}
release-type: node
package-name: release-please-action
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion .yarnrc.yml
@@ -1,4 +1,4 @@
defaultSemverRangePrefix: ''
defaultSemverRangePrefix: ""
enableMessageNames: false
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.4.1.cjs
2 changes: 1 addition & 1 deletion babel.config.cjs
Expand Up @@ -8,7 +8,7 @@ module.exports = function babelConfig(api) {
return {
only: ['src'],
presets: [
[require.resolve('pob-babel/preset.cjs')],
['pob-babel/preset.js'],
[
'@babel/preset-react',
{
Expand Down
5 changes: 0 additions & 5 deletions lint-staged.config.cjs

This file was deleted.

3 changes: 3 additions & 0 deletions lint-staged.config.js
@@ -0,0 +1,3 @@
import createLintStagedConfig from '@pob/root/createLintStagedConfig';

export default createLintStagedConfig();
28 changes: 10 additions & 18 deletions package.json
Expand Up @@ -9,19 +9,18 @@
"homepage": "https://github.com/christophehurpeau/reviewflow",
"type": "module",
"engines": {
"node": "^14.13.1 || >=16.0.0"
"node": ">=16.0.0"
},
"packageManager": "yarn@3.4.1",
"main": "./build/index-node14.mjs",
"main": "./build/index-node16.mjs",
"exports": {
"./package.json": "./package.json",
".": {
"node": {
"import": "./build/index-node14.mjs"
"import": "./build/index-node16.mjs"
}
}
},
"module:node": "./build/index-node14.mjs",
"scripts": {
"build": "yarn clean:build && rollup --config rollup.config.mjs",
"checks": "node scripts/check-package.js",
Expand All @@ -38,11 +37,7 @@
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
"version": "pob-version"
},
"prettier": {
"trailingComma": "all",
"singleQuote": true,
"arrowParens": "always"
},
"prettier": "@pob/root/prettier-config",
"commitlint": {
"extends": [
"@pob/commitlint-config"
Expand Down Expand Up @@ -76,10 +71,7 @@
"babelEnvs": [
{
"target": "node",
"version": "14",
"formats": [
"es"
]
"version": "16"
}
],
"jsx": true,
Expand Down Expand Up @@ -114,26 +106,26 @@
"devDependencies": {
"@babel/core": "7.21.0",
"@babel/preset-react": "7.18.6",
"@pob/commitlint-config": "5.1.0",
"@pob/commitlint-config": "5.1.1",
"@pob/eslint-config": "50.0.0",
"@pob/eslint-config-typescript": "50.0.0",
"@pob/eslint-config-typescript-react": "50.0.0",
"@pob/root": "6.22.0",
"@pob/root": "7.5.0",
"@types/body-parser": "1.19.2",
"@types/cookie-parser": "1.4.3",
"@types/express": "4.17.17",
"@types/issue-parser": "3.0.1",
"@types/jest": "29.4.0",
"@types/jest": "29.4.4",
"@types/jsonwebtoken": "9.0.1",
"@types/node": "16.18.14",
"@types/react": "18.0.28",
"@types/react-dom": "18.0.11",
"@types/simple-oauth2": "4.1.2",
"check-package-dependencies": "6.2.1",
"eslint": "8.35.0",
"eslint": "8.36.0",
"jest": "29.5.0",
"nock": "13.3.0",
"pob-babel": "34.1.0",
"pob-babel": "35.6.0",
"smee-client": "1.2.3",
"type-fest": "3.6.1",
"typescript": "4.9.5"
Expand Down
3 changes: 2 additions & 1 deletion src/.eslintrc.json
Expand Up @@ -2,13 +2,14 @@
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"project": "./tsconfig.json",
"createDefaultProgram": true
},
"plugins": ["@typescript-eslint"],
"extends": [
"@pob/eslint-config-typescript",
"@pob/eslint-config-typescript/node",
"@pob/eslint-config-typescript/app",
"@pob/eslint-config-typescript-react"
],
"settings": {
Expand Down
2 changes: 1 addition & 1 deletion src/accountConfigs/ornikar.test.ts
@@ -1,4 +1,4 @@
import { shouldIgnoreRepo } from 'context/repoContext';
import { shouldIgnoreRepo } from '../context/repoContext';
import ornikarConfig from './ornikar';

describe('ignoreRepoPattern', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/context/slack/initTeamSlack.ts
@@ -1,8 +1,8 @@
import { WebClient } from '@slack/web-api';
import type { ProbotEvent } from 'events/probot-types';
import type { Config } from '../../accountConfigs';
import type { MessageCategory } from '../../dm/MessageCategory';
import { getUserDmSettings } from '../../dm/getUserDmSettings';
import type { ProbotEvent } from '../../events/probot-types';
import type { Org, User, MongoStores } from '../../mongo';
import type { AppContext } from '../AppContext';
import type { AccountInfo } from '../getOrCreateAccount';
Expand Down
2 changes: 1 addition & 1 deletion src/events/account-handlers/actions/syncOrg.ts
@@ -1,5 +1,5 @@
import type { CommonOctokitInterface } from 'octokit';
import type { MongoStores, Org } from '../../../mongo';
import type { CommonOctokitInterface } from '../../../octokit';

interface OrgInfo {
login: string;
Expand Down
4 changes: 2 additions & 2 deletions src/events/account-handlers/utils/createHandlerOrgChange.ts
@@ -1,11 +1,11 @@
import type { EmitterWebhookEventName } from '@octokit/webhooks';
import type { Probot } from 'probot';
import type { CustomExtract } from 'context/repoContext';
import type { ProbotEvent } from 'events/probot-types';
import { accountConfigs, defaultConfig } from '../../../accountConfigs';
import type { AppContext } from '../../../context/AppContext';
import type { AccountContext } from '../../../context/accountContext';
import { obtainAccountContext } from '../../../context/accountContext';
import type { CustomExtract } from '../../../context/repoContext';
import type { ProbotEvent } from '../../probot-types';

export type EventsWithOrganisation = CustomExtract<
EmitterWebhookEventName,
Expand Down
6 changes: 3 additions & 3 deletions src/events/commit-handlers/commitCommentCreated.ts
@@ -1,12 +1,12 @@
import type { Probot } from 'probot';
import type { AccountInfo } from 'context/getOrCreateAccount';
import type { MessageCategory } from 'dm/MessageCategory';
import type { AppContext } from '../../context/AppContext';
import type { AccountInfo } from '../../context/getOrCreateAccount';
import type { SlackMessage } from '../../context/slack/SlackMessage';
import type {
PostSlackMessageResult,
SlackMessageResult,
} from '../../context/slack/TeamSlack';
import type { MessageCategory } from '../../dm/MessageCategory';
import type { AccountEmbed } from '../../mongo';
import * as slackUtils from '../../slack/utils';
import { ExcludesNullish } from '../../utils/Excludes';
Expand Down Expand Up @@ -57,7 +57,7 @@ export default function commitCommentCreated(
: []);
const comments = await fetchCommitComments(context, commit.sha);

const otherCommenters: NonNullable<typeof comments[number]['user']>[] =
const otherCommenters: NonNullable<(typeof comments)[number]['user']>[] =
[];
comments.forEach((otherComment) => {
if (comment.id === otherComment.id) return;
Expand Down
2 changes: 1 addition & 1 deletion src/events/commit-handlers/utils/createCommitHandler.ts
@@ -1,5 +1,4 @@
import type { Probot } from 'probot';
import type { ProbotEvent } from 'events/probot-types';
import { catchExceptedErrors } from '../../../ExpectedError';
import type { AppContext } from '../../../context/AppContext';
import type {
Expand All @@ -8,6 +7,7 @@ import type {
EventsWithRepository,
} from '../../../context/repoContext';
import { obtainRepoContext } from '../../../context/repoContext';
import type { ProbotEvent } from '../../probot-types';
import { fetchCommit } from './fetchCommit';
import type { CommitFromRestEndpoint } from './fetchCommit';

Expand Down
2 changes: 1 addition & 1 deletion src/events/commit-handlers/utils/fetchCommit.ts
@@ -1,6 +1,6 @@
import type { RestEndpointMethodTypes } from '@octokit/rest';
import type { EmitterWebhookEventName } from '@octokit/webhooks';
import type { ProbotEvent } from 'events/probot-types';
import type { ProbotEvent } from '../../probot-types';

export type CommitFromRestEndpoint =
RestEndpointMethodTypes['repos']['getCommit']['response']['data'];
Expand Down
2 changes: 1 addition & 1 deletion src/events/commit-handlers/utils/fetchCommitComments.ts
@@ -1,6 +1,6 @@
import type { RestEndpointMethodTypes } from '@octokit/rest';
import type { EmitterWebhookEventName } from '@octokit/webhooks';
import type { ProbotEvent } from 'events/probot-types';
import type { ProbotEvent } from '../../probot-types';

export type CommentsForCommitFromRestEndpoint =
RestEndpointMethodTypes['repos']['listCommentsForCommit']['response']['data'];
Expand Down
7 changes: 5 additions & 2 deletions src/events/pr-handlers/actions/autoApproveAndAutoMerge.ts
@@ -1,5 +1,8 @@
import type { EventsWithRepository, RepoContext } from 'context/repoContext';
import type { ProbotEvent } from 'events/probot-types';
import type {
EventsWithRepository,
RepoContext,
} from '../../../context/repoContext';
import type { ProbotEvent } from '../../probot-types';
import type { PullRequestFromRestEndpoint } from '../utils/PullRequestData';
import type { ReviewflowPrContext } from '../utils/createPullRequestContext';
import { tryToAutomerge } from './tryToAutomerge';
Expand Down
4 changes: 2 additions & 2 deletions src/events/pr-handlers/actions/autoAssignPRToCreator.ts
@@ -1,6 +1,6 @@
import type { EmitterWebhookEventName } from '@octokit/webhooks';
import type { RepoContext } from 'context/repoContext';
import type { ProbotEvent } from 'events/probot-types';
import type { RepoContext } from '../../../context/repoContext';
import type { ProbotEvent } from '../../probot-types';
import type { PullRequestWithDecentData } from '../utils/PullRequestData';

export const autoAssignPRToCreator = async <
Expand Down
11 changes: 7 additions & 4 deletions src/events/pr-handlers/actions/autoMergeIfPossible.ts
@@ -1,8 +1,11 @@
import type { EventsWithRepository, RepoContext } from 'context/repoContext';
import type { ProbotEvent } from 'events/probot-types';
import type { AutomergeLog } from 'mongo';
import type {
EventsWithRepository,
RepoContext,
} from '../../../context/repoContext';
import type { AutomergeLog } from '../../../mongo';
import { areCommitsAllMadeByBots } from '../../../utils/github/isBotUser';
import { getChecksAndStatusesForPullRequest } from '../../../utils/github/pullRequest/checksAndStatuses';
import type { ProbotEvent } from '../../probot-types';
import type {
PullRequestFromRestEndpoint,
PullRequestLabels,
Expand Down Expand Up @@ -105,7 +108,7 @@ export const autoMergeIfPossibleLegacy = async <
): void => {
const repoFullName = repo.full_name;
context.log.info(`automerge: ${repoFullName}#${pullRequest.id} ${type}`);
// eslint-disable-next-line @typescript-eslint/no-floating-promises

repoContext.appContext.mongoStores.automergeLogs.insertOne({
account: repoContext.accountEmbed,
repoFullName,
Expand Down
2 changes: 1 addition & 1 deletion src/events/pr-handlers/actions/calcAndUpdateLabels.ts
@@ -1,10 +1,10 @@
import type { ProbotEvent } from 'events/probot-types';
import type { AppContext } from '../../../context/AppContext';
import type { LabelResponse } from '../../../context/initRepoLabels';
import type {
EventsWithRepository,
RepoContext,
} from '../../../context/repoContext';
import type { ProbotEvent } from '../../probot-types';
import type { PullRequestWithDecentData } from '../utils/PullRequestData';
import type { ReviewflowPrContext } from '../utils/createPullRequestContext';
import { getFailedOrWaitingChecksAndStatuses } from '../utils/getFailedOrWaitingChecksAndStatuses';
Expand Down
7 changes: 5 additions & 2 deletions src/events/pr-handlers/actions/commentBodyEdited.ts
@@ -1,8 +1,11 @@
import type { EventsWithRepository, RepoContext } from 'context/repoContext';
import type { ProbotEvent } from 'events/probot-types';
import type { AppContext } from '../../../context/AppContext';
import type {
EventsWithRepository,
RepoContext,
} from '../../../context/repoContext';
import { getChecksAndStatusesForPullRequest } from '../../../utils/github/pullRequest/checksAndStatuses';
import { getReviewersWithState } from '../../../utils/github/pullRequest/reviews';
import type { ProbotEvent } from '../../probot-types';
import type { PullRequestFromRestEndpoint } from '../utils/PullRequestData';
import type { ReviewflowPrContext } from '../utils/createPullRequestContext';
import { getFailedOrWaitingChecksAndStatuses } from '../utils/getFailedOrWaitingChecksAndStatuses';
Expand Down

0 comments on commit eaec32a

Please sign in to comment.