Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
82782eb
update tsconfig.json excludes
TheSonOfThomp Aug 25, 2025
59171bf
update TS in testing-lib context spec
TheSonOfThomp Aug 25, 2025
4174a45
updates tsconfigs
TheSonOfThomp Aug 25, 2025
12a2950
lockfile
TheSonOfThomp Aug 25, 2025
df1e1ed
Update chat provider tsconfig.json
TheSonOfThomp Aug 25, 2025
6e8e1ae
Update isValidDate.spec.ts
TheSonOfThomp Aug 25, 2025
73c0308
Update hooks tsconfig.json
TheSonOfThomp Aug 25, 2025
b293740
update icon tsconfig.json
TheSonOfThomp Aug 25, 2025
3c04337
update typography specs
TheSonOfThomp Aug 25, 2025
d62c568
updates charts specs
TheSonOfThomp Aug 25, 2025
082d644
Update Button.spec.tsx
TheSonOfThomp Aug 25, 2025
30e1fcc
Update FeaturesEmptyState.spec.tsx
TheSonOfThomp Aug 25, 2025
f8ed45d
add FIXME
TheSonOfThomp Aug 26, 2025
938cbf1
changesets
TheSonOfThomp Aug 26, 2025
d6bf418
Update tsconfig-spec-files.md
TheSonOfThomp Aug 26, 2025
3f95643
update tsconfig - descendants & popover
TheSonOfThomp Aug 26, 2025
6f37c1c
updates descendants test utils
TheSonOfThomp Aug 26, 2025
9d6cf0d
add @lg-tools/storybook-utils to hooks
TheSonOfThomp Aug 26, 2025
07a1f66
Update PasswordInput.spec.tsx
TheSonOfThomp Aug 26, 2025
acdf9ff
Update SearchInput.testutils types
TheSonOfThomp Aug 26, 2025
736e6e0
add @storybook/types to toast
TheSonOfThomp Aug 26, 2025
715ea7a
Update Pagination.spec.tsx
TheSonOfThomp Aug 26, 2025
13734a2
Update InfoSprinkle.spec.tsx
TheSonOfThomp Aug 26, 2025
10a0d48
Update tsconfig.json
TheSonOfThomp Aug 26, 2025
e15b267
update table util types
TheSonOfThomp Aug 26, 2025
9e21b3f
Update getNewSegmentValueFromInputValue.spec.ts
TheSonOfThomp Aug 26, 2025
fb65f4f
Update Menu.spec.tsx
TheSonOfThomp Aug 26, 2025
01b3d02
Update tsconfig.json
TheSonOfThomp Aug 26, 2025
81ee30e
merge
TheSonOfThomp Aug 28, 2025
0d04e8b
fix renderCustomTooltip test util
TheSonOfThomp Aug 28, 2025
89eb2a8
Update index.ts
TheSonOfThomp Aug 28, 2025
d462bf8
Merge branch 'main' into a/ts-spec
TheSonOfThomp Aug 28, 2025
eb92c42
update icon checksum
TheSonOfThomp Aug 28, 2025
b849fbe
Update Highlight.stories.tsx
TheSonOfThomp Aug 28, 2025
9f81946
update icon types entry point
TheSonOfThomp Aug 28, 2025
5b00553
ignore missing devDeps in validate
TheSonOfThomp Aug 28, 2025
63d8c43
Merge branch 'main' into a/ts-spec
TheSonOfThomp Aug 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/descentents-test-utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lg-chat/leafygreen-chat-provider': patch
---

Resolves TS scoping errors by moving `test` utilities into `src`.
5 changes: 5 additions & 0 deletions .changeset/hooks-packagejson.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/hooks': patch
---

Adds `react-test-renderer` as devDependency
5 changes: 5 additions & 0 deletions .changeset/tiny-pens-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@lg-tools/validate': minor
---

