Skip to content

Commit

Permalink
refactor: update to node 18
Browse files Browse the repository at this point in the history
BREAKING CHANGE: drop node 16
  • Loading branch information
christophehurpeau committed Jul 29, 2023
1 parent 6b27ece commit b61655f
Show file tree
Hide file tree
Showing 173 changed files with 405 additions and 1,300 deletions.
14 changes: 13 additions & 1 deletion .husky/pre-push
@@ -1,4 +1,16 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

yarn test --watchAll=false --changedSince=origin/main && yarn run checks
# z40 is the value matching the empty blob/commit/tree SHA (zero x 40)
z40=0000000000000000000000000000000000000000
branch_ref=$(git symbolic-ref HEAD)

while read local_ref local_sha remote_ref remote_sha
do
# Skip if branch deletion
if [ "$local_sha" != "$z40" ]; then
if [ "$local_ref" = "$branch_ref" ]; then
yarn test --watchAll=false --changedSince=origin/main && yarn run checks
fi
fi
done
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.
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.
7 changes: 7 additions & 0 deletions .yarnrc.yml
Expand Up @@ -2,3 +2,10 @@ defaultSemverRangePrefix: ""
enableMessageNames: false
nodeLinker: node-modules
yarnPath: .yarn/releases/yarn-3.6.1.cjs
supportedArchitectures:
cpu:
- x64
- arm64
os:
- linux
- darwin
2 changes: 1 addition & 1 deletion babel.config.cjs
Expand Up @@ -8,7 +8,7 @@ module.exports = function babelConfig(api) {
return {
only: ['src'],
presets: [
['pob-babel/preset.js'],
['pob-babel/preset.js', { modules: false }],
[
'@babel/preset-react',
{
Expand Down
10 changes: 10 additions & 0 deletions jest.config.json
@@ -0,0 +1,10 @@
{
"cacheDirectory": "./node_modules/.cache/jest",
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
"<rootDir>/src/**/*.test.ts?(x)"
],
"collectCoverageFrom": ["src/**/*.ts?(x)"],
"moduleFileExtensions": ["ts", "tsx", "js", "json"],
"extensionsToTreatAsEsm": [".ts", ".tsx"]
}
54 changes: 16 additions & 38 deletions package.json
Expand Up @@ -9,15 +9,16 @@
"homepage": "https://github.com/christophehurpeau/reviewflow",
"type": "module",
"engines": {
"node": ">=16.0.0"
"node": ">=18.12.0"
},
"packageManager": "yarn@3.6.1",
"main": "./build/index-node16.mjs",
"main": "./build/index-node18.mjs",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./src/index.ts",
"node": {
"import": "./build/index-node16.mjs"
"import": "./build/index-node18.mjs"
}
}
},
Expand All @@ -34,6 +35,7 @@
"postinstall": "pob-root-postinstall",
"start": "yarn clean:build && rollup --config rollup.config.mjs --watch",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test:coverage": "NODE_OPTIONS=--experimental-vm-modules jest --coverage --coverageReporters=json --coverageReporters=text",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch",
"version": "pob-version"
},
Expand All @@ -43,35 +45,11 @@
"@pob/commitlint-config"
]
},
"jest": {
"cacheDirectory": "./node_modules/.cache/jest",
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.ts?(x)",
"<rootDir>/src/**/*.test.ts?(x)"
],
"collectCoverageFrom": [
"src/**/*.ts?(x)"
],
"modulePaths": [
"<rootDir>/src/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"testEnvironment": "node",
"extensionsToTreatAsEsm": [
".ts",
".tsx"
]
},
"pob": {
"babelEnvs": [
{
"target": "node",
"version": "16"
"version": "18"
}
],
"jsx": true,
Expand All @@ -80,23 +58,23 @@
]
},
"dependencies": {
"@commitlint/config-conventional": "17.6.6",
"@commitlint/lint": "17.6.6",
"@commitlint/parse": "17.6.5",
"@commitlint/config-conventional": "17.6.7",
"@commitlint/lint": "17.6.7",
"@commitlint/parse": "17.6.7",
"@octokit/core": "3.6.0",
"@octokit/rest": "18.12.0",
"@octokit/webhooks": "9.26.0",
"@slack/web-api": "6.8.1",
"@tryfabric/mack": "1.2.1",
"body-parser": "1.20.1",
"conventional-changelog-conventionalcommits": "5.0.0",
"conventional-changelog-conventionalcommits": "6.1.0",
"cookie-parser": "1.4.6",
"delay": "6.0.0",
"dotenv": "8.6.0",
"emoji-regex": "10.2.1",
"issue-parser": "6.0.0",
"jsonwebtoken": "9.0.0",
"liwi-mongo": "10.3.2",
"liwi-mongo": "11.0.0",
"lock": "1.1.0",
"probot": "12.3.1",
"react": "18.2.0",
Expand All @@ -107,11 +85,11 @@
"devDependencies": {
"@babel/core": "7.22.9",
"@babel/preset-react": "7.22.5",
"@pob/commitlint-config": "5.1.1",
"@pob/commitlint-config": "6.0.1",
"@pob/eslint-config": "51.0.0",
"@pob/eslint-config-typescript": "51.0.0",
"@pob/eslint-config-typescript-react": "51.0.0",
"@pob/root": "7.5.0",
"@pob/root": "8.1.1",
"@types/body-parser": "1.19.2",
"@types/cookie-parser": "1.4.3",
"@types/express": "4.17.17",
Expand All @@ -123,12 +101,12 @@
"@types/react-dom": "18.2.7",
"@types/simple-oauth2": "4.1.2",
"check-package-dependencies": "6.4.1",
"eslint": "8.43.0",
"eslint": "8.46.0",
"jest": "29.6.2",
"nock": "13.3.2",
"pob-babel": "35.6.2",
"pob-babel": "36.2.0",
"smee-client": "1.2.3",
"type-fest": "3.12.0",
"typescript": "4.9.5"
"typescript": "5.1.6"
}
}
7 changes: 7 additions & 0 deletions scripts/check-package.js
Expand Up @@ -3,6 +3,13 @@ import { createCheckPackage } from 'check-package-dependencies';
await createCheckPackage()
.checkRecommended({
isLibrary: false,
onlyWarnsForInDependencies: {
'@commitlint/config-conventional': {
duplicateDirectDependency: [
'conventional-changelog-conventionalcommits',
],
},
},
})
.checkSatisfiesVersionsFromDependency('probot', {
dependencies: ['@octokit/core', '@octokit/webhooks'],
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Expand Up @@ -28,7 +28,7 @@
"forceConsistentCasingInFileNames": true,

/* Module Resolution Options */
"moduleResolution": "node" /* Specify module resolution strategy. */,
"moduleResolution": "bundler" /* Specify module resolution strategy. */,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
Expand Down

0 comments on commit b61655f

Please sign in to comment.