Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
166 changes: 166 additions & 0 deletions docs/css/release-selector.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
.release-selector-container {
background: var(--md-default-bg-color);
border: 1px solid var(--md-default-fg-color--lightest);
border-radius: 8px;
padding: 1.5rem;
margin: 1rem 0;
}

.release-selector-container h3 {
margin-top: 0;
margin-bottom: 1rem;
color: var(--md-default-fg-color);
}

.selector-row {
display: flex;
flex-wrap: wrap;
gap: 1rem;
margin-bottom: 1rem;
}

.selector-group {
flex: 1;
min-width: 200px;
}

.selector-group label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
color: var(--md-default-fg-color);
}

.selector-group select {
width: 100%;
padding: 0.5rem;
border: 1px solid var(--md-default-fg-color--lightest);
border-radius: 4px;
background: var(--md-default-bg-color);
color: var(--md-default-fg-color);
font-size: 0.9rem;
}

.selector-group select:focus {
outline: none;
border-color: var(--md-primary-fg-color);
box-shadow: 0 0 0 2px var(--md-primary-fg-color--light);
}

.selector-group input[type="checkbox"] {
margin-right: 0.5rem;
}

#download-results {
margin-top: 1.5rem;
}

.release-group {
margin-bottom: 1.5rem;
border: 1px solid var(--md-default-fg-color--lightest);
border-radius: 6px;
overflow: hidden;
}

.release-group h4 {
margin: 0;
padding: 0.75rem 1rem;
background: var(--md-default-fg-color--lightest);
color: var(--md-default-fg-color);
font-size: 1rem;
display: flex;
align-items: center;
gap: 0.5rem;
}

.prerelease-badge {
background: var(--md-accent-fg-color);
color: white;
padding: 0.2rem 0.5rem;
border-radius: 12px;
font-size: 0.75rem;
font-weight: 500;
}

.release-date {
margin-left: auto;
font-size: 0.85rem;
opacity: 0.7;
}

.download-links {
padding: 1rem;
}

.download-link {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.75rem;
margin-bottom: 0.5rem;
background: var(--md-code-bg-color);
border: 1px solid var(--md-default-fg-color--lightest);
border-radius: 4px;
text-decoration: none;
color: var(--md-default-fg-color);
transition: all 0.2s ease;
}

