Skip to content

Commit

Permalink
migrate astro to latest
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-delirium committed Jan 17, 2025
1 parent a692073 commit 1059553
Show file tree
Hide file tree
Showing 214 changed files with 336 additions and 163 deletions.
1 change: 1 addition & 0 deletions .astro/content-assets.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default new Map();
1 change: 1 addition & 0 deletions .astro/content-modules.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default new Map();
166 changes: 166 additions & 0 deletions .astro/content.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
declare module 'astro:content' {
interface Render {
'.mdx': Promise<{
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
components: import('astro').MDXInstance<{}>['components'];
}>;
}
}

declare module 'astro:content' {
export interface RenderResult {
Content: import('astro/runtime/server/index.js').AstroComponentFactory;
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}
interface Render {
'.md': Promise<RenderResult>;
}

export interface RenderedContent {
html: string;
metadata?: {
imagePaths: Array<string>;
[key: string]: unknown;
};
}
}

declare module 'astro:content' {
type Flatten<T> = T extends { [K: string]: infer U } ? U : never;

export type CollectionKey = keyof AnyEntryMap;
export type CollectionEntry<C extends CollectionKey> = Flatten<AnyEntryMap[C]>;

export type ContentCollectionKey = keyof ContentEntryMap;
export type DataCollectionKey = keyof DataEntryMap;

type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidContentEntrySlug<C extends keyof ContentEntryMap> = AllValuesOf<
ContentEntryMap[C]
>['slug'];

/** @deprecated Use `getEntry` instead. */
export function getEntryBySlug<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;

/** @deprecated Use `getEntry` instead. */
export function getDataEntryById<C extends keyof DataEntryMap, E extends keyof DataEntryMap[C]>(
collection: C,
entryId: E,
): Promise<CollectionEntry<C>>;

export function getCollection<C extends keyof AnyEntryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E,
): Promise<E[]>;
export function getCollection<C extends keyof AnyEntryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown,
): Promise<CollectionEntry<C>[]>;

export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(entry: {
collection: C;
slug: E;
}): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(entry: {
collection: C;
id: E;
}): E extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof ContentEntryMap,
E extends ValidContentEntrySlug<C> | (string & {}),
>(
collection: C,
slug: E,
): E extends ValidContentEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getEntry<
C extends keyof DataEntryMap,
E extends keyof DataEntryMap[C] | (string & {}),
>(
collection: C,
id: E,
): E extends keyof DataEntryMap[C]
? string extends keyof DataEntryMap[C]
? Promise<DataEntryMap[C][E]> | undefined
: Promise<DataEntryMap[C][E]>
: Promise<CollectionEntry<C> | undefined>;

/** Resolve an array of entry references from the same collection */
export function getEntries<C extends keyof ContentEntryMap>(
entries: {
collection: C;
slug: ValidContentEntrySlug<C>;
}[],
): Promise<CollectionEntry<C>[]>;
export function getEntries<C extends keyof DataEntryMap>(
entries: {
collection: C;
id: keyof DataEntryMap[C];
}[],
): Promise<CollectionEntry<C>[]>;

export function render<C extends keyof AnyEntryMap>(
entry: AnyEntryMap[C][string],
): Promise<RenderResult>;

export function reference<C extends keyof AnyEntryMap>(
collection: C,
): import('astro/zod').ZodEffects<
import('astro/zod').ZodString,
C extends keyof ContentEntryMap
? {
collection: C;
slug: ValidContentEntrySlug<C>;
}
: {
collection: C;
id: keyof DataEntryMap[C];
}
>;
// Allow generic `string` to avoid excessive type errors in the config
// if `dev` is not running to update as you edit.
// Invalid collection names will be caught at build time.
export function reference<C extends string>(
collection: C,
): import('astro/zod').ZodEffects<import('astro/zod').ZodString, never>;

type ReturnTypeOrOriginal<T> = T extends (...args: any[]) => infer R ? R : T;
type InferEntrySchema<C extends keyof AnyEntryMap> = import('astro/zod').infer<
ReturnTypeOrOriginal<Required<ContentConfig['collections'][C]>['schema']>
>;

type ContentEntryMap = {

};

type DataEntryMap = {

};

