Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: restructuring design system react component code into folders #114

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/design-system-react/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// Add coverage ignore patterns
coveragePathIgnorePatterns: ['index.ts'],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ignoring index files from test coverage as they only re-export components. We could add tests for these in the future, but will ignore them for now.


// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
Expand Down
2 changes: 2 additions & 0 deletions packages/design-system-react/src/components/button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Button } from './Button';
export type { ButtonProps } from './Button';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding index file for Button

5 changes: 5 additions & 0 deletions packages/design-system-react/src/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { Text, TextVariant } from './text';
export type { TextProps } from './text';

export { Button } from './button';
export type { ButtonProps } from './button';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding root index file in components folder

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum TextVariant {
BodyXs = 'body-xs',
}

interface TextProps {
export interface TextProps {
variant: TextVariant;
children: React.ReactNode;
className?: string;
Expand Down
2 changes: 2 additions & 0 deletions packages/design-system-react/src/components/text/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { Text, TextVariant } from './Text';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exporting Text and Text types

export type { TextProps } from './Text';
11 changes: 0 additions & 11 deletions packages/design-system-react/src/index.test.ts

This file was deleted.

3 changes: 1 addition & 2 deletions packages/design-system-react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export { Button } from './Button';
export { Text } from './Text';
export * from './components';
Loading