Skip to content

fix(golden-layout): exclude test files from build output#2642

Merged
mofojed merged 1 commit intodeephaven:mainfrom
mofojed:fix-golden-layout-tests-in-dist
Mar 30, 2026
Merged

fix(golden-layout): exclude test files from build output#2642
mofojed merged 1 commit intodeephaven:mainfrom
mofojed:fix-golden-layout-tests-in-dist

Conversation

@mofojed
Copy link
Copy Markdown
Member

@mofojed mofojed commented Mar 25, 2026

Noticed the test files were being included in golden-layout input. We shouldn't do that.

@mofojed mofojed requested a review from dsmmcken March 25, 2026 18:46
@mofojed mofojed self-assigned this Mar 25, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 49.77%. Comparing base (6775c43) to head (257cbe0).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2642   +/-   ##
=======================================
  Coverage   49.77%   49.77%           
=======================================
  Files         774      774           
  Lines       43846    43860   +14     
  Branches    11286    11291    +5     
=======================================
+ Hits        21825    21832    +7     
- Misses      21975    22010   +35     
+ Partials       46       18   -28     
Flag Coverage Δ
unit 49.77% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent packages/golden-layout test sources and test-only utilities from being included in build artifacts (notably dist/), so they don’t end up in the published package output.

Changes:

  • Expanded tsconfig.json exclusions to omit src/__tests__, src/test-utils, and *.test.* files.
  • Added a Babel CLI --ignore list to skip compiling test and test-utility sources into dist/.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/golden-layout/tsconfig.json Excludes test directories/files from TypeScript project inputs.
packages/golden-layout/package.json Updates Babel build command to ignore tests/test-utils during compilation to dist/.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/golden-layout/package.json Outdated
"build": "cross-env NODE_ENV=production run-p build:*",
"build:sass": "sass --embed-sources --load-path=../../node_modules --style=compressed ./src:./dist ./scss:./css",
"build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.js,.tsx,.jsx\" --source-maps --root-mode upward"
"build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.js,.tsx,.jsx\" --source-maps --root-mode upward --ignore \"./src/__tests__,./src/test-utils,./src/**/*.test.*\""
Copy link

Copilot AI Mar 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --ignore patterns are likely not matching the paths Babel sees (Babel’s shared babel.config.js uses globs like **/__mocks__/* and a .test.* regex, i.e. no leading ./ and directory patterns include wildcards). As written, patterns like ./src/test-utils may not exclude files like src/test-utils/testUtils.ts, which would keep test utilities in the published dist/. Consider switching to glob patterns that match subpaths (e.g. src/test-utils/** and src/__tests__/** or **/test-utils/**) and dropping the redundant .test.* ignore since it’s already handled in babel.config.js.

Suggested change
"build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.js,.tsx,.jsx\" --source-maps --root-mode upward --ignore \"./src/__tests__,./src/test-utils,./src/**/*.test.*\""
"build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.js,.tsx,.jsx\" --source-maps --root-mode upward --ignore \"src/__tests__/**,src/test-utils/**\""

Copilot uses AI. Check for mistakes.
@mofojed mofojed force-pushed the fix-golden-layout-tests-in-dist branch from 180519b to 257cbe0 Compare March 26, 2026 14:03
@mofojed mofojed requested a review from Copilot March 26, 2026 17:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mofojed mofojed requested review from a team and vbabich and removed request for a team March 27, 2026 17:57
@mofojed mofojed merged commit dc84a67 into deephaven:main Mar 30, 2026
15 checks passed
@mofojed mofojed deleted the fix-golden-layout-tests-in-dist branch March 30, 2026 13:06
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants