Skip to content
Merged
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
1,576 changes: 510 additions & 1,066 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@
"diff:v3-v4:mjs": "git diff @callstack/repack@3.0.0:templates/webpack.config.mjs HEAD:templates/webpack.config.mjs > src/public/diffs/repack_v3-v4_mjs.diff"
},
"dependencies": {
"@callstack/rspress-theme": "^0.3.1",
"@rspress/plugin-llms": "2.0.0-beta.21",
"rsbuild-plugin-open-graph": "^1.0.2",
"rspress": "2.0.0-beta.21",
"rspress-plugin-sitemap": "^1.1.1",
"rspress-plugin-vercel-analytics": "^0.3.0"
"@callstack/rspress-preset": "^0.4.1",
"@callstack/rspress-theme": "^0.4.1",
"@rspress/core": "2.0.0-beta.32"
},
"devDependencies": {
"@types/node": "catalog:",
Expand Down
163 changes: 51 additions & 112 deletions website/rspress.config.ts
Original file line number Diff line number Diff line change
@@ -1,126 +1,65 @@
import * as path from 'node:path';
import { pluginCallstackTheme } from '@callstack/rspress-theme/plugin';
import { pluginLlms } from '@rspress/plugin-llms';
import { pluginOpenGraph } from 'rsbuild-plugin-open-graph';
import pluginSitemap from 'rspress-plugin-sitemap';
import vercelAnalytics from 'rspress-plugin-vercel-analytics';
import { defineConfig } from 'rspress/config';
import { withCallstackPreset } from '@callstack/rspress-preset';

const LATEST_VERSION = 'v5';

const DOCS_ROOT = path.join('src', process.env.REPACK_DOC_VERSION ?? 'latest');
const EDIT_ROOT_URL = `https://github.com/callstack/repack/tree/main/website/${DOCS_ROOT}`;

export default defineConfig({
root: path.join(__dirname, DOCS_ROOT),
outDir: 'build',
title: process.env.REPACK_DOC_VERSION
? `[${process.env.REPACK_DOC_VERSION}] Re.Pack`
: 'Re.Pack',
description:
'A modern build tool for React Native that brings the Rspack and webpack ecosystem to mobile React Native apps',
icon: '/img/favicon.ico',
logo: {
light: '/img/logo-light.png',
dark: '/img/logo-dark.png',
},
markdown: {
checkDeadLinks: true,
},
route: {
cleanUrls: true,
},
search: {
versioned: true,
codeBlocks: true,
},
themeConfig: {
enableContentAnimation: true,
enableScrollToTop: true,
outlineTitle: 'Contents',
footer: {
message: `Copyright © ${new Date().getFullYear()} Callstack Open Source`,
},
editLink: {
docRepoBaseUrl: EDIT_ROOT_URL,
text: 'Edit this page on GitHub',
},
socialLinks: [
{
icon: 'github',
mode: 'link',
content: 'https://github.com/callstack/repack',
},
{
icon: 'X',
mode: 'link',
content: 'https://x.com/repack_rn',
export default withCallstackPreset(
{
context: __dirname,
docs: {
description:
'A modern build tool for React Native that brings the Rspack and webpack ecosystem to mobile React Native apps',
editUrl: EDIT_ROOT_URL,
icon: '/img/favicon.ico',
logoDark: '/img/logo-dark.png',
logoLight: '/img/logo-light.png',
ogImage: '/img/og-image.jpg',
rootDir: DOCS_ROOT,
rootUrl: 'https://re-pack.dev',
socials: {
github: 'https://github.com/callstack/repack',
x: 'https://x.com/repack_rn',
discord: 'https://discord.gg/TWDBep3nXV',
},
{
icon: 'discord',
mode: 'link',
content: 'https://discord.gg/TWDBep3nXV',
},
],
title: process.env.REPACK_DOC_VERSION
? `[${process.env.REPACK_DOC_VERSION}] Re.Pack`
: 'Re.Pack',
},
},
builderConfig: {
source: {
define: {
'global.__REPACK_DOC_VERSION__': JSON.stringify(
process.env.REPACK_DOC_VERSION
),
'global.__REPACK_DOC_LATEST_VERSION__': JSON.stringify(LATEST_VERSION),
},
{
outDir: 'build',
globalStyles:
process.env.REPACK_DOC_VERSION !== 'v2' &&
process.env.REPACK_DOC_VERSION !== 'v3' &&
process.env.REPACK_DOC_VERSION !== 'v4'
? path.join(__dirname, 'theme', 'styles.css')
: undefined,
themeConfig: {
enableScrollToTop: true,
},
output: {
distPath: {
// set explicitly for sitemap plugin
root: 'build',
builderConfig: {
source: {
define: {
'global.__REPACK_DOC_VERSION__': JSON.stringify(
process.env.REPACK_DOC_VERSION
),
'global.__REPACK_DOC_LATEST_VERSION__':
JSON.stringify(LATEST_VERSION),
},
},
},
plugins: [
pluginOpenGraph({
title: 'Re.Pack',
type: 'website',
url: 'https://re-pack.dev',
image: 'https://re-pack.dev/img/og-image.jpg',
description: 'A modern build tool for React Native',
twitter: {
site: '@repack_rn',
card: 'summary_large_image',
tools: {
rspack(_config, { addRules }) {
addRules([
{
resourceQuery: /raw/,
type: 'asset/source',
},
]);
},
}),
],
tools: {
rspack(_config, { addRules }) {
addRules([
{
resourceQuery: /raw/,
type: 'asset/source',
},
]);
},
},
},
globalStyles:
process.env.REPACK_DOC_VERSION !== 'v2' &&
process.env.REPACK_DOC_VERSION !== 'v3' &&
process.env.REPACK_DOC_VERSION !== 'v4'
? path.join(__dirname, 'theme', 'styles.css')
: undefined,
plugins: [
// @ts-ignore
pluginSitemap({
domain: 'https://re-pack.dev',
}),
// @ts-ignore
vercelAnalytics(),
// @ts-ignore
pluginCallstackTheme(),
pluginLlms({
exclude: ({ page }) => {
return page.routePath.includes('404');
},
}),
],
});
}
);
2 changes: 1 addition & 1 deletion website/src/latest/api/cli/bundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

In the root of an existing project, run this command in your terminal of choice:

import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

<PackageManagerTabs command={{
npm: 'npm run react-native bundle',
Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/api/cli/start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

In the root of an existing React Native project with Re.Pack, run this command in your terminal of choice:

import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

<PackageManagerTabs command={{
npm: "npm run react-native start",
Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/api/plugins/module-federation-v2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The plugin extends the standard Module Federation 2.0 plugin with functionality

First, install the official `@module-federation/enhanced` package which is required by Re.Pack:

import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

<PackageManagerTabs command="install @module-federation/enhanced" />

Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/features/dev-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ For complete DevServer configuration options and API reference, check out the [D

To start the dev server, you can use the following command:

import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

<PackageManagerTabs command={{
npm: "npm run react-native start",
Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/features/nativewind.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

# NativeWind

Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/features/reanimated.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

# React Native Reanimated

Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/getting-started/quick-start.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs, Steps, Tabs, Tab } from 'rspress/theme';
import { PackageManagerTabs, Steps, Tabs, Tab } from '@theme';

# Quick start

Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/guides/bundle-analysis.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Bundle analysis is a crucial process that helps you understand your app's perfor

### Installation

import { PackageManagerTabs, Tabs, Tab } from 'rspress/theme';
import { PackageManagerTabs, Tabs, Tab } from '@theme';

<Tabs groupId="bundler">
<Tab label="Rspack" value="rspack">
Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/guides/configuration.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tab, Tabs } from 'rspress/theme';
import { Tab, Tabs } from '@theme';
import { CodeBlock } from '@theme';
import RspackCJSTemplate from '../../../../../templates/rspack.config.cjs?raw';
import RspackESMTemplate from '../../../../../templates/rspack.config.mjs?raw';
Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/guides/deploy.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs } from 'rspress/theme';
import { PackageManagerTabs } from '@theme';

# Deployment

Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/guides/expo-modules.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs, Steps } from 'rspress/theme';
import { PackageManagerTabs, Steps } from '@theme';

# Expo Modules

Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/migration-guides/metro.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs, Steps, Tabs, Tab } from 'rspress/theme';
import { PackageManagerTabs, Steps, Tabs, Tab } from '@theme';
import { CodeBlock } from '@theme';
import RspackCJSTemplate from '../../../../../templates/rspack.config.cjs?raw';
import RspackESMTemplate from '../../../../../templates/rspack.config.mjs?raw';
Expand Down
2 changes: 1 addition & 1 deletion website/src/latest/docs/migration-guides/rspack.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs, Steps, Tabs, Tab } from 'rspress/theme';
import { PackageManagerTabs, Steps, Tabs, Tab } from '@theme';

# Migrating to Rspack

Expand Down
2 changes: 1 addition & 1 deletion website/src/v2/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 1
---

import { Tab, Tabs } from 'rspress/theme';
import { Tab, Tabs } from '@theme';

# Getting Started

Expand Down
2 changes: 1 addition & 1 deletion website/src/v3/docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 1
---

import { Tab, Tabs } from 'rspress/theme';
import { Tab, Tabs } from '@theme';

# Getting Started

Expand Down
2 changes: 1 addition & 1 deletion website/src/v4/docs/getting-started.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PackageManagerTabs, Steps } from 'rspress/theme';
import { PackageManagerTabs, Steps } from '@theme';

# Getting Started

Expand Down
10 changes: 7 additions & 3 deletions website/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { PrevNextPage, VersionBadge } from '@callstack/rspress-theme';
import { NoSSR } from 'rspress/runtime';
import { CodeBlockRuntime, Link, Layout as RspressLayout } from 'rspress/theme';
import { NoSSR } from '@rspress/core/runtime';
import {
CodeBlockRuntime,
Link,
Layout as RspressLayout,
} from '@rspress/core/theme';

const OldVersionAnnouncement = ({ version, latestVersion }) => (
<div className="py-2 px-4 flex flex-col sm:flex-row items-center justify-center bg-amber-50 text-amber-900 border-b border-amber-200 text-sm">
Expand Down Expand Up @@ -56,4 +60,4 @@ const CustomPrevNextPage = (props) => {

export { CustomPrevNextPage as PrevNextPage };

export * from 'rspress/theme';
export * from '@rspress/core/theme';