Skip to content
Open
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
3 changes: 3 additions & 0 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ jobs:
- run:
name: Validate versions of dependencies
command: pnpm run check-versions-match
- run:
name: Type check the project
command: pnpm run typecheck
Comment thread
cursor[bot] marked this conversation as resolved.
- run:
name: Execute tests for internal scripts
command: pnpm run test:scripts
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
"lint-staged": "^16.1.0",
"listr2": "^8.3.2",
"minimist": "^1.2.8",
"oxc-transform": "^0.112.0",
"semver": "^7.6.3",
"typescript": "5.5.4",
"upath": "^2.0.1",
"vitest": "^4.0.18"
},
Expand All @@ -45,6 +47,7 @@
"release:prepare-packages": "node ./scripts/preparepackages.js",
"release:publish-packages": "node ./scripts/publishpackages.js",
"lint": "eslint --concurrency=4",
"typecheck": "tsc",
"precommit": "lint-staged",
"reinstall": "pnpx rimraf --glob \"**/node_modules\" && pnpm install",
"check-dependencies": "ckeditor5-dev-dependency-checker"
Expand Down
6 changes: 3 additions & 3 deletions packages/ckeditor5-dev-build-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@
"@types/node": "^22.14.1",
"@types/postcss-mixins": "^9.0.5",
"@vitest/coverage-v8": "^4.0.18",
"rolldown": "^1.0.0-rc.4",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I can accept isolated declarations, I am opposed to using unstable dependencies.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why we migrate partially. Rolldown is used to build internals, but in the end, we still use Rollup. Is it due to a lack of changes in CKEditor 5?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I propose to merge isolated declarations if this PR focuses only on them.

