rokucommunity / sample-projects

A collection of sample projects showing ways you can configure your project with different rokucommunity tools
MIT License
9 stars 3 forks source link

how do I use the component-library-and-project sample? #4

Open ZeeD opened 1 year ago

ZeeD commented 1 year ago

I'm trying the demos in this project and I'm stuck with component-library-and-project. I see there are two bs project; complib and app. I cloned the repo on my machine, entered in complib folder and successfully run bsc that created complib/out/complib.zip. Now I want to "use" this library in app. Running bsc inside app just return errors. On https://github.com/rokucommunity/sample-projects/blob/de0ade935112613b63af83cdf51ade02c928ce51/component-library-and-project/app/manifest#L10 I see that it expect to download complib.zip from http. I changed to point to localhost and started a webserver locally (just python3 -mhttp.server in the complib/out folder). I can succesfully download the .zip file from firefox. Still, I have errors running bsc:

.../component-library-and-project/app$ bsc
[03:37:09:7520 PM]  No bsconfig.json file found, using default options
[03:37:09:7550 PM]  Loading 0 plugins for cwd ".../component-library-and-project/app"
[03:37:09:7590 PM]  Parsing files
[03:37:09:7870 PM]  Parsing files finished. (27.954ms)
[03:37:09:7880 PM]  Validating project
[03:37:09:7920 PM]  Validating project finished. (4.132ms)

components/MainScene.brs:28:9 - error BS1001: Cannot find name 'dialog'

 28          dialog.update({
 __          ~~~~~~

[03:37:09:7940 PM]  Found 1 error
$

what I'm missing?

ZeeD commented 1 year ago

wait. Maybe I misunderstood the problem. Could just be a bug in app? https://github.com/rokucommunity/sample-projects/blob/de0ade935112613b63af83cdf51ade02c928ce51/component-library-and-project/app/components/MainScene.brs#L26-L28

should dialog actually be m.dialog?

TwitchBronBron commented 1 year ago

You're right, that's a bug in the code, it should be m.dialog. However, that shouldn't stop the project from working.

One of the major points of this sample is actually to show you you can do component library launching and debugging using just the built-in vscode extension tools. You shouldn't need to spin up your own component library http server as the BrightScript vscode extension will do that for you.

I'm adding some instructions for this sample right now, I'll comment again when it's ready.

TwitchBronBron commented 1 year ago

Ok, I've added some instructions here. Give them a try, let me know if you have any more questions. :)