Skip to content

Commit ddc2522

Browse files
committed
Update nodejs + some deps and pipelines
1 parent 795471f commit ddc2522

File tree

7 files changed

+65
-81
lines changed

7 files changed

+65
-81
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ jobs:
1313
os: ['ubuntu-24.04']
1414
otp: ['26.2.5']
1515
elixir: ['1.14.5']
16-
node: ['18.20.8']
16+
node: ['22.22.1']
1717

1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v5
2020

2121
- name: Set RELEASE_TAG env
2222
run: echo "RELEASE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV
2323
- name: Update VERSION file with '${GITHUB_REF:10}'
2424
run: echo -n "${GITHUB_REF:11}" > VERSION
2525

26-
- uses: erlef/setup-beam@v1
26+
- uses: erlef/setup-beam@v2
2727
with:
2828
otp-version: ${{ matrix.otp }}
2929
elixir-version: ${{ matrix.elixir }}
30-
- uses: actions/setup-node@v4
30+
- uses: actions/setup-node@v5
3131
with:
3232
node-version: ${{ matrix.node }}
3333

.tool-versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
elixir 1.14.5
22
erlang 26.2.5
3-
nodejs 18.20.8
3+
nodejs 22.22.1

assets/js/components/FakeChart.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import React from 'react';
22
import {Line} from 'react-chartjs-2';
3+
import {Chart as ChartJS, CategoryScale, LinearScale, PointElement, LineElement, Tooltip, Legend} from 'chart.js';
34

5+
ChartJS.register(CategoryScale, LinearScale, PointElement, LineElement, Tooltip, Legend);
46

57
const FakeChart: React.FC = () => {
68

@@ -10,7 +12,7 @@ const FakeChart: React.FC = () => {
1012
{
1113
label: 'Commits',
1214
fill: false,
13-
lineTension: 0.1,
15+
tension: 0.1,
1416
backgroundColor: 'rgba(75,192,192,0.4)',
1517
borderColor: 'rgba(75,192,192,1)',
1618
borderCapStyle: 'butt',
@@ -30,7 +32,7 @@ const FakeChart: React.FC = () => {
3032
}
3133
]
3234
};
33-
35+
3436
return (<div>
3537
<Line data={data} />
3638
</div>);

assets/js/components/LanguagesChart.tsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react';
22
import {ApiResponse, TotalLanguage} from "../types";
33
import {Doughnut} from 'react-chartjs-2';
4-
import 'chartjs-plugin-colorschemes';
4+
import {Chart as ChartJS, ArcElement, Tooltip, Legend} from 'chart.js';
55
import getLangColor from '../languageColors';
66

7+
ChartJS.register(ArcElement, Tooltip, Legend);
8+
79
type LanguagesChartProp = {languages:ApiResponse<[TotalLanguage]>};
810

911
const LanguagesChart: React.FC<LanguagesChartProp> = ({languages}) => {
@@ -34,10 +36,21 @@ const LanguagesChart: React.FC<LanguagesChartProp> = ({languages}) => {
3436

3537
const options = {
3638
maintainAspectRatio: false,
37-
legend: {
38-
position: 'bottom',
39-
labels: {
40-
padding: 15
39+
plugins: {
40+
legend: {
41+
position: 'bottom' as const,
42+
labels: {
43+
padding: 15
44+
}
45+
},
46+
tooltip: {
47+
callbacks: {
48+
label: function(context) {
49+
const label = context.label || '';
50+
const value = context.parsed;
51+
return `${label}: ${value}%`;
52+
}
53+
}
4154
}
4255
},
4356
layout: {
@@ -51,19 +64,9 @@ const LanguagesChart: React.FC<LanguagesChartProp> = ({languages}) => {
5164
responsive: true,
5265
rotation: 1 * Math.PI,
5366
circumference: 1 * Math.PI,
54-
tooltips: {
55-
callbacks: {
56-
label: function(tooltipItem, data) {
57-
const dataset = data.datasets[tooltipItem.datasetIndex];
58-
const currentValue = dataset.data[tooltipItem.index];
59-
const label = data.labels[tooltipItem.index]
60-
return `${label}: ${currentValue}%`;
61-
}
62-
}
63-
}
6467
};
6568

6669
return <Doughnut data={data} options={options} height={250} />;
6770
};
6871

69-
export default LanguagesChart;
72+
export default LanguagesChart;

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ services:
1313
command: bash -c "sh .docker/coophub/entrypoint.sh"
1414

1515
nodejs:
16-
image: node:${VERSION_NODE:-18}
16+
image: node:${VERSION_NODE:-22}
1717
working_dir: "/coophub"
1818
volumes:
1919
- ./:/coophub

package-lock.json

Lines changed: 34 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,15 @@
1111
"@types/react-icons": "^3.0.0",
1212
"@types/reactstrap": "^8.7.0",
1313
"bootstrap": "^4.6.0",
14-
"chart.js": "^2.9.4",
15-
"chartjs-plugin-colorschemes": "^0.4.0",
14+
"chart.js": "^4.4.0",
1615
"fetch-suspense": "^1.2.0",
1716
"jquery": "^3.6.4",
1817
"lodash": "^4.17.0",
1918
"npm": "^9.6.0",
2019
"phoenix": "file:deps/phoenix",
2120
"phoenix_html": "file:deps/phoenix_html",
2221
"react": "^18.2.0",
23-
"react-chartjs-2": "^2.11.0",
22+
"react-chartjs-2": "^5.2.0",
2423
"react-countup": "^6.4.0",
2524
"react-dom": "^18.2.0",
2625
"react-emoji-render": "^2.0.0",

0 commit comments

Comments
 (0)