Skip to main content
Version: Next

Contribution Guide

The bundle has two independent frontend builds. Neither touches the output of the other.

BuildSourceToolOutput
Legacy explorer (explorer, loader entries)assets/jswebpack encoresrc/Resources/public/build (committed)
Explorer app on the Studio stackassets/explorerrsbuildsrc/Resources/public/explorer (committed)

The Studio module in assets/studio has its own rsbuild build and is not covered here.

Frontend Builds: legacy explorer​

All legacy frontend assets are build with webpack encore. The most recent production build is added to the repository in src/Resources/public/build folder.

To build frontend assets

  • install webpack encore to your project
  • add following content to your package.json
{
"name": "demo-project",
"version": "1.0.0",
"description": "This skeleton should be used by experienced Pimcore developers for starting a new project from the ground up. If you are new to Pimcore, it's better to start with our demo package, listed below 😉",
"main": "index.js",
"scripts": {
"encore": "encore",
"dev": "npx encore dev --watch",
"production": "npx encore production"
},
"dependencies": {
"statitics-explorer": "file:<RELATIVE_PATH_TO_STATISTICS_EXPLORER_BUNDLE>"
},
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/preset-react": "^7.10.4",
"@symfony/webpack-encore": "^0.31.0",
"webpack-notifier": "^1.8.0"
}
}
  • for development use the following command: npm run dev
  • for creating production build use the following command: npm run production

Frontend Builds: explorer app (assets/explorer)​

A TypeScript app (React 18, rsbuild, antd through the Portal UI Kit) that builds beside assets/js. The legacy entries stay until the next major release. It builds the explorer and loader entries (src/explorer/index.tsx, src/loader/index.tsx) that replace them.

The app depends on @pimcore/portal-ui-kit, which is delivered by Composer as pimcore/portal-ui-kit (required in composer.json) and linked by path, like portal_engine/assets/portal does:

"@pimcore/portal-ui-kit": "file:../../vendor/pimcore/portal-ui-kit/frontend/portal-ui-kit"
  • run composer install in the bundle first, so that vendor/pimcore/portal-ui-kit exists
  • cd assets/explorer && npm install
  • npm run build creates the production bundle in src/Resources/public/explorer, which installs serve as /bundles/pimcorestatisticsexplorer/explorer; commit it with every change to the app (a test compares it with a fresh build)
  • npm run dev starts the rsbuild dev server
  • npm run check-types runs the type check
  • npm test runs the tests (vitest)