-
Notifications
You must be signed in to change notification settings - Fork 45
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
DS-408: Convert yeoman to plop alternative #2274
DS-408: Convert yeoman to plop alternative #2274
Conversation
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.
@adamszalapski this is great 🎉 I thought we'd never get around to it.
I especially like:
plop
seems much simpler thanyo
- Well-organized "helpers"
- Testing coverage
- User input validation, e.g. "Don't include underscores"
- Uses the latest Jest test templates
One question: if you try to run yarn start
immediately after creating a component/element you'll see an error:
Error: Cannot find module '@bolt/components-foo/package.json'
I think this is because yarn
doesn't know about the new package yet, even though it has been added as a dependency. Running yarn
fixes it. Should we automatically run yarn
on create or just leave that up to the user? Do you know of another way to register the new package?
Approved once we decide on this question^
Update: I'm merging as is. We can discuss the yarn
question later on.
const boltPackageJsonPath = resolve.sync('@bolt/starter-kit/package.json') | ||
const boltPackageJson = require(boltPackageJsonPath); | ||
|
||
const updateBoltPackage = (packageName, writePath) => { |
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.
👏
…rnative # Conflicts: # packages/generators/yeoman-create-component/CHANGELOG.md # packages/generators/yeoman-create-component/package.json
Jira
https://pegadigitalit.atlassian.net/browse/DS-408
Summary
Rewriting the component generator from yeoman to plop and adding the element generator.
Details
The previous yeoman generator is removed. In his place, we added a plop generator that is easier to use and more developer-friendly. Except we rewrite the component generator we add elements generator.
How to test
yarn setup
.yarn cc
to generate component and check if all the files are generated correctly.yarn jest packages/generators/bolt-generator/__tests__/component/bolt-generator.js
and check if all tests passed.yarn ce
to generate element and check if all the files are generated correctly.yarn jest packages/generators/bolt-generator/__tests__/element/bolt-generator.js
and check if all tests passed.We need only two acceptations but I want you all to check this code.