Skip to content

Commit babcdb0

Browse files
authored
Merge pull request #551 from rtfpessoa/bump-dependencies
Bump dependencies
2 parents b517e40 + 2f4f41a commit babcdb0

20 files changed

+4719
-4308
lines changed

.eslintrc.js

-58
This file was deleted.

.github/workflows/test-and-publish.yml

+35-35
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
run: |
2626
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)"
2727
echo "Next version is ${NEXT_VERSION}"
28-
echo "${NEXT_VERSION}" > .version
28+
echo "${NEXT_VERSION}" > next-version.txt
2929
echo "version=${NEXT_VERSION}" >> $GITHUB_ENV
3030
- name: Get next npm tag name
3131
run: |
@@ -37,22 +37,22 @@ jobs:
3737
export PUBLISH_TAG="pr"
3838
fi
3939
echo "Next tag is ${PUBLISH_TAG}"
40-
echo "${PUBLISH_TAG}" > .tag
40+
echo "${PUBLISH_TAG}" > publish-tag.txt
4141
- name: Upload versions
4242
uses: actions/upload-artifact@v3
4343
with:
4444
name: versions
4545
if-no-files-found: error
4646
path: |
47-
.version
48-
.tag
47+
next-version.txt
48+
publish-tag.txt
4949
5050
build:
5151
runs-on: ubuntu-latest
5252
needs: [version]
5353
strategy:
5454
matrix:
55-
node-version: [16.x, 18.x, 20.x]
55+
node-version: [16.x, 18.x, 20.x, 22.x]
5656
steps:
5757
- uses: actions/checkout@v3
5858
with:
@@ -64,8 +64,8 @@ jobs:
6464
cache: 'npm'
6565
- name: Log environment setup
6666
run: |
67-
node -v
68-
npm -v
67+
node -v
68+
npm -v
6969
- name: Install dependencies
7070
run: npm install
7171
- name: Build templates
@@ -86,60 +86,60 @@ jobs:
8686
with:
8787
name: versions
8888
- name: Store version
89-
run: echo "version=$(cat .version)" >> $GITHUB_ENV
89+
run: echo "version=$(cat next-version.txt)" >> $GITHUB_ENV
9090
- name: Configure Git
9191
run: |
92-
git config user.email "[email protected]"
93-
git config user.name "GitHub Actions"
92+
git config user.email "[email protected]"
93+
git config user.name "GitHub Actions"
9494
- name: Tag commit
9595
uses: tvdias/[email protected]
9696
with:
97-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
98-
tag: "${{ env.version }}"
97+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
98+
tag: '${{ env.version }}'
9999
- name: Install dependencies
100100
run: npm install
101101
- uses: actions/setup-node@v3
102102
with:
103103
registry-url: 'https://registry.npmjs.org'
104-
node-version: '18.x'
104+
node-version: '22.x'
105105
- name: Configure NPM version
106106
env:
107107
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
108108
run: |
109-
rm -f .npmrc
110-
touch .npmrc
111-
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
112-
echo "registry=https://registry.npmjs.org/" >> .npmrc
113-
echo "access=public" >> .npmrc
114-
echo "save-exact=true" >> .npmrc
109+
rm -f .npmrc
110+
touch .npmrc
111+
echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
112+
echo "registry=https://registry.npmjs.org/" >> .npmrc
113+
echo "access=public" >> .npmrc
114+
echo "save-exact=true" >> .npmrc
115115
- name: Version package
116116
run: |
117-
# Update version in packages to publish
118-
npm version $(cat .version) -m "Release version %s"
117+
# Update version in packages to publish
118+
npm version $(cat next-version.txt) -m "Release version %s"
119119
- name: Publish to NPM
120-
run: npm publish --tag $(cat .tag)
120+
run: npm publish --tag $(cat publish-tag.txt)
121121
- uses: actions/setup-node@v3
122122
with:
123-
node-version: '18.x'
123+
node-version: '22.x'
124124
registry-url: 'https://npm.pkg.github.com'
125125
- name: Configure NPM version
126126
env:
127127
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128128
run: |
129-
rm -f .npmrc
130-
touch .npmrc
131-
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
132-
echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
133-
echo "access=public" >> .npmrc
134-
echo "save-exact=true" >> .npmrc
129+
rm -f .npmrc
130+
touch .npmrc
131+
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> .npmrc
132+
echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
133+
echo "access=public" >> .npmrc
134+
echo "save-exact=true" >> .npmrc
135135
- name: Publish to GPR
136136
run: |
137-
# HACK: Override npm package name to be able to publish in GitHub
138-
sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
139-
echo "Going to publish version $(cat .version) to GitHub"
140-
npm publish --tag $(cat .tag)
141-
# HACK: Restore npm package name
142-
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
137+
# HACK: Override npm package name to be able to publish in GitHub
138+
sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
139+
echo "Going to publish version $(cat next-version.txt) to GitHub"
140+
npm publish --tag $(cat publish-tag.txt)
141+
# HACK: Restore npm package name
142+
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
143143
- name: Upload docs
144144
uses: actions/upload-artifact@v3
145145
with:

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@ bower_components/
2929
# Terraform
3030
/terraform/.terraform
3131

