From 52d3a67d3e68a9b4af1b1b34f1920895ff420297 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Wed, 18 Feb 2026 17:26:32 +0100 Subject: [PATCH 01/11] Migrate the repository tooling to Rolldown and isolated declarations. --- .circleci/template.yml | 3 + package.json | 3 + .../ckeditor5-dev-build-tools/package.json | 7 +- .../rolldown.config.js | 28 + .../rollup.config.js | 45 -- .../tests/config/config.test.ts | 51 +- .../ckeditor5-dev-build-tools/tsconfig.json | 11 - packages/ckeditor5-dev-changelog/package.json | 12 +- .../rolldown.config.js | 31 + .../ckeditor5-dev-changelog/rollup.config.js | 58 -- .../src/utils/constants.ts | 14 +- .../ckeditor5-dev-changelog/tsconfig.json | 11 - packages/ckeditor5-dev-docs/package.json | 1 - .../package.json | 12 +- .../rolldown.config.js | 29 + .../rollup.config.js | 45 -- .../tsconfig.json | 11 - packages/ckeditor5-dev-utils/package.json | 9 +- .../ckeditor5-dev-utils/rolldown.config.js | 32 + packages/ckeditor5-dev-utils/rollup.config.js | 64 -- .../src/npm/pacotecacheless.ts | 7 +- packages/ckeditor5-dev-utils/tsconfig.json | 14 - .../ckeditor5-dev-web-crawler/package.json | 15 +- .../rolldown.config.js | 28 + .../rollup.config.js | 45 -- .../src/constants.ts | 27 +- .../ckeditor5-dev-web-crawler/tsconfig.json | 11 - packages/typedoc-plugins/package.json | 10 +- packages/typedoc-plugins/rolldown.config.js | 27 + packages/typedoc-plugins/rollup.config.js | 45 -- .../tests/event-inheritance-fixer/index.ts | 14 +- .../utils/typedoc-plugin-remove-class-c.ts | 3 - .../tests/event-param-fixer/index.ts | 10 +- .../tests/purge-private-api-docs/index.ts | 11 +- .../tests/reference-fixer/index.ts | 4 +- .../restore-program-after-conversion/index.ts | 3 - .../typedoc-plugins/tests/tag-event/index.ts | 84 +-- .../tests/tag-observable/index.ts | 4 - packages/typedoc-plugins/tests/tsconfig.json | 17 +- packages/typedoc-plugins/tests/utils.ts | 4 +- .../tests/validators/fires-validator/index.ts | 3 - .../tests/validators/link-validator/index.ts | 3 - .../validators/overloads-validator/index.ts | 3 - .../tests/validators/see-validator/index.ts | 3 - packages/typedoc-plugins/tsconfig.json | 11 - pnpm-lock.yaml | 571 +++++++++++++++--- scripts/ci/generate-circleci-configuration.js | 5 - scripts/plugin-declarations.js | 58 ++ tsconfig.json | 20 +- 49 files changed, 868 insertions(+), 669 deletions(-) create mode 100644 packages/ckeditor5-dev-build-tools/rolldown.config.js delete mode 100644 packages/ckeditor5-dev-build-tools/rollup.config.js delete mode 100644 packages/ckeditor5-dev-build-tools/tsconfig.json create mode 100644 packages/ckeditor5-dev-changelog/rolldown.config.js delete mode 100644 packages/ckeditor5-dev-changelog/rollup.config.js delete mode 100644 packages/ckeditor5-dev-changelog/tsconfig.json create mode 100644 packages/ckeditor5-dev-license-checker/rolldown.config.js delete mode 100644 packages/ckeditor5-dev-license-checker/rollup.config.js delete mode 100644 packages/ckeditor5-dev-license-checker/tsconfig.json create mode 100644 packages/ckeditor5-dev-utils/rolldown.config.js delete mode 100644 packages/ckeditor5-dev-utils/rollup.config.js delete mode 100644 packages/ckeditor5-dev-utils/tsconfig.json create mode 100644 packages/ckeditor5-dev-web-crawler/rolldown.config.js delete mode 100644 packages/ckeditor5-dev-web-crawler/rollup.config.js delete mode 100644 packages/ckeditor5-dev-web-crawler/tsconfig.json create mode 100644 packages/typedoc-plugins/rolldown.config.js delete mode 100644 packages/typedoc-plugins/rollup.config.js delete mode 100644 packages/typedoc-plugins/tsconfig.json create mode 100644 scripts/plugin-declarations.js diff --git a/.circleci/template.yml b/.circleci/template.yml index 3f363cbe4..d5643f4f2 100644 --- a/.circleci/template.yml +++ b/.circleci/template.yml @@ -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 - run: name: Execute tests for internal scripts command: pnpm run test:scripts diff --git a/package.json b/package.json index ae213079a..d5e58ca40 100644 --- a/package.json +++ b/package.json @@ -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" @@ -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" diff --git a/packages/ckeditor5-dev-build-tools/package.json b/packages/ckeditor5-dev-build-tools/package.json index f9df68f6c..28c25591b 100644 --- a/packages/ckeditor5-dev-build-tools/package.json +++ b/packages/ckeditor5-dev-build-tools/package.json @@ -52,14 +52,15 @@ "devDependencies": { "@types/css": "^0.0.38", "@types/node": "^22.19.17", + "@types/postcss-mixins": "^9.0.5", "@vitest/coverage-v8": "^4.1.2", + "rolldown": "^1.0.0-rc.4", "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" diff --git a/packages/ckeditor5-dev-build-tools/rolldown.config.js b/packages/ckeditor5-dev-build-tools/rolldown.config.js new file mode 100644 index 000000000..5c70b6606 --- /dev/null +++ b/packages/ckeditor5-dev-build-tools/rolldown.config.js @@ -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 ) ) +} ); diff --git a/packages/ckeditor5-dev-build-tools/rollup.config.js b/packages/ckeditor5-dev-build-tools/rollup.config.js deleted file mode 100644 index 54eface40..000000000 --- a/packages/ckeditor5-dev-build-tools/rollup.config.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. - * For licensing, see LICENSE.md. - */ - -import { readFileSync } from 'node:fs'; -import path from 'upath'; -import { defineConfig } from 'rollup'; -import commonjs from '@rollup/plugin-commonjs'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; - -// Current working directory -const cwd = process.cwd(); - -// Content of the `package.json` -const pkg = JSON.parse( - readFileSync( path.join( cwd, 'package.json' ) ) -); - -// List of external dependencies -const externals = [ - ...Object.keys( pkg.dependencies || {} ), - ...Object.keys( pkg.peerDependencies || {} ) -]; - -export default defineConfig( { - input: 'src/index.ts', - output: { - format: 'esm', - dir: path.join( cwd, 'dist' ), - assetFileNames: '[name][extname]' - }, - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - commonjs(), - nodeResolve( { - extensions: [ '.mjs', '.js', '.json', '.node', '.ts', '.mts' ], - preferBuiltins: true - } ), - typescript( { - noEmitOnError: true - } ) - ] -} ); diff --git a/packages/ckeditor5-dev-build-tools/tests/config/config.test.ts b/packages/ckeditor5-dev-build-tools/tests/config/config.test.ts index 6b1b3f88b..35b056ba3 100644 --- a/packages/ckeditor5-dev-build-tools/tests/config/config.test.ts +++ b/packages/ckeditor5-dev-build-tools/tests/config/config.test.ts @@ -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[0]; @@ -28,7 +29,7 @@ const defaults: Options = { cwd: '' }; -function getConfig( config: Partial = {} ) { +function getConfig( config: Partial = {} ): ReturnType { return getRollupConfig( Object.assign( {}, defaults, config ) ); } @@ -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 ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true ); + expect( ( fileDoesntExist.plugins as Array ).some( plugin => plugin?.name === 'typescript' ) ).toBe( false ); + expect( ( declarationsFalse.plugins as Array ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true ); } ); test( '--tsconfig should do typechecking regardless of --declarations', async () => { @@ -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 ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true ); + expect( ( withoutDeclarations.plugins as Array ).some( plugin => plugin?.name === 'typescript' ) ).toBe( true ); } ); test( '--external', async () => { @@ -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 () => { @@ -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 () => { @@ -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 () => { @@ -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 () => { @@ -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 ).some( plugin => plugin?.name === 'cke5-translations' ) ).toBe( false ); + expect( ( withTranslations.plugins as Array ).some( plugin => plugin?.name === 'cke5-translations' ) ).toBe( true ); } ); test( '--minify', async () => { @@ -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 ).some( plugin => plugin?.name === 'terser' ) ).toBe( false ); + expect( ( withMinification.plugins as Array ).some( plugin => plugin?.name === 'terser' ) ).toBe( true ); } ); diff --git a/packages/ckeditor5-dev-build-tools/tsconfig.json b/packages/ckeditor5-dev-build-tools/tsconfig.json deleted file mode 100644 index bf3856e5b..000000000 --- a/packages/ckeditor5-dev-build-tools/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src", - "tests" - ] -} diff --git a/packages/ckeditor5-dev-changelog/package.json b/packages/ckeditor5-dev-changelog/package.json index 8796be0bd..9eeadcbf7 100644 --- a/packages/ckeditor5-dev-changelog/package.json +++ b/packages/ckeditor5-dev-changelog/package.json @@ -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", diff --git a/packages/ckeditor5-dev-changelog/rolldown.config.js b/packages/ckeditor5-dev-changelog/rolldown.config.js new file mode 100644 index 000000000..d1c21fd87 --- /dev/null +++ b/packages/ckeditor5-dev-changelog/rolldown.config.js @@ -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() + ] +} ); diff --git a/packages/ckeditor5-dev-changelog/rollup.config.js b/packages/ckeditor5-dev-changelog/rollup.config.js deleted file mode 100644 index e1cbcbc26..000000000 --- a/packages/ckeditor5-dev-changelog/rollup.config.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. - * For licensing, see LICENSE.md. - */ - -import { readFileSync } from 'node:fs'; -import path from 'upath'; -import { defineConfig } from 'rollup'; -import typescript from '@rollup/plugin-typescript'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; - -// Current working directory -const cwd = process.cwd(); - -// Content of the `package.json` -const pkg = JSON.parse( - readFileSync( path.join( cwd, 'package.json' ) ) -); - -// List of external dependencies -const externals = [ - ...Object.keys( pkg.dependencies || {} ), - ...Object.keys( pkg.peerDependencies || {} ) -]; - -const sharedConfig = defineConfig( { - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - typescript( { - noEmitOnError: true - } ), - nodeResolve( { - extensions: [ '.mjs', '.js', '.json', '.node', '.ts', '.mts' ], - preferBuiltins: true - } ) - ] -} ); - -export default defineConfig( [ - { - input: 'src/index.ts', - output: { - format: 'esm', - file: path.join( cwd, 'dist', 'index.js' ), - assetFileNames: '[name][extname]' - }, - ...sharedConfig - }, - { - input: 'src/template.ts', - output: { - format: 'esm', - file: path.join( cwd, 'dist', 'template.js' ), - assetFileNames: '[name][extname]' - }, - ...sharedConfig - } -] ); diff --git a/packages/ckeditor5-dev-changelog/src/utils/constants.ts b/packages/ckeditor5-dev-changelog/src/utils/constants.ts index eca2127dc..d0fb5c925 100644 --- a/packages/ckeditor5-dev-changelog/src/utils/constants.ts +++ b/packages/ckeditor5-dev-changelog/src/utils/constants.ts @@ -17,15 +17,15 @@ export const CHANGESET_DIRECTORY = '.changelog'; export const PRE_RELEASE_DIRECTORY = 'pre-release'; -export const TEMPLATE_FILE = path.join( import.meta.dirname, '../template/template.md' ); +export const TEMPLATE_FILE: string = path.join( import.meta.dirname, '../template/template.md' ); export const SECTIONS = { major: { - title: `MAJOR BREAKING CHANGES [ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-changes)`, + title: `MAJOR BREAKING CHANGES [ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-changes)` as string, titleInLogs: 'MAJOR BREAKING CHANGES' }, minor: { - title: `MINOR BREAKING CHANGES [ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-changes)`, + title: `MINOR BREAKING CHANGES [ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-changes)` as string, titleInLogs: 'MINOR BREAKING CHANGES' }, breaking: { title: 'BREAKING CHANGES' }, @@ -42,12 +42,12 @@ export const SECTIONS = { } } as const; -export const ISSUE_SLUG_PATTERN = /^(?[a-z0-9.-]+)\/(?[a-z0-9.-]+)#(?\d+)$/; -export const ISSUE_PATTERN = /^\d+$/; -export const ISSUE_URL_PATTERN = +export const ISSUE_SLUG_PATTERN: RegExp = /^(?[a-z0-9.-]+)\/(?[a-z0-9.-]+)#(?\d+)$/; +export const ISSUE_PATTERN: RegExp = /^\d+$/; +export const ISSUE_URL_PATTERN: RegExp = /^(?https:\/\/github\.com)\/(?[a-z0-9.-]+)\/(?[a-z0-9.-]+)\/issues\/(?\d+)$/; -export const NICK_NAME_PATTERN = /^@[a-z0-9-_]+$/i; +export const NICK_NAME_PATTERN: RegExp = /^@[a-z0-9-_]+$/i; export const TYPES = [ { name: 'Feature' }, diff --git a/packages/ckeditor5-dev-changelog/tsconfig.json b/packages/ckeditor5-dev-changelog/tsconfig.json deleted file mode 100644 index bf3856e5b..000000000 --- a/packages/ckeditor5-dev-changelog/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src", - "tests" - ] -} diff --git a/packages/ckeditor5-dev-docs/package.json b/packages/ckeditor5-dev-docs/package.json index 399525db1..d898e05d3 100644 --- a/packages/ckeditor5-dev-docs/package.json +++ b/packages/ckeditor5-dev-docs/package.json @@ -30,7 +30,6 @@ }, "devDependencies": { "jest-extended": "^5.0.3", - "typescript": "5.5.4", "vitest": "^4.1.2" }, "scripts": { diff --git a/packages/ckeditor5-dev-license-checker/package.json b/packages/ckeditor5-dev-license-checker/package.json index b35b3dc3b..ab5b672f0 100644 --- a/packages/ckeditor5-dev-license-checker/package.json +++ b/packages/ckeditor5-dev-license-checker/package.json @@ -27,19 +27,15 @@ "upath": "^2.0.1" }, "devDependencies": { - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-typescript": "12.3.0", "@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", - "types": "tsc --noEmit --rootDir ./" + "coverage": "vitest run --config vitest.config.ts --coverage" }, "depcheckIgnore": [ "typescript" diff --git a/packages/ckeditor5-dev-license-checker/rolldown.config.js b/packages/ckeditor5-dev-license-checker/rolldown.config.js new file mode 100644 index 000000000..c89a670c3 --- /dev/null +++ b/packages/ckeditor5-dev-license-checker/rolldown.config.js @@ -0,0 +1,29 @@ +/** + * @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' }; + +// List of external dependencies +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 ) ) +} ); diff --git a/packages/ckeditor5-dev-license-checker/rollup.config.js b/packages/ckeditor5-dev-license-checker/rollup.config.js deleted file mode 100644 index 0a59e36b9..000000000 --- a/packages/ckeditor5-dev-license-checker/rollup.config.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. - * For licensing, see LICENSE.md. - */ - -import { readFileSync } from 'node:fs'; -import upath from 'upath'; -import { defineConfig } from 'rollup'; -import commonjs from '@rollup/plugin-commonjs'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; - -// Current working directory -const cwd = process.cwd(); - -// Content of the `package.json` -const pkg = JSON.parse( - readFileSync( upath.join( cwd, 'package.json' ) ) -); - -// List of external dependencies -const externals = [ - ...Object.keys( pkg.dependencies || {} ), - ...Object.keys( pkg.peerDependencies || {} ) -]; - -export default defineConfig( { - input: 'src/index.ts', - output: { - format: 'esm', - dir: upath.join( cwd, 'dist' ), - assetFileNames: '[name][extname]' - }, - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - commonjs(), - nodeResolve( { - extensions: [ '.mjs', '.js', '.json', '.node', '.ts', '.mts' ], - preferBuiltins: true - } ), - typescript( { - noEmitOnError: true - } ) - ] -} ); diff --git a/packages/ckeditor5-dev-license-checker/tsconfig.json b/packages/ckeditor5-dev-license-checker/tsconfig.json deleted file mode 100644 index bf3856e5b..000000000 --- a/packages/ckeditor5-dev-license-checker/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src", - "tests" - ] -} diff --git a/packages/ckeditor5-dev-utils/package.json b/packages/ckeditor5-dev-utils/package.json index e4da8174b..1aaeeb093 100644 --- a/packages/ckeditor5-dev-utils/package.json +++ b/packages/ckeditor5-dev-utils/package.json @@ -43,18 +43,15 @@ "upath": "^2.0.1" }, "devDependencies": { - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-typescript": "12.3.0", "@types/pacote": "^11.1.8", "@vitest/coverage-v8": "^4.1.2", "jest-extended": "^5.0.3", - "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", diff --git a/packages/ckeditor5-dev-utils/rolldown.config.js b/packages/ckeditor5-dev-utils/rolldown.config.js new file mode 100644 index 000000000..3d7d67a67 --- /dev/null +++ b/packages/ckeditor5-dev-utils/rolldown.config.js @@ -0,0 +1,32 @@ +/** + * @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', + 'ck-debug-loader': 'src/loaders/ck-debug-loader.ts', + 'ck-lightningcss-loader': 'src/loaders/ck-lightningcss-loader.ts' + }, + platform: 'node', + output: { + cleanDir: true, + format: 'esm', + dir: 'dist', + assetFileNames: '[name][extname]' + }, + plugins: [ + declarationFilesPlugin() + ], + external: id => externals.some( name => id.startsWith( name ) ) +} ); diff --git a/packages/ckeditor5-dev-utils/rollup.config.js b/packages/ckeditor5-dev-utils/rollup.config.js deleted file mode 100644 index b8d6b62eb..000000000 --- a/packages/ckeditor5-dev-utils/rollup.config.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. - * For licensing, see LICENSE.md. - */ - -import { readFileSync } from 'node:fs'; -import path from 'upath'; -import { defineConfig } from 'rollup'; -import typescript from '@rollup/plugin-typescript'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; - -// Current working directory -const cwd = process.cwd(); - -// Content of the `package.json` -const pkg = JSON.parse( - readFileSync( path.join( cwd, 'package.json' ) ) -); - -// List of external dependencies -const externals = [ - ...Object.keys( pkg.dependencies || {} ), - ...Object.keys( pkg.peerDependencies || {} ) -]; - -export default defineConfig( { - input: { - main: 'src/index.ts', - debug: 'src/loaders/ck-debug-loader.ts', - lightningCss: 'src/loaders/ck-lightningcss-loader.ts' - }, - output: { - dir: path.join( cwd, 'dist' ), - format: 'esm', - entryFileNames: chunk => { - if ( chunk.name === 'main' ) { - return 'index.js'; - } - - // Webpack debug loader. - if ( chunk.name === 'debug' ) { - return 'ck-debug-loader.js'; - } - - // Webpack Lightning CSS loader. - if ( chunk.name === 'lightningCss' ) { - return 'ck-lightningcss-loader.js'; - } - - return '[name].js'; - }, - assetFileNames: '[name][extname]' - }, - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - typescript( { - noEmitOnError: true - } ), - nodeResolve( { - extensions: [ '.mjs', '.js', '.json', '.node', '.ts', '.mts' ], - preferBuiltins: true - } ) - ] -} ); diff --git a/packages/ckeditor5-dev-utils/src/npm/pacotecacheless.ts b/packages/ckeditor5-dev-utils/src/npm/pacotecacheless.ts index d797631c1..eb114fb5d 100644 --- a/packages/ckeditor5-dev-utils/src/npm/pacotecacheless.ts +++ b/packages/ckeditor5-dev-utils/src/npm/pacotecacheless.ts @@ -9,8 +9,11 @@ import upath from 'upath'; import fs from 'node:fs/promises'; import pacote from 'pacote'; -export const manifest = cacheLessPacoteFactory( pacote.manifest ); -export const packument = cacheLessPacoteFactory( pacote.packument ); +type CacheLessPacoteMethod ) => any> = + ( ...args: Parameters ) => Promise>>; + +export const manifest: CacheLessPacoteMethod = cacheLessPacoteFactory( pacote.manifest ); +export const packument: CacheLessPacoteMethod = cacheLessPacoteFactory( pacote.packument ); /** * Creates a version of a `pacote` function that doesn't use caching. diff --git a/packages/ckeditor5-dev-utils/tsconfig.json b/packages/ckeditor5-dev-utils/tsconfig.json deleted file mode 100644 index 39c3f5141..000000000 --- a/packages/ckeditor5-dev-utils/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist", - "types": [ - "./types/shelljs.d.ts", - ] - }, - "include": [ - "src", - "tests" - ] -} diff --git a/packages/ckeditor5-dev-web-crawler/package.json b/packages/ckeditor5-dev-web-crawler/package.json index 9bacc707f..ee434e3e8 100644 --- a/packages/ckeditor5-dev-web-crawler/package.json +++ b/packages/ckeditor5-dev-web-crawler/package.json @@ -23,9 +23,8 @@ "dist" ], "scripts": { - "types": "tsc --noEmit --rootDir ./", - "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" @@ -35,13 +34,7 @@ "puppeteer-cluster": "^0.24.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "^28.0.9", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-typescript": "12.3.0", - "@vitest/coverage-v8": "^4.1.2", - "rollup": "^4.60.1", - "typescript": "5.5.4", - "upath": "^2.0.1", - "vitest": "^4.1.2" + "rolldown": "^1.0.0", + "upath": "^2.0.1" } } diff --git a/packages/ckeditor5-dev-web-crawler/rolldown.config.js b/packages/ckeditor5-dev-web-crawler/rolldown.config.js new file mode 100644 index 000000000..5c70b6606 --- /dev/null +++ b/packages/ckeditor5-dev-web-crawler/rolldown.config.js @@ -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 ) ) +} ); diff --git a/packages/ckeditor5-dev-web-crawler/rollup.config.js b/packages/ckeditor5-dev-web-crawler/rollup.config.js deleted file mode 100644 index 54eface40..000000000 --- a/packages/ckeditor5-dev-web-crawler/rollup.config.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. - * For licensing, see LICENSE.md. - */ - -import { readFileSync } from 'node:fs'; -import path from 'upath'; -import { defineConfig } from 'rollup'; -import commonjs from '@rollup/plugin-commonjs'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; - -// Current working directory -const cwd = process.cwd(); - -// Content of the `package.json` -const pkg = JSON.parse( - readFileSync( path.join( cwd, 'package.json' ) ) -); - -// List of external dependencies -const externals = [ - ...Object.keys( pkg.dependencies || {} ), - ...Object.keys( pkg.peerDependencies || {} ) -]; - -export default defineConfig( { - input: 'src/index.ts', - output: { - format: 'esm', - dir: path.join( cwd, 'dist' ), - assetFileNames: '[name][extname]' - }, - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - commonjs(), - nodeResolve( { - extensions: [ '.mjs', '.js', '.json', '.node', '.ts', '.mts' ], - preferBuiltins: true - } ), - typescript( { - noEmitOnError: true - } ) - ] -} ); diff --git a/packages/ckeditor5-dev-web-crawler/src/constants.ts b/packages/ckeditor5-dev-web-crawler/src/constants.ts index 1d83f5cc0..b01e08f88 100644 --- a/packages/ckeditor5-dev-web-crawler/src/constants.ts +++ b/packages/ckeditor5-dev-web-crawler/src/constants.ts @@ -20,10 +20,23 @@ export interface ErrorType { description: string; } +interface EventErrorType extends ErrorType { + event: string; +} + +interface ErrorTypes { + PAGE_CRASH: EventErrorType; + UNCAUGHT_EXCEPTION: EventErrorType; + REQUEST_FAILURE: EventErrorType; + RESPONSE_FAILURE: EventErrorType; + CONSOLE_ERROR: EventErrorType; + NAVIGATION_ERROR: ErrorType; +} + /** * Errors from the following hosts will be ignored. */ -export const IGNORED_HOSTS = [ +export const IGNORED_HOSTS: Array = [ 'visualwebsiteoptimizer.com', 'fury.io', 'shields.io', @@ -46,9 +59,9 @@ export const IGNORED_HOSTS = [ 'if-cdn.com' ]; -export const DEFAULT_CONCURRENCY = Math.min( cpus().length, 16 ); +export const DEFAULT_CONCURRENCY: number = Math.min( cpus().length, 16 ); -export const DEFAULT_TIMEOUT = 20 * 1000; +export const DEFAULT_TIMEOUT: number = 20 * 1000; export const DEFAULT_RESPONSIVENESS_CHECK_TIMEOUT = 1000; @@ -56,7 +69,7 @@ export const DEFAULT_RETRIES = 3; export const DEFAULT_RETRY_DELAY = 1000; -export const ERROR_TYPES = { +export const ERROR_TYPES: ErrorTypes = { PAGE_CRASH: { event: 'error', description: 'Page crash' @@ -82,16 +95,16 @@ export const ERROR_TYPES = { // event, but it is thrown as exception from page.goto() method. description: 'Navigation error' } -} as const satisfies Record; +}; -export const PATTERN_TYPE_TO_ERROR_TYPE_MAP = { +export const PATTERN_TYPE_TO_ERROR_TYPE_MAP: Record = { 'page-crash': ERROR_TYPES.PAGE_CRASH, 'uncaught-exception': ERROR_TYPES.UNCAUGHT_EXCEPTION, 'request-failure': ERROR_TYPES.REQUEST_FAILURE, 'response-failure': ERROR_TYPES.RESPONSE_FAILURE, 'console-error': ERROR_TYPES.CONSOLE_ERROR, 'navigation-error': ERROR_TYPES.NAVIGATION_ERROR -} as const satisfies Record; +}; export const IGNORE_ALL_ERRORS_WILDCARD = '*'; diff --git a/packages/ckeditor5-dev-web-crawler/tsconfig.json b/packages/ckeditor5-dev-web-crawler/tsconfig.json deleted file mode 100644 index bf3856e5b..000000000 --- a/packages/ckeditor5-dev-web-crawler/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src", - "tests" - ] -} diff --git a/packages/typedoc-plugins/package.json b/packages/typedoc-plugins/package.json index 606eb8ace..efc38e055 100644 --- a/packages/typedoc-plugins/package.json +++ b/packages/typedoc-plugins/package.json @@ -26,22 +26,18 @@ "upath": "^2.0.1" }, "devDependencies": { - "@rollup/plugin-commonjs": "^28.0.9", - "@rollup/plugin-node-resolve": "^16.0.3", - "@rollup/plugin-typescript": "12.3.0", "glob": "^13.0.6", - "rollup": "^4.60.1", + "rolldown": "^1.0.0", "typedoc": "^0.28.18", "typedoc-plugin-rename-defaults": "^0.7.3", - "typescript": "5.5.4", "vitest": "^4.1.2" }, "peerDependencies": { "typedoc": "^0.28.14" }, "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" diff --git a/packages/typedoc-plugins/rolldown.config.js b/packages/typedoc-plugins/rolldown.config.js new file mode 100644 index 000000000..40cb25c71 --- /dev/null +++ b/packages/typedoc-plugins/rolldown.config.js @@ -0,0 +1,27 @@ +/** + * @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: { + format: 'esm', + dir: 'dist', + assetFileNames: '[name][extname]' + }, + plugins: [ + declarationFilesPlugin() + ], + external: id => externals.some( name => id.startsWith( name ) ) +} ); diff --git a/packages/typedoc-plugins/rollup.config.js b/packages/typedoc-plugins/rollup.config.js deleted file mode 100644 index 54eface40..000000000 --- a/packages/typedoc-plugins/rollup.config.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. - * For licensing, see LICENSE.md. - */ - -import { readFileSync } from 'node:fs'; -import path from 'upath'; -import { defineConfig } from 'rollup'; -import commonjs from '@rollup/plugin-commonjs'; -import { nodeResolve } from '@rollup/plugin-node-resolve'; -import typescript from '@rollup/plugin-typescript'; - -// Current working directory -const cwd = process.cwd(); - -// Content of the `package.json` -const pkg = JSON.parse( - readFileSync( path.join( cwd, 'package.json' ) ) -); - -// List of external dependencies -const externals = [ - ...Object.keys( pkg.dependencies || {} ), - ...Object.keys( pkg.peerDependencies || {} ) -]; - -export default defineConfig( { - input: 'src/index.ts', - output: { - format: 'esm', - dir: path.join( cwd, 'dist' ), - assetFileNames: '[name][extname]' - }, - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - commonjs(), - nodeResolve( { - extensions: [ '.mjs', '.js', '.json', '.node', '.ts', '.mts' ], - preferBuiltins: true - } ), - typescript( { - noEmitOnError: true - } ) - ] -} ); diff --git a/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts b/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts index 35f2e13fa..818cffc42 100644 --- a/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts +++ b/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts @@ -222,7 +222,7 @@ describe( 'typedoc-plugins/event-inheritance-fixer', () => { expect( baseEventClassA.sources ).to.be.an( 'array' ); expect( baseEventClassA.sources ).to.lengthOf( 1 ); - const eventSource = baseEventClassA.sources![ 0 ]; + const eventSource = baseEventClassA.sources![ 0 ]!; expect( eventSource ).to.have.property( 'fileName' ); expect( eventSource ).to.have.property( 'fullFileName' ); @@ -270,8 +270,8 @@ describe( 'typedoc-plugins/event-inheritance-fixer', () => { expect( event.parameters ).to.be.an( 'array' ); expect( event.parameters ).to.lengthOf( 3 ); - const firstParam = event.parameters[ 0 ]; - const firstParamComment = firstParam.comment; + const firstParam = event.parameters[ 0 ]!; + const firstParamComment = firstParam.comment!; const firstParamType = firstParam.type as NamedTupleMember; expect( firstParam ).to.have.property( 'name', 'p1' ); @@ -286,8 +286,8 @@ describe( 'typedoc-plugins/event-inheritance-fixer', () => { expect( firstParamType.element ).to.have.property( 'type', 'intrinsic' ); expect( firstParamType.element ).to.have.property( 'name', 'string' ); - const secondParam = event.parameters[ 1 ]; - const secondParamComment = secondParam.comment; + const secondParam = event.parameters[ 1 ]!; + const secondParamComment = secondParam.comment!; const secondParamType = secondParam.type as NamedTupleMember; expect( secondParam ).to.have.property( 'name', 'p2' ); @@ -302,8 +302,8 @@ describe( 'typedoc-plugins/event-inheritance-fixer', () => { expect( secondParamType.element ).to.have.property( 'type', 'intrinsic' ); expect( secondParamType.element ).to.have.property( 'name', 'number' ); - const thirdParam = event.parameters[ 2 ]; - const thirdParamComment = thirdParam.comment; + const thirdParam = event.parameters[ 2 ]!; + const thirdParamComment = thirdParam.comment!; const thirdParamType = thirdParam.type as NamedTupleMember; expect( thirdParam ).to.have.property( 'name', 'p3' ); diff --git a/packages/typedoc-plugins/tests/event-inheritance-fixer/utils/typedoc-plugin-remove-class-c.ts b/packages/typedoc-plugins/tests/event-inheritance-fixer/utils/typedoc-plugin-remove-class-c.ts index ed4e6bc8d..12cfd80e9 100644 --- a/packages/typedoc-plugins/tests/event-inheritance-fixer/utils/typedoc-plugin-remove-class-c.ts +++ b/packages/typedoc-plugins/tests/event-inheritance-fixer/utils/typedoc-plugin-remove-class-c.ts @@ -22,9 +22,6 @@ import { * "typedoc-plugin-purge-private-api-docs". */ export default function( app: Application ): void { - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, onEventEnd ); } diff --git a/packages/typedoc-plugins/tests/event-param-fixer/index.ts b/packages/typedoc-plugins/tests/event-param-fixer/index.ts index 280f64bf7..041be9936 100644 --- a/packages/typedoc-plugins/tests/event-param-fixer/index.ts +++ b/packages/typedoc-plugins/tests/event-param-fixer/index.ts @@ -144,7 +144,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { expect( eventFooNoText.parameters ).to.be.an( 'array' ); expect( eventFooNoText.parameters ).to.lengthOf( 1 ); - const eventInfoParameter = eventFooNoText.parameters[ 0 ]; + const eventInfoParameter = eventFooNoText.parameters[ 0 ]!; assertEventInfoParameter( eventInfoParameter, eventInfoClass ); } ); @@ -154,7 +154,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { expect( eventFoo.parameters ).to.be.an( 'array' ); expect( eventFoo.parameters ).to.lengthOf( 1 ); - const eventInfoParameter = eventFooNoText.parameters[ 0 ]; + const eventInfoParameter = eventFooNoText.parameters[ 0 ]!; assertEventInfoParameter( eventInfoParameter, eventInfoClass ); } ); @@ -164,7 +164,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { expect( eventFooWithParams.parameters ).to.be.an( 'array' ); expect( eventFooWithParams.parameters ).to.lengthOf( 4 ); - const eventInfoParameter = eventFooNoText.parameters[ 0 ]; + const eventInfoParameter = eventFooNoText.parameters[ 0 ]!; assertEventInfoParameter( eventInfoParameter, eventInfoClass ); } ); @@ -174,7 +174,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { expect( eventObservableChange.parameters ).to.be.an( 'array' ); expect( eventObservableChange.parameters ).to.lengthOf( 4 ); - const eventInfoParameter = eventFooNoText.parameters[ 0 ]; + const eventInfoParameter = eventFooNoText.parameters[ 0 ]!; assertEventInfoParameter( eventInfoParameter, eventInfoClass ); } ); @@ -184,7 +184,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { expect( eventObservableSet.parameters ).to.be.an( 'array' ); expect( eventObservableSet.parameters ).to.lengthOf( 4 ); - const eventInfoParameter = eventFooNoText.parameters[ 0 ]; + const eventInfoParameter = eventFooNoText.parameters[ 0 ]!; assertEventInfoParameter( eventInfoParameter, eventInfoClass ); } ); diff --git a/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts b/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts index c6b484155..bfc5a26ac 100644 --- a/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts +++ b/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts @@ -20,9 +20,6 @@ import { ROOT_TEST_DIRECTORY } from '../utils.js'; import { typeDocPurgePrivateApiDocs, typeDocTagEvent, typeDocRestoreProgramAfterConversion } from '../../src/index.js'; function storeAugmentedInterface( app: Application ) { - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, ( context: Context ) => { context.project.ckeditor5AugmentedInterfaces = [ createInterface( 'AugmentedInterfacePublic' ), @@ -62,10 +59,6 @@ describe( 'typedoc-plugins/purge-private-api-docs', () => { plugin: [ 'typedoc-plugin-rename-defaults' ], - // TODO: To resolve types. - // @ts-expect-error TS2322 - // Type 'boolean' is not assignable to type 'string'. - // For unknown reasons `excludePrivate` type is resolved as `string`. excludePrivate: false } ); @@ -334,8 +327,8 @@ describe( 'typedoc-plugins/purge-private-api-docs', () => { it( 'should remove source URLs only from private reflections', () => { const [ augmentedInterfacePublic, augmentedInterfacePrivate ] = conversionResult.ckeditor5AugmentedInterfaces!; - expect( augmentedInterfacePublic.sources![ 0 ].url ).not.to.be.undefined; - expect( augmentedInterfacePrivate.sources![ 0 ].url ).to.be.undefined; + expect( augmentedInterfacePublic!.sources![ 0 ]!.url ).not.to.be.undefined; + expect( augmentedInterfacePrivate!.sources![ 0 ]!.url ).to.be.undefined; } ); } ); diff --git a/packages/typedoc-plugins/tests/reference-fixer/index.ts b/packages/typedoc-plugins/tests/reference-fixer/index.ts index 3825276b7..3deeb4ef6 100644 --- a/packages/typedoc-plugins/tests/reference-fixer/index.ts +++ b/packages/typedoc-plugins/tests/reference-fixer/index.ts @@ -97,7 +97,7 @@ describe( 'typedoc-plugins/reference-fixer', () => { expect( iconRedoDeclaration ).to.have.property( 'flags' ); expect( iconRedoDeclaration.flags.isConst ).to.equal( true ); expect( iconRedoDeclaration ).to.have.property( 'sources' ); - expect( iconRedoDeclaration.sources![ 0 ].fileName ).to.equal( 'typings/types.d.ts' ); + expect( iconRedoDeclaration.sources![ 0 ]!.fileName ).to.equal( 'typings/types.d.ts' ); expect( iconUndoDeclaration ).to.not.be.undefined; expect( iconUndoDeclaration ).to.have.property( 'variant', 'declaration' ); @@ -107,6 +107,6 @@ describe( 'typedoc-plugins/reference-fixer', () => { expect( iconUndoDeclaration ).to.have.property( 'flags' ); expect( iconUndoDeclaration.flags.isConst ).to.equal( true ); expect( iconUndoDeclaration ).to.have.property( 'sources' ); - expect( iconUndoDeclaration.sources![ 0 ].fileName ).to.equal( 'packages/icons/index.ts' ); + expect( iconUndoDeclaration.sources![ 0 ]!.fileName ).to.equal( 'packages/icons/index.ts' ); } ); } ); diff --git a/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts b/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts index d9251657d..087f68468 100644 --- a/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts +++ b/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts @@ -13,9 +13,6 @@ import { typeDocRestoreProgramAfterConversion } from '../../src/index.js'; import { getPluginPriority } from '../../src/utils/getpluginpriority.js'; function contextProgramChecker( app: Application ) { - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, ( context: Context ) => { expect( context.program ).not.toBeUndefined(); }, getPluginPriority( 'contextProgramChecker' ) ); diff --git a/packages/typedoc-plugins/tests/tag-event/index.ts b/packages/typedoc-plugins/tests/tag-event/index.ts index eb93e2b04..6f0a19283 100644 --- a/packages/typedoc-plugins/tests/tag-event/index.ts +++ b/packages/typedoc-plugins/tests/tag-event/index.ts @@ -257,7 +257,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'comment' ); - const firstParamComment = eventDefinition.parameters[ 0 ].comment!; + const firstParamComment = eventDefinition.parameters[ 0 ]!.comment!; expect( firstParamComment ).to.have.property( 'summary' ); expect( firstParamComment.summary ).to.be.an( 'array' ); @@ -267,7 +267,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', 'p2' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'comment' ); - const secondParamComment = eventDefinition.parameters[ 1 ].comment!; + const secondParamComment = eventDefinition.parameters[ 1 ]!.comment!; expect( secondParamComment ).to.have.property( 'summary' ); expect( secondParamComment.summary ).to.be.an( 'array' ); @@ -277,7 +277,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 2 ] ).to.have.property( 'name', 'p3' ); expect( eventDefinition.parameters[ 2 ] ).to.have.property( 'comment' ); - const thirdParamComment = eventDefinition.parameters[ 2 ].comment!; + const thirdParamComment = eventDefinition.parameters[ 2 ]!.comment!; expect( thirdParamComment ).to.have.property( 'summary' ); expect( thirdParamComment.summary ).to.be.an( 'array' ); @@ -318,7 +318,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - const firstParam = eventDefinition.parameters[ 0 ].type as NamedTupleMember; + const firstParam = eventDefinition.parameters[ 0 ]!.type as NamedTupleMember; expect( firstParam ).to.have.property( 'type', 'namedTupleMember' ); expect( firstParam ).to.have.property( 'element' ); @@ -328,7 +328,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', 'p2' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - const secondParam = eventDefinition.parameters[ 1 ].type as NamedTupleMember; + const secondParam = eventDefinition.parameters[ 1 ]!.type as NamedTupleMember; expect( secondParam ).to.have.property( 'type', 'namedTupleMember' ); expect( secondParam ).to.have.property( 'element' ); @@ -338,7 +338,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 2 ] ).to.have.property( 'name', 'p3' ); expect( eventDefinition.parameters[ 2 ] ).to.have.property( 'type' ); - const thirdParam = eventDefinition.parameters[ 2 ].type as NamedTupleMember; + const thirdParam = eventDefinition.parameters[ 2 ]!.type as NamedTupleMember; expect( thirdParam ).to.have.property( 'type', 'namedTupleMember' ); expect( thirdParam ).to.have.property( 'element' ); @@ -374,10 +374,10 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'flags' ); - expect( eventDefinition.parameters[ 0 ].flags ).to.have.property( 'isOptional', false ); + expect( eventDefinition.parameters[ 0 ]!.flags ).to.have.property( 'isOptional', false ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - const firstParam = eventDefinition.parameters[ 0 ].type as NamedTupleMember; + const firstParam = eventDefinition.parameters[ 0 ]!.type as NamedTupleMember; expect( firstParam ).to.have.property( 'type', 'namedTupleMember' ); expect( firstParam ).to.have.property( 'element' ); @@ -386,10 +386,10 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', 'p2' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'flags' ); - expect( eventDefinition.parameters[ 1 ].flags ).to.have.property( 'isOptional', true ); + expect( eventDefinition.parameters[ 1 ]!.flags ).to.have.property( 'isOptional', true ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - const secondParam = eventDefinition.parameters[ 1 ].type as NamedTupleMember; + const secondParam = eventDefinition.parameters[ 1 ]!.type as NamedTupleMember; expect( secondParam ).to.have.property( 'type', 'namedTupleMember' ); expect( secondParam ).to.have.property( 'element' ); @@ -408,7 +408,7 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - const firstParam = eventDefinition.parameters[ 0 ].type as ReflectionType; + const firstParam = eventDefinition.parameters[ 0 ]!.type as ReflectionType; expect( firstParam ).to.have.property( 'type', 'reflection' ); expect( firstParam ).to.have.property( 'declaration' ); @@ -425,13 +425,13 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', '' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'type', 'intrinsic' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'name', 'number' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'type', 'intrinsic' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'name', 'number' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', '' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - const secondParam = eventDefinition.parameters[ 1 ].type as ReflectionType; + const secondParam = eventDefinition.parameters[ 1 ]!.type as ReflectionType; expect( secondParam ).to.have.property( 'type', 'reflection' ); expect( secondParam ).to.have.property( 'declaration' ); @@ -448,24 +448,24 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', '' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'flags' ); - expect( eventDefinition.parameters[ 0 ].flags ).to.have.property( 'isOptional', true ); + expect( eventDefinition.parameters[ 0 ]!.flags ).to.have.property( 'isOptional', true ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'type', 'optional' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'elementType' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'type', 'optional' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'elementType' ); - const firstParam = eventDefinition.parameters[ 0 ].type as OptionalType; + const firstParam = eventDefinition.parameters[ 0 ]!.type as OptionalType; expect( firstParam.elementType ).to.have.property( 'type', 'intrinsic' ); expect( firstParam.elementType ).to.have.property( 'name', 'number' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', '' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'flags' ); - expect( eventDefinition.parameters[ 1 ].flags ).to.have.property( 'isOptional', true ); + expect( eventDefinition.parameters[ 1 ]!.flags ).to.have.property( 'isOptional', true ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'type', 'optional' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'elementType' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'type', 'optional' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'elementType' ); - const secondParam = eventDefinition.parameters[ 1 ].type as OptionalType; + const secondParam = eventDefinition.parameters[ 1 ]!.type as OptionalType; expect( secondParam.elementType ).to.have.property( 'type', 'reflection' ); expect( secondParam.elementType ).to.have.property( 'declaration' ); @@ -482,20 +482,20 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'type', 'namedTupleMember' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'element' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'type', 'namedTupleMember' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'element' ); - const firstParam = eventDefinition.parameters[ 0 ].type as NamedTupleMember; + const firstParam = eventDefinition.parameters[ 0 ]!.type as NamedTupleMember; expect( firstParam.element ).to.have.property( 'type', 'intrinsic' ); expect( firstParam.element ).to.have.property( 'name', 'string' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', 'p2' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'type', 'namedTupleMember' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'element' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'type', 'namedTupleMember' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'element' ); - const secondParam = eventDefinition.parameters[ 1 ].type as NamedTupleMember; + const secondParam = eventDefinition.parameters[ 1 ]!.type as NamedTupleMember; expect( secondParam.element ).to.have.property( 'type', 'reference' ); expect( secondParam.element ).to.have.property( 'name', 'ExampleType' ); @@ -511,20 +511,20 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'type', 'namedTupleMember' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'element' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'type', 'namedTupleMember' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'element' ); - const firstParam = eventDefinition.parameters[ 0 ].type as NamedTupleMember; + const firstParam = eventDefinition.parameters[ 0 ]!.type as NamedTupleMember; expect( firstParam.element ).to.have.property( 'type', 'intrinsic' ); expect( firstParam.element ).to.have.property( 'name', 'string' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', 'p2' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'type', 'namedTupleMember' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'element' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'type', 'namedTupleMember' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'element' ); - const secondParam = eventDefinition.parameters[ 1 ].type as NamedTupleMember; + const secondParam = eventDefinition.parameters[ 1 ]!.type as NamedTupleMember; expect( secondParam.element ).to.have.property( 'type', 'reference' ); expect( secondParam.element ).to.have.property( 'name', 'ExampleType' ); @@ -540,20 +540,20 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', 'p1' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'type', 'namedTupleMember' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'element' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'type', 'namedTupleMember' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'element' ); - const firstParam = eventDefinition.parameters[ 0 ].type as NamedTupleMember; + const firstParam = eventDefinition.parameters[ 0 ]!.type as NamedTupleMember; expect( firstParam.element ).to.have.property( 'type', 'intrinsic' ); expect( firstParam.element ).to.have.property( 'name', 'string' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'name', 'p2' ); expect( eventDefinition.parameters[ 1 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'type', 'namedTupleMember' ); - expect( eventDefinition.parameters[ 1 ].type ).to.have.property( 'element' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'type', 'namedTupleMember' ); + expect( eventDefinition.parameters[ 1 ]!.type ).to.have.property( 'element' ); - const secondParam = eventDefinition.parameters[ 1 ].type as NamedTupleMember; + const secondParam = eventDefinition.parameters[ 1 ]!.type as NamedTupleMember; expect( secondParam.element ).to.have.property( 'type', 'reference' ); expect( secondParam.element ).to.have.property( 'name', 'ExampleType' ); } ); @@ -568,8 +568,8 @@ describe( 'typedoc-plugins/tag-event', () => { expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'name', '' ); expect( eventDefinition.parameters[ 0 ] ).to.have.property( 'type' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'type', 'intrinsic' ); - expect( eventDefinition.parameters[ 0 ].type ).to.have.property( 'name', 'any' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'type', 'intrinsic' ); + expect( eventDefinition.parameters[ 0 ]!.type ).to.have.property( 'name', 'any' ); } ); } ); } ); diff --git a/packages/typedoc-plugins/tests/tag-observable/index.ts b/packages/typedoc-plugins/tests/tag-observable/index.ts index e0dcd059b..fd75ac3f9 100644 --- a/packages/typedoc-plugins/tests/tag-observable/index.ts +++ b/packages/typedoc-plugins/tests/tag-observable/index.ts @@ -50,10 +50,6 @@ describe( 'typedoc-plugins/tag-observable', () => { plugin: [ 'typedoc-plugin-rename-defaults' ], - // TODO: To resolve types. - // @ts-expect-error TS2322 - // Type 'boolean' is not assignable to type 'string'. - // For unknown reasons `excludePrivate` type is resolved as `string`. excludePrivate: false } ); diff --git a/packages/typedoc-plugins/tests/tsconfig.json b/packages/typedoc-plugins/tests/tsconfig.json index b9646ecf9..5e5973954 100644 --- a/packages/typedoc-plugins/tests/tsconfig.json +++ b/packages/typedoc-plugins/tests/tsconfig.json @@ -1,19 +1,6 @@ { + "extends": "../../../tsconfig.json", "compilerOptions": { - "lib": [ - "ES2022", - "DOM", - "DOM.Iterable" - ], - "noImplicitAny": true, - "noImplicitOverride": true, - "strict": true, - "module": "es6", - "target": "es2020", - "sourceMap": true, - "allowJs": true, - "moduleResolution": "node", - "esModuleInterop": true, - "skipLibCheck": true + "allowJs": true } } diff --git a/packages/typedoc-plugins/tests/utils.ts b/packages/typedoc-plugins/tests/utils.ts index a04bb5502..1ef8af546 100644 --- a/packages/typedoc-plugins/tests/utils.ts +++ b/packages/typedoc-plugins/tests/utils.ts @@ -8,7 +8,7 @@ import { expect } from 'vitest'; import type { TypeScript } from 'typedoc'; import type { ValidatorErrorCallbackArg } from '../src/validators/index.js'; -export const ROOT_TEST_DIRECTORY = upath.join( import.meta.dirname, '..', 'tests' ); +export const ROOT_TEST_DIRECTORY: string = upath.join( import.meta.dirname, '..', 'tests' ); export type ExpectedError = { message: string; @@ -47,6 +47,6 @@ export function assertCalls( errorCalls: Array, expec return true; } ); - }, `Unexpected "${ message }" error received.` ); + } ); } } diff --git a/packages/typedoc-plugins/tests/validators/fires-validator/index.ts b/packages/typedoc-plugins/tests/validators/fires-validator/index.ts index 7b4bffec0..936b995cd 100644 --- a/packages/typedoc-plugins/tests/validators/fires-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/fires-validator/index.ts @@ -53,9 +53,6 @@ describe( 'typedoc-plugins/validators/fires-validator', () => { typeDocPurgePrivateApiDocs( app ); typeDocRestoreProgramAfterConversion( app ); - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, ( context: Context ) => { firesValidator( context, onError ); }, getPluginPriority( 'validators' ) ); diff --git a/packages/typedoc-plugins/tests/validators/link-validator/index.ts b/packages/typedoc-plugins/tests/validators/link-validator/index.ts index e79592f1a..e5d940978 100644 --- a/packages/typedoc-plugins/tests/validators/link-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/link-validator/index.ts @@ -54,9 +54,6 @@ describe( 'typedoc-plugins/validators/link-validator', () => { typeDocPurgePrivateApiDocs( app ); typeDocRestoreProgramAfterConversion( app ); - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, ( context: Context ) => { linkValidator( context, onError ); }, getPluginPriority( 'validators' ) ); diff --git a/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts b/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts index 411969fc7..e1fc44084 100644 --- a/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts @@ -53,9 +53,6 @@ describe( 'typedoc-plugins/validators/overloads-validator', () => { typeDocPurgePrivateApiDocs( app ); typeDocRestoreProgramAfterConversion( app ); - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, ( context: Context ) => { overloadsValidator( context, onError ); }, getPluginPriority( 'validators' ) ); diff --git a/packages/typedoc-plugins/tests/validators/see-validator/index.ts b/packages/typedoc-plugins/tests/validators/see-validator/index.ts index 56d3ff2fe..03c0c087a 100644 --- a/packages/typedoc-plugins/tests/validators/see-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/see-validator/index.ts @@ -53,9 +53,6 @@ describe( 'typedoc-plugins/validators/see-validator', () => { typeDocPurgePrivateApiDocs( app ); typeDocRestoreProgramAfterConversion( app ); - // TODO: To resolve types. - // @ts-expect-error TS2339 - // Property 'on' does not exist on type 'Converter'. app.converter.on( Converter.EVENT_END, ( context: Context ) => { seeValidator( context, onError ); }, getPluginPriority( 'validators' ) ); diff --git a/packages/typedoc-plugins/tsconfig.json b/packages/typedoc-plugins/tsconfig.json deleted file mode 100644 index bf3856e5b..000000000 --- a/packages/typedoc-plugins/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "rootDir": "src", - "outDir": "dist" - }, - "include": [ - "src", - "tests" - ] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f437435c2..07ed47d27 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,9 +58,15 @@ importers: minimist: specifier: ^1.2.8 version: 1.2.8 + oxc-transform: + specifier: ^0.112.0 + version: 0.112.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) semver: specifier: ^7.7.4 version: 7.7.4 + typescript: + specifier: 5.5.4 + version: 5.5.4 upath: specifier: ^2.0.1 version: 2.0.1 @@ -143,15 +149,18 @@ importers: '@types/node': specifier: ^22.19.17 version: 22.19.17 + '@types/postcss-mixins': + specifier: ^9.0.5 + version: 9.0.6 '@vitest/coverage-v8': specifier: ^4.1.2 version: 4.1.2(vitest@4.1.2(@types/node@22.19.17)(vite@7.3.2(@types/node@22.19.17)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) + rolldown: + specifier: ^1.0.0-rc.4 + version: 1.0.0 type-fest: specifier: ^4.41.0 version: 4.41.0 - typescript: - specifier: 5.5.4 - version: 5.5.4 vitest: specifier: ^4.1.2 version: 4.1.2(@types/node@22.19.17)(vite@7.3.2(@types/node@22.19.17)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) @@ -189,24 +198,15 @@ importers: specifier: ^2.0.1 version: 2.0.1 devDependencies: - '@rollup/plugin-node-resolve': - specifier: ^16.0.3 - version: 16.0.3(rollup@4.60.1) - '@rollup/plugin-typescript': - specifier: 12.3.0 - version: 12.3.0(rollup@4.60.1)(tslib@2.8.1)(typescript@5.5.4) '@types/semver': specifier: ^7.7.1 version: 7.7.1 '@vitest/coverage-v8': specifier: ^4.1.2 version: 4.1.2(vitest@4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) - rollup: - specifier: ^4.60.1 - version: 4.60.1 - typescript: - specifier: 5.5.4 - version: 5.5.4 + rolldown: + specifier: ^1.0.0 + version: 1.0.0 vitest: specifier: ^4.1.2 version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) @@ -276,9 +276,6 @@ importers: jest-extended: specifier: ^5.0.3 version: 5.0.3 - typescript: - specifier: 5.5.4 - version: 5.5.4 vitest: specifier: ^4.1.2 version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) @@ -292,21 +289,12 @@ importers: specifier: ^2.0.1 version: 2.0.1 devDependencies: - '@rollup/plugin-node-resolve': - specifier: ^16.0.3 - version: 16.0.3(rollup@4.60.1) - '@rollup/plugin-typescript': - specifier: 12.3.0 - version: 12.3.0(rollup@4.60.1)(tslib@2.8.1)(typescript@5.5.4) '@vitest/coverage-v8': specifier: ^4.1.2 version: 4.1.2(vitest@4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) - rollup: - specifier: ^4.60.1 - version: 4.60.1 - typescript: - specifier: 5.5.4 - version: 5.5.4 + rolldown: + specifier: ^1.0.0 + version: 1.0.0 vitest: specifier: ^4.1.2 version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) @@ -615,12 +603,6 @@ importers: specifier: ^2.0.1 version: 2.0.1 devDependencies: - '@rollup/plugin-node-resolve': - specifier: ^16.0.3 - version: 16.0.3(rollup@4.60.1) - '@rollup/plugin-typescript': - specifier: 12.3.0 - version: 12.3.0(rollup@4.60.1)(tslib@2.8.1)(typescript@5.5.4) '@types/pacote': specifier: ^11.1.8 version: 11.1.8 @@ -630,12 +612,9 @@ importers: jest-extended: specifier: ^5.0.3 version: 5.0.3 - rollup: - specifier: ^4.60.1 - version: 4.60.1 - typescript: - specifier: 5.5.4 - version: 5.5.4 + rolldown: + specifier: ^1.0.0 + version: 1.0.0 vitest: specifier: ^4.1.2 version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) @@ -649,30 +628,12 @@ importers: specifier: ^0.24.0 version: 0.24.0(puppeteer@24.40.0(typescript@5.5.4)) devDependencies: - '@rollup/plugin-commonjs': - specifier: ^28.0.9 - version: 28.0.9(rollup@4.60.1) - '@rollup/plugin-node-resolve': - specifier: ^16.0.3 - version: 16.0.3(rollup@4.60.1) - '@rollup/plugin-typescript': - specifier: 12.3.0 - version: 12.3.0(rollup@4.60.1)(tslib@2.8.1)(typescript@5.5.4) - '@vitest/coverage-v8': - specifier: ^4.1.2 - version: 4.1.2(vitest@4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) - rollup: - specifier: ^4.60.1 - version: 4.60.1 - typescript: - specifier: 5.5.4 - version: 5.5.4 + rolldown: + specifier: ^1.0.0 + version: 1.0.0 upath: specifier: ^2.0.1 version: 2.0.1 - vitest: - specifier: ^4.1.2 - version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) packages/typedoc-plugins: dependencies: @@ -680,30 +641,18 @@ importers: specifier: ^2.0.1 version: 2.0.1 devDependencies: - '@rollup/plugin-commonjs': - specifier: ^28.0.9 - version: 28.0.9(rollup@4.60.1) - '@rollup/plugin-node-resolve': - specifier: ^16.0.3 - version: 16.0.3(rollup@4.60.1) - '@rollup/plugin-typescript': - specifier: 12.3.0 - version: 12.3.0(rollup@4.60.1)(tslib@2.8.1)(typescript@5.5.4) glob: specifier: ^13.0.6 version: 13.0.6 - rollup: - specifier: ^4.60.1 - version: 4.60.1 + rolldown: + specifier: ^1.0.0 + version: 1.0.0 typedoc: specifier: ^0.28.18 version: 0.28.18(typescript@5.5.4) typedoc-plugin-rename-defaults: specifier: ^0.7.3 version: 0.7.3(typedoc@0.28.18(typescript@5.5.4)) - typescript: - specifier: 5.5.4 - version: 5.5.4 vitest: specifier: ^4.1.2 version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) @@ -795,11 +744,11 @@ packages: resolution: {integrity: sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==} engines: {node: '>=0.1.90'} - '@emnapi/core@1.9.2': - resolution: {integrity: sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==} + '@emnapi/core@1.10.0': + resolution: {integrity: sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==} - '@emnapi/runtime@1.9.2': - resolution: {integrity: sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==} + '@emnapi/runtime@1.10.0': + resolution: {integrity: sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==} '@emnapi/wasi-threads@1.2.1': resolution: {integrity: sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==} @@ -1238,6 +1187,12 @@ packages: '@napi-rs/wasm-runtime@0.2.12': resolution: {integrity: sha512-ZVWUcfwY4E/yPitQJl481FjFo3K22D6qF0DuFH6Y/nbnE11GY5uguDxZMGXPQ8WQ0128MXQD7TnfHyK4oWoIJQ==} + '@napi-rs/wasm-runtime@1.1.4': + resolution: {integrity: sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==} + peerDependencies: + '@emnapi/core': ^1.7.1 + '@emnapi/runtime': ^1.7.1 + '@nodelib/fs.scandir@2.1.5': resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} @@ -1431,9 +1386,139 @@ packages: cpu: [x64] os: [win32] + '@oxc-project/types@0.129.0': + resolution: {integrity: sha512-3oz8m3FGdr2nDXVqmFUw7jolKliC4MoyXYIG2c7gpjBnzUWQpUGIYcXYKxTdTi+N2jusvt610ckTMkxdwHkYEg==} + '@oxc-project/types@0.72.3': resolution: {integrity: sha512-CfAC4wrmMkUoISpQkFAIfMVvlPfQV3xg7ZlcqPXPOIMQhdKIId44G8W0mCPgtpWdFFAyJ+SFtiM+9vbyCkoVng==} + '@oxc-transform/binding-android-arm-eabi@0.112.0': + resolution: {integrity: sha512-r4LuBaPnOAi0eUOBNi880Fm2tO2omH7N1FRrL6+nyz/AjQ+QPPLtoyZJva0O+sKi1buyN/7IzM5p9m+5ANSDbg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [android] + + '@oxc-transform/binding-android-arm64@0.112.0': + resolution: {integrity: sha512-ve46vQcQrY8eGe8990VSlS9gkD+AogJqbtfOkeua+5sQGQTDgeIRRxOm7ktCo19uZc2bEBwXRJITgosd+NRVmQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@oxc-transform/binding-darwin-arm64@0.112.0': + resolution: {integrity: sha512-ddbmLU3Tr+i7MOynfwAXxUXud3SjJKlv7XNjaq08qiI8Av/QvhXVGc2bMhXkWQSMSBUeTDoiughKjK+Zsb6y/A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@oxc-transform/binding-darwin-x64@0.112.0': + resolution: {integrity: sha512-TKvmNw96jQZPqYb4pRrzLFDailNB3YS14KNn+x2hwRbqc6CqY96S9PYwyOpVpYdxfoRjYO9WgX9SoS+62a1DPA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@oxc-transform/binding-freebsd-x64@0.112.0': + resolution: {integrity: sha512-YPMkSCDaelO8HHYRMYjm+Q+IfkfIbdtQzwPuasItYkq8UUkNeHNPheNh2JkvQa3c+io3E9ePOgHQ2yihpk7o/Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@oxc-transform/binding-linux-arm-gnueabihf@0.112.0': + resolution: {integrity: sha512-nA7kzQGNEpuTRknst/IJ3l8hqmDmEda3aun6jkXgp7gKxESjuHeaNH04mKISxvJ7fIacvP2g/wtTSnm4u5jL8Q==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxc-transform/binding-linux-arm-musleabihf@0.112.0': + resolution: {integrity: sha512-w8GuLmckKlGc3YujaZKhtbFxziCcosvM2l9GnQjCb/yENWLGDiyQOy0BTAgPGdJwpYTiOeJblEXSuXYvlE1Ong==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@oxc-transform/binding-linux-arm64-gnu@0.112.0': + resolution: {integrity: sha512-9LwwGnJ8+WT0rXcrI8M0RJtDNt91eMqcDPPEvJxhRFHIMcHTy5D5xT+fOl3Us0yMqKo3HUWkbfUYqAp4GoZ3Jw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxc-transform/binding-linux-arm64-musl@0.112.0': + resolution: {integrity: sha512-Lg6VOuSd3oXv7J0eGywgqh/086h+qQzIBOD+47pYKMTTJcbDe+f3h/RgGoMKJE5HhiwT5sH1aGEJfIfaYUiVSw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxc-transform/binding-linux-ppc64-gnu@0.112.0': + resolution: {integrity: sha512-PXzmj82o1moA4IGphYImTRgc2youTi4VRfyFX3CHwLjxPcQ5JtcsgbDt4QUdOzXZ+zC07s5jf2ZzhRapEOlj2w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@oxc-transform/binding-linux-riscv64-gnu@0.112.0': + resolution: {integrity: sha512-vhJsMsVH/6xwa3bt1LGts33FXUkGjaEGDwsRyp4lIfOjSfQVWMtCmWMFNaA0dW9FVWdD2Gt2fSFBSZ+azDxlpg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [glibc] + + '@oxc-transform/binding-linux-riscv64-musl@0.112.0': + resolution: {integrity: sha512-cXWFb7z+2IjFUEcXtRwluq9oEG5qnyFCjiu3SWrgYNcWwPdHusv3I/7K5/CTbbi4StoZ5txbi7/iSfDHNyWuRw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [riscv64] + os: [linux] + libc: [musl] + + '@oxc-transform/binding-linux-s390x-gnu@0.112.0': + resolution: {integrity: sha512-eEFu4SRqJTJ20/88KRWmp+jpHKAw0Y1DsnSgpEeXyBIIcsOaLIUMU/TfYWUmqRbvbMV9rmOmI3kp5xWYUq6kSQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@oxc-transform/binding-linux-x64-gnu@0.112.0': + resolution: {integrity: sha512-ST1MDT+TlOyZ1c5btrGinRSUW2Jf4Pa+0gdKwsyjDSOC3dxy2ZNkN3mosTf4ywc3J+mxfYKqtjs7zSwHz03ILA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxc-transform/binding-linux-x64-musl@0.112.0': + resolution: {integrity: sha512-ISQoA3pD4cyTGpf9sXXeerH6pL2L6EIpdy6oAy2ttkswyVFDyQNVOVIGIdLZDgbpmqGljxZnWqt/J/N68pQaig==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxc-transform/binding-openharmony-arm64@0.112.0': + resolution: {integrity: sha512-UOGVrGIv7yLJovyEXEyUTADuLq98vd/cbMHFLJweRXD+11I8Tn4jASi4WzdsN8C3BVYGRHrXH2NlSBmhz33a4g==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@oxc-transform/binding-wasm32-wasi@0.112.0': + resolution: {integrity: sha512-XIX7Gpq9koAvzBVHDlVFHM79r5uOVK6kTEsdsN4qaajpjkgtv4tdsAOKIYK6l7fUbsbE6xS+6w1+yRFrDeC1kg==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + + '@oxc-transform/binding-win32-arm64-msvc@0.112.0': + resolution: {integrity: sha512-EgXef9kOne9BNsbYBbuRqxk2hteT0xsAGcx/VbtCBMJYNj8fANFhT271DUSOgfa4DAgrQQmsyt/Kr1aV9mpU9w==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@oxc-transform/binding-win32-ia32-msvc@0.112.0': + resolution: {integrity: sha512-6QaB0qjNaou2YR+blncHdw7j0e26IOwOIjLbhVGDeuf9+4rjJeiqRXJ2hOtCcS4zblnao/MjdgQuZ3fM0nl+Kw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ia32] + os: [win32] + + '@oxc-transform/binding-win32-x64-msvc@0.112.0': + resolution: {integrity: sha512-FRKYlY959QeqRPx9kXs0HjU2xuXPT1cdF+vvA200D9uAX/KLcC34MwRqUKTYml4kCc2Vf/P2pBR9cQuBm3zECQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -1443,6 +1528,104 @@ packages: engines: {node: '>=18'} hasBin: true + '@rolldown/binding-android-arm64@1.0.0': + resolution: {integrity: sha512-TWMZnRLMe63C2Lhyicviu7ZHaU4kxa6PS3rofvc9GmcvptzNN11BcfQ4Sl7MwTOsisQoa2keB/EBdNCAnUo8vA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [android] + + '@rolldown/binding-darwin-arm64@1.0.0': + resolution: {integrity: sha512-6XcD+8k0gPVItNagEw78/qqcBDwKcwDYS8V2hRmVsfUSIrd8cWe/CBvRDI5toqFyPfj+FJr6t8U6Xj2P2prEew==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [darwin] + + '@rolldown/binding-darwin-x64@1.0.0': + resolution: {integrity: sha512-iN/tWVXRQDWvmZlKdceP1Dwug9GDpEymhb9p4xnEe6zvCg5lFmzVljl+1qR1NVx3yfGpr2Na+CuLmv5IU8uzfQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [darwin] + + '@rolldown/binding-freebsd-x64@1.0.0': + resolution: {integrity: sha512-jjQMDvvwSOuhOwMszD/klSOjyWMM3zI64hWTj9KT5x4MxRbZAf+7vLQ6qouRhtsLVFHr3f0ILaJAfgENPiQdAQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [freebsd] + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0': + resolution: {integrity: sha512-d//Dtg2x6/m3mbV64yUGNnDGNZaDGRpDLLNGerHQUVObuNaIQaaDp25yUiqGXtHEXX+NP2d0wAlmKgpYgIAJ2A==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm] + os: [linux] + + '@rolldown/binding-linux-arm64-gnu@1.0.0': + resolution: {integrity: sha512-n7Ofp0mx+aB2cC+Sdy5YtMnXtY9lchnHbY+3Yt0uq9JsWQExf4f5Whu0tK0R8Jdc9S6RchTHjIFY7uc92puOVQ==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-arm64-musl@1.0.0': + resolution: {integrity: sha512-EIVjy2cgd7uuMMo94FVkBp7F6DhcZAUwNURkSG3RwUmvAXR6s0ISxM81U+IydcZByPG0pZIHsf1b6kTxoFDgJA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@rolldown/binding-linux-ppc64-gnu@1.0.0': + resolution: {integrity: sha512-JEwwOPcwTLAcpDQlqSmjEmfs63xJnSiUNIGvLcDLUHCWK4XowpS/7c7tUsUH6uT/ct6bMUTdXKfI8967FYj6mg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [ppc64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-s390x-gnu@1.0.0': + resolution: {integrity: sha512-0wjCFhLrihtAubnT9iA0N++0pSV0z5Hg7tNGdNJ4RFaINceHadoF+kiFGyY1qSSNVIAZtLotG8Ju1bgDPkjnFA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [s390x] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-gnu@1.0.0': + resolution: {integrity: sha512-Dfn7iak9BcMMePxcoJfpSbWqnEyrp/dRF63/8qW/eHBdOZov6x5aShLLEYGYdIeSJ6vMLK/XCVB+lGIxm41bQA==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@rolldown/binding-linux-x64-musl@1.0.0': + resolution: {integrity: sha512-5/utzzDmD/pD/bmuaUcbTf/sZYy0aztwIVlfpoW1fTjCZ0BaPOMVWGZL1zvgxyi7ZIVYWlxKONHmSbHuiOh8Jw==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [linux] + libc: [musl] + + '@rolldown/binding-openharmony-arm64@1.0.0': + resolution: {integrity: sha512-ouJs8VcUomfLfpbUECqFMRqdV4x6aeAK3MA4m6vTrJJjKyWTV5KnxZx7Jd9G+GlDaQQxubcba00x16OyJ1meig==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [openharmony] + + '@rolldown/binding-wasm32-wasi@1.0.0': + resolution: {integrity: sha512-E+oHKGiDA+lsKMmFtffDDw91EryDT7uJocrIuCHqhm6bCTM6xFK+3gaCkYOHfPwQr0cCNarSM2xaELoQDz9jJg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [wasm32] + + '@rolldown/binding-win32-arm64-msvc@1.0.0': + resolution: {integrity: sha512-yYK02n8Rngo+gbm1y6G0+7jk1sJ/2Wt7K0me0Y7k/ErBpyf+LJ2gFpqWVTcRV1rUepBlQRmpgWkTQCiiwrK0Ow==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [arm64] + os: [win32] + + '@rolldown/binding-win32-x64-msvc@1.0.0': + resolution: {integrity: sha512-14bpChMahXRRXiTwahSl+zzHPW6qQTXtkMuJBFlbo+pqSAews2d4BdCSHfrJ/MBsCZtpmTafsY+1QhBzitcmdg==} + engines: {node: ^20.19.0 || >=22.12.0} + cpu: [x64] + os: [win32] + + '@rolldown/pluginutils@1.0.0': + resolution: {integrity: sha512-aKs/3GSWyV0mrhNmt/96/Z3yczC3yvrzYATCiCXQebBsGyYzjNdUphRVLeJQ67ySKVXRfMxt2lm12pmXvbPFQQ==} + '@rollup/plugin-commonjs@28.0.9': resolution: {integrity: sha512-PIR4/OHZ79romx0BVVll/PkwWpJ7e5lsqFa3gFfcrFPWwLXLV39JVUzQV9RKjWerE7B845Hqjj9VYlQeieZ2dA==} engines: {node: '>=16.0.0 || 14 >= 14.17'} @@ -1928,6 +2111,9 @@ packages: '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} + '@types/postcss-mixins@9.0.6': + resolution: {integrity: sha512-AyFHDblvvsiyHyjZQYgFSX/mPKnfKflOQD4Xm20qynAicmUX7sXp1cs4wa3rlcvO8ORE4OlkWML3aFgqWbxarA==} + '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -4395,6 +4581,10 @@ packages: resolution: {integrity: sha512-JYQeJKDcUTTZ/uTdJ+fZBGFjAjkLD1h0p3Tf44ZYXRcoMk+57d81paNPFAAwzrzzqhZmkGvKKXDxwyhJXYZlpg==} engines: {node: '>=14.0.0'} + oxc-transform@0.112.0: + resolution: {integrity: sha512-cIRRvZgrHfsAHrkt8LWdAX4+Do8R0MzQSfeo9yzErzHeYiuyNiP4PCTPbOy/wBXL4MYzt3ebrBa5jt3akQkKAg==} + engines: {node: ^20.19.0 || >=22.12.0} + oxc-walker@0.3.0: resolution: {integrity: sha512-mGGgl9dmYHUX7Z3bxXhibwarI0fJVj2E64FNIOZQWUDvEeIPyJTe5ElyJmp4nmDdfdnrlG0bhdR+bR9D6DM/dA==} peerDependencies: @@ -4895,6 +5085,11 @@ packages: resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==} engines: {node: '>=8.0'} + rolldown@1.0.0: + resolution: {integrity: sha512-yD986aXDESFGS95spT1LAv0jssywP4npMEjmMHyN2/5+eE8qQJUype2AaKkRiLgBgyD0LFlubwAht7VmY8rGoA==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + rollup-plugin-svg-import@3.0.0: resolution: {integrity: sha512-5fUESTM5hdqJojrwO53JQUO7NespLNx4iLeMsToQfuaGGqGT5sz85Ns5gCDNxLO6yBPbn7p0A/6YA+Rq3clg4Q==} engines: {node: '>=18.0.0'} @@ -5798,13 +5993,13 @@ snapshots: '@colors/colors@1.5.0': {} - '@emnapi/core@1.9.2': + '@emnapi/core@1.10.0': dependencies: '@emnapi/wasi-threads': 1.2.1 tslib: 2.8.1 optional: true - '@emnapi/runtime@1.9.2': + '@emnapi/runtime@1.10.0': dependencies: tslib: 2.8.1 optional: true @@ -6192,8 +6387,15 @@ snapshots: '@napi-rs/wasm-runtime@0.2.12': dependencies: - '@emnapi/core': 1.9.2 - '@emnapi/runtime': 1.9.2 + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@tybys/wasm-util': 0.10.1 + optional: true + + '@napi-rs/wasm-runtime@1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 '@tybys/wasm-util': 0.10.1 optional: true @@ -6376,8 +6578,75 @@ snapshots: '@oxc-parser/binding-win32-x64-msvc@0.72.3': optional: true + '@oxc-project/types@0.129.0': {} + '@oxc-project/types@0.72.3': {} + '@oxc-transform/binding-android-arm-eabi@0.112.0': + optional: true + + '@oxc-transform/binding-android-arm64@0.112.0': + optional: true + + '@oxc-transform/binding-darwin-arm64@0.112.0': + optional: true + + '@oxc-transform/binding-darwin-x64@0.112.0': + optional: true + + '@oxc-transform/binding-freebsd-x64@0.112.0': + optional: true + + '@oxc-transform/binding-linux-arm-gnueabihf@0.112.0': + optional: true + + '@oxc-transform/binding-linux-arm-musleabihf@0.112.0': + optional: true + + '@oxc-transform/binding-linux-arm64-gnu@0.112.0': + optional: true + + '@oxc-transform/binding-linux-arm64-musl@0.112.0': + optional: true + + '@oxc-transform/binding-linux-ppc64-gnu@0.112.0': + optional: true + + '@oxc-transform/binding-linux-riscv64-gnu@0.112.0': + optional: true + + '@oxc-transform/binding-linux-riscv64-musl@0.112.0': + optional: true + + '@oxc-transform/binding-linux-s390x-gnu@0.112.0': + optional: true + + '@oxc-transform/binding-linux-x64-gnu@0.112.0': + optional: true + + '@oxc-transform/binding-linux-x64-musl@0.112.0': + optional: true + + '@oxc-transform/binding-openharmony-arm64@0.112.0': + optional: true + + '@oxc-transform/binding-wasm32-wasi@0.112.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0)': + dependencies: + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + optional: true + + '@oxc-transform/binding-win32-arm64-msvc@0.112.0': + optional: true + + '@oxc-transform/binding-win32-ia32-msvc@0.112.0': + optional: true + + '@oxc-transform/binding-win32-x64-msvc@0.112.0': + optional: true + '@pkgjs/parseargs@0.11.0': optional: true @@ -6396,6 +6665,57 @@ snapshots: - react-native-b4a - supports-color + '@rolldown/binding-android-arm64@1.0.0': + optional: true + + '@rolldown/binding-darwin-arm64@1.0.0': + optional: true + + '@rolldown/binding-darwin-x64@1.0.0': + optional: true + + '@rolldown/binding-freebsd-x64@1.0.0': + optional: true + + '@rolldown/binding-linux-arm-gnueabihf@1.0.0': + optional: true + + '@rolldown/binding-linux-arm64-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-arm64-musl@1.0.0': + optional: true + + '@rolldown/binding-linux-ppc64-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-s390x-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-x64-gnu@1.0.0': + optional: true + + '@rolldown/binding-linux-x64-musl@1.0.0': + optional: true + + '@rolldown/binding-openharmony-arm64@1.0.0': + optional: true + + '@rolldown/binding-wasm32-wasi@1.0.0': + dependencies: + '@emnapi/core': 1.10.0 + '@emnapi/runtime': 1.10.0 + '@napi-rs/wasm-runtime': 1.1.4(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + optional: true + + '@rolldown/binding-win32-arm64-msvc@1.0.0': + optional: true + + '@rolldown/binding-win32-x64-msvc@1.0.0': + optional: true + + '@rolldown/pluginutils@1.0.0': {} + '@rollup/plugin-commonjs@28.0.9(rollup@4.60.1)': dependencies: '@rollup/pluginutils': 5.3.0(rollup@4.60.1) @@ -6735,7 +7055,7 @@ snapshots: '@types/cors@2.8.19': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/css@0.0.38': {} @@ -6774,7 +7094,7 @@ snapshots: '@types/karma@6.3.9': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 log4js: 6.9.1 transitivePeerDependencies: - supports-color @@ -6791,7 +7111,7 @@ snapshots: '@types/node-fetch@2.6.13': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 form-data: 4.0.5 '@types/node@22.19.17': @@ -6801,12 +7121,13 @@ snapshots: '@types/node@25.5.2': dependencies: undici-types: 7.18.2 + optional: true '@types/npm-package-arg@6.1.4': {} '@types/npm-registry-fetch@8.0.9': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/node-fetch': 2.6.13 '@types/npm-package-arg': 6.1.4 '@types/npmlog': 7.0.0 @@ -6814,17 +7135,21 @@ snapshots: '@types/npmlog@7.0.0': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/pacote@11.1.8': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/npm-registry-fetch': 8.0.9 '@types/npmlog': 7.0.0 '@types/ssri': 7.1.5 '@types/parse-json@4.0.2': {} + '@types/postcss-mixins@9.0.6': + dependencies: + postcss: 8.5.10 + '@types/resolve@1.20.2': {} '@types/semver@7.7.1': {} @@ -6842,21 +7167,21 @@ snapshots: '@types/ssri@7.1.5': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/through2@2.0.41': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/unist@3.0.3': {} '@types/ws@8.18.1': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/yauzl@2.10.3': dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 optional: true '@typescript-eslint/eslint-plugin@8.58.0(@typescript-eslint/parser@8.58.0(eslint@9.39.4(jiti@2.6.1))(typescript@5.5.4))(eslint@9.39.4(jiti@2.6.1))(typescript@5.5.4)': @@ -7896,7 +8221,7 @@ snapshots: engine.io@6.6.6: dependencies: '@types/cors': 2.8.19 - '@types/node': 25.5.2 + '@types/node': 22.19.17 '@types/ws': 8.18.1 accepts: 1.3.8 base64id: 2.0.0 @@ -8712,7 +9037,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 25.5.2 + '@types/node': 22.19.17 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -9736,6 +10061,32 @@ snapshots: '@oxc-parser/binding-win32-arm64-msvc': 0.72.3 '@oxc-parser/binding-win32-x64-msvc': 0.72.3 + oxc-transform@0.112.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0): + optionalDependencies: + '@oxc-transform/binding-android-arm-eabi': 0.112.0 + '@oxc-transform/binding-android-arm64': 0.112.0 + '@oxc-transform/binding-darwin-arm64': 0.112.0 + '@oxc-transform/binding-darwin-x64': 0.112.0 + '@oxc-transform/binding-freebsd-x64': 0.112.0 + '@oxc-transform/binding-linux-arm-gnueabihf': 0.112.0 + '@oxc-transform/binding-linux-arm-musleabihf': 0.112.0 + '@oxc-transform/binding-linux-arm64-gnu': 0.112.0 + '@oxc-transform/binding-linux-arm64-musl': 0.112.0 + '@oxc-transform/binding-linux-ppc64-gnu': 0.112.0 + '@oxc-transform/binding-linux-riscv64-gnu': 0.112.0 + '@oxc-transform/binding-linux-riscv64-musl': 0.112.0 + '@oxc-transform/binding-linux-s390x-gnu': 0.112.0 + '@oxc-transform/binding-linux-x64-gnu': 0.112.0 + '@oxc-transform/binding-linux-x64-musl': 0.112.0 + '@oxc-transform/binding-openharmony-arm64': 0.112.0 + '@oxc-transform/binding-wasm32-wasi': 0.112.0(@emnapi/core@1.10.0)(@emnapi/runtime@1.10.0) + '@oxc-transform/binding-win32-arm64-msvc': 0.112.0 + '@oxc-transform/binding-win32-ia32-msvc': 0.112.0 + '@oxc-transform/binding-win32-x64-msvc': 0.112.0 + transitivePeerDependencies: + - '@emnapi/core' + - '@emnapi/runtime' + oxc-walker@0.3.0(oxc-parser@0.72.3): dependencies: estree-walker: 3.0.3 @@ -10241,6 +10592,27 @@ snapshots: semver-compare: 1.0.0 sprintf-js: 1.1.3 + rolldown@1.0.0: + dependencies: + '@oxc-project/types': 0.129.0 + '@rolldown/pluginutils': 1.0.0 + optionalDependencies: + '@rolldown/binding-android-arm64': 1.0.0 + '@rolldown/binding-darwin-arm64': 1.0.0 + '@rolldown/binding-darwin-x64': 1.0.0 + '@rolldown/binding-freebsd-x64': 1.0.0 + '@rolldown/binding-linux-arm-gnueabihf': 1.0.0 + '@rolldown/binding-linux-arm64-gnu': 1.0.0 + '@rolldown/binding-linux-arm64-musl': 1.0.0 + '@rolldown/binding-linux-ppc64-gnu': 1.0.0 + '@rolldown/binding-linux-s390x-gnu': 1.0.0 + '@rolldown/binding-linux-x64-gnu': 1.0.0 + '@rolldown/binding-linux-x64-musl': 1.0.0 + '@rolldown/binding-openharmony-arm64': 1.0.0 + '@rolldown/binding-wasm32-wasi': 1.0.0 + '@rolldown/binding-win32-arm64-msvc': 1.0.0 + '@rolldown/binding-win32-x64-msvc': 1.0.0 + rollup-plugin-svg-import@3.0.0(rollup@4.60.1): dependencies: '@rollup/pluginutils': 5.3.0(rollup@4.60.1) @@ -10780,7 +11152,8 @@ snapshots: undici-types@6.21.0: {} - undici-types@7.18.2: {} + undici-types@7.18.2: + optional: true unicorn-magic@0.3.0: {} diff --git a/scripts/ci/generate-circleci-configuration.js b/scripts/ci/generate-circleci-configuration.js index 84dddc4e7..39f69d42c 100644 --- a/scripts/ci/generate-circleci-configuration.js +++ b/scripts/ci/generate-circleci-configuration.js @@ -33,10 +33,6 @@ const CIRCLECI_CONFIGURATION_DIRECTORY = upath.join( ROOT_DIRECTORY, '.circleci' } ) ); - const packagesWithTypes = packagesScriptsMap - .filter( ( { scripts } ) => scripts.includes( 'types' ) ) - .map( ( { packageName } ) => packageName ) - .sort(); const packagesWithTests = packagesScriptsMap .filter( ( { scripts } ) => scripts.includes( 'coverage' ) ) .map( ( { packageName } ) => packageName ) @@ -50,7 +46,6 @@ const CIRCLECI_CONFIGURATION_DIRECTORY = upath.join( ROOT_DIRECTORY, '.circleci' ); const stepsToAdd = [ - ...generateSteps( packagesWithTypes, 'pnpm run types', 'Check types for "$1"' ), ...generateSteps( packagesWithTests, 'pnpm run coverage', 'Execute tests for "$1"' ), { run: { diff --git a/scripts/plugin-declarations.js b/scripts/plugin-declarations.js new file mode 100644 index 000000000..904d9481c --- /dev/null +++ b/scripts/plugin-declarations.js @@ -0,0 +1,58 @@ +/** + * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md. + */ + +import { readFileSync, globSync } from 'node:fs'; +import { isolatedDeclaration } from 'oxc-transform'; +import path from 'upath'; + +function getTypeScriptSourceFiles( directoryPath ) { + const sourceFileNames = globSync( '**/*.{ts,tsx,mts,cts}', { + cwd: directoryPath, + ignore: [ '**/*.d.ts', '**/*.d.mts', '**/*.d.cts' ] + } ); + + return sourceFileNames.map( file => path.join( directoryPath, file ) ); +} + +function getDeclarationFileName( sourceFileName ) { + const { dir, name, ext } = path.parse( sourceFileName ); + + return path.join( dir, `${ name }.d${ ext }` ); +} + +export function declarationFilesPlugin() { + const sourceDirectoryPath = path.join( process.cwd(), 'src' ); + + return { + name: 'emit-declaration-files', + + async generateBundle() { + const sourceFilePaths = getTypeScriptSourceFiles( sourceDirectoryPath ); + + await Promise.all( sourceFilePaths.map( async sourceFilePath => { + const filename = path.relative( sourceDirectoryPath, sourceFilePath ); + const source = readFileSync( sourceFilePath, 'utf8' ); + const { errors, code } = await isolatedDeclaration( filename, source, { + sourcemap: false, + stripInternal: true + } ); + + if ( errors.length ) { + const errorMessage = errors + .map( error => [ error.message, error.codeframe ].filter( Boolean ).join( '\n' ) ) + .join( '\n\n' ); + + this.error( `Could not generate a declaration file for "${ filename }".\n${ errorMessage }` ); + } + + this.emitFile( { + type: 'asset', + fileName: getDeclarationFileName( filename ), + source: code + } ); + } ) ); + } + }; +} diff --git a/tsconfig.json b/tsconfig.json index 7d49f7d30..a77a4714d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,28 @@ { "compilerOptions": { + // https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping "target": "ES2022", - "lib": [ - "ES2022" - ], + "lib": [ "ES2022" ], + "types": [ "node", "vitest/globals" ], "moduleDetection": "force", "module": "ESNext", "moduleResolution": "bundler", "declaration": true, "isolatedModules": true, + "isolatedDeclarations": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "noUncheckedIndexedAccess": true, - "skipLibCheck": true - } + "skipLibCheck": true, + "noEmit": true, + "noImplicitAny": true, + "noImplicitOverride": true + }, + "include": [ + "packages/**/*.ts" + ], + "exclude": [ + "**/fixtures" + ] } From 8c4b41f08b597ffceaf58eee50e4b8d005107c52 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 19 Feb 2026 09:45:23 +0100 Subject: [PATCH 02/11] Fix failing CI. --- .../fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/event-inheritance-fixer/index.ts | 4 ++-- .../event-param-fixer/fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/event-param-fixer/index.ts | 4 ++-- .../fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../interface-augmentation-fixer/index.ts | 2 +- .../tests/module-fixer/fixtures/tsconfig.json | 3 --- .../module-fixer/fixtures/tsconfig.test.json | 3 +++ .../tests/module-fixer/index.ts | 2 +- .../fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/purge-private-api-docs/index.ts | 2 +- .../reference-fixer/fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/reference-fixer/index.ts | 2 +- .../fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../restore-program-after-conversion/index.ts | 2 +- .../tests/symbol-fixer/fixtures/tsconfig.json | 3 --- .../symbol-fixer/fixtures/tsconfig.test.json | 3 +++ .../tests/symbol-fixer/index.ts | 2 +- .../tests/tag-error/fixtures/tsconfig.json | 3 --- .../tag-error/fixtures/tsconfig.test.json | 3 +++ .../typedoc-plugins/tests/tag-error/index.ts | 2 +- .../tests/tag-event/fixtures/tsconfig.json | 3 --- .../tag-event/fixtures/tsconfig.test.json | 3 +++ .../typedoc-plugins/tests/tag-event/index.ts | 2 +- .../tag-observable/fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/tag-observable/index.ts | 2 +- packages/typedoc-plugins/tests/tsconfig.json | 6 ------ .../typedoc-plugins/tests/tsconfig.test.json | 19 +++++++++++++++++++ .../fires-validator/fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/validators/fires-validator/index.ts | 2 +- .../link-validator/fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../tests/validators/link-validator/index.ts | 2 +- .../fixtures/tsconfig.test.json | 3 +++ .../fixtures/tsconfig.json | 3 --- .../fixtures/tsconfig.test.json | 3 +++ .../validators/overloads-validator/index.ts | 2 +- .../see-validator/fixtures/tsconfig.json | 3 --- .../see-validator/fixtures/tsconfig.test.json | 3 +++ .../tests/validators/see-validator/index.ts | 2 +- 48 files changed, 84 insertions(+), 68 deletions(-) delete mode 100644 packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.test.json create mode 100644 packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.test.json delete mode 100644 packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.json create mode 100644 packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.test.json diff --git a/packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/event-inheritance-fixer/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts b/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts index 818cffc42..dec8f5010 100644 --- a/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts +++ b/packages/typedoc-plugins/tests/event-inheritance-fixer/index.ts @@ -37,7 +37,7 @@ describe( 'typedoc-plugins/event-inheritance-fixer', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] @@ -360,7 +360,7 @@ describe( 'typedoc-plugins/event-inheritance-fixer', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] diff --git a/packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/event-param-fixer/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/event-param-fixer/index.ts b/packages/typedoc-plugins/tests/event-param-fixer/index.ts index 041be9936..e3e07f166 100644 --- a/packages/typedoc-plugins/tests/event-param-fixer/index.ts +++ b/packages/typedoc-plugins/tests/event-param-fixer/index.ts @@ -52,7 +52,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Warn', entryPoints, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] @@ -88,7 +88,7 @@ describe( 'typedoc-plugins/event-param-fixer', () => { logLevel: 'Warn', // Do not process the "EventInfo" class. entryPoints: entryPoints.filter( file => !file.endsWith( 'eventinfo.ts' ) ), - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] diff --git a/packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/interface-augmentation-fixer/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/interface-augmentation-fixer/index.ts b/packages/typedoc-plugins/tests/interface-augmentation-fixer/index.ts index 898c49eb0..2272e5679 100644 --- a/packages/typedoc-plugins/tests/interface-augmentation-fixer/index.ts +++ b/packages/typedoc-plugins/tests/interface-augmentation-fixer/index.ts @@ -30,7 +30,7 @@ describe( 'typedoc-plugins/interface-augmentation-fixer', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] diff --git a/packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/module-fixer/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/module-fixer/index.ts b/packages/typedoc-plugins/tests/module-fixer/index.ts index e6bdc5845..363229fcb 100644 --- a/packages/typedoc-plugins/tests/module-fixer/index.ts +++ b/packages/typedoc-plugins/tests/module-fixer/index.ts @@ -25,7 +25,7 @@ describe( 'typedoc-plugins/module-fixer', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ) + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ) } ); typeDocModuleFixer( typeDoc ); diff --git a/packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/purge-private-api-docs/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts b/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts index bfc5a26ac..fd1b32c96 100644 --- a/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts +++ b/packages/typedoc-plugins/tests/purge-private-api-docs/index.ts @@ -55,7 +55,7 @@ describe( 'typedoc-plugins/purge-private-api-docs', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ], diff --git a/packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/reference-fixer/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/reference-fixer/index.ts b/packages/typedoc-plugins/tests/reference-fixer/index.ts index 3deeb4ef6..fcc3a18ca 100644 --- a/packages/typedoc-plugins/tests/reference-fixer/index.ts +++ b/packages/typedoc-plugins/tests/reference-fixer/index.ts @@ -30,7 +30,7 @@ describe( 'typedoc-plugins/reference-fixer', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] diff --git a/packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/restore-program-after-conversion/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts b/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts index 087f68468..b7bf17a9f 100644 --- a/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts +++ b/packages/typedoc-plugins/tests/restore-program-after-conversion/index.ts @@ -30,7 +30,7 @@ describe( 'typedoc-plugins/restore-program-after-conversion', () => { const app = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints, - tsconfig: upath.join( fixturesPath, 'tsconfig.json' ), + tsconfig: upath.join( fixturesPath, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] diff --git a/packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/symbol-fixer/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/symbol-fixer/index.ts b/packages/typedoc-plugins/tests/symbol-fixer/index.ts index faf115977..34d0955c5 100644 --- a/packages/typedoc-plugins/tests/symbol-fixer/index.ts +++ b/packages/typedoc-plugins/tests/symbol-fixer/index.ts @@ -28,7 +28,7 @@ describe( 'typedoc-plugins/symbol-fixer', () => { typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ) + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ) } ); warnSpy = vi.spyOn( typeDoc.logger, 'warn' ); diff --git a/packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/tag-error/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/tag-error/index.ts b/packages/typedoc-plugins/tests/tag-error/index.ts index 368966c5f..160dab45c 100644 --- a/packages/typedoc-plugins/tests/tag-error/index.ts +++ b/packages/typedoc-plugins/tests/tag-error/index.ts @@ -34,7 +34,7 @@ describe( 'typedoc-plugins/tag-error', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Warn', entryPoints: files, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), blockTags: [ ...OptionDefaults.blockTags, '@eventName', diff --git a/packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/tag-event/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/tag-event/index.ts b/packages/typedoc-plugins/tests/tag-event/index.ts index 6f0a19283..da1edcaa8 100644 --- a/packages/typedoc-plugins/tests/tag-event/index.ts +++ b/packages/typedoc-plugins/tests/tag-event/index.ts @@ -42,7 +42,7 @@ describe( 'typedoc-plugins/tag-event', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ] diff --git a/packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.json deleted file mode 100644 index 4082f16a5..000000000 --- a/packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.test.json new file mode 100644 index 000000000..367816452 --- /dev/null +++ b/packages/typedoc-plugins/tests/tag-observable/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/tag-observable/index.ts b/packages/typedoc-plugins/tests/tag-observable/index.ts index fd75ac3f9..c300722da 100644 --- a/packages/typedoc-plugins/tests/tag-observable/index.ts +++ b/packages/typedoc-plugins/tests/tag-observable/index.ts @@ -46,7 +46,7 @@ describe( 'typedoc-plugins/tag-observable', () => { const typeDoc = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.json' ), + tsconfig: upath.join( FIXTURES_PATH, 'tsconfig.test.json' ), plugin: [ 'typedoc-plugin-rename-defaults' ], diff --git a/packages/typedoc-plugins/tests/tsconfig.json b/packages/typedoc-plugins/tests/tsconfig.json deleted file mode 100644 index 5e5973954..000000000 --- a/packages/typedoc-plugins/tests/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "compilerOptions": { - "allowJs": true - } -} diff --git a/packages/typedoc-plugins/tests/tsconfig.test.json b/packages/typedoc-plugins/tests/tsconfig.test.json new file mode 100644 index 000000000..b9646ecf9 --- /dev/null +++ b/packages/typedoc-plugins/tests/tsconfig.test.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], + "noImplicitAny": true, + "noImplicitOverride": true, + "strict": true, + "module": "es6", + "target": "es2020", + "sourceMap": true, + "allowJs": true, + "moduleResolution": "node", + "esModuleInterop": true, + "skipLibCheck": true + } +} diff --git a/packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.test.json new file mode 100644 index 000000000..105334e22 --- /dev/null +++ b/packages/typedoc-plugins/tests/validators/fires-validator/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/validators/fires-validator/index.ts b/packages/typedoc-plugins/tests/validators/fires-validator/index.ts index 936b995cd..c0ebdcf1a 100644 --- a/packages/typedoc-plugins/tests/validators/fires-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/fires-validator/index.ts @@ -37,7 +37,7 @@ describe( 'typedoc-plugins/validators/fires-validator', () => { const app = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( fixturesPath, 'tsconfig.json' ) + tsconfig: upath.join( fixturesPath, 'tsconfig.test.json' ) } ); onError = vi.fn(); diff --git a/packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.test.json new file mode 100644 index 000000000..105334e22 --- /dev/null +++ b/packages/typedoc-plugins/tests/validators/link-validator/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/validators/link-validator/index.ts b/packages/typedoc-plugins/tests/validators/link-validator/index.ts index e5d940978..4866ce5e5 100644 --- a/packages/typedoc-plugins/tests/validators/link-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/link-validator/index.ts @@ -38,7 +38,7 @@ describe( 'typedoc-plugins/validators/link-validator', () => { const app = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( fixturesPath, 'tsconfig.json' ) + tsconfig: upath.join( fixturesPath, 'tsconfig.test.json' ) } ); onError = vi.fn(); diff --git a/packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json new file mode 100644 index 000000000..105334e22 --- /dev/null +++ b/packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.test.json new file mode 100644 index 000000000..105334e22 --- /dev/null +++ b/packages/typedoc-plugins/tests/validators/overloads-validator/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts b/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts index e1fc44084..44b7ececa 100644 --- a/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/overloads-validator/index.ts @@ -37,7 +37,7 @@ describe( 'typedoc-plugins/validators/overloads-validator', () => { const app = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( fixturesPath, 'tsconfig.json' ) + tsconfig: upath.join( fixturesPath, 'tsconfig.test.json' ) } ); onError = vi.fn(); diff --git a/packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.json b/packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.json deleted file mode 100644 index 618c6c3e9..000000000 --- a/packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.json" -} diff --git a/packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.test.json new file mode 100644 index 000000000..105334e22 --- /dev/null +++ b/packages/typedoc-plugins/tests/validators/see-validator/fixtures/tsconfig.test.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.test.json" +} diff --git a/packages/typedoc-plugins/tests/validators/see-validator/index.ts b/packages/typedoc-plugins/tests/validators/see-validator/index.ts index 03c0c087a..5f1a7924e 100644 --- a/packages/typedoc-plugins/tests/validators/see-validator/index.ts +++ b/packages/typedoc-plugins/tests/validators/see-validator/index.ts @@ -37,7 +37,7 @@ describe( 'typedoc-plugins/validators/see-validator', () => { const app = await Application.bootstrapWithPlugins( { logLevel: 'Error', entryPoints: files, - tsconfig: upath.join( fixturesPath, 'tsconfig.json' ) + tsconfig: upath.join( fixturesPath, 'tsconfig.test.json' ) } ); onError = vi.fn(); From 2ac6174b3e9697dd3ef6477160bc010a2a44037e Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 19 Feb 2026 10:01:35 +0100 Subject: [PATCH 03/11] Address review feedback. --- packages/typedoc-plugins/rolldown.config.js | 1 + scripts/plugin-declarations.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/typedoc-plugins/rolldown.config.js b/packages/typedoc-plugins/rolldown.config.js index 40cb25c71..5c70b6606 100644 --- a/packages/typedoc-plugins/rolldown.config.js +++ b/packages/typedoc-plugins/rolldown.config.js @@ -16,6 +16,7 @@ export default defineConfig( { input: 'src/index.ts', platform: 'node', output: { + cleanDir: true, format: 'esm', dir: 'dist', assetFileNames: '[name][extname]' diff --git a/scripts/plugin-declarations.js b/scripts/plugin-declarations.js index 904d9481c..5208c6c7b 100644 --- a/scripts/plugin-declarations.js +++ b/scripts/plugin-declarations.js @@ -7,6 +7,8 @@ import { readFileSync, globSync } from 'node:fs'; import { isolatedDeclaration } from 'oxc-transform'; import path from 'upath'; +const declarationExtensions = new Set( [ '.mts', '.cts' ] ); + function getTypeScriptSourceFiles( directoryPath ) { const sourceFileNames = globSync( '**/*.{ts,tsx,mts,cts}', { cwd: directoryPath, @@ -18,8 +20,9 @@ function getTypeScriptSourceFiles( directoryPath ) { function getDeclarationFileName( sourceFileName ) { const { dir, name, ext } = path.parse( sourceFileName ); + const declarationExtension = declarationExtensions.has( ext ) ? ext : '.ts'; - return path.join( dir, `${ name }.d${ ext }` ); + return path.join( dir, `${ name }.d${ declarationExtension }` ); } export function declarationFilesPlugin() { From 3e705096717065eb82a7c9c5409e226f2e37aeb7 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 19 Feb 2026 10:34:03 +0100 Subject: [PATCH 04/11] Add tests for `plugin-declarations.js`. --- scripts-tests/plugin-declarations.mjs | 125 ++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 scripts-tests/plugin-declarations.mjs diff --git a/scripts-tests/plugin-declarations.mjs b/scripts-tests/plugin-declarations.mjs new file mode 100644 index 000000000..78fe04382 --- /dev/null +++ b/scripts-tests/plugin-declarations.mjs @@ -0,0 +1,125 @@ +/** + * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved. + * For licensing, see LICENSE.md. + */ + +import { beforeEach, describe, expect, it, vi } from 'vitest'; +import { globSync, readFileSync } from 'node:fs'; +import { isolatedDeclaration } from 'oxc-transform'; +import { declarationFilesPlugin } from '../scripts/plugin-declarations.js'; + +vi.mock( 'node:fs', () => ( { + globSync: vi.fn(), + readFileSync: vi.fn() +} ) ); + +vi.mock( 'oxc-transform', () => ( { + isolatedDeclaration: vi.fn() +} ) ); + +describe( 'scripts/plugin-declarations', () => { + beforeEach( () => { + vi.spyOn( process, 'cwd' ).mockReturnValue( '/workspace/package' ); + } ); + + it( 'creates declaration assets for TypeScript source files', async () => { + vi.mocked( globSync ).mockReturnValue( [ + 'foo.ts', + 'nested/bar.tsx', + 'module.mts', + 'legacy.cts' + ] ); + + vi.mocked( readFileSync ).mockImplementation( sourceFilePath => `source:${ sourceFilePath }` ); + vi.mocked( isolatedDeclaration ).mockImplementation( async filename => ( { + errors: [], + code: `declaration:${ filename }` + } ) ); + + const plugin = declarationFilesPlugin(); + const emitFile = vi.fn(); + const error = vi.fn(); + + await plugin.generateBundle.call( { emitFile, error } ); + + expect( globSync ).toHaveBeenCalledWith( '**/*.{ts,tsx,mts,cts}', { + cwd: '/workspace/package/src', + ignore: [ '**/*.d.ts', '**/*.d.mts', '**/*.d.cts' ] + } ); + + expect( readFileSync ).toHaveBeenNthCalledWith( 1, '/workspace/package/src/foo.ts', 'utf8' ); + expect( readFileSync ).toHaveBeenNthCalledWith( 2, '/workspace/package/src/nested/bar.tsx', 'utf8' ); + expect( readFileSync ).toHaveBeenNthCalledWith( 3, '/workspace/package/src/module.mts', 'utf8' ); + expect( readFileSync ).toHaveBeenNthCalledWith( 4, '/workspace/package/src/legacy.cts', 'utf8' ); + + expect( isolatedDeclaration ).toHaveBeenNthCalledWith( 1, 'foo.ts', 'source:/workspace/package/src/foo.ts', { + sourcemap: false, + stripInternal: true + } ); + + expect( isolatedDeclaration ).toHaveBeenNthCalledWith( 2, 'nested/bar.tsx', 'source:/workspace/package/src/nested/bar.tsx', { + sourcemap: false, + stripInternal: true + } ); + + expect( isolatedDeclaration ).toHaveBeenNthCalledWith( 3, 'module.mts', 'source:/workspace/package/src/module.mts', { + sourcemap: false, + stripInternal: true + } ); + + expect( isolatedDeclaration ).toHaveBeenNthCalledWith( 4, 'legacy.cts', 'source:/workspace/package/src/legacy.cts', { + sourcemap: false, + stripInternal: true + } ); + + expect( emitFile ).toHaveBeenNthCalledWith( 1, { + type: 'asset', + fileName: 'foo.d.ts', + source: 'declaration:foo.ts' + } ); + + expect( emitFile ).toHaveBeenNthCalledWith( 2, { + type: 'asset', + fileName: 'nested/bar.d.ts', + source: 'declaration:nested/bar.tsx' + } ); + + expect( emitFile ).toHaveBeenNthCalledWith( 3, { + type: 'asset', + fileName: 'module.d.mts', + source: 'declaration:module.mts' + } ); + + expect( emitFile ).toHaveBeenNthCalledWith( 4, { + type: 'asset', + fileName: 'legacy.d.cts', + source: 'declaration:legacy.cts' + } ); + + expect( error ).not.toHaveBeenCalled(); + } ); + + it( 'throws an error when declaration generation reports problems', async () => { + vi.mocked( globSync ).mockReturnValue( [ 'broken.ts' ] ); + vi.mocked( readFileSync ).mockReturnValue( 'export const broken = true;' ); + vi.mocked( isolatedDeclaration ).mockResolvedValue( { + errors: [ + { message: 'Broken declaration', codeframe: 'line 1' }, + { message: 'Another issue' } + ], + code: '' + } ); + + const plugin = declarationFilesPlugin(); + const emitFile = vi.fn(); + const error = vi.fn( message => { + throw new Error( message ); + } ); + + await expect( plugin.generateBundle.call( { emitFile, error } ) ).rejects.toThrow( + 'Could not generate a declaration file for "broken.ts".\nBroken declaration\nline 1\n\nAnother issue' + ); + + expect( emitFile ).not.toHaveBeenCalled(); + } ); +} ); From 805bfa6fca48b8f5e919c46735584bbdefb5ff74 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 19 Feb 2026 10:34:38 +0100 Subject: [PATCH 05/11] Remove unnecessary `types` command. --- packages/ckeditor5-dev-utils/package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ckeditor5-dev-utils/package.json b/packages/ckeditor5-dev-utils/package.json index 1aaeeb093..c736e378b 100644 --- a/packages/ckeditor5-dev-utils/package.json +++ b/packages/ckeditor5-dev-utils/package.json @@ -54,8 +54,7 @@ "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": [ "css-loader", From 115a8134adf0b971be85e5626df5dc39974d28dd Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Thu, 19 Feb 2026 10:51:17 +0100 Subject: [PATCH 06/11] Use `exclude` instead of `ignore` in `globSync` (as required by native glob available in Node). --- scripts-tests/plugin-declarations.mjs | 2 +- scripts/plugin-declarations.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts-tests/plugin-declarations.mjs b/scripts-tests/plugin-declarations.mjs index 78fe04382..54ef1697c 100644 --- a/scripts-tests/plugin-declarations.mjs +++ b/scripts-tests/plugin-declarations.mjs @@ -44,7 +44,7 @@ describe( 'scripts/plugin-declarations', () => { expect( globSync ).toHaveBeenCalledWith( '**/*.{ts,tsx,mts,cts}', { cwd: '/workspace/package/src', - ignore: [ '**/*.d.ts', '**/*.d.mts', '**/*.d.cts' ] + exclude: [ '**/*.d.ts', '**/*.d.mts', '**/*.d.cts' ] } ); expect( readFileSync ).toHaveBeenNthCalledWith( 1, '/workspace/package/src/foo.ts', 'utf8' ); diff --git a/scripts/plugin-declarations.js b/scripts/plugin-declarations.js index 5208c6c7b..585d29a7a 100644 --- a/scripts/plugin-declarations.js +++ b/scripts/plugin-declarations.js @@ -12,7 +12,7 @@ const declarationExtensions = new Set( [ '.mts', '.cts' ] ); function getTypeScriptSourceFiles( directoryPath ) { const sourceFileNames = globSync( '**/*.{ts,tsx,mts,cts}', { cwd: directoryPath, - ignore: [ '**/*.d.ts', '**/*.d.mts', '**/*.d.cts' ] + exclude: [ '**/*.d.ts', '**/*.d.mts', '**/*.d.cts' ] } ); return sourceFileNames.map( file => path.join( directoryPath, file ) ); From dd07c999500ac13099c60ca561736cdef51422f3 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Mon, 11 May 2026 08:49:40 +0200 Subject: [PATCH 07/11] Update Rolldown to `v1.0.0`. --- packages/ckeditor5-dev-build-tools/package.json | 2 +- pnpm-lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ckeditor5-dev-build-tools/package.json b/packages/ckeditor5-dev-build-tools/package.json index 28c25591b..a9b1221f6 100644 --- a/packages/ckeditor5-dev-build-tools/package.json +++ b/packages/ckeditor5-dev-build-tools/package.json @@ -54,7 +54,7 @@ "@types/node": "^22.19.17", "@types/postcss-mixins": "^9.0.5", "@vitest/coverage-v8": "^4.1.2", - "rolldown": "^1.0.0-rc.4", + "rolldown": "^1.0.0", "type-fest": "^4.41.0", "vitest": "^4.1.2" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 07ed47d27..69fa14b03 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -156,7 +156,7 @@ importers: specifier: ^4.1.2 version: 4.1.2(vitest@4.1.2(@types/node@22.19.17)(vite@7.3.2(@types/node@22.19.17)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) rolldown: - specifier: ^1.0.0-rc.4 + specifier: ^1.0.0 version: 1.0.0 type-fest: specifier: ^4.41.0 From 096c27b22ed76f78df36172941198dc0aef4fc2b Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Mon, 11 May 2026 10:00:36 +0200 Subject: [PATCH 08/11] Minor adjustments after rebasing to the latest `master` branch. --- packages/ckeditor5-dev-build-tools/package.json | 1 - .../module-validator/fixtures/tsconfig.test.json | 3 --- pnpm-lock.yaml | 10 ---------- 3 files changed, 14 deletions(-) delete mode 100644 packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json diff --git a/packages/ckeditor5-dev-build-tools/package.json b/packages/ckeditor5-dev-build-tools/package.json index a9b1221f6..909c8397a 100644 --- a/packages/ckeditor5-dev-build-tools/package.json +++ b/packages/ckeditor5-dev-build-tools/package.json @@ -52,7 +52,6 @@ "devDependencies": { "@types/css": "^0.0.38", "@types/node": "^22.19.17", - "@types/postcss-mixins": "^9.0.5", "@vitest/coverage-v8": "^4.1.2", "rolldown": "^1.0.0", "type-fest": "^4.41.0", diff --git a/packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json b/packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json deleted file mode 100644 index 105334e22..000000000 --- a/packages/typedoc-plugins/tests/validators/module-validator/fixtures/tsconfig.test.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.test.json" -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 69fa14b03..7fe5428fa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -149,9 +149,6 @@ importers: '@types/node': specifier: ^22.19.17 version: 22.19.17 - '@types/postcss-mixins': - specifier: ^9.0.5 - version: 9.0.6 '@vitest/coverage-v8': specifier: ^4.1.2 version: 4.1.2(vitest@4.1.2(@types/node@22.19.17)(vite@7.3.2(@types/node@22.19.17)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) @@ -2111,9 +2108,6 @@ packages: '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} - '@types/postcss-mixins@9.0.6': - resolution: {integrity: sha512-AyFHDblvvsiyHyjZQYgFSX/mPKnfKflOQD4Xm20qynAicmUX7sXp1cs4wa3rlcvO8ORE4OlkWML3aFgqWbxarA==} - '@types/resolve@1.20.2': resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} @@ -7146,10 +7140,6 @@ snapshots: '@types/parse-json@4.0.2': {} - '@types/postcss-mixins@9.0.6': - dependencies: - postcss: 8.5.10 - '@types/resolve@1.20.2': {} '@types/semver@7.7.1': {} From 204579254a9b31878dac212b2bf1928c2bbdd970 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Mon, 11 May 2026 10:20:33 +0200 Subject: [PATCH 09/11] Fix TypeScript errors. --- .../src/advanced-messages.ts | 0 .../ckeditor5-method-calls/src/messages.ts | 0 .../fallback-package/src/messages.ts | 0 .../invalid-tsconfig/tsconfig.json | 0 .../missing-locale-translate/src/messages.ts | 0 .../missing-locale-translate/tsconfig.json | 0 .../types/ckeditor5-utils/index.d.ts | 0 .../getsourcemessages/tsconfig.json | 0 .../types/ckeditor5-utils/index.d.ts | 0 .../utils/gettypescriptmessages-mocked.js | 2 +- .../tests/utils/gettypescriptmessages.js | 2 +- .../src/constants.ts | 19 +++++++++--------- .../src/page/page-events.ts | 20 +++++++++---------- 13 files changed, 22 insertions(+), 21 deletions(-) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/ckeditor5-method-calls/src/advanced-messages.ts (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/ckeditor5-method-calls/src/messages.ts (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/fallback-package/src/messages.ts (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/invalid-tsconfig/tsconfig.json (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/missing-locale-translate/src/messages.ts (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/missing-locale-translate/tsconfig.json (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/missing-locale-translate/types/ckeditor5-utils/index.d.ts (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/tsconfig.json (100%) rename packages/ckeditor5-dev-translations/tests/{_fixtures => fixtures}/getsourcemessages/types/ckeditor5-utils/index.d.ts (100%) diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/ckeditor5-method-calls/src/advanced-messages.ts b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/ckeditor5-method-calls/src/advanced-messages.ts similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/ckeditor5-method-calls/src/advanced-messages.ts rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/ckeditor5-method-calls/src/advanced-messages.ts diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/ckeditor5-method-calls/src/messages.ts b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/ckeditor5-method-calls/src/messages.ts similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/ckeditor5-method-calls/src/messages.ts rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/ckeditor5-method-calls/src/messages.ts diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/fallback-package/src/messages.ts b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/fallback-package/src/messages.ts similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/fallback-package/src/messages.ts rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/fallback-package/src/messages.ts diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/invalid-tsconfig/tsconfig.json b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/invalid-tsconfig/tsconfig.json similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/invalid-tsconfig/tsconfig.json rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/invalid-tsconfig/tsconfig.json diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/missing-locale-translate/src/messages.ts b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/missing-locale-translate/src/messages.ts similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/missing-locale-translate/src/messages.ts rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/missing-locale-translate/src/messages.ts diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/missing-locale-translate/tsconfig.json b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/missing-locale-translate/tsconfig.json similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/missing-locale-translate/tsconfig.json rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/missing-locale-translate/tsconfig.json diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/missing-locale-translate/types/ckeditor5-utils/index.d.ts b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/missing-locale-translate/types/ckeditor5-utils/index.d.ts similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/missing-locale-translate/types/ckeditor5-utils/index.d.ts rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/missing-locale-translate/types/ckeditor5-utils/index.d.ts diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/tsconfig.json b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/tsconfig.json similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/tsconfig.json rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/tsconfig.json diff --git a/packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/types/ckeditor5-utils/index.d.ts b/packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/types/ckeditor5-utils/index.d.ts similarity index 100% rename from packages/ckeditor5-dev-translations/tests/_fixtures/getsourcemessages/types/ckeditor5-utils/index.d.ts rename to packages/ckeditor5-dev-translations/tests/fixtures/getsourcemessages/types/ckeditor5-utils/index.d.ts diff --git a/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages-mocked.js b/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages-mocked.js index f38b91525..e4707b0d5 100644 --- a/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages-mocked.js +++ b/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages-mocked.js @@ -26,7 +26,7 @@ describe( 'getTypeScriptMessages() module resolution failures', () => { }; } ); - const fixturesPath = upath.join( import.meta.dirname, '..', '_fixtures', 'getsourcemessages' ); + const fixturesPath = upath.join( import.meta.dirname, '..', 'fixtures', 'getsourcemessages' ); const sourceFilePath = upath.join( fixturesPath, 'ckeditor5-method-calls', 'src', 'messages.ts' ); const { default: getTypeScriptMessages } = await import( '../../lib/utils/gettypescriptmessages.js' ); diff --git a/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages.js b/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages.js index 3ba1b5c91..5f517a639 100644 --- a/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages.js +++ b/packages/ckeditor5-dev-translations/tests/utils/gettypescriptmessages.js @@ -8,7 +8,7 @@ import upath from 'upath'; import getTypeScriptMessages from '../../lib/utils/gettypescriptmessages.js'; describe( 'getTypeScriptMessages()', () => { - const fixturesPath = upath.join( import.meta.dirname, '..', '_fixtures', 'getsourcemessages' ); + const fixturesPath = upath.join( import.meta.dirname, '..', 'fixtures', 'getsourcemessages' ); const packagePath = upath.join( fixturesPath, 'ckeditor5-method-calls' ); const sourceFilePath = upath.join( packagePath, 'src', 'messages.ts' ); const advancedSourceFilePath = upath.join( packagePath, 'src', 'advanced-messages.ts' ); diff --git a/packages/ckeditor5-dev-web-crawler/src/constants.ts b/packages/ckeditor5-dev-web-crawler/src/constants.ts index b01e08f88..45dcb1a7a 100644 --- a/packages/ckeditor5-dev-web-crawler/src/constants.ts +++ b/packages/ckeditor5-dev-web-crawler/src/constants.ts @@ -6,13 +6,14 @@ */ import { cpus } from 'node:os'; +import type { PageEvents } from 'puppeteer'; -export interface ErrorType { +export interface ErrorType { /** * The event name emitted by Puppeteer. */ - event?: string; + event?: TEvent; /** * Human-readable description of the error. @@ -20,16 +21,16 @@ export interface ErrorType { description: string; } -interface EventErrorType extends ErrorType { - event: string; +interface EventErrorType extends ErrorType { + event: TEvent; } interface ErrorTypes { - PAGE_CRASH: EventErrorType; - UNCAUGHT_EXCEPTION: EventErrorType; - REQUEST_FAILURE: EventErrorType; - RESPONSE_FAILURE: EventErrorType; - CONSOLE_ERROR: EventErrorType; + PAGE_CRASH: EventErrorType<'error'>; + UNCAUGHT_EXCEPTION: EventErrorType<'pageerror'>; + REQUEST_FAILURE: EventErrorType<'requestfailed'>; + RESPONSE_FAILURE: EventErrorType<'response'>; + CONSOLE_ERROR: EventErrorType<'console'>; NAVIGATION_ERROR: ErrorType; } diff --git a/packages/ckeditor5-dev-web-crawler/src/page/page-events.ts b/packages/ckeditor5-dev-web-crawler/src/page/page-events.ts index afeef3226..620d0e843 100644 --- a/packages/ckeditor5-dev-web-crawler/src/page/page-events.ts +++ b/packages/ckeditor5-dev-web-crawler/src/page/page-events.ts @@ -74,20 +74,20 @@ export function attachPageEventHandlers( { page, data, pageErrors }: PageEventHa page.on( 'request', onRequest ); page.on( 'dialog', onDialog ); - page.on( ERROR_TYPES.PAGE_CRASH.event!, onPageCrash ); - page.on( ERROR_TYPES.UNCAUGHT_EXCEPTION.event!, onUncaughtException ); - page.on( ERROR_TYPES.REQUEST_FAILURE.event!, onRequestFailure ); - page.on( ERROR_TYPES.RESPONSE_FAILURE.event!, onResponseFailure ); - page.on( ERROR_TYPES.CONSOLE_ERROR.event!, onConsoleError ); + page.on( ERROR_TYPES.PAGE_CRASH.event, onPageCrash ); + page.on( ERROR_TYPES.UNCAUGHT_EXCEPTION.event, onUncaughtException ); + page.on( ERROR_TYPES.REQUEST_FAILURE.event, onRequestFailure ); + page.on( ERROR_TYPES.RESPONSE_FAILURE.event, onResponseFailure ); + page.on( ERROR_TYPES.CONSOLE_ERROR.event, onConsoleError ); return () => { page.off( 'request', onRequest ); page.off( 'dialog', onDialog ); - page.off( ERROR_TYPES.PAGE_CRASH.event!, onPageCrash ); - page.off( ERROR_TYPES.UNCAUGHT_EXCEPTION.event!, onUncaughtException ); - page.off( ERROR_TYPES.REQUEST_FAILURE.event!, onRequestFailure ); - page.off( ERROR_TYPES.RESPONSE_FAILURE.event!, onResponseFailure ); - page.off( ERROR_TYPES.CONSOLE_ERROR.event!, onConsoleError ); + page.off( ERROR_TYPES.PAGE_CRASH.event, onPageCrash ); + page.off( ERROR_TYPES.UNCAUGHT_EXCEPTION.event, onUncaughtException ); + page.off( ERROR_TYPES.REQUEST_FAILURE.event, onRequestFailure ); + page.off( ERROR_TYPES.RESPONSE_FAILURE.event, onResponseFailure ); + page.off( ERROR_TYPES.CONSOLE_ERROR.event, onConsoleError ); }; } From deecee16960218f38a4c017f8fa97a05d5e99e3a Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Mon, 11 May 2026 10:41:49 +0200 Subject: [PATCH 10/11] Add missing dev dependencies. --- packages/ckeditor5-dev-web-crawler/package.json | 4 +++- pnpm-lock.yaml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/ckeditor5-dev-web-crawler/package.json b/packages/ckeditor5-dev-web-crawler/package.json index ee434e3e8..b39da274b 100644 --- a/packages/ckeditor5-dev-web-crawler/package.json +++ b/packages/ckeditor5-dev-web-crawler/package.json @@ -34,7 +34,9 @@ "puppeteer-cluster": "^0.24.0" }, "devDependencies": { + "@vitest/coverage-v8": "^4.1.2", "rolldown": "^1.0.0", - "upath": "^2.0.1" + "upath": "^2.0.1", + "vitest": "^4.1.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7fe5428fa..4cb84ac4d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -625,12 +625,18 @@ importers: specifier: ^0.24.0 version: 0.24.0(puppeteer@24.40.0(typescript@5.5.4)) devDependencies: + '@vitest/coverage-v8': + specifier: ^4.1.2 + version: 4.1.2(vitest@4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3))) rolldown: specifier: ^1.0.0 version: 1.0.0 upath: specifier: ^2.0.1 version: 2.0.1 + vitest: + specifier: ^4.1.2 + version: 4.1.2(@types/node@25.5.2)(vite@7.3.2(@types/node@25.5.2)(jiti@2.6.1)(lightningcss@1.32.0)(terser@5.46.1)(yaml@2.8.3)) packages/typedoc-plugins: dependencies: From 83792da749ef7d97af11158270beb9c5560f6255 Mon Sep 17 00:00:00 2001 From: Filip Sobol Date: Tue, 19 May 2026 15:47:18 +0200 Subject: [PATCH 11/11] Address declaration generation review comments. --- .../rolldown.config.js | 44 ++++++++++++------- scripts-tests/plugin-declarations.mjs | 26 +++++++---- scripts/plugin-declarations.js | 31 +++++++++---- 3 files changed, 69 insertions(+), 32 deletions(-) diff --git a/packages/ckeditor5-dev-changelog/rolldown.config.js b/packages/ckeditor5-dev-changelog/rolldown.config.js index d1c21fd87..dd01fcf22 100644 --- a/packages/ckeditor5-dev-changelog/rolldown.config.js +++ b/packages/ckeditor5-dev-changelog/rolldown.config.js @@ -12,20 +12,34 @@ const externals = [ ...Object.keys( pkg.peerDependencies || {} ) ]; -export default defineConfig( { - input: { - index: 'src/index.ts', - template: 'src/template.ts' - }, +const sharedConfig = defineConfig( { platform: 'node', - output: { - cleanDir: true, - format: 'esm', - dir: 'dist', - assetFileNames: '[name][extname]' - }, - external: id => externals.some( name => id.startsWith( name ) ), - plugins: [ - declarationFilesPlugin() - ] + external: id => externals.some( name => id.startsWith( name ) ) } ); + +export default defineConfig( [ + { + input: 'src/index.ts', + output: { + cleanDir: true, + format: 'esm', + dir: 'dist', + entryFileNames: 'index.js', + assetFileNames: '[name][extname]' + }, + plugins: [ + declarationFilesPlugin() + ], + ...sharedConfig + }, + { + input: 'src/template.ts', + output: { + format: 'esm', + dir: 'dist', + entryFileNames: 'template.js', + assetFileNames: '[name][extname]' + }, + ...sharedConfig + } +] ); diff --git a/scripts-tests/plugin-declarations.mjs b/scripts-tests/plugin-declarations.mjs index 54ef1697c..5f48a6a1b 100644 --- a/scripts-tests/plugin-declarations.mjs +++ b/scripts-tests/plugin-declarations.mjs @@ -100,15 +100,22 @@ describe( 'scripts/plugin-declarations', () => { } ); it( 'throws an error when declaration generation reports problems', async () => { - vi.mocked( globSync ).mockReturnValue( [ 'broken.ts' ] ); + vi.mocked( globSync ).mockReturnValue( [ 'broken.ts', 'another-broken.ts' ] ); vi.mocked( readFileSync ).mockReturnValue( 'export const broken = true;' ); - vi.mocked( isolatedDeclaration ).mockResolvedValue( { - errors: [ - { message: 'Broken declaration', codeframe: 'line 1' }, - { message: 'Another issue' } - ], - code: '' - } ); + vi.mocked( isolatedDeclaration ) + .mockResolvedValueOnce( { + errors: [ + { message: 'Broken declaration', codeframe: 'line 1' }, + { message: 'Another issue' } + ], + code: '' + } ) + .mockResolvedValueOnce( { + errors: [ + { message: 'Second broken declaration', codeframe: 'line 2' } + ], + code: '' + } ); const plugin = declarationFilesPlugin(); const emitFile = vi.fn(); @@ -117,7 +124,8 @@ describe( 'scripts/plugin-declarations', () => { } ); await expect( plugin.generateBundle.call( { emitFile, error } ) ).rejects.toThrow( - 'Could not generate a declaration file for "broken.ts".\nBroken declaration\nline 1\n\nAnother issue' + 'Could not generate a declaration file for "broken.ts".\nBroken declaration\nline 1\n\nAnother issue\n\n' + + 'Could not generate a declaration file for "another-broken.ts".\nSecond broken declaration\nline 2' ); expect( emitFile ).not.toHaveBeenCalled(); diff --git a/scripts/plugin-declarations.js b/scripts/plugin-declarations.js index 585d29a7a..225bde7e5 100644 --- a/scripts/plugin-declarations.js +++ b/scripts/plugin-declarations.js @@ -34,7 +34,7 @@ export function declarationFilesPlugin() { async generateBundle() { const sourceFilePaths = getTypeScriptSourceFiles( sourceDirectoryPath ); - await Promise.all( sourceFilePaths.map( async sourceFilePath => { + const declarationFiles = await Promise.all( sourceFilePaths.map( async sourceFilePath => { const filename = path.relative( sourceDirectoryPath, sourceFilePath ); const source = readFileSync( sourceFilePath, 'utf8' ); const { errors, code } = await isolatedDeclaration( filename, source, { @@ -42,20 +42,35 @@ export function declarationFilesPlugin() { stripInternal: true } ); - if ( errors.length ) { - const errorMessage = errors + return { + fileName: getDeclarationFileName( filename ), + filename, + errors, + source: code + }; + } ) ); + + const errorMessages = declarationFiles + .filter( declarationFile => declarationFile.errors.length ) + .map( declarationFile => { + const errors = declarationFile.errors .map( error => [ error.message, error.codeframe ].filter( Boolean ).join( '\n' ) ) .join( '\n\n' ); - this.error( `Could not generate a declaration file for "${ filename }".\n${ errorMessage }` ); - } + return `Could not generate a declaration file for "${ declarationFile.filename }".\n${ errors }`; + } ); + if ( errorMessages.length ) { + this.error( errorMessages.join( '\n\n' ) ); + } + + for ( const declarationFile of declarationFiles ) { this.emitFile( { type: 'asset', - fileName: getDeclarationFileName( filename ), - source: code + fileName: declarationFile.fileName, + source: declarationFile.source } ); - } ) ); + } } }; }