feat(validation): make validation ESM/CJS package [WIP] #479
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes validation package a hybrid ESM/CJS one.
It started with VSCode extension not really supporting ESM-only packages. Such can be only imported with dynamic import which has a number of limitations AFAIU, see kubeshop/vscode-monokle#8. And then it seems VSC team does not have any timeline or clear incentive to support such - you can read the discussion here microsoft/vscode#130367.
It was okeyish for validation import only, but the same issue happens with new
synchronizer
package. And sincesynchronizer
depends onvalidation
package (well, for types import only but still) both needs to be CJS.Based on https://www.sensedeep.com/blog/posts/2021/how-to-create-single-source-npm-module.html.
This is WIP as I still need to test if it works with VSC and Cloud correctly without breaking anything, I'm still not sure if other dependencies won't cause issues too. See #479 (comment).
Changes
Fixes
Checklist