guardian / prosemirror-noting

Prosemirror plugin that adds the ability to have ranges added to the document that expand and contract around dependent on the input.
MIT License
57 stars 8 forks source link

Move build from rollup to vite #54

Closed rhystmills closed 5 months ago

rhystmills commented 5 months ago

What does this change?

This PR moves the build process from Rollup to Vite, removes many now-unused dependencies, and bumps the version of many remaining dependencies.

Running yarn build was failing for me - possible due to some clashes in dependency changes since the last release (four years ago). I had a go at bumping various packages but kept encountering errors related to either rollup or eslint. With so many linked dependencies, it was difficult to isolate which one was at the route of the problem.

I've decided instead to remove rollup completely, and replace with Vite. Vite is used more widely in Content Production, especially in related packages like https://github.com/guardian/prosemirror-typerighter and https://github.com/guardian/prosemirror-editor

eslint has been modernised, using the new config format, replacing .eslintrc.json.

How to test

  1. Run yarn then yarn build locally in this project. Does it build?
  2. There should be (at least) files called noting.js and noting.css in the top level dist folder.

You could also try publishing locally with yarn yalc and then use it in flexible-content (via yalc add @guardian/prosemirror-noting in the composer directory).

rhystmills commented 5 months ago

I was having trouble running this locally - some obscure bug was causing all text nodes in our Composer editor to show as the string 'undefined', I've now released a more simpler fix to get the build running: https://github.com/guardian/prosemirror-noting/pull/55