Skip to content

Unhelpful TypeError on invalid aegir config in TypeScript project #938

@SgtPooki

Description

@SgtPooki

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:

  1. Create a new npm project (npm init ...)
  2. mkdir test src
  3. touch src/index.ts
  4. touch test/main.spec.ts
  5. npm install -D aegir check-aegir-project
  6. $(npm bin)/check-aegir-project
  7. Follow the prompts and accept all changes
  8. npm run test or npm run build
  9. 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

Metadata

Metadata

Assignees

Labels

P2Medium: Good to have, but can wait until someone steps uphelp wantedSeeking public contribution on this issuekind/enhancementA net-new feature or improvement to an existing feature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions