-
Notifications
You must be signed in to change notification settings - Fork 28
Improve development guide #171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
EliTheGingerCat
wants to merge
11
commits into
evaera:master
Choose a base branch
from
EliTheGingerCat:docs-development
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
97fc9a7
docs: yap about the different parts of Moonwave
EliTheGingerCat 838fed5
style: normalise line after heading
EliTheGingerCat 016fc98
refactor: install dependencies right away
EliTheGingerCat b4a11dc
fix: letter outside code box
EliTheGingerCat f5ead43
fix: remove useless warning since already says to install dependencie…
EliTheGingerCat dfd496c
docs: create CONTRIBUTING.md
EliTheGingerCat 0af3f8a
style: remove some second person usage
EliTheGingerCat fd3ced1
fix: remove `/website` navigation
EliTheGingerCat e9cb188
fix: remove exclamation mark section
EliTheGingerCat 3247549
fix: use headings
EliTheGingerCat cfeb8eb
docs: split into subsections
EliTheGingerCat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Development Guide | ||
|
|
||
| Requirements: | ||
| - [Node.js 18+](https://nodejs.org/en/) | ||
| - [Rust 1.75.0 and Cargo](https://rustup.rs/) | ||
| - [Cargo Insta](https://insta.rs/docs/cli/) | ||
|
|
||
| It is best to install all dependencies immediately. | ||
| 1. Clone this repository by running `git clone https://github.com/evaera/moonwave` | ||
| 2. In `/cli`, run `npm i`, `npm run tsc`, and `npm link` | ||
| 3. In `/docusaurus-plugin-moonwave`, run `npm i` | ||
| 4. In `/extractor`, run `cargo install --path . --locked` | ||
| 5. In `/website`, run `npm i` | ||
|
|
||
| ## Extractor | ||
|
|
||
| The Extractor in Moonwave is a Rust program which parses documentation comments in Lua source code and outputs JSON to represent the Moonwave doc entries defined in those comments. | ||
|
|
||
| ### Using in Development | ||
|
|
||
| Every time it is edited, rerun `cargo install --path . --locked` to update your local `moonwave-extractor` executable. | ||
|
|
||
| ### Testing | ||
|
|
||
| It is necessary to run tests to ensure that the changes made to the Extractor are correct. If your contribution involves modifying the Extractor's output, then add new tests. In `/extractor`, run all the tests with `cargo test`, and if there are changes, run `cargo insta review`. | ||
|
|
||
| ## Command Line Interface | ||
|
|
||
| The CLI is the user-facing interface of Moonwave, written in TypeScript, which handles project configuration and interacts with both the Extractor and Docusaurus Plugin to build and deploy Moonwave documentation websites. | ||
|
|
||
| ### Using in Development | ||
|
|
||
| It is recommended to use `moonwave dev` with the environment variable `MOONWAVE_DEV=1`, which will utilise the local version of the Extractor and the Docusaurus Plugin. | ||
|
|
||
| ### Live Reloading | ||
|
|
||
| In `/cli`, use `npm run dev` to automatically recompile the CLI every time a file is changed. This means that the next time a Moonwave command is executed, it will use the latest changes. Keep in mind that although `moonwave dev` supports hot reload for Luau files, it does not reload for the CLI, so it is necessary to rerun the command every time the Command Line Interface is updated. | ||
|
|
||
| ## Docusaurus Plugin | ||
|
|
||
| Moonwave integrates with Docusaurus via a JavaScript Plugin which adds an API section to the website, generating a separate page for each Luau class. It uses both custom React components as well as Docusaurus components and features. | ||
|
|
||
| See https://docusaurus.io/ | ||
|
|
||
| ### Live Reloading | ||
|
|
||
| Using `moonwave dev` in development mode will set a local path in `package.json`, enabling hot reload for this package. | ||
|
|
||
| ### Agnostisation | ||
|
|
||
| *(the act of making agnostic)* | ||
|
|
||
| It is a goal to make this package fully agnostic towards Docusaurus so that the components can be used in any React environment. | ||
|
|
||
| See https://github.com/evaera/moonwave/issues/47 | ||
|
|
||
| ## Official Moonwave website | ||
|
|
||
| Moonwave has its own [website](https://eryn.io/moonwave/) that documents usage of the tool. In `/website`, use `npm run start` to locally view the website. Hot reload is supported. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.