Skip to content

Commit

Permalink
Overhaul contributor docs (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcramer committed Nov 22, 2023
1 parent 7df9a61 commit cbd74ee
Show file tree
Hide file tree
Showing 8 changed files with 117 additions and 84 deletions.
38 changes: 0 additions & 38 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ overlay into development environments, and it does it by leveraging the existing

## Contributing / Running the repo

See [CONTIBUTING.md](./CONTRIBUTING.md) for how to contribute and develop Spotlight.
See [Contribute](https://spotlightjs.com/contribute/) for how to contribute and develop Spotlight.

## More on Architecture

Expand Down
10 changes: 6 additions & 4 deletions packages/website/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@ export default defineConfig({
label: 'Write an integration',
link: '/guides/integration/',
},
{
label: 'How to make a Release',
link: '/guides/release/',
},
],
},
{
Expand All @@ -95,6 +91,12 @@ export default defineConfig({
directory: 'integrations',
},
},
{
label: 'Contribute',
autogenerate: {
directory: 'contribute',
},
},
{
label: 'Reference',
autogenerate: {
Expand Down
18 changes: 18 additions & 0 deletions packages/website/src/content/docs/contribute/changesets.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Changesets
description: How-to commit to Spotlight.
---

Spotlight uses [Changesets](https://github.com/changesets/changesets) to track changes & versions.

Whenever you make a change that is users facing, you should add a changeset to your PR. You can do this by runing the
following command:

```shell
pnpm changeset:add
```

This will guide you through the process to define the changeset. You have to select which package(s) are affected by
this change, if it is a patch/minor/major change, and provide a description for the change.

Note that not all PRs need a changeset (e.g. if you only write docs), and a PR can also have more than one changeset.
14 changes: 14 additions & 0 deletions packages/website/src/content/docs/contribute/docs.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Documentation
description: How-to contribute to documentation.
---

Docs are located within the `@spotlightjs/website` project (in `./packages/website`).

You can run the documentation (website) build using:

```shell
pnpm dev:website
```

You'll then find the Astro-based website available at http://localhost:4321/.
69 changes: 69 additions & 0 deletions packages/website/src/content/docs/contribute/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: Get Started
description: A guide how to contribute to Spotlight.
---

Spotlight relies on a [pnpm](https://pnpm.io) monorepo. You'll need to install pnpm to get things going, which can be done with [Volta](https://volta.sh).

Pull down the repo (or your fork):

```shell
git clone https://github.com/getsentry/spotlight.git
```

Ensure the node and pnpm are available:

```shell
volta install node pnpm
```

Lastly, install the package requirements:

```shell
pnpm install
```

## Development

From there you can spin up the Spotlight repo into watch mode:

```shell
pnpm dev:core
```

Depending on what you're doing there's two paths to develop against the core.

If you simply want to run Spotlight against the example application, you can spin that up using:

```shell
pnpm dev:playground
```

Additionally you may want to link it into an existing project. This is a little brittle, and we're not experts here, so your mileage may vary.

First, when in the Spotlight root directory, you'll need to link the packages you're referencing (likely `@spotlightjs/core` and `@spotlightjs/sidecar`):

```shell
pnpm link --global -C packages/core
pnpm link --global -C packages/sidecar
```

You can now link these within your project. For example if you're using `pnpm`:

```shell
pnpm link --global @spotlightjs/core
pnpm link --global @spotlightjs/sidecar
```

## Repository Structure

The monorepo is mostly straight forward, but here's a quick summary:

```
spotlight
└── packages
├── core // @spotlightjs/core - the main overlay
├── sidecar // @spotlightjs/sidecar - the sidecar (proxy) for streaming data
├── tsconfig // @spotlightjs/tsconfig - shared tsconfig
└── website // @spotlightjs/website - the main overlay
```
9 changes: 9 additions & 0 deletions packages/website/src/content/docs/contribute/releases.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Publishing
description: How-to publish a new release of Spotlight.
---

When you want to publish a new version, you need to trigger the
[Prepare Publish](https://github.com/getsentry/spotlight/actions/workflows/prepare-publish.yml) Github Action. This
action will open a PR with all versions bumped & changelogs updated according to the currently pending changesets. If
you approve & merge this PR, these versions will automatically be published to NPM.
41 changes: 0 additions & 41 deletions packages/website/src/content/docs/guides/release.mdx

This file was deleted.

0 comments on commit cbd74ee

Please sign in to comment.