Skip to content

incorrectly renames packages to undefined, when importing. #69

@georgejecook

Description

@georgejecook

background

roku-log (https://github.com/georgejecook/roku-log) uses the rokucommunity@bslib. However, when transpiled it uses bslib, without rokucommunity namespace. don't know why. described here: rokucommunity/brighterscript#809.

When I import roku-log as a named npm import in projects, such as maestro, I find that the packages are corrupted, and replaced with /undefined/bslib.brs.

steps to reproduce

You will observe the roku-log, xml files are now broken. e.g.

HTTPTransport.xml

<?xml version='1.0' encoding='UTF-8' ?>
<component name='log_HTTPTransport' extends='Group'>
    <interface>
        <field id='maxLinesBeforeSending' type='integer' value='20' />
        <field id='maxSecondsBeforeSending' type='integer' value='5' />
        <field id='url' type='string' value='' />
        <field id='sendNow' type='boolean' value='false' alwaysNotify='true' onChange='sendLogsNow' />
        <field id='sendAutomatically' type='boolean' value='true' />
        <function name='logItem' />
        <function name='sendLogsNow' />
    </interface>
    <script type="text/brightscript" uri="pkg:/components/roku_modules/log/HTTPTransport.brs" />
    <script type="text/brightscript" uri="pkg:/source/roku_modules/undefined/bslib.brs" />
    <children />
</component>
<!--//# sourceMappingURL=./HTTPTransport.xml.map -->

I have had to workaround this with a script that I use to spot and fix these. Other users of my libraries are now hitting these problems, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions