Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
956bfc7
Migrate `ckeditor5-build-tools` from Rollup to Rolldown.
filipsobol May 13, 2026
bd3df55
Fix TypeDoc event inheritance for typed mixin aliases.
filipsobol May 14, 2026
7d157ca
Fix type error.
filipsobol May 14, 2026
d29b3ed
Reuse `declarationFiles` plugin from `build-tools` when building the …
filipsobol May 14, 2026
a820808
Remove `rewrite` API from the `build-tools` package.
filipsobol May 15, 2026
a287a70
Add temporary plugin to restore `@preserve` annotations in `@__PURE__…
filipsobol May 18, 2026
c3e7516
Use more precise path in `tsconfig.json`.
filipsobol May 18, 2026
86b0fbb
Remove unused test and dependency.
filipsobol May 18, 2026
26d1169
Add missing `@types/shelljs` to `dev-utils` package.
filipsobol May 18, 2026
ee6c76a
Fix paths in `tsconfig.json`.
filipsobol May 18, 2026
17787b1
Add changelog entries.
filipsobol May 18, 2026
b77017f
Merge remote-tracking branch 'origin/master' into ci/4316-use-rolldow…
filipsobol May 18, 2026
0aaf31d
Merge remote-tracking branch 'origin/ci/4293-migrate-to-rolldown-and-…
filipsobol May 19, 2026
46eb32b
Address declaration generation review comments.
filipsobol May 19, 2026
8fbeea9
Merge remote-tracking branch 'origin/ci/4293-migrate-to-rolldown-and-…
filipsobol May 19, 2026
5dbe031
Address review comments.
filipsobol May 26, 2026
8313bed
Merge remote-tracking branch 'origin/master' into ci/4316-use-rolldow…
filipsobol May 26, 2026
14bc83f
Address review comments.
filipsobol May 26, 2026
26237cc
Update Rolldown and remove plugin that addressed the issue fixed in n…
filipsobol May 27, 2026
e825537
Remove unused fixtures.
filipsobol May 27, 2026
4a36ff1
Merge remote-tracking branch 'origin/master' into ci/4316-use-rolldow…
filipsobol May 27, 2026
2a17a0c
Emit empty CSS bundle when no styles exist regardless of sourcemap se…
filipsobol May 27, 2026
6f31b8d
Improve code coverage.
filipsobol May 27, 2026
bbfc3a7
Replace `.flatMap` with `.map`
filipsobol May 27, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: Major breaking change
scope:
- ckeditor5-dev-build-tools
---

Removed output path rewriting from `ckeditor5-dev-build-tools` except for package imports rewritten to `ckeditor5` and `ckeditor5-premium-features` in browser builds.

The `rewrite` JavaScript API option was removed. Imports using `ckeditor5/src/*` and `ckeditor5-collaboration/src/*` are no longer rewritten automatically.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: Major breaking change
scope:
- ckeditor5-dev-build-tools
---

Replaced Rollup with Rolldown in `ckeditor5-dev-build-tools`.

Rollup-specific dependencies that are no longer needed because Rolldown provides equivalent features out of the box were removed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: Major breaking change
scope:
- ckeditor5-dev-build-tools
---

Changed `ckeditor5-dev-build-tools` to assume that package sources use TypeScript isolated declarations.

Declaration files are now generated without invoking TypeScript, so builds no longer perform type checking.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: Feature
scope:
- ckeditor5-dev-build-tools
---

Added the `declarationFiles` plugin to `ckeditor5-dev-build-tools` for generating `.d.ts` files from TypeScript sources that use isolated declarations.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
type: Major breaking change
scope:
- ckeditor5-dev-build-tools
---

Removed the `loadTypeScriptSources`, `replaceImports`, and `emitCss` exports from `ckeditor5-dev-build-tools`.

The `loadTypeScriptSources` and `replaceImports` behavior is now handled by Rolldown. The `bundleCss` plugin now ensures that a CSS file is always emitted, including when the generated file is empty.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: Other
scope:
- ckeditor5-dev-build-tools
---

Improved the performance of selected `ckeditor5-dev-build-tools` plugins.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"lint-staged": "^16.4.0",
"listr2": "^8.3.3",
"minimist": "^1.2.8",
"oxc-transform": "^0.112.0",
"semver": "^7.7.4",
"typescript": "5.5.4",
"upath": "^2.0.1",
Expand Down
12 changes: 0 additions & 12 deletions packages/ckeditor5-dev-build-tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,18 +184,6 @@ When using the JavaScript API, the option must be an array.

**Example value:** `external: [ 'lodash', 'moment' ]`

#### `rewrite`

**Type:** `string[]`

**Default value:** `[]`

A list of imports to rewrite in the output file. This option can be used if one of the dependencies provided in `external` has a separate build for the new install methods that should be used instead of the one used in the source code.

This option is only available for the JavaScript API.

**Example value:** `rewrite: [ 'dependency', 'dependency/dist/index.js' ]`

## Changelog

See the [`CHANGELOG.md`](https://github.com/ckeditor/ckeditor5-dev/blob/master/packages/ckeditor5-dev-bump-year/CHANGELOG.md) file.
Expand Down
22 changes: 5 additions & 17 deletions packages/ckeditor5-dev-build-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ckeditor/ckeditor5-dev-build-tools",
"version": "55.6.3",
"description": "Rollup-based tools used to build CKEditor 5 packages.",
"description": "Rolldown-based tools used to build CKEditor 5 packages.",
"keywords": [],
"author": "CKSource (http://cksource.com/)",
"license": "GPL-2.0-or-later",
Expand All @@ -27,47 +27,35 @@
"ckeditor5-dev-build-tools": "bin/build-project.js"
},
"dependencies": {
"@rollup/plugin-commonjs": "^28.0.9",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-swc": "^0.4.0",
"@rollup/plugin-terser": "^1.0.0",
"@rollup/plugin-typescript": "12.3.0",
"@rollup/pluginutils": "^5.3.0",
"@swc/core": "^1.15.24",
"cssnano": "^7.1.4",
"cssnano-preset-lite": "^4.0.4",
"es-toolkit": "^1.45.1",
"estree-walker": "^3.0.3",
"glob": "^13.0.6",
"lightningcss": "^1.32.0",
"magic-string": "^0.30.21",
"pofile": "^1.1.4",
"purgecss": "^8.0.0",
"rollup": "^4.60.1",
"rollup-plugin-svg-import": "^3.0.0",
"rolldown": "^1.0.3",
"source-map": "^0.7.6",
"upath": "^2.0.1"
},
"devDependencies": {
"@types/css": "^0.0.38",
"@types/node": "^22.19.17",
"@vitest/coverage-v8": "^4.1.2",
"rolldown": "^1.0.0",
"type-fest": "^4.41.0",
"vitest": "^4.1.2"
},
"scripts": {
"build": "rolldown -c rolldown.config.js",
"dev": "rolldown -c rolldown.config.js --watch",
"build": "rolldown -c rolldown.config.ts",
"dev": "rolldown -c rolldown.config.ts --watch",
"test": "vitest run --config vitest.config.ts",
"coverage": "vitest run --config vitest.config.ts --coverage",
"test:dev": "vitest dev"
},
"depcheckIgnore": [
"@types/css",
"@vitest/coverage-v8",
"estree",
"typescript"
"@vitest/coverage-v8"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
*/

