fastify / fastify/fastify-cli

Unnecessary ts build step while "npm run test". Ts generated project.

Open
#640 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
733
Forks
177
Avg merge
1d 20h
Merged PRs (30d)
3

Description

### 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.