This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 107
/
shipit_react-native.php-example
67 lines (62 loc) · 1.98 KB
/
shipit_react-native.php-example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?hh
/**
* Copyright (c) 2016-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace Facebook\ShipIt;
require_once(__DIR__.'/../autoload.php');
final class ShipItReactNative extends FBShipItCLI {
<<__Override>>
protected static function projectFilterChangeset(
ShipItChangeset $changeset,
): ShipItChangeset {
return $changeset
|> FBCommonFilters::stripSummariesByDefault($$)
|> FBCommonFilters::applyAll(
$$,
shape(
// FBCommonFilters defines a common set of files to ignore
// across all fb projects, such as BUCK files and others.
// We want to export *all* of the react-native-github folder
// to GitHub, except for a few specific paths.
'stripCommonFiles/exceptions' => ImmVector {
'/.*/',
},
),
)
|> ShipItPathFilters::stripPaths(
$$,
ImmVector {
'@(^|/)node_modules/@',
'@(^|/)npm-shrinkwrap.json@',
'@(^|/)yarn.lock@',
'@(^|/)packager/react-packager/src/packager_experimental/@',
},
)
|> ShipItPathFilters::moveDirectories(
$$,
ImmMap {
'fbobjc/Libraries/FBReactKit/js/react-native-github/' => '',
},
);
}
<<__Override>>
public static function getStaticConfig(): FBShipItCLIStaticConfig {
return shape(
'internalRepo' => 'fbsource',
'githubOrg' => 'facebook',
'githubProject' => 'react-native',
'sourceRoots' => ImmSet {
'fbobjc/Libraries/FBReactKit/js/react-native-github',
},
);
}
}
// Allow require() from unit test
if (isset($argv[0]) && realpath($argv[0]) === realpath(__FILE__)) {
ShipItReactNative::cliMain();
}