From 09997dc257b37028c3bbab5e29b675f3d990f667 Mon Sep 17 00:00:00 2001 From: Vardhaman Bhandari <97441447+Vardhaman619@users.noreply.github.com> Date: Sat, 5 Oct 2024 09:46:04 +0000 Subject: [PATCH 1/4] fix: update references from twitter.com to x.com --- apps/api/src/pkg/metrics/axiom.ts | 2 +- apps/dashboard/app/auth/layout.tsx | 4 ++-- apps/docs/introduction.mdx | 2 +- apps/docs/mint.json | 2 +- apps/engineering/mint.json | 2 +- apps/www/app/changelog/page.tsx | 2 +- apps/www/components/changelog/changelog-grid-item.tsx | 2 +- apps/www/content/blog/how-unkey-treats-marketing.mdx | 4 ++-- apps/www/content/changelog/2023-07-21.mdx | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/api/src/pkg/metrics/axiom.ts b/apps/api/src/pkg/metrics/axiom.ts index 42216725cc..1a11c4bcc5 100644 --- a/apps/api/src/pkg/metrics/axiom.ts +++ b/apps/api/src/pkg/metrics/axiom.ts @@ -1,3 +1,3 @@ -// idfk https://twitter.com/chronark_/status/1790061863918604666 +// idfk https://x.com/chronark_/status/1790061863918604666 // @ts-ignore import "@axiomhq/js"; diff --git a/apps/dashboard/app/auth/layout.tsx b/apps/dashboard/app/auth/layout.tsx index 41224db1fb..4898b16258 100644 --- a/apps/dashboard/app/auth/layout.tsx +++ b/apps/dashboard/app/auth/layout.tsx @@ -41,7 +41,7 @@ const quotes: { }, { text: "Just used Unkey, by far the easiest and cheapest ( its free ) solution I have used so far for saas to manage their api keys. Its amazing how easy it is use.", - source: "https://twitter.com/tkejr_/status/1731613302378164440", + source: "https://x.com/tkejr_/status/1731613302378164440", author: { name: "Tanmay", image: "/images/quoteImages/tanmay.jpg", @@ -50,7 +50,7 @@ const quotes: { }, { text: "Diving into Unkey for a project, and I'm impressed! Love the straightforward setup for managing API keys.", - source: "https://twitter.com/ojabowalola/status/1724134790670999919", + source: "https://x.com/ojabowalola/status/1724134790670999919", author: { name: "Lola", image: "/images/quoteImages/lola.jpg", diff --git a/apps/docs/introduction.mdx b/apps/docs/introduction.mdx index 3862ac67e6..dd61e2c47b 100644 --- a/apps/docs/introduction.mdx +++ b/apps/docs/introduction.mdx @@ -71,6 +71,6 @@ Join the Unkey community to ask questions, discuss best practices, and share tip diff --git a/apps/docs/mint.json b/apps/docs/mint.json index bb51ddea24..c7e46d60f4 100644 --- a/apps/docs/mint.json +++ b/apps/docs/mint.json @@ -403,7 +403,7 @@ } ], "footerSocials": { - "twitter": "https://twitter.com/unkeydev", + "twitter": "https://x.com/unkeydev", "github": "https://github.com/unkeyed/unkey" }, "openapi": "https://api.unkey.dev/openapi.json", diff --git a/apps/engineering/mint.json b/apps/engineering/mint.json index 77f3b0ce76..a8e359e33e 100644 --- a/apps/engineering/mint.json +++ b/apps/engineering/mint.json @@ -57,7 +57,7 @@ } ], "footerSocials": { - "twitter": "https://twitter.com/unkeydev", + "twitter": "https://x.com/unkeydev", "github": "https://github.com/unkeyed/unkey" }, "analytics": { diff --git a/apps/www/app/changelog/page.tsx b/apps/www/app/changelog/page.tsx index 7cb1e5cbe9..c5cb4c9c57 100644 --- a/apps/www/app/changelog/page.tsx +++ b/apps/www/app/changelog/page.tsx @@ -76,7 +76,7 @@ export default async function Changelogs(_props: Props) {
- +

