Skip to content

Commit

Permalink
several fixes for plugins on website (ardatan#1597)
Browse files Browse the repository at this point in the history
* fixes

* Update website/theme.config.tsx

* yarn deduplicate and fix edit on github
  • Loading branch information
dimaMachina authored Dec 19, 2022
1 parent 77208ce commit 519f9c3
Show file tree
Hide file tree
Showing 11 changed files with 613 additions and 787 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"postinstall": "patch-package",
"lint": "eslint --config .eslintrc.json --ext .ts . --max-warnings 0",
"ci:lint": "eslint --config .eslintrc.json --ext .ts . --max-warnings 0 --output-file eslint_report.json --format json",
"lint:prettier": "prettier --ignore-path .gitignore --check .",
"lint:prettier": "prettier --cache --ignore-path .gitignore --check .",
"prebuild": "rimraf packages/*/dist packages/plugins/*/dist",
"build": "bob build",
"ts:check": "tsc --noEmit",
Expand All @@ -38,7 +38,7 @@
"release": "changeset publish",
"loadtest:start-server": "NODE_ENV=production node ./benchmark/app.js",
"loadtest:run": "k6 -e GRAPHQL_HOSTNAME=0.0.0.0 run ./benchmark/k6.js",
"prettier": "prettier --ignore-path .gitignore --write --list-different ."
"prettier": "prettier --cache --ignore-path .gitignore --write --list-different ."
},
"devDependencies": {
"@babel/core": "7.17.5",
Expand Down
14 changes: 7 additions & 7 deletions packages/plugins/sentry/README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
## `@envelop/sentry`

This plugins collects errors and performance tracing for your execution flow, and reports it to [Sentry](https://sentry.io/).
This plugin collects errors and performance tracing for your execution flow, and reports it to [Sentry](https://sentry.io).

This is how it looks like in Sentry for error tracking:

![Example](./packages/plugins/sentry/error1.png)
![Example](./packages/plugins/sentry/error2.png)
![Example](./error1.png)
![Example](./error2.png)

> The operation name, document, variables are collected on errors, and the breadcrumbs that led to the error. You can also add any custom values that you need.
And for performance tracking:

![Example](./packages/plugins/sentry/perf1.png)
![Example](./packages/plugins/sentry/perf2.png)
![Example](./perf1.png)
![Example](./perf2.png)

> You can get information about each resolver (including field and type names), it's execution time and arguments. Also, in case of an error, the performance log and info are attached automatically to the reported Sentry error.
## Getting Started

```
```sh
yarn add @sentry/node @sentry/tracing @envelop/sentry
```

1. Start by creating an account and a project in https://sentry.io/
1. Start by creating an account and a project in https://sentry.io
2. Follow the instructions to setup your Sentry instance in your application.
3. Setup Sentry global instance configuration.
4. Setup the Envelop plugin.
Expand Down

Large diffs are not rendered by default.

File renamed without changes.
14 changes: 7 additions & 7 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
},
"dependencies": {
"date-fns": "2.29.3",
"next-sitemap": "3.1.23",
"@theguild/components": "4.3.6",
"next": "12.3.1",
"next-sitemap": "3.1.42",
"@theguild/components": "4.4.4",
"next": "13.0.7",
"react": "18.2.0",
"react-dom": "18.2.0",
"next-mdx-remote": "4.1.0"
"next-mdx-remote": "4.2.0"
},
"devDependencies": {
"@theguild/algolia": "1.0.1",
"@theguild/algolia": "1.0.2",
"@theguild/tailwind-config": "0.2.1",
"@types/node": "18.6.2",
"@types/react": "18.0.18"
"@types/node": "18.11.15",
"@types/react": "18.0.26"
}
}
4 changes: 2 additions & 2 deletions website/src/components/plugins-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { StaticImageData } from 'next/image';
import { useSSG } from 'nextra/ssg';
import { compareDesc } from 'date-fns';
import { MarketplaceSearch, fetchPackageInfo } from '@theguild/components';
import { pluginsArr, ALL_TAGS } from '@/lib/plugins';
import { PLUGINS, ALL_TAGS } from '@/lib/plugins';

type Plugin = {
title: string;
Expand All @@ -20,7 +20,7 @@ type Plugin = {

export const getStaticProps = async () => {
const plugins: Plugin[] = await Promise.all(
pluginsArr.map(async ({ identifier, npmPackage, title, icon, tags, githubReadme, className = '' }) => {
PLUGINS.map(async ({ identifier, npmPackage, title, icon, tags, githubReadme, className = '' }) => {
const {
readme,
createdAt,
Expand Down
15 changes: 4 additions & 11 deletions website/src/lib/plugin-get-static-props.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { compileMdx } from 'nextra/compile';
import { fetchPackageInfo } from '@theguild/components';
import { pluginsArr } from './plugins';
import { PLUGINS } from './plugins';
import { format } from 'date-fns';
import { GetStaticProps, GetStaticPaths } from 'next';

export const getStaticPaths: GetStaticPaths = () => ({
fallback: 'blocking',
paths: pluginsArr.map(({ identifier }) => ({
paths: PLUGINS.map(({ identifier }) => ({
params: { name: identifier },
})),
});

export const getStaticProps: GetStaticProps = async ctx => {
const pluginPath = ctx.params?.name;
const plugin = pluginsArr.find(v => v.identifier === pluginPath);
const plugin = PLUGINS.find(v => v.identifier === pluginPath);

if (!plugin) {
throw new Error(`Unknown "${pluginPath}" plugin identifier`);
Expand All @@ -32,16 +32,9 @@ export const getStaticProps: GetStaticProps = async ctx => {
'MMM do, yyyy'
)}|
## Installation
<PackageCmd packages={["${npmPackage}"]} />
${readme}`,
{
mdxOptions: {
outputFormat: 'function-body',
jsx: false,
},
unstable_defaultShowCopyCode: true,
}
);

Expand Down
Loading

0 comments on commit 519f9c3

Please sign in to comment.