@expo/fingerprint 0.4.1 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -6
- package/bin/cli.js +26 -5
- package/build/sourcer/Bare.js +13 -7
- package/build/sourcer/Bare.js.map +1 -1
- package/package.json +16 -9
- package/.eslintignore +0 -1
- package/CHANGELOG.md +0 -55
- package/__mocks__/@expo/spawn-async.ts +0 -30
- package/__mocks__/fs/promises.ts +0 -17
- package/__mocks__/fs.ts +0 -2
- package/__mocks__/resolve-from.ts +0 -24
- package/babel.config.js +0 -6
- package/e2e/__tests__/__snapshots__/managed-test.ts.snap +0 -242
- package/e2e/__tests__/bare-test.ts +0 -72
- package/e2e/__tests__/managed-test.ts +0 -165
- package/e2e/jest.config.js +0 -11
- package/jest.config.js +0 -10
- package/scripts/createFixture.ts +0 -81
- package/src/Dedup.ts +0 -97
- package/src/Fingerprint.ts +0 -60
- package/src/Fingerprint.types.ts +0 -110
- package/src/Options.ts +0 -81
- package/src/Sort.ts +0 -22
- package/src/__tests__/Dedup-test.ts +0 -177
- package/src/__tests__/Fingerprint-test.ts +0 -143
- package/src/__tests__/Sort-test.ts +0 -56
- package/src/hash/Hash.ts +0 -203
- package/src/hash/__tests__/Hash-test.ts +0 -238
- package/src/index.ts +0 -2
- package/src/sourcer/Bare.ts +0 -115
- package/src/sourcer/Expo.ts +0 -223
- package/src/sourcer/ExpoConfigLoader.ts +0 -84
- package/src/sourcer/PatchPackage.ts +0 -18
- package/src/sourcer/Sourcer.ts +0 -58
- package/src/sourcer/Utils.ts +0 -62
- package/src/sourcer/__tests__/Bare-test.ts +0 -88
- package/src/sourcer/__tests__/Expo-test.ts +0 -305
- package/src/sourcer/__tests__/PatchPackage-test.ts +0 -57
- package/src/sourcer/__tests__/Sourcer-test.ts +0 -21
- package/src/sourcer/__tests__/Utils-test.ts +0 -41
- package/src/sourcer/__tests__/__snapshots__/Bare-test.ts.snap +0 -21
- package/src/sourcer/__tests__/__snapshots__/Expo-test.ts.snap +0 -139
- package/src/sourcer/__tests__/fixtures/BareReactNative70Project.json +0 -47
- package/src/sourcer/__tests__/fixtures/ExpoAutolinkingAndroid.json +0 -82
- package/src/sourcer/__tests__/fixtures/ExpoAutolinkingIos.json +0 -114
- package/src/sourcer/__tests__/fixtures/ExpoManaged47Project.json +0 -6
- package/src/sourcer/__tests__/fixtures/PatchPackage.json +0 -4
- package/src/sourcer/__tests__/fixtures/RncliAutoLinking.json +0 -165
- package/src/utils/Path.ts +0 -26
- package/src/utils/Profile.ts +0 -47
- package/src/utils/__tests__/Path-test.ts +0 -36
- package/src/utils/__tests__/Profile-test.ts +0 -11
- package/tsconfig.json +0 -9
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"modules": [
|
|
3
|
-
{
|
|
4
|
-
"packageName": "expo",
|
|
5
|
-
"packageVersion": "47.0.3",
|
|
6
|
-
"pods": [{ "podName": "Expo", "podspecDir": "/app/node_modules/expo" }],
|
|
7
|
-
"swiftModuleNames": ["Expo"],
|
|
8
|
-
"modules": [],
|
|
9
|
-
"appDelegateSubscribers": [],
|
|
10
|
-
"reactDelegateHandlers": [],
|
|
11
|
-
"debugOnly": false
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"packageName": "expo-application",
|
|
15
|
-
"packageVersion": "5.0.1",
|
|
16
|
-
"pods": [
|
|
17
|
-
{
|
|
18
|
-
"podName": "EXApplication",
|
|
19
|
-
"podspecDir": "/app/node_modules/expo-application/ios"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"swiftModuleNames": ["EXApplication"],
|
|
23
|
-
"modules": [],
|
|
24
|
-
"appDelegateSubscribers": [],
|
|
25
|
-
"reactDelegateHandlers": [],
|
|
26
|
-
"debugOnly": false
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"packageName": "expo-constants",
|
|
30
|
-
"packageVersion": "14.0.2",
|
|
31
|
-
"pods": [
|
|
32
|
-
{
|
|
33
|
-
"podName": "EXConstants",
|
|
34
|
-
"podspecDir": "/app/node_modules/expo-constants/ios"
|
|
35
|
-
}
|
|
36
|
-
],
|
|
37
|
-
"swiftModuleNames": ["EXConstants"],
|
|
38
|
-
"modules": [],
|
|
39
|
-
"appDelegateSubscribers": [],
|
|
40
|
-
"reactDelegateHandlers": [],
|
|
41
|
-
"debugOnly": false
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"packageName": "expo-error-recovery",
|
|
45
|
-
"packageVersion": "4.0.1",
|
|
46
|
-
"pods": [
|
|
47
|
-
{
|
|
48
|
-
"podName": "EXErrorRecovery",
|
|
49
|
-
"podspecDir": "/app/node_modules/expo-error-recovery/ios"
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"swiftModuleNames": ["EXErrorRecovery"],
|
|
53
|
-
"modules": [],
|
|
54
|
-
"appDelegateSubscribers": [],
|
|
55
|
-
"reactDelegateHandlers": [],
|
|
56
|
-
"debugOnly": false
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"packageName": "expo-file-system",
|
|
60
|
-
"packageVersion": "15.1.1",
|
|
61
|
-
"pods": [
|
|
62
|
-
{
|
|
63
|
-
"podName": "EXFileSystem",
|
|
64
|
-
"podspecDir": "/app/node_modules/expo-file-system/ios"
|
|
65
|
-
}
|
|
66
|
-
],
|
|
67
|
-
"swiftModuleNames": ["EXFileSystem"],
|
|
68
|
-
"modules": [],
|
|
69
|
-
"appDelegateSubscribers": [],
|
|
70
|
-
"reactDelegateHandlers": [],
|
|
71
|
-
"debugOnly": false
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"packageName": "expo-font",
|
|
75
|
-
"packageVersion": "11.0.1",
|
|
76
|
-
"pods": [{ "podName": "EXFont", "podspecDir": "/app/node_modules/expo-font/ios" }],
|
|
77
|
-
"swiftModuleNames": ["EXFont"],
|
|
78
|
-
"modules": [],
|
|
79
|
-
"appDelegateSubscribers": [],
|
|
80
|
-
"reactDelegateHandlers": [],
|
|
81
|
-
"debugOnly": false
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"packageName": "expo-keep-awake",
|
|
85
|
-
"packageVersion": "11.0.1",
|
|
86
|
-
"pods": [
|
|
87
|
-
{
|
|
88
|
-
"podName": "ExpoKeepAwake",
|
|
89
|
-
"podspecDir": "/app/node_modules/expo-keep-awake/ios"
|
|
90
|
-
}
|
|
91
|
-
],
|
|
92
|
-
"swiftModuleNames": ["ExpoKeepAwake"],
|
|
93
|
-
"modules": ["KeepAwakeModule"],
|
|
94
|
-
"appDelegateSubscribers": [],
|
|
95
|
-
"reactDelegateHandlers": [],
|
|
96
|
-
"debugOnly": false
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
"packageName": "expo-modules-core",
|
|
100
|
-
"packageVersion": "1.0.2",
|
|
101
|
-
"pods": [
|
|
102
|
-
{
|
|
103
|
-
"podName": "ExpoModulesCore",
|
|
104
|
-
"podspecDir": "/app/node_modules/expo-modules-core"
|
|
105
|
-
}
|
|
106
|
-
],
|
|
107
|
-
"swiftModuleNames": ["ExpoModulesCore"],
|
|
108
|
-
"modules": [],
|
|
109
|
-
"appDelegateSubscribers": [],
|
|
110
|
-
"reactDelegateHandlers": [],
|
|
111
|
-
"debugOnly": false
|
|
112
|
-
}
|
|
113
|
-
]
|
|
114
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"/app/App.js": "import { StatusBar } from 'expo-status-bar';\nimport { StyleSheet, Text, View } from 'react-native';\n\nexport default function App() {\n return (\n <View style={styles.container}>\n <Text>Open up App.js to start working on your app!</Text>\n <StatusBar style=\"auto\" />\n </View>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n backgroundColor: '#fff',\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n",
|
|
3
|
-
"/app/app.json": "{\n \"expo\": {\n \"name\": \"sdk47\",\n \"slug\": \"sdk47\",\n \"version\": \"1.0.0\",\n \"orientation\": \"portrait\",\n \"icon\": \"./assets/icon.png\",\n \"userInterfaceStyle\": \"light\",\n \"splash\": {\n \"image\": \"./assets/splash.png\",\n \"resizeMode\": \"contain\",\n \"backgroundColor\": \"#ffffff\"\n },\n \"updates\": {\n \"fallbackToCacheTimeout\": 0\n },\n \"assetBundlePatterns\": [\n \"**/*\"\n ],\n \"ios\": {\n \"supportsTablet\": true\n },\n \"android\": {\n \"adaptiveIcon\": {\n \"foregroundImage\": \"./assets/adaptive-icon.png\",\n \"backgroundColor\": \"#FFFFFF\"\n }\n },\n \"web\": {\n \"favicon\": \"./assets/favicon.png\"\n }\n }\n}\n",
|
|
4
|
-
"/app/babel.config.js": "module.exports = function(api) {\n api.cache(true);\n return {\n presets: ['babel-preset-expo'],\n };\n};\n",
|
|
5
|
-
"/app/package.json": "{\n \"name\": \"sdk47\",\n \"version\": \"1.0.0\",\n \"main\": \"node_modules/expo/AppEntry.js\",\n \"scripts\": {\n \"start\": \"expo start\",\n \"android\": \"expo start --android\",\n \"ios\": \"expo start --ios\",\n \"web\": \"expo start --web\"\n },\n \"dependencies\": {\n \"expo\": \"~47.0.3\",\n \"expo-status-bar\": \"~1.4.2\",\n \"react\": \"18.1.0\",\n \"react-native\": \"0.70.5\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.12.9\"\n },\n \"private\": true\n}\n"
|
|
6
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"/app/patches/expo-modules-core+1.0.2.patch": "diff --git a/node_modules/expo-modules-core/ExpoModulesCore.podspec b/node_modules/expo-modules-core/ExpoModulesCore.podspec\nindex 626b33f..08afac7 100644\n--- a/node_modules/expo-modules-core/ExpoModulesCore.podspec\n+++ b/node_modules/expo-modules-core/ExpoModulesCore.podspec\n@@ -3,7 +3,7 @@ require 'json'\n package = JSON.parse(File.read(File.join(__dir__, 'package.json')))\n fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'\n fabric_compiler_flags = '-DRN_FABRIC_ENABLED'\n-folly_version = '2021.07.22.00'\n+folly_version = '2022.10.17.00'\n folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32'\n \n Pod::Spec.new do |s|\n",
|
|
3
|
-
"/app/patches/expo+47.0.3.patch": "diff --git a/node_modules/expo/Expo.podspec b/node_modules/expo/Expo.podspec\nindex 07be428..9b6537c 100644\n--- a/node_modules/expo/Expo.podspec\n+++ b/node_modules/expo/Expo.podspec\n@@ -10,7 +10,7 @@ Pod::Spec.new do |s|\n s.license = package['license']\n s.author = package['author']\n s.homepage = package['homepage']\n- s.platform = :ios, '13.0'\n+ s.platform = :ios, '14.0'\n s.source = { git: 'https://github.com/expo/expo.git' }\n s.static_framework = true\n s.header_dir = 'Expo'\n"
|
|
4
|
-
}
|
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": "/root/apps/demo",
|
|
3
|
-
"reactNativePath": "/root/node_modules/react-native",
|
|
4
|
-
"dependencies": {
|
|
5
|
-
"react-native-reanimated": {
|
|
6
|
-
"root": "/root/node_modules/react-native-reanimated",
|
|
7
|
-
"name": "react-native-reanimated",
|
|
8
|
-
"platforms": {
|
|
9
|
-
"ios": {
|
|
10
|
-
"podspecPath": "/root/node_modules/react-native-reanimated/RNReanimated.podspec",
|
|
11
|
-
"configurations": [],
|
|
12
|
-
"scriptPhases": []
|
|
13
|
-
},
|
|
14
|
-
"android": {
|
|
15
|
-
"sourceDir": "/root/node_modules/react-native-reanimated/android",
|
|
16
|
-
"packageImportPath": "import com.swmansion.reanimated.ReanimatedPackage;",
|
|
17
|
-
"packageInstance": "new ReanimatedPackage()",
|
|
18
|
-
"buildTypes": [],
|
|
19
|
-
"componentDescriptors": [],
|
|
20
|
-
"androidMkPath": "/root/node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/Android.mk",
|
|
21
|
-
"cmakeListsPath": "/root/node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/CMakeLists.txt"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"commands": [
|
|
27
|
-
{
|
|
28
|
-
"name": "log-ios",
|
|
29
|
-
"description": "starts iOS device syslog tail"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"name": "run-ios",
|
|
33
|
-
"description": "builds your app and starts it on iOS simulator",
|
|
34
|
-
"examples": [
|
|
35
|
-
{
|
|
36
|
-
"desc": "Run on a different simulator, e.g. iPhone SE (2nd generation)",
|
|
37
|
-
"cmd": "react-native run-ios --simulator \"iPhone SE (2nd generation)\""
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"desc": "Run on a connected device, e.g. Max's iPhone",
|
|
41
|
-
"cmd": "react-native run-ios --device \"Max's iPhone\""
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"desc": "Run on the AppleTV simulator",
|
|
45
|
-
"cmd": "react-native run-ios --simulator \"Apple TV\" --scheme \"helloworld-tvOS\""
|
|
46
|
-
}
|
|
47
|
-
],
|
|
48
|
-
"options": [
|
|
49
|
-
{
|
|
50
|
-
"name": "--simulator <string>",
|
|
51
|
-
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
|
|
52
|
-
"default": "iPhone 13"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"name": "--configuration <string>",
|
|
56
|
-
"description": "Explicitly set the scheme configuration to use",
|
|
57
|
-
"default": "Debug"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"name": "--scheme <string>",
|
|
61
|
-
"description": "Explicitly set Xcode scheme to use"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"name": "--device [string]",
|
|
65
|
-
"description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "--udid <string>",
|
|
69
|
-
"description": "Explicitly set device to use by udid"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"name": "--no-packager",
|
|
73
|
-
"description": "Do not launch packager while building"
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
"name": "--verbose",
|
|
77
|
-
"description": "Do not use xcbeautify or xcpretty even if installed"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"name": "--port <number>",
|
|
81
|
-
"default": 8081
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
"name": "--terminal <string>",
|
|
85
|
-
"description": "Launches the Metro Bundler in a new window using the specified terminal path."
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"name": "log-android",
|
|
91
|
-
"description": "starts logkitty"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"name": "run-android",
|
|
95
|
-
"description": "builds your app and starts it on a connected Android emulator or device",
|
|
96
|
-
"options": [
|
|
97
|
-
{
|
|
98
|
-
"name": "--variant <string>",
|
|
99
|
-
"description": "Specify your app's build variant",
|
|
100
|
-
"default": "debug"
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
"name": "--appId <string>",
|
|
104
|
-
"description": "Specify an applicationId to launch after build. If not specified, `package` from AndroidManifest.xml will be used.",
|
|
105
|
-
"default": ""
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
"name": "--appIdSuffix <string>",
|
|
109
|
-
"description": "Specify an applicationIdSuffix to launch after build.",
|
|
110
|
-
"default": ""
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
"name": "--main-activity <string>",
|
|
114
|
-
"description": "Name of the activity to start",
|
|
115
|
-
"default": "MainActivity"
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
"name": "--deviceId <string>",
|
|
119
|
-
"description": "builds your app and starts it on a specific device/simulator with the given device id (listed by running \"adb devices\" on the command line)."
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
"name": "--no-packager",
|
|
123
|
-
"description": "Do not launch packager while building"
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
"name": "--port <number>",
|
|
127
|
-
"default": 8081
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
"name": "--terminal <string>",
|
|
131
|
-
"description": "Launches the Metro Bundler in a new window using the specified terminal path.",
|
|
132
|
-
"default": "tmux"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
"name": "--tasks <list>",
|
|
136
|
-
"description": "Run custom Gradle tasks. By default it's \"installDebug\""
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
"name": "--active-arch-only",
|
|
140
|
-
"description": "Build native libraries only for the current device architecture for debug builds.",
|
|
141
|
-
"default": false
|
|
142
|
-
}
|
|
143
|
-
]
|
|
144
|
-
}
|
|
145
|
-
],
|
|
146
|
-
"healthChecks": [],
|
|
147
|
-
"platforms": {
|
|
148
|
-
"ios": {},
|
|
149
|
-
"android": {}
|
|
150
|
-
},
|
|
151
|
-
"project": {
|
|
152
|
-
"ios": {
|
|
153
|
-
"sourceDir": "/root/apps/demo/ios",
|
|
154
|
-
"xcodeProject": {
|
|
155
|
-
"name": "RN070.xcworkspace",
|
|
156
|
-
"isWorkspace": true
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
"android": {
|
|
160
|
-
"sourceDir": "/root/apps/demo/android",
|
|
161
|
-
"appName": "app",
|
|
162
|
-
"packageName": "com.rn070"
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
package/src/utils/Path.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import minimatch from 'minimatch';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Indicate the given `filePath` should be excluded by `ignorePaths`
|
|
5
|
-
*/
|
|
6
|
-
export function isIgnoredPath(
|
|
7
|
-
filePath: string,
|
|
8
|
-
ignorePaths: string[],
|
|
9
|
-
minimatchOptions: minimatch.IOptions = { dot: true }
|
|
10
|
-
): boolean {
|
|
11
|
-
const minimatchObjs = ignorePaths.map(
|
|
12
|
-
(ignorePath) => new minimatch.Minimatch(ignorePath, minimatchOptions)
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
let result = false;
|
|
16
|
-
for (const minimatchObj of minimatchObjs) {
|
|
17
|
-
const currMatch = minimatchObj.match(filePath);
|
|
18
|
-
if (minimatchObj.negate && result && !currMatch) {
|
|
19
|
-
// Special handler for negate (!pattern).
|
|
20
|
-
// As long as previous match result is true and not matched from the current negate pattern, we should early return.
|
|
21
|
-
return false;
|
|
22
|
-
}
|
|
23
|
-
result ||= currMatch;
|
|
24
|
-
}
|
|
25
|
-
return result;
|
|
26
|
-
}
|
package/src/utils/Profile.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import chalk from 'chalk';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Wrap a method and profile the time it takes to execute the method using `EXPO_PROFILE`.
|
|
5
|
-
* Works best with named functions (i.e. not arrow functions).
|
|
6
|
-
*
|
|
7
|
-
* @param fn function to profile.
|
|
8
|
-
* @param functionName optional name of the function to display in the profile output.
|
|
9
|
-
*/
|
|
10
|
-
export function profile<IArgs extends any[], T extends (...args: IArgs) => any>(
|
|
11
|
-
fn: T,
|
|
12
|
-
functionName: string = fn.name
|
|
13
|
-
): T {
|
|
14
|
-
if (!process.env['DEBUG']) {
|
|
15
|
-
return fn;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const name = chalk.dim(`⏱ [profile] ${functionName ?? 'unknown'}`);
|
|
19
|
-
|
|
20
|
-
return ((...args: IArgs) => {
|
|
21
|
-
// Start the timer.
|
|
22
|
-
console.time(name);
|
|
23
|
-
|
|
24
|
-
// Invoke the method.
|
|
25
|
-
const results = fn(...args);
|
|
26
|
-
|
|
27
|
-
// If non-promise then return as-is.
|
|
28
|
-
if (!(results instanceof Promise)) {
|
|
29
|
-
console.timeEnd(name);
|
|
30
|
-
return results;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Otherwise await to profile after the promise resolves.
|
|
34
|
-
return new Promise<Awaited<ReturnType<T>>>((resolve, reject) => {
|
|
35
|
-
results.then(
|
|
36
|
-
(results) => {
|
|
37
|
-
resolve(results);
|
|
38
|
-
console.timeEnd(name);
|
|
39
|
-
},
|
|
40
|
-
(reason) => {
|
|
41
|
-
reject(reason);
|
|
42
|
-
console.timeEnd(name);
|
|
43
|
-
}
|
|
44
|
-
);
|
|
45
|
-
});
|
|
46
|
-
}) as T;
|
|
47
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { isIgnoredPath } from '../Path';
|
|
2
|
-
|
|
3
|
-
describe(isIgnoredPath, () => {
|
|
4
|
-
it('should support file pattern', () => {
|
|
5
|
-
expect(isIgnoredPath('app.json', ['app.json'])).toBe(true);
|
|
6
|
-
expect(isIgnoredPath('app.ts', ['*.{js,ts}'])).toBe(true);
|
|
7
|
-
expect(isIgnoredPath('/dir/app.json', ['/dir/*.json'])).toBe(true);
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
it('should support directory pattern', () => {
|
|
11
|
-
expect(isIgnoredPath('/app/ios/Podfile', ['**/ios/**/*'])).toBe(true);
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('case sensitive by design', () => {
|
|
15
|
-
expect(isIgnoredPath('app.json', ['APP.JSON'])).toBe(false);
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should include dot files from wildcard pattern', () => {
|
|
19
|
-
expect(isIgnoredPath('.bashrc', ['*'])).toBe(true);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('no `matchBase` and `partial` by design', () => {
|
|
23
|
-
expect(isIgnoredPath('/dir/app.json', ['app.json'])).toBe(false);
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('match a file inside a dir should use a globstar', () => {
|
|
27
|
-
expect(isIgnoredPath('/dir/app.ts', ['*'])).toBe(false);
|
|
28
|
-
expect(isIgnoredPath('/dir/app.ts', ['**/*'])).toBe(true);
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should use `!` to override default ignorePaths', () => {
|
|
32
|
-
const ignorePaths = ['**/ios/**/*', '!**/ios/Podfile', '**/android/**/*'];
|
|
33
|
-
expect(isIgnoredPath('/app/ios/Podfile', ignorePaths)).toBe(false);
|
|
34
|
-
expect(isIgnoredPath('/app/ios/Podfile.lock', ignorePaths)).toBe(true);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { profile } from '../Profile';
|
|
2
|
-
|
|
3
|
-
it(`respects input types`, () => {
|
|
4
|
-
const fn = jest.fn((a: string, b: string) => {
|
|
5
|
-
if (typeof a === 'string') return 1;
|
|
6
|
-
if (typeof b === 'string') return -1;
|
|
7
|
-
return 0;
|
|
8
|
-
});
|
|
9
|
-
expect(profile(fn)('a', 'b')).toBe(1);
|
|
10
|
-
expect(fn).toBeCalledWith('a', 'b');
|
|
11
|
-
});
|