-
Notifications
You must be signed in to change notification settings - Fork 279
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
[React] Move template related scripts to the base package #1506
Conversation
.../create-sitecore-jss/src/templates/react/src/components/styleguide/Styleguide-RouteFields.js
Outdated
Show resolved
Hide resolved
/** | ||
* CONFIG GENERATION | ||
*/ | ||
require('./generate-config'); |
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.
Would env values for config be read anywhere?
In nextjs we set initial values from env and set the missing values from package.json and scjssconfig.
And would it be better to make bootstrap into plugin too, for parity with nextjs?
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.
I added env variables for default config
but bootstrap doesn't have plugins (even in nextjs sample app) and I think that we don't really need it since we just need to call a few scripts, maybe let's "pluginize" it if it will be more complex? (like component builder generation)
packages/create-sitecore-jss/src/templates/react/scripts/scaffold-component.js
Outdated
Show resolved
Hide resolved
packages/sitecore-jss-dev-tools/src/templating/react/generate-component-builder.ts
Show resolved
Hide resolved
packages/sitecore-jss-dev-tools/src/templating/react/generate-component-builder.ts
Show resolved
Hide resolved
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.
This is a huge effort, thanks Illia.
I've left some comments for small improvements
packages/sitecore-jss-dev-tools/src/templating/scaffold.test.ts
Outdated
Show resolved
Hide resolved
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.
This looks great!
I'm thinking we should also update the nextjs
template to remove duplicated code which is now available in the sitecore-jss-dev-tools
package. It appears much of the templating code that was moved is the same in nextjs.
packages/create-sitecore-jss/src/templates/react/scripts/generate-component-builder/index.js
Show resolved
Hide resolved
@ambrauer Agree, "nextjs" also should be updated, but let's update it in a scope of next PBI, since even this part is bigger than was expected initially (we wanted to verify a new approach starting from "react"), and we need to consider doc input + testing. I will create follow-up item |
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.
@illiakovalenko Sounds good, as long as the nextjs work item is a fast-follower (we want these to be in the same upcoming release).
Description / Motivation
PR includes:
Testing Details
Types of changes