From 611b86af522567d0a586b40a5950c763ec59eac2 Mon Sep 17 00:00:00 2001 From: Rohan Mukherjee Date: Sat, 19 Feb 2022 20:15:40 +0530 Subject: [PATCH] fix(prepublish): added module, and exports in prepublish script (#21) * fix(prepublish): added module, and exports in prepublish script * fix(prepublish): remove unused library dependencies in prepublish script * docs(README): mention the connect and disconnect methods exposed by the library --- README.md | 3 +++ package.json | 8 +++++++- prepublish.js | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e7ca982..e826100 100644 --- a/README.md +++ b/README.md @@ -121,6 +121,7 @@ function App() { width: '75vw', height: '75vh', }} + ref={ref} /> ); } @@ -151,6 +152,8 @@ interface Props { To know more about these props, check out [API.md](https://github.com/novnc/noVNC/blob/master/docs/API.md#properties). +You can pass a `ref` to the `VncScreen` component, and access the `connect()` and `disconnect()` methods from the library. Check out [#18](https://github.com/roerohan/react-vnc/issues/18) for more details. + ## Roadmap diff --git a/package.json b/package.json index ca5cd42..c5c384c 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,13 @@ "files": [ "dist/" ], - "repository": "https://github.com/roerohan/react-vnc/", + "repository": { + "type": "git", + "url": "git+https://github.com/roerohan/react-vnc.git" + }, + "bugs": { + "url": "https://github.com/roerohan/react-vnc/issues" + }, "dependencies": { "@testing-library/jest-dom": "^5.11.10", "@testing-library/react": "^11.2.6", diff --git a/prepublish.js b/prepublish.js index 2568050..3c01654 100644 --- a/prepublish.js +++ b/prepublish.js @@ -1,10 +1,19 @@ const fs = require('fs'); const pkg = require('./package.json'); +// NOTE(roerohan): remove dependencies that are not needed for the library. const { react, 'react-scripts': reactScripts, 'react-dom': reactDom, + '@testing-library/jest-dom': testingLibraryjestDom, + '@testing-library/react': testingLibraryReact, + '@testing-library/user-event': testingLibraryUserEvent, + '@types/jest': typesJest, + '@types/node': typesNode, + '@types/react': typesReact, + '@types/react-dom': typesReactDom, + 'web-vitals': webVitals, ...dependencies } = pkg.dependencies; @@ -21,6 +30,8 @@ fs.writeFileSync('package.json', JSON.stringify({ repository: pkg.repository, keywords: pkg.keywords, main: pkg.main, + module: pkg.module, + exports: pkg.exports, typings: pkg.typings, publishConfig: pkg.publishConfig, dependencies,