# Core updates

## Introduction

This library uses components of the "regular" H5P libraries to display the editor and the player. For this purpose, the JavaScript and CSS files that make up the JavasScript client (which is run in the browser) are copied over from Joubel's PHP implementation upon `npm install`.

As newer content type versions typically as require a new core version, we need to regularly update the references to the core files.

## Steps

1. Change the script in `scripts/install.sh` to download the new H5P versions from GitHub
2. Change the values of these properties of the editor configuration object (e.g. [`H5PConfig.ts`](https://github.com/Lumieducation/H5P-Nodejs-library/blob/release/packages/h5p-server/src/implementation/H5PConfig.ts)):
   * `coreApiVersion` (put in the version H5P now uses in the downloaded core files; typically the version of h5p-editor-php-library without patch version, e.g. 1.24)
   * `h5pVersion` (put in the version of the PHP libraries themselves (includes patch version, e.g.: 1.24.1))
3. Change the README to reflect the new versions (download links to GitHub)
4. Check if there are new JavaScript files in the core that are required to run the editor or the player. Add them to the `H5PPlayer.coreScripts()` or `H5PEditor.coreScripts()` methods in the respective files.
5. Run `npx ts-node packages/h5p-server/scripts/generate-supported-language-list.ts` to update the list of languages the editor supports.
6. Run all tests (including test:integration) to check if the everything still works as expected. (for example, inserting scripts might break tests)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.lumi.education/development/core-updates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