.download-link:hover {
background: var(--md-primary-fg-color--light);
border-color: var(--md-primary-fg-color);
transform: translateY(-1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-link:last-child {
margin-bottom: 0;
}

.download-icon {
font-size: 1.2rem;
}

.download-details {
margin-left: auto;
font-size: 0.85rem;
opacity: 0.7;
}

.no-results {
text-align: center;
padding: 2rem;
color: var(--md-default-fg-color--light);
font-style: italic;
}

/* Responsive design */
@media (max-width: 768px) {
.selector-row {
flex-direction: column;
}

.selector-group {
min-width: unset;
}

.release-group h4 {
flex-direction: column;
align-items: flex-start;
gap: 0.25rem;
}

.release-date {
margin-left: 0;
}

.download-link {
flex-direction: column;
align-items: flex-start;
gap: 0.5rem;
}

.download-details {
margin-left: 0;
}
}
63 changes: 45 additions & 18 deletions docs/documentation/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,44 @@
1. [Download the `editor`](https://github.com/godotjs/GodotJS/releases) based on your OS and select an JS engine (we recommend `v8` for a start) and unzip it
2. Rename the downloaded file based on your OS:
- Linux: `godot.linuxbsd.editor.x86_64` ➡️ `godot`
- MacOS: no rename required
- Windows: `godot.windows.editor.x86_64.exe` ➡️ `godot.exe`

## Download GodotJS
Choose your platform and preferences to download the latest GodotJS release:

<div id="release-selector"></div>


> **Note:** The `Godot.app` isn't signed for MacOS you need
> to [allow to open it](https://support.apple.com/en-us/102445#:~:text=If%20you%20want%20to%20open%20an%20app%20that%20hasn%E2%80%99t%20been%20notarized%20or%20is%20from%20an%20unidentified%20developer).


### Manual Installation

If you prefer to browse all releases manually, visit the [GitHub Releases page](https://github.com/godotjs/GodotJS/releases).

### Installation Instructions

After downloading:

1. Extract the downloaded zip file
2. Rename the executable based on your OS:
- **Linux**: `godot.linuxbsd.editor.x86_64` → `godot`
- **macOS**: No rename required
- **Windows**: `godot.windows.editor.x86_64.exe` → `godot.exe`
3. [Add Godot to your PATH](https://docs.godotengine.org/en/stable/tutorials/editor/command_line_tutorial.html#path)
- Linux: `/usr/local/bin`
- MacOS: `echo ~/your-path/Godot.app/Contents/MacOS|sudo tee /etc/paths.d/godot;bash -l;echo $PATH`
- Windows: `setx /M path "%path%;C:\your-path\windows-editor-v8"`
4. Open a terminal
5. Test if you can use Godot via terminal and run:

```shell
godot --version
```
4. Test the installation by running `godot --version` in your terminal

### JS Engine Comparison

| Engine | Performance | Memory Usage | Platform Support | Recommended For |
|--------------------|-------------|--------------|------------------|--------------------------|
| **V8** | High | Higher | Desktop | Development & Production |
| **QuickJS** | Medium | Lower | All platforms | Mobile & Embedded |
| **JavaScriptCore** | High | Medium | macOS/iOS | Apple platforms |
| **Browser** | High | Lower | Web | Web |

### Target Types

> **Note:** The `Godot.app` isn't signed for MacOS you need to [allow to open it](https://support.apple.com/en-us/102445#:~:text=If%20you%20want%20to%20open%20an%20app%20that%20hasn%E2%80%99t%20been%20notarized%20or%20is%20from%20an%20unidentified%20developer).
- **Editor**: Full Godot editor with GodotJS support
- **Template**: Export templates for building your games
- **Debug**: Debug versions with additional logging and debugging features

## Create a new project

Expand All @@ -25,14 +49,16 @@ godot --version
3. Run `cd <your-project>`
4. Run `npm i`
5. Run `npm run dev` - this will enable typescript watch mode and opens the editor
6. Inside the editor [install preset files](#install-preset-files) via `Project > Tools > GodotJS > Install Preset files`
6. Inside the editor [install preset files](#install-preset-files) via
`Project > Tools > GodotJS > Install Preset files`
7. Click `OK` to confirm a list of files will be generated in the project.
8. Attach the `example.ts` script to a node and run the project

### Manually

1. Run `godot -p` and create a new project
2. Inside the editor [install preset files](#install-preset-files) via `Project > Tools > GodotJS > Install Preset files`
2. Inside the editor [install preset files](#install-preset-files) via
`Project > Tools > GodotJS > Install Preset files`
3. Click `OK` to confirm a list of files will be generated in the project.
4. Run `cd <your-project>`
5. Run `npm i`
Expand Down Expand Up @@ -69,6 +95,7 @@ npx tsc
npx tsc -w
```

Also, you can simply click the tool button on _GodotJS_ bottom panel in the godot editor. It'll do the same thing for you.
Also, you can simply click the tool button on _GodotJS_ bottom panel in the godot editor. It'll do the same thing for
you.

![TSC Watch](images/tsproj_tsc_watch.png)
29 changes: 0 additions & 29 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@ hide:
**_-- TypeScript/JavaScript Support for Godot 4.x by leveraging the high-performance capabilities of V8 to bring the delightful development experience of TypeScript into Godot.
--_**

Supports JavaScript engines:

- V8
- QuickJS
- JavaScriptCore
- Directly run scripts on the host browser JS VM when porting to web.

![typescript_intellisence](images/typescript_intellisence.png)

Expand All @@ -34,29 +28,6 @@ Read the [getting-started](documentation/getting-started.md).
- [Worker threads](documentation/experimental/worker.md) (limited support) (**experimental**)
- Asynchronously loaded modules (limited support) (_temporarily only available in v8.impl, quickjs.impl_)

## Getting the engine

No installation or setup necessary.
The binaries for download are the complete, usable Godot editor
and engine with JavaScript/TypeScript language support.

### Binary downloads

Download the binaries from the [Releases](https://github.com/godotjs/GodotJS/releases).

### Choose your engine

Before initiating, make sure to select the JavaScript runtime you prefer between `v8`, `QuickJS` and `Web` (See [Supported Platforms](#supported-platforms)):

- `v8` is proven to be one of the most powerful and high-performance JavaScript runtimes.
- `QuickJS` is a remarkable and lightweight option.
- `JavaScriptCore` is the built-in JavaScript engine for WebKit and bundled with macOS/iOS.
- `Web` is only suitable when building for Web. All scripts run on the host browser JS VM rather than an additional interpreter.

### Building from source

In some cases you want or need to build the engine from source.
Read the [Building from Source](documentation/building-from-source/) documentation in this case.

## Examples

Expand Down
Loading