Skip to content

Commit

Permalink
Merge pull request #317 from ckeditor/remove-ckeditor5-premium-featur…
Browse files Browse the repository at this point in the history
…es-from-peer-dependencies

Fix: Improve ESM support by adding missing file extensions in imports.

Other: Remove `ckeditor5-premium-features` from `peerDependencies`.
  • Loading branch information
filipsobol authored Sep 26, 2024
2 parents 2dadb48 + eb91b1b commit af84547
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 61 deletions.
6 changes: 6 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ module.exports = {
' * For licensing, see LICENSE.md.',
' */'
] } ],
'ckeditor5-rules/require-file-extensions-in-imports': [
'error',
{
extensions: [ '.ts', '.js', '.json' ]
}
],
'ckeditor5-rules/prevent-license-key-leak': 'error',
'vue/multi-word-component-names': 'off',
'no-unused-vars': 'off',
Expand Down
2 changes: 1 addition & 1 deletion demos/editor-cdn/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

<script setup lang="ts">
import { ref, reactive, computed } from 'vue';
import useCKEditorCloud from '../../src/useCKEditorCloud';
import useCKEditorCloud from '../../src/useCKEditorCloud.js';
import type { EventInfo, ClassicEditor } from 'https://cdn.ckeditor.com/typings/ckeditor5.d.ts';
// Load CKEditor from the CDN
Expand Down
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@
},
"dependencies": {
"lodash-es": "^4.17.21",
"@ckeditor/ckeditor5-integrations-common": "^2.0.0"
"@ckeditor/ckeditor5-integrations-common": "^2.1.0"
},
"peerDependencies": {
"ckeditor5": ">=42.0.0 || ^0.0.0-nightly",
"ckeditor5-premium-features": ">=42.0.0 || ^0.0.0-nightly",
"vue": "^3.4.0"
},
"devDependencies": {
Expand Down Expand Up @@ -65,7 +64,7 @@
"vitest": "^2.0.0",
"vue": "^3.4.30",
"vue-eslint-parser": "^9.1.0",
"vue-tsc": "^2.0.22",
"vue-tsc": "^2.1.6",
"webdriverio": "^8.39.0"
},
"resolutions": {
Expand All @@ -79,7 +78,7 @@
},
"scripts": {
"dev": "vite",
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly",
"build": "tsc --noEmit && vite build && vue-tsc --emitDeclarationOnly",
"test": "vitest run --coverage",
"test:watch": "vitest --ui --watch",
"test:check:types": "tsc --noEmit -p ./tests/tsconfig.json",
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export {
* CDN related exports.
*/

export { default as useCKEditorCloud } from './useCKEditorCloud';
export { default as useCKEditorCloud } from './useCKEditorCloud.js';

export {
loadCKEditorCloud,
Expand Down
6 changes: 6 additions & 0 deletions src/shims-vue.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
* For licensing, see LICENSE.md.
*/

declare module '*.vue';
2 changes: 1 addition & 1 deletion src/useCKEditorCloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { toValue, type MaybeRefOrGetter } from 'vue';
import { useAsync, type AsyncComposableResult } from './composables/useAsync';
import { useAsync, type AsyncComposableResult } from './composables/useAsync.js';

import {
loadCKEditorCloud,
Expand Down
4 changes: 2 additions & 2 deletions tests/ckeditor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import { nextTick } from 'vue';
import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest';
import { mount } from '@vue/test-utils';
import { Ckeditor } from '../src/plugin';
import { Ckeditor } from '../src/plugin.js';
import {
MockEditor,
ModelDocument,
ViewDocument
} from './_utils/mockeditor';
} from './_utils/mockeditor.js';

describe( 'CKEditor component', () => {
beforeEach( () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/composables/useAsync.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ref } from 'vue';
import { flushPromises } from '@vue/test-utils';

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

describe( 'useAsync', () => {
it( 'should call async function and return the result in data ref', async () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/plugin/localcomponent.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { nextTick } from 'vue';
import { describe, it, expect } from 'vitest';
import { mount } from '@vue/test-utils';
import { Ckeditor } from '../../src/plugin.js';
import { MockEditor } from '../_utils/mockeditor';
import { MockEditor } from '../_utils/mockeditor.js';

class FooEditor extends MockEditor {}

Expand Down
2 changes: 1 addition & 1 deletion tests/useCKEditorCloud.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ref } from 'vue';
import { removeAllCkCdnResources } from '@ckeditor/ckeditor5-integrations-common/test-utils';
import type { CKEditorCloudConfig } from '@ckeditor/ckeditor5-integrations-common';

import useCKEditorCloud from '../src/useCKEditorCloud';
import useCKEditorCloud from '../src/useCKEditorCloud.js';

describe( 'useCKEditorCloud', () => {
beforeEach( removeAllCkCdnResources );
Expand Down
2 changes: 0 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,

"emitDeclarationOnly": true,
"declaration": true,
"declarationDir": "./dist"
},
Expand Down
78 changes: 31 additions & 47 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1196,10 +1196,10 @@
"@ckeditor/ckeditor5-utils" "43.1.0"
ckeditor5 "43.1.0"

"@ckeditor/ckeditor5-integrations-common@^2.0.0":
version "2.0.0"
resolved "https://registry.yarnpkg.com/@ckeditor/ckeditor5-integrations-common/-/ckeditor5-integrations-common-2.0.0.tgz#09ea8a6a6a3c01f601260a85d9af98ede78644cf"
integrity sha512-Gkt7tYVv168voQZFdN4PxVp6M5/ZgzIOrqI6uPRjuk73dYjdLCeotnEXYejE6cxyLi9m2UM2mvhXibOIKVcoPw==
"@ckeditor/ckeditor5-integrations-common@^2.1.0":
version "2.1.0"
resolved "https://registry.yarnpkg.com/@ckeditor/ckeditor5-integrations-common/-/ckeditor5-integrations-common-2.1.0.tgz#5e1423ff764c421d8181a35f73677610038f1fb8"
integrity sha512-vn6qMb36sl6eSCc27dvThk6xISif59MxnxZmRBC440TyP7S9ZcS0ai4yHd5QyaH70ZIe0lhS7DWdLaiKtBggVQ==

"@ckeditor/[email protected]":
version "43.1.0"
Expand Down Expand Up @@ -3155,24 +3155,24 @@
loupe "^3.1.1"
tinyrainbow "^1.2.0"

"@volar/[email protected].0-alpha.18", "@volar/language-core@~2.4.0-alpha.18":
version "2.4.0-alpha.18"
resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-2.4.0-alpha.18.tgz#dafffd68ac07c26d69de16741187fd4c06bfa345"
integrity sha512-JAYeJvYQQROmVRtSBIczaPjP3DX4QW1fOqW1Ebs0d3Y3EwSNRglz03dSv0Dm61dzd0Yx3WgTW3hndDnTQqgmyg==
"@volar/[email protected].5", "@volar/language-core@~2.4.1":
version "2.4.5"
resolved "https://registry.yarnpkg.com/@volar/language-core/-/language-core-2.4.5.tgz#af8ba724b05fc4dce2339c49662e732e9c22c897"
integrity sha512-F4tA0DCO5Q1F5mScHmca0umsi2ufKULAnMOVBfMsZdT4myhVl4WdKRwCaKcfOkIEuyrAVvtq1ESBdZ+rSyLVww==
dependencies:
"@volar/source-map" "2.4.0-alpha.18"
"@volar/source-map" "2.4.5"

"@volar/[email protected].0-alpha.18":
version "2.4.0-alpha.18"
resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-2.4.0-alpha.18.tgz#a2413932ff6b1821ae8efcbd9249d4da3f99f223"
integrity sha512-MTeCV9MUwwsH0sNFiZwKtFrrVZUK6p8ioZs3xFzHc2cvDXHWlYN3bChdQtwKX+FY2HG6H3CfAu1pKijolzIQ8g==
"@volar/[email protected].5":
version "2.4.5"
resolved "https://registry.yarnpkg.com/@volar/source-map/-/source-map-2.4.5.tgz#81223a06321aaa067b40619189b44a9f0b7ac2d8"
integrity sha512-varwD7RaKE2J/Z+Zu6j3mNNJbNT394qIxXwdvz/4ao/vxOfyClZpSDtLKkwWmecinkOVos5+PWkWraelfMLfpw==

"@volar/typescript@~2.4.0-alpha.18":
version "2.4.0-alpha.18"
resolved "https://registry.yarnpkg.com/@volar/typescript/-/typescript-2.4.0-alpha.18.tgz#806aca9ce1bd7c48dc5fcd0fcf7f33bdd04e5b35"
integrity sha512-sXh5Y8sqGUkgxpMWUGvRXggxYHAVxg0Pa1C42lQZuPDrW6vHJPR0VCK8Sr7WJsAW530HuNQT/ZIskmXtxjybMQ==
"@volar/typescript@~2.4.1":
version "2.4.5"
resolved "https://registry.yarnpkg.com/@volar/typescript/-/typescript-2.4.5.tgz#1210c1e8561ac20af46348ceaf8e6e96c797063f"
integrity sha512-mcT1mHvLljAEtHviVcBuOyAwwMKz1ibXTi5uYtP/pf4XxoAzpdkQ+Br2IC0NPCvLCbjPZmbf3I0udndkfB1CDg==
dependencies:
"@volar/language-core" "2.4.0-alpha.18"
"@volar/language-core" "2.4.5"
path-browserify "^1.0.1"
vscode-uri "^3.0.8"

Expand Down Expand Up @@ -3226,12 +3226,12 @@
de-indent "^1.0.2"
he "^1.2.0"

"@vue/language-core@2.0.29":
version "2.0.29"
resolved "https://registry.yarnpkg.com/@vue/language-core/-/language-core-2.0.29.tgz#19462d786cd7a1c21dbe575b46970a57094e0357"
integrity sha512-o2qz9JPjhdoVj8D2+9bDXbaI4q2uZTHQA/dbyZT4Bj1FR9viZxDJnLcKVHfxdn6wsOzRgpqIzJEEmSSvgMvDTQ==
"@vue/language-core@2.1.6":
version "2.1.6"
resolved "https://registry.yarnpkg.com/@vue/language-core/-/language-core-2.1.6.tgz#b48186bdb9b3ef2b83e1f76d5b1ac357b3a7ed94"
integrity sha512-MW569cSky9R/ooKMh6xa2g1D0AtRKbL56k83dzus/bx//RDJk24RHWkMzbAlXjMdDNyxAaagKPRquBIxkxlCkg==
dependencies:
"@volar/language-core" "~2.4.0-alpha.18"
"@volar/language-core" "~2.4.1"
"@vue/compiler-dom" "^3.4.0"
"@vue/compiler-vue2" "^2.7.16"
"@vue/shared" "^3.4.0"
Expand Down Expand Up @@ -8115,7 +8115,7 @@ stringify-object@^3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -8129,13 +8129,6 @@ strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1, strip-ansi@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -8736,13 +8729,13 @@ vue-eslint-parser@^9.1.0, vue-eslint-parser@^9.4.3:
lodash "^4.17.21"
semver "^7.3.6"

vue-tsc@^2.0.22:
version "2.0.29"
resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-2.0.29.tgz#bf7e9605af9fadec7fd6037d242217f5c6ad2c3b"
integrity sha512-MHhsfyxO3mYShZCGYNziSbc63x7cQ5g9kvijV7dRe1TTXBRLxXyL0FnXWpUF1xII2mJ86mwYpYsUmMwkmerq7Q==
vue-tsc@^2.1.6:
version "2.1.6"
resolved "https://registry.yarnpkg.com/vue-tsc/-/vue-tsc-2.1.6.tgz#d93fdc617da6546674301a746fd7089ea6d4543d"
integrity sha512-f98dyZp5FOukcYmbFpuSCJ4Z0vHSOSmxGttZJCsFeX0M4w/Rsq0s4uKXjcSRsZqsRgQa6z7SfuO+y0HVICE57Q==
dependencies:
"@volar/typescript" "~2.4.0-alpha.18"
"@vue/language-core" "2.0.29"
"@volar/typescript" "~2.4.1"
"@vue/language-core" "2.1.6"
semver "^7.5.4"

vue@^3.4.30:
Expand Down Expand Up @@ -8879,16 +8872,7 @@ wordwrap@^1.0.0:
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

[email protected], wrap-ansi@^6.2.0, wrap-ansi@^7.0.0, wrap-ansi@^8.0.1, wrap-ansi@^8.1.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", [email protected], wrap-ansi@^6.2.0, wrap-ansi@^7.0.0, wrap-ansi@^8.0.1, wrap-ansi@^8.1.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand Down

0 comments on commit af84547

Please sign in to comment.