This repository was archived by the owner on Apr 13, 2025. It is now read-only.
Fix 0.1.0
publishing problems
#228
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
0.1.0
release had some problems:Missing
tslib
dependency onnodecg-io-core
Since the beginning of nodecg-io we always had
importHelpers
set to true intsconfig.common.json
. Meaning TS is allowed to generate code that usestslib
. One day I removedtslib
as a dependency because it was working without it, we had no code that neededtslib
at that time.With Simplify importing of core #163 this changed because we had a star export, which needs
tslib
, but it worked fine in our dev environment because we have hoisted dependencies and various other packages depend ontslib
.Because of this services cannot registered when they are installed in a non-hoisted environment and also bundles cannot use the core, unless the import everything using the full paths.
Fixed in f89e593 by adding
tslib
as a dependency to the core.Nanoleaf and Tiane exposed fetch/ws types but typings were in
devDependencies
In a perfect world (see issue 3) typings that are only used internally can be left in
devDependencies
and only typings that are exposed need to be independencies
. This is also true for most of our published packages but not for Nanoleaf and Tiane.Nanoleaf exposed a fetch type in the following method:
NanoleafClient.getAllPanelInfo(): Promise<fetch.Response>
(maybe that function also should get a proper return type). Thus@types/fetch
need to be a production dependency, which has been fixed in 8d8b318.Tiane exposed the websocket client type in its public constructor of the Tiane service class:
constructor(websocket: WebSocket)
. This has been fixed in 63c9da5 by making the constructor private and theconnectTiane
function a public static method ofTiane
.Both of these issues weren't found in our dev environment because we always install
devDependencies
.The services are usable with this error but you cannot compile TypeScripts bundle depending on them unless you install the typings for these packages into your bundle.
Release of raw
.ts
files instead of generated.d.ts
typingsTypeScript can gather type information using the source
.ts
files or.d.ts
which only contain the typings. While developing we always used the first way and it worked. The problem is that those files contain all imports, including those that are only used internally like@types/crypto-js
(used by core) even when they are not exported. But in a production install we don't have those dependencies and we therefore cannot use the.ts
files when e.g. building a bundle.Because of this bundles that are using ahk, curseforge, intellij, nanoleaf, tiane and xdotool cannot be compiled unless you temporarily install the
devDependencies
.The solution to this is to generate the
.d.ts
definitions and to not publish the source.ts
files. This has been done in 665e311 and 3464b6d.These changes will be cherry-picked to
release/0.1
and we will have patch release (0.1.1
) published for the following packages:The other services work as they are and because they use
^0.1.0
as a version selector fornodecg-io-core
they will be able to work with the new version of the core.