https://github.com/sr258/h5p-sharedb-test
https://github.com/sr258/h5p-sharedb-test
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/sr258/h5p-sharedb-test
- Owner: sr258
- License: mit
- Created: 2021-12-28T20:03:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T15:33:51.000Z (over 2 years ago)
- Last Synced: 2025-06-04T19:37:10.820Z (about 1 year ago)
- Language: TypeScript
- Size: 594 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# H5P shared state sample
A simple voting content types that demonstrates how to use lumieducation's
shared state server.
## Getting started (development)
Requirements:
- NodeJS >= 16
- NPM >= 7
Clone this repository with git and check out the branch that you are interested
in (or choose the branch first and then download the archive, but learning
how to use git really makes sense).
Change to the repository directory and run
```bash
npm install
```
to install required modules. Afterwards, you can build the project using
```bash
npm run build
```
or, if you want to let everything be built continuously while you are making
changes to the code, run
```bash
npm run build:watch
```
Before putting the code in production, you should always run `npm run build`.
The build process will transpile TypeScript to JS that can be used in browser.
The build process will also move the source files into one distribution file and
minify the code.
## Dependency
There is a dependency on the H5P library [H5P.SharedStateClient](https://github.com/sr258/h5p-shared-state-client). You need to include it in the .h5p bundle.
## Using
- Make sure the directory of this repository is "H5P.ShareDBTest-0.1" (or the
current version number).
- run `npm build`
- Install the H5P CLI tool from NPM (`npm install -g h5p`)
- go the parent directory of the repo
- run `h5p pack h5p-sharedb-test h5p-shared-state-client out.h5p`
- Upload the resulting libraries.h5p file to WordPress (Make sure you've set these values in wp-config.php when you want to upload the same version again):
- define('H5P_DEV', true);
- define('H5P_DISABLE_AGGREGATION', true);