Skip to content

Commit af84547

Browse files
authored
Merge pull request #317 from ckeditor/remove-ckeditor5-premium-features-from-peer-dependencies
Fix: Improve ESM support by adding missing file extensions in imports. Other: Remove `ckeditor5-premium-features` from `peerDependencies`.
2 parents 2dadb48 + eb91b1b commit af84547

File tree

12 files changed

+54
-61
lines changed

12 files changed

+54
-61
lines changed

.eslintrc.cjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ module.exports = {
2424
' * For licensing, see LICENSE.md.',
2525
' */'
2626
] } ],
27+
'ckeditor5-rules/require-file-extensions-in-imports': [
28+
'error',
29+
{
30+
extensions: [ '.ts', '.js', '.json' ]
31+
}
32+
],
2733
'ckeditor5-rules/prevent-license-key-leak': 'error',
2834
'vue/multi-word-component-names': 'off',
2935
'no-unused-vars': 'off',

demos/editor-cdn/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
<script setup lang="ts">
4040
import { ref, reactive, computed } from 'vue';
41-
import useCKEditorCloud from '../../src/useCKEditorCloud';
41+
import useCKEditorCloud from '../../src/useCKEditorCloud.js';
4242
import type { EventInfo, ClassicEditor } from 'https://cdn.ckeditor.com/typings/ckeditor5.d.ts';
4343
4444
// Load CKEditor from the CDN

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@
3131
},
3232
"dependencies": {
3333
"lodash-es": "^4.17.21",
34-
"@ckeditor/ckeditor5-integrations-common": "^2.0.0"
34+
"@ckeditor/ckeditor5-integrations-common": "^2.1.0"
3535
},
3636
"peerDependencies": {
3737
"ckeditor5": ">=42.0.0 || ^0.0.0-nightly",
38-
"ckeditor5-premium-features": ">=42.0.0 || ^0.0.0-nightly",
3938
"vue": "^3.4.0"
4039
},
4140
"devDependencies": {
@@ -65,7 +64,7 @@
6564
"vitest": "^2.0.0",
6665
"vue": "^3.4.30",
6766
"vue-eslint-parser": "^9.1.0",
68-
"vue-tsc": "^2.0.22",
67+
"vue-tsc": "^2.1.6",
6968
"webdriverio": "^8.39.0"
7069
},
7170
"resolutions": {
@@ -79,7 +78,7 @@
7978
},
8079
"scripts": {
8180
"dev": "vite",
82-
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
81+
"build": "tsc --noEmit && vite build && vue-tsc --emitDeclarationOnly",
8382
"test": "vitest run --coverage",
8483
"test:watch": "vitest --ui --watch",
8584
"test:check:types": "tsc --noEmit -p ./tests/tsconfig.json",

src/plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export {
4242
* CDN related exports.
4343
*/
4444

45-
export { default as useCKEditorCloud } from './useCKEditorCloud';
45+
export { default as useCKEditorCloud } from './useCKEditorCloud.js';
4646

4747
export {
4848
loadCKEditorCloud,

src/shims-vue.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/**
2+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3+
* For licensing, see LICENSE.md.
4+
*/
5+
6+
declare module '*.vue';

src/useCKEditorCloud.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55

66
import { toValue, type MaybeRefOrGetter } from 'vue';
7-
import { useAsync, type AsyncComposableResult } from './composables/useAsync';
7+
import { useAsync, type AsyncComposableResult } from './composables/useAsync.js';
88

99
import {
1010
loadCKEditorCloud,

tests/ckeditor.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
import { nextTick } from 'vue';
77
import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
88
import { mount } from '@vue/test-utils';
9-
import { Ckeditor } from '../src/plugin';
9+
import { Ckeditor } from '../src/plugin.js';
1010
import {
1111
MockEditor,
1212
ModelDocument,
1313
ViewDocument
14-
} from './_utils/mockeditor';
14+
} from './_utils/mockeditor.js';
1515

1616
describe( 'CKEditor component', () => {
1717
beforeEach( () => {

tests/composables/useAsync.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { ref } from 'vue';
88
import { flushPromises } from '@vue/test-utils';
99

1010
import { createDefer } from '@ckeditor/ckeditor5-integrations-common';
11-
import { useAsync } from '../../src/composables/useAsync';
11+
import { useAsync } from '../../src/composables/useAsync.js';
1212

1313
describe( 'useAsync', () => {
1414
it( 'should call async function and return the result in data ref', async () => {

tests/plugin/localcomponent.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { nextTick } from 'vue';
77
import { describe, it, expect } from 'vitest';
88
import { mount } from '@vue/test-utils';
99
import { Ckeditor } from '../../src/plugin.js';
10-
import { MockEditor } from '../_utils/mockeditor';
10+
import { MockEditor } from '../_utils/mockeditor.js';
1111

1212
class FooEditor extends MockEditor {}
1313

tests/useCKEditorCloud.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { ref } from 'vue';
1010
import { removeAllCkCdnResources } from '@ckeditor/ckeditor5-integrations-common/test-utils';
1111
import type { CKEditorCloudConfig } from '@ckeditor/ckeditor5-integrations-common';
1212

13-
import useCKEditorCloud from '../src/useCKEditorCloud';
13+
import useCKEditorCloud from '../src/useCKEditorCloud.js';
1414

1515
describe( 'useCKEditorCloud', () => {
1616
beforeEach( removeAllCkCdnResources );

0 commit comments

Comments
 (0)