thrunium 1.2.0-rc.1 → 1.2.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -3
- package/dist/cli.mjs +377 -91
- package/dist/thrunium.js +15 -5
- package/dist/thrunium.min.js +2 -2
- package/dist/thrunium.min.js.map +2 -2
- package/dist/types/game.d.ts +29 -12
- package/dist/types/reference.d.ts +1 -1
- package/package.json +1 -1
- package/templates/ts/tsconfig.json +1 -1
- package/templates/js/index.html +0 -6
- package/templates/ts/index.html +0 -6
- package/templates/ts/pnpm-workspace.yaml +0 -4
- /package/templates/js/{src/main.js → game.js} +0 -0
- /package/templates/{js → pnpm}/pnpm-workspace.yaml +0 -0
- /package/templates/ts/{src/main.ts → game.ts} +0 -0
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ The engine is also on npm as `thrunium` (Node 24 or newer):
|
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
37
|
npx thrunium init my-game # new TypeScript project; add --js for JavaScript
|
|
38
|
-
cd my-game &&
|
|
38
|
+
cd my-game && npm run dev # init installs for you; use pnpm dev, yarn dev or bun run dev
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
```ts
|
|
@@ -57,10 +57,20 @@ Commands (`thrunium --help`, `--version`):
|
|
|
57
57
|
|---|---|
|
|
58
58
|
| `thrunium dev` | `--port <n>` (default 3000, tries the next 10 ports if busy), `--host <name>` (default `localhost`), `--no-open` |
|
|
59
59
|
| `thrunium build` | `--out <dir>` (default `dist`), `--engine cdn\|bundle` |
|
|
60
|
-
| `thrunium init [dir]` | `--js` (TypeScript by default)
|
|
60
|
+
| `thrunium init [dir]` | `--js` (TypeScript by default), `--pm npm\|pnpm\|yarn\|bun` (default: the one that ran it, else npm), `--no-install`; the folder must be empty. Installs by default; if that fails the project is kept and the command is printed |
|
|
61
|
+
|
|
62
|
+
A project needs no `index.html`: without one, `dev` and `build` generate the page
|
|
63
|
+
from `game.json` (`entry`, else the first of `game.ts`, `game.js`, `src/game.ts`,
|
|
64
|
+
`src/game.js`; the title is `name`, else the folder name). A hand-written
|
|
65
|
+
`index.html` is used as written, and having both it and `entry` is an error.
|
|
66
|
+
`import './style.css'` from game code is bundled and linked, with `url()` fonts and
|
|
67
|
+
images; remote `@import` stays remote. A generated page takes a title, description,
|
|
68
|
+
favicon, link-preview image, address and language from `page` in `game.json`, and
|
|
69
|
+
the contents of an optional `head.html` and `body.html` (see the "Dev server and
|
|
70
|
+
builds" guide). None of these mix with a hand-written `index.html`.
|
|
61
71
|
|
|
62
72
|
`dev` never uses the CDN. For a project with a module entry
|
|
63
|
-
(`<script type="module" src=...>` importing `thrunium`), `build` has two engine
|
|
73
|
+
(a generated page, or `<script type="module" src=...>` importing `thrunium`), `build` has two engine
|
|
64
74
|
modes. `cdn` (the default) adds a script tag for
|
|
65
75
|
`https://cdn.thrungames.com/thrunium/v<version>/thrunium.min.js` with a `sha384`
|
|
66
76
|
integrity hash, pinned to the installed version. It fails, and leaves the output
|