Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "RedwoodGraphQL",
"name": "CedarJS",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-20-bullseye",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"workspaceFolder": "/workspaces/RedwoodGraphQL",
"workspaceFolder": "/workspaces/cedar",
"forwardPorts": [8910, 8911],
"portsAttributes": {
"8910": {
"label": "RedwoodJS Web",
"label": "CedarJS Web",
"onAutoForward": "notify"
},
"8911": {
"label": "RedwoodJS API",
"label": "CedarJS API",
"onAutoForward": "ignore"
}
},
Expand Down
58 changes: 29 additions & 29 deletions .ona/automations.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
services:
dev-server:
name: RedwoodJS Development Server
description: Runs the RedwoodJS development server for both web and api sides
name: CedarJS Development Server
description: Runs the CedarJS development server for both web and api sides
commands:
start: |
# Ensure corepack is enabled in service environment
corepack enable
cd /workspaces/rw-test-app
NODE_ENV=development corepack yarn rw dev
cd /workspaces/cdr-test-app
NODE_ENV=development corepack yarn cedarjs dev

tasks:
setup-environment:
name: Setup RedwoodJS Environment
description: Setup RedwoodJS development environment (runs automatically after devcontainer starts)
name: Setup CedarJS Environment
description: Setup CedarJS development environment (runs automatically after devcontainer starts)
triggeredBy:
- postDevcontainerStart
command: |
export RWFW_PATH="/workspaces/RedwoodGraphQL"
export RWFW_PATH="/workspaces/cedar"
export REDWOOD_DISABLE_TELEMETRY=1
echo "Setting up RedwoodJS development environment..."
mkdir -p /workspaces/rw-test-app
cd /workspaces/RedwoodGraphQL
echo "Setting up CedarJS development environment..."
mkdir -p /workspaces/cdr-test-app
cd /workspaces/cedar
echo "Cleaning up existing symlinks and cache..."
rm -rf node_modules/@redwoodjs
rm -rf node_modules/@cedarjs
rm -rf node_modules/.cache
rm -f yarn.lock
corepack yarn cache clean --all 2>/dev/null || true
echo "Installing framework dependencies..."
corepack yarn install
echo "Building test project..."
corepack yarn run build:test-project ../rw-test-app --typescript --link --verbose
cd /workspaces/rw-test-app
corepack yarn run build:test-project ../cdr-test-app --typescript --link --verbose
cd /workspaces/cdr-test-app
sed -i "s/\(open *= *\).*/\1false/" redwood.toml
echo -e "\n\n\033[94m ======================================================\n\033[33m ⌛ RedwoodJS development environment is ready!\n Test app \"rw-test-app\" has been generated & linked with framework code.\n\n If you make changes to the framework:\n 1. \033[33mEnsure env vars are set \033[92mexport RWFW_PATH=\"/workspaces/RedwoodGraphQL\"\033[33m\n 2. \033[33mRun \033[92mcorepack yarn rwfw project:sync\033[33m to sync changes\n 3. \033[33mOr use the \033[92mSync Framework Changes\033[33m task from Ona dashboard\n\033[94m ======================================================\n\n"
# Open ports for RedwoodJS development servers
echo -e "\n\n\033[94m ======================================================\n\033[33m ⌛ CedarJS development environment is ready!\n Test app \"cdr-test-app\" has been generated & linked with framework code.\n\n If you make changes to the framework:\n 1. \033[33mEnsure env vars are set \033[92mexport RWFW_PATH=\"/workspaces/cedar\"\033[33m\n 2. \033[33mRun \033[92mcorepack yarn rwfw project:sync\033[33m to sync changes\n 3. \033[33mOr use the \033[92mSync Framework Changes\033[33m task from Ona dashboard\n\033[94m ======================================================\n\n"
# Open ports for CedarJS development servers
echo "Opening ports for development servers..."
gitpod environment port open 8910 --name "RedwoodJS Web Server" --protocol https
gitpod environment port open 8911 --name "RedwoodJS API Server" --protocol https
gitpod environment port open 8910 --name "CedarJS Web Server" --protocol https
gitpod environment port open 8911 --name "CedarJS API Server" --protocol https
echo "✅ Ports 8910 (Web) and 8911 (API) are now open with HTTPS"
# Signal completion
touch /tmp/redwood-setup-complete
touch /tmp/cedar-setup-complete
echo "✅ Setup task completed successfully"

start-dev-after-setup:
Expand All @@ -50,13 +50,13 @@ tasks:
command: |
# Wait for setup to complete
echo "Waiting for setup to complete..."
while [ ! -f /tmp/redwood-setup-complete ]; do
while [ ! -f /tmp/cedar-setup-complete ]; do
sleep 2
done
echo "Setup completed, starting development server..."
# Ensure ports are open before starting service
gitpod environment port open 8910 --name "RedwoodJS Web Server" --protocol https 2>/dev/null || true
gitpod environment port open 8911 --name "RedwoodJS API Server" --protocol https 2>/dev/null || true
gitpod environment port open 8910 --name "CedarJS Web Server" --protocol https 2>/dev/null || true
gitpod environment port open 8911 --name "CedarJS API Server" --protocol https 2>/dev/null || true
gitpod automations service start dev-server
echo "✅ Development server started"

Expand All @@ -66,30 +66,30 @@ tasks:
triggeredBy:
- manual
command: |
export RWFW_PATH="/workspaces/RedwoodGraphQL"
export RWFW_PATH="/workspaces/cedar"
cd /workspaces/rw-test-app
corepack yarn rwfw project:sync
echo "Framework changes synced to test project"

start-dev-server:
name: Start Development Server
description: Start the RedwoodJS development server
description: Start the CedarJS development server
triggeredBy:
- manual
command: |
gitpod automations service start dev-server

stop-dev-server:
name: Stop Development Server
description: Stop the RedwoodJS development server
description: Stop the CedarJS development server
triggeredBy:
- manual
command: |
gitpod automations service stop dev-server

restart-dev-server:
name: Restart Development Server
description: Restart the RedwoodJS development server
description: Restart the CedarJS development server
triggeredBy:
- manual
command: |
Expand All @@ -103,9 +103,9 @@ tasks:
triggeredBy:
- manual
command: |
echo "Opening RedwoodJS development ports with HTTPS..."
gitpod environment port open 8910 --name "RedwoodJS Web Server" --protocol https
gitpod environment port open 8911 --name "RedwoodJS API Server" --protocol https
echo "Opening CedarJS development ports with HTTPS..."
gitpod environment port open 8910 --name "CedarJS Web Server" --protocol https
gitpod environment port open 8911 --name "CedarJS API Server" --protocol https
echo "✅ Ports opened successfully with HTTPS protocol"
gitpod environment port list

Expand All @@ -115,7 +115,7 @@ tasks:
triggeredBy:
- manual
command: |
echo "Closing RedwoodJS development ports..."
echo "Closing CedarJS development ports..."
gitpod environment port close 8910
gitpod environment port close 8911
echo "✅ Ports closed successfully"
Expand Down
30 changes: 15 additions & 15 deletions docs/docs/how-to/using-ona.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Ona is a cloud development environment with all the necessary tools and dependen

Click on the Run in Ona button:

[![Run in Ona](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/redwoodjs/starter)
[![Run in Ona](https://ona.com/run-in-ona.svg)](https://app.ona.com/#https://github.com/cedarjs/starter)

This will launch Ona and ask you to configure a new workspace. Click continue.

Expand All @@ -23,37 +23,37 @@ What's going on behind the scenes:

- Ona is setting up the environment
- It installs our recommended VS Code plugins:
- [ESLint](https://github.com/redwoodjs/starter/blob/main)
- [Git Lens](https://github.com/redwoodjs/starter/blob/main)
- [VS Code Language - Babel](https://github.com/redwoodjs/starter/blob/main)
- [VS Code Version Lens](https://github.com/redwoodjs/starter#:~:text=VS%20Code%20Version%20Lens)
- [Editor Config](https://github.com/redwoodjs/starter#:~:text=Code%20Version%20Lens-,Editor%20Config,-Prisma)
- [Prisma](https://github.com/redwoodjs/starter/blob/main)
- [VS Code GraphQL](https://github.com/redwoodjs/starter/blob/main)
- It runs our **Create Cedar App** which will install the latest stable version of Redwood. We're setting this project to use TypeScript, however, you can [change it to JavaScript](https://github.com/redwoodjs/starter/blob/main) if you prefer.
- [ESLint](https://github.com/cedarjs/starter/blob/main)
- [Git Lens](https://github.com/cedarjs/starter/blob/main)
- [VS Code Language - Babel](https://github.com/cedarjs/starter/blob/main)
- [VS Code Version Lens](https://github.com/cedarjs/starter#:~:text=VS%20Code%20Version%20Lens)
- [Editor Config](https://github.com/cedarjs/starter#:~:text=Code%20Version%20Lens-,Editor%20Config,-Prisma)
- [Prisma](https://github.com/cedarjs/starter/blob/main)
- [VS Code GraphQL](https://github.com/cedarjs/starter/blob/main)
- It runs our **Create Cedar App** which will install the latest stable version of CedarJS. We're setting this project to use TypeScript, however, you can [change it to JavaScript](https://github.com/cedarjs/starter/blob/main) if you prefer.
- It runs `yarn install`, adding all the dependencies for the project
- Changes the database over to Postgres

Once everything is up and running, you can click on the Ports tab:

![GitPod Ports Tab](https://github.com/redwoodjs/starter/raw/main/images/gitpod-ports.png)
![GitPod Ports Tab](https://github.com/cedarjs/starter/raw/main/images/gitpod-ports.png)

You can click on the address or the globe icon to open that particular port in a new tab.

- Port 5432 is the database. So, if you click on that port, you'll probably see a "Port 5432 Not Found" error, but it is working!
![GitPod on Port 5432](https://github.com/redwoodjs/starter/raw/main/images/gitpod-port-5432.png)
![GitPod on Port 5432](https://github.com/cedarjs/starter/raw/main/images/gitpod-port-5432.png)

- Port 8910 is your frontend
![Port 8910 frontend](https://github.com/redwoodjs/starter/raw/main/images/gitpod-port-8910.png)
![Port 8910 frontend](https://github.com/cedarjs/starter/raw/main/images/gitpod-port-8910.png)

- Port 8911 is your backend and will show you a list of all available functions. If you add `/graphql` to the end of the URL, you should see the GraphQL Playground
![Port 8911 GraphQL Playground](https://github.com/redwoodjs/starter/raw/main/images/gitpod-graphql.png)
![Port 8911 GraphQL Playground](https://github.com/cedarjs/starter/raw/main/images/gitpod-graphql.png)

## How to use Gitpod (Ona)

<iframe width="560" height="315" src="https://www.youtube.com/embed/5pNHaqJWKL4?si=OmkQvmPL_Cc3djLg" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

If you have an existing project, you can still use Gitpod:
If you have an existing project, you can still use Ona:

1. Take any repository within GitHub and append `gitpod.io/#` to the URL. This will quickly launch a Ona environment.
1. Take any repository within GitHub and append `https://app.ona.com/#` to the URL. This will quickly launch a Ona environment.
2. Within the Terminal, run `yarn install` to install all the dependencies
2 changes: 1 addition & 1 deletion docs/docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ For all the details, see the [CLI reference](cli-commands.md).

The fastest way to start a new Cedar project is to use Ona's (formerly Gitpod) cloud development environment ([additional documentation for working with Ona](./how-to/using-ona)).

[![Run in Ona](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/cedarjs/starter)
[![Run in Ona](https://ona.com/run-in-ona.svg)](https://app.ona.com/#https://github.com/cedarjs/starter)

## Prisma and the database

Expand Down
Loading