Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions .eslintrc.cjs

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/release-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "24.x"
cache: "yarn"
- name: project - install
run: yarn --frozen-lockfile
- run: yarn eslint
- run: yarn lint
- run: yarn test --run

publish:
needs: test
Expand All @@ -36,10 +38,11 @@ jobs:
- uses: actions/setup-node@v4
with:
node-version: "24.x"
cache: "yarn"
registry-url: https://npm.pkg.github.com/
- name: project - install
run: yarn --frozen-lockfile
- run: yarn prepare
- run: yarn build
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6 changes: 5 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: tests

on: [push]
on:
push:
pull_request:

jobs:
build:
Expand All @@ -21,3 +23,5 @@ jobs:
run: yarn --frozen-lockfile
- name: lint
run: yarn lint
- name: test
run: yarn test --run --coverage
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
## [v47.6.1-next.0](https://github.com/Multiverse-io/ckeditor5-math/compare/v43.2.0-next.2...v47.6.1-next.0) (2026-03-27)

- Update dependencies and compatibility for CKEditor 47.6.1.
- Replace `@ckeditor/ckeditor5-package-tools` build toolchain with Vite
and Vitest.
- Fix blank equations when moving or inserting containers with nested
math widgets.
- Fix drag-and-drop reconversion and widget persistence after moving math widgets.
- Restore KaTeX sample rendering and balloon form styling for CKEditor 47.
- Raise the minimum Node.js version to 24.11+ for the CKEditor 47 toolchain.
Expand Down
95 changes: 32 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ ckeditor5-math is a TeX-based mathematical plugin for CKEditor 5. You can use it
* [`test`](#test)
* [`lint`](#lint)
* [`stylelint`](#stylelint)
* [`build:dist`](#builddist)
* [`translations:collect`](#translationscollect)
* [`translations:download`](#translationsdownload)
* [`translations:upload`](#translationsupload)
* [`ts:build` and `ts:clear`](#tsbuild-and-tsclear)
* [`build`](#build)
* [`build:npm`](#buildnpm)
* [`build:browser`](#buildbrowser)
* [`build:types`](#buildtypes)
* [`translations:synchronize`](#translationssynchronize)
* [`translations:validate`](#translationsvalidate)

## Features

- Written in TypeScript (as of v41.2.1)
- DLL build support (as of v36.0.3)
- TeX syntax
- Inline and display equations
- Preview view
Expand Down Expand Up @@ -115,24 +115,6 @@ InlineEditor.defaultConfig = {

**Copy theme/ckeditor5-math folder** from [https://github.com/isaul32/ckeditor5/tree/master/packages/ckeditor5-theme-lark](https://github.com/isaul32/ckeditor5/tree/master/packages/ckeditor5-theme-lark) to your lark theme repository

### Using DLL builds

Use the [official DLL build](https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/alternative-setups/dll-builds.html) and additionally load the math plugin:

```html
<script src="path/to/node_modules/@multiverse-io/ckeditor5-math/build/math.js"></script>
<script>
CKEditor5.editorClassic.ClassicEditor
.create(editorElement, {
plugins: [
CKEditor5.math.Math,
...
],
...
});
</script>
```

## Configuration & Usage

### Plugin options
Expand Down Expand Up @@ -328,21 +310,16 @@ yarn run start --language=de

### `test`

Allows executing unit tests for the package, specified in the `tests/` directory. The command accepts the following modifiers:

* `--coverage` &ndash; to create the code coverage report,
* `--watch` &ndash; to observe the source files (the command does not end after executing tests),
* `--source-map` &ndash; to generate source maps of sources,
* `--verbose` &ndash; to print additional webpack logs.
Runs the browser-based Vitest suite from the `tests/` directory.

Examples:

```bash
# Execute tests.
yarn run test

# Generate code coverage report after each change in the sources.
yarn run test --coverage --test
# Generate a one-off coverage report.
yarn run test --run --coverage
```

### `lint`
Expand All @@ -367,61 +344,53 @@ Examples:
yarn run stylelint
```

### `build:dist`
### `build`

Creates npm and browser builds of your plugin. These builds can be added to the editor by following the [Configuring CKEditor 5 features](https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/configuration.html) guide.
Creates the declaration, npm, and browser builds of the plugin.

Examples:

```bash
# Builds the `npm` and browser files thats are ready to publish.
npm run build:dist
# Build everything that is ready to publish.
yarn run build
```

### `translations:collect`
### `build:npm`

Collects translation messages (arguments of the `t()` function) and context files, then validates whether the provided values do not interfere with the values specified in the `@ckeditor/ckeditor5-core` package.
Creates the ESM package that is published to npm.

The task may end with an error if one of the following conditions is met:
```bash
yarn run build:npm
```

* Found the `Unused context` error &ndash; entries specified in the `lang/contexts.json` file are not used in source files. They should be removed.
* Found the `Context is duplicated for the id` error &ndash; some of the entries are duplicated. Consider removing them from the `lang/contexts.json` file, or rewrite them.
* Found the `Context for the message id is missing` error &ndash; entries specified in source files are not described in the `lang/contexts.json` file. They should be added.
### `build:browser`

Examples:
Creates the browser bundle in `dist/browser/`.

```bash
yarn run translations:collect
yarn run build:browser
```

### `translations:download`
### `build:types`

Download translations from the Transifex server. Depending on users' activity in the project, it creates translation files used for building the editor.

The task requires passing the URL to Transifex API. Usually, it matches the following format: `https://www.transifex.com/api/2/project/[PROJECT_SLUG]`.

To avoid passing the `--transifex` option whenever you call the command, you can store it in `package.json`, next to the `ckeditor5-package-tools translations:download` command.

Examples:
Generates the TypeScript declaration files in `dist/`.

```bash
yarn run translations:download --transifex [API URL]
yarn run build:types
```

### `translations:upload`
### `translations:synchronize`

Uploads translation messages onto the Transifex server. It allows users to create translations into other languages using the Transifex platform.
Collects translation messages and synchronizes the package translation files.

The task requires passing the URL to the Transifex API. Usually, it matches the following format: `https://www.transifex.com/api/2/project/[PROJECT_SLUG]`.
```bash
yarn run translations:synchronize
```

To avoid passing the `--transifex` option whenever you call the command, you can store it in `package.json`, next to the `ckeditor5-package-tools translations:upload` command.
### `translations:validate`

Examples:
Validates translation contexts without updating files.

```bash
yarn run translations:upload --transifex [API URL]
yarn run translations:validate
```

### `ts:build` and `ts:clear`

These scripts compile TypeScript and remove the compiled files. They are used in the aforementioned life cycle scripts, and there is no need to call them manually.
50 changes: 50 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import globals from 'globals';
import { defineConfig } from 'eslint/config';
import eslintConfigCKEditor5 from 'eslint-config-ckeditor5';
import eslintPluginCKEditor5Rules from 'eslint-plugin-ckeditor5-rules';

export default defineConfig( [
eslintConfigCKEditor5,
{
name: 'Ignored files config',
ignores: [
'dist/**',
'src/**/*.js',
'src/**/*.d.ts'
]
},
{
name: 'Base config',
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser
}
},
linterOptions: {
reportUnusedInlineConfigs: 'error',
reportUnusedDisableDirectives: 'error'
},
plugins: {
'ckeditor5-rules': eslintPluginCKEditor5Rules
},
rules: {
'ckeditor5-rules/require-file-extensions-in-imports': [ 'error', {
extensions: [ '.ts', '.js', '.json' ]
} ]
}
},
{
files: [ 'scripts/**/*' ],
languageOptions: {
globals: {
...globals.node
}
}
},
{
files: [ 'tests/**/*.[jt]s', 'sample/**/*.[jt]s' ],
rules: {}
}
] );
Loading
Loading