Skip to content

refactor: group core into form and domains folders and narrow its exports - #1906

Open
gabrielseco wants to merge 4 commits into
refactor/core-invoice-schedulesfrom
refactor/core-folder-structure
Open

gabrielseco wants to merge 4 commits into
refactor/core-invoice-schedulesfrom
refactor/core-folder-structure

Conversation

@gabrielseco

@gabrielseco gabrielseco commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Reorganizes the private core package into folders and trims what it exports. Behavior and the public API of @remoteoss/remote-flows are unchanged.

Why

Follow-up to #1894 (Phase 2 of the Angular support plan, #1833). Core is growing flow by flow, so it needs a layout where each flow's code has its own folder. Its entry point also exported things nothing used, and nothing stopped that from happening again.

What changed

Toggle details
  • packages/core/src/invoiceSchedules/ moves to packages/core/src/domains/invoice-schedule/. The test is renamed to invoiceSchedule.test.ts.
  • form.ts and headlessForm.ts (with their tests) move into packages/core/src/form/.
  • object.ts only held getNestedValue, used only by form.ts, so it is merged into form/form.ts and deleted.
  • money.ts, fieldHelpers.ts, fieldTypes.ts and types.ts stay where they are.
  • Core's index.ts now exports only names the SDK imports. A new check, pnpm run check-core-exports, enforces it: it runs Knip on packages/core (config in knip.json) and fails on any export nobody uses. It runs in pnpm run ci and in the lint job of pr.yml. Knip is a new dev dependency, pinned at 6.44.1.
  • What the check found and this PR removes:
    • createInvoiceScheduleSchema, a static schema with no users, is deleted.
    • supportedTypes, findFieldsByType, FileConverter, parseFormValuesToAPI and parseSubmitValues are no longer exported. Core still uses them internally.
    • isMultiSelect is no longer exported. Its only consumer was an unused re-export in src/components/form/utils.ts.
    • Two wrapper functions in src/components/form/utils.ts that nothing called are deleted.
  • .oxlintrc.json: the createHeadlessForm import exception follows headlessForm.ts to its new path.
  • No public API change: nothing in src/index.tsx changes.

Screenshots

N/A

Related Resources

Testing

type-check is clean and pnpm run check-core-exports passes. The core, src/common, src/components/form and InvoiceSchedule tests pass locally (492 tests); CI runs the full suite.

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

Note

Medium Risk
Shrinks and relocates @remoteoss/remote-flows-core exports and paths; downstream direct imports of removed symbols would break, though the main package API is unchanged.

Overview
Core layout and surface area

The private @remoteoss/remote-flows-core package is reorganized: invoice schedule code lives under domains/invoice-schedule/, and form logic (form, headlessForm, tests) moves under src/form/. getNestedValue is merged from deleted object.ts into form/form.ts. packages/core/src/index.ts re-exports only what downstream code still needs; several previously exported symbols are internal-only (parseFormValuesToAPI, parseSubmitValues, findFieldsByType, FileConverter, supportedTypes, isMultiSelect) and the unused createInvoiceScheduleSchema export is removed.

Tooling

Knip is added with knip.json, a check-core-exports script (knip --workspace packages/core --include exports), and it runs in pnpm ci and the PR lint workflow so stray core exports fail CI. .oxlintrc updates the no-restricted-imports exception path for the moved headlessForm file.

App layer

src/components/form/utils.ts drops the unused parseFormValuesToAPI / parseSubmitValues wrappers and the isMultiSelect re-export; the parseJSFToValidate helper with file conversion remains.

The published @remoteoss/remote-flows entry is unchanged; risk is mainly for anything importing the workspace core package directly via removed exports.

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

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Deploy preview for remote-flows ready!

Project:remote-flows
Status: ✅  Deploy successful!
Preview URL:https://remote-flows-l2hfkx4be-remotecom.vercel.app
Latest Commit:4a86b16

Deployed with vercel-action

@github-actions

github-actions Bot commented Nov 6, 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-qkj245fwz-remotecom.vercel.app
Latest Commit:4a86b16

Deployed with vercel-action

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

📊 Coverage Report

✅ Coverage increased! 🎉

Metric Current Previous Change Status
Lines 90.30% 90.27% +0.03% 🟢
Statements 90.18% 90.16% +0.03% 🟢
Functions 89.22% 89.12% +0.10% 🟢
Branches 81.90% 81.88% +0.02% 🟢

Detailed Breakdown

Lines Coverage
  • Covered: 5882 / 6514
  • Coverage: 90.30%
  • Change: +0.03% (-1 lines)
Statements Coverage
  • Covered: 5952 / 6600
  • Coverage: 90.18%
  • Change: +0.03% (-1 statements)
Functions Coverage
  • Covered: 1565 / 1754
  • Coverage: 89.22%
  • Change: +0.10% (0 functions)
Branches Coverage
  • Covered: 3646 / 4452
  • Coverage: 81.90%
  • Change: +0.02% (0 branches)

✅ Coverage check passed

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Size Report

Metric Current Previous Change Status
Total (gzip) 245.87 kB 245.82 kB +56 B (+0.0%) 🔴
Total (raw) 678.96 kB 678.96 kB -5 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.87 kB / 350 kB (70.2%)
  • ✅ Total raw: 678.96 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 (new)
  5. internals-DvjNxy5y.js - 6.14 kB (new)
View All Files (312 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 new
internals-DvjNxy5y.js 6.14 kB new
hooks-BOuqz5Jj.js 5.78 kB new
index.js 5.65 kB -9 B (-0.2%)
sdk.gen-D_5dqKZ5.js 5.63 kB 0 B (0%)
flows/Onboarding/hooks.js 4.69 kB -2 B (-0.0%)
FieldSetField-BvY4qz0z.js 4.58 kB new

✅ Bundle size 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