import { defineConfig } from 'rolldown';
import { declarationFilesPlugin } from '../../scripts/plugin-declarations.js';
import { declarationFiles } from './src/plugins/declarations.js';
import pkg from './package.json' with { type: 'json' };

const packageJson = pkg as {
dependencies?: Record<string, string>;
peerDependencies?: Record<string, string>;
};

const externals = [
...Object.keys( pkg.dependencies || {} ),
...Object.keys( pkg.peerDependencies || {} )
...Object.keys( packageJson.dependencies || {} ),
...Object.keys( packageJson.peerDependencies || {} )
];

export default defineConfig( {
Expand All @@ -22,7 +27,9 @@ export default defineConfig( {
assetFileNames: '[name][extname]'
},
plugins: [
declarationFilesPlugin()
declarationFiles( {
sourceDirectory: 'src'
} )
],
external: id => externals.some( name => id.startsWith( name ) )
} );
36 changes: 19 additions & 17 deletions packages/ckeditor5-dev-build-tools/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import fs from 'node:fs';
import url from 'node:url';
import { styleText, parseArgs } from 'node:util';
import path from 'upath';
import { rollup, type RollupOutput, type GlobalsOption, type LogLevelOption } from 'rollup';
import { rolldown, type LogLevelOption, type OutputOptions, type RolldownOutput } from 'rolldown';
import { loadSourcemaps } from './plugins/loadSourcemaps.js';
import { getRollupConfig } from './config.js';
import { getRolldownConfig } from './config.js';
import { camelizeObjectKeys, removeWhitespace, getOptionalPlugin } from './utils.js';

type GlobalsOption = Record<string, string> | ( ( name: string ) => string );

export interface BuildOptions {
input: string;
output: string;
Expand All @@ -20,7 +22,6 @@ export interface BuildOptions {
globals: GlobalsOption | Array<string>;
banner: string;
external: Array<string>;
rewrite: Array<[string, string]>;
declarations: boolean;
translations: string;
sourceMap: boolean;
Expand All @@ -39,7 +40,6 @@ export const defaultOptions: BuildOptions = {
globals: {},
banner: '',
external: [],
rewrite: [],
declarations: false,
translations: '',
sourceMap: false,
Expand Down Expand Up @@ -107,20 +107,20 @@ function normalizeGlobalsParameter( globals: GlobalsOption | Array<string> ): Gl
/**
* Generates `UMD` build based on previous `ESM` build.
*/
async function generateUmdBuild( args: BuildOptions, bundle: RollupOutput ): Promise<RollupOutput> {
async function generateUmdBuild( args: BuildOptions, bundle: RolldownOutput ): Promise<RolldownOutput> {
args.input = args.output;

const { dir, name } = path.parse( args.output );
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const { plugins, ...config } = await getRollupConfig( args );
const { plugins, resolve, tsconfig, transform, moduleTypes, output, ...config } = await getRolldownConfig( args );

/**
* Ignore the plugins we used for the ESM build. Instead, add a new plugin to not only
* load the source code of the dependencies (which is the default in Rollup for better
* load the source code of the dependencies (which is the default in Rolldown for better
* performance), but also their source maps to generate a proper final source map for
* the UMD bundle.
*/
const build = await rollup( {
const build = await rolldown( {
...config,
plugins: [
getOptionalPlugin(
Expand All @@ -131,9 +131,10 @@ async function generateUmdBuild( args: BuildOptions, bundle: RollupOutput ): Pro
} );

const umdBundle = await build.write( {
...( output as OutputOptions ),
format: 'umd',
file: path.join( dir, `${ name }.umd.js` ),
inlineDynamicImports: true,
codeSplitting: false,
assetFileNames: '[name][extname]',
sourcemap: args.sourceMap,
name: args.name,
Expand All @@ -148,7 +149,7 @@ async function generateUmdBuild( args: BuildOptions, bundle: RollupOutput ): Pro
...bundle.output,
...umdBundle.output
]
};
} as unknown as RolldownOutput;
}

/**
Expand Down Expand Up @@ -196,7 +197,7 @@ async function normalizeOptions( options: Partial<BuildOptions> ): Promise<Build
*/
export async function build(
options: Partial<BuildOptions> = getCliArguments()
): Promise<RollupOutput> {
): Promise<RolldownOutput> {
try {
const args: BuildOptions = await normalizeOptions( options );

Expand All @@ -210,22 +211,23 @@ export async function build(
}

/**
* Create Rollup configuration based on provided arguments.
* Create Rolldown configuration based on provided arguments.
*/
const config = await getRollupConfig( args );
const { output, ...config } = await getRolldownConfig( args );

/**
* Run Rollup to generate bundles.
* Run Rolldown to generate bundles.
*/
const build = await rollup( config );
const build = await rolldown( config );

/**
* Write bundles to the filesystem.
*/
const bundle = await build.write( {
...( output as OutputOptions ),
format: 'esm',
file: args.output,
inlineDynamicImports: true,
codeSplitting: false,
assetFileNames: '[name][extname]',
sourcemap: args.sourceMap,
name: args.name
Expand All @@ -242,7 +244,7 @@ export async function build(
} catch ( error: any ) {
let message: string;

if ( error.name === 'RollupError' ) {
if ( error.id ) {
message = `
${ styleText( 'red', 'ERROR: Error occurred when processing the file ' + error.id ) }.
${ error.message }
Expand Down
Loading