This repository contains code and styling used in conjunction with content in Moodle for the RAISE project.
Prerequisites:
- Install Node Version Manager
- Create a local Moodle environment using raise-moodle-spikes
Run the following in a terminal to continuously build code as you make changes:
$ nvm use
$ npm install
$ npm run watch
In a separate terminal launch the development server to serve assets:
$ npm run dev
Configure your Moodle instance to include the Javascript and CSS bundles:
- Navigate to
Site Administration
->Appearance
->Additional HTML
- Populate the following into the
Within HEAD
box and save:
<link rel="stylesheet" href="http://localhost:3000/dist/assets/index.css">
<script type="module" crossorigin src="http://localhost:3000/dist/assets/index.js"></script>
There are a few script commands defined to help with running linters and tests:
$ npm run lint
$ npm test
If you're using VS Code as your editor, the following extensions can help with development:
For Stylelint
, you will need to add the following to your .vscode/settings.json
to see linting errors for .scss
files:
{
"stylelint.validate": ["css", "scss"]
}
Please refer to schemas for details on using supported interactive capabilities.
In order to update the client code generated by openapi to serve the EventsAPI you can use the command below. This process creates a docker container with java which runs the openapi-generator-cli commands.
If you want to modify the language or location of the client code, modify the arguments following -g or -o respectively.
$ cd k12-apps-raise
$ docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i https://events.raiselearning.org/openapi.json \
-g typescript-fetch \
-o local/src/eventsapi