@Akryum I am so sorry for these large pull requests.
I've replaced most of the Regex we used to parse Meteor packages with a JavaScript parser to extract the data we need to build up Meteor stubs for Vite, this addresses most of the syntax-based edge cases caused by Meteor's package format.
It also makes it a lot easier to traverse through the bits of the package source we need to build up a good stub, all without having to worry about debugging and refactoring long lines of ungodly regex statements from the last PR. π
β The Vite plugin has been moved into its own package to make it a little easier to work on, particularly for managing dependencies and testing!
π€ Meteor package stubs are now validated on the client at runtime. So non-working packages won't just silently fail when you least expect it. Though, that shouldn't happen anymore. Not foolproof, as it will emit false-positive warnings for packages that export undefined. Warnings can be ignored per-package through the Meteor settings.json file.
π₯ Tests can finally run server-side now, and using Vitest, they are blazingly fast.
π Debug mode added to Vite plugin - captures all incoming Meteor package code and outgoing stubs into a mock file format for tests.
β Module re-exports from nested directories is now handled the same way like non-nested modules, which I believe didn't work earlier and would export as undefined.
π¬ Converted plugin and workers to TypeScript.
There's a few bits and pieces left to do, but I'll have the PR ready early next week. π
I'm planning on shipping the fork as it's own package so it can be put in use and its own line of issue reports while this PR waits for a review.
I've replaced most of the Regex we used to parse Meteor packages with a JavaScript parser to extract the data we need to build up Meteor stubs for Vite, this addresses most of the syntax-based edge cases caused by Meteor's package format.
It also makes it a lot easier to traverse through the bits of the package source we need to build up a good stub, all without having to worry about debugging and refactoring long lines of ungodly regex statements from the last PR. π
undefined
. Warnings can be ignored per-package through the Meteor settings.json file.undefined
.There's a few bits and pieces left to do, but I'll have the PR ready early next week. π
I'm planning on shipping the fork as it's own package so it can be put in use and its own line of issue reports while this PR waits for a review.