Unnecessary ts build step while "npm run test". Ts generated project.
- Lingua principale
- JavaScript
- Stelle
- 733
- Fork
- 177
- Merge medio
- 1g 20h
- PR unite (30g)
- 3
Descrizione
### 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?
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con lo script npm test generato e test/helper.ts, in particolare con la costruzione di AppPath e con la funzione build che invoca. Usa AutoloadPluginOptions.matchFilter per esaminare quali percorsi TypeScript vengono utilizzati, quindi scegli se i test generati debbano riutilizzare dist/app.js oppure omettere il passaggio iniziale di build. Esegui npm test per confermare che il progetto generato non transpili più l'app due volte.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, typescript
- Ambito
- build-system, cli, testing
- Tipo di issue
- Refactoring
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100