react-native-in-app-debugger 1.0.72 → 1.0.73
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/Highlight.jsx +4 -4
- package/Libs.jsx +30 -10
- package/package.json +1 -1
- package/parentDependencies.js +1 -1
- package/postinstall.js +2 -1
package/Highlight.jsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Text from './Text';
|
|
3
3
|
|
|
4
|
-
export default ({ text, filter }) => {
|
|
5
|
-
if (!filter || !/^[a-zA-Z0-9./]+$/.test(filter)) return text
|
|
4
|
+
export default ({ text, filter, style = {} }) => {
|
|
5
|
+
if (!filter || !/^[a-zA-Z0-9./]+$/.test(filter)) return <Text style={style}>{text}</Text>;
|
|
6
6
|
const indices = [...text.matchAll(new RegExp(filter, 'gi'))].map((a) => a.index);
|
|
7
|
-
if (!indices.length) return text
|
|
7
|
+
if (!indices.length) return <Text style={style}>{text}</Text>;
|
|
8
8
|
return (
|
|
9
9
|
<>
|
|
10
10
|
{indices.map((i, ii) => {
|
|
@@ -14,7 +14,7 @@ export default ({ text, filter }) => {
|
|
|
14
14
|
return (
|
|
15
15
|
<>
|
|
16
16
|
{preText}
|
|
17
|
-
<Text style={{ backgroundColor: 'yellow', color: 'black' }}>{searchText}</Text>
|
|
17
|
+
<Text style={{ backgroundColor: 'yellow', color: 'black', ...style }}>{searchText}</Text>
|
|
18
18
|
{seqText}
|
|
19
19
|
</>
|
|
20
20
|
);
|
package/Libs.jsx
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
import Text from "./Text";
|
|
9
9
|
import Highlight from "./Highlight";
|
|
10
10
|
import packageJson from "../../package.json";
|
|
11
|
+
import realDeps from "./parentDependencies.js";
|
|
11
12
|
|
|
12
13
|
const libs = Object.entries(packageJson.dependencies).reduce(
|
|
13
14
|
(arr, [name, version]) => [...arr, { name, version }],
|
|
@@ -33,19 +34,38 @@ export default () => {
|
|
|
33
34
|
(l) =>
|
|
34
35
|
!filter ||
|
|
35
36
|
l.name.toLowerCase().includes(filter) ||
|
|
36
|
-
l.version.includes(filter)
|
|
37
|
+
l.version.includes(filter) ||
|
|
38
|
+
realDeps[l.name].includes(filter)
|
|
37
39
|
)}
|
|
38
40
|
showsVerticalScrollIndicator
|
|
39
41
|
keyExtractor={(i) => i.name}
|
|
40
|
-
renderItem={({ item }) =>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
renderItem={({ item }) => {
|
|
43
|
+
const showAlt =
|
|
44
|
+
!!realDeps[item.name] &&
|
|
45
|
+
item.version.replace("^", "") !== realDeps[item.name];
|
|
46
|
+
return (
|
|
47
|
+
<TouchableHighlight underlayColor="#ffffff44" onPress={() => null}>
|
|
48
|
+
<Text selectable style={{ color: "white", marginVertical: 10 }}>
|
|
49
|
+
<Highlight text={item.name + " : "} filter={filter} />
|
|
50
|
+
<Highlight
|
|
51
|
+
text={item.version}
|
|
52
|
+
filter={filter}
|
|
53
|
+
style={
|
|
54
|
+
showAlt
|
|
55
|
+
? { textDecorationLine: "line-through", color: "red" }
|
|
56
|
+
: undefined
|
|
57
|
+
}
|
|
58
|
+
/>
|
|
59
|
+
{showAlt && (
|
|
60
|
+
<Highlight
|
|
61
|
+
text={" " + realDeps[item.name]}
|
|
62
|
+
filter={filter}
|
|
63
|
+
/>
|
|
64
|
+
)}
|
|
65
|
+
</Text>
|
|
66
|
+
</TouchableHighlight>
|
|
67
|
+
);
|
|
68
|
+
}}
|
|
49
69
|
/>
|
|
50
70
|
</>
|
|
51
71
|
);
|
package/package.json
CHANGED
package/parentDependencies.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{}
|
|
1
|
+
export default {}
|
package/postinstall.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
const fs = require('fs');
|
|
2
2
|
const read = (p) => JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
3
3
|
const parentDependencies = fs.openSync('./parentDependencies.js', 'w');
|
|
4
|
-
fs.writeSync(parentDependencies, '{');
|
|
4
|
+
fs.writeSync(parentDependencies, 'export default {');
|
|
5
5
|
for (const d in read('../../package.json').dependencies) {
|
|
6
6
|
try {
|
|
7
7
|
fs.writeSync(parentDependencies, `"${d}":"${read(`../${d}/package.json`).version}",`);
|
|
8
8
|
} catch (e) {}
|
|
9
9
|
}
|
|
10
10
|
fs.writeSync(parentDependencies, '}');
|
|
11
|
+
fs.closeSync(parentDependencies);
|