Skip to content

Commit 5c31ce2

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-SER-428-Quality-Check-root-drectory-modal-issue
2 parents 45e9a40 + da6dfe9 commit 5c31ce2

665 files changed

Lines changed: 23385 additions & 21757 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Copilot Setup Steps
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
copilot-setup-steps:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v5
21+
- name: Setup Bun
22+
uses: oven-sh/setup-bun@v2
23+
with:
24+
bun-version: 1.3.8
25+
26+
- name: Install dependencies
27+
run: bun install --frozen-lockfile
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Dockerize Profiles
2+
3+
on:
4+
push:
5+
branches: [feat-profiles]
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
branches: [feat-profiles]
9+
workflow_dispatch:
10+
11+
jobs:
12+
dockerize-profiles:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout the repo
17+
uses: actions/checkout@v2
18+
- name: Set up QEMU
19+
uses: docker/setup-qemu-action@v2
20+
- name: Set up Docker Buildx
21+
uses: docker/setup-buildx-action@v2
22+
- name: Log in to Docker Hub
23+
uses: docker/login-action@v3
24+
with:
25+
username: ${{ vars.DOCKERHUB_USERNAME }}
26+
password: ${{ secrets.DOCKERHUB_TOKEN }}
27+
28+
- name: Extract metadata (tags, labels) for Docker
29+
id: meta
30+
uses: docker/metadata-action@v5
31+
with:
32+
images: appwrite/console-profiles
33+
tags: |
34+
type=ref,event=branch,prefix=branch-
35+
type=ref,event=pr
36+
type=sha,prefix=sha-
37+
type=raw,value=gh-${{ github.run_id}}
38+
flavor: |
39+
latest=false
40+
41+
- name: Build and push Docker image
42+
id: push
43+
uses: docker/build-push-action@v6
44+
with:
45+
context: .
46+
push: true
47+
platforms: linux/amd64,linux/arm64
48+
tags: ${{ steps.meta.outputs.tags }}
49+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/e2e.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,28 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
- name: Use Node.js
16-
uses: actions/setup-node@v3
15+
- name: Setup Bun
16+
uses: oven-sh/setup-bun@v2
1717
with:
18-
node-version: 20
19-
- name: Install pnpm
20-
uses: pnpm/action-setup@v4
18+
bun-version: 1.3.8
19+
2120
- name: Install dependencies
22-
run: pnpm install --frozen-lockfile
21+
run: bun install --frozen-lockfile
22+
23+
- name: Cache Playwright browsers
24+
uses: actions/cache@v4
25+
id: playwright-cache
26+
with:
27+
path: ~/.cache/ms-playwright
28+
key: ${{ runner.os }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
restore-keys: |
30+
${{ runner.os }}-playwright-
31+
2332
- name: Install Playwright Browsers
24-
run: pnpm exec playwright install --with-deps chromium
33+
run: bunx playwright install --with-deps chromium
34+
2535
- name: E2E Tests
26-
run: pnpm run e2e
36+
run: bun test:e2e
2737
- uses: actions/upload-artifact@v4
2838
if: ${{ !cancelled() }}
2939
with:

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
build-args: |
163163
"PUBLIC_CONSOLE_MODE=cloud"
164164
"PUBLIC_APPWRITE_MULTI_REGION=false"
165-
"PUBLIC_CONSOLE_EMAIL_VERIFICATION=true"
165+
"PUBLIC_CONSOLE_EMAIL_VERIFICATION=false"
166166
"PUBLIC_CONSOLE_MOCK_AI_SUGGESTIONS=false"
167167
"PUBLIC_CONSOLE_FEATURE_FLAGS="
168168
"PUBLIC_STRIPE_KEY=${{ secrets.PUBLIC_STRIPE_KEY_STAGE }}"

.github/workflows/tests.yml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,25 @@ jobs:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Use Node.js
19-
uses: actions/setup-node@v3
18+
- name: Setup Bun
19+
uses: oven-sh/setup-bun@v2
2020
with:
21-
node-version: 20
22-
- name: Install pnpm
23-
uses: pnpm/action-setup@v4
21+
bun-version: 1.3.8
22+
2423
- name: Audit dependencies
25-
run: pnpm audit --audit-level high
24+
run: bun audit --audit-level high
25+
2626
- name: Install dependencies
27-
run: pnpm install --frozen-lockfile
27+
run: bun install --frozen-lockfile
28+
2829
- name: Svelte Diagnostics
29-
run: pnpm run check
30+
run: bun check
31+
3032
- name: Linter
31-
run: pnpm run lint
33+
run: bun lint
34+
3235
- name: Unit Tests
33-
run: pnpm run test
36+
run: bun test:unit
37+
3438
- name: Build Console
35-
run: pnpm run build
39+
run: bun run build

.gitpod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart
66

77
tasks:
8-
- init: npm install && npm run build
9-
command: npm run dev
8+
- init: bun install && bun run build
9+
command: bun run dev

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Ignore files for PNPM, NPM and YARN
1+
# Ignore files for PNPM, NPM, BUN and YARN
22
pnpm-lock.yaml
33
package-lock.json
44
yarn.lock
5+
bun.lock

AGENTS.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Appwrite Console - Copilot Instructions
2+
3+
## Repository Overview
4+
5+
Appwrite Console is the web-based GUI for the Appwrite backend-as-a-service platform. Single-page application built with
6+
**Svelte 5 + SvelteKit 2**, **TypeScript** (not strict mode), **Vite 7**, tested with **Vitest + Playwright**. Package
7+
manager/runtime: **Bun** (Node 20+ optional for tooling). ~1500 files with extensive component-based architecture.
8+
9+
## Critical Build & Test Commands
10+
11+
### Setup (REQUIRED before any commands)
12+
13+
1. **Install Bun**:
14+
- Linux & macOS: `curl -fsSL https://bun.sh/install | bash`
15+
- Windows: `powershell -c "irm bun.sh/install.ps1 | iex"`
16+
2. **Create .env**: `cp .env.example .env` (configure `PUBLIC_APPWRITE_ENDPOINT` and `PUBLIC_CONSOLE_MODE`)
17+
3. **Configure network access** (if using GitHub Actions or restricted environments):
18+
- Ensure firewall/proxy allows access to: `pkg.pr.new`, `pkg.vc`, `registry.npmjs.org`
19+
- These domains are required for dependencies: `@appwrite.io/console`, `@appwrite.io/pink-icons-svelte`,
20+
`@appwrite.io/pink-svelte`
21+
- In GitHub Actions: Ensure Bun is installed and registry access is configured
22+
- If network errors persist, check proxy settings: `npm config get proxy` and `npm config get https-proxy`
23+
4. **Install dependencies**: `bun install --frozen-lockfile` (if pkg.pr.new/pkg.vc fail due to network restrictions,
24+
installation may still succeed with cached versions)
25+
26+
### Development Commands
27+
28+
**Standard workflow**: `check``lint``test``build` (before committing)
29+
30+
- `bun run check` - TypeScript/Svelte validation (~30-60s)
31+
- `bun run lint` - ESLint check (~10-20s)
32+
- `bun run format` - Auto-fix Prettier formatting
33+
- `bun run test` - Vitest unit tests with TZ=EST (~10-30s)
34+
- `bun run build` - Production build via build.js (~60-120s)
35+
- `bun run dev` - Dev server on port 3000
36+
- `bun run preview` - Preview build on port 4173
37+
- `bun run e2e` - Playwright tests (needs `bunx playwright install --with-deps chromium` first, ~120s+)
38+
39+
**CI Pipeline** (`.github/workflows/tests.yml`): audit → install → check → lint → test → build
40+
41+
## Project Structure
42+
43+
```
44+
src/
45+
├── lib/ # Reusable logic ($lib alias)
46+
│ ├── components/ # Feature components (billing, domains, permissions, etc.)
47+
│ ├── elements/ # Basic UI elements
48+
│ ├── helpers/ # Utility functions (array, date, string, etc.)
49+
│ ├── stores/ # Svelte stores for state
50+
│ ├── sdk/ # Appwrite SDK wrappers
51+
│ └── constants.ts, flags.ts, system.ts
52+
├── routes/
53+
│ ├── (console)/ # Auth-required routes
54+
│ │ ├── organization-[organization]/
55+
│ │ └── project-[region]-[project]/ # databases, functions, messaging, storage
56+
│ └── (public)/ # Public routes (login, register, auth callbacks)
57+
├── themes/ # Theme definitions ($themes alias)
58+
└── app.html, hooks.{client,server}.ts, service-worker.ts
59+
```
60+
61+
**SvelteKit conventions**: `+page.svelte` (component), `+page.ts` (data loader), `+layout.svelte` (wrapper),
62+
`+error.svelte` (errors). Groups like `(console)` organize routes without affecting URLs. Dynamic params: `[param]`.
63+
64+
## Key Configuration
65+
66+
**svelte.config.js**: Adapter = static SPA (fallback: index.html), base path `/console`, aliases: `$lib`, `$routes`,
67+
`$themes`
68+
**vite.config.ts**: Dev port 3000
69+
**tsconfig.json**: Extends `.svelte-kit/tsconfig.json`, **NOT strict mode** (`strict: false`)
70+
**eslint.config.js**: Flat config (ESLint 9+), many rules disabled (see TODOs)
71+
**.prettierrc**: 4 spaces, single quotes, 100 char width, no trailing commas
72+
73+
## Testing
74+
75+
**Unit (Bun test)**: Tests in `src/lib/helpers/*.test.ts`, run with `TZ=EST` (timezone matters). Setup mocks SvelteKit (
76+
`$app/*`) in `bun-test-setup.ts` via `bunfig.toml`.
77+
**E2E (Playwright)**: Tests in `e2e/journeys/*.spec.ts`, needs build+preview on port 4173, retries 3x, timeout 120s,
78+
Chromium only.
79+
80+
## Common Pitfalls
81+
82+
1. **Blank page in dev**: Disable ad blockers if seeing "Failed to fetch dynamically imported module" (known SvelteKit
83+
issue)
84+
2. **Network errors on install**:
85+
- pkg.pr.new/pkg.vc deps may fail due to firewall/proxy restrictions
86+
- Check access: `curl -I https://pkg.pr.new` and `curl -I https://pkg.vc`
87+
- Configure proxy if needed: `npm config set proxy http://proxy:port` and
88+
`npm config set https-proxy http://proxy:port`
89+
- GitHub Actions: Ensure runner has internet access and Bun is installed
90+
- Local dev: Often safe to continue with cached versions if network fails
91+
3. **OOM on build**: Set `NODE_OPTIONS=--max_old_space_size=8192` (like Dockerfile does)
92+
4. **Test failures**: Always use `bun run test` (sets TZ=EST), not `bun test` directly
93+
5. **TS errors not showing**: Run `bun run check` explicitly (dev server doesn't always surface them)
94+
6. **Format vs lint conflicts**: Run `bun run format` before `bun run lint`
95+
7. **E2E timeouts**: Wait 120s for preview server startup, tests auto-retry 3x
96+
8. **Stale build**: Clear `.svelte-kit` if changes not reflected: `rm -rf .svelte-kit && bun run build`
97+
98+
## Code Conventions
99+
100+
- Imports: Use `$lib`, `$routes`, `$themes` aliases
101+
- Components: PascalCase, in `src/lib/components/[feature]/`
102+
- Helpers: Pure functions in `src/lib/helpers/`
103+
- Types: Inline or `.d.ts`, not `.types.ts` files
104+
- Comments: Minimal, use for TODOs or complex logic
105+
- TypeScript: Not strict mode, `any` tolerated
106+
107+
## Workflow
108+
109+
1. Run Appwrite backend locally (see [docs](https://appwrite.io/docs/advanced/self-hosting))
110+
2. Configure `.env` with backend endpoint
111+
3. `bun install --frozen-lockfile`
112+
4. `bun run dev` (hot reload on port 3000)
113+
5. Before commit: `bun run check && bun run format && bun run lint && bun run test && bun run build`
114+
6. **Take screenshots**: For any UI changes, capture screenshots and include them in the PR description or comments
115+
before finalizing
116+
117+
## Required Pre-Completion Checklist
118+
119+
**CRITICAL**: Before finishing any work or marking a task complete, agents MUST run the following commands in order and
120+
ensure all pass:
121+
122+
1. **`bun run format`** - Auto-fix all formatting issues
123+
2. **`bun run check`** - Verify TypeScript/Svelte types (must show 0 errors, 0 warnings)
124+
3. **`bun run lint`** - Check code style (ignore pre-existing issues in files you didn't modify)
125+
4. **`bun run test`** - Run all unit tests (all tests must pass)
126+
5. **`bun run build`** - Ensure production build succeeds
127+
128+
If any command fails:
129+
130+
- **Format/Lint**: Run `bun run format` to auto-fix, then re-check
131+
- **Type errors**: Fix all TypeScript errors in files you modified
132+
- **Test failures**: Fix failing tests or ensure failures are unrelated to your changes
133+
- **Build failures**: Debug and resolve build issues before proceeding
134+
135+
**Never skip these checks** - they are mandatory quality gates before any work is considered complete.
136+
137+
**Trust these instructions** - only search if incomplete/incorrect. See CONTRIBUTING.md for PR conventions. Use
138+
`--frozen-lockfile` always. Docker builds: multi-stage, final image is nginx serving static files from `/console` path.

0 commit comments

Comments
 (0)