Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ jobs:
with:
node-version: 22
cache: yarn
cache-dependency-path: docs/yarn.lock
cache-dependency-path: |
yarn.lock
docs/yarn.lock

- name: Install library dependencies (local source)
working-directory: ${{ github.workspace }}
run: yarn install --immutable

- name: Install dependencies
run: yarn install --immutable
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/docs-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ jobs:
with:
node-version: 22
cache: yarn
cache-dependency-path: docs/yarn.lock
cache-dependency-path: |
yarn.lock
docs/yarn.lock

- name: Install library dependencies (local source)
working-directory: ${{ github.workspace }}
run: yarn install --immutable

- name: Install dependencies
run: yarn install --immutable
Expand Down
42 changes: 39 additions & 3 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import { topbarBannerReservationScript } from '@swmansion/t-rex-ui/topbar-banner';
import { TOP_BAR_BANNER } from './src/components/topbarBanner.config.ts';

const path = require('path');

const lightCodeTheme = require('./src/theme/CodeBlock/highlighting-light.js');
const darkCodeTheme = require('./src/theme/CodeBlock/highlighting-dark.js');

Expand All @@ -22,6 +24,38 @@ function reactNativeWebPlugin() {
};
}

function enrichedHtmlLocalSourcePlugin() {
const librarySource = path.resolve(__dirname, '../src');
return {
name: 'enriched-html-local-source',
configureWebpack(_config, isServer, utils) {
return {
module: {
rules: [
{
test: /\.tsx?$/,
include: librarySource,
use: [utils.getJSLoader({ isServer })],
},
],
},
resolve: {
alias: {
'react-native-enriched-html$': path.resolve(
librarySource,
'index.tsx'
),
// The react-native-enriched-html has separate react and react-dom dependencies in node_modules,
// so React would otherwise be resolved from the repo root and bundled twice.
'react': path.resolve(__dirname, 'node_modules/react'),
'react-dom': path.resolve(__dirname, 'node_modules/react-dom'),
},
},
};
},
};
}

const firstBannerZone = TOP_BAR_BANNER.zones[0];
const bannerReservationHeadTags = firstBannerZone
? [
Expand Down Expand Up @@ -103,6 +137,7 @@ const config = {

plugins: [
reactNativeWebPlugin,
enrichedHtmlLocalSourcePlugin,
function transpileTRexUiTheme() {
return {
name: 'transpile-t-rex-ui-theme',
Expand Down Expand Up @@ -160,9 +195,10 @@ const config = {
dropdownActiveClassDisabled: true,
},
{
href: 'https://github.com/software-mansion/react-native-enriched-html/',
position: 'right',
className: 'header-github',
'href':
'https://github.com/software-mansion/react-native-enriched-html/',
'position': 'right',
'className': 'header-github',
'aria-label': 'GitHub repository',
},
],
Expand Down
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"react": "19.1.1",
"react-dom": "19.1.1",
"react-native": "0.86.0",
"react-native-enriched-html": "1.0.1",
"react-native-web": "0.21.2"
},
"resolutions": {
Expand Down
12 changes: 12 additions & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@site/*": ["./*"],
"react-native-enriched-html": ["../src/index.tsx"],
},
},
"exclude": [".docusaurus", "build"],
"include": ["src/examples"],
}
Loading
Loading