@@ -100,6 +100,30 @@ async function getComposerJson(instruction, package, ref) {
100100 return fs . readFileSync ( package . composerJsonFile , 'utf8' ) ;
101101}
102102
103+ /**
104+ * Determine the stability level of a composer version string
105+ * @param {string } version - The version string to check (e.g. "2.4.0-beta1", "1.0.0", "dev-master")
106+ * @returns {string } - Returns 'dev', 'alpha', 'beta', 'RC', 'stable', or 'patch'
107+ */
108+ function getVersionStability ( version ) {
109+ version = version . toLowerCase ( ) ;
110+
111+ if ( version . startsWith ( 'dev-' ) || version . includes ( '-dev' ) ) {
112+ return 'dev' ;
113+ }
114+ if ( version . includes ( '-alpha' ) ) {
115+ return 'alpha' ;
116+ }
117+ if ( version . includes ( '-beta' ) ) {
118+ return 'beta' ;
119+ }
120+ if ( version . includes ( '-rc' ) ) {
121+ return 'RC' ;
122+ }
123+
124+ return 'stable' ;
125+ }
126+
103127/**
104128 * @param {repositoryBuildDefinition } instruction
105129 * @param {packageDefinition } package
@@ -545,18 +569,18 @@ async function determineMagentoCommunityEditionProject(url, ref, release) {
545569 *
546570 * @param {repositoryBuildDefinition } instruction
547571 * @param {buildState } release
548- * @param {{minimumStability :String|undefined, description: String|undefined } } options
572+ * @param {{description :String|undefined, transform: Array< String, Function> } } options
549573 * @returns {Promise<{}> }
550574 */
551575async function createMagentoCommunityEditionProject ( instruction , release , options ) {
552576 const defaults = {
553- minimumStability : 'stable' ,
554577 description : 'eCommerce Platform for Growth (Community Edition)' ,
555578 transform : { } ,
556579 } ;
557- const { minimumStability , description, transform} = Object . assign ( defaults , ( options || { } ) )
580+ const { description, transform} = Object . assign ( defaults , ( options || { } ) )
558581 const name = `${ instruction . vendor } /project-community-edition` ;
559582 const version = release . version || release . dependencyVersions [ name ] || release . ref ;
583+ const minimumStability = getVersionStability ( version ) ;
560584 const { packageFilepath, files} = await createComposerJsonOnlyPackage (
561585 instruction ,
562586 release ,
0 commit comments