-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Move to npm workspaces #5301
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
Merged
Merged
Move to npm workspaces #5301
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
OEvgeny
approved these changes
Sep 23, 2024
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.
Changelog Entry
Changed
core-js-pure/Promise.withResolveersfromp-defer, in PR #5301, by @compulimFixed
punycodeto our dependencies asmarkdown-itrequires it but did not have it in theirpackage.json, in PR #5301, by @compulimDescription
Developers who fork and build Web Chat, will need to read
CONTRIBUTING.mdagain for updated/simplified instructions.Web Chat is on lerna@6. Starting from lerna@7, they are moving to npm workspaces.
We are also moving to npm workspaces. As we don't use many tools of lerna, we no longer install lerna.
Key differences between lerna@6 and npm workspaces:
prebump/postbumppackage-lock.jsonat the project rootlerna execequivalent in npmnx, which depends on a version of@parcel/watcherthat does not offer binaries for Windows on ARMDesign
Moving away from lerna
npm introduced workspaces feature which overlaps with lerna.
We are moving to NPM workspaces feature for a standard approach for maintaining mono repo.
By default, npm workspaces hoist packages (most packages at root
/node_modules). Some changes will need to be made in Web Chat for hoisting.For samples, we are maintaining another npm workspaces under
/samplesfolder.Moving away from
p-deferWhen running, it's complaining about "dynamic import" of
p-defer. We are moving away fromp-deferintoPromise.withResolversviacore-js-pure.We still need
core-js-pureponyfill because Chrome and Node.js in our test infrastructure does not natively supportPromise.withResolversyet.Specific Changes
CONTRIBUTING.mdwith steps for npm workspacesnpm run buildbeforenpm startnpm clean-install --strict-peer-depsprebumpandpostbumpscripts as npm recognizes local peer dependencies automaticallybumpscript will continue skip bumping local peer dependenciesauditfixscripts as we can now runnpm audit fix --workspacesat root levelcldr-dataandcldr-data-downloaderto prevent name collision/node_moduleslocation as all packages are now hoistedconcurrentlywith--prefix-colors "auto"and run asnpm:start:*punycodeto dependencies as it is required bymarkdown-itby missing in their production dependenciescldr-data: Movedinstallscript tobuildscript asinstallscript no longer run automaticallyfluent-bundle: Useisomorphic-reactto load a common version of React for@fluentui/*and Web Chatnpm installinstead ofnpm clean-installbecause we no longer have a localpackage-lock.jsonfor thetest/harnesspackageI have added tests and executed them locallyCHANGELOG.mdReview Checklist
Accessibility reviewed (tab order, content readability, alt text, color contrast)Browser and platform compatibilities reviewedCSS styles reviewed (minimal rules, noz-index)Internationalization reviewed (strings, unit formatting)package.jsonandpackage-lock.jsonreviewedSecurity reviewed (no data URIs, check for nonce leak)Tests reviewed (coverage, legitimacy)