type AnyEntryMap = ContentEntryMap & DataEntryMap;

export type ContentConfig = typeof import("../src/content.config.mjs");
}
1 change: 1 addition & 0 deletions .astro/data-store.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[["Map",1,2],"meta::meta",["Map",3,4,5,6],"astro-version","5.1.7","astro-config-digest","{\"root\":{},\"srcDir\":{},\"publicDir\":{},\"outDir\":{},\"cacheDir\":{},\"site\":\"https://docs.openreplay.com/\",\"compressHTML\":true,\"base\":\"/\",\"trailingSlash\":\"ignore\",\"output\":\"static\",\"scopedStyleStrategy\":\"attribute\",\"build\":{\"format\":\"directory\",\"client\":{},\"server\":{},\"assets\":\"_astro\",\"serverEntry\":\"entry.mjs\",\"redirects\":true,\"inlineStylesheets\":\"auto\",\"concurrency\":1},\"server\":{\"open\":false,\"host\":false,\"port\":4321,\"streaming\":true},\"redirects\":{},\"image\":{\"endpoint\":{\"route\":\"/_image\"},\"service\":{\"entrypoint\":\"astro/assets/services/sharp\",\"config\":{}},\"domains\":[],\"remotePatterns\":[]},\"devToolbar\":{\"enabled\":true},\"markdown\":{\"syntaxHighlight\":\"shiki\",\"shikiConfig\":{\"langs\":[],\"langAlias\":{},\"theme\":\"slack-dark\",\"themes\":{},\"wrap\":false,\"transformers\":[]},\"remarkPlugins\":[null,null],\"rehypePlugins\":[],\"remarkRehype\":{},\"gfm\":true,\"smartypants\":true},\"security\":{\"checkOrigin\":true},\"env\":{\"schema\":{},\"validateSecrets\":false},\"experimental\":{\"clientPrerender\":false,\"contentIntellisense\":false,\"responsiveImages\":false},\"legacy\":{\"collections\":false}}"]
5 changes: 5 additions & 0 deletions .astro/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1737124929637
}
}
2 changes: 2 additions & 0 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/// <reference types="astro/client" />
/// <reference path="content.d.ts" />
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@11ty/eleventy-fetch": "^3.0.0",
"@actions/core": "^1.9.1",
"@algolia/client-search": "^4.14.2",
"@astrojs/preact": "^2.0.2",
"@astrojs/sitemap": "1.0.0",
"@astrojs/preact": "^4.0.2",
"@astrojs/sitemap": "3.2.1",
"@babel/core": "^7.23.2",
"@docsearch/css": "^3.2.2",
"@docsearch/react": "^3.2.0",
Expand All @@ -39,15 +39,15 @@
"@types/node": "^18.6.4",
"@typescript-eslint/eslint-plugin": "^5.32.0",
"@typescript-eslint/parser": "^5.32.0",
"astro": "^1.6.1",
"astro-eslint-parser": "^0.4.5",
"astro-og-canvas": "^0.1.5",
"astro": "^5.1.7",
"astro-eslint-parser": "^1.1.0",
"astro-og-canvas": "^0.5.6",
"bcp-47-normalize": "^2.1.0",
"canvaskit-wasm": "^0.37.0",
"chroma-js": "^2.4.2",
"dedent-js": "^1.0.1",
"eslint": "^8.21.0",
"eslint-plugin-astro": "^0.14.0",
"eslint-plugin-astro": "^1.3.1",
"fast-glob": "^3.2.11",
"github-slugger": "^1.5.0",
"gray-matter": "^4.0.3",
Expand Down Expand Up @@ -77,17 +77,17 @@
"unist-util-visit": "^4.1.0"
},
"dependencies": {
"@astrojs/mdx": "^0.11.6",
"@astrojs/react": "^1.2.2",
"@astrojs/tailwind": "^2.1.3",
"@astrojs/mdx": "^4.0.6",
"@astrojs/react": "^4.1.5",
"@astrojs/tailwind": "^5.1.4",
"@fontsource/figtree": "^4.5.2",
"@fontsource/fira-code": "^4.5.13",
"@fontsource/ibm-plex-mono": "^4.5.10",
"@jsdevtools/rehype-url-inspector": "^2.0.2",
"@nanostores/preact": "^0.1.3",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"astro-embed": "^0.2.0",
"astro-embed": "^0.9.0",
"astro-tooltips": "^0.6.2",
"dotenv": "^16.0.3",
"algoliasearch": "^4.24.0",
Expand All @@ -101,7 +101,7 @@
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.0.1",
"remark-copy-linked-files": "^1.5.0",
"remark-gfm": "^3.0.1",
"remark-gfm": "^4.0.0",
"remark-smartypants": "^2.0.0",
"sass": "^1.54.3",
"tailwindcss": "^3.2.4"
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions src/i18n/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ async function markFallbackNavEntries(lang: string, nav: NavDict) {
return nav;
}

const translations = mapDefaultExports<UIDict>(import.meta.globEager('./*/ui.ts'));
const translations = mapDefaultExports<UIDict>(import.meta.glob('./*/ui.ts', { eager: true }));
const docsearchTranslations = mapDefaultExports<DocSearchTranslation>(
import.meta.globEager('./*/docsearch.ts')
import.meta.glob('./*/docsearch.ts', { eager: true })
);
const navTranslations = mapDefaultExports<NavDict>(import.meta.globEager('./*/nav.ts'));
const navTranslations = mapDefaultExports<NavDict>(import.meta.glob('./*/nav.ts', { eager: true }));

const fallbackLang = 'en';

Expand Down
2 changes: 1 addition & 1 deletion src/pages/en/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ openreplay -s

The result would be something similar to this:

![OpenReplay status](./cli/images/or-cli-status.png)
![OpenReplay status](/cli/or-cli-status.png)

## Have questions?

Expand Down
8 changes: 4 additions & 4 deletions src/pages/en/installation/error-reporting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gain high-level and granular visibility into errors within your web applications
2. **Use Omnisearch**: select the event **“Error Message”** and enter the specific error message.

<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<img src="./images/error-tracking/errors_sessions_view.gif" alt="Errors in sessions" style={{ width: '600px', height: 'auto' }} />
<img src="/error-tracking/errors_sessions_view.gif" alt="Errors in sessions" style={{ width: '600px', height: 'auto' }} />
</div>

### Inside a single Session
Expand All @@ -24,7 +24,7 @@ Gain high-level and granular visibility into errors within your web applications
3. Click on **"Find all sessions with this error"** to see the list of sessions where the error occurred.

<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<img src="./images/error-tracking/errors_session_view.gif" alt="Session error" style={{ width: '600px', height: 'auto' }} />
<img src="/error-tracking/errors_session_view.gif" alt="Session error" style={{ width: '600px', height: 'auto' }} />
</div>

### From the Cards view
Expand All @@ -33,7 +33,7 @@ Gain high-level and granular visibility into errors within your web applications
2. Select **Table of Errors** card

{/* <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<img src="./images/error-tracking/errors_cards_view.gif" alt="Table of errors" style={{ width: '600px', height: 'auto' }} />
<img src="/error-tracking/errors_cards_view.gif" alt="Table of errors" style={{ width: '600px', height: 'auto' }} />
</div> */}

## Manually logging exceptions
Expand Down Expand Up @@ -101,4 +101,4 @@ function myFunction(errorEvent) {
```

## Have questions?
If you have any questions about this process, feel free to reach out to us on our [Slack](https://slack.openreplay.com) or check out our [Forum](https://forum.openreplay.com).
If you have any questions about this process, feel free to reach out to us on our [Slack](https://slack.openreplay.com) or check out our [Forum](https://forum.openreplay.com).
5 changes: 2 additions & 3 deletions src/pages/en/installation/metadata.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To set up metadata keys:
5. Click **Add** to save the metadata key.

<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<img src="./images/send-metadata/send_metadata.gif" alt="Send Metadata" style={{ width: '600px', height: 'auto' }} />
<img src="/send-metadata/send_metadata.gif" alt="Send Metadata" style={{ width: '600px', height: 'auto' }} />
</div>


Expand Down Expand Up @@ -109,11 +109,10 @@ Metadata keys allow you to filter and search sessions in OpenReplay:
3. Enter the metadata value (e.g., `free`) to filter session recordings.

<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
<img src="./images/send-metadata/filter_metatdata.gif" alt="Filter Metadata" style={{ width: '600px', height: 'auto' }} />
<img src="/send-metadata/filter_metatdata.gif" alt="Filter Metadata" style={{ width: '600px', height: 'auto' }} />
</div>

This feature enables quick and precise identification of sessions based on user-specific details.

## Have questions?
If you have any questions about this process, feel free to reach out to us on our [Slack](https://slack.openreplay.com) or check out our [Forum](https://forum.openreplay.com).

6 changes: 3 additions & 3 deletions src/pages/en/tutorials/build-plugins.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Now, there are a few things we have to do to make this work:

With that done, we'll create the actual component showcasing the data inside the player. Something like this:

![The end result](./images/build-plugins/1.png)
![The end result](/tutorials/build-plugins/1.png)

To do so, we’ll rely on an existing component, and we’ll copy&paste the Fetch component. To do that, we’ll duplicate the folder `frontend/app/components/Session_/Fetch` and name it “JQuery”.

Expand Down Expand Up @@ -320,10 +320,10 @@ The code is performing a GET request using Jquery’s `get` method once the page

Here is what the end result should look like for you:

![Displaying JQuery requests](./images/build-plugins/2.png)
![Displaying JQuery requests](/tutorials/build-plugins/2.png)

---

You can [check out this repository](https://github.com/deleteman/openreplay) for the **complete source code** of this tutorial.

If you have any issues with any of the steps of this process, please contact us on our [Slack community](https://slack.openreplay.com/) and ask our devs directly!
If you have any issues with any of the steps of this process, please contact us on our [Slack community](https://slack.openreplay.com/) and ask our devs directly!
10 changes: 5 additions & 5 deletions src/pages/en/tutorials/capture-request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ Now that you've seen the code, let's take a look at what you'd get if you were t
## Regular data capture with OpenReplay
For this example, I'm going to be using the NPM version of the package, if you don't know how to do that, check out [the docs](https://docs.openreplay.com/installation/setup-or) and then get back here.

![](./images/fetch/network-tab-imbored.png)
![](/tutorials/fetch/network-tab-imbored.png)

This is the UI for the session replay by default.
Notice how on the bottom half I've already selected the "Network" tab, but while it does show the requests being made, there are no details
about them. Even if you click on one of them, you'll get the minimum details available:

![](./images/fetch/network-tab-details.png)
![](/tutorials/fetch/network-tab-details.png)

So what can we do? You can enable capturing of the request information with the [Network options object](installation/network-options).
Let's look at that.
Expand Down Expand Up @@ -146,7 +146,7 @@ Notice the warning box I get in this case:
As the dev who coded this I know what to do to test it and understand where the bug is. However, as a user the error is not really telling me much, and I might not be able to communicate this in a way the dev team can understand.
So instead, as a user, I can simply complain to the company about their app not working, and you, as the developer responsible for the application can take a look at my session and inspect the request the client sent and the response from the server.

![](./images/fetch/network-tab-requests.png)
![](/tutorials/fetch/network-tab-requests.png)

Look at the session replay UI now. Inside the Network tab you can see the requests we've been doing to the external API.

Expand Down Expand Up @@ -226,10 +226,10 @@ const tracker = new Tracker({

As you can see, the change is simple, we replace only the numbers on this attribute so now the request looks like this in our UI:

![](./images/fetch/network-tab-sanitized-data.png)
![](/tutorials/fetch/network-tab-sanitized-data.png)

Now your user's data is secured once again.

## Have questions?

If you'd like to check out the code to look at this example in detail, you can find it [here on GitHub](https://github.com/deleteman/im-bored-app/tree/v1.10). If you have any issues setting up the Fetch plugin or the Tracker itself, please reach out to us on our  [Slack community](https://slack.openreplay.com/) and ask our devs directly!
If you'd like to check out the code to look at this example in detail, you can find it [here on GitHub](https://github.com/deleteman/im-bored-app/tree/v1.10). If you have any issues setting up the Fetch plugin or the Tracker itself, please reach out to us on our  [Slack community](https://slack.openreplay.com/) and ask our devs directly!
Loading

0 comments on commit 1059553

Please sign in to comment.