Skip to content

Commit c67d1a5

Browse files
authored
Prevent global types file from reaching into tsx (#8477)
Fixes get-props script: ![image](https://screenshot.click/23-17-oal6c-t47x0.png) Typescript compiler was looking at global scripts and reaching into PatternsExample and complaining about not having jsx flag, which it shouldn't need. Shouldn't even be concerned with that file. This moves the types to the global types file and tsx pulls the types from it
1 parent cbb14c5 commit c67d1a5

File tree

5 files changed

+1900
-1867
lines changed

5 files changed

+1900
-1867
lines changed

.changeset/spicy-turtles-push.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'polaris.shopify.com': patch
3+
---
4+
5+
Fix global types file

polaris.shopify.com/src/components/PatternsExample/PatternsExample.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,7 @@ import GrowFrame from '../GrowFrame';
88
import Code from '../Code';
99
import ExampleWrapper, {LinkButton} from '../ExampleWrapper';
1010
import InlinePill from '../InlinePill';
11-
12-
type RelatedComponent = {
13-
label: string;
14-
url: string;
15-
};
16-
export type PatternExample = {
17-
code: string;
18-
context?: string;
19-
snippetCode?: string;
20-
relatedComponents: RelatedComponent[];
21-
};
11+
import {PatternExample} from '../../types';
2212

2313
const getISOStringYear = () => new Date().toISOString().split('T')[0];
2414

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
import PatternsExample, {type PatternExample} from './PatternsExample';
1+
import PatternsExample from './PatternsExample';
22
export default PatternsExample;
3-
export {type PatternExample};

0 commit comments

Comments
 (0)