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

Module with its leaf dependencies in same folder #163

Open
Vakrim opened this issue Jan 22, 2021 · 1 comment
Open

Module with its leaf dependencies in same folder #163

Vakrim opened this issue Jan 22, 2021 · 1 comment

Comments

@Vakrim
Copy link

Vakrim commented Jan 22, 2021

I'm working on fork with slightly modified version of fractal representation and I'm wonder if you would like to include it in destiny behind option flag. Main difference is that each file is in the same folder with dependencies.

Example

Orignal version

❯ destiny tests/fixtures/shared-with-dependencies
INFO: Generating tree for: tests/fixtures/shared-with-dependencies
shared-with-dependencies
├──index
│  ├──ParticipantSetup
│  │  ├──ParticipantSetupForm
│  │  │  ├──ConfigForm
│  │  │  │  ├──RadioBoxGroup
│  │  │  │  │  └──RadioBoxGroup.scss
│  │  │  │  ├──ConfigForm.module.scss
│  │  │  │  └──RadioBoxGroup.js
│  │  │  ├──ConfigForm.js
│  │  │  └──ParticipantSetupForm.scss
│  │  ├──ParticipantSetup.scss
│  │  └──ParticipantSetupForm.js
│  ├──shared
│  │  ├──Area
│  │  │  ├──Area.config.js
│  │  │  └──Area.module.scss
│  │  ├──CheckboxWithLabel
│  │  │  └──CheckboxWithLabel.scss
│  │  ├──Area.js
│  │  └──CheckboxWithLabel.js
│  ├──SomeOtherResource
│  │  └──SomeOtherResource.module.scss
│  ├──ParticipantSetup.js
│  └──SomeOtherResource.js
└──index.js

My version

❯ destiny --nest-main-modules tests/fixtures/shared-with-dependencies
INFO: Generating tree for: tests/fixtures/shared-with-dependencies
shared-with-dependencies
├──ParticipantSetup
│  ├──ParticipantSetupForm
│  │  ├──ConfigForm
│  │  │  ├──RadioBoxGroup
│  │  │  │  ├──RadioBoxGroup.js
│  │  │  │  └──RadioBoxGroup.scss
│  │  │  ├──ConfigForm.js
│  │  │  └──ConfigForm.module.scss
│  │  ├──ParticipantSetupForm.js
│  │  └──ParticipantSetupForm.scss
│  ├──ParticipantSetup.js
│  └──ParticipantSetup.scss
├──shared
│  ├──Area
│  │  ├──Area.js
│  │  ├──Area.config.js
│  │  └──Area.module.scss
│  └──CheckboxWithLabel
│     ├──CheckboxWithLabel.js
│     └──CheckboxWithLabel.scss
├──SomeOtherResource
│  ├──SomeOtherResource.js
│  └──SomeOtherResource.module.scss
└──index.js

It feels more natural to me that each subtree is contained in one folder and there is no need for "index" folder. But I guess it's matter of personal taste, so I'll leave it for discussion for now

@AnatoleLucet
Copy link
Collaborator

Hey, by what I can see, this structure looks like what @benawad proposed in #151.
Feel free to open a PR so we can look it up!

@Vakrim Vakrim changed the title Module with it's leaf dependencies in same folder Module with its leaf dependencies in same folder Jan 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants