Skip to content

Commit

Permalink
chore: move from deno.json to deps.ts for standalone cli (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Feb 26, 2024
2 parents b216eeb + 1129b65 commit 40d2252
Show file tree
Hide file tree
Showing 39 changed files with 262 additions and 357 deletions.
90 changes: 37 additions & 53 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,102 +1,90 @@
# Open Game Services (OGS)

## Development
## Install

**Setup Dev Environment**
**From GitHub (recommended)**

```
deno task dev:setup
deno install --allow-net --allow-read --allow-env --allow-run --allow-write --name ogs --force https://raw.githubusercontent.com/rivet-gg/open-game-services-engine/main/src/cli/main.ts
```

**Start OGS server**
**From source**

After cloning the repo, run:

```
deno task start:watch
deno install --allow-net --allow-read --allow-env --allow-run --allow-write --name ogs --force src/cli/main.ts
```

Under the hood, this runs:
## Usage

- `deno task build`
- `deno task migrate`
- `deno task entrypoint:watch`
**Setup Dev Environment**

You can also run each one individually.
```
ogs dev setup
```

**Run tests**
**Start OGS server**

_OGS testing is very WIP at the moment._
```
ogs dev start
```

This does not require restarting the server
**Run tests**

```
deno task build
deno task test modules/tokens/tests/e2e.ts
ogs test
```

**Creating modules & scripts**

Create module:

```
deno task create:module foo
ogs create module foo
```

Create script:

```
deno task create:script foo bar
ogs create script foo bar
```

Create migration:
**Generate SDKs**

```
deno task create:migration foo bar
ogs sdk generate
```

**Generate SDKs** To generate SDKs to :

```
deno task sdk:gen
```

SDKs are generated at `dist/sdks/`.
SDKs are generated to `dist/sdks/`.

**OpenAPI & Postman/Insomnia/Paw**

Explore the APIs by opening `dist/openapi.json` in Postman/Insomnia/Paw.

## Goals

- **Package manager for game services** Adding backend functionality to your
game should be as easy as one command
- **Easy to use for game devs** Designed from the ground up to be approachable
by game developers to add backend functionality to their game
- **Easy to modify for everyone** Modules are built to be as simple as possible
and rigorously reviewed before merging
- **Modular** Add, remove, and modify modules from the backend to fit the use
case for your game
- **Easy to use for game devs** The Engine takes care of the hard stuff so
adding functionality is dead simple
- **Secure & load tested** Security, laod testing & anti-botting is not an
afterthought
- **Strict schemas & documentation** Strict typings & documentation are
_required_ to make this easy to approach
- **Portable & lightweight** Built on boring, reliable technology that runs
however you want to run OGS
- **Community-driven** Modularity make it easy for devs to customize for their
own use cases & contribute modules
- **Secure by default** Security & anti-botting should not be an afterthought
for gaming backends
- **Load test everything** Everything is load tested to prevent surprises on
launch day
- **Strict schemas for everything**
- **Documented** Strict typings & documentation are _required_ to make this easy
to approach
- **Permissively licensed** Apache 2.0 license allows developers to adapt &
modify & redistribute
- **Language agnostic** Performance critical parts of the project will likely be
optimized to use a high performance language, such as Rust
- **Package manager for game services** Adding backend functionality to your
game should be as easy as one command
- **Permissively licensed** Apache 2.0 license allows developers to adapt,
modify, & redistribute

## Technologies Used

- TypeScript
- Deno
- Postgres
- Redis
- Language: TypeScript
- Runtime: Deno
- Database: Postgres
- ORM: Prisma

## Who uses OGS?

Expand All @@ -118,7 +106,3 @@ The following companies provide enterprise support & custom modules for OGS:

- [Rivet](https://rivet.gg/support)
- _Create a PR to list your services for OGS_

## Modules

TODO
80 changes: 0 additions & 80 deletions TODO.md

This file was deleted.

20 changes: 2 additions & 18 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
{
"tasks": {
"cli": "deno run -A --check src/cli/main.ts --path tests/test_project"
},
"imports": {
"@ogs/runtime": "./src/runtime/mod.ts",
"@ogs/types": "./src/types/mod.ts",
"@ogs/helpers/": "./dist/helpers/",
"@faker-js/faker": "npm:@faker-js/faker@^8.4.1",
"std/": "https://deno.land/std@0.208.0/",
"postgres/": "https://deno.land/x/postgres@v0.17.2/",
"glob": "npm:glob@^10.3.10",
"typescript-json-schema": "npm:typescript-json-schema@^0.62.0",
"ajv": "npm:ajv@^8.12.0",
"ajv-formats": "npm:ajv-formats@^2.1.1",
"pg": "npm:pg@^8.11.3",
"@prisma/adapter-pg": "npm:@prisma/adapter-pg@^5.9.1",
"esbuild": "npm:esbuild@^0.20.0",
"esbuild-plugin-polyfill-node": "npm:@rivet-gg/esbuild-plugin-polyfill-node@^0.4.0",
"cliffy/": "https://deno.land/x/cliffy@v1.0.0-rc.3/"
"cli:run": "deno run -A --check src/cli/main.ts --path tests/test_project",
"cli:compile": "deno compile --check --allow-net --allow-read --allow-env --allow-run --allow-write --output dist/cli src/cli/main.ts"
},
"lint": {
"include": ["src/"],
Expand Down
Loading

0 comments on commit 40d2252

Please sign in to comment.