diff --git a/CHANGELOG.md b/CHANGELOG.md index 08aeee1..b42fd21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,10 +6,14 @@ All notable changes to [Phantom](https://github.com/sidiousvic/phantom) will be 👻 +## [v2.1.1] — 2020.07.20 + +- [x] Fixed exporting/importing bug. + ## [v2.1.0] — 2020.07.20 - [x] Using `rollup` for builds. -- [x] Package exports type definitions +- [x] Package exports type definitions. - [x] [Added tsc types test](./spec/types.test.ts) ## [v2.0.0] — 2020.07.19 @@ -58,6 +62,7 @@ All notable changes to [Phantom](https://github.com/sidiousvic/phantom) will be - [x] In `phantom.ts` instances of `innerHTML` injection were reinforced with the sanitizer. HMTL is now sanitized before rendering to DOM. [unreleased]: https://github.com/sidiousvic/phantom/compare/v2.1.0...HEAD +[v2.1.1]: https://github.com/sidiousvic/phantom/compare/v2.1.0...v2.1.1 [v2.1.0]: https://github.com/sidiousvic/phantom/compare/v2.0.0...v2.1.0 [v2.0.0]: https://github.com/sidiousvic/phantom/compare/v1.7.7...v2.0.0 [v1.7.7]: https://github.com/sidiousvic/phantom/compare/v1.6.0...v1.7.7 diff --git a/package-lock.json b/package-lock.json index ca6f470..8a84ca8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@sidiousvic/phantom", - "version": "2.1.0", + "version": "2.1.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 9cd695c..3c57cfe 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sidiousvic/phantom", - "version": "2.1.0", + "version": "2.1.1", "description": "A state—reactive DOM rendering engine for building UIs. 👻", "main": "lib/phantom.js", "unpkg": "dist/phantom.js", @@ -33,7 +33,7 @@ "scripts": { "clean": "rimraf lib dist es types", "build": "rollup -c", - "preversion": "npm run build && npm test", + "preversion": "npm test", "postversion": "git push origin --all; git push origin --tags", "test": "jest && tsc spec/types.test.ts --noEmit", "example/pizza": "webpack --config examples/pizza/webpack.config.js && webpack-dev-server --mode development --hot --watch-stdin --config examples/pizza/webpack.config.js", diff --git a/rollup.config.js b/rollup.config.js index 1508432..9bcef5b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -29,7 +29,7 @@ export default [ file: "lib/phantom.js", format: "cjs", indent: false, - exports: "auto", + exports: "named", }, external: makeExternalPredicate([ ...Object.keys(pkg.dependencies || {}), @@ -122,6 +122,7 @@ export default [ format: "umd", name: "Phantom", indent: false, + exports: "named", }, plugins: [ nodeResolve({ @@ -148,6 +149,7 @@ export default [ format: "umd", name: "Phantom", indent: false, + exports: "named", }, plugins: [ nodeResolve({ diff --git a/spec/types.test.ts b/spec/types.test.ts index 7104f97..5281c5b 100644 --- a/spec/types.test.ts +++ b/spec/types.test.ts @@ -1,6 +1,5 @@ import { PhantomAction } from "./../src/types/phantomStore"; -import phantom from "../src/phantom"; -import createPhantomStore from "../src/createPhantomStore"; +import phantom, { createPhantomStore } from "../src/index"; const initialData = { 0: "0", diff --git a/src/index.ts b/src/index.ts index 10d8a22..f5d9641 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,5 @@ -// functions -import createPhantomStore from "./createPhantomStore"; import phantom from "./phantom"; - +import createPhantomStore from "./createPhantomStore"; // types export { PhantomElement, @@ -14,6 +12,5 @@ export { Subscription, } from "./types/phantomStore"; // phantomStore -// API exports -phantom.createPhantomStore = createPhantomStore; +export { createPhantomStore }; export default phantom;