xeokit / sdk

Next-generation alpha-status xeokit viewer in development
https://xeokit.github.io/sdk/docs/api/index.html
GNU Affero General Public License v3.0
17 stars 10 forks source link

npm run dist always fails with TS2307: Cannot find module '@xeokit/data' #7

Open xeolabs opened 5 months ago

xeolabs commented 5 months ago

Attempting to build by running npm run dist, the process always fails with the following message:

@xeokit/gltf2dtx:dist: src/gltf2dtx.ts(3,20): error TS2307: Cannot find module '@xeokit/data' or its corresponding type declarations.

I'm stuck on this error - If anyone can see where I've configured things wrongly that would be cool.

lindsay@mousebear:~/xeolabs/sdk-feb4-2$ npm run dist

> xeokit@0.1.0 dist
> turbo run dist   --concurrency 100

╭───────────────────────────────────────────────────────────────────────╮
│                                                                       │
│                  Update available v1.11.2 ≫ v1.12.3                   │
│    Changelog: https://github.com/vercel/turbo/releases/tag/v1.12.3    │
│           Run "npx @turbo/codemod@latest update" to update            │
│                                                                       │
│        Follow @turborepo for updates: https://x.com/turborepo         │
╰───────────────────────────────────────────────────────────────────────╯
• Packages in scope: @xeokit/basictypes, @xeokit/bcf, @xeokit/boundaries, @xeokit/cameracontrol, @xeokit/cityjson, @xeokit/cityjson2dtx, @xeokit/cityjsontypes_1_1_3, @xeokit/compression, @xeokit/constants, @xeokit/core, @xeokit/curves, @xeokit/data, @xeokit/demos, @xeokit/dotbim, @xeokit/dtx, @xeokit/gltf, @xeokit/gltf2dtx, @xeokit/ifc2dtx, @xeokit/ifctypes, @xeokit/kdtree2, @xeokit/kdtree3, @xeokit/ktx2, @xeokit/las, @xeokit/las2dtx, @xeokit/locale, @xeokit/math, @xeokit/matrix, @xeokit/pick, @xeokit/procgen, @xeokit/rtc, @xeokit/scene, @xeokit/testutils, @xeokit/threedxml, @xeokit/treeview, @xeokit/utils, @xeokit/viewer, @xeokit/webglrenderer, @xeokit/webglutils, @xeokit/webifc
• Running dist in 39 packages
• Remote caching disabled
@xeokit/compression:dist: cache bypass, force executing f5077ea08e20f7ea
@xeokit/pick:dist: cache bypass, force executing c98ac46dfde320e1
@xeokit/math:dist: cache bypass, force executing 49848de5797259ec
@xeokit/cityjsontypes_1_1_3:dist: cache bypass, force executing a8987917917a138f
@xeokit/webifc:dist: cache bypass, force executing 7e0bb63e57ddaacc
@xeokit/gltf:dist: cache bypass, force executing b3cab1843e766eac
@xeokit/rtc:dist: cache bypass, force executing 2f453c93c8d69192
@xeokit/dtx:dist: cache bypass, force executing 964f6be7122489f9
@xeokit/webglrenderer:dist: cache bypass, force executing 4528da8e3054f657
@xeokit/las2dtx:dist: cache bypass, force executing 2427a0dc1a72db17
@xeokit/las:dist: cache bypass, force executing 3b006a415ce2e97b
@xeokit/bcf:dist: cache bypass, force executing 407f06f9fa354bee
@xeokit/viewer:dist: cache bypass, force executing b79f539051e4abd7
@xeokit/dotbim:dist: cache bypass, force executing fb692263329469d8
@xeokit/utils:dist: cache bypass, force executing 6e329a870559b5ab
@xeokit/ifctypes:dist: cache bypass, force executing 0583eea0c6f14b8c
@xeokit/ifc2dtx:dist: cache bypass, force executing dea2acebbda7d363
@xeokit/ktx2:dist: cache bypass, force executing 58ed3487f61ddbfd
@xeokit/matrix:dist: cache bypass, force executing 0a4a76a90b60e7b6
@xeokit/procgen:dist: cache bypass, force executing 15970707e1be1dc3
@xeokit/scene:dist: cache bypass, force executing 2a7028e1d3cad41c
@xeokit/data:dist: cache bypass, force executing bb8e896a58d48296
@xeokit/kdtree3:dist: cache bypass, force executing abbf858cef3659bf
@xeokit/basictypes:dist: cache bypass, force executing 1a8085121bc68d20
@xeokit/curves:dist: cache bypass, force executing e2a3b2b58944c654
@xeokit/gltf2dtx:dist: cache bypass, force executing d3605a8202d81d8a
@xeokit/constants:dist: cache bypass, force executing 9ebb68d1be47b9ad
@xeokit/treeview:dist: cache bypass, force executing 8e5f20e11164591c
@xeokit/core:dist: cache bypass, force executing e76478bee5c9fe55
@xeokit/cityjson2dtx:dist: cache bypass, force executing 82659b4c0235f2f4
@xeokit/kdtree2:dist: cache bypass, force executing 8fe02feafe180fca
@xeokit/locale:dist: cache bypass, force executing 0cc0b18c521cc7c3
@xeokit/webglutils:dist: cache bypass, force executing 9274ee03b4bd3da4
@xeokit/cityjson:dist: cache bypass, force executing 0a1acaff8d2d25e2
@xeokit/cameracontrol:dist: cache bypass, force executing deecc4b7cb81f9e5
@xeokit/boundaries:dist: cache bypass, force executing 1e3526e05816060f
@xeokit/threedxml:dist: cache bypass, force executing ede1850de8ce6ef6
@xeokit/compression:dist: yarn run v1.22.19
@xeokit/math:dist: yarn run v1.22.19
@xeokit/gltf:dist: yarn run v1.22.19
@xeokit/pick:dist: yarn run v1.22.19
@xeokit/webifc:dist: yarn run v1.22.19
@xeokit/cityjsontypes_1_1_3:dist: yarn run v1.22.19
@xeokit/webglrenderer:dist: yarn run v1.22.19
@xeokit/las2dtx:dist: yarn run v1.22.19
@xeokit/dtx:dist: yarn run v1.22.19
@xeokit/dotbim:dist: yarn run v1.22.19
@xeokit/las:dist: yarn run v1.22.19
@xeokit/utils:dist: yarn run v1.22.19
@xeokit/rtc:dist: yarn run v1.22.19
@xeokit/viewer:dist: yarn run v1.22.19
@xeokit/ifctypes:dist: yarn run v1.22.19
@xeokit/boundaries:dist: yarn run v1.22.19
@xeokit/ktx2:dist: yarn run v1.22.19
@xeokit/matrix:dist: yarn run v1.22.19
@xeokit/scene:dist: yarn run v1.22.19
@xeokit/procgen:dist: yarn run v1.22.19
@xeokit/data:dist: yarn run v1.22.19
@xeokit/gltf:dist: $ tsc
@xeokit/constants:dist: yarn run v1.22.19
@xeokit/math:dist: $ tsc
@xeokit/las2dtx:dist: $ tsc
@xeokit/kdtree3:dist: yarn run v1.22.19
@xeokit/compression:dist: $ tsc
@xeokit/cityjsontypes_1_1_3:dist: $ tsc
@xeokit/curves:dist: yarn run v1.22.19
@xeokit/gltf2dtx:dist: yarn run v1.22.19
@xeokit/ifc2dtx:dist: yarn run v1.22.19
@xeokit/webglutils:dist: yarn run v1.22.19
@xeokit/cityjson2dtx:dist: yarn run v1.22.19
@xeokit/treeview:dist: yarn run v1.22.19
@xeokit/core:dist: yarn run v1.22.19
@xeokit/dtx:dist: $ tsc
@xeokit/basictypes:dist: yarn run v1.22.19
@xeokit/utils:dist: $ tsc
@xeokit/viewer:dist: $ tsc
@xeokit/rtc:dist: $ tsc
@xeokit/ifctypes:dist: $ tsc
@xeokit/procgen:dist: $ tsc
@xeokit/locale:dist: yarn run v1.22.19
@xeokit/boundaries:dist: $ tsc
@xeokit/kdtree2:dist: yarn run v1.22.19
@xeokit/ktx2:dist: $ tsc
@xeokit/las:dist: $ tsc
@xeokit/constants:dist: $ tsc
@xeokit/dotbim:dist: $ tsc
@xeokit/webifc:dist: $ tsc
@xeokit/data:dist: $ tsc
@xeokit/bcf:dist: yarn run v1.22.19
@xeokit/webglrenderer:dist: $ tsc
@xeokit/pick:dist: $ tsc
@xeokit/threedxml:dist: yarn run v1.22.19
@xeokit/kdtree3:dist: $ tsc
@xeokit/matrix:dist: $ tsc
@xeokit/scene:dist: $ tsc
@xeokit/core:dist: $ tsc
@xeokit/basictypes:dist: $ tsc
@xeokit/cityjson2dtx:dist: $ tsc
@xeokit/ifc2dtx:dist: $ tsc
@xeokit/cameracontrol:dist: yarn run v1.22.19
@xeokit/curves:dist: $ tsc
@xeokit/treeview:dist: $ tsc
@xeokit/gltf2dtx:dist: $ tsc
@xeokit/cityjson:dist: yarn run v1.22.19
@xeokit/webglutils:dist: $ tsc
@xeokit/locale:dist: $ tsc
@xeokit/bcf:dist: $ tsc
@xeokit/kdtree2:dist: $ tsc
@xeokit/threedxml:dist: $ tsc
@xeokit/cityjson:dist: $ tsc
@xeokit/cameracontrol:dist: $ tsc
@xeokit/math:dist: Done in 4.40s.
@xeokit/cityjson2dtx:dist: Done in 4.33s.
@xeokit/utils:dist: Done in 4.53s.
@xeokit/cityjsontypes_1_1_3:dist: Done in 4.57s.
@xeokit/constants:dist: Done in 4.55s.
@xeokit/procgen:dist: Done in 4.64s.
@xeokit/ifctypes:dist: Done in 4.75s.
@xeokit/gltf2dtx:dist: src/gltf2dtx.ts(3,20): error TS2307: Cannot find module '@xeokit/data' or its corresponding type declarations.
@xeokit/ktx2:dist: Done in 4.82s.
@xeokit/data:dist: Done in 4.84s.
@xeokit/kdtree3:dist: Done in 4.83s.
@xeokit/gltf2dtx:dist: error Command failed with exit code 2.
@xeokit/gltf2dtx:dist: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@xeokit/gltf2dtx:dist: ERROR: command finished with error: command (/home/lindsay/xeolabs/sdk-feb4-2/packages/gltf2dtx) /usr/local/bin/yarn run dist exited (2)
@xeokit/gltf2dtx#dist: command (/home/lindsay/xeolabs/sdk-feb4-2/packages/gltf2dtx) /usr/local/bin/yarn run dist exited (2)

 Tasks:    10 successful, 37 total
