Skip to content

Commit e71172f

Browse files
committed
docs: update readme
1 parent e428059 commit e71172f

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

LICENSE

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2022 Travis Whitton
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# TSC-PICO-8 - TypeScript for PICO-8
1+
# TS-PICO-8 - TypeScript for PICO-8
22

33
![](pico8.png)
44

55
Create [PICO-8](https://www.lexaloffle.com/pico-8.php) games in TypeScript!
66

7-
TSC-PICO-8 contains all the function declarations (`.d.ts`) for the PICO-8 API
7+
TS-PICO-8 contains all the function declarations (`.d.ts`) for the PICO-8 API
88
and will compile your TypeScript code to Lua and inject it into your PICO-8 cart.
99

1010
Compression and mangling options are configurable to optimize for token usage, and
@@ -23,20 +23,22 @@ using a typed language with PICO-8.
2323

2424
### Prerequisites
2525

26-
1. Install a recent version of NodeJS
27-
2. Clone this repository to your local machine
28-
3. Install dependencies `npm install`
26+
1. Install a recent version of PICO-8
27+
2. Install a recent version of NodeJS
28+
3. Clone this repository to your local machine
29+
4. Install dependencies `npm install`
2930

3031
### Create a PICO-8 project
3132

3233
1. Run `bin/tspico8 init` to generate the default workspace `p8workspace`.
33-
2. Optionally configure `p8workspace/tspico8.json` to specify compression, mangling, and pico-8 location.
34+
2. Optionally configure `p8workspace/tspico8.json` to specify compression, mangling, and pico-8 location. Note: tspico8 will attempt to detect the pico-8 location automatically.
3435
3. Run `bin/tspico8 run` to watch for changes inside of `p8workspace` and recompile/relaunch when detected.
3536

3637
### Configuration (tspico8.json)
3738

3839
```
3940
{
41+
// Set this if tspico8 can't find your pico-8 install automatically
4042
"pico8": {
4143
"executable": "path/to/pico8/executable/file"
4244
},
@@ -74,9 +76,9 @@ Lua is accomplished as follows.
7476

7577
1. A file watcher (chokidar) watches `p8workspace` for any changes to `*.ts` or `spritesheet.png`.
7678
2. When a change is detected, `tsc` is invoked and the resulting JavaScript dumps to `p8workspace/build/compiled.js`.
77-
3. A second file watcher (chokidar) detecs a change to `compiled.js` and runs uglify with the params
78-
provided in `tspico8.json` to produce a compressed JavaScript file `p8workspace/build/compressed.js`.
79-
4. The compressed JavaScript file is then fed to a PICO-8 specific JavaScript to Lua compiler (jspicl-cli) that does something very close to a one to translation and assembles the final cart.
79+
3. The `compiled.js` is fed into uglify with the params provided in `tspico8.json`
80+
to produce a compressed JavaScript file `p8workspace/build/compressed.js`.
81+
4. The compressed JavaScript file is then fed to a PICO-8 specific JavaScript to Lua compiler (jspicl-cli) that does something very close to a one-to-one translation and assembles the final cart.
8082

8183
The PICO-8 Lua interpreter is somewhat limited compared to modern Lua, so there are a lot of
8284
scenarios where unexpected output from any stage of this process can break your cart.

src/tspico8.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env node
2+
13
import * as child_process from "child_process";
24
import * as fse from "fs-extra";
35
import * as path from "path";

0 commit comments

Comments
 (0)