-
Notifications
You must be signed in to change notification settings - Fork 31
Transition to Yarn Workspaces #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
leeyi45
wants to merge
75
commits into
master
Choose a base branch
from
yarn-workspaces
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are still many tasks left to be done, this is far from complete, but I thought I'd open this now for feedback. I'm especially concerned that the structure of the repository looks a lot more complex now, so I'm wondering if there's any need for simplifying things. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Transition to Yarn Workspaces
Yarn has supported Workspaces since Yarn 1, but it has matured over later versions and we can now use it since we have moved to using Yarn 4.
The main motivations for doing this are:
@jscad/modeling
patch forcsg
). Also each bundle/tab can customize its owntsconfig
etc..Migration to
vitest
This repository was migrated to
vitest
, which has been designed as a drop in replacement forjest
. I find that gettingjest
to work with the wide mix of ESM and CJS syntaxes has been a major headache, and configuration forjest
has always been needlessly complicated.vitest
supports TypeScript and ESM out of the box and has generally provided a far smoother experience, especially when dealing with dependencies that need to be tested (liketypedoc
).Why I hate Jest
Basically some scripts relied on__dirname
, which is only available in CJS, and so would not work if compiled to ESM. But the scripts also used top level await, so compiling to CJS wasn't an option. Thus,import.meta.dirname
would have to be used instead, but that meant thatjest
couldn't transform these files unless it was run in its experimental ESM mode, which would then cause many of the CJS bundled dependencies to break because they don't use imports with extensions.The alternatives would have been significantly bulkier
jest
configurations or major changes to the code, and even after trying both of those I still ended up with errors becausejest
wouldn't properly transform dependencies.Also because
jest
insists on transforming to CJS, we can't useverbatimModuleSyntax: true
intsconfig
, instead requiring some weird configuration as a workaround.Upgrading Module Manifests
This PR is the beginning of the steps required to address #57. Bundles will now be able to specify a
requires
field in their manifest that specifies the minimum version of Source that the bundle can be used with.Bundles will also be able to specify versions to help work toward resolving #79. A bundle manifest can now look like:
Each bundle specifies its own manifest, which is then collated by the build tools automatically.