Skip to content

Commit c6db33b

Browse files
authored
Merge pull request #446 from software-mansion/@patrycjakalinska/prepare-for-stable-t-rex
docs: Bump t-rex to stable with Docusaurus 3.7
2 parents a170a85 + 5998e2b commit c6db33b

11 files changed

+4333
-2244
lines changed

packages/audiodocs/docs/guides/lets-make-some-noise.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ import LetsMakeSomeNoiseSrc from '!!raw-loader!@site/src/examples/LetsMakeSomeNo
108108
In this guide, we have learned how to create a simple audio player using [`AudioContext`](/core/audio-context) and [``AudioBufferSourceNode``](/sources/audio-buffer-source-node) as well as how we can load audio data from a remote source. To sum up:
109109

110110
- `AudioContext` is the main object that controls the audio graph.
111-
- the [`decodeAudioData`](/core/base-audio-context#decodeaudiodata) method can be used to load audio data from a remote resource in the form of an [`AudioBuffer`](sources/audio-buffer).
111+
- the [`decodeAudioData`](/core/base-audio-context#decodeaudiodata) method can be used to load audio data from a remote resource in the form of an [`AudioBuffer`](/sources/audio-buffer).
112112
- `AudioBufferSourceNode` can be used with any `AudioBuffer`.
113113
- In order to hear the sounds, we need to connect the source node to the destination node exposed by `AudioContext`.
114114
- We can control the playback of the sound using [`start`](/sources/audio-buffer-source-node#start) and [`stop`](/sources/audio-scheduled-source-node#stop) methods of the `AudioBufferSourceNode` (and other source nodes, which we will show later).

packages/audiodocs/docs/guides/noise-generation.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ The last noise type I would like to describe is brownian noise (also known as Br
8989

9090
Brownian noise, similarly to pink one, decreases in power by $\dfrac{12dB}{octave}$ and sounds similar to waterfall. The implementation is taken from article by Zach Denton, [How to Generate Noise with the Web Audio API](https://noisehack.com/generate-noise-web-audio-api/):
9191

92+
9293
```tsx
9394
const createBrownianNoise = () => {
9495
const aCtx = new AudioContext();

packages/audiodocs/docs/sources/audio-buffer.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ specific sample rate which is the quantity of frames that will play in one secon
1313
![](/img/audioBuffer.png)
1414

1515
It can be created from audio file using `decodeAudioData`, `decodeAudioDataSource` or from raw data using `constructor`.
16-
Once you have data in `AudioBuffer`, audio can be played by passing it to [`AudioBufferSourceNode`](/sources/audio-buffer-source-node).
16+
Once you have data in `AudioBuffer`, audio can be played by passing it to [`AudioBufferSourceNode`](audio-buffer-source-node).
1717

1818
## Constructor
1919

packages/audiodocs/docusaurus.config.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
const lightCodeTheme = require('./src/theme/CodeBlock/highlighting-light.js');
55
const darkCodeTheme = require('./src/theme/CodeBlock/highlighting-dark.js');
6-
const math = require('remark-math');
7-
const katex = require('rehype-katex');
6+
import remarkMath from 'remark-math';
7+
import rehypeKatex from 'rehype-katex';
88
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
99

1010
const webpack = require('webpack');
@@ -44,8 +44,8 @@ const config = {
4444
breadcrumbs: false,
4545
sidebarCollapsible: false,
4646
sidebarPath: require.resolve('./sidebars.js'),
47-
remarkPlugins: [math],
48-
rehypePlugins: [katex],
47+
remarkPlugins: [remarkMath],
48+
rehypePlugins: [rehypeKatex],
4949
editUrl:
5050
'https://github.com/software-mansion/react-native-audio-api/edit/main/packages/audiodocs/docs',
5151
},
@@ -109,6 +109,7 @@ const config = {
109109
copyright: `All trademarks and copyrights belong to their respective owners.`,
110110
},
111111
prism: {
112+
additionalLanguages: ['bash'],
112113
theme: lightCodeTheme,
113114
darkTheme: darkCodeTheme,
114115
},
@@ -127,26 +128,26 @@ const config = {
127128

128129
const raf = require('raf');
129130
raf.polyfill();
130-
131+
131132
return {
132133
mergeStrategy: {
133134
'resolve.extensions': 'prepend',
134135
},
135136
plugins: [
136137
new webpack.DefinePlugin({
137-
...processMock,
138-
__DEV__: 'false',
139-
setImmediate: () => {},
138+
...processMock,
139+
__DEV__: 'false',
140140
}),
141141
],
142142
module: {
143143
rules: [
144144
{
145-
test: /\.txt/,
145+
test: /\.txt$/,
146146
type: 'asset/source',
147147
},
148148
{
149149
test: /\.tsx?$/,
150+
use: 'babel-loader',
150151
},
151152
],
152153
},

packages/audiodocs/package.json

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,47 +21,48 @@
2121
"@babel/preset-env": "^7.23.2",
2222
"@babel/preset-react": "^7.18.6",
2323
"@babel/preset-typescript": "^7.21.0",
24-
"@docusaurus/core": "^2.4.3",
25-
"@docusaurus/plugin-debug": "^2.4.3",
26-
"@docusaurus/preset-classic": "^2.4.3",
27-
"@docusaurus/theme-mermaid": "^2.4.3",
28-
"@emotion/react": "^11.10.6",
29-
"@emotion/styled": "^11.10.6",
30-
"@mdx-js/react": "^1.6.22",
31-
"@mui/material": "^5.12.0",
32-
"@swmansion/t-rex-ui": "^0.0.13",
24+
"@docusaurus/core": "3.7.0",
25+
"@docusaurus/plugin-debug": "3.7.0",
26+
"@docusaurus/preset-classic": "3.7.0",
27+
"@docusaurus/theme-mermaid": "3.7.0",
28+
"@emotion/react": "^11.14.0",
29+
"@emotion/styled": "^11.14.0",
30+
"@mdx-js/react": "^3.0.0",
31+
"@mui/material": "^7.1.0",
3332
"@shopify/react-native-skia": "1.10.2",
33+
"@swmansion/t-rex-ui": "1.0.0",
3434
"@vercel/og": "^0.6.2",
3535
"babel-polyfill": "^6.26.0",
3636
"babel-preset-expo": "^9.2.2",
37-
"clsx": "^1.2.1",
37+
"clsx": "^2.1.0",
3838
"hast-util-is-element": "1.1.0",
39+
"prism-react-renderer": "^2.1.0",
3940
"raf": "^3.4.1",
4041
"raw-loader": "^4.0.2",
41-
"react": "^17.0.2",
42+
"react": "^18.2.0",
4243
"react-colorful": "^5.6.1",
43-
"react-dom": "^17.0.2",
44+
"react-dom": "^18.2.0",
4445
"react-draggable": "^4.4.5",
4546
"react-native": "^0.71.4",
4647
"react-native-audio-api": "0.5.6",
4748
"react-native-gesture-handler": "^2.16.0",
4849
"react-native-reanimated": "^3.8.1",
4950
"react-native-web": "^0.18.12",
50-
"rehype-katex": "5",
51-
"remark-math": "3",
51+
"rehype-katex": "7",
52+
"remark-math": "6",
5253
"source-map": "^0.7.4",
5354
"source-map-loader": "^4.0.1",
5455
"usehooks-ts": "^2.9.1"
5556
},
5657
"devDependencies": {
57-
"@docusaurus/module-type-aliases": "^2.4.3",
58-
"@tsconfig/docusaurus": "^1.0.7",
58+
"@docusaurus/module-type-aliases": "^3.7.0",
59+
"@docusaurus/tsconfig": "3.7.0",
5960
"copy-webpack-plugin": "^11.0.0",
6061
"esbuild": "^0.20.2",
6162
"esbuild-register": "^3.5.0",
6263
"eslint-plugin-mdx": "^2.2.0",
6364
"prettier": "^2.8.4",
64-
"typescript": "^4.7.4",
65+
"typescript": "~5.2.2",
6566
"typescript-eslint": "^8.18.0",
6667
"webpack-cli": "^5.0.1"
6768
},

packages/audiodocs/src/theme/CodeBlock/CodeBlock/highlighting-dark.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

packages/audiodocs/src/theme/CodeBlock/CodeBlock/highlighting-light.js

Lines changed: 0 additions & 66 deletions
This file was deleted.

packages/audiodocs/src/theme/CodeBlock/highlighting-dark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const darkTheme = require('prism-react-renderer/themes/github');
1+
const darkTheme = require('prism-react-renderer').themes.github;
22

33
module.exports = {
44
...darkTheme,

packages/audiodocs/src/theme/CodeBlock/highlighting-light.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const lightTheme = require('prism-react-renderer/themes/github');
1+
const lightTheme = require('prism-react-renderer').themes.github;
22

33
module.exports = {
44
...lightTheme,

packages/audiodocs/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// This file is not used in compilation. It is here just for a nice editor experience.
3-
"extends": "@tsconfig/docusaurus/tsconfig.json",
3+
"extends": "@docusaurus/tsconfig",
44
"compilerOptions": {
55
"baseUrl": "."
66
},

0 commit comments

Comments
 (0)