Chore/monorepo migration - #3
Merged
Merged
Conversation
Added two new hooks for comprehensive TanStack Query coverage: - useBlockingInfiniteQuery: UI blocking for infinite scrolling and pagination - useBlockingQueries: unified blocking for multiple parallel queries Refactored all hooks to use shared utilities: - useBlockingManager: centralized blocker lifecycle management - resolveBlockingReason: dynamic reason selection logic - useQueryBlockerId, useMutationBlockerId, useRandomBlockerId: ID generators
- Update peer dependency from ^0.5.0 to ^0.6.0 - Compatible with new updateBlocker function - Compatible with clear operations middleware events - Compatible with priority validation
- Update peer dependency to react-action-guard ^0.6.0 - Add timeline visualization for "clear" and "clear_scope" events - Add color coding for clear operations
… concepts - Rewrote all 14 JSDoc examples to demonstrate library value proposition - useBlockingQuery: scope isolation, background refresh, error handling, multi-scope - useBlockingMutation: multi-component coordination, priority system, error blocking - useBlockingInfiniteQuery: visual feedback patterns, scope isolation - useBlockingQueries: parallel coordination, dynamic arrays, app initialization - All examples now show useIsBlocked/useBlockingInfo usage - Demonstrates clear advantages over vanilla TanStack Query
- Added detailed JSDoc for ActionGuardDevtools component - 5 usage examples: basic setup, positioning, isolated stores, production - Props documentation with defaults and types - Production behavior and performance notes - devtoolsMiddleware integration examples - README improvements with quick start guide
ci: bump workflow Node matrix to 22/24
ci: bump workflow Node matrix to 22/24
ci: bump workflow Node matrix to 22/24
Snapshot of pending edits (typed hooks, tests, docs) prior to restructuring this repo into packages/core.
Restructure this repo as a pnpm workspace monorepo. This repo becomes the monorepo root; the published @okyrychenko-dev/react-action-guard package moves to packages/core with git history preserved via rename detection. Switches package management from npm to pnpm workspaces (root pnpm-lock.yaml replaces per-package package-lock.json), and repoints husky hooks at the workspace root.
- Drop per-package husky/.github/package-lock.json now that the root owns hooks, CI, and the single pnpm-lock.yaml - Add repository.directory to each package.json; link internal @okyrychenko-dev/react-action-guard devDependency via workspace:* - Move zustand-toolkit/postcss/brace-expansion/minimatch overrides from scattered per-package `overrides` fields into pnpm-workspace.yaml (pnpm ignores package.json-level overrides in workspaces) - Add changesets (independent per-package versioning, peer ranges auto-bumped via updateInternalDependencies) and rewrite ci.yml / release.yml for pnpm + changesets - Add a "Changeset check" CI job (pull_request only) that runs `changeset status --since=origin/main`, the documented changesets pattern for failing a PR that touches a package without adding a changeset - Pin @tanstack/react-query, react-router-dom, eslint-plugin-react-hooks and typescript-eslint devDependencies to the exact versions each package's old npm lockfile had resolved. pnpm's isolated resolution picked newer versions for these loose semver ranges than npm's historical lockfiles did, which surfaced real breakage (a removed `NoInfer` export, a renamed `unstable_mask` field, and stricter react-hooks/unbound-method lint rules) unrelated to the migration itself; pinning restores the tested/published state - devtools was missing @types/node and used the classic `@storybook/react` import where every other story file in the repo uses `@storybook/react-vite` -- both were phantom-dependency issues only visible now that pnpm no longer hoists them in - Update 6 story files (devtools, router) off the deprecated `useBlocker` alias onto `useActionBlocker`, since linking against the local workspace core (rather than the last npm-published version) surfaces its in-progress deprecation - Apply prettier to packages/core, packages/ui (31 files), and packages/tanstack (1 file) where formatting had drifted from the shared root .prettierrc.json before format:check was ever wired in; whitespace-only, no logic changes - Add a root README.md with the package table, dependency flow, dev commands, and how releasing works - Fix Development/Contributing sections in every package README: they still said `npm install` / `npm run <script>` from the package's old standalone repo root; replaced with pnpm --filter (or cd packages/<x>) equivalents, and added a changeset reminder to each Contributing checklist - Fix bugs/homepage in each package.json: they pointed at the old standalone repos (or, for core, at the monorepo root README instead of packages/core's own); all five now point at the shared monorepo issue tracker and their own packages/<x> tree Verified: build, typecheck, lint, format:check, and test:run are all green across all 5 packages (643 tests passing), and `npm pack --dry-run` file lists for every package are byte-identical to their pre-migration baseline.
Repo restructuring only; no package's published output changed (verified via npm pack --dry-run diff). No version bump needed.
typecheck/lint/test in ui, tanstack, router, and devtools all resolve @okyrychenko-dev/react-action-guard via workspace:*, whose types/main fields point at dist/. On a fresh checkout, that dist/ doesn't exist until core is built, so a naive CI step order (typecheck before build) fails with "Cannot find module" -- confirmed on the pushed branch. Rather than papering over it by reordering steps, decouple the checks from the build entirely: - Extract shared compilerOptions into a root tsconfig.base.json; each package's tsconfig.json (used by tsup for the actual build) now just extends it with its own outDir/rootDir -- unchanged as far as tsup is concerned. - Add tsconfig.typecheck.json in each of ui/tanstack/router/devtools, extending tsconfig.json and adding a paths mapping straight to packages/core/src/index.ts. rootDir is widened to the common parent since core's source now enters the program. core's window.types.ts (an ambient Window.gtag/mixpanel/amplitude augmentation with no explicit importer) is included explicitly since path-based inclusion only pulls in files actually imported through the module graph. - Point each package's typecheck script and ESLint's parserOptions.project at tsconfig.typecheck.json instead of projectService's default discovery, so lint's type-aware rules resolve the same way. - Verified this doesn't leak into what tsup publishes: tsup marks the package external, and esbuild/rollup-plugin-dts both short-circuit external specifiers before consulting tsconfig paths -- dist output byte-size-identical with and without the paths mapping present. typecheck and lint for all 5 packages now pass with zero prior build. Only `test` (real Vite/Node module resolution, not tsconfig paths) and `build` itself still need core built, so ci.yml/release.yml now run: typecheck -> lint -> format:check -> build -> test. Also: - Finished the useBlocker -> useActionBlocker rename in core (the folder/file names now match the canonical export instead of keeping the old name with a deprecated alias re-export). - Un-pinned @tanstack/react-query, react-router-dom, eslint-plugin-react-hooks, and typescript-eslint back to normal ^ ranges now that the underlying issues are actually fixed in source rather than dodged by holding old tool versions. - Added engines.node >=22 to the root package.json. Verified end-to-end from a clean slate (removed node_modules and all dist, pnpm install --frozen-lockfile, ran typecheck/lint/format/build/ test in the new CI order): all green, 643 tests passing. npm pack --dry-run file lists are unchanged for all 5 packages.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This monorepo was assembled via git subtree from 4 previously separate, already-tested repos. Codecov's patch check diffs this PR against origin/main, which never contained ui/tanstack/router/devtools at all -- so their entire pre-existing source shows up as "new" diff, and patch coverage collapses to roughly each package's own overall coverage (~91%, matching devtools' own 91.38% statement coverage almost exactly) rather than signaling anything about actually-untested new work. - ignore: barrel index.ts/index.tsx (pure re-exports, already excluded from vitest's own coverage config in core/tanstack) plus Storybook .stories.tsx/.mdx files - coverage.status.patch: informational -- still visible on PRs, no longer blocks/fails CI on structural changes like this migration - coverage.status.project: target auto with a 1% threshold, so real regressions in normal future PRs still gate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Merges the 5 previously-separate
@okyrychenko-dev/*package repos(
react-action-guard,react-action-guard-ui,-tanstack,-router,-devtools) into this repo as a pnpm workspace monorepo, underpackages/*.react-zustand-toolkitstays a separate repo/dependency.No impact on npm consumers. Each package keeps its own name,
version, and independent release cadence.