watchpot 1.0.0-rc.1 → 1.0.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/CHANGELOG.md +8 -0
- package/README.md +2 -3
- package/api/core/feature-types.d.ts +2 -0
- package/bin/watchpot.mjs +0 -0
- package/dist/core/feature-types.d.ts +2 -0
- package/package.json +1 -1
- package/src/core/feature-types.ts +5 -0
- package/templates/game/.scaffold/generate.ts +7 -2
- package/templates/game/gitignore +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Each release is a tag `vX.Y.Z`. A breaking change names its codemod in `codemods/` (policy in `codemods/README.md`).
|
|
4
4
|
|
|
5
|
+
## 1.0.0-rc.3
|
|
6
|
+
|
|
7
|
+
Found by scaffolding a game from npm: the published store types collapsed to `never` in a game (the declarations now load the zustand middleware types), npm dropped the template's `.gitignore` (it ships as `gitignore` and the scaffold renames it), and `create-watchpot` left a new game unformatted (it runs `lint:fix` after the install).
|
|
8
|
+
|
|
9
|
+
## 1.0.0-rc.2
|
|
10
|
+
|
|
11
|
+
The npm release of rc.1 pointed its entries at the TypeScript source instead of `dist/`, and `create-watchpot`'s rc.1 named the engine with an unresolvable `workspace:` range. Both are republished with `bun publish`, which reads the manifest `prepack` writes. No code changed.
|
|
12
|
+
|
|
5
13
|
## 1.0.0-rc.1
|
|
6
14
|
|
|
7
15
|
A clean break: the API a game is written against, redone in one release, with no deprecated aliases and no codemods.
|
package/README.md
CHANGED
|
@@ -6,9 +6,8 @@ away, the systems idle games share (currencies, generators, upgrade trees, prest
|
|
|
6
6
|
that proves the pacing. It is for developers who want to build an idle game and keep the look, the words and the
|
|
7
7
|
rules their own: the engine ships mechanism and behaviour, never a stylesheet.
|
|
8
8
|
|
|
9
|
-
**How this was made.**
|
|
10
|
-
who
|
|
11
|
-
and the docs too. It is said here so nobody has to guess: read it, use it and judge it knowing that.
|
|
9
|
+
**How this was made.** This engine is more or less completely vibe-coded, prompted closely by somebody
|
|
10
|
+
who has spent far too much time playing idle games.
|
|
12
11
|
|
|
13
12
|
## Install
|
|
14
13
|
|
package/bin/watchpot.mjs
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/// <reference types="zustand/middleware" preserve="true" />
|
|
2
|
+
/// <reference types="zustand/middleware/immer" preserve="true" />
|
|
3
|
+
// The persist and immer middlewares declare their mutators by module augmentation. These references carry it into
|
|
4
|
+
// the published declarations, where nothing else imports the middlewares: without them `IdleMutators` names mutators
|
|
5
|
+
// a game's compiler has never seen, and every store type collapses to `never`.
|
|
1
6
|
import type { Draft } from "immer";
|
|
2
7
|
import type { Mutate, StoreApi } from "zustand/vanilla";
|
|
3
8
|
import type { Decimal } from "./decimal";
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* JSX the markers are `{/* @if <f> *\/}` and `{/* @end *\/}`; in CSS, `/* @if <f> *\/` and `/* @end *\/`.
|
|
22
22
|
*/
|
|
23
23
|
import { spawnSync } from "node:child_process";
|
|
24
|
-
import { cp, mkdir, readdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
24
|
+
import { cp, mkdir, readdir, readFile, rename, rm, writeFile } from "node:fs/promises";
|
|
25
25
|
import { createRequire } from "node:module";
|
|
26
26
|
import { dirname, join, resolve } from "node:path";
|
|
27
27
|
import { fileURLToPath } from "node:url";
|
|
@@ -1231,12 +1231,17 @@ async function vacant(dir: string): Promise<boolean> {
|
|
|
1231
1231
|
/** The engine a `templates/game` folder ships in: two folders up (`<engine>/templates/game`). */
|
|
1232
1232
|
const engineOf = (template: string) => resolve(template, "..", "..");
|
|
1233
1233
|
|
|
1234
|
-
/**
|
|
1234
|
+
/**
|
|
1235
|
+
* Copies the template into `out`, leaving out its scaffold, installs and git folder. The template keeps its ignore
|
|
1236
|
+
* file as `gitignore`: npm leaves every `.gitignore` out of a published package, so the dotted name never reaches a
|
|
1237
|
+
* game made from the npm install. It becomes `.gitignore` here.
|
|
1238
|
+
*/
|
|
1235
1239
|
async function copyTemplate(out: string, template: string) {
|
|
1236
1240
|
await cp(template, out, {
|
|
1237
1241
|
recursive: true,
|
|
1238
1242
|
filter: (src) => !/[\\/](node_modules|\.git|\.scaffold)([\\/]|$)/.test(src.slice(template.length)),
|
|
1239
1243
|
});
|
|
1244
|
+
await rename(join(out, "gitignore"), join(out, ".gitignore"));
|
|
1240
1245
|
}
|
|
1241
1246
|
|
|
1242
1247
|
/** Compiles `design/tokens.json` into `src/tokens.css` with the engine's own compiler, as `bun run tokens` does. */
|