Skip to content

HF-359: Import the formula builder core as hyperformula-ui - #1832

Merged
sequba merged 15 commits into
developfrom
feat/hf-359-import-hyperformula-ui
Oct 21, 2026
Merged

sequba merged 15 commits into
developfrom
feat/hf-359-import-hyperformula-ui

Conversation

@sequba

@sequba sequba commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Context

Brings the formula builder's core into the monorepo as the hyperformula-ui package, ready to publish to npm. Grid integrations are not part of it: Handsontable ships its own as a built-in plugin, and adapters for other grids are examples maintained outside this repository.

What came over, from the formula-builder repository at e85b52b:

hyperformula-ui/
  packages/core/       the package, published as hyperformula-ui (was @hfe/core)
  demo/js/basic/       the editor-only demo page, with demo/shared/
  e2e/                 its Playwright smoke check
  scripts/  tsconfig.*.json  rspack.base.mjs  vitest.base.ts  biome.json
  dev-docs/            the architecture and spec, plus new pages

The adapter packages, the other demos and their e2e specs stayed behind, since they need the adapters.

Decisions:

  • One snapshot, no history. develop squash-merges, so keeping history would need a merge-commit exception for this PR and an audit of every private commit before it went public. The formula-builder repository keeps the full history.
  • pnpm to npm, done here. catalog: and workspace:* became plain ranges, and every pnpm command became an npm one. Each UI package declares TypeScript 5 and Biome itself, because npm hoists the engine's TypeScript 4 to the root. Biome is pinned to 2.4.16, the version formula-builder ran: 2.5 adds rules that fail on the imported tests.
  • Name and licence. The package is hyperformula-ui, GPL-3.0-only. prepack copies the root LICENSE.txt in, as it does for the engine. The peer range is hyperformula ^3.0.0, as in formula-builder and the Handsontable plugin: every engine call is feature-detected, and before 3.4.0 autocomplete lists names without descriptions.
  • Conventions stay inside hyperformula-ui/. Biome, no inline comments, and the .hfe-*/--hfe-* prefix are written down in hyperformula-ui/dev-docs/CODE-STYLE.md. The CSS names are unchanged, so the Handsontable plugin's e2e selectors keep working.
  • No translations. Function names come from the engine's language packs.
  • Workspace by path. --workspace=hyperformula-ui also matches workspaces by folder, so every script and doc names hyperformula-ui/packages/core. The licence gate lists workspaces by path and drops each one from its own report by package name.
  • The engine is resolved from the workspace. The core does not import it. The demo does, so the e2e job runs bundle-all first.
  • Source under a private export condition. formula-builder exported src/index.ts under development, which webpack and Vite enable by default in dev mode, so a webpack 5 dev build of a project using the package failed with Can't resolve './formulaBuilder'. The condition is now hyperformula-ui-source, which only this repository's tsconfig and demo enable. It comes before types, because TypeScript takes the first match. With the packed tarball, webpack dev and production builds of a consumer project both pass.
  • Declarations work under node16/nodenext. tsc emits extensionless relative imports. A nodenext consumer then got TS2834 or, under skipLibCheck, any for every export. scripts/addDeclarationExtensions.mjs now adds .js to them after the build, and a new check:types step runs attw on the packed package in CI.
  • Agent skills, in this repository's format. formula-builder's skills restated rules and assumed pnpm and adapters, so they did not come over; their content is in hyperformula-ui/dev-docs/. A new hyperformula-ui-dev skill routes there. hyperformula-ui/dev-docs/REVIEWING.md carries formula-builder's reviewer checks, and hyperformula-code-review now sends UI diffs to it.
  • Three regexes made linear. CodeQL flagged three polynomial regexes in the imported code: in parseCellInput, in fillColor, and in the lexer's handling of unterminated strings. All three were real; on 40,000 to 80,000 characters of crafted text they took 0.3 to 2.6 s. parseCellInput and fillColor now accept the same strings in linear time. The lexer gives the same tokens except in one case: a backslash right before a line break inside an unterminated string, where a later quote used to start a closed string and is now an error. New tests pin the results, that case included.
  • No HTML sinks. formula-builder built its icons with innerHTML, which throws under a host's Trusted Types policy (require-trusted-types-for 'script'), so no grid would render. Icons are now data in ui/icons.ts, built with createElementNS; nothing in src/ writes innerHTML, outerHTML or insertAdjacentHTML. A test makes the innerHTML setter throw and checks icons still build.
  • Function help links are checked. A custom function's docUrl reaches href only with an http: or https: protocol, so a javascript: URL is never rendered.
  • The formula bar fits its cell. From review, so the Handsontable plugin can drop its overrides:
    • The editor's height cap never exceeds the clipping ancestor's clientHeight.
    • The bar shows its mount before attaching the editor, so the cap lands before focus() can scroll an ancestor.
    • The bar's vertical padding moves onto the overlay and textarea, so the idle view and a one-line capped editor are both 28px.
    • A bar-initiated edit opens on the first line, with the caret at the end.
    • The bar editor's scrollbar is auto, through the new --hfe-scrollbar-width and --hfe-formula-bar-scrollbar-width tokens.
  • Host icons. A new icons option takes element factories that replace the four built-in glyphs; there are no markup strings, so no HTML sink.

