Skip to content

refactor: move currency and base64 helpers to core - #1897

Open
gabrielseco wants to merge 2 commits into
chore/core-tsconfigfrom
refactor/core-format-helpers
Open

gabrielseco wants to merge 2 commits into
chore/core-tsconfigfrom
refactor/core-format-helpers

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Moves two small helpers, a currency formatter and a base64 data URI helper, into the private core package. Behavior and the public API of @remoteoss/remote-flows are unchanged.

Why

Phase 2 of the Angular support plan (#1833). Both are plain functions that any framework needs, and the Angular spike already uses the second. Stacked on #1896.

What changed

Toggle details
  • New packages/core/src/format.ts with formatCurrency and clearBase64Data, moved as they were.
  • src/lib/utils.ts re-exports them from core, so every existing import keeps working.
  • Other helpers in that file stay in React on purpose: stripHtml and prettifyFormValues (which uses it) need the browser's DOMParser, the sanitizers need DOMPurify, and transformYupErrorsIntoObject needs yup.
  • Public API: no change. Nothing here is exported from src/index.tsx.

Screenshots

N/A

Related Resources

Testing

The same checks CI runs pass locally: the lint command (exit 0), type-check (both configs) and the full vitest suite (134 files, 1729 tests). No test changes.

  • Tested against the example/ app in a browser
  • Feature flag: N/A

Note

Low Risk
Mechanical relocation with re-exports preserving the previous API; no logic or security-sensitive behavior changes.

Overview
Moves formatCurrency and clearBase64Data from src/lib/utils.ts into packages/core/src/format.ts and exports them from @remoteoss/remote-flows-core.

Keeps the same behavior: src/lib/utils.ts now re-exports those two from core, so existing imports from the app layer keep working without a breaking change to the flows package’s surface for consumers that used utils.

This supports sharing the helpers outside React (e.g. Angular) without duplicating logic.

Reviewed by Cursor Bugbot for commit f47faf3. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 245.96 kB 245.87 kB +92 B (+0.0%) 🔴
Total (raw) 679.13 kB 678.96 kB +172 B (+0.0%) 🔴
CSS (gzip) 22.03 kB 22.03 kB 0 B (0%) 🟢
CSS (raw) 114.89 kB 114.89 kB 0 B (0%) 🟢

Size Limits

  • ✅ Total gzipped: 245.96 kB / 350 kB (70.3%)
  • ✅ Total raw: 679.13 kB / 850 kB (79.9%)
  • ✅ CSS gzipped: 22.03 kB / 25 kB (88.1%)

Largest Files (Top 5)

  1. index.esm-wIkXrqU6.js - 11.4 kB (0 B (0%))
  2. styles.css - 11.02 kB (0 B (0%))
  3. index.css - 11.02 kB (0 B (0%))
  4. src-DbaOwr-q.js - 7 kB (0 B (0%))
  5. internals-Wj8m-urF.js - 6.14 kB (new)
View All Files (313 total)
File Size (gzip) Change
index.esm-wIkXrqU6.js 11.4 kB 0 B (0%)
styles.css 11.02 kB 0 B (0%)
index.css 11.02 kB 0 B (0%)
src-DbaOwr-q.js 7 kB 0 B (0%)
internals-Wj8m-urF.js 6.14 kB new
hooks-DY0pTQ-L.js 5.8 kB new
index.js 5.65 kB -1 B (-0.0%)
sdk.gen-D_5dqKZ5.js 5.63 kB 0 B (0%)
flows/Onboarding/hooks.js 4.69 kB 0 B (0%)
FieldSetField-BQka2l92.js 4.58 kB new

✅ Bundle size check passed

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-7ieoyab6j-remotecom.vercel.app
Latest Commit:f47faf3

Deployed with vercel-action

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for adp-cost-calculator ready!

Project:adp-cost-calculator
Status: ✅  Deploy successful!
Preview URL:https://adp-cost-calculator-d4xu8a8c7-remotecom.vercel.app
Latest Commit:f47faf3

Deployed with vercel-action

@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📊 Coverage Report

⚪ Coverage unchanged

Metric Current Previous Change Status
Lines 90.33% 90.33% 0% ⚪
Statements 90.21% 90.21% 0% ⚪
Functions 89.22% 89.22% 0% ⚪
Branches 81.96% 81.96% 0% ⚪

Detailed Breakdown

Lines Coverage
  • Covered: 5884 / 6514
  • Coverage: 90.33%
  • Change: 0% (0 lines)
Statements Coverage
  • Covered: 5954 / 6600
  • Coverage: 90.21%
  • Change: 0% (0 statements)
Functions Coverage
  • Covered: 1565 / 1754
  • Coverage: 89.22%
  • Change: 0% (0 functions)
Branches Coverage
  • Covered: 3649 / 4452
  • Coverage: 81.96%
  • Change: 0% (0 branches)

✅ Coverage check passed

This branch has not been deployed

No deployments
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