11const repo = require ( './repository' ) ;
22const { setArchiveBaseDir, createPackagesForTag, createPackageForTag} = require ( './package-modules' ) ;
3- const { compareTags} = require ( './utils' ) ;
3+ const { compareTags, httpSlurp } = require ( './utils' ) ;
44
55/**
66 * package(s) | from | modules-folder | repo url
@@ -17,6 +17,7 @@ const {compareTags} = require('./utils');
1717 * ------------------------------------------------------------------------------------------------------------------
1818 * magento/zendframework1 | 1.13.0 | '' | https://github.com/mage-os/mirror-zf1.git
1919 * | | | single package, but requires exclude config
20+ * | | | version not in release composer.json files
2021 * ------------------------------------------------------------------------------------------------------------------
2122 */
2223
@@ -37,38 +38,47 @@ async function createPackagesSinceTag(url, from, modulesPath, excludes) {
3738 return tags ;
3839}
3940
40- async function createPackageSinceTag ( url , from , modulesPath , excludes ) {
41+ async function createPackageSinceTag ( url , from , modulesPath , excludes , composerJsonUrl ) {
4142 const tags = await listTagsFrom ( url , from ) ;
4243 for ( const tag of tags ) {
43- await createPackageForTag ( url , modulesPath , excludes , tag ) ;
44+ await createPackageForTag ( url , modulesPath , excludes , tag , composerJsonUrl . replace ( '{{version}}' , tag ) ) ;
4445 }
4546 return tags ;
4647}
4748
4849( async function ( ) {
49- let tags ;
50-
51- tags = await createPackagesSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'app/code/Magento' )
50+ let tags , exclude , composerJsonUrl ;
51+
52+ exclude = [ ] ;
53+ tags = await createPackagesSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'app/code/Magento' , exclude )
5254 console . log ( 'app/code/Magento modules' , tags )
5355
54- tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , '' , [ ".github/" , "app/code/" , "app/design/frontend/" , "app/design/adminhtml/" , "app/i18n/" , "lib/internal/Magento/Framework/" , "composer.lock" , ] )
55- console . log ( 'magento/magento2ce' , tags ) ;
56+ exclude = [ ".github/" , "app/code/" , "app/design/frontend/" , "app/design/adminhtml/" , "app/i18n/" , "lib/internal/Magento/Framework/" , "composer.lock" ] ;
57+ composerJsonUrl = 'https://raw.githubusercontent.com/mage-os/magento2-base-composer-json/main/{{version}}/magento2-base/composer.json' ;
58+ tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , '' , exclude , composerJsonUrl )
59+ console . log ( 'magento/magento2-base' , tags )
5660
57- tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework' , [ 'lib/internal/Magento/Framework/Amqp/' , 'lib/internal/Magento/Framework/Bulk/' , 'lib/internal/Magento/Framework/MessageQueue/' ] )
61+ exclude = [ 'lib/internal/Magento/Framework/Amqp/' , 'lib/internal/Magento/Framework/Bulk/' , 'lib/internal/Magento/Framework/MessageQueue/' ] ;
62+ tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework' , exclude )
5863 console . log ( 'magento/framework' , tags )
5964
60- tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework/Amqp' , [ ] )
65+ exclude = [ ] ;
66+ tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework/Amqp' , exclude )
6167 console . log ( 'magento/framework-amqp' , tags )
6268
63- tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework/Bulk' , [ ] )
69+ exclude = [ ] ;
70+ tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework/Bulk' , exclude )
6471 console . log ( 'magento/framework-bulk' , tags ) ;
6572
66- tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework/MessageQueue' , [ ] )
73+ exclude = [ ] ;
74+ tags = await createPackageSinceTag ( 'https://github.com/mage-os/mirror-magento2.git' , '2.4.0' , 'lib/internal/Magento/Framework/MessageQueue' , exclude )
6775 console . log ( 'magento/framework-message-queue' , tags )
6876
69- tags = await createPackagesSinceTag ( 'https://github.com/mage-os/mirror-security-package.git' , '1.0.0' , '' , [ '.github/' , '_metapackage/' ] )
77+ exclude = [ '.github/' , '_metapackage/' ] ;
78+ tags = await createPackagesSinceTag ( 'https://github.com/mage-os/mirror-security-package.git' , '1.0.0' , '' , exclude )
7079 console . log ( 'security packages' , tags )
7180
72- tags = await createPackagesSinceTag ( 'https://github.com/mage-os/mirror-inventory.git' , '1.1.5' , '' , [ '.github/' , '_metapackage/' , 'dev/' ] )
81+ exclude = [ '.github/' , '_metapackage/' , 'dev/' ] ;
82+ tags = await createPackagesSinceTag ( 'https://github.com/mage-os/mirror-inventory.git' , '1.1.5' , '' , exclude )
7383 console . log ( 'inventory packages' , tags )
74- } ) ( )
84+ } ) ( )
0 commit comments