32+
# Compiled templates
3233
/src/diff2html-templates.*
34+
35+
# Compiled website
3336
/docs/
37+
38+
# Bundles temporary typescript files compiled by webpack
39+
/bundles-out/
40+
41+
# Web bundles
3442
/bundles/
43+
# CommonJS library
3544
/lib/
45+
# ESNext library
3646
/lib-esm/

.husky/pre-commit

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
32

43
npm run lint:staged

eslint.config.mjs

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
import globals from 'globals';
2+
import eslint from '@eslint/js';
3+
import tseslint from 'typescript-eslint';
4+
import pluginJest from 'eslint-plugin-jest';
5+
import json from '@eslint/json';
6+
import pluginPromise from 'eslint-plugin-promise';
7+
8+
export default [
9+
{ ...eslint.configs.recommended, files: ['src/**/*.{js,mjs,cjs,ts}'] },
10+
...tseslint.configs.recommended,
11+
// ...tseslint.configs.recommendedTypeChecked,
12+
// ...tseslint.configs.strict,
13+
// ...tseslint.configs.stylistic,
14+
// ...tseslint.configs.strictTypeChecked,
15+
// ...tseslint.configs.stylisticTypeChecked,
16+
{
17+
rules: {
18+
'@typescript-eslint/no-unused-vars': [
19+
'error',
20+
{
21+
args: 'all',
22+
argsIgnorePattern: '^_',
23+
caughtErrors: 'all',
24+
caughtErrorsIgnorePattern: '^_',
25+
destructuredArrayIgnorePattern: '^_',
26+
varsIgnorePattern: '^_',
27+
ignoreRestSiblings: true,
28+
},
29+
],
30+
},
31+
},
32+
pluginPromise.configs['flat/recommended'],
33+
{
34+
plugins: {
35+
json,
36+
},
37+
files: ['**/*.json'],
38+
language: 'json/json',
39+
rules: {
40+
'json/no-duplicate-keys': 'error',
41+
},
42+
},
43+
{
44+
...pluginJest.configs['flat/recommended'],
45+
...pluginJest.configs['flat/style'],
46+
files: ['src/__tests__/**/*tests.ts'],
47+
plugins: { jest: pluginJest },
48+
languageOptions: {
49+
globals: pluginJest.environments.globals.globals,
50+
},
51+
},
52+
{
53+
languageOptions: {
54+
globals: {
55+
...globals.browser,
56+
...globals.node,
57+
...globals.es2025,
58+
Atomics: 'readonly',
59+
SharedArrayBuffer: 'readonly',
60+
document: 'readonly',
61+
navigator: 'readonly',
62+
window: 'readonly',
63+
},
64+
parserOptions: {
65+
project: './tsconfig.eslint.json',
66+
tsconfigRootDir: './',
67+
},
68+
},
69+
},
70+
{
71+
ignores: ['src/diff2html-templates.*', 'coverage/', 'docs/', 'bundles-out/', 'bundles/', 'lib/', 'lib-esm/'],
72+
},
73+
{
74+
...tseslint.configs.disableTypeChecked,
75+
files: ['**/*.{js,mjs,cjs}'],
76+
},
77+
];

jest.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ module.exports = {
1919
lines: 93,
2020
},
2121
},
22+
prettierPath: require.resolve('prettier-2'),
2223
};

0 commit comments

Comments
 (0)