From 44569ae643c94948ce42ba3c9bf007c16d0b4d85 Mon Sep 17 00:00:00 2001 From: Daniel Griesser Date: Mon, 2 Oct 2023 17:30:26 +0200 Subject: [PATCH] feat: Write docs --- website/astro.config.mjs | 17 ++++++++++++----- website/src/content/docs/architecture.mdx | 7 +++++++ website/src/content/docs/guides/integration.md | 14 ++++++++++++++ website/src/content/docs/guides/plugin.md | 7 ------- website/src/content/docs/integrations/astro.mdx | 12 ++++++++++++ .../src/content/docs/integrations/django.mdx | 12 ++++++++++++ .../src/content/docs/integrations/sentry.mdx | 12 ++++++++++++ .../src/content/docs/reference/configuration.md | 8 ++++---- website/yarn.lock | 6 +++--- 9 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 website/src/content/docs/architecture.mdx create mode 100644 website/src/content/docs/guides/integration.md delete mode 100644 website/src/content/docs/guides/plugin.md create mode 100644 website/src/content/docs/integrations/astro.mdx create mode 100644 website/src/content/docs/integrations/django.mdx create mode 100644 website/src/content/docs/integrations/sentry.mdx diff --git a/website/astro.config.mjs b/website/astro.config.mjs index a7b502b3..3edd1e1b 100644 --- a/website/astro.config.mjs +++ b/website/astro.config.mjs @@ -17,11 +17,14 @@ export default defineConfig({ { label: "Start here", items: [ - // Each item here is one entry in the navigation menu. { label: "What is Spotlight?", link: "/what-is-spotlight/", }, + { + label: "Architecture", + link: "/architecture/", + }, ], }, @@ -41,13 +44,18 @@ export default defineConfig({ { label: "Guides", items: [ - // Each item here is one entry in the navigation menu. { - label: "Write a plugin", - link: "/guides/plugin/", + label: "Write an integration", + link: "/guides/integration/", }, ], }, + { + label: "Integrations", + autogenerate: { + directory: "integrations", + }, + }, { label: "Reference", autogenerate: { @@ -58,7 +66,6 @@ export default defineConfig({ customCss: ["./src/tailwind.css"], }), tailwind({ - // Disable the default base styles: applyBaseStyles: false, }), ], diff --git a/website/src/content/docs/architecture.mdx b/website/src/content/docs/architecture.mdx new file mode 100644 index 00000000..36c4b4b3 --- /dev/null +++ b/website/src/content/docs/architecture.mdx @@ -0,0 +1,7 @@ +--- +title: Architecture of Spotlight +--- + +## Frontend + +## Sidecar diff --git a/website/src/content/docs/guides/integration.md b/website/src/content/docs/guides/integration.md new file mode 100644 index 00000000..10ae4554 --- /dev/null +++ b/website/src/content/docs/guides/integration.md @@ -0,0 +1,14 @@ +--- +title: Write your own Integration +description: A guide how to write a Spotlight Integration +--- + +An integration in Spotlight is rather powerful. It can completely change the behavior, add, remove functionality from Spotlight. + +By default, Spotlight really only is a slim skeleton for configured integrations. The minimal configuration of an integration has to have is and name and a version. + +## Integration Ordering + +All integrations are run in the order that they are configured. For instance, for the array `[sentry(), astro()]` in the `init` call, `sentry()` will run before `astro()` and astro might overwrite things perviously configured. + +Your integration should ideally run in any order. If this isn’t possible, we recommend documenting that your integration needs to come first or last in your user’s integrations configuration array. \ No newline at end of file diff --git a/website/src/content/docs/guides/plugin.md b/website/src/content/docs/guides/plugin.md deleted file mode 100644 index 3eafd1ac..00000000 --- a/website/src/content/docs/guides/plugin.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: Write your own Plugin -description: A guide how to write a Spotlight plugin ---- - -A plugin in Spotlight is rather powerful. It can completely change the behavior, add, remove functionality from Spotlight. - diff --git a/website/src/content/docs/integrations/astro.mdx b/website/src/content/docs/integrations/astro.mdx new file mode 100644 index 00000000..9dff2055 --- /dev/null +++ b/website/src/content/docs/integrations/astro.mdx @@ -0,0 +1,12 @@ +--- +title: Astro +--- + +```js +... +integrations: [astro({configOptions})] +... +``` + +## `configOptions` + diff --git a/website/src/content/docs/integrations/django.mdx b/website/src/content/docs/integrations/django.mdx new file mode 100644 index 00000000..3e7ea495 --- /dev/null +++ b/website/src/content/docs/integrations/django.mdx @@ -0,0 +1,12 @@ +--- +title: Django +--- + +```js +... +integrations: [django({configOptions})] +... +``` + +## `configOptions` + diff --git a/website/src/content/docs/integrations/sentry.mdx b/website/src/content/docs/integrations/sentry.mdx new file mode 100644 index 00000000..70d68b94 --- /dev/null +++ b/website/src/content/docs/integrations/sentry.mdx @@ -0,0 +1,12 @@ +--- +title: Sentry +--- + +```js +... +integrations: [sentry({configOptions})] +... +``` + +## `configOptions` + diff --git a/website/src/content/docs/reference/configuration.md b/website/src/content/docs/reference/configuration.md index fb198e9d..7f88804f 100644 --- a/website/src/content/docs/reference/configuration.md +++ b/website/src/content/docs/reference/configuration.md @@ -9,13 +9,13 @@ description: All the configuration options for setting up Spotlight import * as Spotlight from '@sentry/spotlight'; Spotlight.init({ - plugins: ['sentry'] + integrations: [sentry()] }); ``` -### `plugins` +### `integrations` -*type:* `string[]` +*type:* `[]` -Defines which plugins should be loaded for Spotlight. \ No newline at end of file +Defines which integrations should be loaded for Spotlight. \ No newline at end of file diff --git a/website/yarn.lock b/website/yarn.lock index b28986fe..597214d1 100644 --- a/website/yarn.lock +++ b/website/yarn.lock @@ -904,9 +904,9 @@ astring@^1.8.0: integrity sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg== astro@^3.0.6: - version "3.2.0" - resolved "https://registry.yarnpkg.com/astro/-/astro-3.2.0.tgz#699fca50f3c424ed562bae660d78d0813821e528" - integrity sha512-sDQnSFV46ZzNkVU6co5f8wilZFmGiWsqnIVoMhd5/XPU76iZdA40WqFyBOhGaji7hGuqbcjN8MGobMg53lsoUg== + version "3.2.1" + resolved "https://registry.yarnpkg.com/astro/-/astro-3.2.1.tgz#c37ce0a96589919e06dd00728e7a8513076f636b" + integrity sha512-idPwpMSdFg8wuS9HVkefDcbRdKpCkQzZGeKw3XO6enLcCv6ZvACRdWgl9xhM/N3RO4AOzrnJPAk1cbYcP3FdNQ== dependencies: "@astrojs/compiler" "^2.1.0" "@astrojs/internal-helpers" "0.2.0"