From 6728fa9bfe16de4993bf97df824db8c8d8916d03 Mon Sep 17 00:00:00 2001 From: NotNite Date: Mon, 7 Oct 2024 16:21:43 -0400 Subject: [PATCH] Document more moonlight developer stuff --- src/content/docs/dev/helper-scripts.md | 24 +++++++++++++ src/content/docs/dev/publishing.mdx | 47 ++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 src/content/docs/dev/helper-scripts.md create mode 100644 src/content/docs/dev/publishing.mdx diff --git a/src/content/docs/dev/helper-scripts.md b/src/content/docs/dev/helper-scripts.md new file mode 100644 index 0000000..31bc437 --- /dev/null +++ b/src/content/docs/dev/helper-scripts.md @@ -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 +``` diff --git a/src/content/docs/dev/publishing.mdx b/src/content/docs/dev/publishing.mdx new file mode 100644 index 0000000..3606c63 --- /dev/null +++ b/src/content/docs/dev/publishing.mdx @@ -0,0 +1,47 @@ +--- +title: Publishing a new release +sidebar: + order: 3 +--- +import { Aside } from "@astrojs/starlight/components"; + + + + +## 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.