Once rolldown officially releases v1 (https://voidzero.dev/posts/announcing-rolldown-rc#roadmap-to-1-0-and-vite-8), we can adopt it in this repository.

"type-fest": "^4.10.2",
"typescript": "5.5.4",
"vitest": "^4.0.18"
},
"scripts": {
"build": "rollup -c rollup.config.js --forceExit",
"dev": "rollup -c rollup.config.js --watch",
"build": "rolldown -c rolldown.config.js",
"dev": "rolldown -c rolldown.config.js --watch",
"test": "vitest run --config vitest.config.ts",
"coverage": "vitest run --config vitest.config.ts --coverage",
"test:dev": "vitest dev"
Expand Down
28 changes: 28 additions & 0 deletions packages/ckeditor5-dev-build-tools/rolldown.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/

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

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

export default defineConfig( {
input: 'src/index.ts',
platform: 'node',
output: {
cleanDir: true,
format: 'esm',
dir: 'dist',
assetFileNames: '[name][extname]'
},
plugins: [
declarationFilesPlugin()
],
external: id => externals.some( name => id.startsWith( name ) )
} );
43 changes: 0 additions & 43 deletions packages/ckeditor5-dev-build-tools/rollup.config.js

This file was deleted.

51 changes: 26 additions & 25 deletions packages/ckeditor5-dev-build-tools/tests/config/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import { test, expect } from 'vitest';
import { getRollupConfig } from '../../src/config.js';
import { mockGetUserDependency } from '../_utils/utils.js';
import type { Plugin } from 'rollup';

type Options = Parameters<typeof getRollupConfig>[0];

Expand All @@ -28,7 +29,7 @@ const defaults: Options = {
cwd: ''
};

function getConfig( config: Partial<Options> = {} ) {
function getConfig( config: Partial<Options> = {} ): ReturnType<typeof getRollupConfig> {
return getRollupConfig( Object.assign( {}, defaults, config ) );
}

Expand All @@ -53,9 +54,9 @@ test( '--tsconfig', async () => {
declarations: false
} );

expect( fileExists.plugins.some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
expect( fileDoesntExist.plugins.some( plugin => plugin?.name === 'typescript' ) ).toBe( false );
expect( declarationsFalse.plugins.some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
expect( ( fileExists.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
expect( ( fileDoesntExist.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'typescript' ) ).toBe( false );
expect( ( declarationsFalse.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
} );

test( '--tsconfig should do typechecking regardless of --declarations', async () => {
Expand All @@ -68,8 +69,8 @@ test( '--tsconfig should do typechecking regardless of --declarations', async ()
declarations: false
} );

expect( withDeclarations.plugins.some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
expect( withoutDeclarations.plugins.some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
expect( ( withDeclarations.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
expect( ( withoutDeclarations.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true );
} );

test( '--external', async () => {
Expand All @@ -81,22 +82,22 @@ test( '--external', async () => {
} );

// Exclude simple package names.
expect( config.external( 'foo' ) ).toBe( true );
expect( ( config.external as Function )( 'foo' ) ).toBe( true );

// Exclude package names that contain a dot (which might be treated as a file extension).
expect( config.external( 'socket.io-client' ) ).toBe( true );
expect( ( config.external as Function )( 'socket.io-client' ) ).toBe( true );

// Exclude packages with a code file extension (.ts, .js, .json, etc.).
expect( config.external( 'socket.io-client/src/index.js' ) ).toBe( true );
expect( ( config.external as Function )( 'socket.io-client/src/index.js' ) ).toBe( true );

// Don't exclude CSS files.
expect( config.external( 'socket.io-client/src/index.css' ) ).toBe( false );
expect( ( config.external as Function )( 'socket.io-client/src/index.css' ) ).toBe( false );

// Don't exclude SVG files.
expect( config.external( 'socket.io-client/theme/icon.svg' ) ).toBe( false );
expect( ( config.external as Function )( 'socket.io-client/theme/icon.svg' ) ).toBe( false );

// Don't exclude packages not listed in the "external" option.
expect( config.external( 'bar' ) ).toBe( false );
expect( ( config.external as Function )( 'bar' ) ).toBe( false );
} );

test( '--external automatically adds packages that make up the "ckeditor5"', async () => {
Expand All @@ -115,10 +116,10 @@ test( '--external automatically adds packages that make up the "ckeditor5"', asy
external: [ 'ckeditor5' ]
} );

expect( config.external( 'ckeditor5' ) ).toBe( true );
expect( config.external( 'ckeditor5/src/ui.js' ) ).toBe( true );
expect( config.external( '@ckeditor/ckeditor5-core' ) ).toBe( true );
expect( config.external( '@ckeditor/ckeditor5-code-block/theme/codeblock.css' ) ).toBe( false );
expect( ( config.external as Function )( 'ckeditor5' ) ).toBe( true );
expect( ( config.external as Function )( 'ckeditor5/src/ui.js' ) ).toBe( true );
expect( ( config.external as Function )( '@ckeditor/ckeditor5-core' ) ).toBe( true );
expect( ( config.external as Function )( '@ckeditor/ckeditor5-code-block/theme/codeblock.css' ) ).toBe( false );
} );

test( '--external automatically adds packages that make up the "ckeditor5-premium-features"', async () => {
Expand All @@ -138,10 +139,10 @@ test( '--external automatically adds packages that make up the "ckeditor5-premiu
external: [ 'ckeditor5-premium-features' ]
} );

expect( config.external( 'ckeditor5-premium-features' ) ).toBe( true );
expect( config.external( 'ckeditor5-collaboration/src/collaboration-core.js' ) ).toBe( true );
expect( config.external( '@ckeditor/ckeditor5-case-change' ) ).toBe( true );
expect( config.external( '@ckeditor/ckeditor5-real-time-collaboration/theme/usermarkers.css' ) ).toBe( false );
expect( ( config.external as Function )( 'ckeditor5-premium-features' ) ).toBe( true );
expect( ( config.external as Function )( 'ckeditor5-collaboration/src/collaboration-core.js' ) ).toBe( true );
expect( ( config.external as Function )( '@ckeditor/ckeditor5-case-change' ) ).toBe( true );
expect( ( config.external as Function )( '@ckeditor/ckeditor5-real-time-collaboration/theme/usermarkers.css' ) ).toBe( false );
} );

test( '--external doesn\'t fail when "ckeditor5-premium-features" is not installed', async () => {
Expand All @@ -156,7 +157,7 @@ test( '--external doesn\'t fail when "ckeditor5-premium-features" is not install
external: [ 'ckeditor5-premium-features' ]
} );

expect( config.external( 'ckeditor5-premium-features' ) ).toBe( true );
expect( ( config.external as Function )( 'ckeditor5-premium-features' ) ).toBe( true );
} );

test( '--translations', async () => {
Expand All @@ -165,8 +166,8 @@ test( '--translations', async () => {
translations: '**/*.po'
} );

expect( withoutTranslations.plugins.some( plugin => plugin?.name === 'cke5-translations' ) ).toBe( false );
expect( withTranslations.plugins.some( plugin => plugin?.name === 'cke5-translations' ) ).toBe( true );
expect( ( withoutTranslations.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'cke5-translations' ) ).toBe( false );
expect( ( withTranslations.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'cke5-translations' ) ).toBe( true );
} );

test( '--minify', async () => {
Expand All @@ -175,6 +176,6 @@ test( '--minify', async () => {
minify: true
} );

expect( withoutMinification.plugins.some( plugin => plugin?.name === 'terser' ) ).toBe( false );
expect( withMinification.plugins.some( plugin => plugin?.name === 'terser' ) ).toBe( true );
expect( ( withoutMinification.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'terser' ) ).toBe( false );
expect( ( withMinification.plugins as Array<Plugin> ).some( plugin => plugin?.name === 'terser' ) ).toBe( true );
} );
11 changes: 0 additions & 11 deletions packages/ckeditor5-dev-build-tools/tsconfig.json

This file was deleted.

12 changes: 4 additions & 8 deletions packages/ckeditor5-dev-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,17 @@
"upath": "^2.0.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-typescript": "12.3.0",
"@types/semver": "^7.7.0",
"@vitest/coverage-v8": "^4.0.18",
"rollup": "^4.9.5",
"typescript": "5.5.4",
"rolldown": "^1.0.0-rc.4",
"vitest": "^4.0.18"
},
"scripts": {
"build": "rollup -c rollup.config.js --forceExit",
"dev": "rollup -c rollup.config.js --watch",
"build": "rolldown -c rolldown.config.js",
"dev": "rolldown -c rolldown.config.js --watch",
"test": "vitest run --config vitest.config.ts",
"coverage": "vitest run --config vitest.config.ts --coverage",
"test:dev": "vitest dev",
"types": "tsc --noEmit --rootDir ./"
"test:dev": "vitest dev"
},
"depcheckIgnore": [
"@vitest/coverage-v8",
Expand Down
31 changes: 31 additions & 0 deletions packages/ckeditor5-dev-changelog/rolldown.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/**
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/

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

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

export default defineConfig( {
input: {
index: 'src/index.ts',
template: 'src/template.ts'
},
platform: 'node',
output: {
cleanDir: true,
format: 'esm',
dir: 'dist',
assetFileNames: '[name][extname]'
},
external: id => externals.some( name => id.startsWith( name ) ),
plugins: [
declarationFilesPlugin()
]
} );
56 changes: 0 additions & 56 deletions packages/ckeditor5-dev-changelog/rollup.config.js

This file was deleted.

Loading