Skip to content

Commit

Permalink
fix(docs): formatting, typos, new global func described, project dire…
Browse files Browse the repository at this point in the history
…ctory structure described (#33)

* fix: more consistent formatting

* fix: add missing reference to fixed_update

* fix: update mention of eslint file type and add mention of other configuration files

* fix: capitalization
  • Loading branch information
thinknathan authored Aug 12, 2024
1 parent edc7743 commit c6724f0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion config/jargon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ tstl:
name: TSTL
long_name: TypeScriptToLua Transpiler
description: An extension to the TypeScript compiler that transpiles TypeScript
code to lua
code to Lua
wip:
name: WIP
long_name: Work In Progress
Expand Down
6 changes: 3 additions & 3 deletions content/configuration/def-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ title: "Defold API"
order: 3
---

Getting accurate types for the Defold API is an important part of ts-defold. Here are some
Getting accurate types for the Defold API is an important part of ***ts-defold***. Here are some
ways to get the definitions you need:

:sparkles: The `types` library is built-in into all ts-defold templates, and is automatically
:sparkles: The `types` library is built-in into all ***ts-defold*** templates, and is automatically
published to keep up with the latest changes to Defold.

:star2: [TS-Defold Types II](https://github.com/thinknathan/ts-defold-types)
Expand Down Expand Up @@ -45,7 +45,7 @@ const result = (go.get_position() + vmath.vector3(1, 1, 1)) as vmath.vector3; //

Or you can use the
[Operator Map Types](https://typescripttolua.github.io/docs/advanced/language-extensions#operator-map-types)
provided by TSTL to enable full type checking.
provided by _TSTL_ to enable full type checking.

:notes: [Utility Types](https://github.com/thinknathan/tsd-util-types/blob/main/types/vmath.d.ts)
include all relevant vector math operations.
Expand Down
2 changes: 1 addition & 1 deletion content/configuration/def-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ a strictly typed language like TypeScript. Here's how we handle it:
# Library

The [@ts-defold/library](https://github.com/ts-defold/library) contains user-submitted
types for popular Defold extensions. The library is included in all ts-defold templates.
types for popular Defold extensions. The library is included in all ***ts-defold*** templates.
Install your preferred extensions in Defold, then type `npm run resolve` to fetch
the matching types from the library.

Expand Down
10 changes: 5 additions & 5 deletions content/configuration/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ title: "Plugins"
order: 2
---

[TypeScriptToLua](https://typescripttolua.github.io/docs/api/plugins) allows you to extend the transpilers behavior and ***ts-defold*** uses this _API_ to bring some quality of life and necessary features to using TypeScript with Defold.
[TypeScriptToLua](https://typescripttolua.github.io/docs/api/plugins) allows you to extend the transpiler's behavior and ***ts-defold*** uses this _API_ to bring some quality of life and necessary features to using TypeScript with Defold.

## Export Globals

The [tstl-export-to-global](https://github.com/thinknathan/tstl-export-to-global)
plugin is used to allow the export function to emulate the expected behavior of
"exports" in a Defold game script.

The `init`, `on_input`, `on_message`, `on_reload`, `update`, and `final` functions
are executed on each game script by the Defold game engine. Each of those functions
are expected to be defined in the file scope of the game script for the game engine
to execute them.
The `init`, `on_input`, `on_message`, `on_reload`, `update`, `fixed_update`, and
`final` functions are executed on each game script by the Defold game engine.
Each of those functions are expected to be defined in the file scope of the
game script for the game engine to execute them.

To adhere to these requirements, the ***tstl-export-to-global*** plugin will hoist
all exports to the global scope of the file.
Expand Down
4 changes: 3 additions & 1 deletion content/gettingstarted/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ npm init @ts-defold ./project-name
***@ts-defold/create*** templates follow this common directory structure

```bash
├─ .eslintrc # Eslint configured to handle the caveats of TSTL & ts-defold
├─ .prettierrc.json # Configuration for prettier code formatting
├─ eslint.config.mjs # Eslint configured to handle the caveats of TSTL & ts-defold
├─ package.json # NPM package dependencies and metadata
├─ tsconfig.json # TypeScript compiler configuration for TSTL & ts-defold
├─ .github/ # Github workflows and automation [optional]
├─ .vscode/ # Settings, extensions, and tasks for Visual Studio Code
├─ @types/ # Type definitions for your project and native extensions
├─ app/ # The Defold game project
│ ├─ lualib_bundle.lua # TypeScript support library
Expand Down
7 changes: 6 additions & 1 deletion content/gettingstarted/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,15 @@ system and configuration.</Info>
## Project Directory Structure

```bash
├─ .eslintrc # Eslint configured to handle the caveats of TSTL & ts-defold
├─ .prettierrc.json # Configuration for prettier code formatting
├─ eslint.config.mjs # Eslint configured to handle the caveats of TSTL & ts-defold
├─ package.json # NPM package dependencies and metadata
├─ tsconfig.json # TypeScript compiler configuration for TSTL & ts-defold
├─ .github/ # Github workflows and automation [optional]
├─ .vscode/ # Settings, extensions, and tasks for Visual Studio Code
├─ @types/ # Type definitions for your project and native extensions
├─ app/ # The Defold game project
│ ├─ lualib_bundle.lua # TypeScript support library
│ ├─ modules/ # Transpiled shared lua modules
Expand Down
2 changes: 1 addition & 1 deletion content/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ your [Defold](https://defold.com) game projects.
## Why TypeScript? :sparkles:

Defold uses Lua for its game scripting language, and it is an excellent choice!
The ts-defold team loves Lua, and has worked with Lua for years. So why TypeScript?
The ***ts-defold*** team loves Lua, and has worked with Lua for years. So why TypeScript?

TypeScript brings compile-time type-checking, generics, cutting-edge IDE support,
better code maintainability, a familiar syntax, and a lot of other cool features.
Expand Down

0 comments on commit c6724f0

Please sign in to comment.