kentcdodds / kentcdodds/kcd-scripts

Babel removes test files from src directory after building

Open
#163 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
889
Forks
205
PR merge metrics
No merged PRs in 30d

Description

  • kcd-scripts version: 6.6.0
  • node version: 14.14.0
  • npm version: 6.14.8

Relevant code or config

$ kcd-scripts build --out-dir .

What you did:
Run npm run build in the root of the project

What happened:
src/__tests__/gatsby-node.js was deleted

Reproduction repository:
https://github.com/MichaelDeBoey/gatsby-plugin-pinterest/tree/support-pluginOptionsSchema

Problem description:
When implementing https://github.com/robinmetral/gatsby-plugin-pinterest/pull/15 and running npm run build or npm run validate in the root of the project, src/__tests__/gatsby-node.js was deleted.

Suggested solution:
Investigation needed 🤔

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue in the linked repository by running npm run build or npm run validate from the project root, using kcd-scripts build --out-dir . as the reported command. Inspect how the build handles src/__tests__/gatsby-node.js; done means the build no longer deletes that test file while preserving the expected build output.

Written by the indexing model from the issue text.

Assessment

Tech stack
babel, javascript, nodejs
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.