-
Notifications
You must be signed in to change notification settings - Fork 2.9k
RFC: File Organization Convention for v9 Packages #24332
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
Merged
TristanWatanabe
merged 5 commits into
microsoft:master
from
TristanWatanabe:rfc-v9-package-folder-structure
Aug 22, 2022
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
rfcs/shared/build-system/07-standard-package-structure-for-v9.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # RFC: File Organization Convention for v9 Packages | ||
|
|
||
| Contributors: @TristanWatanabe, @Hotell | ||
|
|
||
| ## Summary | ||
|
|
||
| Fluent v9 is currently lacking a standard on how v9 package files should be structured. This RFC aims to provide a single source of truth on how files should be organized within each v9 package to provide consistency across all v9 packages and to prevent shipping any unnecessary files to npm. | ||
|
|
||
| ## Problem Statement | ||
|
|
||
| Fluent v9 does not have a defined standard on how v9 files should be organized within each respective package. There is currently no standard for where asset files and documentation files such as specs and migration guides should be stored which leads to inconsistency, clutter and shipment of irrelevant files to npm. | ||
|
|
||
| ## Detailed Design or Proposal | ||
|
|
||
| The proposed folder organization can be seen below: | ||
|
|
||
| ``` | ||
| |- docs/ | ||
| |- assets/ | ||
| |- MIGRATION.md | ||
| |- SPEC.md | ||
| |- stories/ | ||
| |- assets/ | ||
| |- {componentName}/ //story files | ||
| |- e2e/ | ||
| |- assets/ | ||
| |- e2e tests | ||
| |- src/ | ||
| |- common/ | ||
| |- components/ //implementation and test files | ||
| |- index.ts | ||
| |- {componentName}.ts | ||
| CHANGELOG.json | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| ``` | ||
|
|
||
| We're already following this convention when it comes to e2e so most of the work will be extracting stories out of the `src` folder and moving those to the root of the package. The asset files will also need to be moved to the appropriate `assets` subfolder. And finally, the `.npmignore` file will then be updated to ignore any asset files and files living within the documentation folder. | ||
|
|
||
| ## Pros and Cons | ||
|
|
||
| ### Pros | ||
|
|
||
| - Defined standard for v9 package folder structure for developers to reference. | ||
| - Prevents shipment of unnecessary files to npm. | ||
| - Decoupling to subfolders will allow for better scope alignment for future CI work. | ||
|
|
||
| ### Cons | ||
|
|
||
| - More moving of files around. | ||
|
|
||
| ## Open Issues | ||
|
|
||
| - [#22289](https://github.com/microsoft/fluentui/issues/22289) | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this
commonis root of evil regarding type-checking etc :P, can we remove it ? #23976There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being addressed in #24543