Skip to content

Commit 4be535b

Browse files
committedMar 13, 2024·
[nextra] Transpile packages to avoid module not found issue
1 parent 6caff45 commit 4be535b

File tree

3 files changed

+44
-44
lines changed

3 files changed

+44
-44
lines changed
 

‎README.md

+34-40
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# Developer Documentation
22

3-
- [Installation](#installation)
4-
- [Requirements](#requirements)
5-
- [Clone the Developer docs repo](#clone-the-developer-docs-repo)
6-
- [Build and serve the docs locally](#build-and-serve-the-docs-locally)
7-
- [Build static html files](#build-static-html-files)
8-
- [Debug/Format files](#debugging)
3+
- [Developer Documentation](#developer-documentation)
4+
- [Installation](#installation)
5+
- [Requirements](#requirements)
6+
- [Clone the Developer docs repo](#clone-the-developer-docs-repo)
7+
- [Build and serve the docs locally](#build-and-serve-the-docs-locally)
8+
- [Debugging](#debugging)
9+
- [Regenerating contributors](#regenerating-contributors)
910

1011
> Visit the `README.md` under `apps/docusaurus` for more steps on building / developing in this repo
1112
@@ -24,74 +25,67 @@ Before you proceed, make sure you install the following tools.
2425

2526
- Install [Node.js](https://nodejs.org/en/download/) by executing the below command on your Terminal:
2627

27-
```
28+
```sh
2829
brew install node
2930
```
3031

3132
- Install the latest [pnpm](https://pnpm.io/installation) by executing the below command on your Terminal:
3233

33-
```
34+
```sh
3435
curl -fsSL https://get.pnpm.io/install.sh | sh -
3536
```
3637

3738
## Clone the Developer docs repo
3839

39-
```
40+
```sh
4041
git clone https://github.com/aptos-labs/developer-docs.git
41-
4242
```
4343

4444
## Build and serve the docs locally
4545

4646
1. Run `pnpm`.
4747

48-
```
48+
```sh
4949
pnpm install
5050
```
5151

52-
This step will configure the Docusaurus static site generator.
53-
54-
2. Start the server locally. This will also open the locally built docs in your default browser.
52+
2. Build the repository
5553

56-
> **NOTE**: This step will not generate static html files, but will render the docs dynamically.
57-
58-
```
59-
pnpm start
54+
```sh
55+
pnpm build
6056
```
6157

62-
3. See your changes staged at: http://localhost:3000/
63-
64-
4. Create a pull request with your changes as described in our [Contributing](https://github.com/aptos-labs/aptos-core/blob/main/CONTRIBUTING.md) README.
65-
66-
## (Optional) Build static html files
67-
68-
Execute the below steps if you want to generate static html documentation files. A `build` directory will be created with the static html files and assets contained in it.
58+
3. Navigate to the correct subdirectory
6959

70-
1. Make sure you install dependencies.
71-
72-
```
73-
pnpm install
60+
**Docusaurus**
61+
```sh
62+
cd apps/docusaurus
7463
```
7564

76-
2. Build static html files with pnpm.
77-
78-
```
79-
pnpm build
65+
**Nextra**
66+
```sh
67+
cd apps/nextra
8068
```
8169

82-
This command generates static html content and places it in the `build` directory.
83-
84-
3. Finally, use the below command to start the documentation server on your localhost.
70+
4. Run the development server
8571

72+
**Docusaurus**
73+
```sh
74+
pnpm serve
8675
```
87-
pnpm run serve
76+
77+
**Nextra**
78+
```sh
79+
pnpm dev
8880
```
8981

82+
See the README.md in each respective app for more information
83+
9084
## Debugging
9185

9286
Fix formatting issues by running:
9387

94-
```
88+
```sh
9589
pnpm fmt
9690
```
9791

@@ -101,12 +95,12 @@ The src/contributors.json file (which powers the list of Authors at the bottom o
10195

10296
In order to generate the contributor map you must authenticate with GitHub. The best way to do that is using GitHub CLI ([installation guide(https://github.com/cli/cli#installation)]). Once you have the GitHub CLI installed, you can run the following command to authenticate:
10397

104-
```
98+
```sh
10599
gh auth login --scopes read:user,user:email
106100
```
107101

108102
Once that is done, you can generate the map with this command:
109103

110-
```
104+
```sh
111105
pnpm contributors
112106
```

‎apps/nextra/README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ The official website for [Aptos Docs](https://github.com/aptos-labs/nextra).
55
To develop locally, clone this repository and run the following command to start
66
the local dev server:
77

8+
From the root of the `developer-docs` directory, run:
89
```bash
9-
yarn
10-
yarn dev
10+
pnpm i && pnpm build
1111
```
1212

13-
And visit `localhost:3000` to preview your changes.
13+
Navigate back to `netra` and run
14+
```bash
15+
pnpm dev
16+
```
17+
18+
And visit `localhost:3030` to preview your changes.

‎apps/nextra/next.config.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ export default withBundleAnalyzer(
4848
permanent: true
4949
}
5050
],
51-
reactStrictMode: true
51+
reactStrictMode: true,
52+
transpilePackages: ['@aptos-labs/aptos-nextra-config']
5253
})
5354
)

0 commit comments

Comments
 (0)
Please sign in to comment.