Merge branch 'feature/rollup-build' into main

This commit is contained in:
Philipp Kühn 2020-11-10 12:43:43 +01:00
commit 0ac228156c
45 changed files with 951 additions and 751 deletions

View File

@ -23,7 +23,7 @@ import { Editor } from '@tiptap/core'
import { defaultExtensions } from '@tiptap/starter-kit'
new Editor({
element: document.getElementsByClassName('element'),
element: document.querySelector('.element'),
extensions: defaultExtensions(),
content: '<p>Your content.</p>',
})

View File

@ -13,7 +13,7 @@
"scripts": {
"start": "yarn --cwd ./docs start",
"build:docs": "yarn --cwd ./docs build",
"build:packages": "yarn clean:packages && lerna exec -- microbundle --compress",
"build:packages": "yarn clean:packages && rollup -c",
"clean:packages": "rm -rf ./packages/*/dist",
"lint": "eslint --quiet --no-error-on-unmatched-pattern ./",
"test:open": "cypress open --project tests",
@ -21,10 +21,17 @@
"reset": "yarn clean:packages && rm -rf ./**/.cache && rm -rf ./**/node_modules && rm -rf ./yarn.lock && yarn install"
},
"devDependencies": {
"@atomico/rollup-plugin-sizes": "^1.1.4",
"@babel/core": "^7.11.6",
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4",
"@babel/plugin-proposal-optional-chaining": "^7.11.0",
"@babel/preset-env": "^7.11.5",
"@lerna/batch-packages": "^3.16.0",
"@lerna/filter-packages": "^3.18.0",
"@lerna/project": "^3.21.0",
"@rollup/plugin-babel": "^5.2.1",
"@rollup/plugin-commonjs": "^16.0.0",
"@rollup/plugin-node-resolve": "^10.0.0",
"@types/prosemirror-commands": "^1.0.3",
"@types/prosemirror-history": "^1.0.1",
"@types/prosemirror-inputrules": "^1.0.3",
@ -44,7 +51,11 @@
"eslint-plugin-vue": "^7.0.1",
"lerna": "^3.22.1",
"levenary": "^1.1.1",
"microbundle": "^0.12.4",
"minimist": "^1.2.5",
"rollup": "^2.33.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.29.0",
"rollup-plugin-vue": "5",
"typedoc": "^0.19.2",
"typescript": "^4.0.5",
"vue": "^2.6.12"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/core",
"version": "2.0.0",
"source": "index.ts",
"main": "dist/tiptap-core.js",
"umd:main": "dist/tiptap-core.umd.js",
"module": "dist/tiptap-core.mjs",
"unpkg": "dist/tiptap-core.js",
"jsdelivr": "dist/tiptap-core.js",
"main": "dist/tiptap-core.cjs.js",
"umd": "dist/tiptap-core.umd.js",
"module": "dist/tiptap-core.esm.js",
"unpkg": "dist/tiptap-core.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -267,6 +267,8 @@ export class Editor extends EventEmitter {
}),
})
console.log({ plugins: this.extensionManager.plugins })
// `editor.view` is not yet available at this time.
// Therefore we will add all plugins and node views directly afterwards.
const newState = this.state.reconfigure({

View File

@ -1,4 +1,4 @@
import { Plugin } from 'prosemirror-state'
import { Plugin, PluginKey } from 'prosemirror-state'
import { createExtension } from '../Extension'
export const FocusEvents = createExtension({
@ -7,6 +7,7 @@ export const FocusEvents = createExtension({
return [
new Plugin({
key: new PluginKey('focusEvents'),
props: {
attributes: {
tabindex: '0',

View File

@ -1,4 +1,4 @@
import { Plugin } from 'prosemirror-state'
import { Plugin, PluginKey } from 'prosemirror-state'
import { Slice, Fragment, MarkType } from 'prosemirror-model'
export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any) => any): Plugin {
@ -51,6 +51,7 @@ export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any)
}
return new Plugin({
key: new PluginKey('markPasteRule'),
props: {
transformPasted: slice => {
return new Slice(handler(slice.content), slice.openStart, slice.openEnd)

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-blockquote",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-blockquote.js",
"umd:main": "dist/tiptap-extension-blockquote.umd.js",
"module": "dist/tiptap-extension-blockquote.mjs",
"unpkg": "dist/tiptap-extension-blockquote.js",
"jsdelivr": "dist/tiptap-extension-blockquote.js",
"main": "dist/tiptap-extension-blockquote.cjs.js",
"umd": "dist/tiptap-extension-blockquote.umd.js",
"module": "dist/tiptap-extension-blockquote.esm.js",
"unpkg": "dist/tiptap-extension-blockquote.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-bold",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-bold.js",
"umd:main": "dist/tiptap-extension-bold.umd.js",
"module": "dist/tiptap-extension-bold.mjs",
"unpkg": "dist/tiptap-extension-bold.js",
"jsdelivr": "dist/tiptap-extension-bold.js",
"main": "dist/tiptap-extension-bold.cjs.js",
"umd": "dist/tiptap-extension-bold.umd.js",
"module": "dist/tiptap-extension-bold.esm.js",
"unpkg": "dist/tiptap-extension-bold.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-bullet-list",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-bullet-list.js",
"umd:main": "dist/tiptap-extension-bullet-list.umd.js",
"module": "dist/tiptap-extension-bullet-list.mjs",
"unpkg": "dist/tiptap-extension-bullet-list.js",
"jsdelivr": "dist/tiptap-extension-bullet-list.js",
"main": "dist/tiptap-extension-bullet-list.cjs.js",
"umd": "dist/tiptap-extension-bullet-list.umd.js",
"module": "dist/tiptap-extension-bullet-list.esm.js",
"unpkg": "dist/tiptap-extension-bullet-list.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-code-block",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-code-block.js",
"umd:main": "dist/tiptap-extension-code-block.umd.js",
"module": "dist/tiptap-extension-code-block.mjs",
"unpkg": "dist/tiptap-extension-code-block.js",
"jsdelivr": "dist/tiptap-extension-code-block.js",
"main": "dist/tiptap-extension-code-block.cjs.js",
"umd": "dist/tiptap-extension-code-block.umd.js",
"module": "dist/tiptap-extension-code-block.esm.js",
"unpkg": "dist/tiptap-extension-code-block.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-code",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-code.js",
"umd:main": "dist/tiptap-extension-code.umd.js",
"module": "dist/tiptap-extension-code.mjs",
"unpkg": "dist/tiptap-extension-code.js",
"jsdelivr": "dist/tiptap-extension-code.js",
"main": "dist/tiptap-extension-code.cjs.js",
"umd": "dist/tiptap-extension-code.umd.js",
"module": "dist/tiptap-extension-code.esm.js",
"unpkg": "dist/tiptap-extension-code.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-collaboration-cursor",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-collaboration-cursor.js",
"umd:main": "dist/tiptap-extension-collaboration-cursor.umd.js",
"module": "dist/tiptap-extension-collaboration-cursor.mjs",
"unpkg": "dist/tiptap-extension-collaboration-cursor.js",
"jsdelivr": "dist/tiptap-extension-collaboration-cursor.js",
"main": "dist/tiptap-extension-collaboration-cursor.cjs.js",
"umd": "dist/tiptap-extension-collaboration-cursor.umd.js",
"module": "dist/tiptap-extension-collaboration-cursor.esm.js",
"unpkg": "dist/tiptap-extension-collaboration-cursor.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-collaboration",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-collaboration.js",
"umd:main": "dist/tiptap-extension-collaboration.umd.js",
"module": "dist/tiptap-extension-collaboration.mjs",
"unpkg": "dist/tiptap-extension-collaboration.js",
"jsdelivr": "dist/tiptap-extension-collaboration.js",
"main": "dist/tiptap-extension-collaboration.cjs.js",
"umd": "dist/tiptap-extension-collaboration.umd.js",
"module": "dist/tiptap-extension-collaboration.esm.js",
"unpkg": "dist/tiptap-extension-collaboration.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-document",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-document.js",
"umd:main": "dist/tiptap-extension-document.umd.js",
"module": "dist/tiptap-extension-document.mjs",
"unpkg": "dist/tiptap-extension-document.js",
"jsdelivr": "dist/tiptap-extension-document.js",
"main": "dist/tiptap-extension-document.cjs.js",
"umd": "dist/tiptap-extension-document.umd.js",
"module": "dist/tiptap-extension-document.esm.js",
"unpkg": "dist/tiptap-extension-document.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-dropcursor",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-dropcursor.js",
"umd:main": "dist/tiptap-extension-dropcursor.umd.js",
"module": "dist/tiptap-extension-dropcursor.mjs",
"unpkg": "dist/tiptap-extension-dropcursor.js",
"jsdelivr": "dist/tiptap-extension-dropcursor.js",
"main": "dist/tiptap-extension-dropcursor.cjs.js",
"umd": "dist/tiptap-extension-dropcursor.umd.js",
"module": "dist/tiptap-extension-dropcursor.esm.js",
"unpkg": "dist/tiptap-extension-dropcursor.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -1,5 +1,5 @@
import { createExtension } from '@tiptap/core'
import { Plugin } from 'prosemirror-state'
import { Plugin, PluginKey } from 'prosemirror-state'
import { DecorationSet, Decoration } from 'prosemirror-view'
export interface FocusOptions {
@ -16,6 +16,7 @@ const FocusClasses = createExtension({
addProseMirrorPlugins() {
return [
new Plugin({
key: new PluginKey('focus'),
props: {
decorations: ({ doc, selection }) => {
const { isEditable, isFocused } = this.editor

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-focus",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-focus.js",
"umd:main": "dist/tiptap-extension-focus.umd.js",
"module": "dist/tiptap-extension-focus.mjs",
"unpkg": "dist/tiptap-extension-focus.js",
"jsdelivr": "dist/tiptap-extension-focus.js",
"main": "dist/tiptap-extension-focus.cjs.js",
"umd": "dist/tiptap-extension-focus.umd.js",
"module": "dist/tiptap-extension-focus.esm.js",
"unpkg": "dist/tiptap-extension-focus.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-font-family",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-font-family.js",
"umd:main": "dist/tiptap-extension-font-family.umd.js",
"module": "dist/tiptap-extension-font-family.mjs",
"unpkg": "dist/tiptap-extension-font-family.js",
"jsdelivr": "dist/tiptap-extension-font-family.js",
"main": "dist/tiptap-extension-font-family.cjs.js",
"umd": "dist/tiptap-extension-font-family.umd.js",
"module": "dist/tiptap-extension-font-family.esm.js",
"unpkg": "dist/tiptap-extension-font-family.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-gapcursor",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-gapcursor.js",
"umd:main": "dist/tiptap-extension-gapcursor.umd.js",
"module": "dist/tiptap-extension-gapcursor.mjs",
"unpkg": "dist/tiptap-extension-gapcursor.js",
"jsdelivr": "dist/tiptap-extension-gapcursor.js",
"main": "dist/tiptap-extension-gapcursor.cjs.js",
"umd": "dist/tiptap-extension-gapcursor.umd.js",
"module": "dist/tiptap-extension-gapcursor.esm.js",
"unpkg": "dist/tiptap-extension-gapcursor.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-hard-break",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-hard-break.js",
"umd:main": "dist/tiptap-extension-hard-break.umd.js",
"module": "dist/tiptap-extension-hard-break.mjs",
"unpkg": "dist/tiptap-extension-hard-break.js",
"jsdelivr": "dist/tiptap-extension-hard-break.js",
"main": "dist/tiptap-extension-hard-break.cjs.js",
"umd": "dist/tiptap-extension-hard-break.umd.js",
"module": "dist/tiptap-extension-hard-break.esm.js",
"unpkg": "dist/tiptap-extension-hard-break.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-heading",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-heading.js",
"umd:main": "dist/tiptap-extension-heading.umd.js",
"module": "dist/tiptap-extension-heading.mjs",
"unpkg": "dist/tiptap-extension-heading.js",
"jsdelivr": "dist/tiptap-extension-heading.js",
"main": "dist/tiptap-extension-heading.cjs.js",
"umd": "dist/tiptap-extension-heading.umd.js",
"module": "dist/tiptap-extension-heading.esm.js",
"unpkg": "dist/tiptap-extension-heading.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-highlight",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-highlight.js",
"umd:main": "dist/tiptap-extension-highlight.umd.js",
"module": "dist/tiptap-extension-highlight.mjs",
"unpkg": "dist/tiptap-extension-highlight.js",
"jsdelivr": "dist/tiptap-extension-highlight.js",
"main": "dist/tiptap-extension-highlight.cjs.js",
"umd": "dist/tiptap-extension-highlight.umd.js",
"module": "dist/tiptap-extension-highlight.esm.js",
"unpkg": "dist/tiptap-extension-highlight.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-history",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-history.js",
"umd:main": "dist/tiptap-extension-history.umd.js",
"module": "dist/tiptap-extension-history.mjs",
"unpkg": "dist/tiptap-extension-history.js",
"jsdelivr": "dist/tiptap-extension-history.js",
"main": "dist/tiptap-extension-history.cjs.js",
"umd": "dist/tiptap-extension-history.umd.js",
"module": "dist/tiptap-extension-history.esm.js",
"unpkg": "dist/tiptap-extension-history.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-horizontal-rule",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-horizontal-rule.js",
"umd:main": "dist/tiptap-extension-horizontal-rule.umd.js",
"module": "dist/tiptap-extension-horizontal-rule.mjs",
"unpkg": "dist/tiptap-extension-horizontal-rule.js",
"jsdelivr": "dist/tiptap-extension-horizontal-rule.js",
"main": "dist/tiptap-extension-horizontal-rule.cjs.js",
"umd": "dist/tiptap-extension-horizontal-rule.umd.js",
"module": "dist/tiptap-extension-horizontal-rule.esm.js",
"unpkg": "dist/tiptap-extension-horizontal-rule.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-image",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-image.js",
"umd:main": "dist/tiptap-extension-image.umd.js",
"module": "dist/tiptap-extension-image.mjs",
"unpkg": "dist/tiptap-extension-image.js",
"jsdelivr": "dist/tiptap-extension-image.js",
"main": "dist/tiptap-extension-image.cjs.js",
"umd": "dist/tiptap-extension-image.umd.js",
"module": "dist/tiptap-extension-image.esm.js",
"unpkg": "dist/tiptap-extension-image.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-italic",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-italic.js",
"umd:main": "dist/tiptap-extension-italic.umd.js",
"module": "dist/tiptap-extension-italic.mjs",
"unpkg": "dist/tiptap-extension-italic.js",
"jsdelivr": "dist/tiptap-extension-italic.js",
"main": "dist/tiptap-extension-italic.cjs.js",
"umd": "dist/tiptap-extension-italic.umd.js",
"module": "dist/tiptap-extension-italic.esm.js",
"unpkg": "dist/tiptap-extension-italic.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-link",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-link.js",
"umd:main": "dist/tiptap-extension-link.umd.js",
"module": "dist/tiptap-extension-link.mjs",
"unpkg": "dist/tiptap-extension-link.js",
"jsdelivr": "dist/tiptap-extension-link.js",
"main": "dist/tiptap-extension-link.cjs.js",
"umd": "dist/tiptap-extension-link.umd.js",
"module": "dist/tiptap-extension-link.esm.js",
"unpkg": "dist/tiptap-extension-link.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-list-item",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-list-item.js",
"umd:main": "dist/tiptap-extension-list-item.umd.js",
"module": "dist/tiptap-extension-list-item.mjs",
"unpkg": "dist/tiptap-extension-list-item.js",
"jsdelivr": "dist/tiptap-extension-list-item.js",
"main": "dist/tiptap-extension-list-item.cjs.js",
"umd": "dist/tiptap-extension-list-item.umd.js",
"module": "dist/tiptap-extension-list-item.esm.js",
"unpkg": "dist/tiptap-extension-list-item.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-ordered-list",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-ordered-list.js",
"umd:main": "dist/tiptap-extension-ordered-list.umd.js",
"module": "dist/tiptap-extension-ordered-list.mjs",
"unpkg": "dist/tiptap-extension-ordered-list.js",
"jsdelivr": "dist/tiptap-extension-ordered-list.js",
"main": "dist/tiptap-extension-ordered-list.cjs.js",
"umd": "dist/tiptap-extension-ordered-list.umd.js",
"module": "dist/tiptap-extension-ordered-list.esm.js",
"unpkg": "dist/tiptap-extension-ordered-list.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-paragraph",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-paragraph.js",
"umd:main": "dist/tiptap-extension-paragraph.umd.js",
"module": "dist/tiptap-extension-paragraph.mjs",
"unpkg": "dist/tiptap-extension-paragraph.js",
"jsdelivr": "dist/tiptap-extension-paragraph.js",
"main": "dist/tiptap-extension-paragraph.cjs.js",
"umd": "dist/tiptap-extension-paragraph.umd.js",
"module": "dist/tiptap-extension-paragraph.esm.js",
"unpkg": "dist/tiptap-extension-paragraph.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-strike",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-strike.js",
"umd:main": "dist/tiptap-extension-strike.umd.js",
"module": "dist/tiptap-extension-strike.mjs",
"unpkg": "dist/tiptap-extension-strike.js",
"jsdelivr": "dist/tiptap-extension-strike.js",
"main": "dist/tiptap-extension-strike.cjs.js",
"umd": "dist/tiptap-extension-strike.umd.js",
"module": "dist/tiptap-extension-strike.esm.js",
"unpkg": "dist/tiptap-extension-strike.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-task-item",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-task-item.js",
"umd:main": "dist/tiptap-extension-task-item.umd.js",
"module": "dist/tiptap-extension-task-item.mjs",
"unpkg": "dist/tiptap-extension-task-item.js",
"jsdelivr": "dist/tiptap-extension-task-item.js",
"main": "dist/tiptap-extension-task-item.cjs.js",
"umd": "dist/tiptap-extension-task-item.umd.js",
"module": "dist/tiptap-extension-task-item.esm.js",
"unpkg": "dist/tiptap-extension-task-item.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-task-list",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-task-list.js",
"umd:main": "dist/tiptap-extension-task-list.umd.js",
"module": "dist/tiptap-extension-task-list.mjs",
"unpkg": "dist/tiptap-extension-task-list.js",
"jsdelivr": "dist/tiptap-extension-task-list.js",
"main": "dist/tiptap-extension-task-list.cjs.js",
"umd": "dist/tiptap-extension-task-list.umd.js",
"module": "dist/tiptap-extension-task-list.esm.js",
"unpkg": "dist/tiptap-extension-task-list.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-text-align",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-text-align.js",
"umd:main": "dist/tiptap-extension-text-align.umd.js",
"module": "dist/tiptap-extension-text-align.mjs",
"unpkg": "dist/tiptap-extension-text-align.js",
"jsdelivr": "dist/tiptap-extension-text-align.js",
"main": "dist/tiptap-extension-text-align.cjs.js",
"umd": "dist/tiptap-extension-text-align.umd.js",
"module": "dist/tiptap-extension-text-align.esm.js",
"unpkg": "dist/tiptap-extension-text-align.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-text-style",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-text-style.js",
"umd:main": "dist/tiptap-extension-text-style.umd.js",
"module": "dist/tiptap-extension-text-style.mjs",
"unpkg": "dist/tiptap-extension-text-style.js",
"jsdelivr": "dist/tiptap-extension-text-style.js",
"main": "dist/tiptap-extension-text-style.cjs.js",
"umd": "dist/tiptap-extension-text-style.umd.js",
"module": "dist/tiptap-extension-text-style.esm.js",
"unpkg": "dist/tiptap-extension-text-style.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-text",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-text.js",
"umd:main": "dist/tiptap-extension-text.umd.js",
"module": "dist/tiptap-extension-text.mjs",
"unpkg": "dist/tiptap-extension-text.js",
"jsdelivr": "dist/tiptap-extension-text.js",
"main": "dist/tiptap-extension-text.cjs.js",
"umd": "dist/tiptap-extension-text.umd.js",
"module": "dist/tiptap-extension-text.esm.js",
"unpkg": "dist/tiptap-extension-text.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-typography",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-typography.js",
"umd:main": "dist/tiptap-extension-typography.umd.js",
"module": "dist/tiptap-extension-typography.mjs",
"unpkg": "dist/tiptap-extension-typography.js",
"jsdelivr": "dist/tiptap-extension-typography.js",
"main": "dist/tiptap-extension-typography.cjs.js",
"umd": "dist/tiptap-extension-typography.umd.js",
"module": "dist/tiptap-extension-typography.esm.js",
"unpkg": "dist/tiptap-extension-typography.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/extension-underline",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-extension-underline.js",
"umd:main": "dist/tiptap-extension-underline.umd.js",
"module": "dist/tiptap-extension-underline.mjs",
"unpkg": "dist/tiptap-extension-underline.js",
"jsdelivr": "dist/tiptap-extension-underline.js",
"main": "dist/tiptap-extension-underline.cjs.js",
"umd": "dist/tiptap-extension-underline.umd.js",
"module": "dist/tiptap-extension-underline.esm.js",
"unpkg": "dist/tiptap-extension-underline.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,6 +2,11 @@
"name": "@tiptap/html",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-html.cjs.js",
"umd": "dist/tiptap-html.umd.js",
"module": "dist/tiptap-html.esm.js",
"unpkg": "dist/tiptap-html.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/starter-kit",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-starter-kit.js",
"umd:main": "dist/tiptap-starter-kit.umd.js",
"module": "dist/tiptap-starter-kit.mjs",
"unpkg": "dist/tiptap-starter-kit.js",
"jsdelivr": "dist/tiptap-starter-kit.js",
"main": "dist/tiptap-starter-kit.cjs.js",
"umd": "dist/tiptap-starter-kit.umd.js",
"module": "dist/tiptap-starter-kit.esm.js",
"unpkg": "dist/tiptap-starter-kit.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/vue-starter-kit",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-vue-starter-kit.js",
"umd:main": "dist/tiptap-vue-starter-kit.umd.js",
"module": "dist/tiptap-vue-starter-kit.mjs",
"unpkg": "dist/tiptap-vue-starter-kit.js",
"jsdelivr": "dist/tiptap-vue-starter-kit.js",
"main": "dist/tiptap-vue-starter-kit.cjs.js",
"umd": "dist/tiptap-vue-starter-kit.umd.js",
"module": "dist/tiptap-vue-starter-kit.esm.js",
"unpkg": "dist/tiptap-vue-starter-kit.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

View File

@ -2,11 +2,11 @@
"name": "@tiptap/vue",
"version": "1.0.0",
"source": "index.ts",
"main": "dist/tiptap-vue.js",
"umd:main": "dist/tiptap-vue.umd.js",
"module": "dist/tiptap-vue.mjs",
"unpkg": "dist/tiptap-vue.js",
"jsdelivr": "dist/tiptap-vue.js",
"main": "dist/tiptap-vue.cjs.js",
"umd": "dist/tiptap-vue.umd.js",
"module": "dist/tiptap-vue.esm.js",
"unpkg": "dist/tiptap-vue.bundle.umd.min.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"

119
rollup.config.js Normal file
View File

@ -0,0 +1,119 @@
import path from 'path'
import minimist from 'minimist'
import { getPackages } from '@lerna/project'
import filterPackages from '@lerna/filter-packages'
import batchPackages from '@lerna/batch-packages'
import typescript from 'rollup-plugin-typescript2'
import resolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import vuePlugin from 'rollup-plugin-vue'
import babel from '@rollup/plugin-babel'
import { terser } from 'rollup-plugin-terser'
import sizes from '@atomico/rollup-plugin-sizes'
async function getSortedPackages(scope, ignore) {
const packages = await getPackages(__dirname)
const filtered = filterPackages(packages, scope, ignore, false)
return batchPackages(filtered)
.filter(item => item.name !== '@tiptap/docs')
.reduce((arr, batch) => arr.concat(batch), [])
}
async function build(commandLineArgs) {
const config = []
// Support --scope and --ignore globs if passed in via commandline
const { scope, ignore } = minimist(process.argv.slice(2))
const packages = await getSortedPackages(scope, ignore)
// prevent rollup warning
delete commandLineArgs.scope
delete commandLineArgs.ignore
packages.forEach(pkg => {
const basePath = path.relative(__dirname, pkg.location)
const input = path.join(basePath, 'index.ts')
const {
name,
main,
umd,
module,
unpkg,
} = pkg.toJSON()
const plugins = [
resolve(),
commonjs(),
typescript({
tsconfigOverride: {
compilerOptions: {
declaration: true,
},
},
}),
vuePlugin(),
babel({
babelHelpers: 'bundled',
}),
sizes(),
]
config.push({
input,
output: [
{
name,
file: path.join(basePath, umd),
format: 'umd',
sourcemap: true,
},
{
name,
file: path.join(basePath, main),
format: 'cjs',
sourcemap: true,
exports: 'auto',
},
{
name,
file: path.join(basePath, module),
format: 'es',
sourcemap: true,
},
],
external: [
...Object.keys(pkg.dependencies || {}),
...Object.keys(pkg.devDependencies || {}),
...Object.keys(pkg.peerDependencies || {}),
],
plugins,
})
config.push({
input,
output: [
{
name,
file: path.join(basePath, unpkg),
format: 'umd',
sourcemap: true,
globals: {
vue: 'Vue',
},
},
],
externals: [
'vue',
],
plugins: [
...plugins,
terser(),
],
})
})
return config
}
export default build

View File

@ -28,11 +28,8 @@
"files": [
"./shims/vue.d.ts"
],
"filesGlob": [
"packages/**/*.ts"
],
"exclude": [
"node_modules",
"dist"
"**/node_modules",
"**/dist"
]
}

1193
yarn.lock

File diff suppressed because it is too large Load Diff