Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 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 @@ -108,6 +108,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.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",
"vite": ">=7.3.2 <8",
"vitest": "^4.1.2"
Expand All @@ -46,6 +48,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 @@ -53,13 +53,13 @@
"@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",
"typescript": "5.5.4",
"vitest": "^4.1.2"
},
"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 ) )
} );
45 changes: 0 additions & 45 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 @@ -38,21 +38,17 @@
"upath": "^2.0.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^16.0.3",
"@rollup/plugin-typescript": "12.3.0",
"@types/semver": "^7.7.1",
"@vitest/coverage-v8": "^4.1.2",
"rollup": "^4.60.1",
"typescript": "5.5.4",
"rolldown": "^1.0.0",
"vitest": "^4.1.2"
},
"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'
},
Comment thread
filipsobol marked this conversation as resolved.
Outdated
platform: 'node',
output: {
cleanDir: true,
format: 'esm',
dir: 'dist',
assetFileNames: '[name][extname]'
},
external: id => externals.some( name => id.startsWith( name ) ),
plugins: [
declarationFilesPlugin()
]
} );
Comment thread
filipsobol marked this conversation as resolved.
58 changes: 0 additions & 58 deletions packages/ckeditor5-dev-changelog/rollup.config.js

This file was deleted.

Loading