Unnecessary ts build step while "npm run test". Ts generated project.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 733
- Forks
- 178
- Ø Merge
- 1 T. 20 Std.
- Gemergte PRs (30 T.)
- 3
Beschreibung
### Prerequisites
- [X] I have written a descriptive issue title
- [X] I have searched existing issues to ensure the issue has not already been raised
### Issue
Command "fastify generate . --lang=ts" generates:
- npm script "test": npm run build:ts && tsc -p test/tsconfig.json && tap --ts \"test/**/*.test.ts\"
- file: ./test/helper.ts
Inside ./test/helper.ts the variable ```AppPath``` is created that ends with "src/app.ts".
Before the tests are run, the code inside the ./dist folder will already be transpiled because the first part of the npm script "test" worked (npm run build:ts).
The app will be transpiled again when "build" function is called (imported from ./test/helper.ts).
You can log used typescript file paths in ```AutoloadPluginOptions.matchFilter``` function.
Why not create the ```AppPath``` that ends with "dist/app.js" or remove "npm run build:ts" part from the "test" script?
Beitragsleitfaden
Rechercherichtung
Beginne mit dem generierten npm test-Skript und test/helper.ts, insbesondere mit der Konstruktion von AppPath und der von ihr aufgerufenen build-Funktion. Verwende AutoloadPluginOptions.matchFilter, um zu prüfen, welche TypeScript-Pfade verwendet werden, und entscheide anschließend, ob die generierten Tests dist/app.js wiederverwenden oder den anfänglichen Build-Schritt weglassen sollen. Führe npm test aus, um zu bestätigen, dass das generierte Projekt die App nicht mehr zweimal transpiliert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- build-system, cli, testing
- Issue-Typ
- Refactoring
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100