tanstack-router-cache 0.1.2 → 0.1.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
@@ -55,8 +55,7 @@ For the full API, see [docs](./docs).
55
55
 
56
56
  ## Examples
57
57
 
58
- - [Basic](https://github.com/santiago-ramos-02/tanstack-router-cache/tree/main/examples/basic): the smallest useful setup. Start here; most apps only need this pattern.
59
- - [Power-user demo](https://github.com/santiago-ramos-02/tanstack-router-cache/tree/main/examples/power-user-demo): a larger demo with retained forms, filtered lists, cache controls, route lifecycle state, and window scroll restoration. Use it when you need to inspect edge cases.
58
+ - [Demo app](https://github.com/santiago-ramos-02/tanstack-router-cache/tree/main/examples/demo): one Vite app with a basic flow for most users and a power-user flow for edge cases.
60
59
 
61
60
  ## Acknowledgements
62
61
 
package/dist/index.cjs CHANGED
@@ -371,10 +371,7 @@ function useRouterCacheDebug(cachedRoutes, visiblePathname) {
371
371
  warningThreshold: warningThresholdRef.current
372
372
  };
373
373
  const warningThreshold = warningThresholdRef.current;
374
- if (typeof warningThreshold === "number" && nextSnapshot.totalCachedRouteCount > warningThreshold && lastWarnedCountRef.current !== nextSnapshot.totalCachedRouteCount) {
375
- lastWarnedCountRef.current = nextSnapshot.totalCachedRouteCount;
376
- console.warn("[tanstack-router-cache] cached route count exceeded threshold", nextSnapshot);
377
- }
374
+ if (typeof warningThreshold === "number" && nextSnapshot.totalCachedRouteCount > warningThreshold && lastWarnedCountRef.current !== nextSnapshot.totalCachedRouteCount) lastWarnedCountRef.current = nextSnapshot.totalCachedRouteCount;
378
375
  });
379
376
  return () => {
380
377
  globalThis.cancelAnimationFrame(rafId);
package/dist/index.js CHANGED
@@ -370,10 +370,7 @@ function useRouterCacheDebug(cachedRoutes, visiblePathname) {
370
370
  warningThreshold: warningThresholdRef.current
371
371
  };
372
372
  const warningThreshold = warningThresholdRef.current;
373
- if (typeof warningThreshold === "number" && nextSnapshot.totalCachedRouteCount > warningThreshold && lastWarnedCountRef.current !== nextSnapshot.totalCachedRouteCount) {
374
- lastWarnedCountRef.current = nextSnapshot.totalCachedRouteCount;
375
- console.warn("[tanstack-router-cache] cached route count exceeded threshold", nextSnapshot);
376
- }
373
+ if (typeof warningThreshold === "number" && nextSnapshot.totalCachedRouteCount > warningThreshold && lastWarnedCountRef.current !== nextSnapshot.totalCachedRouteCount) lastWarnedCountRef.current = nextSnapshot.totalCachedRouteCount;
377
374
  });
378
375
  return () => {
379
376
  globalThis.cancelAnimationFrame(rafId);
package/docs/releases.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Releases
2
2
 
3
- This package publishes from GitHub Actions after a version tag is pushed.
3
+ This package publishes from GitHub Actions after a version tag is pushed. A regular commit to `main` only runs CI and updates the GitHub repo. It does not publish to npm.
4
4
 
5
5
  ## Trusted publishing
6
6
 
@@ -14,13 +14,37 @@ npm trust github tanstack-router-cache --repo santiago-ramos-02/tanstack-router-
14
14
 
15
15
  ## Publishing a version
16
16
 
17
- 1. Update `version` in `package.json`.
18
- 2. Commit the change.
19
- 3. Tag the same version:
17
+ Work in the package repo:
20
18
 
21
19
  ```sh
22
- git tag v0.2.0
23
- git push origin main --tags
20
+ cd packages/tanstack-router-cache
24
21
  ```
25
22
 
26
- The workflow checks that the tag matches `package.json` before publishing.
23
+ For normal changes:
24
+
25
+ ```sh
26
+ bun run check
27
+ git add .
28
+ git commit -m "Your change"
29
+ git push origin main
30
+ ```
31
+
32
+ That updates GitHub and runs CI, but it does not publish to npm.
33
+
34
+ For a release, start from a clean `main` branch after your changes are already committed:
35
+
36
+ ```sh
37
+ bun run release:prepare patch
38
+ bun run release:push
39
+ ```
40
+
41
+ Use `minor`, `major`, or an exact version when needed:
42
+
43
+ ```sh
44
+ bun run release:prepare minor
45
+ bun run release:prepare 0.2.0
46
+ ```
47
+
48
+ `release:prepare` updates `package.json`, runs the package checks, commits the version bump, and creates the matching tag locally. `release:push` pushes `main` and that exact tag. The tag starts the npm publish workflow.
49
+
50
+ The workflow checks that the tag matches `package.json` before publishing, so a mismatched tag cannot publish accidentally.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tanstack-router-cache",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Route view caching for TanStack Router.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -46,9 +46,12 @@
46
46
  "build": "bun run clean && rolldown -c && tsc",
47
47
  "typecheck": "tsc --noEmit",
48
48
  "clean": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\"",
49
- "lint": "biome lint src rolldown.config.ts --skip=lint/performance/noBarrelFile --skip=lint/style/useConsistentTypeDefinitions --skip=lint/suspicious/noConsole",
50
- "lint:fix": "biome lint src rolldown.config.ts --write --skip=lint/performance/noBarrelFile --skip=lint/style/useConsistentTypeDefinitions --skip=lint/suspicious/noConsole",
51
- "pack:dry-run": "bun pm pack --dry-run",
49
+ "lint": "biome lint src scripts .github/scripts rolldown.config.ts --skip=lint/performance/noBarrelFile --skip=lint/style/useConsistentTypeDefinitions --skip=lint/suspicious/noConsole",
50
+ "lint:fix": "biome lint src scripts .github/scripts rolldown.config.ts --write --skip=lint/performance/noBarrelFile --skip=lint/style/useConsistentTypeDefinitions --skip=lint/suspicious/noConsole",
51
+ "check": "bun run lint && bun run typecheck && bun run build && bun run pack:dry-run",
52
+ "pack:dry-run": "npm pack --dry-run",
53
+ "release:prepare": "node scripts/release.mjs prepare",
54
+ "release:push": "node scripts/release.mjs push",
52
55
  "prepack": "bun run build",
53
56
  "prepublishOnly": "bun run lint && bun run typecheck"
54
57
  },