Skip to content

Commit

Permalink
fix(prepublish): added module, and exports in prepublish script (#21)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
roerohan authored Feb 19, 2022
1 parent f7b77d8 commit 611b86a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ function App() {
width: '75vw',
height: '75vh',
}}
ref={ref}
/>
);
}
Expand Down Expand Up @@ -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 -->
## Roadmap

Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 11 additions & 0 deletions prepublish.js
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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,
Expand Down

0 comments on commit 611b86a

Please sign in to comment.