Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Dependencies of produced npm package now contain all required packages #20

Merged
merged 2 commits into from
May 10, 2021

Conversation

UncleSamSwiss
Copy link
Contributor

(except for core React modules)

Tested with the current create-adapter version.

This will fix #17

@AlCalzone
Copy link
Contributor

@GermanBluefox please merge and release!

@GermanBluefox
Copy link
Collaborator

I don't understand, why are modules were removed...

@AlCalzone
Copy link
Contributor

AlCalzone commented May 9, 2021

"dependencies": {
"@sentry/browser": "^6.3.5",
"@material-ui/core": "^4.11.4",
"react-color": "^2.19.3",
"react-colorful": "^5.1.4",
"react-dropzone": "^11.3.2",
"react-inlinesvg": "^2.3.0",
"@types/iobroker": "^3.2.9"

They are included as dependencies in the package.json of this module (see gulpfile change). Once a dev has included @iobroker/adapter-react, he no longer has to add them to his own package.json, so it shouldn't be mentioned in the README.

@Apollon77
Copy link
Collaborator

LGTM

@GermanBluefox
Copy link
Collaborator

GermanBluefox commented May 10, 2021

"dependencies": {
"@sentry/browser": "^6.3.5",
"@material-ui/core": "^4.11.4",
"react-color": "^2.19.3",
"react-colorful": "^5.1.4",
"react-dropzone": "^11.3.2",
"react-inlinesvg": "^2.3.0",
"@types/iobroker": "^3.2.9"

They are included as dependencies in the package.json of this module (see gulpfile change). Once a dev has included @iobroker/adapter-react, he no longer has to add them to his own package.json, so it shouldn't be mentioned in the README.

But it is only valid, if the user uses dev server. And why the gulp file takes and overwrite existing deps? And if I use something else? Maps, image processing? It will be overwritten by gulp task

@AlCalzone
Copy link
Contributor

And why the gulp file takes and overwrite existing deps?

I don't understand. You use the gulpfile to release an npm package without dependencies, yet that npm package needs those dependencies to work. There are no dependencies that get overwritten.
Right now devs need to figure out which version of adapter-react needs which dependencies by going through the git history here and looking at the readme for the version they have installed. And they have to add them to their own package.json themselves.

The change here only makes it so the released npm package contains the correct dependencies, so this is no longer necessary.

@AlCalzone
Copy link
Contributor

grafik

@UncleSamSwiss
Copy link
Contributor Author

UncleSamSwiss commented May 10, 2021

But it is only valid, if the user uses dev server. And why the gulp file takes and overwrite existing deps? And if I use something else? Maps, image processing? It will be overwritten by gulp task

This has nothing to do with dev-server. It is about using adapter-react with Adapter Creator. The dependencies you create in your package.json (while creating the adapter-react NPM package) are currently empty, thus as @AlCalzone said, every developer needs to add your dependencies as his dependencies. This is wrong. With npm, every package has its own dependencies, and those dependencies need to be mentioned in the package.json of the published npm package.

If you look at your published npm package, it has no dependencies at all: https://cdn.jsdelivr.net/npm/@iobroker/adapter-react/package.json

@GermanBluefox GermanBluefox merged commit cba5d3b into ioBroker:master May 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Publish NPM package with the right dependencies
4 participants