Validate script no longer fails if a package is missing a `devDependency`. This was done due to a significant number of false positives, and since using `pnpm` to resolve packages should flag the true missing `devDeps` in the build, test, or stories step
106 changes: 106 additions & 0 deletions .changeset/tsconfig-spec-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
'@leafygreen-ui/a11y': patch
'@leafygreen-ui/avatar': patch
'@leafygreen-ui/badge': patch
'@leafygreen-ui/banner': patch
'@leafygreen-ui/box': patch
'@leafygreen-ui/button': patch
'@leafygreen-ui/callout': patch
'@leafygreen-ui/card': patch
'@leafygreen-ui/checkbox': patch
'@leafygreen-ui/chip': patch
'@leafygreen-ui/code': patch
'@leafygreen-ui/combobox': patch
'@leafygreen-ui/confirmation-modal': patch
'@leafygreen-ui/context-drawer': patch
'@leafygreen-ui/copyable': patch
'@leafygreen-ui/date-picker': patch
'@leafygreen-ui/date-utils': patch
'@leafygreen-ui/descendants': patch
'@leafygreen-ui/drawer': patch
'@leafygreen-ui/emotion': patch
'@leafygreen-ui/empty-state': patch
'@leafygreen-ui/expandable-card': patch
'@leafygreen-ui/form-field': patch
'@leafygreen-ui/form-footer': patch
'@leafygreen-ui/gallery-indicator': patch
'@leafygreen-ui/guide-cue': patch
'@leafygreen-ui/hooks': patch
'@leafygreen-ui/icon': patch
'@leafygreen-ui/icon-button': patch
'@leafygreen-ui/info-sprinkle': patch
'@leafygreen-ui/input-option': patch
'@leafygreen-ui/inline-definition': patch
'@leafygreen-ui/leafygreen-provider': patch
'@leafygreen-ui/lib': patch
'@leafygreen-ui/loading-indicator': patch
'@leafygreen-ui/marketing-modal': patch
'@leafygreen-ui/menu': patch
'@leafygreen-ui/modal': patch
'@leafygreen-ui/number-input': patch
'@leafygreen-ui/ordered-list': patch
'@leafygreen-ui/palette': patch
'@leafygreen-ui/pagination': patch
'@leafygreen-ui/password-input': patch
'@leafygreen-ui/popover': patch
'@leafygreen-ui/portal': patch
'@leafygreen-ui/preview-card': patch
'@leafygreen-ui/radio-box-group': patch
'@leafygreen-ui/radio-group': patch
'@leafygreen-ui/ripple': patch
'@leafygreen-ui/search-input': patch
'@leafygreen-ui/section-nav': patch
'@leafygreen-ui/select': patch
'@leafygreen-ui/segmented-control': patch
'@leafygreen-ui/side-nav': patch
'@leafygreen-ui/skeleton-loader': patch
'@leafygreen-ui/split-button': patch
'@leafygreen-ui/stepper': patch
'@leafygreen-ui/table': patch
'@leafygreen-ui/tabs': patch
'@leafygreen-ui/testing-lib': patch
'@leafygreen-ui/text-area': patch
'@leafygreen-ui/text-input': patch
'@leafygreen-ui/tokens': patch
'@leafygreen-ui/toast': patch
'@leafygreen-ui/toggle': patch
'@leafygreen-ui/toolbar': patch
'@leafygreen-ui/tooltip': patch
'@leafygreen-ui/typography': patch
'@lg-charts/chart-card': patch
'@lg-charts/colors': patch
'@lg-charts/core': patch
'@lg-charts/drag-provider': patch
'@lg-charts/legend': patch
'@lg-charts/series-provider': patch
'@lg-chat/avatar': patch
'@lg-chat/chat-disclaimer': patch
'@lg-chat/chat-window': patch
'@lg-chat/fixed-chat-window': patch
'@lg-chat/input-bar': patch
'@lg-chat/leafygreen-chat-provider': patch
'@lg-chat/lg-markdown': patch
'@lg-chat/message': patch
'@lg-chat/message-actions': patch
'@lg-chat/message-feedback': patch
'@lg-chat/message-prompts': patch
'@lg-chat/message-rating': patch
'@lg-chat/message-feed': patch
'@lg-chat/rich-links': patch
'@lg-chat/suggestions': patch
'@lg-chat/title-bar': patch
'@lg-tools/build': patch
'@lg-tools/cli': patch
'@lg-tools/codemods': patch
'@lg-tools/link': patch
'@lg-tools/lint': patch
'@lg-tools/meta': patch
'@lg-tools/prompt-kit': patch
'@lg-tools/slackbot': patch
'@lg-tools/storybook-utils': patch
'@lg-tools/test-harnesses': patch
'@lg-tools/update': patch
---

Removes `*.spec.ts` files from tsconfig `exclude` pattern, ensuring that tests are type-checked at build time.
Also adds missing TS "references" for packages that are imported into test files
5 changes: 5 additions & 0 deletions .changeset/warm-webs-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@leafygreen-ui/confirmation-modal': patch
---

