-
Notifications
You must be signed in to change notification settings - Fork 53
Conversation
d2787b8
to
17a0e66
Compare
Perf comparison
Generated by 🚫 dangerJS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for this, @ecraig12345 - this is a good step forward
821f692
to
b74f1e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since Stardust became a monorepo it was not possible to run UTs direcly in WebStorm.
After this change I can run them again 🎉
@miroslavstastny Cool! I'm curious which part of the change enabled that? |
I think the pure fact that it is now possible to run |
577ec8a
to
0e9fb42
Compare
152dfce
to
c10be51
Compare
@@ -18,7 +18,7 @@ module.exports = api => { | |||
'@babel/preset-env', | |||
{ | |||
modules: useESModules ? false : 'cjs', | |||
targets: isNode ? { node: '8' } : undefined, | |||
targets: isNode ? { node: '10' } : undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
So much awesome!!! |
Add an individual jest configuration for each package instead of one configuration at the root. This is one step towards making the packages' builds more modular, which is a prereq for converging to one repo.
Also add per-package
test
,test:watch
, andclean
commands, and makegulp bundle:package:*
automatically run against the current directory if in a sub-package.New workflow
While in the root directory:
yarn test
runs each project'stest
script (basicallylerna run test --stream
)yarn test:watch
runs/watches all tests in non-just projectsyarn clean
cleans cache, docs, and each projectWhile in a package directory:
yarn test
andyarn test:watch
runs that project's testsyarn clean
cleans that project's outputgulp bundle:package:*
(where*
is the rest of a task name) runs the specified task against only the current packageDetails
Getting the tests working per-project also required adding per-project
gulpfile.ts
,.gulp.js
(formerly.gulp.json
), andbabel.config.js
. For now these mostly just reuse the base configs.Exception to the above: I removed the
build:docs:component-info
andbuild:docs:component-behavior-menu
steps from the defaulttest
command, and moved them to overrides of thetest
command in the gulpfiles of the relevant projects (react
andaccessibility
respectively).I also made assorted typing updates to build files--turned out to not be needed, but I'm checking them in anyway since I already did the work and they help a bit with maintainability/understandability. (Background is I thought they were needed before Ken figured out that I needed to copy the
.gulp.js
file into each project to make it register babel properly. Without that file, it was trying to use ts-node to interpret TS scripts, and apparently ts-node does type checking based on the project's config, which caused type errors in newer projects with stricter configs.)Other stuff
bundle:package:types
to onlycd
if it's being run at the rootisRoot
andpackage
toconfig.ts
for convenient reference in tasksdel
instead ofrimraf
so we can easily delete multiple things in one taskmaxWorkers
CI setting fromconfig.yml
tobuild/gulp/tasks/test-unit.ts
to avoid issues with the syntax of passing it through on the command linewatch:docs
task into separate parts so that thereact
andaccessibility
packages can run only the parts they needperf-test/just.config.ts
wait to load anything from@fluentui/digest
until it's actually needed. This makes theclean
andtest
scripts work even if digest hasn't been built yet. (issue will go away with project references!)process.env.DEBUG
is set--could switch to a different detection method if preferred)moduleNameMapper
config usinglerna-alias
in jest config for just-based projectsIf anyone is interested, this is the VS Code launch.json configuration I used for debugging scripts...