Skip to content

Commit

Permalink
Merge pull request #490 from ckeditor/migrate-to-esm
Browse files Browse the repository at this point in the history
Internal: Migrate from webpack and Karma to Vite and Vitest. See ckeditor/ckeditor5#16616.

Internal: Fix test coverage which only covered a small portion of the codebase.

MINOR BREAKING CHANGE: Migrate to ESM. Related to ckeditor/ckeditor5#16616.
  • Loading branch information
filipsobol authored Jul 12, 2024
2 parents 2a0d189 + 36e4456 commit 630074a
Show file tree
Hide file tree
Showing 130 changed files with 7,450 additions and 13,509 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
command: yarn run build
- run:
name: Run unit tests
command: yarn run coverage
command: yarn run test
- run:
name: Verify the code coverage
command: |
Expand Down
1 change: 1 addition & 0 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ module.exports = {
},
'rules': {
'react/prop-types': 'off',
'react/no-deprecated': 'off',
'no-console': 'off',
'no-trailing-spaces': 'error',
'ckeditor5-rules/allow-imports-only-from-main-package-entry-point': 'off',
Expand Down
29 changes: 17 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,33 @@ npm install

You can also use [Yarn](https://yarnpkg.com/).

### Running the development server

To manually test the editor integration with different versions of React, you can start the development server using one of the commands below:

```bash
npm run dev:16 # Open the demo projects using React 16.
npm run dev:18 # Open the demo projects using React 18.
npm run dev:19 # Open the demo projects using React 19.
```

### Executing tests

Before starting tests execution, you need to build the package. You can use `npm run build` in order to build the production-ready version
or `npm run develop` which produces a development version with attached watcher for all sources files.
To test the editor integration against a set of automated tests, run the following command:

```bash
npm run test -- [additional options]
# or
npm t -- [additional options]
npm run test
```

The command accepts the following options:
If you want to run the tests in watch mode, use the following command:

* `--coverage` (`-c`) – Whether to generate the code coverage.
* `--source-map` (`-s`) – Whether to attach the source maps.
* `--watch` (`-w`) – Whether to watch test files.
* `--reporter` (`-r`) – Reporter for Karma (default: `mocha`, can be changed to `dots`).
* `--browsers` (`-b`) – Browsers that will be used to run tests (default: `Chrome`, available: `Firefox`).
```bash
npm run test:watch
```

### Building the package

Build a minified version of the package that is ready to publish:
To build the package that is ready to publish, use the following command:

```bash
npm run build
Expand Down
24 changes: 0 additions & 24 deletions demo-multiroot-react-18/package.json

This file was deleted.

74 changes: 0 additions & 74 deletions demo-multiroot-react-18/src/App.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions demo-multiroot-react-18/src/main.tsx

This file was deleted.

9 changes: 0 additions & 9 deletions demo-multiroot-react-18/src/vite-env.d.ts

This file was deleted.

22 changes: 0 additions & 22 deletions demo-multiroot-react-18/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions demo-multiroot-react-18/tsconfig.node.json

This file was deleted.

13 changes: 0 additions & 13 deletions demo-multiroot-react-18/vite.config.ts

This file was deleted.

Loading

0 comments on commit 630074a

Please sign in to comment.