Skip to content

Commit d8e7155

Browse files
chore(devcontainer): onafy repo — automations, HMR fix, README badge (#91)
- Add allowedDevOrigins for Ona preview environments (fixes cross-origin HMR) - Move postCreateCommand to .ona/automations.yaml (install deps task + dev server service) - Add portsAttributes for port 3000 labeling - Replace Quick start with Ona badge, project setup instructions, and secrets table Co-authored-by: Ona <no-reply@ona.com>
1 parent 265f8b4 commit d8e7155

4 files changed

Lines changed: 51 additions & 10 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
"name": "memo",
33
"image": "mcr.microsoft.com/devcontainers/javascript-node:22",
44
"features": {
5-
"ghcr.io/devcontainers/features/github-cli:1": {}
5+
"ghcr.io/devcontainers/features/github-cli": {}
66
},
7-
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y --no-install-recommends curl && pnpm install && npx playwright install --with-deps chromium",
8-
"forwardPorts": [3000]
7+
"forwardPorts": [3000],
8+
"portsAttributes": {
9+
"3000": {
10+
"label": "Memo App",
11+
"onAutoForward": "notify"
12+
}
13+
}
914
}

.ona/automations.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tasks:
2+
installDeps:
3+
name: Install dependencies
4+
description: Install npm packages and Playwright browsers.
5+
command: |
6+
pnpm install && npx playwright install --with-deps chromium
7+
triggeredBy:
8+
- postDevcontainerStart
9+
10+
services:
11+
dev-server:
12+
name: Dev Server
13+
description: Next.js development server on port 3000.
14+
commands:
15+
start: pnpm dev
16+
ready: curl -sf http://localhost:3000

README.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,32 @@ Past streams are available on the [YouTube channel](https://www.youtube.com/@ona
3737
- [Vitest](https://vitest.dev/) + [Playwright](https://playwright.dev/) (testing)
3838
- Deployed on [Vercel](https://vercel.com/)
3939

40-
## Quick start
40+
## Getting started
4141

42-
```bash
43-
pnpm install
44-
pnpm dev
45-
```
42+
[![Run in Ona](https://ona.com/run-in-ona.svg)](https://app.ona.com/#https://github.com/gitpod-io/memo)
43+
44+
The fastest way to run Memo is in an [Ona](https://ona.com). Click the badge above, or:
45+
46+
1. [Add this repository to an Ona project](https://ona.com/docs/ona/create-first-project)
47+
2. Configure the required [**project secrets**](https://ona.com/docs/ona/projects/project-secrets#project-secrets) (see below)
48+
3. Open the environment — dependencies install automatically and the dev server starts on port 3000
49+
50+
### Required project secrets
51+
52+
Set these in your Ona project settings under **Secrets**:
53+
54+
| Secret | Description |
55+
|---|---|
56+
| `NEXT_PUBLIC_SUPABASE_URL` | Supabase project URL |
57+
| `NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY` | Supabase anon/public key |
58+
| `SUPABASE_SECRET_KEY` | Supabase service role key |
59+
| `NEXT_PUBLIC_SENTRY_DSN` | Sentry DSN (optional — leave empty to disable) |
60+
| `SENTRY_DSN` | Sentry server-side DSN (optional) |
61+
| `SENTRY_AUTH_TOKEN` | Sentry auth token for source maps (optional) |
62+
| `SENTRY_ORG` | Sentry organization slug (optional) |
63+
| `SENTRY_PROJECT` | Sentry project slug (optional) |
4664

47-
Open [http://localhost:3000](http://localhost:3000).
65+
Without Supabase secrets, the app starts but auth and data features won't work.
4866

4967
## Project links
5068

next.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import type { NextConfig } from "next";
22
import { withSentryConfig } from "@sentry/nextjs";
33

4-
const nextConfig: NextConfig = {};
4+
const nextConfig: NextConfig = {
5+
allowedDevOrigins: ["*.preview.devx.network", "*.preview.env.ona.dev"],
6+
};
57

68
export default withSentryConfig(nextConfig, {
79
org: process.env.SENTRY_ORG,

0 commit comments

Comments
 (0)