@gnsx/genesys.sdk
v4.2.11
Published
Genesys SDK - A development toolkit for game development
Readme
User Workflow
- Download and install the latest version from the Release page.
- Create an empty folder on your disk to store the project.
- Open the empty folder created earlier in this app, select a template and create a project, then start the file server.
- Launch the web editor and cursor to develop.
Developer
Run Locally
pnpm installpnpm dev: to run the dev version, connects to localhost:3000 if available- run
pnpm devon genesys.ai to start localhost:3000 - if localhost:3000 is started after the sdk, refresh the sdk with Ctrl+R/Ctrl+Shift+R
- run
pnpm dev:watch: same aspnpm devbut with auto-restart on file changes using nodemonpnpm dev:hosted: connects to the hosted genesys.ai site.pnpm dist: to build the app locally. Installer will be generated in thedistfolder that you can use to install the app directly on your machine.
CLI Tools
The SDK includes command-line tools for creating and building projects without launching the GUI.
Available Commands
# Show help and available commands
genesys-sdk --help
# Show version
genesys-sdk --version
# Create a new project
genesys-sdk new -n <project-name> -t <template-id> [-p <parent-path>]
# Build an existing project (with TypeScript type checking)
genesys-sdk build [-p <project-path>]
# Build without type checking (faster)
genesys-sdk build [-p <project-path>] --no-tsc
# List available project templates
genesys-sdk list-templatesNew Project Template
- The logic to setup a new project is in new-project.ts, it contains a few steps:
- Generate
game.tsanddefault.genesys-scenebased on the selected template. - Generate
package.jsonand{project}.code-workspacefrom code. - Copy the files from
assets/new-projectto the project folder. - Run
pnpm installandpnpm buildin the project folder.
- Generate
Add Electron API
Electron API is for exposing code that relies on the nodejs environment to the frontend environment.
To add a new one, following this:
- Define the API in api.ts
- Add the API wrapper in preload.ts
- Implement the API in handler.ts
