From 2c75efbaba1581433067e7e19573236a45297241 Mon Sep 17 00:00:00 2001 From: Prev Wong Date: Sat, 4 Jan 2020 03:28:37 +0800 Subject: [PATCH] publish utils The resulting core and layers bundle requires type definitions from utils. --- packages/core/package.json | 6 +++--- packages/layers/package.json | 2 +- packages/utils/LICENSE | 4 ++-- packages/utils/README.md | 2 +- packages/utils/package.json | 9 ++++----- packages/utils/src/useConnectorHooks.tsx | 2 +- packages/utils/src/useMethods.ts | 1 + rollup.config.js | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 7d71e894b..4a2daad54 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -34,15 +34,15 @@ "url": "https://github.com/prevwong/craft.js/issues" }, "dependencies": { + "@craftjs/utils": "^0.1.0-alpha.2", "debounce": "^1.2.0", "immer": "^3.1.3", "lodash.isequalwith": "^4.4.0", "shortid": "^2.2.15", - "tiny-invariant": "^1.0.6" + "tiny-invariant": "^1.0.6", + "@types/react": "^16.9.11" }, "devDependencies": { - "@craftjs/utils": "^0.1.0-alpha.2", - "@types/react": "^16.9.11", "react": "^16.8.0" }, "peerDependencies": { diff --git a/packages/layers/package.json b/packages/layers/package.json index 58c022f67..9206bbb31 100644 --- a/packages/layers/package.json +++ b/packages/layers/package.json @@ -31,6 +31,7 @@ }, "homepage": "https://github.com/prevwong/craft.js/", "dependencies": { + "@craftjs/utils": "^0.1.0-alpha.2", "immer": "^3.1.3", "lodash.isequalwith": "^4.4.0", "react-contenteditable": "^3.3.3", @@ -40,7 +41,6 @@ }, "devDependencies": { "@babel/core": "^7.7.4", - "@craftjs/utils": "^0.1.0-alpha.2", "@svgr/rollup": "^4.3.3" }, "peerDependencies": { diff --git a/packages/utils/LICENSE b/packages/utils/LICENSE index 68843ee5a..2c4d5027c 100644 --- a/packages/utils/LICENSE +++ b/packages/utils/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Prev Wong +Copyright (c) 2020 Previnash Wong Sze Chuan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/packages/utils/README.md b/packages/utils/README.md index 1bff34160..4e87c55be 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -1,6 +1,6 @@ # @craftjs/utils -Internal package containing common utilities used across the Craft.js monorepo. +Internal package containing common utilities used across the [Craft.js](https://github.com/prevwong/craft.js) monorepo. diff --git a/packages/utils/package.json b/packages/utils/package.json index 9d487efba..b40d983cf 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,9 +1,10 @@ { "name": "@craftjs/utils", - "private": true, + "description": "Utilities used internally across the craft.js monorepo", + "private": false, "version": "0.1.0-alpha.2", - "description": "Shared utilities used across the craft.js monorepo", "author": "Prev Wong ", + "license": "MIT", "main": "./dist/cjs/index.js", "module": "./dist/esm/index.js", "types": "./lib/index.d.ts", @@ -15,9 +16,7 @@ "dependencies": { "immer": "^3.1.3", "lodash.isequalwith": "^4.4.0", - "tiny-invariant": "^1.0.6" - }, - "devDependencies": { + "tiny-invariant": "^1.0.6", "@types/react": "^16.9.11" }, "peerDependencies": { diff --git a/packages/utils/src/useConnectorHooks.tsx b/packages/utils/src/useConnectorHooks.tsx index 1e83285ed..64b948134 100644 --- a/packages/utils/src/useConnectorHooks.tsx +++ b/packages/utils/src/useConnectorHooks.tsx @@ -1,10 +1,10 @@ +// https://github.com/react-dnd/react-dnd import { isValidElement, ReactElement } from "react"; import { cloneElement } from "react"; import invariant from "tiny-invariant"; import { useMemo } from "react"; import { useRef } from "react"; -// Thank you React DND function setRef(ref: any, node: any) { if (node) { if (typeof ref === "function") { diff --git a/packages/utils/src/useMethods.ts b/packages/utils/src/useMethods.ts index 94055cc08..96b91b80b 100644 --- a/packages/utils/src/useMethods.ts +++ b/packages/utils/src/useMethods.ts @@ -1,3 +1,4 @@ +// https://github.com/pelotom/use-methods import produce, { PatchListener } from "immer"; import { useMemo, useEffect, useRef, useReducer } from "react"; diff --git a/rollup.config.js b/rollup.config.js index 5b1ce72fd..4088a4688 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -5,7 +5,7 @@ import typescript from "rollup-plugin-typescript"; import babel from "rollup-plugin-babel"; const shouldMinify = process.env.NODE_ENV === "production"; -const bundle = ["@craftjs/utils", "tslib"]; +const bundle = ["tslib"]; export default { input: "./src/index.ts",