aurelia / aurelia/cli

[Suggestion] Drop .ext and code duplication in js+ts files

Open
#1,119 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
402
Forks
134
PR merge metrics
No merged PRs in 30d

Description

**I'm submitting a suggestion to improve cli maintainability**

1) The CLI skeletons contains `.ext` files to be able to flexibly change the output to either JS or TS based on choices made by the developer setting up a new project.

Although this is a great concept it has some drawbacks.
- IDE does not know what to do with these files (work around: manually setting file type)
- Linter don't work on these files
- Not unit testable, files cannot be required as-is
- These files are never properly setup for TS since the typings would not work in a JS output which leads me to:

2) When we want to add a proper TS file with typings to a skeleton we have a JS and TS variant in a skeleton. This results in duplicate code and maintenance, it easy to forgot one or the other.

**Suggestion**
If https://github.com/aurelia/cli/pull/1067 is completed a transpiler is introduced.
We could change all skeletons to a TS setup, this would give the TS users properly typed files and for the JS users we could simply transpile these files. This would remove duplicate code and would provide a normal development experience in the IDE.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the CLI skeletons and the `.ext` files, then read pull request #1067 to understand the proposed transpiler. Compare the JavaScript and TypeScript variants across the skeletons; done means the duplicate variants and `.ext` files are replaced by a TypeScript setup that can produce both supported outputs.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
cli, tooling
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.