From af69710736ab303379a73ece050c5d631417d26b Mon Sep 17 00:00:00 2001 From: Eric Maciel Date: Thu, 17 Feb 2022 15:12:55 -0500 Subject: [PATCH] v0.7.28 --- packages/bridge/package.json | 7 +++---- packages/bridge/src/cursor/index.ts | 6 ++++-- packages/bridge/src/index.ts | 1 + packages/bridge/src/path/index.ts | 4 ++-- packages/bridge/tsconfig.json | 6 +++++- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/bridge/package.json b/packages/bridge/package.json index 488d180..a496907 100644 --- a/packages/bridge/package.json +++ b/packages/bridge/package.json @@ -1,6 +1,6 @@ { "name": "@hiveteams/collab-bridge", - "version": "0.7.27", + "version": "0.7.28", "files": [ "lib" ], @@ -18,9 +18,8 @@ "license": "MIT", "scripts": { "prepublishOnly": "yarn run build:module", - "build:module": "yarn run build:types && yarn run build:js", - "build:types": "tsc --emitDeclarationOnly", - "build:js": "babel src --out-dir lib --extensions \".ts,.tsx\" --source-maps inline", + "build:module": "yarn run build:js", + "build:js": "./node_modules/typescript/bin/tsc -p ./tsconfig.json", "watch": "yarn build:js -w", "test": "jest" }, diff --git a/packages/bridge/src/cursor/index.ts b/packages/bridge/src/cursor/index.ts index 81e6054..5619f2f 100644 --- a/packages/bridge/src/cursor/index.ts +++ b/packages/bridge/src/cursor/index.ts @@ -1,4 +1,4 @@ -import { Operation, Range } from 'slate' +import { BaseSetNodeOperation, Operation, Range } from 'slate' import { CursorData } from '../model' import { toJS } from '../utils' @@ -15,7 +15,9 @@ export const setCursor = ( if (!doc.cursors) doc.cursors = {} - const newCursor = cursorOps[cursorOps.length - 1]?.newProperties || {} + const newCursor = + (cursorOps[cursorOps.length - 1] as BaseSetNodeOperation) + ?.newProperties || {} if (selection) { const newCursorData = Object.assign( diff --git a/packages/bridge/src/index.ts b/packages/bridge/src/index.ts index 8a6778a..9751586 100644 --- a/packages/bridge/src/index.ts +++ b/packages/bridge/src/index.ts @@ -1,3 +1,4 @@ +export * from './path' export * from './apply' export * from './convert' export * from './utils' diff --git a/packages/bridge/src/path/index.ts b/packages/bridge/src/path/index.ts index 024e269..6aa1c68 100644 --- a/packages/bridge/src/path/index.ts +++ b/packages/bridge/src/path/index.ts @@ -1,8 +1,8 @@ -import { Element, Node, Path } from 'slate' +import { Element, Path } from 'slate' import { SyncValue } from '../model' -export const isTree = (node: Node): boolean => Boolean(node?.children) +export const isTree = (node: Element): boolean => Boolean(node?.children) export const getTarget = (doc: SyncValue | Element, path: Path) => { const iterate = (current: any, idx: number) => { diff --git a/packages/bridge/tsconfig.json b/packages/bridge/tsconfig.json index f518710..c8f023c 100644 --- a/packages/bridge/tsconfig.json +++ b/packages/bridge/tsconfig.json @@ -2,8 +2,12 @@ "extends": "../../tsconfig.base.json", "include": ["./src/**/*"], "compilerOptions": { + "target": "es2019", + "module": "commonjs", "rootDir": "./src", "outDir": "./lib", - "composite": true + "composite": true, + "declaration": true, + "declarationMap": true } }