Changelog

diff --git a/apps/www/components/changelog/changelog-grid-item.tsx b/apps/www/components/changelog/changelog-grid-item.tsx index 2cf3166fc3..58d58600a9 100644 --- a/apps/www/components/changelog/changelog-grid-item.tsx +++ b/apps/www/components/changelog/changelog-grid-item.tsx @@ -62,7 +62,7 @@ export async function ChangelogGridItem({ className, changelog }: Props) {
diff --git a/apps/www/content/blog/how-unkey-treats-marketing.mdx b/apps/www/content/blog/how-unkey-treats-marketing.mdx index 3ac1e87093..be795c9deb 100644 --- a/apps/www/content/blog/how-unkey-treats-marketing.mdx +++ b/apps/www/content/blog/how-unkey-treats-marketing.mdx @@ -166,7 +166,7 @@ Before you get upset, the community needs these events. They are the lifeblood o - Frontend Horse Christmas Spectacular - Github projects -- Twitter Guesser game show... Which was hilarious. +- X(Twitter) Guesser game show... Which was hilarious. - Colby Fayock's site launch giveaways Some of those events had no real value to Clerk, but they had value to the community. Which means they had value to Clerk. @@ -225,4 +225,4 @@ You will notice everything is related to feedback and building relationships. Th ## Conclusion -Traditional marketing is dead from Unkey's perspective, and I hope this blog post has helped you understand how we think about marketing and developer relations. If you have any questions, feel free to reach out to me on [Twitter](https://twitter.com/james_r_perkins) or [Email](james@unkey.dev). +Traditional marketing is dead from Unkey's perspective, and I hope this blog post has helped you understand how we think about marketing and developer relations. If you have any questions, feel free to reach out to me on [X(Twitter)](https://x.com/james_r_perkins) or [Email](james@unkey.dev). diff --git a/apps/www/content/changelog/2023-07-21.mdx b/apps/www/content/changelog/2023-07-21.mdx index c8ea26716f..c0a8d33e0c 100644 --- a/apps/www/content/changelog/2023-07-21.mdx +++ b/apps/www/content/changelog/2023-07-21.mdx @@ -65,4 +65,4 @@ You can read about this in our [documentation](https://unkey.com/docs/api-refere ## Community Shoutout -A huge shoutout to **[Wilfred Almeida](https://twitter.com/WilfredAlmeida_)** who spent some time creating the Go SDK. You can check out the Go code on [GitHub](https://github.com/WilfredAlmeida/unkey-go) and even help with some remaining items. +A huge shoutout to **[Wilfred Almeida](https://x.com/WilfredAlmeida_)** who spent some time creating the Go SDK. You can check out the Go code on [GitHub](https://github.com/WilfredAlmeida/unkey-go) and even help with some remaining items. From e1d4f442f07e10470aeba659fc10c0aab91702f7 Mon Sep 17 00:00:00 2001 From: Vardhaman Bhandari <97441447+Vardhaman619@users.noreply.github.com> Date: Tue, 8 Oct 2024 13:29:31 +0000 Subject: [PATCH 2/4] deleted files in apps/engineering --- apps/engineering/errors.mdx | 124 ------------------------------ apps/engineering/introduction.mdx | 8 -- apps/engineering/mint.json | 68 ---------------- 3 files changed, 200 deletions(-) delete mode 100644 apps/engineering/errors.mdx delete mode 100644 apps/engineering/introduction.mdx delete mode 100644 apps/engineering/mint.json diff --git a/apps/engineering/errors.mdx b/apps/engineering/errors.mdx deleted file mode 100644 index 5687c4f495..0000000000 --- a/apps/engineering/errors.mdx +++ /dev/null @@ -1,124 +0,0 @@ ---- -title: Errors -description: 'Error handling for Unkey APIs' ---- - -Javascript's error handling is pretty horrible. Errors are thrown everywhere and rarely caught at the correct place. - -At Unkey we're counteracting this issue by explicitely returning errors where they may happen. - -Instead of guessing whether a function may throw an error, it's clerly typed and you can not forget to handle the error. -Not all errors can be handled immediately and you can of course choose to escalate it further, but at least they won't be forgotten. - - -## `@unkey/error` - -The `@unkey/error` package in `/internal/error` provides primitives for returning and handling errors as well as a few common error classes. - -Below will be a short introduction to each of the primitives - -### `Result` - -Functions should return a `Result` where the happy path response as well as all possible errors are strongly typed. - -```ts Example -import {type Result, Ok, Err, BaseError } from "@unkey/error" - -class DivisionByZeroError extends BaseError { - public type = "DivisionByZeroError" - public retry = false -} - -function divide(a: number, b: number): Result{ - if (b === 0){ - return Err(new DivisionByZeroError()) - } - return Ok(a / b) -} - - - -const { val: division, err } = divide(1, 0) -if (err) { - // handle error -} -// use division result -``` - - -### `Ok(v: V)` - -A helper to return a valid result. -`Ok()` can be used for void returns. - -### `Err(e: E)` - -A helper to return an error result. - -### `BaseError` - -The base error that all errors should extend from. - -Errors may specify: -- any number of key-value context that will be useful to debug later -- whether the error is retryable -- a cause, which is the error that cause this error if you want to wrap it. - -```ts BaseError -export abstract class BaseError extends Error { - public abstract readonly type: ErrorType; - public abstract readonly retry: boolean; - public readonly cause: BaseError | undefined; - public readonly context: TContext | undefined; -``` - - -## Creating a new Error - -Here's an example of a `SchemaError` that might happen when `zod` invalidates a schema. - -The static `fromZod` constructor is a nice utility added specifically for this error. - - -```ts schema-error.ts - -import type { ZodError } from "zod"; -import { generateErrorMessage } from "zod-error"; -import { BaseError } from "./base"; - -/** - * Parsing a permission query failed - */ -export class SchemaError extends BaseError<{ raw: unknown }> { - public readonly retry = false; - - static fromZod(e: ZodError, raw: unknown): SchemaError { - const message = generateErrorMessage(e.issues, { - maxErrors: 1, - delimiter: { - component: ": ", - }, - path: { - enabled: true, - type: "objectNotation", - label: "", - }, - code: { - enabled: true, - label: "", - }, - message: { - enabled: true, - label: "", - }, - }); - return new SchemaError(message, { - id: SchemaError.name, - context: { - raw: JSON.stringify(raw), - }, - }); - } -} - -``` \ No newline at end of file diff --git a/apps/engineering/introduction.mdx b/apps/engineering/introduction.mdx deleted file mode 100644 index 5fb2e5bbb9..0000000000 --- a/apps/engineering/introduction.mdx +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: Overview -description: 'Welcome to the Unkey engineering docs!' ---- - -## What are engienering docs? - -This is the place we collect decisions, guides and thoughts about building Unkey. diff --git a/apps/engineering/mint.json b/apps/engineering/mint.json deleted file mode 100644 index a8e359e33e..0000000000 --- a/apps/engineering/mint.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "$schema": "https://mintlify.com/schema.json", - "name": "Unkey Engineering", - "colors": { - "primary": "#09090b", - "light": "#EAE6E0", - "dark": "#18181b", - "background": { - "light": "#fafaf9", - "dark": "#0c0a09" - } - }, - "feedback": { - "raiseIssue": true, - "suggestEdit": true, - "thumbsRating": true - }, - "favicon": "/unkey.png", - "topbarLinks": [ - { - "name": "Discord", - "url": "https://unkey.com/discord" - }, - { - "name": "Dashboard", - "url": "https://app.unkey.com" - } - ], - "topbarCtaButton": { - "type": "github", - "url": "https://github.com/unkeyed/unkey" - }, - "tabs": [ - { - "name": "RFCs", - "url": "rfcs" - } - ], - "navigation": [ - { - "group": "Get Started", - "pages": ["introduction"] - }, - { - "group": "Errors", - "icon": "triangle-exclamation", - "pages": ["errors"] - }, - { - "group": "Services", - "icon": "vault", - "pages": ["services/vault"] - }, - { - "group": "RFCs", - "pages": ["rfcs/0001-retrieving-keys"] - } - ], - "footerSocials": { - "twitter": "https://x.com/unkeydev", - "github": "https://github.com/unkeyed/unkey" - }, - "analytics": { - "posthog": { - "apiKey": "phc_kCLW6KdzuihzMqTuJ6PNC4sHP7ipArtEAF8uUH2V5Yt" - } - } -} From fa06b512def78ac5ddc67db8a79e965137700b97 Mon Sep 17 00:00:00 2001 From: Vardhaman Bhandari <97441447+Vardhaman619@users.noreply.github.com> Date: Wed, 9 Oct 2024 11:04:03 +0000 Subject: [PATCH 3/4] Revert "deleted files in apps/engineering" This reverts commit e1d4f442f07e10470aeba659fc10c0aab91702f7. --- apps/engineering/errors.mdx | 124 ++++++++++++++++++++++++++++++ apps/engineering/introduction.mdx | 8 ++ apps/engineering/mint.json | 68 ++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 apps/engineering/errors.mdx create mode 100644 apps/engineering/introduction.mdx create mode 100644 apps/engineering/mint.json diff --git a/apps/engineering/errors.mdx b/apps/engineering/errors.mdx new file mode 100644 index 0000000000..5687c4f495 --- /dev/null +++ b/apps/engineering/errors.mdx @@ -0,0 +1,124 @@ +--- +title: Errors +description: 'Error handling for Unkey APIs' +--- + +Javascript's error handling is pretty horrible. Errors are thrown everywhere and rarely caught at the correct place. + +At Unkey we're counteracting this issue by explicitely returning errors where they may happen. + +Instead of guessing whether a function may throw an error, it's clerly typed and you can not forget to handle the error. +Not all errors can be handled immediately and you can of course choose to escalate it further, but at least they won't be forgotten. + + +## `@unkey/error` + +The `@unkey/error` package in `/internal/error` provides primitives for returning and handling errors as well as a few common error classes. + +Below will be a short introduction to each of the primitives + +### `Result` + +Functions should return a `Result` where the happy path response as well as all possible errors are strongly typed. + +```ts Example +import {type Result, Ok, Err, BaseError } from "@unkey/error" + +class DivisionByZeroError extends BaseError { + public type = "DivisionByZeroError" + public retry = false +} + +function divide(a: number, b: number): Result{ + if (b === 0){ + return Err(new DivisionByZeroError()) + } + return Ok(a / b) +} + + + +const { val: division, err } = divide(1, 0) +if (err) { + // handle error +} +// use division result +``` + + +### `Ok(v: V)` + +A helper to return a valid result. +`Ok()` can be used for void returns. + +### `Err(e: E)` + +A helper to return an error result. + +### `BaseError` + +The base error that all errors should extend from. + +Errors may specify: +- any number of key-value context that will be useful to debug later +- whether the error is retryable +- a cause, which is the error that cause this error if you want to wrap it. + +```ts BaseError +export abstract class BaseError extends Error { + public abstract readonly type: ErrorType; + public abstract readonly retry: boolean; + public readonly cause: BaseError | undefined; + public readonly context: TContext | undefined; +``` + + +## Creating a new Error + +Here's an example of a `SchemaError` that might happen when `zod` invalidates a schema. + +The static `fromZod` constructor is a nice utility added specifically for this error. + + +```ts schema-error.ts + +import type { ZodError } from "zod"; +import { generateErrorMessage } from "zod-error"; +import { BaseError } from "./base"; + +/** + * Parsing a permission query failed + */ +export class SchemaError extends BaseError<{ raw: unknown }> { + public readonly retry = false; + + static fromZod(e: ZodError, raw: unknown): SchemaError { + const message = generateErrorMessage(e.issues, { + maxErrors: 1, + delimiter: { + component: ": ", + }, + path: { + enabled: true, + type: "objectNotation", + label: "", + }, + code: { + enabled: true, + label: "", + }, + message: { + enabled: true, + label: "", + }, + }); + return new SchemaError(message, { + id: SchemaError.name, + context: { + raw: JSON.stringify(raw), + }, + }); + } +} + +``` \ No newline at end of file diff --git a/apps/engineering/introduction.mdx b/apps/engineering/introduction.mdx new file mode 100644 index 0000000000..5fb2e5bbb9 --- /dev/null +++ b/apps/engineering/introduction.mdx @@ -0,0 +1,8 @@ +--- +title: Overview +description: 'Welcome to the Unkey engineering docs!' +--- + +## What are engienering docs? + +This is the place we collect decisions, guides and thoughts about building Unkey. diff --git a/apps/engineering/mint.json b/apps/engineering/mint.json new file mode 100644 index 0000000000..a8e359e33e --- /dev/null +++ b/apps/engineering/mint.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://mintlify.com/schema.json", + "name": "Unkey Engineering", + "colors": { + "primary": "#09090b", + "light": "#EAE6E0", + "dark": "#18181b", + "background": { + "light": "#fafaf9", + "dark": "#0c0a09" + } + }, + "feedback": { + "raiseIssue": true, + "suggestEdit": true, + "thumbsRating": true + }, + "favicon": "/unkey.png", + "topbarLinks": [ + { + "name": "Discord", + "url": "https://unkey.com/discord" + }, + { + "name": "Dashboard", + "url": "https://app.unkey.com" + } + ], + "topbarCtaButton": { + "type": "github", + "url": "https://github.com/unkeyed/unkey" + }, + "tabs": [ + { + "name": "RFCs", + "url": "rfcs" + } + ], + "navigation": [ + { + "group": "Get Started", + "pages": ["introduction"] + }, + { + "group": "Errors", + "icon": "triangle-exclamation", + "pages": ["errors"] + }, + { + "group": "Services", + "icon": "vault", + "pages": ["services/vault"] + }, + { + "group": "RFCs", + "pages": ["rfcs/0001-retrieving-keys"] + } + ], + "footerSocials": { + "twitter": "https://x.com/unkeydev", + "github": "https://github.com/unkeyed/unkey" + }, + "analytics": { + "posthog": { + "apiKey": "phc_kCLW6KdzuihzMqTuJ6PNC4sHP7ipArtEAF8uUH2V5Yt" + } + } +} From 4d65e8123f43e8643177c4023b1286373981b4fe Mon Sep 17 00:00:00 2001 From: Vardhaman Bhandari <97441447+Vardhaman619@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:55:17 +0530 Subject: [PATCH 4/4] fix typo in how-unkey-treats-marketing.mdx --- apps/www/content/blog/how-unkey-treats-marketing.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/www/content/blog/how-unkey-treats-marketing.mdx b/apps/www/content/blog/how-unkey-treats-marketing.mdx index be795c9deb..6abb38ede2 100644 --- a/apps/www/content/blog/how-unkey-treats-marketing.mdx +++ b/apps/www/content/blog/how-unkey-treats-marketing.mdx @@ -166,7 +166,7 @@ Before you get upset, the community needs these events. They are the lifeblood o - Frontend Horse Christmas Spectacular - Github projects -- X(Twitter) Guesser game show... Which was hilarious. +- Twitter Guesser game show... Which was hilarious. - Colby Fayock's site launch giveaways Some of those events had no real value to Clerk, but they had value to the community. Which means they had value to Clerk.