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 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 && pnpm install && pnpm dev
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); the folder must be empty |
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