You need to pass the engine so you reference always the same engine in the lib & in the scene.
In order to use an ecs component, you need to import it and pass the engine, so both the library and the scene are talking about the same component instance.
import * as components from '@dcl/ecs/dist/components'
const Transform = components.Transform(engine)
Transform.getOrNull(entity)
Set your NPM_TOKEN on github secrets and the lib will automatically be deployed to npm registry. Be sure to set the package.json#name property with your library name. See .github/workflows/ci.yml file.
npm run dev
to start the typescript compiler.
npm run start
to start the library as a scene.