Skip to content

Add support for *.ts files in karma tests - #350

Merged
wojciechczerniak merged 3 commits into
developfrom
karma-browser-on-ts
May 11, 2020
Merged

wojciechczerniak merged 3 commits into
developfrom
karma-browser-on-ts

Conversation

@mrpiotr-dev

@mrpiotr-dev mrpiotr-dev commented May 11, 2020 •

Copy link
Copy Markdown
Contributor

Context

PR adds support for source *.ts files in browser tests. Thanks to that we get access to the source code.

How has this been tested?

Run npm run test:browser

Related issue:

  1. Test runner for web browsers #219

@mrpiotr-dev mrpiotr-dev changed the title Downgrades karma to v4 to add support for *.ts files Add support for *.ts files in karma tests May 11, 2020
@mrpiotr-dev
mrpiotr-dev marked this pull request as ready for review May 11, 2020 07:30

@wojciechczerniak wojciechczerniak 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.

👍

@wojciechczerniak
wojciechczerniak merged commit 6d29745 into develop May 11, 2020
@wojciechczerniak
wojciechczerniak deleted the karma-browser-on-ts branch May 11, 2020 08:53
GreenFlux added a commit that referenced this pull request Oct 29, 2026
Heading ids now come from github-slugger, which differs from the VuePress slugify for dots, slashes, ampersands, quotes and leading digits: every release-notes version (#_3-5-0 is #350 now) and about 25 other headings. Links from blog posts, issues and answers elsewhere would open the right page at the top.

A heading whose VuePress id differs from its new one now also carries the old id, as an empty span inside the heading, so both scroll to it. The plugin reproduces VuePress's slugify and its numbering of repeats, and skips an old id that is another heading's new id. Checked against a VuePress build of develop: every old heading anchor lands on the same heading.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GreenFlux added a commit that referenced this pull request Oct 29, 2026
)

### Context

This moves the HyperFormula docs from VuePress 1.x to Astro Starlight,
using the same theme and styles as the Handsontable docs.

VuePress 1 is end-of-life, only builds with webpack 4 and
`--openssl-legacy-provider`, and it's the reason `docs/` has to stay out
of the npm workspace. The Handsontable docs already moved to Starlight,
so this also gets both portals looking the same on handsontable.com.

This replaces #1686 and #1791, my earlier attempts at the same
migration. They were started before the monorepo restructure in #1757
moved most of the files they touched, so instead of fighting the
conflicts I rebuilt it on current `develop` with a much smaller
footprint:

- The guides stay in `docs/guide/` and the API reference in `docs/api/`.
Astro reads them where they are, so nothing that points at a guide path
had to change.
- Every URL stays the same. Pages still build to
`guide/basic-usage.html`, and names with dots like
`guide/migration-from-2.x-to-3.0.html` keep them, so the Worker,
`_headers` and inbound links don't need to change. The only addresses
that moved are the API overview, which is now `api.html`, the sitemap,
which is now `sitemap-index.xml`, and the old `api-ref-readme` page. All
three redirect in `docs/cf/_redirects`.
- The page edits are syntax only. Titles moved into frontmatter, `:::
tip` became `:::tip`, `::: warning` became `:::caution`, and live
examples open with `:::example{#id}`. Links, the `{{ $page.* }}` values
and the examples are handled by a Markdown plugin at build time, so the
pages themselves didn't need rewriting.

Everything the VuePress site did still works: the live examples with
Open in StackBlitz, the `.md` copy of every page, `llms-full.txt`, View
as Markdown, the coding agent wizard, search over the `tags`
frontmatter, the API sidebar listing each page's sections, and the
analytics and error reporting scripts in the head. The one thing I
dropped is the "Help us improve this page" link. It opened edits against
`master`, but the docs are edited on `develop`.

The look comes straight from the Handsontable docs. Every stylesheet in
`docs/src/styles/` except `custom.css` and `hyperformula.css` is an
exact copy of `docs/src/styles` in handsontable/handsontable at
`e2726d5`, so they can be refreshed by copying them again. The header,
sidebar, page title, contents sidebar, footer and Support menu are
adapted from their components, minus the framework switcher, versions
menu and docs assistant, which we don't need. Their header script was
written for Starlight 0.41, so I updated the mobile sidebar toggle for
the popover menu in 0.42. `hyperformula.css` has the few fixes their
styles needed on our pages. The Support menu links to the HyperFormula
forum category and the Slack Community, using the same addresses as
handsontable.com. The live examples' stylesheets are written for a light
page and StackBlitz opens them as they are, so in dark mode the site
swaps their fixed colors for the theme's.

A couple of things that are good to know when reviewing:

