openscd / open-scd-core

Apache License 2.0
5 stars 8 forks source link

Open-scd-core is not exporting any typed mixins. #88

Closed pascalwilbrink closed 1 year ago

pascalwilbrink commented 1 year ago

Open-scd-core is not exporting any typed mixins. Therefore I cannot use a mixin inside a plugin.

Can these be exported by the foundation as well?

Sander3003 commented 1 year ago

Let's refine this

pascalwilbrink commented 1 year ago

Discussion from Slack

pascal wilbrink 10:51 AM @openscd/open-scd-core is not exporting any Mixins (typed ones). Can this be fixed? Added a github issue here: https://github.com/openscd/open-scd-core/issues/88

#88 Open-scd-core is not exporting any typed mixins. Open-scd-core is not exporting any typed mixins.
Therefore I cannot use a mixin inside a plugin. Can these be exported by the foundation as well? https://github.com/[openscd/open-scd-core](https://github.com/openscd/open-scd-core)|openscd/open-scd-coreopenscd/open-scd-core | Feb 17th | Added by GitHub white_check_mark eyes raised_hands

Christian 11:09 AM Thanks, good idea!

pascal wilbrink 11:11 AM and what about the OpenSCD class?

Christian 11:11 AM I think we already export that from open-scd.ts, don't we? We could export the mixins from there as well. (edited)

pascal wilbrink 11:12 AM https://www.npmjs.com/package/@openscd/open-scd-core?activeTab=explore There's only a foundation.d.ts file in here, no open-scd.d.ts 11:13 import { OpenSCD } from '@openscd/open-scd-core/open-scd.js'; This doesn't work import { OpenSCD } from '@openscd/open-scd-core'; Neither does this (edited)

Christian 11:22 AM "compile": "tsc -b && tsc foundation.ts --declaration --emitDeclarationOnly --outDir dist", in package.json means we currently export types only for foundation.ts, we should add open-scd.ts to that command to fix that. We could do that in the same pull request which re-exports the mixins from open-scd.ts, what do you think?

Sander3003 commented 1 year ago

This won't be necessary anymore if the OpenSCD class is exported. The issue will arrise again if we start with CoMPAS based on OpenSCD-core.

danyill commented 1 year ago

This is still an issue for me, I can't use open-scd-core in tests easily unless I either have the OpenSCD class (as a lit element with types) or I have mixins which I can wrap my plugin in.

So I'd like to re-open this and perhaps we can discuss at refinement.