Skip to content

buildit/aem-react-scaffold

Repository files navigation

AEM-React Scaffold Project

This is a scaffold project for getting React components working within AEM. It is based on this project https://github.com/sinnerschrader/aem-react-js

Build/deploy to AEM

To quickly build and deploy after cloning:

npm install
npm run deploy

NPM scripts in detail

  • Create new component with generator: npm run generator
  • Build: npm run build
  • Test (watch and produce HTML reports): npm run test
  • Test (single run for prod and cobertura reports): npm run test:prod
  • Build & test (single run): npm run start
  • Deploy to AEM (will build, run tests and push to AEM): npm run deploy
  • Run storybook on local server: npm run storybook

Creating components

You should use the generator to create components. This will make sure things go in the right place plus it will generate the AEM boilerplate code that needs to go with each component. The project is setup so that you can have a deployable site (src/com) and an associated styleguide site (src/styleguide). Feel free to rearrange as needed but keep in mind you'll have to update the generator if you change these paths.

src/content has the AEM boilerplate. Normally you do not have to touch this, however you may need to if you want to start restricting what can and cannot be shown in the sidekick when authoring.

In general you should only be working in src/com and src/styleguide.

Sample page

A sample page is included at http://localhost:4502/content/react-demo/sample-page.html?wcmmode=disabled After deployment you should be able to see it. This contains the sample components under the src directory.

Related projects

This project is based on the AEM React project by SinnerSchrader.

About

Scaffold project for using React within AEM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published