From 9a32737a0f4568a00feff7d23b3fa7869e6b0eed Mon Sep 17 00:00:00 2001 From: d3m1d0v Date: Tue, 19 Dec 2023 20:12:25 +0300 Subject: [PATCH] feat: add package exports --- package.json | 31 +++++++++++++++++++ .../behavior/ReactRenderer/index.ts | 2 +- src/pm/commands.ts | 1 + src/pm/history.ts | 1 + src/pm/inputrules.ts | 1 + src/pm/keymap.ts | 1 + src/pm/model.ts | 1 + src/pm/readme.md | 16 ++++++++++ src/pm/state.ts | 1 + src/pm/transform.ts | 1 + src/pm/utils.ts | 1 + src/pm/view.ts | 1 + src/styles/markdown.scss | 1 + 13 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 src/pm/commands.ts create mode 100644 src/pm/history.ts create mode 100644 src/pm/inputrules.ts create mode 100644 src/pm/keymap.ts create mode 100644 src/pm/model.ts create mode 100644 src/pm/readme.md create mode 100644 src/pm/state.ts create mode 100644 src/pm/transform.ts create mode 100644 src/pm/utils.ts create mode 100644 src/pm/view.ts create mode 100644 src/styles/markdown.scss diff --git a/package.json b/package.json index 262ea39e..cf69934d 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,40 @@ "type": "git", "url": "https://github.com/yandex-cloud/yfm-editor" }, + "exports": { + ".": { + "types": "./build/esm/index.d.ts", + "require": "./build/cjs/index.js", + "import": "./build/esm/index.js" + }, + "./specs": { + "types": "./build/esm/extensions/specs.d.ts", + "require": "./build/cjs/extensions/specs.js", + "import": "./build/esm/extensions/specs.js" + }, + "./pm/*": { + "types": "./build/esm/pm/*", + "require": "./build/cjs/pm/*", + "import": "./build/esm/pm/*" + }, + "./styles/*": "./build/esm/styles/*" + }, "main": "build/cjs/index.js", "module": "build/esm/index.js", "types": "build/esm/index.d.ts", + "typesVersions": { + "*": { + "index.d.ts": [ + "./build/esm/index.d.ts" + ], + "specs": [ + "./build/esm/extensions/specs.d.ts" + ], + "pm/*": [ + "./build/esm/pm/*" + ] + } + }, "files": [ "build" ], diff --git a/src/extensions/behavior/ReactRenderer/index.ts b/src/extensions/behavior/ReactRenderer/index.ts index 380f2c82..a9080528 100644 --- a/src/extensions/behavior/ReactRenderer/index.ts +++ b/src/extensions/behavior/ReactRenderer/index.ts @@ -10,7 +10,7 @@ import { RenderStorageItemEventMap, } from './types'; -export type {RendererItem} from './types'; +export type {RendererItem, RenderStorage} from './types'; export {Renderer as ReactRendererComponent} from './react'; export type {RendererProps as ReactRendererComponentProps} from './react'; diff --git a/src/pm/commands.ts b/src/pm/commands.ts new file mode 100644 index 00000000..de221a38 --- /dev/null +++ b/src/pm/commands.ts @@ -0,0 +1 @@ +export * from 'prosemirror-commands'; diff --git a/src/pm/history.ts b/src/pm/history.ts new file mode 100644 index 00000000..055ec974 --- /dev/null +++ b/src/pm/history.ts @@ -0,0 +1 @@ +export * from 'prosemirror-history'; diff --git a/src/pm/inputrules.ts b/src/pm/inputrules.ts new file mode 100644 index 00000000..c6f22287 --- /dev/null +++ b/src/pm/inputrules.ts @@ -0,0 +1 @@ +export * from 'prosemirror-inputrules'; diff --git a/src/pm/keymap.ts b/src/pm/keymap.ts new file mode 100644 index 00000000..44b86bff --- /dev/null +++ b/src/pm/keymap.ts @@ -0,0 +1 @@ +export * from 'prosemirror-keymap'; diff --git a/src/pm/model.ts b/src/pm/model.ts new file mode 100644 index 00000000..149a810c --- /dev/null +++ b/src/pm/model.ts @@ -0,0 +1 @@ +export * from 'prosemirror-model'; diff --git a/src/pm/readme.md b/src/pm/readme.md new file mode 100644 index 00000000..e99010a3 --- /dev/null +++ b/src/pm/readme.md @@ -0,0 +1,16 @@ +## PM submodule + +### Re-exports prosemirror core modules: + +- [prosemirror-commands](https://github.com/ProseMirror/prosemirror-commands) +- [prosemirror-history](https://github.com/ProseMirror/prosemirror-history) +- [prosemirror-inputrules](https://github.com/ProseMirror/prosemirror-inputrules) +- [prosemirror-keymap](https://github.com/ProseMirror/prosemirror-keymap) +- [prosemirror-model](https://github.com/ProseMirror/prosemirror-model) +- [prosemirror-state](https://github.com/ProseMirror/prosemirror-state) +- [prosemirror-transform](https://github.com/ProseMirror/prosemirror-transform) +- [prosemirror-view](https://github.com/ProseMirror/prosemirror-view) + +### Also some other modules: + +- [prosemirror-utils](https://github.com/atlassian/prosemirror-utils) diff --git a/src/pm/state.ts b/src/pm/state.ts new file mode 100644 index 00000000..455a4dbd --- /dev/null +++ b/src/pm/state.ts @@ -0,0 +1 @@ +export * from 'prosemirror-state'; diff --git a/src/pm/transform.ts b/src/pm/transform.ts new file mode 100644 index 00000000..0b4f8de2 --- /dev/null +++ b/src/pm/transform.ts @@ -0,0 +1 @@ +export * from 'prosemirror-transform'; diff --git a/src/pm/utils.ts b/src/pm/utils.ts new file mode 100644 index 00000000..c6c610b6 --- /dev/null +++ b/src/pm/utils.ts @@ -0,0 +1 @@ +export * from 'prosemirror-utils'; diff --git a/src/pm/view.ts b/src/pm/view.ts new file mode 100644 index 00000000..8b3c6310 --- /dev/null +++ b/src/pm/view.ts @@ -0,0 +1 @@ +export * from 'prosemirror-view'; diff --git a/src/styles/markdown.scss b/src/styles/markdown.scss new file mode 100644 index 00000000..c8cd71e2 --- /dev/null +++ b/src/styles/markdown.scss @@ -0,0 +1 @@ +@use '../extensions/yfm/Color/colors';