Skip to content

Commit e4ab2b2

Browse files
committed
[LOCAL] augment forEachPackage to accept optional excludes and add for the bump and trigger release script
1 parent 4f82350 commit e4ab2b2

3 files changed

Lines changed: 31 additions & 11 deletions

File tree

scripts/monorepo/bump-all-updated-packages/index.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,18 @@ const buildExecutor =
115115
const buildAllExecutors = () => {
116116
const executors = [];
117117

118-
forEachPackage((...params) => {
119-
executors.push(buildExecutor(...params));
120-
});
118+
forEachPackage(
119+
(...params) => {
120+
executors.push(buildExecutor(...params));
121+
},
122+
[
123+
'assets',
124+
'eslint-config-react-native-community',
125+
'eslint-plugin-react-native-community',
126+
'normalize-color',
127+
'polyfills',
128+
],
129+
);
121130

122131
return executors;
123132
};

scripts/monorepo/for-each-package.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,16 @@ const getDirectories = source =>
3434
*/
3535

3636
/**
37-
* Iterate through every package inside /packages (ignoring react-native) and call provided callback for each of them
37+
* Iterate through every package inside /packages (ignoring react-native and any additional excluded packages) and call provided callback for each of them
3838
*
39-
* @param {forEachPackageCallback} callback The callback which will be called for each package
39+
* @param {forEachPackageCallback} callback - The callback which will be called for each package
40+
* @param {string[]} [additionalExcludes] - Additional packages to exclude
4041
*/
41-
const forEachPackage = callback => {
42-
// We filter react-native package on purpose, so that no CI's script will be executed for this package in future
42+
const forEachPackage = (callback, additionalExcludes = []) => {
43+
const packagesToExclude = [...PACKAGES_BLOCK_LIST, ...additionalExcludes];
44+
4345
const packagesDirectories = getDirectories(PACKAGES_LOCATION).filter(
44-
directoryName => !PACKAGES_BLOCK_LIST.includes(directoryName),
46+
directoryName => !packagesToExclude.includes(directoryName),
4547
);
4648

4749
packagesDirectories.forEach(packageDirectory => {

scripts/trigger-react-native-release.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,18 @@ const buildExecutor =
8989
const buildAllExecutors = () => {
9090
const executors = [];
9191

92-
forEachPackage((...params) => {
93-
executors.push(buildExecutor(...params));
94-
});
92+
forEachPackage(
93+
(...params) => {
94+
executors.push(buildExecutor(...params));
95+
},
96+
[
97+
'assets',
98+
'eslint-config-react-native-community',
99+
'eslint-plugin-react-native-community',
100+
'normalize-color',
101+
'polyfills',
102+
],
103+
);
95104

96105
return executors;
97106
};

0 commit comments

Comments
 (0)