Cached:    0 cached, 37 total
  Time:    5.635s 
Failed:    @xeokit/gltf2dtx#dist

 ERROR  run failed: command  exited (2)
lindsay@mousebear:~/xeolabs/sdk-feb4-2$ 
DhivinX commented 5 months ago

Hello,

I tried to reproduce the problem myself. And the situation is as follows.

The problem lies in the order of building the packages, in turbo you should indicate in the "dist" section, "dependsOn": ["^dist"] - this means building the dependency packages first. I managed to build the repository, but I had to perform some of the steps manually. (I manually called build math, scene, webifc, viewer first)

Another thing is tsconfig, here references and paths seem unnecessary to me when we use ESM packages (ready-built packages downloaded from node_modules).

Another thing is that I see that there is no lock file in the repo, from npm or yarn, you should always send such a file to the version control system, this will allow for correct and faster reconstruction of dependencies.

And the last thing is I wouldn't mix package managers, if we use npm then not yarn and vice versa. Yarn also has "yarn publish" but it resolves dependencies in a completely different way than NPM, which is crucial in finding the right dependencies.

xeolabs commented 5 months ago

Thanks @DhivinX, I'll fix those things.

DhivinX commented 5 months ago

@xeolabs I can integrate PNPM like a package manager. I can do it this week (max next week) and maybe I can fix most of the conflicts. What do you think?

xeolabs commented 5 months ago

@xeolabs I can integrate PNPM like a package manager. I can do it this week (max next week) and maybe I can fix most of the conflicts. What do you think?

@DhivinX yes please I think that would be ideal. Go for it.

DhivinX commented 4 months ago

Fixed by https://github.com/xeokit/sdk/pull/12