Unhelpful TypeError on invalid aegir config in TypeScript project
SgtPooki opened this issue · 3 comments
Describe the bug
Starting up a new typescript project using aegir, I forgot to set tsRepo: true
in the aegir config file. I received a TypeError for almost all aegir commands:
TypeError: Unknown file extension ".ts" for "..."
...
Using https://github.com/libp2p/js-libp2p-tcp as an example.. I didn't see tsRepo: true
in that repo, so I forgot that I needed it.
To Reproduce
Steps to reproduce the behavior:
- Create a new npm project (npm init ...)
mkdir test src
touch src/index.ts
touch test/main.spec.ts
npm install -D aegir check-aegir-project
$(npm bin)/check-aegir-project
- Follow the prompts and accept all changes
npm run test
ornpm run build
- See error
Note that creating an aegir config file .aegir.js
with tsRepo: true
will resolve the error.
Expected behavior
Catch this error and display a helpful warning to the user that typescript projects require tsRepo: true
in the aegir config.
Screenshots
N/A
Desktop (please complete the following information):
- OS: macOS Monterey 12.1
- Browser: N/A
- Version: N/A
Smartphone (please complete the following information):
N/A
Additional context
N/A
Can you try this again with aegir@37.x.x
? It's got a bit better at detecting project types, the tsRepo
field isn't necessary any more.
See the migration guide at https://github.com/ipfs/aegir/blob/master/md/migration-to-v37.md and also perhaps the sort of PR that does the upgrade
I'll try to repro with the new version and update this issue
seems to work fine now