Root changes:

  • workspaces gains the UI's members.
  • New root scripts: typecheck (fan-out), build:ui, dev:ui, test:ui, test:e2e. test now also runs test:ui.
  • A new workflow, hyperformula-ui.yml, runs two jobs: verify (build, stale-stylesheet and stale-DOCS.md checks, lint, typecheck, unit tests, npm pack --dry-run, attw) and e2e.
  • release.sh also deletes the UI workspaces' node_modules before regenerating the lockfile. DEFINITION-OF-DONE.md lists the UI's gate.
  • Biome is a single hoisted copy in the lockfile.
  • dev-docs/STRUCTURE.md records the import as done and lists what changed from the plan; BUILD.md, CODE-STYLE.md, CODE-REVIEW.md, AGENT-TOOLING.md and the dev-docs index link to the UI's pages.

Publishing is a separate, manual step after this merges: hyperformula-ui/dev-docs/RELEASE.md.

How did you test your changes?

Run from a clean worktree after npm ci:

Command Result
npm ci Clean install; no package the engine resolves changed version in the lockfile
npm run build:ui, then git diff --exit-code -- 'hyperformula-ui/**/cssText.ts' Builds; stylesheet unchanged
npm run lint Engine 0 errors; UI packages clean
npm run test:ui 88 files, 1083 tests passed
npm run bundle-all, then npm run typecheck Engine bundles OK; every UI package typechecks, before the core is built
npm run test:e2e 1 passed, before the core is built (run with the container's preinstalled Chromium)
npm pack --dry-run --workspace=hyperformula-ui/packages/core LICENSE.txt, README.md, DOCS.md, package.json, dist/ without its .tsbuildinfo, src/; 288 files
npm run check:types --workspace=hyperformula-ui/packages/core attw: node16 (from ESM) and bundler green
npm run check:licenses OK, 3 production dependencies
npm run test:jest Smoke tests only, 4 passed; the private suite was not available here. The engine's source is unchanged

Then I installed the packed tarball and hyperformula@^3.4.0 in an empty project:

  • import { FormulaBuilder } from "hyperformula-ui" typechecks under strict TypeScript 5, and the module loads in Node.
  • webpack 5 builds it in both development and production mode. Before the condition rename, the development build failed.

I also linked the built package into a module: nodenext project, without skipLibCheck. There, const x: number = FormulaBuilder now fails with TS2322, the expected error. Before the declaration fix, the same project got TS2834 on every import in dist/index.d.ts.

For the regex fixes, I timed each function on crafted input of 40,000 to 80,000 characters, before and after:

Function Before After
lexer 2574 ms 73 ms
parseCellInput 1814 ms 0 ms
fillColor 337 ms 0 ms

For the release steps, npm version 0.1.0-next.0 --workspace=hyperformula-ui/packages/core --no-git-tag-version followed by npm install installs cleanly, now that the demo depends on "*". I reverted both afterwards.

For the formula bar, I measured a bar-hosted editor in Chromium before and after, with a five-line formula:

Case Before After
--hfe-editor-max-lines: 1: idle view / capped editor height 20px / 20px in a 28px cell 28px / 28px
Same: first line shown on open no, scrolled to the last line yes
29px overflow-x: auto slot: editor height / slot scroll 99px / 75px 28px / 0px

Every relative Markdown link and anchor in the changed files resolves.

Compatibility with Excel and Google Sheets

Not applicable. The engine does not change.

Public API changes

None in hyperformula. Adds a new package, hyperformula-ui, with its own API, listed in hyperformula-ui/packages/core/DOCS.md.

Out of scope and follow-ups

  • Publishing to npm. Done by hand after merge, following hyperformula-ui/dev-docs/RELEASE.md. After that, @hfe/core becomes hyperformula-ui in the Handsontable plugin PR (HOT-15500: Add the FormulaBuilder plugin built on hyperformula-ui handsontable#13172) and in the adapter examples.

  • Public docs pages ("UI Components" in docs/). A separate task.

  • CI path filtering. Still owed, as dev-docs/STRUCTURE.md records.

  • License Compliance (FOSSA) passes after 2 issues were ignored in the FOSSA dashboard:

    • hyperformula (GPL-3.0-only) is our own engine, which workspace packages now depend on.
    • node-forge (BSD-3-Clause OR GPL-2.0, which FOSSA reads as GPL-2.0) is reached only through @rspack/cli's dev server, which the build never runs; we elect BSD-3-Clause.

    Neither ships in the hyperformula-ui tarball.

  • One CodeQL alert left open, on lexer/matchers.ts. Its real case is fixed. Its thread explains why the rest is a false positive, for a maintainer to dismiss.

Types of changes

  • Breaking change (existing functionality no longer works as before) – agreed with the maintainers
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

Related issues

  1. HF-359

Checklist

  • My pull request meets the Definition of Done.
  • I have signed the Contributor License Agreement.
  • I read my own diff end to end before requesting a review.
  • I added a CHANGELOG.md entry, written by the changelog rules – or none is needed (docs, tests or tooling only). The entry is in hyperformula-ui/CHANGELOG.md; the engine's changelog is unchanged.
  • I updated the documentation and JSDoc to match the change.
  • Breaking change only: I added a section to the migration guide.
  • I updated the dev-docs/ pages this change affects – or none needed it.

🤖 Generated with Claude Code

https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe

Imported from the formula-builder repository at commit e85b52b, without
its history. Copied unchanged: the core package, the shared build, test
and lint configuration it reaches through ../../, the editor-only demo
with its shared helpers, and the Playwright suite that drives it.

Adapters, the other demos and the pnpm workspace files stay behind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
Only the core package came over, so the grid demos and their checks have
nothing to run against. The demo keeps the editor-only `basic` page, and
the Playwright suite keeps its one check: typing `=1+2` shows `3`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
The repository runs one package manager. `catalog:` and `workspace:*`
specifications become plain version ranges, and the generator scripts and
the Playwright web server call npm instead of pnpm. Each package declares
its own TypeScript 5, because npm hoists the engine's 4.x to the root, and
its own Biome, which the formula-builder root used to supply. The API docs
generator loads TypeScript from the package it documents, for the same
reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
The package takes the name it will be published under, and its manifest
gains the licence, repository, peer range and pack steps a public package
needs:

- the root LICENSE.txt is copied in by prepack and removed by postpack,
  the way the engine does it;
- the hyperformula peer range is ^3.4.0, the first version with the
  function metadata methods the editor calls;
- each package lints itself with Biome, pinned to the 2.4.16 that
  formula-builder ran, and the core also lints the shared configuration;
- generated banners name the workspace by path, because
  --workspace=hyperformula-ui also matches workspaces by folder, not only
  the package of that name.

The demo imports the renamed package, and the core gets a README for npm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
The root lists the UI's members directly: npm does not nest workspace
roots, so hyperformula-ui/ is a folder of workspaces rather than one.

- `lint` already fans out to every workspace, so it now also runs Biome
  over the UI; a new `typecheck` fans out the same way.
- `build:ui`, `dev:ui`, `test:ui` and `test:e2e` run the UI's scripts, and
  `test` includes the UI's unit tests.
- The licence gate checks the production dependencies of
  hyperformula-ui too. Workspaces are listed by path, and each one is
  excluded from its own report by its package name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
Two jobs, in their own workflow:

- verify builds the package, fails if the generated stylesheet differs
  from the committed one, lints, typechecks, runs the unit tests and
  dry-runs the tarball;
- e2e builds the engine, which the demo resolves from this workspace,
  then lints and typechecks the demo and the suite and runs Playwright.

No path filter: a filtered workflow that becomes a required check stays
pending forever on pull requests that do not touch its paths.

The tarball dry run showed the README linking to DOCS.md, which the
package did not ship, so `files` now includes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
The UI's internals move into hyperformula-ui/dev-docs/, next to the
engine's own: the architecture and the spec come from the imported
package, and the conventions, the testing notes, the keyboard matrix and
the task map come from formula-builder's agent skills, which did not come
over. They are adapted to this repository: npm commands, the
hyperformula-ui name, the one demo, and no adapters in the tree.

New pages: the code style that applies inside hyperformula-ui/ only, and
the manual release procedure for the package. The folder gets a README,
an AGENTS.md and its own CHANGELOG.

At the root, STRUCTURE.md describes the imported layout and the
decisions taken on the way in, and drops the import from what the move
still owes. BUILD.md, CODE-STYLE.md and the dev-docs index point at the
UI's pages, and agents are kept out of the UI's build output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
export function matchSticky(pattern: RegExp, text: string, pos: number): RegExpExecArray | null {
pattern.lastIndex = pos;

return pattern.exec(text);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The string case in this alert was real. a4e81e3 fixes it in the lexer: after one unterminated string, the lexer stopped rescanning from every later quote, and an 80,000-character input went from 2574 ms to 73 ms. The tokens are unchanged, and a new test in tests/lexer/lexer.test.ts pins them.

The rest of the alert stays because CodeQL treats matchSticky as a scan over every start position. Every pattern passed to it has the y flag, so one exec tries only lastIndex, and the lexer calls it once per position and then moves past the match. Timed on a4e81e3, with CodeQL's own input shapes, at 20,000 and then 80,000 repetitions:

Input 20k 80k
"\a + \"\a × n 70 ms 190 ms
A × n 0 ms 1 ms
0 × n 0 ms 0 ms
' + '& × n 42 ms 102 ms
_ × n 0 ms 0 ms

4× the input takes about 2.5–3× the time, so all of these are linear. I'm leaving this thread open: a false-positive dismissal is a call for a maintainer with code-scanning access.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A correction to my reply above, thanks to Adrian's review. The tokens are unchanged except in one case: a backslash right before a line break inside an unterminated string. RE_STRING's . does not match a line break, so in ="a\⏎"b" a later quote used to start a closed string. It's now an error, and ef76392 pins that in a test. The timings and the false-positive reasoning above still hold.


Generated by Claude Code

CodeQL flagged them as polynomial on uncontrolled input, and each one
was: on 40,000 to 80,000 characters of crafted text they took 0.3 to
2.6 seconds.

- parseCellInput: `\d+\.?\d*` can split a run of digits many ways;
  `\d+(?:\.\d*)?` accepts the same strings in one.
- fillColor: the lazy hue group and `\s*` before the alpha both matched
  spaces. The group now runs up to the slash and is trimmed, as before.
- The lexer rescanned to the end of the text from every quote after an
  unterminated string. When a string fails to close from one quote, it
  fails from every later quote too, since each of those sits inside the
  first scan as an escaped quote, so the lexer now stops trying.

The tokens and results are unchanged; new tests pin them, and passed
before the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe

sequba commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

License Compliance (FOSSA) reports "2 issues found" on 62f8af5. The check passed on #1757's head, so this PR introduces them. I can't see which packages FOSSA flags: its dashboard isn't reachable from my environment. Someone with FOSSA access needs to look.

Every package this PR adds is a development dependency. The published hyperformula-ui has no runtime dependencies, and npm run check:licenses passes. Among the new packages, these are the ones whose licences are not plain MIT, ISC, Apache-2.0 or BSD:

Package Licence Pulled in by
node-forge@1.4.0 (BSD-3-Clause OR GPL-2.0) @rspack/cli → @rspack/dev-server → webpack-dev-server → selfsigned
opener@1.5.2 (WTFPL OR MIT) a dev tool
tslib@2.8.1 0BSD several build tools
demo-js, @hfe-demo/shared, e2e no license field private workspace packages, never published

If FOSSA flags node-forge, the core's build can call rspack's API instead of @rspack/cli, which drops the dev server and node-forge with it. If it flags the private packages, they can declare "license": "UNLICENSED". I'll change neither until someone confirms which two issues FOSSA reports. Its run on a4e81e3 is still in progress.


Generated by Claude Code

@sequba
sequba marked this pull request as ready for review October 20, 2026 12:30
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
hyperformula-docs 34d6ef9 Commit Preview URL

Branch Preview URL
Oct 21 2026, 10:23 AM

@sequba
sequba requested a review from adrianspdev October 20, 2026 12:33
The package exported src/index.ts under the `development` condition.
webpack and Vite enable that condition by default in dev mode, so
another project's dev build loaded the TypeScript source: webpack 5
failed with "Can't resolve './formulaBuilder'".

The condition is now `hyperformula-ui-source`, which only this
repository's tsconfig and demo enable. Consumers always get dist/; the
demo and the end-to-end suite still run against the source without a
build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
formula-builder's agent skills did not come over with the import. Their
rules now live in hyperformula-ui/dev-docs/; this adds the pieces that
route agents to them, in this repository's format.

- hyperformula-ui-dev: the entry-point skill for work in
  hyperformula-ui/, so agents load the UI's conventions rather than the
  engine's.
- hyperformula-ui/dev-docs/REVIEWING.md: what to check in a UI change,
  carrying over formula-builder's reviewer agent. That means the core's
  invariants, plus the public surface outside TypeScript: the CSS names,
  the peer range and the exports map.
- hyperformula-code-review routes a review to the REVIEWING.md and
  CODE-STYLE.md of the part of the repository the diff touches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
@github-actions

github-actions Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Performance comparison of head (34d6ef9) vs base (dd3e92b)

                                     testName |    base |    head | change
--------------------------------------------------------------------------
                                      Sheet A |  499.89 |  505.38 | +1.10%
                                      Sheet B |  161.44 |  164.33 | +1.79%
                                      Sheet T |  142.04 |   142.3 | +0.18%
                                Column ranges |  476.22 |     474 | -0.47%
                                Sorted lookup | 14365.9 | 14345.3 | -0.14%
Sheet A:  change value, add/remove row/column |   15.64 |   15.18 | -2.94%
 Sheet B: change value, add/remove row/column |  136.27 |  138.74 | +1.81%
                   Column ranges - add column |  147.03 |  142.61 | -3.01%
                Column ranges - without batch |  454.52 |  445.89 | -1.90%
                        Column ranges - batch |  116.59 |   112.4 | -3.59%

@adrianspdev adrianspdev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally on 365e835d8 after a fresh npm ci: build, stylesheet and DOCS.md regenerate clean, Biome clean in all four UI workspaces, typecheck fan-out passes without a UI dist/, 1072 unit tests pass, tarball and licence gate as described, all Markdown links resolve, no engine package changed version in the lockfile.

Two checks stay red and need a maintainer: CodeQL alert #82 is a false positive to dismiss (the timings in the existing thread hold up; I reproduced them), and FOSSA needs someone with dashboard access.

Comments below are small; none blocks on the author's side.


Reviewed with Claude Code

Comment thread hyperformula-ui/tsconfig.package.json Resolved
Comment thread hyperformula-ui/rspack.base.mjs Resolved
Comment thread hyperformula-ui/packages/core/README.md Resolved
Comment thread .github/workflows/hyperformula-ui.yml Resolved
- The tarball no longer ships dist/.tsbuildinfo, the incremental build
  cache tsc writes next to the declarations.
- CI fails on a stale DOCS.md, the same way as on a stale stylesheet.
- rspack.base.mjs drops its tsx option, which only the React adapters
  used.
- The core's README says hyperformula is an optional peer, and what is
  off without it.
- @hfe-demo/shared exports datasets.ts plainly. Its source condition
  pointed at the same file as the default, and nothing imported its
  shared.css export; the demo serves that file through a symlink.
- A test pins the one input whose tokens the unterminated-string change
  did alter: a backslash before a line break. `.` does not match a line
  break, so a later quote can start a closed string there; it is now an
  error, as the quotes after any other unterminated string are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
@cursor

cursor Bot commented Oct 20, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@adrianspdev
adrianspdev requested a review from Haxikowy October 21, 2026 06:18

@adrianspdev adrianspdev left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Second pass, from integrating this head into the Handsontable plugin and walking the editor-only demo and the plugin's formula bar by hand in Chromium, WebKit and Firefox. One blocking item: the package's single innerHTML sink breaks grid construction under a Trusted Types policy, which Handsontable supports and tests. The rest are design and demo points.

For a maintainer, not the author: CodeQL alert #82 on lexer/matchers.ts:26 is a false positive, the timings in its thread hold up, and it needs dismissing. FOSSA is green on this head.


Reviewed with Claude Code

Comment thread hyperformula-ui/dev-docs/TESTING.md Resolved
Comment thread hyperformula-ui/demo/shared/datasets.ts Outdated
});
}

