hyperledger-cacti/cacti

build(plugin-satp-hermes): dist/lib/knex/knexfile.ts not under rootDir

Opened this issue · 2 comments

Description

Broken on both main and satp-dev

 cd packages/cactus-plugin-satp-hermes/
yarn ncc build ./dist/lib/main/typescript/plugin-satp-hermes-gateway-cli.js --minify --out=./dist/bundle/ncc/

The interesting parts from the logs that the command above will produce:

[tsl] ERROR
      TS6059: File '/home/peter/a/cacti/packages/cactus-plugin-satp-hermes/dist/lib/knex/knexfile-remote.ts' is not under 'rootDir' '/home/peter/a/cacti/packages/cactus-plugin-satp-hermes/src'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Root file specified for compilation
[tsl] ERROR
      TS6059: File '/home/peter/a/cacti/packages/cactus-plugin-satp-hermes/dist/lib/knex/knexfile.ts' is not under 'rootDir' '/home/peter/a/cacti/packages/cactus-plugin-satp-hermes/src'. 'rootDir' is expected to contain all source files.
  The file is in the program because:
    Root file specified for compilation
[tsl] ERROR in /home/peter/a/cacti/packages/cactus-plugin-satp-hermes/src/test/typescript/make-checks.ts(11,3)
      TS2304: Cannot find name 'expect'.
[tsl] ERROR in /home/peter/a/cacti/packages/cactus-plugin-satp-hermes/src/test/typescript/make-checks.ts(12,3)
      TS2304: Cannot find name 'expect'.
[tsl] ERROR in /home/peter/a/cacti/packages/cactus-plugin-satp-hermes/src/test/typescript/make-checks.ts(14,3)
      TS2304: Cannot find name 'expect'.

2024-12-18-satp-hermes-ncc-bundle.crash.log

Acceptance Criteria

  1. Bundling is passing
  2. tsconfig.json is fixed so that it follows the usual patterns established by the rest of the packages
  3. Build itself is passing as well (yarn tsc)

cc: @RafaelAPB

Thank you, Peter!

I encountered the same error initially when testing the command. However, after deleting the dist folder and building again, the error no longer occurred. It's possible that leftover files from previous builds were causing the issue. I also ran a git reset --hard on my folder to ensure everything was clean, and run it again.
If is not this I don't know what can be.