-
Notifications
You must be signed in to change notification settings - Fork 236
feat(create-workspace): Add a script to quickly create a new workspace from the template #2415
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
Conversation
…or the new monorepo workspace
…NTRIBUTING to describe the new working flow
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.
Amazing! Great to have these config packages in its own folder, and the mocha config is super neat.
packages/data-service/package.json
Outdated
"prepublishOnly": "npm run compile", | ||
"pretest": "npm run compile && mongodb-runner start --port=27018", | ||
"test": "cross-env TS_NODE_FILES=true nyc mocha --colors --timeout 15000 -r ts-node/register src/**/*.spec.*", | ||
"test": "cross-env TS_NODE_FILES=true nyc mocha", |
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.
was fighting with this a lot, can we have a different task for covered tests (test-cov
)? And a test-watch
with --watch
, maybe only me, but personally I use that a ton and run tests each 3 seconds, i would love to have a way for that to be really fast.
scripts/create-workspace.js
Outdated
depcheck: 'depcheck', | ||
check: 'npm run lint && npm run depcheck', | ||
'check-ci': 'npm run check', | ||
test: 'cross-env TS_NODE_FILES=true nyc mocha', |
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.
was fighting with this a lot, can we have a different task for covered tests (test-cov
)? And a test-watch
with --watch
, maybe is only me, but personally I use that a ton and run tests each 3 seconds, i would love to have a way for that to be really fast.
Would you be ok with including the changes i've done here: (also fixes nyc reporting coverage in test files)
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.
Totally, let's include this stuff in the template! Then following your suggestion we will scripts like this:
test
->mocha
test-cov
->cross-env TS_NODE_FILES=true nyc -x "**/*.spec.*" npm run test
test-watch
->npm run test -- --watch
test-ci
->npm run test-cov
Makes sense?
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.
Yep!
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.
Done in 34089b9
return; | ||
} | ||
|
||
console.log(); |
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.
is this a newline?
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.
Yep
...base, | ||
require: base.require.concat([ | ||
'jsdom-global/register', | ||
path.resolve(__dirname, 'chai-dom-register.js'), |
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.
should we add also sinon
and sinon-chai
somewhere?
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.
Yep, good idea, seems like we use it a lot in tests suites (I somehow never noticed before)
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.
Done in a74c870
Co-Authored-By: Maurizio Casimirri <maurizio.cas@gmail.com>
…figuration Co-Authored-By: Maurizio Casimirri <maurizio.cas@gmail.com>
901305a
to
17c9224
Compare
I noticed that our CONTRIBUTING section about creating a new package got kinda long and consisting of too many steps to do manually, there was also some undocumented things about the npm scripts that caused some CI failures recently. I started with just updating the docs, but it seems to me that having some tool that will ask you a few questions and bootstrap everything itself might be a better approach here. This is how this script looks in action:
I also moved all the config files into their own
configs
folder so it's a bit easier to find them and they are not in the way when looking for packages.Rendered CONTRIBUTING.md for convenience.