@party-stack/tanstack-db-patches 0.0.0-stage → 0.2.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Robert Fidler
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,108 @@
1
- # Temporary Holding Version
1
+ # TanStack DB patches
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An Effect CLI that registers Party Stack's tested TanStack patches using pnpm's
4
+ native patch support. Run setup once; future ordinary `pnpm install` commands
5
+ apply the patches. There is no custom pnpm hook, postinstall script, runtime
6
+ import, or forked DB package.
7
+
8
+ Version `0.1.0` is **not published yet**. It targets exactly:
9
+
10
+ | Package | Version | Fix |
11
+ | -------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
12
+ | `@tanstack/db` | `1.0.0-rc.1.4` | Bounded exact ordered prefixes ([#2398](https://github.com/TanStack/db/issues/2398)) |
13
+ | `@tanstack/react-db` | `1.0.0-rc.1.4` | Synchronous Suspense readiness ([#2396](https://github.com/TanStack/db/issues/2396)) and initial-load error retries ([#2397](https://github.com/TanStack/db/issues/2397)) |
14
+
15
+ The [ordered-window contract](./ordered-window.md) explains the DB patch and
16
+ its upstream proposal. Neither patch changes React itself. See the repository's
17
+ [patch inventory](../../patches/README.md) for scope and regression coverage.
18
+
19
+ ## Setup after publication
20
+
21
+ From your pnpm project or workspace:
22
+
23
+ ```sh
24
+ pnpm dlx @party-stack/tanstack-db-patches setup
25
+ ```
26
+
27
+ The CLI knows its own version. It installs that exact version and integrity as a
28
+ pnpm `configDependency`, merges the native `patchedDependencies` paths, then runs
29
+ `pnpm install --no-frozen-lockfile` and checks the installed packages. Commit
30
+ `pnpm-workspace.yaml` and `pnpm-lock.yaml` afterward. Subsequent installs need
31
+ neither the CLI nor a `.pnpmfile.cjs`: pnpm installs config dependencies before it
32
+ needs their patch files.
33
+
34
+ To make the setup tool version explicit:
35
+
36
+ ```sh
37
+ pnpm dlx @party-stack/tanstack-db-patches@0.1.0 setup
38
+ ```
39
+
40
+ The CLI currently supports pnpm `10.34.6` and newer 10.x, with `10.34.6` tested.
41
+ The Effect CLI and Node platform implementation are bundled into the executable;
42
+ the package has no runtime dependencies or lifecycle scripts, as required for a
43
+ pnpm config dependency. It changes only project-local pnpm configuration.
44
+
45
+ ## Commands
46
+
47
+ ```sh
48
+ pnpm dlx @party-stack/tanstack-db-patches setup --core-only
49
+ pnpm dlx @party-stack/tanstack-db-patches setup --no-install
50
+ pnpm dlx @party-stack/tanstack-db-patches check
51
+ pnpm dlx @party-stack/tanstack-db-patches setup --cwd /path/to/workspace
52
+ ```
53
+
54
+ - `--core-only` registers/checks core DB without requiring React DB. It leaves
55
+ existing independently managed patches alone.
56
+ - `--no-install` writes configuration; run `pnpm install` yourself afterward.
57
+ - `check` verifies the patch paths, installed upstream versions, and patched
58
+ distribution code. Pass the same `--core-only` selection used during setup.
59
+ - Invocations inside an app resolve its enclosing pnpm workspace root.
60
+
61
+ Unrelated settings and patch meanings are preserved. A conflicting patch for
62
+ the same exact target fails before setup overwrites it. The CLI does not upgrade
63
+ TanStack versions, enable `allowUnusedPatches`, or ignore patch failures. Install
64
+ the supported versions; another release needs separately reviewed patches.
65
+
66
+ ## Use the unpublished package
67
+
68
+ Build and pack it from this repository:
69
+
70
+ ```sh
71
+ pnpm exec vp run @party-stack/tanstack-db-patches#build
72
+ pnpm --dir packages/tanstack-db-patches pack --pack-destination /tmp
73
+ ```
74
+
75
+ Until publication, unpack the tarball inside a consumer workspace and use local
76
+ mode. The vendored directory must remain checked in so later installs can find
77
+ the patch files:
78
+
79
+ ```sh
80
+ mkdir -p vendor/tanstack-db-patches
81
+ tar -xzf /tmp/party-stack-tanstack-db-patches-0.1.0.tgz -C vendor/tanstack-db-patches --strip-components=1
82
+ node vendor/tanstack-db-patches/lib/cli.js setup --local
83
+ ```
84
+
85
+ `--local` requires the package to live inside the target workspace; it rejects a
86
+ temporary `dlx` cache path. It registers those stable files directly and does not
87
+ add a config dependency. This repository uses the same package's patch files.
88
+ For a local-mode install, use `check --local` from that same package.
89
+
90
+ `pnpm add --config /path/to/package.tgz` is not supported by pnpm: config
91
+ dependencies require registry metadata and integrity. Local mode avoids that
92
+ bootstrap requirement. Once published, use the normal one-command setup.
93
+
94
+ ## Verification
95
+
96
+ ```sh
97
+ pnpm exec vp run @party-stack/tanstack-db-patches#test
98
+ pnpm exec vp run @party-stack/tanstack-db-patches#verify-distribution
99
+ ```
100
+
101
+ The opt-in distribution test packs the standalone executable and serves it from
102
+ a disposable loopback npm registry. It tests normal `dlx setup/check`, core-only
103
+ and vendored local installs, both patches' source/distribution changes, one
104
+ shared DB identity, repeated setup, unrelated patches, conflict refusal and a
105
+ clean frozen-lockfile reinstall. No package is published externally.
106
+
107
+ See pnpm's [config dependency](https://pnpm.io/10.x/config-dependencies) and
108
+ [patch](https://pnpm.io/10.x/cli/patch) documentation.