Skip to content

Commit

Permalink
Document more moonlight developer stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
NotNite committed Oct 7, 2024
1 parent e80ed2f commit 6728fa9
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/content/docs/dev/helper-scripts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Helper scripts
sidebar:
order: 3
---

Inside of the moonlight repository, there is a `scripts` folder with some tools in it.

## update.js

Updates the dependency with the given name in all packages.

```shell title="Updating mappings"
node ./scripts/update.js @moonlight-mod/mappings
```

## link.js

Links associated packages with pnpm temporarily. **Not recommended, may break your node_modules.**

```shell title="Using and undoing link"
node ./scripts/link.js
node ./scripts/link.js --undo
```
47 changes: 47 additions & 0 deletions src/content/docs/dev/publishing.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
title: Publishing a new release
sidebar:
order: 3
---
import { Aside } from "@astrojs/starlight/components";

<Aside>This page is mainly here for moonlight core developers who forget what they're doing. Normal users and contributors PRing do not have to do anything here.</Aside>
<Aside type="caution">When publishing to npm, versions are constant. Exercise caution.</Aside>

## Publishing moonlight

moonlight CI builds the `develop` branch automatically. This section is for publishing a new stable, versioned release.

- Checkout the `main` branch.
- Merge `develop` into `main`.
- Update the version in `package.json` and write `CHANGELOG.md`.
- Do not append to the changelog - remake it.
- If any types changes were made in this release, [publish the types](#publishing-types).
- Commit and push to `main`.
- Create a tag with the version, **starting with the character `v`**: `git tag vX.Y.Z`
- This `v` is very important. CI will not pick it up otherwise. The installers will not know what to do without it.
- Push the tag: `git push --tags`
- Checkout the `develop` branch.
- Merge `main` into `develop`.
- Push to `develop`.

## Publishing types

- Update the version in `packages/types/package.json`.
- The version of types does not need to be in sync with the version of moonlight.
- Commit and push to `main`.
- If releasing a stable build of moonlight, make sure the main version bump and types version bump are in the same commit.
- Publish the package: `pnpm publish --access public`
- Publish from within the `packages/types` directory.
- In [the sample extension](https://github.com/moonlight-mod/sample-extension), update the types package: `pnpm update @moonlight-mod/types`
- Commit and push to the sample extension.

## Publishing LunAST/moonmap/mappings

- Update package.json with a new version.
- Commit and push to `main`.
- Create a tag with the version, **starting with the character `v`**: `git tag vX.Y.Z`
- Same reasoning as [above](#publishing-moonlight).
- Push the tag: `git push --tags`
- Wait for the package to be uploaded to npm.
- Use [the update helper script](/dev/helper-scripts) to update the dependencies in moonlight.

0 comments on commit 6728fa9

Please sign in to comment.