Commit graph

6277 commits

Author SHA1 Message Date
Sébastien Lorber
b7ba0b54fb
chore: upgrade image-size deps to v2 (#11065)
* upgrade image-size to v2

* fix resizeImage script

* fix tests
2025-04-07 18:29:15 +02:00
Sébastien Lorber
31b279fea6
refactor(theme): introduce CodeBlockContextProvider + split into smaller components (#11062)
* introduce CodeBlockContextProvider

* refactor: apply lint autofix

* add comment

* move wordWrap to context

* Refactor button components

* remove console logs

* Extract more code block components

* Extract CodeBlockLineToken subcomponent

* add TODOs

---------

Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-04-04 20:11:40 +02:00
Sébastien Lorber
d28210d35b
refactor(theme): CodeBlock, centralize metadata parsing + refactor theme component (#11059)
* fix import duplicated

* centralize parsing of code block metadata

* split logic into many subcomponents

* extract getCodeBlockClassName

* fix duplicate useCodeWordWrap() call

* simplify JSX

* move ensureLanguageClassName logic to theme-common

* fix line highlighting bug

* rename tokens to lines

* Extract Pre/Code subcomponents

* Add tests for metadata language

* Add tests for metadata className

* Add tests for metadata title

* Add tests for metadata line highlighting

* Add tests for metadata lineNumbersStart
2025-04-04 18:15:34 +02:00
Sébastien Lorber
f6bdc3123b
refactor(theme): refactor CodeBlock parseLines logic + use inline snapshots to ease review (#11058)
* refactor codeblock parseLines logic + use inline snapshots

* refactor: apply lint autofix

* eslint

---------

Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-04-04 13:22:51 +02:00
Sébastien Lorber
16e3002911
fix(theme): navbar mobile sidebar should allow clicking dropdown parent link (#11053)
* try to repro + initial fix

* Use HTML button

* extract useItemCollapsible()

* Split DropdownNavbarItem into Mobile/Desktop subcomponents

* Add aria labels to button

* cleanup prop types

* aria label

* add translations

* cleanup types

* Split DefaultNavbarItem into Mobile/Desktop subcomponents

* revert change

* type fix
2025-04-03 18:40:45 +02:00
Sébastien Lorber
a05629eeb5
chore: use rspack 1.3.0 (#11039)
* upgrade rspack

* disable parallelCodeSplitting temporarily
2025-04-01 15:33:09 +02:00
程序员小墨
3176a2ccba
fix(theme): Fix code block magic comments with CRLF line breaks bug (#11046)
* fix: with CRLF line breaks, an extra empty line was rendered with // highlight-end at end of code blocks

See: #11036

* Add unit tests

---------

Co-authored-by: sebastien <lorber.sebastien@gmail.com>
2025-04-01 15:14:02 +02:00
Daniel Kuschny
c0f3755d51
test(theme-common): Add tests for getLineNumbersStart (#11017) 2025-03-28 17:20:50 +01:00
Sébastien Lorber
dae29a2782
refactor(core): remove clean-webpack-plugin (#11037)
* remove clean-webpack-plugin

* refactor: apply lint autofix

* remove clean-webpack-plugin

---------

Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-03-27 18:44:48 +01:00
Sébastien Lorber
37d8844506
fix(cli): fix CLI write-translation bug (#11027)
* fix write-translation bug

* fix write-translation bug
2025-03-27 12:22:44 +01:00
Tatsunori Uchino
8881fd1a59
fix(theme-translation): add missing Japanese translation for System Mode (#11030) 2025-03-27 11:58:10 +01:00
Sébastien Lorber
e64e0e7c96
fix(ideal-image): fix waypoint initial scroll bug (#11026)
fiw waypoint initial scroll bug
2025-03-24 15:31:37 +01:00
Sébastien Lorber
43fdb825e8
fix(ideal-image): Internalize react-waypoint dependency, fix React 19 compatibility (#11014)
* copy waypoint, remove logs

* remove propTypes

* remove debug

* remove scrollableAncestor prop

* remove onPositionChange

* remove horizontal prop

* remove fireOnRapidScroll

* remove useless render code

* remove ensureRefIsUsedByChild

* remove children prop

* inline constants

* remove consolidated-events

* copy getCurrentPosition

* remove computeOffsetPixels

* extract findScrollableAncestor

* extract getBounds

* remove hasWindow

* remove onNextTick()

* fixes

* make it work, replace waypoint

* slim down

* slim down

* slim down

* use TypeScript

* slim down

* slim down

* revert
2025-03-20 12:33:27 +01:00
Sébastien Lorber
fcee060f40
refactor(ideal-image-plugin): internalize legacy component code (#11010)
* almost working

* refactor: apply lint autofix

* cspell ignore

* refactor: apply lint autofix

* type fixes

---------

Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-03-19 18:21:09 +01:00
Sébastien Lorber
502b9007be
perf(core): Optimize docusaurus start/serve, fix openBrowser() perf issue on macOS (#11007)
Optimize openBrowser() util
2025-03-19 13:18:32 +01:00
Sébastien Lorber
3782244ce7
feat(core): Add bundler tracing/profiling (#11006)
* Add rspack tracing/profiling

* Add CLI start PerfLogger

* cleanup BundlerCPUProfilerPlugin
2025-03-19 12:14:06 +01:00
Sébastien Lorber
e88f1aaf96
fix(mdx-loader): refactor and fix heading to toc html value serialization (#11004)
* refactor with iso behavior

* Add unit tests

* change behavior for <img> tags
2025-03-18 17:52:26 +01:00
dependabot[bot]
1d4d17da18
chore(deps): bump actions/setup-node from 4.2.0 to 4.3.0 (#11002)
* chore(deps): bump actions/setup-node from 4.2.0 to 4.3.0

Bumps [actions/setup-node](https://github.com/actions/setup-node) from 4.2.0 to 4.3.0.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](1d0ff469b7...cdca7365b2)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* refactor: apply lint autofix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-18 10:01:00 +01:00
cylewaitforit
b0b95ccff9
fix(module-type-aliases): pin react-helmet-async to @slorber/react-helmet-async@1.3.0 (#10998) 2025-03-17 11:17:05 +01:00
Balthasar Hofer
579bb5ad37
fix(theme): CodeBlock should accept title of ReactNode type (#10999)
* allow ReactNode for CodeBlock title

* fix example
2025-03-17 11:03:10 +01:00
dependabot[bot]
7d36e2a8ff
chore(deps): bump @babel/runtime-corejs3 from 7.25.9 to 7.26.10 (#10990)
Bumps [@babel/runtime-corejs3](https://github.com/babel/babel/tree/HEAD/packages/babel-runtime-corejs3) from 7.25.9 to 7.26.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.26.10/packages/babel-runtime-corejs3)

---
updated-dependencies:
- dependency-name: "@babel/runtime-corejs3"
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 18:51:00 +01:00
dependabot[bot]
39eded7b69
chore(deps): bump axios from 1.7.7 to 1.8.2 (#10970)
Bumps [axios](https://github.com/axios/axios) from 1.7.7 to 1.8.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.7...v1.8.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-14 18:32:20 +01:00
Sébastien Lorber
cb69b40c86
fix(theme): mobile drawer history blocker should be rendered conditionally (workaround) (#10989)
Add history blocker workaround
2025-03-14 18:22:00 +01:00
Sébastien Lorber
7cf94c03a4
feat(theme): Allow resetting colorMode to System/OS value (#10987)
* make it work

* fix

* Try to fix accessibility issues

* add translations

* rename 'auto' to 'system'

* refactor: apply lint autofix

* rename 'auto' to 'system'

* remove title prop

* typo

* use shorter title

* refactor: apply lint autofix

* document useColorMode tradeoffs + data-attribute variables

---------

Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
Co-authored-by: nasso
Co-authored-by: OzakIOne
2025-03-14 13:45:25 +01:00
pedenys
fd51384cab
docs: update external link to MDX reference (#10981)
Update markdown-features-code-blocks.mdx

Update external link to MDX reference
2025-03-13 10:53:45 +01:00
Jake Boone
549ab795c3
feat(plugin-npm2yarn): Add Bun to default tabs conversions (#10953)
* fix(plugin-npm2yarn): Add Bun as default to align with docs

* fix(plugin-npm2yarn): update test snapshot with bunx

* fix(plugin-npm2yarn): update test snapshot with bunx-create

* fix(plugin-npm2yarn): update screenshot to add pnpm and Bun

---------

Co-authored-by: Sébastien Lorber <slorber@users.noreply.github.com>
2025-03-11 09:37:01 +01:00
dependabot[bot]
e2e85e6b50
chore(deps): bump prismjs from 1.29.0 to 1.30.0 (#10978)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.29.0...v1.30.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-10 20:29:27 -04:00
Sébastien Lorber
15b0ef6d13
chore: add eslint-plugin-react-compiler (#10969)
* install ESLint plugin

* fix eslint CodeBlockLine error

* eslint

* eslint

* eslint

* refactor: apply lint autofix

* empty

---------

Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-03-07 18:04:40 +01:00
Sébastien Lorber
d33004da1e
chore: upgrade monorepo to TS 5.8 (#10966)
* Upgrade to TS 5.8

* increase build perf CI timeout values

* enable erasableSyntaxOnly

* enable erasableSyntaxOnly
2025-03-06 12:33:11 +01:00
Sébastien Lorber
dec3bcbbd7
fix(create-docusaurus): fix CLI and remove shelljs escapeShellArg util (#10958) 2025-02-28 20:09:59 +01:00
dependabot[bot]
2976dfea72
chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 (#10957)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-28 19:07:23 +01:00
Sébastien Lorber
4d3930f944
refactor: remove react-dev-utils (CRA) dependency, internalize code (#10956)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-02-28 18:49:27 +01:00
ozaki
7f4a37949e
refactor: replace unmaintained shelljs dependency by execa (#10358)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
2025-02-28 14:31:01 +01:00
Hidde de Vries
a6ef3897e0
fix(theme): only render secondaryMenu if it should be shown (#10705)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
2025-02-27 16:39:03 +01:00
Sébastien Lorber
396deedba4
fix(theme): fix useColorMode().colorMode leading to React hydration mismatches (#10954) 2025-02-27 16:32:28 +01:00
マルコメ
9d7ceec189
docs: add missing code block language to README.md (#10952) 2025-02-26 10:15:03 +01:00
kilavvy
154c95c11c
docs: typo in documentation files (#10950) 2025-02-25 13:38:38 +01:00
Joshua Chen
f31bfec3c9
fix(theme-classic): fix ThemeClassName reference (#10948) 2025-02-24 02:07:16 -05:00
Sébastien Lorber
ca035d8562
feat(theme): add theme layout stable CSS classes (#10945) 2025-02-21 19:03:49 +01:00
Yangshun Tay
c10a18d51d
misc(blog): Update Yangshun bio (#10942) 2025-02-21 12:16:03 +01:00
Sébastien Lorber
e641568e7f
feat(core): Docusaurus Faster - Rspack Persistent Cache (#10931) 2025-02-21 11:39:48 +01:00
Massoud Maboudi
5b848cb2f0
docs(showcase): Update datagit.ir showcase image, description, and tags (#10939) 2025-02-20 13:04:16 +01:00
Sébastien Lorber
cdc3ba31d9
chore(algolia): bump docsearch dependency to v3.9 (#10941) 2025-02-20 11:25:52 +01:00
dependabot[bot]
1a71b3863a
chore(deps): bump dompurify from 3.1.6 to 3.2.4 (#10937)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-18 13:30:44 +01:00
dependabot[bot]
871af414a5
chore(deps): bump preactjs/compressed-size-action from 2.7.0 to 2.8.0 (#10936)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-18 12:56:25 +01:00
Taras
75e5a00a66
docs: disable plugin-debug in production by default (#10928) 2025-02-16 15:22:59 +01:00
Sébastien Lorber
af272bdefa
fix(docs): fix mdx loader cache invalidation bug on versions changes (#10934) 2025-02-14 17:46:41 +01:00
Sébastien Lorber
a72a06ecb1
fix(plugins): add missing validateOptions types (#10929)
Co-authored-by: slorber <749374+slorber@users.noreply.github.com>
2025-02-13 15:29:51 +01:00
Milica
04f7972f32
docs: updating showcase site link (#10925) 2025-02-13 12:21:15 +01:00
John Reilly
45065e8d2b
fix(seo): docs breadcrumb structured data should use JSON-LD and filter unliked categories (#10888)
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
2025-02-07 19:03:10 +01:00