rokucommunity / ropm

A package manager for the Roku platform.
MIT License
31 stars 5 forks source link

do not apply annotations to the parent namespace #29

Closed georgejecook closed 3 years ago

georgejecook commented 3 years ago

currently, if a class is the first thing in a file, and it has annotations, then those annotations will get applied to it's namespace.

my only recourse currently is to add dummy functions at the top of all class files which are subject to this.

        it.only('does not apply a classes annotations to the generated namespace', async () => {
            manager.modules = createProjects(hostDir, hostDir, {
                name: 'host',
                dependencies: [{
                    name: 'logger',
                    _files: {
                        'source/lib.d.bs': trim`
                            @doNotMoveMeBro
                            class Person
                            end class
                        `
                    }
                }]
            });

            await process();

            fsEqual(`${hostDir}/source/roku_modules/logger/lib.d.bs`, trim`
                namespace logger
                @doNotMoveMeBro
                class Person
                end class
                end namespace
            `);
        });
georgejecook commented 3 years ago

ok - the workaround doesn't work - i have to add these manually, as they get applied to parent namespaces.

georgejecook commented 3 years ago

made a quick script to fix it; not ideal though.