Skip to content

Commit

Permalink
docs: documentation updates (electrode-io#1922)
Browse files Browse the repository at this point in the history
* docs: update readme and contribution guidelines

* docs: documentation and contribution guidelines updated

* docs: update release guidelines

* docs: update release guidelines
  • Loading branch information
arunvishnun committed Mar 24, 2023
1 parent 776374f commit 0891ab3
Show file tree
Hide file tree
Showing 58 changed files with 9,734 additions and 13,944 deletions.
72 changes: 37 additions & 35 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,19 @@ There are [few guidelines](#contributing-guidelines) that we request contributor

## Getting Started

This repo uses a custom [Lerna] mono-repo setup with [fyn] as package manager to install and local linking node modules.
This is a mono-repo and we use [rushjs] for mono-repo management. Also, we use [pnpm] as the package manager along with [rushjs].
To read more about [rushjs with pnpm]

### Setup

This is a mono-repo and we use [fyn] to install and local linking packages when doing development. You can use `npm run`, but never use `npm install` in our repo else things will break. Below, `fun` is an alias for `npm run` that [fyn] provides.

Install some CLI tools globally for convenience:

```bash
$ npm install -g xclap-cli @xarc/run-cli fyn
```

Fork and clone the repo at <https://github.com/electrode-io/electrode.git> and bootstrap all the packages.

```bash
$ git clone https://github.com/<your-github-id>/electrode.git
$ cd electrode
$ fyn # install node_modules
$ fun bootstrap # run npm script bootstrap
$ npm install -g @microsoft/rush # install rush
$ rush install # installs package dependencies for all packages, based on the shrinkwrap file (pnpm-lock) that got created/updated using rush update.
$ rush build # Run build command on all projects whose source files have changed since the last successful build
```

### Try a sample
Expand All @@ -33,8 +27,7 @@ Now you can go to the `samples` folder and try the `create-app-demo` sample app,

```bash
$ cd samples/create-app-demo
$ fyn
$ fun dev
$ rushx dev
```

You should see some output in the console with `[DEV ADMIN]`. You can press `M` for the dev menu.
Expand All @@ -43,19 +36,19 @@ And when you open the browser at `http://localhost:3000`, you should see the dem

### **Useful** Notes

- You should bootstrap the entire repo at the top dir at least once with `fun bootstrap`
- After you make changes to any module under packages, if you want to test them in one of the samples, just run [fyn] in that sample and it will ensure all changed local packages are properly rebuilt and installed.
- You should bootstrap the entire repo at the top dir at least once with `rush install`
- After you make changes to any module under packages, if you want to test them in one of the samples, just run `` rushx <command>`` in that sample and it will ensure all changed local packages are properly rebuilt and installed.

#### Test with `@xarc/create-app`

You can quickly use the `xarc-create-app` package to create an app for testing.

```bash
$ cd samples
$ node ../packages/xarc-create-app/src my-test-app
$ cd my-test-app
$ fyn
$ fun dev
$ cd samples && node ../packages/xarc-create-app/src my-test-app
$ cd ../ && rush update
$ cd samples/my-test-app
$
$ rushx dev
```

## Contributing Guidelines
Expand Down Expand Up @@ -99,34 +92,43 @@ If you need help or found an issue, please [submit a github issue](https://githu

Our docs use [docusaurus]. The source is in the directory `/docusaurus`. It's generated to `/docs` and published as github docs at <https://www.electrode.io/electrode>.

To edit the docs:
### To run the docs locally:

```bash
$ cd docusaurus
$ fyn
$ fun start
$ pnpm install
$ pnpm start
```

And open your browser to `http://localhost:4000` to view the docs locally.

### To generate documentations to `/docs`:

```bash
$ cd docusaurus
$ pnpm run deploy
```

## Releasing

The versioning of modules in the this repo are all automatically controlled by the commit message.
- Run `rush change` for any PRs with changes that needs to get released
This will provide an interactive screen to add Change description. Please provide details here about the changes you are making thorugh this PR
This will generate a change files in JSON format which are later used to generate changelogs
- Commit the generated change files (JSON).

> NOTE: Rush by default does NOT support conventional commits and developers needs to decide on the version bump (major/minor/patch).
It's important that commits are isolated for the package they affected only and contains the version tags `[major]`, `[minor]`, or `[patch]`. `[patch]` is the default if tag is not found in commit message.
Read more about [best practices]
### To publish
- https://rushjs.io/pages/maintainer/publishing/#dry-run-mode

To release, follow these steps:

1. Use `xrun update-changelog` to detect packages that changed and their version bumps.
1. Verify and check the file `CHANGELOG.md`, add a summary of key changes under the date.
1. Amend the commit for `CHANGELOG.md` with summary changes.
1. Run `npx fynpo prepare --no-tag` to prepare packages for release.
1. Run `git tag -a rel-v<#>-<date>` where `<#>` is the major archetype version, and `<date>` as `YYYYMMDD`. (ie: `rel-v9-20210301`)
1. Publish the packages that has version bumps.
1. Push the release commits.

[prettier]: https://www.npmjs.com/package/prettier
[lerna]: https://lernajs.io/

[xclap-cli]: https://www.npmjs.com/package/xclap-cli
[fyn]: https://www.npmjs.com/package/fyn
[docusaurus]: https://docusaurus.io/
[rushjs]: https://rushjs.io/pages/intro/welcome/
[rushjs with pnpm]: https://rushjs.io/pages/maintainer/package_managers/
[best practices]: https://rushjs.io/pages/best_practices/change_logs/#recommended-practices
[pnpm]: https://pnpm.io/
Loading

0 comments on commit 0891ab3

Please sign in to comment.