Comments (7)
Mhh, correct. I think wot-typescript-definitions
is a core dependency.
Hence, I assume this needs to be fixed for other packages (e.g., binding-coap etc) also.
I will provide a fix.
from node-wot.
Related question: in package.json
of binding-fujitsu there is the following case
"devDependencies": {
"@node-wot/td-tools": "0.6.1",
...
},
"dependencies": {
"@node-wot/core": "0.6.1",
...
}
@node-wot/core
refers to @node-wot/td-tools
as default dependency. Hence this is broken also, I believe.
According to my understanding devDependencies
should be used only if the dependency
- is used for building the code (TypeScript dependencies) or
- if it is necessary for tests only
In any other case it should be put as dependencies
.
@hasbel any opinion?
from node-wot.
There is no need to add the typescript definitions to the dependencies
of the bindings. They have core
as a dependency and core
should provide the type definitions for them.
Your understanding of devDependencies
is correct, but types are a bit special in the sense that they may only be needed during development, but may also be exported as well in some cases.
In general, if a type definition (be it wot-typescript-definitions
or any other @type/<name>
from definitelyTyped) is exported, it needs to be included in dependencies
, otherwise it can be in devDependencies
.
For example, if we look inside the dist
folder of a binding, we can see that inside the *.d.ts
typescript definitions, there is no mention of the wot-typescript-definitions
. However inside core
, we can see that they are mentioned in many places, including for example comsumed-thing.d.ts
.
As for fujitsu binding, you are right, @node-wot/td-tools
should be in dependencies
because is needed for the code to run.
from node-wot.
As for fujitsu binding, you are right, @node-wot/td-tools should be in dependencies because is needed for the code to run.
I will look into that more closely but I think in this case we can even safely remove "@node-wot/td-tools" from "devDependencies" without the need of adding it to "dependencies".
i.e. @node-wot/core
depends on @node-wot/td-tools
Doing so in all package.json
would clean-up the dependencies...
from node-wot.
I stumbled across this as well.
I now have the -definitions
in the devDependencies
of my project, which is logically the right place in my opinion:
- they are needed so I can build
- they are not needed at runtime
However, AFAIK there is no way to tell yarn/npm that whoever imports this package in runtime should have this other dependency in his dev-Deps. (might be there is a way)
so runtime dependencies makes sense, but has the risk to be inconsistent should the wot-typescript-definitions
have changes that are not reflected in node-wot
(exposedThing.writeProperty(...)
is such an example currently)
My suggestion would be to re-expose the types, so that users of node-wot
can import them from core
(or a specific definitons
module) that will always be code-compliant (but can deviate from the standard if it evolved away)
from node-wot.
I pushed a commit (see 20ce754) that cleans-up some dependencies and fixes the problem from @hasbel
Unfortunately implicit dependencies need to be put as an additional dependency if the types are used. I did not find another good solution for it..
@hasbel @h0ru5
Shall we do some more changes or leave it like this?
from node-wot.
No response and I assume issue is fixed by now.
Feel free to re-open the issue if this is not the case.
from node-wot.
Related Issues (20)
- Upgrading to ES2021 HOT 2
- allowSelfSigned not working for requestThingDescription HOT 4
- findProtocol SHOULD NOT require base HOT 4
- CI - Add Node.js 22 to CI tests
- CoAP issue on local machine (Windows) - nO HOT 2
- Async actions should not try to validate the value according DataSchema
- action and event affordance do not raise error when data schema does not match HOT 1
- events without subprotocol might be causing unexpected behaviour HOT 3
- Export WoT implementation type
- Modbus Test issue with modv:function HOT 1
- Issue with void-obj of Test Thing HOT 1
- Follow-up on validating output for (async) actions
- Re-creating package-lock.json fails HOT 7
- observe property deserialized value (may) not (be) completely consistent HOT 5
- Deprecating tm-helpers from node-wot HOT 3
- [test] Convert unhandledRejection to uncaughtException
- TODOs after major release
- Re-activate mbus tests on Windows
- two netconf-codec.ts files
- Replacing Protocol and Port Detection HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-wot.