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

Folder structure to be set up #7

Closed
10 tasks
RyRy79261 opened this issue Aug 11, 2020 · 4 comments · Fixed by #31
Closed
10 tasks

Folder structure to be set up #7

RyRy79261 opened this issue Aug 11, 2020 · 4 comments · Fixed by #31
Assignees
Labels
Priority: P0 Critical Added to issues relating to a critical severity bugs.
Milestone

Comments

@RyRy79261
Copy link
Contributor

RyRy79261 commented Aug 11, 2020

Description

WIP Notice: @tanmoytb @FSM1 Please comment on the structure proposed below

The folder structure needs to be set up to categorize & taxonomize components in an easy to navigate way

High level

  • Components (Composable components, theme elements, form elements, icons, small scope elements)
  • Providers (React Context API Wrappers, etc)
  • Modules (Billing modules, Login modules, basically shared wide scope/opinionated components)
  • Theme (Actual theme definitions)

Component sub folders

  • Icons
  • Emoji
  • Layouts (General grids, general page layouts)
  • *Elements (Buttons, links, typography etc)
  • Form Elements (Form & Formik specific elements)
  • Helpers (Scroll wrappers, Accordians, Tabbed views, etc)
@RyRy79261 RyRy79261 added Priority: P0 Critical Added to issues relating to a critical severity bugs. enhancement labels Aug 11, 2020
@RyRy79261 RyRy79261 mentioned this issue Aug 11, 2020
2 tasks
@FSM1
Copy link
Contributor

FSM1 commented Aug 11, 2020

This looks great @RyRy79261

The Providers will include contexts (similar to the web3-context) that act as wrappers for the various API's that we need. Not sure whether we will need a custom themeProvider as I think styledComponents already covers this...

I have added a parent folder for the actual Theme object that would need to be passed in to the theme provider, since this will be common for all implementations.

@FSM1
Copy link
Contributor

FSM1 commented Aug 11, 2020

In terms of usability, I think each of the top level folders should basically act as a separate package, ie.

import {Button} from '@chainsafe/common-ui/components'

This will mean that each top level folder will have an index.ts file, that imports and re-exports all the various sub-component, ie.

packages/common/components/index.ts will looks like:

import {Button} from './Button';
...
export {Button, ...};

The packages/common/index.ts file will then be as follows:

import * as Components from '/components';
import * as Providers from '/providers';
...

export {
  components: Components,
  providers: Providers,
  ...
}

@RyRy79261 RyRy79261 mentioned this issue Aug 11, 2020
6 tasks
@priom priom added this to the Sprint 20.8 milestone Aug 12, 2020
@RyRy79261
Copy link
Contributor Author

@FSM1 I agree with this approach as it uses common language for the separate components

@FSM1
Copy link
Contributor

FSM1 commented Aug 14, 2020

Change of plans w.r.t. the package structure. To enable the individual importing of components etc we will break the High Level items out into separate packages in the monorepo. These should all follow the naming convention of common- (eg. common-components, etc). Update the root npm script to build all common packages at once.

@FSM1 FSM1 closed this as completed in #31 Aug 14, 2020
@FSM1 FSM1 changed the title [WIP] Folder structure to be set up Folder structure to be set up Aug 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P0 Critical Added to issues relating to a critical severity bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants