Skip to content

Commit

Permalink
INT-3324: move tinymce to be an optional peer dependency (#422)
Browse files Browse the repository at this point in the history
* INT-3324: Move tinymce to be a optional peer dependency

* INT-3324: Use `import type` for tinymce types

* INT-3324: Bumped major version

* INT-3324: Added a changelog entry
  • Loading branch information
danoaky-tiny authored Jul 25, 2024
1 parent e938cb7 commit 7472fcb
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Changed
- Moved tinymce dependency to be a optional peer dependency. #INT-3324

## 6.0.0 - 2024-06-05

### Added
Expand Down
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tinymce/tinymce-vue",
"version": "6.0.2-rc",
"version": "7.0.2-rc",
"description": "Official TinyMCE Vue 3 Component",
"private": false,
"repository": {
Expand Down Expand Up @@ -33,8 +33,14 @@
"LICENSE.txt"
],
"peerDependencies": {
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1",
"vue": "^3.0.0"
},
"peerDependenciesMeta": {
"tinymce": {
"optional": true
}
},
"devDependencies": {
"@babel/core": "^7.20.2",
"@ephox/agar": "^8.0.1",
Expand Down Expand Up @@ -69,6 +75,7 @@
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-typescript2": "^0.34.1",
"rollup-plugin-uglify": "^6.0.0",
"tinymce": "^7",
"tinymce-4": "npm:tinymce@^4",
"tinymce-5": "npm:tinymce@^5",
"tinymce-6": "npm:tinymce@^6",
Expand All @@ -84,8 +91,5 @@
"vue-router": "^4.3.2",
"vue-template-compiler": "^2.7.16",
"webpack": "^5.75.0"
},
"dependencies": {
"tinymce": "^7.0.0 || ^6.0.0 || ^5.5.1"
}
}
2 changes: 1 addition & 1 deletion src/main/ts/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { Ref, watch, SetupContext } from 'vue';
import { IPropTypes } from './components/EditorPropTypes';
import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
import type { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';

const validEvents = [
'onActivate',
Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/components/Editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { getTinymce } from '../TinyMCE';
import { isTextarea, mergePlugins, uuid, isNullOrUndefined, initEditor } from '../Utils';
import { editorProps, IPropTypes } from './EditorPropTypes';
import { h, defineComponent, onMounted, ref, Ref, toRefs, nextTick, watch, onBeforeUnmount, onActivated, onDeactivated } from 'vue';
import { Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce';
import type { Editor as TinyMCEEditor, EditorEvent, TinyMCE } from 'tinymce';

type EditorOptions = Parameters<TinyMCE['init']>[0];

Expand Down
2 changes: 1 addition & 1 deletion src/main/ts/components/EditorPropTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*
*/
import { TinyMCE } from 'tinymce';
import type { TinyMCE } from 'tinymce';

type EditorOptions = Parameters<TinyMCE['init']>[0];

Expand Down
2 changes: 1 addition & 1 deletion src/stories/Editor.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { onBeforeMount, ref } from 'vue';
import { ScriptLoader } from '../main/ts/ScriptLoader';

import { Editor } from '../main/ts/components/Editor';
import { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';
import type { Editor as TinyMCEEditor, EditorEvent } from 'tinymce';

const apiKey = 'qagffr3pkuv17a8on1afax661irst1hbr4e6tbv888sz91jc';
const content = `
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -15341,10 +15341,10 @@ tiny-emitter@^2.0.0:
resolved "https://registry.npmjs.org/tinymce/-/tinymce-7.0.1.tgz"
integrity sha512-0a7DJnhniBx2psRuKcVQ9g4hujN6PAR4fPS0NSF1T1luH1RBDZVVEn2pGND6Ly+AW1lUm/cHOHjsasqBelMhbw==

"tinymce@^7.0.0 || ^6.0.0 || ^5.5.1":
version "7.1.1"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.1.1.tgz#63cd62c0288bdbddb854b3565387c8d7dec14be4"
integrity sha512-QQJKsEiM+jUfrlxNivuVUiv1jsHv4a27rub4oqajtsYQ4mFukN3hkWQrZnzVNtnPOIUsOGU2Ycem0DnEU/JKcA==
tinymce@^7:
version "7.2.1"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-7.2.1.tgz#9b4f6b5a0fa647e2953c174ac69aa47483683332"
integrity sha512-ADd1cvdIuq6NWyii0ZOZRuu+9sHIdQfcRNWBcBps2K8vy7OjlRkX6iw7zz1WlL9kY4z4L1DvIP+xOrVX/46aHA==

tmp@^0.2.1:
version "0.2.1"
Expand Down

0 comments on commit 7472fcb

Please sign in to comment.