From 923b32b9aa7c528c479d8e90db6ce68679cfa739 Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Wed, 10 Aug 2022 10:36:28 -0700 Subject: [PATCH 1/5] Add RFC --- .../07-package-subfolder-structure-for-v9.md | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md diff --git a/rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md b/rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md new file mode 100644 index 0000000000000..6ecddab116962 --- /dev/null +++ b/rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md @@ -0,0 +1,52 @@ +# RFC: Subfolder Structure 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/ + |- component stories +|- e2e/ + |- assets/ + |- e2e tests +|- src/ + |- implementation files +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) From 0d6bfde3c97626a34e69cc0159db7c1287d9212e Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Wed, 10 Aug 2022 13:51:44 -0700 Subject: [PATCH 2/5] nit: update RFC name --- ...ucture-for-v9.md => 07-standard-package-structure-for-v9.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename rfcs/shared/build-system/{07-package-subfolder-structure-for-v9.md => 07-standard-package-structure-for-v9.md} (97%) diff --git a/rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md similarity index 97% rename from rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md rename to rfcs/shared/build-system/07-standard-package-structure-for-v9.md index 6ecddab116962..8fe4b9ac6db31 100644 --- a/rfcs/shared/build-system/07-package-subfolder-structure-for-v9.md +++ b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md @@ -1,4 +1,4 @@ -# RFC: Subfolder Structure for v9 Packages +# RFC: Standard Structure for v9 Packages Contributors: @TristanWatanabe, @Hotell From 51f63994a88b95bbe6b74c3b794ec85a50ee5b82 Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Wed, 10 Aug 2022 13:55:12 -0700 Subject: [PATCH 3/5] nit: update title --- .../shared/build-system/07-standard-package-structure-for-v9.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rfcs/shared/build-system/07-standard-package-structure-for-v9.md b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md index 8fe4b9ac6db31..608b863d78e75 100644 --- a/rfcs/shared/build-system/07-standard-package-structure-for-v9.md +++ b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md @@ -1,4 +1,4 @@ -# RFC: Standard Structure for v9 Packages +# RFC: File Organization Convention for v9 Packages Contributors: @TristanWatanabe, @Hotell From b72c06a15fc645890c4303d63076e2f9eb843d2b Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Wed, 10 Aug 2022 13:56:34 -0700 Subject: [PATCH 4/5] nit: more descriptive --- rfcs/shared/build-system/07-standard-package-structure-for-v9.md | 1 + 1 file changed, 1 insertion(+) diff --git a/rfcs/shared/build-system/07-standard-package-structure-for-v9.md b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md index 608b863d78e75..366101c495bbd 100644 --- a/rfcs/shared/build-system/07-standard-package-structure-for-v9.md +++ b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md @@ -27,6 +27,7 @@ The proposed folder organization can be seen below: |- e2e tests |- src/ |- implementation files + |- test files CHANGELOG.json CHANGELOG.md package.json From e34e6920db41858df31da9cf81f55cd83ac5bdbe Mon Sep 17 00:00:00 2001 From: Tristan Watanabe Date: Wed, 10 Aug 2022 14:06:18 -0700 Subject: [PATCH 5/5] more descriptive folder structure for src --- .../07-standard-package-structure-for-v9.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rfcs/shared/build-system/07-standard-package-structure-for-v9.md b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md index 366101c495bbd..74ec01f3fc823 100644 --- a/rfcs/shared/build-system/07-standard-package-structure-for-v9.md +++ b/rfcs/shared/build-system/07-standard-package-structure-for-v9.md @@ -17,17 +17,19 @@ The proposed folder organization can be seen below: ``` |- docs/ |- assets/ - |- migration.md - |- spec.md + |- MIGRATION.md + |- SPEC.md |- stories/ |- assets/ - |- component stories + |- {componentName}/ //story files |- e2e/ |- assets/ |- e2e tests |- src/ - |- implementation files - |- test files + |- common/ + |- components/ //implementation and test files + |- index.ts + |- {componentName}.ts CHANGELOG.json CHANGELOG.md package.json