Skip to content

Commit e97341c

Browse files
authored
chore: update node and deps (#130)
* chore: regenerate package-lock and fix related issues * chore: update image-js * chore: update cspell * chore: update node version in CI * chore: update clsx * chore: update and simplify cspell action * chore: update immer * chore: update react-icons * chore: build on cloudflare with node 22 * chore: update react
1 parent 957adf4 commit e97341c

File tree

15 files changed

+3688
-1414
lines changed

15 files changed

+3688
-1414
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
nodejs:
1111
uses: zakodium/workflows/.github/workflows/nodejs.yml@nodejs-v1
1212
with:
13-
node-version: 18.x
13+
node-version: 22.x
1414
lint-check-types: true
1515
npm-test-command: npm run build
16-
node-version-matrix: '[18]'
16+
node-version-matrix: '[22]'
1717
upload-coverage: false
1818
disable-test-package: true

.github/workflows/spellcheck.yml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,13 @@ on:
66
- main
77
pull_request:
88

9-
env:
10-
NODE_VERSION: 18.x
11-
129
jobs:
1310
spellcheck:
1411
runs-on: ubuntu-latest
1512
steps:
16-
- uses: actions/checkout@v3
17-
- uses: actions/setup-node@v3
18-
with:
19-
node-version: ${{ env.NODE_VERSION }}
20-
cache: npm
21-
- name: Install dependencies
22-
run: npm ci
23-
- uses: streetsidesoftware/cspell-action@v2
13+
- uses: actions/checkout@v4
14+
- uses: streetsidesoftware/cspell-action@v7
2415
with:
16+
config: ./cspell.config.yaml
2517
files: |
2618
**/*.md

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

docs/Features/Comparison/Addition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 10
44

55
# Addition
66

7-
_Makes an addition between two images._
7+
_Add two images together._
88

99
[🖼️ Image options and parameters of `add` method](https://image-js.github.io/image-js-typescript/classes/Image.html#add 'github.io link')
1010

docs/Features/Operations/Threshold.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ _Choose a threshold value_: This value is determined based on the characteristic
7171
_Compare each pixel's intensity value with the threshold value:_ If the pixel value is greater than or equal to the threshold value, it is assigned to one group (foreground or object).
7272
If the pixel value is less than the threshold value, it is assigned to the other group (background).
7373

74-
_Generate a binary image:_ The result of thresholding is a binary image(mask) where pixels belonging to the foreground are assigned a value of 1 (white) and pixels belonging to the background are assigned a value of 0 (black).
74+
_Generate a binary image:_ The result of thresholding is a mask where pixels belonging to the foreground are assigned a value of 1 (white) and pixels belonging to the background are assigned a value of 0 (black).
7575

7676
</details>

docusaurus.config.js

Lines changed: 158 additions & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ const path = require('path');
44

55
const darkCodeTheme = require('prism-react-renderer').themes.dracula;
66
const lightCodeTheme = require('prism-react-renderer').themes.github;
7-
const katex = require('rehype-katex');
8-
const math = require('remark-math');
97

108
async function demoLoaderPlugin() {
119
return {
@@ -39,171 +37,175 @@ async function demoLoaderPlugin() {
3937
};
4038
}
4139

42-
/** @type {import('@docusaurus/types').Config} */
43-
const config = {
44-
title: 'ImageJS',
45-
tagline: 'Advanced image processing and manipulation in JavaScript.',
46-
favicon: 'img/favicon.ico',
40+
/** @type {() => Promise<import('@docusaurus/types').Config>} */
41+
async function createConfig() {
42+
const remarkPlugins = [(await import('remark-math')).default];
43+
const rehypePlugins = [(await import('rehype-katex')).default];
44+
return {
45+
title: 'ImageJS',
46+
tagline: 'Advanced image processing and manipulation in JavaScript.',
47+
favicon: 'img/favicon.ico',
4748

48-
// Set the production url of your site here
49-
url: 'https://image-js-docs.pages.dev/',
50-
// Set the /<baseUrl>/ pathname under which your site is served
51-
// For GitHub pages deployment, it is often '/<projectName>/'
52-
baseUrl: '/',
49+
// Set the production url of your site here
50+
url: 'https://image-js-docs.pages.dev/',
51+
// Set the /<baseUrl>/ pathname under which your site is served
52+
// For GitHub pages deployment, it is often '/<projectName>/'
53+
baseUrl: '/',
5354

54-
// GitHub pages deployment config.
55-
// If you aren't using GitHub pages, you don't need these.
56-
organizationName: 'Zakodium', // Usually your GitHub org/user name.
57-
projectName: 'image-js', // Usually your repo name.
55+
// GitHub pages deployment config.
56+
// If you aren't using GitHub pages, you don't need these.
57+
organizationName: 'Zakodium', // Usually your GitHub org/user name.
58+
projectName: 'image-js', // Usually your repo name.
5859

59-
plugins: [
60-
demoLoaderPlugin,
61-
[
62-
'@orama/plugin-docusaurus-v3',
63-
{
64-
searchbox: {
65-
disableChat: true,
60+
plugins: [
61+
demoLoaderPlugin,
62+
[
63+
'@orama/plugin-docusaurus-v3',
64+
{
65+
searchbox: {
66+
disableChat: true,
67+
},
6668
},
67-
},
69+
],
6870
],
69-
],
7071

71-
onBrokenLinks: 'throw',
72-
onBrokenMarkdownLinks: 'warn',
72+
onBrokenLinks: 'throw',
73+
onBrokenMarkdownLinks: 'warn',
7374

74-
// Even if you don't use internalization, you can use this field to set useful
75-
// metadata like html lang. For example, if your site is Chinese, you may want
76-
// to replace "en" with "zh-Hans".
77-
i18n: {
78-
defaultLocale: 'en',
79-
locales: ['en'],
80-
},
75+
// Even if you don't use internalization, you can use this field to set useful
76+
// metadata like html lang. For example, if your site is Chinese, you may want
77+
// to replace "en" with "zh-Hans".
78+
i18n: {
79+
defaultLocale: 'en',
80+
locales: ['en'],
81+
},
8182

82-
presets: [
83-
[
84-
'classic',
85-
/** @type {import('@docusaurus/preset-classic').Options} */
83+
presets: [
84+
[
85+
'classic',
86+
/** @type {import('@docusaurus/preset-classic').Options} */
87+
{
88+
docs: {
89+
sidebarPath: require.resolve('./sidebars.js'),
90+
// Please change this to your repo.
91+
// Remove this to remove the "edit this page" links.
92+
editUrl: 'https://github.com/image-js/image-js-docs/tree/main/',
93+
remarkPlugins,
94+
rehypePlugins,
95+
},
96+
blog: {
97+
showReadingTime: true,
98+
blogTitle: 'Docusaurus blog!',
99+
blogDescription: 'A Docusaurus powered blog!',
100+
blogSidebarTitle: 'All posts',
101+
blogSidebarCount: 'ALL',
102+
// Please change this to your repo.
103+
// Remove this to remove the "edit this page" links.
104+
editUrl: 'https://github.com/image-js/image-js-docs/tree/main/',
105+
},
106+
theme: {
107+
customCss: require.resolve('./src/css/custom.css'),
108+
},
109+
},
110+
],
111+
],
112+
stylesheets: [
113+
{
114+
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
115+
type: 'text/css',
116+
integrity:
117+
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
118+
crossorigin: 'anonymous',
119+
},
120+
],
121+
themeConfig:
122+
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
86123
({
87-
docs: {
88-
sidebarPath: require.resolve('./sidebars.js'),
89-
// Please change this to your repo.
90-
// Remove this to remove the "edit this page" links.
91-
editUrl: 'https://github.com/image-js/image-js-docs/tree/main/',
92-
remarkPlugins: [math],
93-
rehypePlugins: [katex],
124+
// Replace with your project's social card
125+
image: 'img/docusaurus-social-card.jpg',
126+
navbar: {
127+
title: 'ImageJS',
128+
logo: {
129+
alt: 'ImageJS',
130+
src: 'img/logo.svg',
131+
},
132+
items: [
133+
{
134+
type: 'doc',
135+
docId: 'Getting started',
136+
position: 'left',
137+
label: 'Docs',
138+
},
139+
{ to: '/blog', label: 'Blog', position: 'left' },
140+
{
141+
href: 'https://image-js.github.io/image-js-typescript/',
142+
label: 'API reference',
143+
position: 'left',
144+
},
145+
],
94146
},
95-
blog: {
96-
showReadingTime: true,
97-
blogTitle: 'Docusaurus blog!',
98-
blogDescription: 'A Docusaurus powered blog!',
99-
blogSidebarTitle: 'All posts',
100-
blogSidebarCount: 'ALL',
101-
// Please change this to your repo.
102-
// Remove this to remove the "edit this page" links.
103-
editUrl: 'https://github.com/image-js/image-js-docs/tree/main/',
147+
footer: {
148+
style: 'dark',
149+
links: [
150+
{
151+
title: 'Docs',
152+
items: [
153+
{
154+
label: 'Getting started',
155+
to: '/docs/Getting started',
156+
},
157+
{
158+
label: 'Basics',
159+
to: '/docs/Basics',
160+
},
161+
{
162+
label: 'Features',
163+
to: '/docs/Features',
164+
},
165+
],
166+
},
167+
{
168+
title: 'Learn',
169+
items: [
170+
{
171+
label: 'Tutorials',
172+
to: '/docs/Tutorials',
173+
},
174+
{
175+
label: 'Useful tips',
176+
to: '/docs/Useful tips',
177+
},
178+
{
179+
label: 'Glossary',
180+
to: '/docs/Glossary',
181+
},
182+
],
183+
},
184+
{
185+
title: 'More',
186+
items: [
187+
{
188+
label: 'GitHub',
189+
href: 'https://github.com/image-js/image-js-typescript',
190+
},
191+
{
192+
label: 'API reference',
193+
href: 'https://image-js.github.io/image-js-typescript/',
194+
},
195+
{
196+
label: 'Zakodium',
197+
href: 'https://www.zakodium.com/',
198+
},
199+
],
200+
},
201+
],
104202
},
105-
theme: {
106-
customCss: require.resolve('./src/css/custom.css'),
203+
prism: {
204+
theme: lightCodeTheme,
205+
darkTheme: darkCodeTheme,
107206
},
108207
}),
109-
],
110-
],
111-
stylesheets: [
112-
{
113-
href: 'https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css',
114-
type: 'text/css',
115-
integrity:
116-
'sha384-odtC+0UGzzFL/6PNoE8rX/SPcQDXBJ+uRepguP4QkPCm2LBxH3FA3y+fKSiJ+AmM',
117-
crossorigin: 'anonymous',
118-
},
119-
],
120-
themeConfig:
121-
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
122-
({
123-
// Replace with your project's social card
124-
image: 'img/docusaurus-social-card.jpg',
125-
navbar: {
126-
title: 'ImageJS',
127-
logo: {
128-
alt: 'ImageJS',
129-
src: 'img/logo.svg',
130-
},
131-
items: [
132-
{
133-
type: 'doc',
134-
docId: 'Getting started',
135-
position: 'left',
136-
label: 'Docs',
137-
},
138-
{ to: '/blog', label: 'Blog', position: 'left' },
139-
{
140-
href: 'https://image-js.github.io/image-js-typescript/',
141-
label: 'API reference',
142-
position: 'left',
143-
},
144-
],
145-
},
146-
footer: {
147-
style: 'dark',
148-
links: [
149-
{
150-
title: 'Docs',
151-
items: [
152-
{
153-
label: 'Getting started',
154-
to: '/docs/Getting started',
155-
},
156-
{
157-
label: 'Basics',
158-
to: '/docs/Basics',
159-
},
160-
{
161-
label: 'Features',
162-
to: '/docs/Features',
163-
},
164-
],
165-
},
166-
{
167-
title: 'Learn',
168-
items: [
169-
{
170-
label: 'Tutorials',
171-
to: '/docs/Tutorials',
172-
},
173-
{
174-
label: 'Useful tips',
175-
to: '/docs/Useful tips',
176-
},
177-
{
178-
label: 'Glossary',
179-
to: '/docs/Glossary',
180-
},
181-
],
182-
},
183-
{
184-
title: 'More',
185-
items: [
186-
{
187-
label: 'GitHub',
188-
href: 'https://github.com/image-js/image-js-typescript',
189-
},
190-
{
191-
label: 'API reference',
192-
href: 'https://image-js.github.io/image-js-typescript/',
193-
},
194-
{
195-
label: 'Zakodium',
196-
href: 'https://www.zakodium.com/',
197-
},
198-
],
199-
},
200-
],
201-
},
202-
prism: {
203-
theme: lightCodeTheme,
204-
darkTheme: darkCodeTheme,
205-
},
206-
}),
207-
};
208+
};
209+
}
208210

209-
module.exports = config;
211+
module.exports = createConfig;

0 commit comments

Comments
 (0)