boardgameio / boardgame.io

State Management and Multiplayer Networking for Turn-Based Games
https://boardgame.io
MIT License
10.03k stars 709 forks source link

Cannot find module 'boardgame.io/ui'. #93

Closed vdfdev closed 6 years ago

vdfdev commented 6 years ago

I was trying to recreate the chess on my project, and it seems like the "ui" is not included in the npm package? I am getting this error:

Cannot find module 'boardgame.io/ui'.

I think we are missing a section like:

  {
    input: 'packages/ui.js',
    output: { file: 'dist/ui.js', format: 'umd' },
    name: 'Ui',
    external: [ 'react' ],
    globals: { 'react': 'React' },
    plugins: plugins,
  },

on https://github.com/google/boardgame.io/blob/master/rollup.npm.js ?

Stefan-Hanke commented 6 years ago

Just some observations: Using a vanilla clone, there is no error. The only io.js file present is inside the packages/ directory. Somehow, webpack finds that file and resolves boardgame.io/io to it. Maybe I'm blind but I didn't find any reference to that particular file or directory. package.json only mentions files below dist/. Actually, it looks like webpack resolves any module reference boardgameio/* to packages/*.

nicolodavis commented 6 years ago

@Felizardo This is by design because the UI module is still not really ready. Maybe it's time to release the first version of it. I can add it.

@Stefan-Hanke The .babelrc file contains an alias that does this mapping so that code in the examples can depend on src.

vdfdev commented 6 years ago

+1 for releasing it, even with no API consistency (it is a 0. release afterall). I want to leverage grid, hexgrid, token implementation, they are already very helpful (even if the API changes later) :)