Skip to content

Commit

Permalink
refactor: updated to Lerna 8 and moved monorepo to NPM Workspaces (#3836
Browse files Browse the repository at this point in the history
)

* refactor: updated to Lerna 9 and moved monorepo to NPM Workspaces

* docs: updated docs

* chore: updated package-lock
  • Loading branch information
sr258 authored Dec 29, 2024
1 parent ba17c9b commit 814b55d
Show file tree
Hide file tree
Showing 23 changed files with 26,589 additions and 57,646 deletions.
32 changes: 16 additions & 16 deletions docs/development/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
## Prerequisites

Make sure you have [`git`](https://git-scm.com/), [`node`](https://nodejs.org/)
>= 10.16, and [`npm`](https://www.npmjs.com/get-npm) installed. There might
be problems if you use `yarn` as it doesn't use the `package-lock.json` file and
>= 20, and [`npm`](https://www.npmjs.com/get-npm) installed. There might be
problems if you use `yarn` as it doesn't use the `package-lock.json` file and
you might get incorrect and untested dependencies.

**Important:** If you use Windows, you must use Bash (comes with Git for
Expand All @@ -18,23 +18,23 @@ cd h5p-nodejs-library
npm install
```

This will install all dependencies in all packages, run lerna's
[bootstrap](https://lerna.js.org/#command-bootstrap) command, linking all
cross-dependencies and downloads test-dependencies such as the h5p core and
This will install all dependencies in all packages, linking all
cross-dependencies and downloads test dependencies such as the h5p core and
editor library as well as content types.

## Structure of the repository

This repository is a so called monorepo and is managed by
[lerna](https://lerna.js.org). A monorepo is one repository for several
packages, which can be found in the `packages/` folder. Each subfolder is its
own package, published via [npm](https://www.npmjs.com). Packages are mostly
self contained except for the following cases:

* node modules needed for every package are located in the root `package.json`
and `node_module` folder. The [jest](https://jestjs.io) testing framework and
`typescript` are used in every package - therefore these are installed in the
root `node_module` folder and made accessible in every package.
This repository is a [NPM
workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) monorepo. A
monorepo is one repository for several packages, which can be found in the
`packages/` folder. Each subfolder is its own package, published via
[npm](https://www.npmjs.com). Packages are mostly self contained except for the
following cases:

* NPM modules needed for every package are located in the root `package.json`
and `node_module` folder. For example, the [jest](https://jestjs.io) testing
framework and `typescript` are used in every package - therefore these are
made accessible in every package.
* data used for unit and integration tests that are required by more than one
package are located in `test/data`. Data used for only single packages is
located in the respective `package/<name>/test/data` folder.
Expand All @@ -53,7 +53,7 @@ npm run build

To start the server-side-rendering example run

```
```bash
npm start
```

Expand Down
3 changes: 1 addition & 2 deletions docs/examples/rest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ application are provided by which package:
## Trying it out

1. Clone the repository
2. Run `npm install` **in the root**. This will install all dependencies of the example packages and internally link the packages inside the monorepo with
symlinks (lerna).
2. Run `npm install` **in the root**. This will install all dependencies of the example packages and internally link the packages inside the monorepo.
3. Run `npm start` for the server. (Must be up and running before you start the client!)
4. Run `npm start` for the client (**the server must still be running**).
5. A browser should open on http://localhost:3000. If there is an error, you have to reload the the page, as the server might not be fully initialized yet.
Expand Down
3 changes: 2 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ export default [
'**/node_modules/',
'**/*.d.ts',
'**/*.config.js',
'packages/h5p-html-exporter/src/**/*.js',]
'packages/h5p-html-exporter/src/**/*.js',
'packages/h5p-examples/public']
},
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
Expand Down
Loading

0 comments on commit 814b55d

Please sign in to comment.