- Astro 7 uses Sätteri instead of remark for Markdown, so
`docs/src/markdown-plugins.mjs` is a Sätteri plugin. It's the same mdast
nodes though, so it reads a lot like a remark plugin.
- Heading anchors now come from `github-slugger`, which handles dots,
slashes, `&`, quotes and leading digits differently than VuePress did.
That changes 58 guide anchors, for example every release-notes version
(`#_3-5-0` is `#350` now) and `#moment-js-integration` (now
`#momentjs-integration`). So links from blog posts and issues don't
break, `legacyAnchorsPlugin` in `docs/src/markdown-plugins.mjs` puts the
old id on the same heading as an empty `<span>`, and both scroll to it.
I checked it against a VuePress build of `develop`, and every old
heading anchor lands on the same heading. API anchors like
`#buildfromarray` didn't change. I also updated the two internal links
that used the old form.

It's easier to review one commit at a time. The first five are the
migration itself: move the shared files out of `.vuepress`, convert the
syntax, add Astro, remove VuePress, and update `dev-docs`. The rest are
the theme and fixes on top.

### How did you test your changes?

I built the branch next to a VuePress build of the same `develop` commit
and compared the two.

- `npm run docs:install`, `docs:lint`, `docs:build` and `docs:build:cf`
all pass from clean installs, and CI runs the same steps.
- The output file list matches, except for the three redirected
addresses above. The `.md` copies of the guides are byte-identical.
- Every internal link resolves, checked the same way the Worker resolves
URLs. There are 43 broken `#static-…` anchors coming from the TypeDoc
output, but VuePress has 44 of the same ones, so that's not new.
- I loaded every page at 375, 800 and 1440 px and checked for horizontal
scrolling, leftover syntax and tables without the scroll wrapper. No
issues.
- All 12 live examples run with no console errors.
- On the Workers Builds preview, every page in the sitemap and its `.md`
copy returns 200, and the old `/docs/*` addresses still redirect to
handsontable.com.

Astro 7 needs Node 22.22 or newer. CI and Workers Builds both pick up a
new enough 22.x from the root `.nvmrc`, and both built this branch.

### Compatibility with Excel and Google Sheets

Not applicable.

### Public API changes

None.

### Out of scope and follow-ups

- The Workers Builds settings don't need to change. The build and deploy
commands are the same, and the asset directory comes from
`docs/wrangler.jsonc`.
- `docs/` stays outside the npm workspace for now. The legacy toolchain
reason is gone, but joining the workspace should be its own PR.
- Aside titles are hidden, same as on the current site and the
Handsontable docs.
- Search ranks API pages above the matching guide for some queries. If
you search "named expressions", the API classes come up before the
guide. That's worth tuning separately.
- A page address without `.html` 404s when the page name has a dot, like
`guide/migration-from-2.x-to-3.0`. That's how the Worker behaves today
too, so I didn't change it here.

### 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. Supersedes #1686 and #1791.

### Checklist
- [x] My pull request meets the [Definition of
Done](https://github.com/handsontable/hyperformula/blob/develop/dev-docs/DEFINITION-OF-DONE.md).
- [ ] 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).
- [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 with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Full replacement of the production docs build and deploy artifact
paths; correctness depends on URL redirects, Worker routing, and
Cloudflare build settings staying aligned with the new output layout.
> 
> **Overview**
> Replaces the HyperFormula documentation site builder: **VuePress 1.x
and `docs/.vuepress/` are removed** in favor of **Astro + Starlight**,
with configuration in `astro.config.mjs`, plugins and UI overrides under
`docs/src/`, and static deploy rules in `docs/cf/`.
> 
> **Build and repo wiring** now treat the portal output as `docs/dist/`
(not `.vuepress/dist`), ignore `.astro/`, and point lint, agent deny
lists, and dev-docs at the new layout. The built-in-functions generator
**slugifies categories with `github-slugger`** instead of VuePress
shared-utils.
> 
> **Guide content** is updated for Starlight: `title` in frontmatter (no
body `#` titles), `:::tip` / `:::caution` asides, `:::example{#id}` for
live demos, plain Markdown links instead of `$withBase`, and small
link/anchor fixes where heading ids changed (legacy ids are preserved
via a markdown plugin per the PR description).
> 
> **Behavior the old site had** is reimplemented on Astro: md companions
and `llms-full.txt`, search (Pagefind on full build), API sidebar
grouping, analytics/Sentry head tags, and Cloudflare **redirects** for
`api.html`, sitemap, and removed pages—while keeping familiar `.html`
page URLs for the Worker.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
17f0b67. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 5.5 <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.

2 participants