watchpot 1.0.0-rc.2 → 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 CHANGED
@@ -2,6 +2,10 @@
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
+
5
9
  ## 1.0.0-rc.2
6
10
 
7
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.
@@ -1,3 +1,5 @@
1
+ /// <reference types="zustand/middleware" preserve="true" />
2
+ /// <reference types="zustand/middleware/immer" preserve="true" />
1
3
  import type { Draft } from "immer";
2
4
  import type { Mutate, StoreApi } from "zustand/vanilla";
3
5
  import type { Decimal } from "./decimal";
@@ -1,3 +1,5 @@
1
+ /// <reference types="zustand/middleware" preserve="true" />
2
+ /// <reference types="zustand/middleware/immer" preserve="true" />
1
3
  import type { Draft } from "immer";
2
4
  import type { Mutate, StoreApi } from "zustand/vanilla";
3
5
  import type { Decimal } from "./decimal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "watchpot",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -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
- /** Copies the template into `out`, leaving out its scaffold, installs and git folder. */
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. */
@@ -0,0 +1,5 @@
1
+ node_modules/
2
+ dist/
3
+ .env
4
+ *.log
5
+ bash.exe.stackdump