@norcy/react-native-toolkit 0.2.7 → 0.2.10
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 +12 -0
- package/android/build.gradle +7 -0
- package/android/buildscript.gradle +15 -0
- package/android/dependencies.gradle +149 -0
- package/android/gradle.properties +4 -4
- package/android/root.gradle +37 -0
- package/android/settings.gradle +2 -0
- package/android/src/main/AndroidManifest.xml +1 -1
- package/android/src/main/java/com/norcy/reactnativetoolkit/BaseToolkitActivity.java +42 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/BaseToolkitApplication.java +63 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/CheckPackageInstallationModule.java +48 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/NCYAPI.java +191 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/NCYReport.java +48 -0
- package/android/src/main/java/com/norcy/reactnativetoolkit/PreferencesManager.java +50 -0
- package/android/src/main/java/com/{norcyreactnativetoolkit → norcy/reactnativetoolkit}/ReactNativeToolkitModule.kt +2 -1
- package/android/src/main/java/com/{norcyreactnativetoolkit → norcy/reactnativetoolkit}/ReactNativeToolkitPackage.kt +8 -2
- package/android/src/main/java/com/norcy/reactnativetoolkit/UMengManager.java +54 -0
- package/lib/commonjs/AppLink.js.map +1 -1
- package/lib/commonjs/SentryManager.js +31 -23
- package/lib/commonjs/SentryManager.js.map +1 -1
- package/lib/commonjs/Tool.js +26 -0
- package/lib/commonjs/Tool.js.map +1 -1
- package/lib/module/AppLink.js.map +1 -1
- package/lib/module/SentryManager.js +32 -24
- package/lib/module/SentryManager.js.map +1 -1
- package/lib/module/Tool.js +27 -1
- package/lib/module/Tool.js.map +1 -1
- package/lib/typescript/AppLink.d.ts +1 -2
- package/lib/typescript/AppLink.d.ts.map +1 -1
- package/lib/typescript/SentryManager.d.ts.map +1 -1
- package/lib/typescript/Tool.d.ts +3 -0
- package/lib/typescript/Tool.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/AppLink.ts +2 -3
- package/src/SentryManager.ts +37 -27
- package/src/Tool.ts +39 -1
- package/.circleci/config.yml +0 -98
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/workflows/publish-on-main.yml +0 -32
- package/.gitignore +0 -66
- package/.husky/pre-commit +0 -2
- package/.prettierrc +0 -8
- package/.watchmanconfig +0 -6
- package/babel.config.js +0 -3
- package/cocoa_plugins/cocoapods-rn-toolkit/Gemfile +0 -13
- package/cocoa_plugins/cocoapods-rn-toolkit/LICENSE.txt +0 -22
- package/cocoa_plugins/cocoapods-rn-toolkit/README.md +0 -27
- package/cocoa_plugins/cocoapods-rn-toolkit/Rakefile +0 -13
- package/cocoa_plugins/cocoapods-rn-toolkit/cocoapods-rn-toolkit.gemspec +0 -28
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/command/toolkit.rb +0 -44
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/command.rb +0 -1
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/common_build_settings.rb +0 -12
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/gem_version.rb +0 -3
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/ios17_uigraphics.rb +0 -57
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/library_search_paths.rb +0 -41
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/xcode16_rnziparchive.rb +0 -15
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit.rb +0 -1
- package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods_plugin.rb +0 -32
- package/cocoa_plugins/cocoapods-rn-toolkit/spec/command/toolkit_spec.rb +0 -12
- package/cocoa_plugins/cocoapods-rn-toolkit/spec/spec_helper.rb +0 -50
- package/locales/en-US.json +0 -1
- package/locales/zh-CN.json +0 -1
- package/tsconfig.json +0 -27
- package/yarn.lock +0 -10168
package/lib/typescript/Tool.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export declare const Tool: {
|
|
|
53
53
|
useForceUpdate: () => () => void;
|
|
54
54
|
showToast: (toast: string) => void;
|
|
55
55
|
alertWithConfig: (config?: AlertConfig) => boolean;
|
|
56
|
+
requestAppStoreReview: () => boolean;
|
|
56
57
|
goAppStoreReview: () => void;
|
|
57
58
|
goUpgrade: () => void;
|
|
58
59
|
notifyMe: (text: string) => Promise<void>;
|
|
@@ -72,6 +73,8 @@ export declare const Tool: {
|
|
|
72
73
|
isHuaweiDevice: () => boolean;
|
|
73
74
|
copy: (text: string) => void;
|
|
74
75
|
paste: () => Promise<string>;
|
|
76
|
+
isAgreed: () => boolean;
|
|
77
|
+
onAgree: () => void;
|
|
75
78
|
};
|
|
76
79
|
export {};
|
|
77
80
|
//# sourceMappingURL=Tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tool.d.ts","sourceRoot":"","sources":["../../src/Tool.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tool.d.ts","sourceRoot":"","sources":["../../src/Tool.ts"],"names":[],"mappings":"AA8BA,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAE3B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAElB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IAEjB,WAAW,EAAE,MAAM,CAAC;IAEpB,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IAErB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,EAAE,CAAC;CACL;AAED,eAAO,IAAI,aAAa,EAAE,iBAAiB,CAAC;AAE5C,eAAO,MAAM,iBAAiB,GAAI,QAAQ,iBAAiB,SAE1D,CAAC;AAuDF,eAAO,MAAM,IAAI;mBACA,MAAM;qBAGJ,IAAI,QAAQ,MAAM,GAAG,MAAM;sBAkC1B,GAAG;uBAWF,MAAM;uBAIN,MAAM;6BAIA,MAAM;;IAc/B;;;;;;;;;OASG;2BACoB,MAAM;;uBA2BV,MAAM;+BAME,WAAW;;;;qBAiFf,MAAM;gDAMqB,MAAM,OAAO,CAAC,OAAO,CAAC;uBAmDjE,MAAM,cACC,MAAM,kBACF,MAAM,OAAO,CAAC,OAAO,CAAC;;;;;;;+BAoEb,OAAO;;;;;;iBAsErB,MAAM;;;;CAoBpB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norcy/react-native-toolkit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "My Toolkit",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
@@ -56,9 +56,6 @@
|
|
|
56
56
|
"@react-native-clipboard/clipboard": "^1.16.3",
|
|
57
57
|
"@react-native-community/eslint-config": "^3.2.0",
|
|
58
58
|
"@react-native-masked-view/masked-view": "^0.3.0",
|
|
59
|
-
"@react-navigation/bottom-tabs": "^6.5.0",
|
|
60
|
-
"@react-navigation/native": "^6.1.0",
|
|
61
|
-
"@react-navigation/stack": "^6.3.0",
|
|
62
59
|
"@release-it/conventional-changelog": "^8.0.2",
|
|
63
60
|
"@sentry/cli": "^2.38.2",
|
|
64
61
|
"@sentry/react-native": "^5.33.1",
|
|
@@ -80,13 +77,15 @@
|
|
|
80
77
|
"react-native": "0.72.5",
|
|
81
78
|
"react-native-blob-util": "^0.19.11",
|
|
82
79
|
"react-native-builder-bob": "^0.30.2",
|
|
83
|
-
"react-native-device-info": "^
|
|
80
|
+
"react-native-device-info": "^11.1.0",
|
|
84
81
|
"react-native-gesture-handler": "^2.0.0",
|
|
82
|
+
"react-native-in-app-review": "^4.4.2",
|
|
85
83
|
"react-native-mmkv-storage": "0.10.3",
|
|
86
84
|
"react-native-purchases": "^7.28.1",
|
|
87
85
|
"react-native-safe-area-context": "^4.0.0",
|
|
88
86
|
"react-native-screens": "^3.0.0",
|
|
89
87
|
"react-native-simple-toast": "^1.1.3",
|
|
88
|
+
"react-native-splash-screen": "^3.3.0",
|
|
90
89
|
"react-native-wechat-lib": "^1.1.26",
|
|
91
90
|
"release-it": "^17.7.0",
|
|
92
91
|
"semver": "^7.3.7",
|
|
@@ -98,10 +97,9 @@
|
|
|
98
97
|
"@react-native-async-storage/async-storage": "*",
|
|
99
98
|
"@react-native-camera-roll/camera-roll": "*",
|
|
100
99
|
"@react-native-clipboard/clipboard": "*",
|
|
100
|
+
"@react-native-community/async-storage": "*",
|
|
101
|
+
"@react-native-community/cameraroll": "*",
|
|
101
102
|
"@react-native-masked-view/masked-view": "*",
|
|
102
|
-
"@react-navigation/bottom-tabs": "^6.0.0",
|
|
103
|
-
"@react-navigation/native": "^6.0.0",
|
|
104
|
-
"@react-navigation/stack": "^6.0.0",
|
|
105
103
|
"@sentry/react-native": "*",
|
|
106
104
|
"i18n-js": "*",
|
|
107
105
|
"js-sha1": "*",
|
|
@@ -112,11 +110,13 @@
|
|
|
112
110
|
"react-native-blob-util": "*",
|
|
113
111
|
"react-native-device-info": "*",
|
|
114
112
|
"react-native-gesture-handler": "^2.0.0",
|
|
113
|
+
"react-native-in-app-review": "*",
|
|
115
114
|
"react-native-mmkv-storage": "~0.10.3",
|
|
116
115
|
"react-native-purchases": "*",
|
|
117
116
|
"react-native-safe-area-context": "^4.0.0",
|
|
118
117
|
"react-native-screens": "^3.0.0",
|
|
119
118
|
"react-native-simple-toast": "*",
|
|
119
|
+
"react-native-splash-screen": "*",
|
|
120
120
|
"react-native-wechat-lib": "*",
|
|
121
121
|
"semver": "*"
|
|
122
122
|
},
|
package/src/AppLink.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NavigationProp, ParamListBase } from '@react-navigation/native';
|
|
2
1
|
import queryString from 'query-string';
|
|
3
2
|
import { Linking } from 'react-native';
|
|
4
3
|
import { Tool, ToolkitConfig } from './Tool';
|
|
@@ -36,7 +35,7 @@ const getAppInsideQueryParams = (
|
|
|
36
35
|
return ret;
|
|
37
36
|
};
|
|
38
37
|
|
|
39
|
-
let GlobalNavigation:
|
|
38
|
+
let GlobalNavigation: any = null;
|
|
40
39
|
|
|
41
40
|
export const AppLink = {
|
|
42
41
|
/* 测试用例:
|
|
@@ -93,7 +92,7 @@ export const AppLink = {
|
|
|
93
92
|
GlobalNavigation?.navigate(page, params);
|
|
94
93
|
},
|
|
95
94
|
|
|
96
|
-
init: (navigation:
|
|
95
|
+
init: (navigation: any) => {
|
|
97
96
|
GlobalNavigation = navigation;
|
|
98
97
|
setTimeout(() => {
|
|
99
98
|
Linking.getInitialURL()
|
package/src/SentryManager.ts
CHANGED
|
@@ -1,41 +1,51 @@
|
|
|
1
1
|
import * as Sentry from '@sentry/react-native';
|
|
2
2
|
import { LoginSuccessResultType } from './LoginManager';
|
|
3
3
|
import { Notification } from './Notification';
|
|
4
|
-
import { ToolkitConfig } from './Tool';
|
|
4
|
+
import { Tool, ToolkitConfig } from './Tool';
|
|
5
5
|
|
|
6
6
|
let isReady = false;
|
|
7
|
+
|
|
8
|
+
const doInit = () => {
|
|
9
|
+
console.log('使用 Sentry');
|
|
10
|
+
Sentry.init({
|
|
11
|
+
dsn: ToolkitConfig.SentryDSN,
|
|
12
|
+
tracesSampleRate: 1.0,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
Notification.addListener(
|
|
16
|
+
'onLoginSuccess',
|
|
17
|
+
({ user }: LoginSuccessResultType) => {
|
|
18
|
+
const sentryUser: Sentry.User = {
|
|
19
|
+
id: user.AVUser.get('objectId'),
|
|
20
|
+
email: user.email,
|
|
21
|
+
username: user.nickname,
|
|
22
|
+
};
|
|
23
|
+
Sentry.setUser(sentryUser);
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
Notification.addListener('onLogout', () => {
|
|
28
|
+
Sentry.setUser(null);
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
// Sentry.nativeCrash();
|
|
32
|
+
// Sentry.captureException(new Error('测试77!'));
|
|
33
|
+
// throw new Error('My first Sentry error!');
|
|
34
|
+
};
|
|
35
|
+
|
|
7
36
|
export const SentryManager = {
|
|
8
37
|
init: () => {
|
|
9
38
|
isReady = !__DEV__ && !!ToolkitConfig.SentryDSN;
|
|
10
39
|
if (!isReady) {
|
|
11
40
|
console.log('不使用 Sentry');
|
|
12
41
|
} else {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
Notification.addListener(
|
|
21
|
-
'onLoginSuccess',
|
|
22
|
-
({ user }: LoginSuccessResultType) => {
|
|
23
|
-
const sentryUser: Sentry.User = {
|
|
24
|
-
id: user.AVUser.get('objectId'),
|
|
25
|
-
email: user.email,
|
|
26
|
-
username: user.nickname,
|
|
27
|
-
};
|
|
28
|
-
Sentry.setUser(sentryUser);
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
Notification.addListener('onLogout', () => {
|
|
33
|
-
Sentry.setUser(null);
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
// Sentry.nativeCrash();
|
|
37
|
-
// Sentry.captureException(new Error('测试77!'));
|
|
38
|
-
// throw new Error('My first Sentry error!');
|
|
42
|
+
if (Tool.isAgreed()) {
|
|
43
|
+
doInit();
|
|
44
|
+
} else {
|
|
45
|
+
Notification.addListenerOnce('onAgree', () => {
|
|
46
|
+
doInit();
|
|
47
|
+
});
|
|
48
|
+
}
|
|
39
49
|
}
|
|
40
50
|
},
|
|
41
51
|
|
package/src/Tool.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
AppLink,
|
|
3
|
+
Notification,
|
|
4
|
+
SyncPrefData,
|
|
5
|
+
} from '@norcy/react-native-toolkit';
|
|
2
6
|
import { CameraRoll } from '@react-native-camera-roll/camera-roll';
|
|
3
7
|
import Clipboard from '@react-native-clipboard/clipboard';
|
|
4
8
|
import { useState } from 'react';
|
|
@@ -18,6 +22,7 @@ import {
|
|
|
18
22
|
isLandscapeSync,
|
|
19
23
|
isTablet,
|
|
20
24
|
} from 'react-native-device-info';
|
|
25
|
+
import InAppReview from 'react-native-in-app-review';
|
|
21
26
|
import Toast from 'react-native-simple-toast';
|
|
22
27
|
import { PlatformHelper } from './PlatformHelper';
|
|
23
28
|
import { BuildInPrefs, PrefData } from './PrefData';
|
|
@@ -243,6 +248,26 @@ export const Tool = {
|
|
|
243
248
|
return false;
|
|
244
249
|
},
|
|
245
250
|
|
|
251
|
+
requestAppStoreReview: () => {
|
|
252
|
+
if (Platform.OS === 'ios' && InAppReview.isAvailable()) {
|
|
253
|
+
// trigger UI InAppreview
|
|
254
|
+
InAppReview.RequestInAppReview()
|
|
255
|
+
.then((hasFlowFinishedSuccessfully) => {
|
|
256
|
+
console.log(
|
|
257
|
+
'InAppReview in ios has launched successfully',
|
|
258
|
+
hasFlowFinishedSuccessfully
|
|
259
|
+
);
|
|
260
|
+
})
|
|
261
|
+
.catch((error) => {
|
|
262
|
+
console.log(error);
|
|
263
|
+
});
|
|
264
|
+
return true;
|
|
265
|
+
} else {
|
|
266
|
+
Tool.goAppStoreReview();
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
|
|
246
271
|
goAppStoreReview: () => {
|
|
247
272
|
ReportUtil.report('StoreReview');
|
|
248
273
|
if (PlatformHelper.isIOS()) {
|
|
@@ -499,4 +524,17 @@ export const Tool = {
|
|
|
499
524
|
paste: () => {
|
|
500
525
|
return Clipboard.getString();
|
|
501
526
|
},
|
|
527
|
+
|
|
528
|
+
isAgreed: () => {
|
|
529
|
+
if (Platform.OS === 'ios') {
|
|
530
|
+
return true;
|
|
531
|
+
}
|
|
532
|
+
return SyncPrefData.getPrefString('Sync_AgreeMode') === '1';
|
|
533
|
+
},
|
|
534
|
+
|
|
535
|
+
onAgree: () => {
|
|
536
|
+
SyncPrefData.setPrefString('Sync_AgreeMode', '1');
|
|
537
|
+
NativeModules.NCYAPI?.onAgree && NativeModules.NCYAPI.onAgree();
|
|
538
|
+
Notification.postNotification('onAgree');
|
|
539
|
+
},
|
|
502
540
|
};
|
package/.circleci/config.yml
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
version: 2.1
|
|
2
|
-
|
|
3
|
-
executors:
|
|
4
|
-
default:
|
|
5
|
-
docker:
|
|
6
|
-
- image: circleci/node:10
|
|
7
|
-
working_directory: ~/project
|
|
8
|
-
|
|
9
|
-
commands:
|
|
10
|
-
attach_project:
|
|
11
|
-
steps:
|
|
12
|
-
- attach_workspace:
|
|
13
|
-
at: ~/project
|
|
14
|
-
|
|
15
|
-
jobs:
|
|
16
|
-
install-dependencies:
|
|
17
|
-
executor: default
|
|
18
|
-
steps:
|
|
19
|
-
- checkout
|
|
20
|
-
- attach_project
|
|
21
|
-
- restore_cache:
|
|
22
|
-
keys:
|
|
23
|
-
- dependencies-{{ checksum "package.json" }}
|
|
24
|
-
- dependencies-
|
|
25
|
-
- restore_cache:
|
|
26
|
-
keys:
|
|
27
|
-
- dependencies-example-{{ checksum "example/package.json" }}
|
|
28
|
-
- dependencies-example-
|
|
29
|
-
- run:
|
|
30
|
-
name: Install dependencies
|
|
31
|
-
command: |
|
|
32
|
-
yarn install --cwd example --frozen-lockfile
|
|
33
|
-
yarn install --frozen-lockfile
|
|
34
|
-
- save_cache:
|
|
35
|
-
key: dependencies-{{ checksum "package.json" }}
|
|
36
|
-
paths: node_modules
|
|
37
|
-
- save_cache:
|
|
38
|
-
key: dependencies-example-{{ checksum "example/package.json" }}
|
|
39
|
-
paths: example/node_modules
|
|
40
|
-
- persist_to_workspace:
|
|
41
|
-
root: .
|
|
42
|
-
paths: .
|
|
43
|
-
|
|
44
|
-
lint:
|
|
45
|
-
executor: default
|
|
46
|
-
steps:
|
|
47
|
-
- attach_project
|
|
48
|
-
- run:
|
|
49
|
-
name: Lint files
|
|
50
|
-
command: |
|
|
51
|
-
yarn lint
|
|
52
|
-
|
|
53
|
-
typescript:
|
|
54
|
-
executor: default
|
|
55
|
-
steps:
|
|
56
|
-
- attach_project
|
|
57
|
-
- run:
|
|
58
|
-
name: Typecheck files
|
|
59
|
-
command: |
|
|
60
|
-
yarn typescript
|
|
61
|
-
|
|
62
|
-
unit-tests:
|
|
63
|
-
executor: default
|
|
64
|
-
steps:
|
|
65
|
-
- attach_project
|
|
66
|
-
- run:
|
|
67
|
-
name: Run unit tests
|
|
68
|
-
command: |
|
|
69
|
-
yarn test --coverage
|
|
70
|
-
- store_artifacts:
|
|
71
|
-
path: coverage
|
|
72
|
-
destination: coverage
|
|
73
|
-
|
|
74
|
-
build-package:
|
|
75
|
-
executor: default
|
|
76
|
-
steps:
|
|
77
|
-
- attach_project
|
|
78
|
-
- run:
|
|
79
|
-
name: Build package
|
|
80
|
-
command: |
|
|
81
|
-
yarn prepare
|
|
82
|
-
|
|
83
|
-
workflows:
|
|
84
|
-
build-and-test:
|
|
85
|
-
jobs:
|
|
86
|
-
- install-dependencies
|
|
87
|
-
- lint:
|
|
88
|
-
requires:
|
|
89
|
-
- install-dependencies
|
|
90
|
-
- typescript:
|
|
91
|
-
requires:
|
|
92
|
-
- install-dependencies
|
|
93
|
-
- unit-tests:
|
|
94
|
-
requires:
|
|
95
|
-
- install-dependencies
|
|
96
|
-
- build-package:
|
|
97
|
-
requires:
|
|
98
|
-
- install-dependencies
|
package/.editorconfig
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# EditorConfig helps developers define and maintain consistent
|
|
2
|
-
# coding styles between different editors and IDEs
|
|
3
|
-
# editorconfig.org
|
|
4
|
-
|
|
5
|
-
root = true
|
|
6
|
-
|
|
7
|
-
[*]
|
|
8
|
-
|
|
9
|
-
indent_style = space
|
|
10
|
-
indent_size = 2
|
|
11
|
-
|
|
12
|
-
end_of_line = lf
|
|
13
|
-
charset = utf-8
|
|
14
|
-
trim_trailing_whitespace = true
|
|
15
|
-
insert_final_newline = true
|
package/.gitattributes
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
name: Publish to npm
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [master, beta]
|
|
6
|
-
|
|
7
|
-
jobs:
|
|
8
|
-
publish-npm:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v4
|
|
12
|
-
with:
|
|
13
|
-
fetch-depth: 0
|
|
14
|
-
# 添加 token 权限
|
|
15
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
16
|
-
|
|
17
|
-
- uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: '18.x'
|
|
20
|
-
registry-url: 'https://registry.npmjs.org'
|
|
21
|
-
|
|
22
|
-
- run: yarn install --frozen-lockfile --ignore-scripts
|
|
23
|
-
|
|
24
|
-
- run: |
|
|
25
|
-
git config user.name "GitHub Actions"
|
|
26
|
-
git config user.email "actions@github.com"
|
|
27
|
-
yarn publish --patch --message "Bump version to %s [skip ci]"
|
|
28
|
-
git push origin ${{ github.ref_name }} --follow-tags
|
|
29
|
-
env:
|
|
30
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
31
|
-
# 确保使用 checkout 步骤配置的 token
|
|
32
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
package/.gitignore
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# OSX
|
|
2
|
-
#
|
|
3
|
-
.DS_Store
|
|
4
|
-
|
|
5
|
-
# XDE
|
|
6
|
-
.expo/
|
|
7
|
-
|
|
8
|
-
# VSCode
|
|
9
|
-
.vscode/
|
|
10
|
-
jsconfig.json
|
|
11
|
-
|
|
12
|
-
# Xcode
|
|
13
|
-
#
|
|
14
|
-
build/
|
|
15
|
-
*.pbxuser
|
|
16
|
-
!default.pbxuser
|
|
17
|
-
*.mode1v3
|
|
18
|
-
!default.mode1v3
|
|
19
|
-
*.mode2v3
|
|
20
|
-
!default.mode2v3
|
|
21
|
-
*.perspectivev3
|
|
22
|
-
!default.perspectivev3
|
|
23
|
-
xcuserdata
|
|
24
|
-
*.xccheckout
|
|
25
|
-
*.moved-aside
|
|
26
|
-
DerivedData
|
|
27
|
-
*.hmap
|
|
28
|
-
*.ipa
|
|
29
|
-
*.xcuserstate
|
|
30
|
-
project.xcworkspace
|
|
31
|
-
|
|
32
|
-
# Android/IJ
|
|
33
|
-
#
|
|
34
|
-
.idea
|
|
35
|
-
.gradle
|
|
36
|
-
local.properties
|
|
37
|
-
android.iml
|
|
38
|
-
|
|
39
|
-
# Cocoapods
|
|
40
|
-
#
|
|
41
|
-
example/ios/Pods
|
|
42
|
-
|
|
43
|
-
# node.js
|
|
44
|
-
#
|
|
45
|
-
node_modules/
|
|
46
|
-
npm-debug.log
|
|
47
|
-
yarn-debug.log
|
|
48
|
-
yarn-error.log
|
|
49
|
-
|
|
50
|
-
# BUCK
|
|
51
|
-
buck-out/
|
|
52
|
-
\.buckd/
|
|
53
|
-
android/app/libs
|
|
54
|
-
android/keystores/debug.keystore
|
|
55
|
-
|
|
56
|
-
# Expo
|
|
57
|
-
.expo/*
|
|
58
|
-
|
|
59
|
-
# generated by bob
|
|
60
|
-
lib/
|
|
61
|
-
|
|
62
|
-
# cocoa_plugins
|
|
63
|
-
!/cocoa_plugins/cocoapods-rn-toolkit/lib
|
|
64
|
-
pkg
|
|
65
|
-
.idea/
|
|
66
|
-
*.gem
|
package/.husky/pre-commit
DELETED
package/.prettierrc
DELETED
package/.watchmanconfig
DELETED
package/babel.config.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2024 Nx <chenyg32@gmail.com>
|
|
2
|
-
|
|
3
|
-
MIT License
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
|
-
a copy of this software and associated documentation files (the
|
|
7
|
-
"Software"), to deal in the Software without restriction, including
|
|
8
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
|
9
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
|
10
|
-
permit persons to whom the Software is furnished to do so, subject to
|
|
11
|
-
the following conditions:
|
|
12
|
-
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
|
14
|
-
included in all copies or substantial portions of the Software.
|
|
15
|
-
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
17
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
18
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
19
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
20
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
21
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
22
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
# cocoapods-rn-toolkit
|
|
2
|
-
|
|
3
|
-
A description of cocoapods-rn-toolkit.
|
|
4
|
-
|
|
5
|
-
## 构建
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
gem build cocoapods-rn-toolkit.gemspec
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## 发布
|
|
12
|
-
|
|
13
|
-
```
|
|
14
|
-
# Step 1: 修改 gem_version.rb 中的版本号
|
|
15
|
-
# Step 2: 发布
|
|
16
|
-
gem push cocoapods-rn-toolkit-x.x.x.gem
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## Installation
|
|
20
|
-
|
|
21
|
-
$ gem install -s https://rubygems.org cocoapods-rn-toolkit -V
|
|
22
|
-
$ bundle install
|
|
23
|
-
|
|
24
|
-
## Usage
|
|
25
|
-
|
|
26
|
-
$ pod spec toolkit POD_NAME
|
|
27
|
-
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# coding: utf-8
|
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
|
-
require 'cocoapods-rn-toolkit/gem_version.rb'
|
|
5
|
-
|
|
6
|
-
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name = 'cocoapods-rn-toolkit'
|
|
8
|
-
spec.version = CocoapodsRnToolkit::VERSION
|
|
9
|
-
spec.authors = ['Nx']
|
|
10
|
-
spec.email = ['chenyg32@gmail.com']
|
|
11
|
-
spec.description = %q{A toolkit for React Native development with CocoaPods.}
|
|
12
|
-
spec.summary = %q{cocoapods-rn-toolkit provides utilities and commands to streamline React Native development using CocoaPods.}
|
|
13
|
-
spec.homepage = 'https://github.com/your_username/cocoapods-rn-toolkit'
|
|
14
|
-
spec.license = 'MIT'
|
|
15
|
-
|
|
16
|
-
spec.files = Dir['lib/**/*', 'README.md', 'LICENSE']
|
|
17
|
-
spec.require_paths = ['lib']
|
|
18
|
-
|
|
19
|
-
spec.add_runtime_dependency 'cocoapods', '~> 1.0'
|
|
20
|
-
|
|
21
|
-
spec.add_development_dependency 'bundler', '~> 2.0'
|
|
22
|
-
spec.add_development_dependency 'rake', '~> 13.0'
|
|
23
|
-
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
24
|
-
|
|
25
|
-
spec.required_ruby_version = '>= 2.6.0'
|
|
26
|
-
spec.platform = Gem::Platform::RUBY
|
|
27
|
-
spec.required_rubygems_version = '>= 2.7.0'
|
|
28
|
-
end
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
module Pod
|
|
2
|
-
class Command
|
|
3
|
-
# This is an example of a cocoapods plugin adding a top-level subcommand
|
|
4
|
-
# to the 'pod' command.
|
|
5
|
-
#
|
|
6
|
-
# You can also create subcommands of existing or new commands. Say you
|
|
7
|
-
# wanted to add a subcommand to `list` to show newly deprecated pods,
|
|
8
|
-
# (e.g. `pod list deprecated`), there are a few things that would need
|
|
9
|
-
# to change.
|
|
10
|
-
#
|
|
11
|
-
# - move this file to `lib/pod/command/list/deprecated.rb` and update
|
|
12
|
-
# the class to exist in the the Pod::Command::List namespace
|
|
13
|
-
# - change this class to extend from `List` instead of `Command`. This
|
|
14
|
-
# tells the plugin system that it is a subcommand of `list`.
|
|
15
|
-
# - edit `lib/cocoapods_plugins.rb` to require this file
|
|
16
|
-
#
|
|
17
|
-
# @todo Create a PR to add your plugin to CocoaPods/cocoapods.org
|
|
18
|
-
# in the `plugins.json` file, once your plugin is released.
|
|
19
|
-
#
|
|
20
|
-
class Toolkit < Command
|
|
21
|
-
self.summary = 'Short description of cocoapods-rn-toolkit.'
|
|
22
|
-
|
|
23
|
-
self.description = <<-DESC
|
|
24
|
-
Longer description of cocoapods-rn-toolkit.
|
|
25
|
-
DESC
|
|
26
|
-
|
|
27
|
-
self.arguments = 'NAME'
|
|
28
|
-
|
|
29
|
-
def initialize(argv)
|
|
30
|
-
@name = argv.shift_argument
|
|
31
|
-
super
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
def validate!
|
|
35
|
-
super
|
|
36
|
-
help! 'A Pod name is required.' unless @name
|
|
37
|
-
end
|
|
38
|
-
|
|
39
|
-
def run
|
|
40
|
-
UI.puts "Add your implementation for the cocoapods-rn-toolkit plugin in #{__FILE__}"
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require 'cocoapods-rn-toolkit/command/toolkit'
|
package/cocoa_plugins/cocoapods-rn-toolkit/lib/cocoapods-rn-toolkit/common_build_settings.rb
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
module CocoapodsRnToolkit
|
|
2
|
-
class CommonBuildSettings
|
|
3
|
-
def self.apply(installer)
|
|
4
|
-
installer.pods_project.targets.each do |target|
|
|
5
|
-
target.build_configurations.each do |config|
|
|
6
|
-
config.build_settings['ENABLE_BITCODE'] = "NO"
|
|
7
|
-
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = "arm64"
|
|
8
|
-
end
|
|
9
|
-
end
|
|
10
|
-
end
|
|
11
|
-
end
|
|
12
|
-
end
|