export const portfolioMeta: ScenarioMeta = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: 288 lines, and the one remaining demo imports two functions from this file. The five scenario datasets from here down, the e2e framework-by-adapter matrix in e2e/tests/_shared/, and the shared tsconfig.*.json, rspack.base.mjs and vitest.base.ts all serve a single package now. Trim them to what the demo uses, or name the planned packages in dev-docs/STRUCTURE.md so the generality has a reason on record.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

acf31eb trims datasets.ts to what the demo uses: the sample sheet, the named expressions, buildHyperFormula, formatResult and evaluateFormula. The scenario datasets are gone. The e2e matrix was already cut to the one js/basic route in the trim commit.

I've kept the shared configuration:

  • tsconfig.base.json is extended by all four workspaces.
  • rspack.base.mjs, vitest.base.ts and tsconfig.package.json serve only the core today. Folding them into it would change paths that its scripts and SPEC.md rely on, for no behaviour gain.

No further UI packages are planned on record, so I haven't named any in STRUCTURE.md. If you'd rather fold the core-only files into packages/core/, say so and I'll do it.


Generated by Claude Code

Comment thread hyperformula-ui/demo/shared/datasets.ts Resolved
- Icons are built with createElementNS from data in ui/icons.ts instead
  of being parsed from markup through innerHTML, the package's only HTML
  sink. Under a host's Trusted Types policy that assignment throws, so a
  Handsontable grid with the plugin did not render at all. The unused
  SELECT_ARROW_ICON goes.