Sets `renderSearchInput` test util return type params to required
1 change: 0 additions & 1 deletion charts/chart-card/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion charts/colors/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
4 changes: 4 additions & 0 deletions charts/core/src/ChartContext/ChartContext.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const addChartSeries = jest.fn();
const ChartProviderMock = ({ children }: PropsWithChildren<{}>) => {
return (
<ChartContext.Provider
// TODO: Fix this test context @tsck
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 Will fix this once it's merged - https://jira.mongodb.org/browse/LG-5478

// @ts-expect-error - chartOptions is not defined in the ChartContextType
value={{ chartOptions, updateChartOptions, addChartSeries }}
>
{children}
Expand All @@ -24,6 +26,7 @@ describe('lg-chart/core/ChartContext', () => {
test('renders children', async () => {
const { getByTestId } = render(
<ChartProvider
// @ts-expect-error - chartOptions is not defined in the ChartContextType
chartOptions={{}}
updateChartOptions={() => {}}
addChartSeries={() => {}}
Expand All @@ -43,6 +46,7 @@ describe('lg-chart/core/ChartContext', () => {
const { result } = renderHook(useChartContext, {
wrapper: ChartProviderMock,
});
// @ts-expect-error - chartOptions is not defined in the ChartContextType
const { chartOptions, updateChartOptions, addChartSeries } =
result.current;
expect(chartOptions).toBe(chartOptions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,14 @@ function descendingCompareFn(
}

const renderCustomTooltip = (props: Partial<CustomTooltipProps> = {}) => {
const defaultProps: CustomTooltipProps = {
seriesData: mockSeriesData,
const resolvedProps: CustomTooltipProps = {
seriesData: props.seriesData || mockSeriesData,
chartId: props.chartId || 'test-chart',
tooltipPinned: props.tooltipPinned || false,
...props,
};

return render(<CustomTooltip {...defaultProps} {...props} />);
return render(<CustomTooltip {...resolvedProps} />);
};

describe('@lg-charts/core/ChartTooltip/CustomTooltip', () => {
Expand Down Expand Up @@ -118,7 +121,7 @@ describe('@lg-charts/core/ChartTooltip/CustomTooltip', () => {

test('should render custom series value with seriesValueFormatter', () => {
renderCustomTooltip({
seriesValueFormatter: (value: number) => `$${value}`,
seriesValueFormatter: value => `$${value}`,
});

expect(screen.getByText('$100')).toBeInTheDocument();
Expand Down
10 changes: 7 additions & 3 deletions charts/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@
]
}
},
"include": ["src/**/*"],
"exclude": ["**/*.spec.*", "**/*.stories.*"],
"include": [
"src/**/*"
],
"exclude": [
"**/*.stories.*"
],
"references": [
{
"path": "../chart-card"
Expand All @@ -27,7 +31,7 @@
},
{
"path": "../../packages/hooks"
},
},
{
"path": "../../packages/icon"
},
Expand Down
1 change: 0 additions & 1 deletion charts/drag-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion charts/legend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion charts/series-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/avatar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/chat-disclaimer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/chat-window/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/fixed-chat-window/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/input-bar/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
5 changes: 4 additions & 1 deletion chat/leafygreen-chat-provider/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
"compilerOptions": {},
"include": ["src/**/*"],
"references": [
{
"path": "../../packages/hooks"
},
{
"path": "../../packages/leafygreen-provider"
}
},
]
}
1 change: 0 additions & 1 deletion chat/lg-markdown/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
18 changes: 13 additions & 5 deletions chat/message-actions/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
{
"extends": "@lg-tools/build/config/package.tsconfig.json",
"compilerOptions": {
"compilerOptions": {
"paths": {
"@leafygreen-ui/icon/dist/*": ["../../packages/icon/src/generated/*"],
"@leafygreen-ui/*": ["../../packages/*/src"]
"@leafygreen-ui/icon/dist/*": [
"../../packages/icon/src/generated/*"
],
"@leafygreen-ui/*": [
"../../packages/*/src"
]
}
},
"include": ["src/**/*"],
"exclude": ["**/*.spec.*", "**/*.stories.*"],
"include": [
"src/**/*"
],
"exclude": [
"**/*.stories.*"
],
"references": [
{
"path": "../leafygreen-chat-provider"
Expand Down
1 change: 0 additions & 1 deletion chat/message-feed/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/message-feedback/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/message-prompts/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/message-rating/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/message/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
1 change: 0 additions & 1 deletion chat/rich-links/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"src/**/*"
],
"exclude": [
"**/*.spec.*",
"**/*.stories.*"
],
"references": [
Expand Down
Loading
Loading