@@ -10,6 +10,7 @@ import { getAllPackageInfo, isConvergedPackage } from '@fluentui/scripts-monorep
1010export function getConfig ( { version } : { version : 'web-components' } ) : { scope : string [ ] } ;
1111export function getConfig ( { version } : { version : 'v8' } ) : { scope : string [ ] } ;
1212export function getConfig ( { version } : { version : 'tools' } ) : { scope : string [ ] } ;
13+ export function getConfig ( { version } : { version : 'headless' } ) : { scope : string [ ] } ;
1314export function getConfig ( { version } : { version : 'vNext' } ) : {
1415 scope : string [ ] ;
1516 groupConfig : {
@@ -18,8 +19,8 @@ export function getConfig({ version }: { version: 'vNext' }): {
1819 include : string [ ] ;
1920 } ;
2021} ;
21- export function getConfig ( { version } : { version : 'v8' | 'vNext' | 'web-components' | 'tools' } ) {
22- const { vNextPaths, webComponentsPaths, toolsPaths, v8Paths } = getPackagePaths ( ) ;
22+ export function getConfig ( { version } : { version : 'v8' | 'vNext' | 'web-components' | 'tools' | 'headless' } ) {
23+ const { vNextPaths, webComponentsPaths, toolsPaths, v8Paths, headlessPaths } = getPackagePaths ( ) ;
2324
2425 if ( version === 'vNext' ) {
2526 return {
@@ -48,6 +49,12 @@ export function getConfig({ version }: { version: 'v8' | 'vNext' | 'web-componen
4849 } ;
4950 }
5051
52+ if ( version === 'headless' ) {
53+ return {
54+ scope : [ ...headlessPaths ] ,
55+ } ;
56+ }
57+
5158 throw new Error ( 'Unsupported version scopes acquisition' ) ;
5259}
5360
@@ -66,18 +73,25 @@ const isToolsPackage: typeof isConvergedPackage = metadata => {
6673
6774 return hasToolsTag && ! isPrivate && ! isV8Package ( metadata ) ;
6875} ;
76+ const isHeadlessPackage : typeof isConvergedPackage = metadata => {
77+ const hasHeadlessTag = Boolean ( metadata . project . tags ?. includes ( 'react-headless' ) ) ;
78+ const isPrivate = Boolean ( metadata . packageJson . private ) ;
79+
80+ return hasHeadlessTag && ! isPrivate ;
81+ } ;
6982
7083function getPackagePaths ( ) {
7184 const allProjects = getAllPackageInfo ( ) ;
7285 const vNextPaths : string [ ] = [ ] ;
7386 const webComponentsPaths : string [ ] = [ ] ;
7487 const v8Paths : string [ ] = [ ] ;
7588 const toolsPaths : string [ ] = [ ] ;
89+ const headlessPaths : string [ ] = [ ] ;
7690
7791 for ( const project of Object . values ( allProjects ) ) {
7892 const isPrivate = Boolean ( project . packageJson . private ) ;
7993 const metadata = { project : project . projectConfig , packageJson : project . packageJson } ;
80- if ( isConvergedPackage ( metadata ) && ! isToolsPackage ( metadata ) && ! isPrivate ) {
94+ if ( isConvergedPackage ( metadata ) && ! isToolsPackage ( metadata ) && ! isHeadlessPackage ( metadata ) && ! isPrivate ) {
8195 vNextPaths . push ( project . packagePath ) ;
8296 }
8397 if ( isWebComponentPackage ( metadata ) ) {
@@ -89,7 +103,10 @@ function getPackagePaths() {
89103 if ( isV8Package ( metadata ) ) {
90104 v8Paths . push ( project . packagePath ) ;
91105 }
106+ if ( isHeadlessPackage ( metadata ) ) {
107+ headlessPaths . push ( project . packagePath ) ;
108+ }
92109 }
93110
94- return { vNextPaths, webComponentsPaths, toolsPaths, v8Paths } ;
111+ return { vNextPaths, webComponentsPaths, toolsPaths, v8Paths, headlessPaths } ;
95112}
0 commit comments