- The function help popup renders the "Learn more" link only for http
  and https URLs. A custom function's docUrl could carry any scheme,
  javascript: included.
- The demo evaluates the editor's engine form, so a formula with a
  // comment computes instead of showing an error, and prints errors in
  spreadsheet spelling (#DIV/0!), from DetailedCellError.value.
- The demo's datasets file keeps only what the demo uses, and the
  demo's helper folder is renamed from shared/ to helpers/, apart from
  the @hfe-demo/shared package.
- TESTING.md describes the suite as it is: a file per module or per
  behaviour. CODE-STYLE.md and REVIEWING.md record the no-HTML-sink rule
  and the URL check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe

@Haxikowy Haxikowy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three points with no line in the diff:

  • script/release/release.sh:659 deletes only the root and hyperformula/ node_modules before regenerating the lockfile, so stale hyperformula-ui/**/node_modules get written into the engine's release lockfile. Step 5's npm run test now also runs test:ui, while the comment at :666 still says lint, unit and browser tests.
  • dev-docs/DEFINITION-OF-DONE.md:30-35 lists only engine checks, but the new hyperformula-ui-dev skill sends UI work there. Add a line for build:ui, typecheck and test:ui.
  • npm dedupe --dry-run hoists @biomejs/biome@2.4.16 to the root and removes four 48 MB copies from the lockfile.

Comment thread hyperformula-ui/demo/js/package.json Resolved
Comment thread hyperformula-ui/tsconfig.base.json Resolved
Comment thread hyperformula-ui/dev-docs/SPEC.md Resolved
Comment thread hyperformula-ui/packages/core/DOCS.md Resolved
- Editor size: the height cap never exceeds the clipping ancestor's
  clientHeight, so an ancestor that scrolls the editor up cannot grow it.
  The bar shows its mount before attaching the editor, so the first cap
  lands before focus() can scroll an ancestor to the caret.
- Formula bar: the vertical padding moves from the formula cell onto the
  overlay and textarea, and the cell loses its end padding. The idle view
  and a one-line capped editor are now the same height, and the capped
  scroll port spans the whole cell.
- A bar-initiated edit opens scrolled to the first line, with the caret
  at the end, matching the idle view (FormulaEditor.scrollToStart).
- New --hfe-scrollbar-width token (default thin) for the capped editor and
  popup lists; the bar editor uses --hfe-formula-bar-scrollbar-width
  (default auto).
- New icons option (IconsOptions, keyed by IconName) on FormulaBuilder and
  FormulaEditor: element factories that replace the close, externalLink,
  namedExpression and function glyphs. No markup strings, so no HTML sink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe
…ery consumer

- exports: the hyperformula-ui-source condition comes before types, since
  TypeScript takes the first match; this repository's typecheck now reads
  src/ under the condition, as SPEC.md says.
- Declarations: scripts/addDeclarationExtensions.mjs adds .js to relative
  imports in the emitted .d.ts files, so node16/nodenext consumers resolve
  them instead of failing with TS2834 or, under skipLibCheck, typing every
  export as any. A new check:types script runs attw on the packed package,
  and the verify job runs it.
- Peer range back to hyperformula ^3.0.0: the catalog already falls back
  on engines without getAvailableFunctions, and Handsontable allows ^3.0.0.
- The demo depends on hyperformula-ui "*", so a version bump in the
  release steps does not break npm install.
- DOCS.md ships in the tarball, so its links to ARCHITECTURE.md and the
  demo are absolute GitHub URLs.
- Biome is hoisted to one root copy in the lockfile; no other package moves.
- release.sh also deletes the hyperformula-ui workspaces' node_modules
  before regenerating the lockfile, and describes what npm run test runs.
- DEFINITION-OF-DONE.md lists the hyperformula-ui gate. ARCHITECTURE.md,
  SPEC.md and KEYBOARD-SHORTCUTS.md describe the grid adapters as external
  examples, and RELEASE.md runs check:types before publishing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe

sequba commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@Haxikowy, here is how 34d6ef9 handles the three points in your review summary:

  • release.sh: step 4 now also deletes hyperformula-ui/packages/*/node_modules, hyperformula-ui/demo/*/node_modules and hyperformula-ui/e2e/node_modules, so the globs mirror the root workspaces. The step 5 comment and release-README.md now say that npm run test also lints the UI and runs its unit tests.
  • DEFINITION-OF-DONE.md: the pre-flight gate has a line for hyperformula-ui/ changes: build:ui, typecheck and test:ui, plus test:e2e when the demo or the mounting changes. It links to the UI's TESTING.md.
  • Biome dedupe: I didn't run a full npm dedupe. Its dry run also changes engine packages, among them jasmine-core (7.0.2 to 5.13.0), acorn and range-parser. Instead, I dropped the four nested @biomejs/* lock entries and let npm install re-resolve them. The result is one hoisted @biomejs/biome@2.4.16. Compared entry by entry, the lockfile has 36 entries removed and 9 added, all of them @biomejs/*, and no other entry changed. npm ci then installs cleanly, and every UI workspace lints with the root copy.

Generated by Claude Code

@codecov

codecov Bot commented Oct 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.28%. Comparing base (dd3e92b) to head (34d6ef9).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1832   +/-   ##
========================================
  Coverage    97.28%   97.28%           
========================================
  Files          207      207           
  Lines        16218    16218           
  Branches      3556     3588   +32     
========================================
  Hits         15777    15777           
  Misses         433      433           
  Partials         8        8           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sequba
sequba merged commit 5378551 into develop Oct 21, 2026
34 of 35 checks passed
@sequba
sequba deleted the feat/hf-359-import-hyperformula-ui branch October 21, 2026 10:38
sequba added a commit that referenced this pull request Oct 21, 2026
…releases (#1833)

### Context

`hyperformula-ui/dev-docs/RELEASE.md`, merged in #1832, lists one set of
steps and ends with "add the organization as the package's owner",
without saying which organization or how. It also mixes steps that
happen once with steps that happen every time, and assumes the first
version is the prerelease `0.1.0-next.0`.

This PR restructures the page:

- **A table at the top** says which sections to follow for the first
release and which for every later one.
- **Before every release:** `npm login`, `npm whoami`, and checking that
the account may publish. That check is `npm org ls handsoncode
<username>` before the first release and `npm access list collaborators
hyperformula-ui` after it. It also says to pass `--otp=<code>` on
accounts with two-factor authentication.
- **The first release:** publishes `0.3.5` under `latest`. Before
publishing, it checks with `npm view` that the name is still free. After
publishing, it finds the `handsoncode` team that maintains
`hyperformula` with `npm team ls` and `npm access list packages`, grants
it `read-write` with `npm access grant`, and checks the result.
- **Release steps**, for every release: the same build, check, version,
changelog, tag, pack, publish and push steps as before. The version and
dist-tag now come from two shell variables, `VERSION` and `TAG`, so one
set of commands covers both a stable release (`latest`) and a prerelease
(`next`). This replaces the separate "A stable release" section. The
licence copy and the tarball check are merged into one step, so it stays
nine steps.
- **Versions and tags:** the first version is `0.3.5`. Stable versions
go under `latest`, prereleases such as `0.4.0-next.0` under `next`. The
`handsoncode` organization maintains the package, as it does
`hyperformula`.

### How did you test your changes?

- Checked that the name and its look-alikes are free on npm: `npm view
hyperformula-ui`, `hyperformulaui`, `hyper-formula-ui`,
`hyperformula_ui` and `hyperformula.ui` all return 404.
- Read from the registry that `handsoncode` already has write access to
`hyperformula` and `handsontable`.
- Checked the three in-page anchors against the headings.
- `git grep` finds no other page referring to the old `0.1.0-next.0`
example or to a section that was removed.
- I could not run `npm team ls`, `npm access` or `npm publish`: they
need a logged-in npm account, which this environment doesn't have.

### Compatibility with Excel and Google Sheets

Not applicable. Documentation only.

### Public API changes

None.

### Out of scope and follow-ups

- The release itself, done by hand by a maintainer following this page.
- After publishing, `@hfe/core` becomes `hyperformula-ui` in the
Handsontable plugin PR (handsontable/handsontable#13172).

### Types of changes
- [ ] Breaking change (existing functionality no longer works as before)
– agreed with the maintainers
- [ ] New feature or improvement (a non-breaking change that adds
functionality)
- [ ] Bug fix (a non-breaking change that fixes an issue)
- [ ] Additional language file, or a change to an existing language file
(translations)
- [x] Change to the documentation

### Related issues
1. HF-359

### Checklist
- [x] My pull request meets the [Definition of
Done](https://github.com/handsontable/hyperformula/blob/develop/dev-docs/DEFINITION-OF-DONE.md).
- [x] I have signed the [Contributor License
Agreement](https://goo.gl/forms/yuutGuN0RjsikVpM2).
- [x] I read my own diff end to end before requesting a review.
- [x] I added a
[CHANGELOG.md](https://github.com/handsontable/hyperformula/blob/develop/CHANGELOG.md)
entry, written by [the changelog
rules](https://github.com/handsontable/hyperformula/blob/develop/dev-docs/DOC-STANDARDS.md#the-changelog)
– or none is needed (docs, tests or tooling only). None is needed:
documentation only.
- [x] I updated the documentation and JSDoc to match the change.
- [ ] Breaking change only: I added a section to the migration guide.
- [x] I updated the `dev-docs/` pages this change affects – or none
needed it.

---
_Generated by [Claude
Code](https://claude.ai/code/session_013iRJc4HBUpeRFDy1TxBzWe)_

Co-authored-by: Claude <noreply@anthropic.com>
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.

5 participants