Repository navigation
Contributing
Cay Henning edited this page May 15, 2024
·
6 revisions
- Node v16 or higher
- Yarn or Bun (both package managers are viable options and work for MWDK development)
- Checkout this repo or make your own fork (recommended).
- Run
yarn install && yarn build && yarn linkinside the Materia Widget Development Kit. - Run
yarn start
- Find a widget to run the MWDK for. Run
rm -rf node_modules. - In your
package.json, enter the GitHub URL for your MWDK development branch. For example, you can use:"materia-widget-development-kit": "https://github.com/cayb0rg/Materia-Widget-Dev-Kit.git#issue/webpack-5-upgrade" - Run
yarn install - (Optional) Run
yarn link materia-widget-development-kit. This will allow you to make changes to the MWDK without having to reinstall it in your widget. - Run
yarn start
The MWDK uses the following technologies:
- Express.js for the server and webpack-dev-middleware for compiling and viewing assets
- Handlebars view engine for rendering .hbs template files. All template files can be found in the views folder.
- Webpack 5 for compiling and bundling the assets
-
webpack.config.jsis for the MWDK only. -
webpack-generate-widget-hash.jsis responsible for generating the.wigtfile for installing to Materia. -
webpack-widget.jsis where the webpack configuration for individual widgets are generated.- A HTMLWebpackPlugin is created for every .html file in the widget's entries. This plugin outputs an HTML file with all of the necessary CSS and JS assets.
- The MiniCssExtractPlugin is responsible for extracting the CSS from the entries.
- All of the default loaders are defined here as well, such as the React loader, Coffee loader, image loaders, etc.
-
The player, creator, and scorescreen run on the same files as Materia, published in the Materia widget dependencies package. API Endpoints (calls to /api/json/*) are being mocked in express.js.
This Wiki will be updated over time. For now, good luck and have fun!