Skip to content

refactor: share admin users hooks helper - #32

Merged
thinkclay merged 1 commit into
mainfrom
codex/create-shared-helper-for-admin-users-hooks
Sep 23, 2025
Merged

thinkclay merged 1 commit into
mainfrom
codex/create-shared-helper-for-admin-users-hooks

Conversation

@thinkclay

Copy link
Copy Markdown
Contributor

Summary

  • add a shared createAdminUsersHooks helper that also exposes mergeOrganizationId
  • update the Next.js and Expo API utilities to reuse the shared helper while keeping platform-specific client setup

Testing

  • npx tsc -p app/core/tsconfig.json --noEmit --pretty false (fails: existing type errors in unrelated packages)

https://chatgpt.com/codex/tasks/task_b_68d20ce32afc8331a7e93d96ee450000

@thinkclay
thinkclay merged commit b857219 into main Sep 23, 2025
@thinkclay
thinkclay deleted the codex/create-shared-helper-for-admin-users-hooks branch September 23, 2025 03:13
thinkclay added a commit that referenced this pull request Sep 17, 2026
`@scaffald/ui-docs:build` fails in CI on the ui pointer bump:

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

The same build passes locally, and re-running the CI job reproduces it, so it is
environmental rather than flaky and I have not yet found the difference.
Scaffald/ui#32 declaring the dependency on the docs site was not enough.

Sentry removal does not depend on any of that, is verified, and is the larger
half of the saving. So the pointer goes back to what main has and the icon work
moves to its own PR, where the docs build can be debugged without holding this
up. Scaffald/ui#31 and #32 are already merged on the ui side; only the pointer
bump is deferred.

Co-Authored-By: Claude Opus 5 <[email protected]>
thinkclay added a commit that referenced this pull request Sep 17, 2026
* perf: remove Sentry, and the duplicate icon set — 17.4 MB → 12.1 MB

The bundle audit in #791 found the web entry bundle was 17.4 MB, and that two
things accounted for over a third of it. Both are now gone.

    entry bundle   17.42 MB  ->  12.07 MB   (-5.35 MB, -30.7%)
    brotli         3.27 MB   ->   1.90 MB   (-42%)

Attribution before and after, through the source map:

    @sentry/*    3.62 MB  ->  0.00 MB
    lucide*      2.20 MB  ->  1.14 MB

## Sentry, removed entirely

22.9% of the bundle, and roughly 2 MB of that was `@sentry/core` bundled **five
times** — one version at the root (10.38.0) and a newer one (10.73.0) nested
under `react`, `replay`, `replay-canvas`, `feedback` and `browser-utils`. The
bundle showed it independently: 293 groups of byte-identical modules, almost all
in ×5 sets.

Removed rather than deduplicated, per the call to drop it. Gone: the
`utils/sentry/` module and its four setup docs, `SentryTestButtons` (defined,
never used), `scripts/setup-sentry.mjs` and its doc, the `setup-sentry` step in
both prebuild scripts, four `@sentry/*` dependencies across three package.json
files, six `EXPO_PUBLIC_SENTRY_DSN_*` entries in eas.json, the DSN types in
environment.d.ts, the `extra.sentry` block in app.config.ts, and the test mock,
validator and validator registration.

**What this costs, stated plainly:** there is no remote error reporting any
more. `logger.error` prints and stops there. Two places were quietly relying on
Sentry to be the real sink, and both are corrected rather than left:

* `ErrorBoundary.componentDidCatch` logged only under `__DEV__` and otherwise
  handed the error to Sentry. That branch would have made every caught error in
  production silent, so it now logs unconditionally.
* `logger.warn` sent production warnings to Sentry and printed nothing. It now
  prints in development and does nothing in production — by design rather than
  by accident, and the comment says so.

Two compliance documents named Sentry as a processor and would have been false:

* `PrivacyScreen` listed "Crash data — Sentry crash reporting", a "Performance
  data" row that was Sentry's, and Sentry among service providers.
* `play-store-assets/metadata/data-safety.md` used it in the reasoning for why
  "Shared" is No everywhere.

Both updated. **If the privacy text is version-controlled in
`core.legal_documents`, this needs a published version per migration 342's
runbook — flagging rather than assuming.**

## The second icon set

`lucide-react` was imported in exactly one file, for two icons, while 369 files
use `lucide-react-native`. Metro tree-shakes neither barrel, so that one import
shipped a complete second icon set: 1,439 modules, 1.07 MB.

The fix was deleting `BreadcrumbIcons.web.tsx` — its sibling already exports the
same two names from `lucide-react-native`, and the three consumers import
`./BreadcrumbIcons` without an extension. Scaffald/ui#31, merged; the submodule
pointer moves to 27c91b8.

`lucide-react-native` still ships whole at 1.14 MB for the 147 icons actually
used. That is the next question and is deliberately not answered here.

Verified: typecheck clean on scf-core and scaffald-app, scf-core suite
1097 passed / 0 failed, production export green.

Refs #791

Co-Authored-By: Claude Opus 5 <[email protected]>

* fix(deps): bump the ui pointer for the docs-site dependency fix

`@scaffald/ui-docs:build` failed on the previous commit:

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

Dropping the `lucide-react` fork moved the Breadcrumb's web path onto
`lucide-react-native`, and the Docusaurus site had never declared that package —
64 components in @scaffald/ui import it and the site renders them, so it had been
resolving through whatever pnpm hoisted, and regenerating the lockfile here moved
it out of reach. Scaffald/ui#32 declares it; the site already aliases
react-native → react-native-web, so it resolves the same way the app does.

Co-Authored-By: Claude Opus 5 <[email protected]>

* chore: split the icon change out of this PR

`@scaffald/ui-docs:build` fails in CI on the ui pointer bump:

    Module not found: Error: Can't resolve 'lucide-react-native'
      in '<repo>/packages/ui/dist'

The same build passes locally, and re-running the CI job reproduces it, so it is
environmental rather than flaky and I have not yet found the difference.
Scaffald/ui#32 declaring the dependency on the docs site was not enough.

Sentry removal does not depend on any of that, is verified, and is the larger
half of the saving. So the pointer goes back to what main has and the icon work
moves to its own PR, where the docs build can be debugged without holding this
up. Scaffald/ui#31 and #32 are already merged on the ui side; only the pointer
bump is deferred.

Co-Authored-By: Claude Opus 5 <[email protected]>

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant