react-native-in-app-debugger 1.0.71 → 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 +3 -2
- package/parentDependencies.js +1 -0
- package/postinstall.js +11 -0
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
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-in-app-debugger",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.73",
|
|
4
4
|
"description": "This library's main usage is to be used by Non-Technical testers during UAT, SIT or any testing phase.",
|
|
5
5
|
"main": "index.jsx",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
8
|
-
"
|
|
8
|
+
"deploy": "npm publish --access=public",
|
|
9
|
+
"postinstall": "node postinstall.js"
|
|
9
10
|
},
|
|
10
11
|
"keywords": [
|
|
11
12
|
"debugger"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
package/postinstall.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const fs = require('fs');
|
|
2
|
+
const read = (p) => JSON.parse(fs.readFileSync(p, 'utf-8'));
|
|
3
|
+
const parentDependencies = fs.openSync('./parentDependencies.js', 'w');
|
|
4
|
+
fs.writeSync(parentDependencies, 'export default {');
|
|
5
|
+
for (const d in read('../../package.json').dependencies) {
|
|
6
|
+
try {
|
|
7
|
+
fs.writeSync(parentDependencies, `"${d}":"${read(`../${d}/package.json`).version}",`);
|
|
8
|
+
} catch (e) {}
|
|
9
|
+
}
|
|
10
|
+
fs.writeSync(parentDependencies, '}');
|
|
11
|
+
fs.closeSync(parentDependencies);
|