Skip to content

Commit 86660d7

Browse files
artus9033jbroma
andauthored
chore: upgrade docs to new Callstack rspress theme (#68)
* chore: upgrade to new Callstack rspress theme * chore: nohoist for docs (#69) * feat: migrate to new callstack theme & use default mdx home screen * fix: style fixes * fix: errors with default LinkCard impl; re-export components from CK theme in @theme * refactor: migrate from custom workaround for execution prefixes in PackageManagerTabs * chore: comply with biome in docs * chore: lint docs with biome on pre-commit * ci: lint docs in CI --------- Co-authored-by: Jakub Romańczyk <lorczyslav@gmail.com>
1 parent bfd1e64 commit 86660d7

35 files changed

+1981
-1878
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
const config = {
33
root: true,
44
extends: ['@callstack'],
5-
ignorePatterns: ['node_modules/', '**/node_modules/', 'lib/', '**/lib/', 'build/', '**/build/'],
5+
ignorePatterns: ['node_modules/', '**/node_modules/', 'lib/', '**/lib/', 'build/', '**/build/', 'docs/**'],
66
rules: {
77
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
88
'@typescript-eslint/consistent-type-imports': ['error'],

.github/workflows/lint-docs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Lint docs
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
paths:
7+
- '.github/workflows/lint-docs.yml'
8+
- 'docs/**/*.{md,mdx,js,ts,jsx,tsx}'
9+
10+
concurrency: ${{ github.workflow }}-${{ github.ref }}
11+
12+
jobs:
13+
lint-docs:
14+
name: Lint docs
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup
23+
uses: ./.github/actions/setup
24+
25+
- name: Run linter
26+
run: yarn lint:docs

docs/components/CustomHomePage.tsx

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

docs/components/PackagesPresentation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { LinkCard } from 'rspress/theme';
1+
import { LinkCard } from '@theme';
22

33
export function PackagesPresentation() {
44
return (
File renamed without changes.

docs/docs/docs/react-native.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ sidebar_position: 2
33
---
44

55
import { PackageManagerTabs, Badge } from '@theme';
6-
import { generateExecCommands } from '@utils/generateExecCommands';
76

87
# React Native Legal
98

@@ -35,11 +34,11 @@ If you are using Expo, you need to add the config plugin to your `app.json` or `
3534

3635
After adding the plugin, rebuild your app using either:
3736

38-
<PackageManagerTabs command={generateExecCommands('expo prebuild')} />
37+
<PackageManagerTabs command="expo prebuild" exec />
3938

4039
or
4140

42-
<PackageManagerTabs command={generateExecCommands('eas build')} />
41+
<PackageManagerTabs command="eas build" exec />
4342

4443
This will ensure the required native dependencies are included.
4544

@@ -51,7 +50,7 @@ This library **cannot be used** in [Expo Go](https://expo.dev/go) because it req
5150

5251
For bare React Native projects, you need to run the CLI plugin to generate and include license data. Run the following command from your project root:
5352

54-
<PackageManagerTabs command={generateExecCommands('react-native legal-generate')} />
53+
<PackageManagerTabs command="react-native legal-generate" exec />
5554

5655
This will extract and prepare license metadata for use in your app.
5756

docs/docs/index.mdx

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,55 @@
11
---
2-
pageType: custom
3-
---
4-
5-
import { CustomHomePage } from '@components/CustomHomePage';
2+
pageType: home
63

7-
<CustomHomePage />
4+
hero:
5+
name: |
6+
<span class="hero-name">React Native Legal</span>
7+
<br/>
8+
<span class="hero-name">License Kit</span>
9+
tagline: |
10+
<span class="hero-tagline" style="line-height: 1.4;">
11+
Automagically generate license acknowledgements
12+
for your <ins>React Native app</ins> & <ins>any Node.js</ins> project
13+
</span>
14+
actions:
15+
- theme: 'brand'
16+
text: 'React Native'
17+
link: '/docs/react-native'
18+
- theme: 'brand'
19+
text: 'CLI'
20+
link: '/docs/standalone-cli'
21+
- theme: 'brand'
22+
text: 'API'
23+
link: '/docs/programmatic-usage'
24+
- theme: 'alt'
25+
text: 'GitHub'
26+
link: 'https://github.com/callstackincubator/react-native-legal'
27+
image:
28+
src: /notice.png
29+
alt: RN Legal Logo
30+
features:
31+
- title: 'Native Integration'
32+
details: 'Uses native platform tools (LicensePlist for iOS and AboutLibraries for Android) to generate and display licenses.'
33+
icon: '📱'
34+
link: '/docs/react-native'
35+
- title: 'Expo & Bare Workflow Support'
36+
details: 'Works with both Expo managed workflow via Config Plugin and React Native CLI via custom command.'
37+
icon: '🔌'
38+
link: '/docs/react-native#setup'
39+
- title: 'NodeJS / Non-RN Projects Support'
40+
details: 'Works with any Node.js project, not just React Native apps. Use it to generate license reports for any Node.js application.'
41+
icon: '💻'
42+
link: '/docs/standalone-cli'
43+
- title: 'Versatile output formats (CLI & Programmatic)'
44+
details: 'Generate license reports in a format of choice (JSON, Markdown, raw text, AboutLibraries-compatible JSON metadata).'
45+
icon: '📝'
46+
link: '/docs/standalone-cli#command-line-options'
47+
- title: 'Programmatic API'
48+
details: 'Core functionalities are exposed as an importable package you can use programmatically and adjust the presentation / processing of the report contents.'
49+
icon: '🛠️'
50+
link: '/docs/programmatic-usage'
51+
- title: 'Automatic Scanning'
52+
details: 'Automatically scans your dependencies and generates license information for both iOS and Android platforms.'
53+
icon: '🔎'
54+
link: '/docs/react-native'
55+
---

docs/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
},
88
"scripts": {
99
"build": "rspress build",
10-
"check": "biome check --write",
10+
"check": "biome check",
11+
"fix": "biome check --write",
1112
"dev": "rspress dev",
1213
"format": "biome format --write",
1314
"preview": "rspress preview"
1415
},
1516
"dependencies": {
16-
"@callstack/rspress-theme": "^0.0.2",
17-
"rspress": "1.44.0"
17+
"@callstack/rspress-theme": "^0.1.3",
18+
"rspress": "^2.0.0-beta.20"
1819
},
1920
"devDependencies": {
2021
"@biomejs/biome": "^1.9.4",
21-
"@rspress/plugin-typedoc": "1.44.0",
22+
"@rspress/plugin-typedoc": "^2.0.0-beta.20",
2223
"@types/node": "^18.11.17"
2324
}
2425
}

docs/rspress.config.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ export default defineConfig({
2727
plugins: [
2828
pluginCallstackTheme(),
2929
pluginTypeDoc({
30-
entryPoints: [path.join(__dirname, '..', 'packages', 'licenses-api', 'src', 'index.ts')],
30+
entryPoints: [
31+
path.join(
32+
__dirname,
33+
'..',
34+
'packages',
35+
'licenses-api',
36+
'src',
37+
'index.ts',
38+
),
39+
],
3140
outDir: 'api',
3241
}),
3342
],

docs/styles/globalStyles.css

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,50 @@
2828
text-align: center;
2929
margin-top: 40;
3030
margin-bottom: 40;
31+
display: flex;
32+
justify-content: center;
33+
align-items: center;
34+
}
35+
36+
/* == Introduction page styles section end == */
37+
38+
/* == Theme styles section start == */
39+
40+
img#logo {
41+
width: auto !important;
42+
height: 1.6rem !important;
3143
}
3244

33-
.home-footer-wrapper {
34-
position: relative;
35-
margin-top: 140;
45+
img[class*="heroImage-"] {
46+
max-height: unset !important;
47+
height: 100px;
3648
}
3749

38-
/* == Introduction page styles section end == */
50+
div[class*="container-"] {
51+
/* so as not to limit the height of the container */
52+
height: unset !important;
53+
/* slight paddin from the top */
54+
padding-top: 1rem !important;
55+
}
56+
57+
/* Theme styles section end == */
58+
59+
/* == Callstack rspress theme styles section start == */
60+
61+
@font-face {
62+
font-family: "Alliance No. 2";
63+
font-style: normal;
64+
font-weight: 400;
65+
font-display: swap;
66+
/* src: url('./fonts/alliance-no-2-regular.ttf') format('truetype'); */
67+
}
68+
69+
@font-face {
70+
font-family: "Alliance No. 2";
71+
font-style: normal;
72+
font-weight: 500;
73+
font-display: swap;
74+
/* src: url('./fonts/alliance-no-2-medium.ttf') format('truetype'); */
75+
}
76+
77+
/* Callstack rspress theme styles section end */

0 commit comments

Comments
 (0)