Skip to content

Commit 81a78d1

Browse files
authored
Merge branch 'main' into backup-performance-changelog
2 parents 129af32 + 9dfa659 commit 81a78d1

File tree

13 files changed

+146
-79
lines changed

13 files changed

+146
-79
lines changed

.github/workflows/tests.yml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,51 @@ jobs:
3535
run: pnpm install --frozen-lockfile
3636
- name: Check formatting
3737
run: pnpm format:check
38-
38+
tests:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
with:
43+
ref: ${{ github.event.pull_request.head.sha }}
44+
- uses: actions/setup-node@v4
45+
with:
46+
node-version: 20
47+
- name: Install corepack
48+
run: npm i -g corepack@latest
49+
- name: Install pnpm
50+
run: corepack enable
51+
- name: Get pnpm store directory
52+
shell: bash
53+
run: |
54+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
55+
- uses: actions/cache@v4
56+
name: Setup pnpm cache
57+
with:
58+
path: ${{ env.STORE_PATH }}
59+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
60+
restore-keys: |
61+
${{ runner.os }}-pnpm-store-
62+
- name: Install dependencies
63+
run: pnpm install --frozen-lockfile
64+
- name: Install playwright dependencies
65+
run: pnpm exec playwright install --with-deps chromium
66+
- name: Run tests
67+
env:
68+
PUBLIC_APPWRITE_ENDPOINT: ${{ vars.PUBLIC_APPWRITE_ENDPOINT }}
69+
PUBLIC_APPWRITE_DASHBOARD: ${{ vars.PUBLIC_APPWRITE_DASHBOARD }}
70+
PUBLIC_APPWRITE_PROJECT_ID: ${{ vars.PUBLIC_APPWRITE_PROJECT_ID }}
71+
PUBLIC_APPWRITE_DB_MAIN_ID: ${{ vars.PUBLIC_APPWRITE_DB_MAIN_ID }}
72+
PUBLIC_APPWRITE_COL_THREADS_ID: ${{ vars.PUBLIC_APPWRITE_COL_THREADS_ID }}
73+
PUBLIC_APPWRITE_COL_MESSAGES_ID: ${{ vars.PUBLIC_APPWRITE_COL_MESSAGES_ID }}
74+
PUBLIC_APPWRITE_FN_TLDR_ID: ${{ vars.PUBLIC_APPWRITE_FN_TLDR_ID }}
75+
PUBLIC_APPWRITE_PROJECT_INIT_ID: ${{ vars.PUBLIC_APPWRITE_PROJECT_INIT_ID }}
76+
PUBLIC_GROWTH_ENDPOINT: ${{ vars.PUBLIC_GROWTH_ENDPOINT }}
77+
PUBLIC_POSTHOG_API_KEY: ${{ vars.PUBLIC_POSTHOG_API_KEY }}
78+
APPWRITE_DB_INIT_ID: ${{ secrets.APPWRITE_DB_INIT_ID }}
79+
APPWRITE_COL_INIT_ID: ${{ secrets.APPWRITE_COL_INIT_ID }}
80+
APPWRITE_API_KEY_INIT: ${{ secrets.APPWRITE_API_KEY_INIT }}
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
run: pnpm test
3983
build:
4084
runs-on: ubuntu-latest
4185
steps:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ terraform/**/.t*
2121
terraform/**/.env
2222
terraform/**/**/*.tfstate*
2323
/.cache
24+
/test-results

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"icons:optimize": "node ./src/icons/optimize.js",
1818
"lint": "prettier --check . && eslint .",
1919
"preview": "vite preview",
20-
"test": "npm run test:integration && npm run test:unit",
20+
"test": "npm run test:integration",
2121
"test:integration": "playwright test",
2222
"test:unit": "vitest",
2323
"optimize": "node ./scripts/optimize-assets.js",
@@ -96,5 +96,16 @@
9696
"vite-plugin-image-optimizer": "^1.1.8",
9797
"vite-plugin-manifest-sri": "^0.2.0",
9898
"vitest": "^1.6.0"
99+
},
100+
"pnpm": {
101+
"onlyBuiltDependencies": [
102+
"@parcel/watcher",
103+
"@sentry/cli",
104+
"core-js",
105+
"esbuild",
106+
"sharp",
107+
"svelte-preprocess",
108+
"ttf2woff2"
109+
]
99110
}
100111
}

playwright.config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import type { PlaywrightTestConfig } from '@playwright/test';
22

33
const config: PlaywrightTestConfig = {
44
webServer: {
5-
command: 'npm run build && npm run preview',
6-
port: 4173
5+
command: 'pnpm run dev',
6+
port: 5173
77
},
8+
fullyParallel: true,
89
testDir: 'tests',
910
testMatch: /(.+\.)?(test|spec)\.[jt]s/
1011
};

src/hooks.server.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const securityheaders: Handle = async ({ event, resolve }) => {
5353
"'unsafe-eval'",
5454
'https://*.posthog.com',
5555
'https://*.plausible.io',
56+
'https://*.reo.dev',
5657
'https://plausible.io',
5758
'https://js.zi-scripts.com',
5859
'https://ws.zoominfo.com'
@@ -74,6 +75,7 @@ const securityheaders: Handle = async ({ event, resolve }) => {
7475
'https://*.sentry.io',
7576
'https://*.plausible.io',
7677
'https://plausible.io',
78+
'https://*.reo.dev',
7779
'https://js.zi-scripts.com',
7880
'https://aorta.clickagy.com',
7981
'https://hemsync.clickagy.com',

src/lib/components/blog/table-of-contents.svelte

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
1+
<script lang="ts" context="module">
2+
export type TocItem = {
3+
title: string;
4+
href: string;
5+
step?: number;
6+
selected?: boolean;
7+
level?: number;
8+
children?: Array<{
9+
title: string;
10+
href: string;
11+
selected: boolean;
12+
level?: number;
13+
}>;
14+
};
15+
</script>
16+
117
<script lang="ts">
2-
import type { TocItem } from '$lib/layouts/DocsArticle.svelte';
318
import { classNames } from '$lib/utils/classnames';
19+
import { fade } from 'svelte/transition';
420
521
const backToTop = () => {
622
window.scrollTo({ top: 0 });
723
};
824
25+
let isScrolled: boolean = false;
26+
27+
const handleIsScrolled = () => {
28+
isScrolled = !!window.scrollY;
29+
};
30+
931
export let toc: Array<TocItem> = [];
32+
export let heading: string = 'Table of Contents';
1033
</script>
1134

35+
<svelte:window on:scroll={handleIsScrolled} />
36+
1237
<nav class="sticky top-32 col-span-3 mt-2 -ml-4 hidden h-[800px] flex-col gap-6 lg:flex">
13-
<span class="text-micro text-primary ps-6 uppercase tracking-tighter">Table of Contents</span>
38+
<span class="text-micro tracking-loose text-primary font-aeonik-fono ps-6 uppercase"
39+
>{heading}</span
40+
>
1441
<div class="relative">
1542
<ul
16-
class="border-smooth mask text-caption flex max-h-[600px] flex-col gap-4 overflow-scroll border-b pb-11 [scrollbar-width:none]"
43+
class="mask text-caption flex max-h-[600px] flex-col gap-4 overflow-scroll pb-11 [scrollbar-width:none]"
1744
>
1845
{#each toc as parent (parent.href)}
1946
<li
@@ -24,7 +51,7 @@
2451
{
2552
'font-medium': parent.level && parent.level === 1,
2653
'ps-6': parent.level && parent.level === 2,
27-
'pl-10': parent.level && parent.level >= 3,
54+
'ps-12': parent.level && parent.level >= 3,
2855
'before:opacity-100': parent.selected
2956
}
3057
)}
@@ -33,7 +60,7 @@
3360

3461
{#if parent.children}
3562
<ul
36-
class="border-smooth mt-11 ml-9 flex flex-col gap-7 border-b pb-11 text-xs"
63+
class="border-smooth text-caption mt-11 ml-9 flex flex-col gap-7 border-b pb-10"
3764
>
3865
{#each parent.children as child}
3966
<li
@@ -58,11 +85,15 @@
5885
</ul>
5986
</div>
6087

61-
<button
62-
class="text-primary group mt-8 flex cursor-pointer items-center gap-2 pl-7 transition-all active:scale-95"
63-
on:click={backToTop}
64-
>
65-
<span class="web-icon-arrow-up transition group-hover:-translate-y-0.5" />
66-
Back to Top
67-
</button>
88+
{#if isScrolled}
89+
<button
90+
class="text-primary group border-smooth text-caption ms-6 -mt-4 flex cursor-pointer items-center gap-2 border-t pt-10 font-medium transition-all"
91+
on:click={backToTop}
92+
out:fade
93+
in:fade
94+
>
95+
<span class="web-icon-arrow-up transition group-hover:-translate-y-0.5" />
96+
Back to Top
97+
</button>
98+
{/if}
6899
</nav>

src/lib/layouts/DocsArticle.svelte

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import { setContext } from 'svelte';
1919
import { writable } from 'svelte/store';
2020
import { Feedback } from '$lib/components';
21-
import { scrollToTop } from '$lib/actions/scrollToTop';
21+
import TableOfContents from '$lib/components/blog/table-of-contents.svelte';
2222
2323
export let title: string;
2424
export let toc: Array<TocItem>;
@@ -72,45 +72,7 @@
7272
<aside class="web-references-menu ps-6">
7373
<div class="web-references-menu-content">
7474
{#if toc && toc.length > 0}
75-
<div class="flex items-center justify-between gap-4">
76-
<h5 class="web-references-menu-title text-micro uppercase">On This Page</h5>
77-
</div>
78-
<ol class="web-references-menu-list">
79-
{#each toc as parent (parent.href)}
80-
<li class="web-references-menu-item">
81-
<a
82-
href={parent.href}
83-
class="web-references-menu-link"
84-
class:is-selected={parent.selected}
85-
>
86-
{#if parent?.step}
87-
<span class="web-numeric-badge">{parent.step}</span>
88-
{/if}
89-
<span class="text-caption">{parent.title}</span>
90-
</a>
91-
{#if parent.children}
92-
<ol class="web-references-menu-list mt-4 ml-8">
93-
{#each parent.children as child}
94-
<li class="web-references-menu-item">
95-
<a
96-
href={child.href}
97-
class="web-references-menu-link"
98-
>
99-
<span class="text-caption">{child.title}</span>
100-
</a>
101-
</li>
102-
{/each}
103-
</ol>
104-
{/if}
105-
</li>
106-
{/each}
107-
</ol>
108-
<div class="border-greyscale-900/4 border-t pt-5">
109-
<button class="web-link inline-flex items-center gap-2" use:scrollToTop>
110-
<span class="web-icon-arrow-up" aria-hidden="true" />
111-
<span class="text-caption">Back to top</span>
112-
</button>
113-
</div>
75+
<TableOfContents heading="On This Page" {toc} />
11476
{/if}
11577
</div>
11678
</aside>

src/redirects.json

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@
139139
"link": "/docs/authentication-management",
140140
"redirect": "/docs/products/auth/users"
141141
},
142-
{
143-
"link": "/docs/authentication-server",
144-
"redirect": "/docs/authentication-server"
145-
},
146142
{
147143
"link": "/docs/authentication-security",
148144
"redirect": "/docs/products/auth/security"
@@ -265,7 +261,7 @@
265261
},
266262
{
267263
"link": "/docs/debugging",
268-
"redirect": "/docs/advanced/self-hosting/debugging"
264+
"redirect": "/docs/advanced/self-hosting/debug"
269265
},
270266
{
271267
"link": "/docs/upgrade",
@@ -467,10 +463,6 @@
467463
"link": "/docs/models/collection",
468464
"redirect": "/docs/references/cloud/models/collection"
469465
},
470-
{
471-
"link": "/docs/models/attribute",
472-
"redirect": "/docs/references/cloud/models/attribute"
473-
},
474466
{
475467
"link": "/docs/models/index",
476468
"redirect": "/docs/references/cloud/models/index"
@@ -659,10 +651,6 @@
659651
"link": "/keyboard",
660652
"redirect": "/docs/tooling/appwriter"
661653
},
662-
{
663-
"link": "/careers",
664-
"redirect": "https://appwrite.careers"
665-
},
666654
{
667655
"link": "/policy/terms",
668656
"redirect": "/terms"
@@ -671,10 +659,7 @@
671659
"link": "/policy/privacy",
672660
"redirect": "/privacy"
673661
},
674-
{
675-
"link": "/cli/install.sh",
676-
"redirect": "https://raw.githubusercontent.com/appwrite/sdk-for-cli/master/install.sh"
677-
},
662+
678663
{
679664
"link": "/case-studies",
680665
"redirect": "/customer-stories"

src/routes/+layout.svelte

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,22 @@
178178
document.body.appendChild(zi);
179179
});
180180
</script>
181+
182+
<!-- Reo.dev -->
183+
<script type="text/javascript">
184+
!(function () {
185+
var e, t, n;
186+
(e = '144fa7eaa4904e8'),
187+
(t = function () {
188+
Reo.init({ clientID: '144fa7eaa4904e8' });
189+
}),
190+
((n = document.createElement('script')).src =
191+
'https://static.reo.dev/' + e + '/reo.js'),
192+
(n.defer = !0),
193+
(n.onload = t),
194+
document.head.appendChild(n);
195+
})();
196+
</script>
181197
{/if}
182198

183199
<!-- canonical url -->

src/routes/careers/+page.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { redirect } from '@sveltejs/kit';
2+
3+
export function load() {
4+
redirect(301, 'https://careers.appwrite.io');
5+
}

0 commit comments

Comments
 (0)