• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ckeditor / ckeditor5-dev / 01d40841-7b9c-47d8-9901-4f268c4917a9

02 Apr 2025 10:37AM UTC coverage: 88.054% (+0.01%) from 88.04%
01d40841-7b9c-47d8-9901-4f268c4917a9

push

circleci

web-flow
Merge pull request #1092 from ckeditor/ci/3992-prioritize-ts-over-js

Fix (build-tools): Prioritize `.ts` over `.js` files.

1721 of 1809 branches covered (95.14%)

Branch coverage included in aggregate %.

32 of 34 new or added lines in 2 files covered. (94.12%)

9675 of 11133 relevant lines covered (86.9%)

25.7 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.11
/packages/ckeditor5-dev-build-tools/src/plugins/loadSources.ts
1
/**
1✔
2
 * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md.
4
 */
5

6
import { accessSync } from 'fs';
7
import { resolve, dirname } from 'path';
8
import type { Plugin } from 'rollup';
9

10
export function loadTypeScriptSources(): Plugin {
1✔
11
        const cache: Record<string, string | null> = {};
42✔
12

13
        return {
42✔
14
                name: 'load-typescript-sources',
42✔
15

16
                resolveId( source: string, importer: string | undefined ) {
42✔
17
                        if ( !importer || !source.startsWith( '.' ) || !source.endsWith( '.js' ) ) {
238✔
18
                                return null;
209✔
19
                        }
209✔
20

21
                        const path = resolve(
29✔
22
                                dirname( importer ),
29✔
23
                                source.replace( /\.js$/, '.ts' )
29✔
24
                        );
29✔
25

26
                        if ( cache[ path ] ) {
238!
NEW
27
                                return cache[ path ];
×
NEW
28
                        }
✔
29

30
                        try {
29✔
31
                                accessSync( path );
29✔
32
                                cache[ path ] = path;
29✔
33

34
                                return path;
29✔
35
                        } catch {
30✔
36
                                cache[ path ] = null;
28✔
37

38
                                return null;
28✔
39
                        }
28✔
40
                }
238✔
41
        };
42✔
42
}
42✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc