├── .gitignore
├── .npmrc
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── ISSUE_TEMPLATE.md
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
├── template.config.js
└── template
├── App.tsx
├── __tests__
└── App-test.tsx
├── _buckconfig
├── _gitattributes
├── _gitignore
├── _watchmanconfig
├── android
├── app
│ ├── _BUCK
│ ├── build.gradle
│ ├── build_defs.bzl
│ ├── debug.keystore
│ ├── proguard-rules.pro
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ └── main
│ │ ├── AndroidManifest.xml
│ │ ├── assets
│ │ └── fonts
│ │ │ ├── antfill.ttf
│ │ │ └── antoutline.ttf
│ │ ├── java
│ │ └── com
│ │ │ └── helloworld
│ │ │ ├── MainActivity.java
│ │ │ └── MainApplication.java
│ │ └── res
│ │ ├── layout
│ │ └── launch_screen.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
├── app.json
├── babel.config.js
├── global.ts
├── iconfont.json
├── index.js
├── ios
├── HelloWorld-tvOS
│ └── Info.plist
├── HelloWorld-tvOSTests
│ └── Info.plist
├── HelloWorld.xcodeproj
│ ├── project.pbxproj
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── HelloWorld-tvOS.xcscheme
│ │ └── HelloWorld.xcscheme
├── HelloWorld
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Base.lproj
│ │ └── LaunchScreen.xib
│ ├── Images.xcassets
│ │ ├── AppIcon.appiconset
│ │ │ └── Contents.json
│ │ └── Contents.json
│ ├── Info.plist
│ └── main.m
├── HelloWorldTests
│ ├── HelloWorldTests.m
│ └── Info.plist
└── Podfile
├── metro.config.js
├── package.json
├── scripts
└── react-scrollview-fix.js
├── src
├── App.tsx
├── common
│ ├── enums
│ │ └── index.ts
│ ├── index.ts
│ ├── stores
│ │ └── index.ts
│ └── utils
│ │ └── index.ts
├── iconfont
│ └── Icon.tsx
├── request
│ └── Api.ts
├── routes
│ ├── AppContainer.tsx
│ ├── RootStackParamList.ts
│ ├── RouteType.ts
│ ├── getActiveRoute.ts
│ └── getScreenOptions.ts
├── screens
│ ├── DetailScreen.tsx
│ ├── HomeScreen.tsx
│ └── MineScreen.tsx
└── views
│ ├── HeaderButtons.tsx
│ ├── IconWithBadge.tsx
│ └── index.ts
├── tsconfig.json
└── types
└── global.d.ts
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .vscode/
3 | .DS_Store
4 | yarn.lock
5 | package-lock.json
6 |
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | registry=https://registry.npmjs.org/
2 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | * Using welcoming and inclusive language
12 | * Being respectful of differing viewpoints and experiences
13 | * Gracefully accepting constructive criticism
14 | * Focusing on what is best for the community
15 | * Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | * Trolling, insulting/derogatory comments, and personal or political attacks
21 | * Public or private harassment
22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | * Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project owner at emin@emin.ch. The project owner will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project owner is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Contributing to this project should be as easy and transparent as possible.
4 |
5 | ## Workflow
6 |
7 | We use [GitHub Flow](https://guides.github.com/introduction/flow/), so all code changes happen through pull requests.
8 |
9 | 1. Fork the repository and create your branch from `master`.
10 | 2. If you've changed the functionality, update the documentation.
11 | 3. Issue that pull request! :tada:
12 |
13 | ## License
14 |
15 | By contributing, you agree that your contributions will be licensed under the [MIT License](https://choosealicense.com/licenses/mit/).
16 |
--------------------------------------------------------------------------------
/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Expected results
2 |
3 | What did you expect to happen?
4 |
5 | ## Observed results
6 |
7 | What happened?
8 |
9 | ### Logs
10 |
11 | Please add the log output here.
12 |
13 | ## Steps to reproduce
14 |
15 | 1.
16 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Emin Khateeb
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # :space_invader: React Native Template TypeScript
2 |
3 | [](https://opensource.org/licenses/MIT)
4 | [](https://badge.fury.io/js/@sigmayun/react-native-template-typescript)
5 | [](https://www.npmjs.com/package/@sigmayun/react-native-template-typescript)
6 |
7 | > React Native template for a quick start with TypeScript.
8 |
9 | ## :star: Features
10 |
11 | - Elegant usage directly within the [React Native CLI](https://github.com/react-native-community/cli)
12 | - Consistent with the default React Native template
13 | - Powerful additional dependencies
14 |
15 | ## :arrow_forward: Usage
16 |
17 | ### Note on the legacy CLI
18 | There seems to be quite some confusion about the legacy CLI. This template only works with the new CLI. Make sure you have uninstalled the legacy `react-native-cli` first (`npm uninstall -g react-native-cli`), for the below command to work. If you wish to not use `npx`, you can also install the new CLI globally (`npm i -g @react-native-community/cli` or `yarn global add @react-native-community/cli`).
19 |
20 | Further information can be found here: https://github.com/react-native-community/cli#about
21 |
22 | ### `react-native@0.61.0` or higher
23 |
24 | ```sh
25 | npx react-native init MyApp --template @sigmayun/react-native-template-typescript
26 | ```
27 |
28 | 将 `index.js` 中的 `import App from './App'` 改成 `import App from './src/App'` 即可看到我为大家默认配置的路由架构!
29 |
30 | > 注意: 我在 https://bre.is/zWKCftso 编写了高级配置的文档,请务必阅读!!!
31 |
32 | ### react-native@0.60.x
33 |
34 | ```sh
35 | npx react-native init MyApp --template react-native-template-typescript@6.2.0
36 | ```
37 |
38 | ## :computer: Contributing
39 |
40 | Contributions are very welcome. Please check out the [contributing document](CONTRIBUTING.md).
41 |
42 | ## :bookmark: License
43 |
44 | This project is [MIT](LICENSE) licensed.
45 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-native-template-typescript",
3 | "version": "0.5.3",
4 | "lockfileVersion": 1
5 | }
6 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@sigmayun/react-native-template-typescript",
3 | "version": "0.5.3",
4 | "description": "React Native template for a quick start with TypeScript.",
5 | "scripts": {
6 | "postversion": "npm publish && git push --tags && git push"
7 | },
8 | "files": [
9 | "template",
10 | "template.config.js"
11 | ],
12 | "repository": {
13 | "type": "git",
14 | "url": "git+https://github.com/sigmayun/react-native-template-typescript.git"
15 | },
16 | "keywords": [
17 | "react-native",
18 | "typescript",
19 | "jest",
20 | "template",
21 | "boilerplate"
22 | ],
23 | "author": {
24 | "name": "杨俊宁",
25 | "url": "https://youngjuning.js.org",
26 | "email": "1003719811@qq.com"
27 | },
28 | "license": "MIT",
29 | "bugs": {
30 | "url": "https://github.com/sigmayun/react-native-template-typescript/issues"
31 | },
32 | "homepage": "https://github.com/sigmayun/react-native-template-typescript#readme",
33 | "devDependencies": {
34 | "@sishuguojixuefu/eslint-config": "^0.10.0",
35 | "husky": "^4.2.3",
36 | "lint-staged": "^10.0.8"
37 | },
38 | "eslintConfig": {
39 | "extends": [
40 | "@sishuguojixuefu"
41 | ],
42 | "env": {
43 | "react-native/react-native": true
44 | }
45 | },
46 | "eslintIgnore": [
47 | "!.eslintrc.js",
48 | "!.prettierrc.js",
49 | "__tests__/App-test.tsx"
50 | ],
51 | "prettier": "@sishuguojixuefu/eslint-config/.prettierrc.js",
52 | "husky": {
53 | "hooks": {
54 | "pre-commit": "lint-staged"
55 | }
56 | },
57 | "lint-staged": {
58 | "**/*.{js,jsx,ts,tsx}": [
59 | "eslint --fix",
60 | "git add"
61 | ],
62 | "**/*.{md,json}": [
63 | "prettier --write",
64 | "git add"
65 | ]
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/template.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | placeholderName: 'HelloWorld',
3 | templateDir: './template',
4 | }
5 |
--------------------------------------------------------------------------------
/template/App.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * Sample React Native App
3 | * https://github.com/facebook/react-native
4 | *
5 | * Generated with the TypeScript template
6 | * https://github.com/react-native-community/react-native-template-typescript
7 | *
8 | * @format
9 | */
10 |
11 | import React from 'react'
12 | import { SafeAreaView, StyleSheet, ScrollView, View, Text, StatusBar } from 'react-native'
13 |
14 | import { Header, LearnMoreLinks, Colors, DebugInstructions, ReloadInstructions } from 'react-native/Libraries/NewAppScreen'
15 |
16 | const App = () => {
17 | return (
18 | <>
19 |
20 |
21 |
22 |
23 | {global.HermesInternal == null ? null : (
24 |
25 | Engine: Hermes
26 |
27 | )}
28 |
29 |
30 | Step One
31 |
32 | Edit App.tsx to change this screen and then come back to see your edits.
33 |
34 |
35 |
36 | See Your Changes
37 |
38 |
39 |
40 |
41 |
42 | Debug
43 |
44 |
45 |
46 |
47 |
48 | Learn More
49 | Read the docs to discover what to do next:
50 |
51 |
52 |
53 |
54 |
55 | >
56 | )
57 | }
58 |
59 | const styles = StyleSheet.create({
60 | body: {
61 | backgroundColor: Colors.white,
62 | },
63 | engine: {
64 | position: 'absolute',
65 | right: 0,
66 | },
67 | footer: {
68 | color: Colors.dark,
69 | fontSize: 12,
70 | fontWeight: '600',
71 | padding: 4,
72 | paddingRight: 12,
73 | textAlign: 'right',
74 | },
75 | highlight: {
76 | fontWeight: '700',
77 | },
78 | scrollView: {
79 | backgroundColor: Colors.lighter,
80 | },
81 | sectionContainer: {
82 | marginTop: 32,
83 | paddingHorizontal: 24,
84 | },
85 | sectionDescription: {
86 | color: Colors.dark,
87 | fontSize: 18,
88 | fontWeight: '400',
89 | marginTop: 8,
90 | },
91 | sectionTitle: {
92 | color: Colors.black,
93 | fontSize: 24,
94 | fontWeight: '600',
95 | },
96 | })
97 |
98 | export default App
99 |
--------------------------------------------------------------------------------
/template/__tests__/App-test.tsx:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import 'react-native';
6 | import React from 'react';
7 | import App from '../App';
8 |
9 | // Note: test renderer must be required after react-native.
10 | import renderer from 'react-test-renderer';
11 |
12 | it('renders correctly', () => {
13 | renderer.create();
14 | });
15 |
--------------------------------------------------------------------------------
/template/_buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/template/_gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/template/_gitignore:
--------------------------------------------------------------------------------
1 | # OSX
2 | #
3 | .DS_Store
4 |
5 | # Xcode
6 | #
7 | build/
8 | *.pbxuser
9 | !default.pbxuser
10 | *.mode1v3
11 | !default.mode1v3
12 | *.mode2v3
13 | !default.mode2v3
14 | *.perspectivev3
15 | !default.perspectivev3
16 | xcuserdata
17 | *.xccheckout
18 | *.moved-aside
19 | DerivedData
20 | *.hmap
21 | *.ipa
22 | *.xcuserstate
23 | project.xcworkspace
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 |
33 | # Visual Studio Code
34 | #
35 | .vscode/
36 |
37 | # node.js
38 | #
39 | node_modules/
40 | npm-debug.log
41 | yarn-error.log
42 | yarn.lock
43 | package-lock.json
44 |
45 | # BUCK
46 | buck-out/
47 | \.buckd/
48 | *.keystore
49 | !debug.keystore
50 |
51 | # fastlane
52 | #
53 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
54 | # screenshots whenever they are needed.
55 | # For more information about the recommended setup visit:
56 | # https://docs.fastlane.tools/best-practices/source-control/
57 |
58 | */fastlane/report.xml
59 | */fastlane/Preview.html
60 | */fastlane/screenshots
61 |
62 | # Bundle artifact
63 | *.jsbundle
64 |
65 | # CocoaPods
66 | /ios/Pods/
67 | Podfile.lock
68 |
--------------------------------------------------------------------------------
/template/_watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/template/android/app/_BUCK:
--------------------------------------------------------------------------------
1 | # To learn about Buck see [Docs](https://buckbuild.com/).
2 | # To run your application with Buck:
3 | # - install Buck
4 | # - `npm start` - to start the packager
5 | # - `cd android`
6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
8 | # - `buck install -r android/app` - compile, install and run application
9 | #
10 |
11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12 |
13 | lib_deps = []
14 |
15 | create_aar_targets(glob(["libs/*.aar"]))
16 |
17 | create_jar_targets(glob(["libs/*.jar"]))
18 |
19 | android_library(
20 | name = "all-libs",
21 | exported_deps = lib_deps,
22 | )
23 |
24 | android_library(
25 | name = "app-code",
26 | srcs = glob([
27 | "src/main/java/**/*.java",
28 | ]),
29 | deps = [
30 | ":all-libs",
31 | ":build_config",
32 | ":res",
33 | ],
34 | )
35 |
36 | android_build_config(
37 | name = "build_config",
38 | package = "com.helloworld",
39 | )
40 |
41 | android_resource(
42 | name = "res",
43 | package = "com.helloworld",
44 | res = "src/main/res",
45 | )
46 |
47 | android_binary(
48 | name = "app",
49 | keystore = "//android/keystores:debug",
50 | manifest = "src/main/AndroidManifest.xml",
51 | package_type = "debug",
52 | deps = [
53 | ":app-code",
54 | ],
55 | )
56 |
--------------------------------------------------------------------------------
/template/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
22 | * bundleCommand: "ram-bundle",
23 | *
24 | * // whether to bundle JS and assets in debug mode
25 | * bundleInDebug: false,
26 | *
27 | * // whether to bundle JS and assets in release mode
28 | * bundleInRelease: true,
29 | *
30 | * // whether to bundle JS and assets in another build variant (if configured).
31 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
32 | * // The configuration property can be in the following formats
33 | * // 'bundleIn${productFlavor}${buildType}'
34 | * // 'bundleIn${buildType}'
35 | * // bundleInFreeDebug: true,
36 | * // bundleInPaidRelease: true,
37 | * // bundleInBeta: true,
38 | *
39 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
40 | * // for example: to disable dev mode in the staging build type (if configured)
41 | * devDisabledInStaging: true,
42 | * // The configuration property can be in the following formats
43 | * // 'devDisabledIn${productFlavor}${buildType}'
44 | * // 'devDisabledIn${buildType}'
45 | *
46 | * // the root of your project, i.e. where "package.json" lives
47 | * root: "../../",
48 | *
49 | * // where to put the JS bundle asset in debug mode
50 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
51 | *
52 | * // where to put the JS bundle asset in release mode
53 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
54 | *
55 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
56 | * // require('./image.png')), in debug mode
57 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
58 | *
59 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
60 | * // require('./image.png')), in release mode
61 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
62 | *
63 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
64 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
66 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67 | * // for example, you might want to remove it from here.
68 | * inputExcludes: ["android/**", "ios/**"],
69 | *
70 | * // override which node gets called and with what additional arguments
71 | * nodeExecutableAndArgs: ["node"],
72 | *
73 | * // supply additional arguments to the packager
74 | * extraPackagerArgs: []
75 | * ]
76 | */
77 |
78 | project.ext.react = [
79 | entryFile: "index.js",
80 | enableHermes: false, // clean and rebuild if changing
81 | ]
82 |
83 | apply from: "../../node_modules/react-native/react.gradle"
84 |
85 | /**
86 | * Set this to true to create two separate APKs instead of one:
87 | * - An APK that only works on ARM devices
88 | * - An APK that only works on x86 devices
89 | * The advantage is the size of the APK is reduced by about 4MB.
90 | * Upload all the APKs to the Play Store and people will download
91 | * the correct one based on the CPU architecture of their device.
92 | */
93 | def enableSeparateBuildPerCPUArchitecture = false
94 |
95 | /**
96 | * Run Proguard to shrink the Java bytecode in release builds.
97 | */
98 | def enableProguardInReleaseBuilds = false
99 |
100 | /**
101 | * The preferred build flavor of JavaScriptCore.
102 | *
103 | * For example, to use the international variant, you can use:
104 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105 | *
106 | * The international variant includes ICU i18n library and necessary data
107 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108 | * give correct results when using with locales other than en-US. Note that
109 | * this variant is about 6MiB larger per architecture than default.
110 | */
111 | def jscFlavor = 'org.webkit:android-jsc:+'
112 |
113 | /**
114 | * Whether to enable the Hermes VM.
115 | *
116 | * This should be set on project.ext.react and mirrored here. If it is not set
117 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118 | * and the benefits of using Hermes will therefore be sharply reduced.
119 | */
120 | def enableHermes = project.ext.react.get("enableHermes", false);
121 |
122 | android {
123 | compileSdkVersion rootProject.ext.compileSdkVersion
124 |
125 | compileOptions {
126 | sourceCompatibility JavaVersion.VERSION_1_8
127 | targetCompatibility JavaVersion.VERSION_1_8
128 | }
129 |
130 | defaultConfig {
131 | applicationId "com.helloworld"
132 | minSdkVersion rootProject.ext.minSdkVersion
133 | targetSdkVersion rootProject.ext.targetSdkVersion
134 | versionCode 1
135 | versionName "1.0"
136 | multiDexEnabled true
137 | vectorDrawables.useSupportLibrary = true
138 | // APP_NAME
139 | buildConfigField "String", "APP_NAME", '"' + rootProject.name + '"'
140 | // BUILD_TIME
141 | buildConfigField "String", "BUILD_TIME", '"' + new Date().format("yyyy-MM-dd HH:mm:ss", TimeZone.getTimeZone("Asia/Shanghai")) + '"'
142 | }
143 | aaptOptions {
144 | cruncherEnabled=false
145 | }
146 | splits {
147 | abi {
148 | reset()
149 | enable enableSeparateBuildPerCPUArchitecture
150 | universalApk false // If true, also generate a universal APK
151 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
152 | }
153 | }
154 | signingConfigs {
155 | debug {
156 | storeFile file('debug.keystore')
157 | storePassword 'android'
158 | keyAlias 'androiddebugkey'
159 | keyPassword 'android'
160 | }
161 | }
162 | buildTypes {
163 | debug {
164 | signingConfig signingConfigs.debug
165 | }
166 | release {
167 | // Caution! In production, you need to generate your own keystore file.
168 | // see https://facebook.github.io/react-native/docs/signed-apk-android.
169 | signingConfig signingConfigs.debug
170 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
171 | minifyEnabled enableProguardInReleaseBuilds
172 | shrinkResources enableProguardInReleaseBuilds
173 | zipAlignEnabled true
174 | debuggable false
175 | }
176 | }
177 | // applicationVariants are e.g. debug, release
178 | applicationVariants.all { variant ->
179 | variant.outputs.each { output ->
180 | // For each separate APK per architecture, set a unique version code as described here:
181 | // https://developer.android.com/studio/build/configure-apk-splits.html
182 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
183 | def abi = output.getFilter(OutputFile.ABI)
184 | if (abi != null) { // null for the universal-debug, universal-release variants
185 | output.versionCodeOverride =
186 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
187 | }
188 |
189 | }
190 | }
191 | }
192 |
193 | dependencies {
194 | implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
195 | implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
196 | implementation fileTree(dir: "libs", include: ["*.jar"])
197 | implementation "com.facebook.react:react-native:+" // From node_modules
198 |
199 | if (enableHermes) {
200 | def hermesPath = "../../node_modules/hermes-engine/android/";
201 | debugImplementation files(hermesPath + "hermes-debug.aar")
202 | releaseImplementation files(hermesPath + "hermes-release.aar")
203 | } else {
204 | implementation jscFlavor
205 | }
206 | }
207 |
208 | // Run this once to be able to run the application with BUCK
209 | // puts all compile dependencies into folder libs for BUCK to use
210 | task copyDownloadableDepsToLibs(type: Copy) {
211 | from configurations.compile
212 | into 'libs'
213 | }
214 |
215 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
216 |
--------------------------------------------------------------------------------
/template/android/app/build_defs.bzl:
--------------------------------------------------------------------------------
1 | """Helper definitions to glob .aar and .jar targets"""
2 |
3 | def create_aar_targets(aarfiles):
4 | for aarfile in aarfiles:
5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6 | lib_deps.append(":" + name)
7 | android_prebuilt_aar(
8 | name = name,
9 | aar = aarfile,
10 | )
11 |
12 | def create_jar_targets(jarfiles):
13 | for jarfile in jarfiles:
14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15 | lib_deps.append(":" + name)
16 | prebuilt_jar(
17 | name = name,
18 | binary_jar = jarfile,
19 | )
20 |
--------------------------------------------------------------------------------
/template/android/app/debug.keystore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/debug.keystore
--------------------------------------------------------------------------------
/template/android/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
--------------------------------------------------------------------------------
/template/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/template/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/template/android/app/src/main/assets/fonts/antfill.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/assets/fonts/antfill.ttf
--------------------------------------------------------------------------------
/template/android/app/src/main/assets/fonts/antoutline.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/assets/fonts/antoutline.ttf
--------------------------------------------------------------------------------
/template/android/app/src/main/java/com/helloworld/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.helloworld;
2 |
3 | import com.facebook.react.ReactActivity;
4 | import android.os.Bundle;
5 | import org.devio.rn.splashscreen.SplashScreen;
6 |
7 | public class MainActivity extends ReactActivity {
8 |
9 | /**
10 | * Returns the name of the main component registered from JavaScript. This is used to schedule
11 | * rendering of the component.
12 | */
13 | @Override
14 | protected String getMainComponentName() {
15 | return "HelloWorld";
16 | }
17 |
18 | @Override
19 | protected void onCreate(Bundle savedInstanceState) {
20 | // SplashScreen.show(this, true);
21 | super.onCreate(savedInstanceState);
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/template/android/app/src/main/java/com/helloworld/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.helloworld;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import com.facebook.react.PackageList;
6 | import com.facebook.react.ReactApplication;
7 | import com.facebook.react.ReactNativeHost;
8 | import com.facebook.react.ReactPackage;
9 | import com.facebook.soloader.SoLoader;
10 | import java.lang.reflect.InvocationTargetException;
11 | import java.util.List;
12 |
13 | public class MainApplication extends Application implements ReactApplication {
14 |
15 | private final ReactNativeHost mReactNativeHost =
16 | new ReactNativeHost(this) {
17 | @Override
18 | public boolean getUseDeveloperSupport() {
19 | return BuildConfig.DEBUG;
20 | }
21 |
22 | @Override
23 | protected List getPackages() {
24 | @SuppressWarnings("UnnecessaryLocalVariable")
25 | List packages = new PackageList(this).getPackages();
26 | // Packages that cannot be autolinked yet can be added manually here, for example:
27 | // packages.add(new MyReactNativePackage());
28 | return packages;
29 | }
30 |
31 | @Override
32 | protected String getJSMainModuleName() {
33 | return "index";
34 | }
35 | };
36 |
37 | @Override
38 | public ReactNativeHost getReactNativeHost() {
39 | return mReactNativeHost;
40 | }
41 |
42 | @Override
43 | public void onCreate() {
44 | super.onCreate();
45 | SoLoader.init(this, /* native exopackage */ false);
46 | initializeFlipper(this); // Remove this line if you don't want Flipper enabled
47 | }
48 |
49 | /**
50 | * Loads Flipper in React Native templates.
51 | *
52 | * @param context
53 | */
54 | private static void initializeFlipper(Context context) {
55 | if (BuildConfig.DEBUG) {
56 | try {
57 | /*
58 | We use reflection here to pick up the class that initializes Flipper,
59 | since Flipper library is not available in release mode
60 | */
61 | Class> aClass = Class.forName("com.facebook.flipper.ReactNativeFlipper");
62 | aClass.getMethod("initializeFlipper", Context.class).invoke(null, context);
63 | } catch (ClassNotFoundException e) {
64 | e.printStackTrace();
65 | } catch (NoSuchMethodException e) {
66 | e.printStackTrace();
67 | } catch (IllegalAccessException e) {
68 | e.printStackTrace();
69 | } catch (InvocationTargetException e) {
70 | e.printStackTrace();
71 | }
72 | }
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/template/android/app/src/main/res/layout/launch_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/template/android/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #000000
4 |
5 |
--------------------------------------------------------------------------------
/template/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Hello App Display Name
3 |
4 |
--------------------------------------------------------------------------------
/template/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/template/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | ext {
5 | buildToolsVersion = "28.0.3"
6 | minSdkVersion = 16
7 | compileSdkVersion = 28
8 | targetSdkVersion = 28
9 | }
10 | repositories {
11 | google()
12 | jcenter()
13 | }
14 | dependencies {
15 | classpath("com.android.tools.build:gradle:3.4.2")
16 |
17 | // NOTE: Do not place your application dependencies here; they belong
18 | // in the individual module build.gradle files
19 | }
20 | }
21 |
22 | allprojects {
23 | repositories {
24 | mavenLocal()
25 | maven {
26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
27 | url("$rootDir/../node_modules/react-native/android")
28 | }
29 | maven {
30 | // Android JSC is installed from npm
31 | url("$rootDir/../node_modules/jsc-android/dist")
32 | }
33 |
34 | maven { url 'https://maven.aliyun.com/repository/public/' }
35 | google()
36 | jcenter()
37 | maven { url 'https://jitpack.io' }
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/template/android/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
19 |
20 | android.useAndroidX=true
21 | android.enableJetifier=true
22 | dexOptions.javaMaxHeapSize = 2g
23 | org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
24 |
--------------------------------------------------------------------------------
/template/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/sigmayun/react-native-template-typescript/8bc23f044e1be931aad8aa9988a0bef672212e39/template/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/template/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.5-all.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/template/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # http://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 | # Determine the Java command to use to start the JVM.
86 | if [ -n "$JAVA_HOME" ] ; then
87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
88 | # IBM's JDK on AIX uses strange locations for the executables
89 | JAVACMD="$JAVA_HOME/jre/sh/java"
90 | else
91 | JAVACMD="$JAVA_HOME/bin/java"
92 | fi
93 | if [ ! -x "$JAVACMD" ] ; then
94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
95 |
96 | Please set the JAVA_HOME variable in your environment to match the
97 | location of your Java installation."
98 | fi
99 | else
100 | JAVACMD="java"
101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
102 |
103 | Please set the JAVA_HOME variable in your environment to match the
104 | location of your Java installation."
105 | fi
106 |
107 | # Increase the maximum file descriptors if we can.
108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
109 | MAX_FD_LIMIT=`ulimit -H -n`
110 | if [ $? -eq 0 ] ; then
111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
112 | MAX_FD="$MAX_FD_LIMIT"
113 | fi
114 | ulimit -n $MAX_FD
115 | if [ $? -ne 0 ] ; then
116 | warn "Could not set maximum file descriptor limit: $MAX_FD"
117 | fi
118 | else
119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
120 | fi
121 | fi
122 |
123 | # For Darwin, add options to specify how the application appears in the dock
124 | if $darwin; then
125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126 | fi
127 |
128 | # For Cygwin, switch paths to Windows format before running java
129 | if $cygwin ; then
130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
132 | JAVACMD=`cygpath --unix "$JAVACMD"`
133 |
134 | # We build the pattern for arguments to be converted via cygpath
135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
136 | SEP=""
137 | for dir in $ROOTDIRSRAW ; do
138 | ROOTDIRS="$ROOTDIRS$SEP$dir"
139 | SEP="|"
140 | done
141 | OURCYGPATTERN="(^($ROOTDIRS))"
142 | # Add a user-defined pattern to the cygpath arguments
143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
145 | fi
146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
147 | i=0
148 | for arg in "$@" ; do
149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
151 |
152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
154 | else
155 | eval `echo args$i`="\"$arg\""
156 | fi
157 | i=$((i+1))
158 | done
159 | case $i in
160 | (0) set -- ;;
161 | (1) set -- "$args0" ;;
162 | (2) set -- "$args0" "$args1" ;;
163 | (3) set -- "$args0" "$args1" "$args2" ;;
164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170 | esac
171 | fi
172 |
173 | # Escape application args
174 | save () {
175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176 | echo " "
177 | }
178 | APP_ARGS=$(save "$@")
179 |
180 | # Collect all arguments for the java command, following the shell quoting and substitution rules
181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182 |
183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185 | cd "$(dirname "$0")"
186 | fi
187 |
188 | exec "$JAVACMD" "$@"
189 |
--------------------------------------------------------------------------------
/template/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem http://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
34 |
35 | @rem Find java.exe
36 | if defined JAVA_HOME goto findJavaFromJavaHome
37 |
38 | set JAVA_EXE=java.exe
39 | %JAVA_EXE% -version >NUL 2>&1
40 | if "%ERRORLEVEL%" == "0" goto init
41 |
42 | echo.
43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
44 | echo.
45 | echo Please set the JAVA_HOME variable in your environment to match the
46 | echo location of your Java installation.
47 |
48 | goto fail
49 |
50 | :findJavaFromJavaHome
51 | set JAVA_HOME=%JAVA_HOME:"=%
52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
53 |
54 | if exist "%JAVA_EXE%" goto init
55 |
56 | echo.
57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
58 | echo.
59 | echo Please set the JAVA_HOME variable in your environment to match the
60 | echo location of your Java installation.
61 |
62 | goto fail
63 |
64 | :init
65 | @rem Get command-line arguments, handling Windows variants
66 |
67 | if not "%OS%" == "Windows_NT" goto win9xME_args
68 |
69 | :win9xME_args
70 | @rem Slurp the command line arguments.
71 | set CMD_LINE_ARGS=
72 | set _SKIP=2
73 |
74 | :win9xME_args_slurp
75 | if "x%~1" == "x" goto execute
76 |
77 | set CMD_LINE_ARGS=%*
78 |
79 | :execute
80 | @rem Setup the command line
81 |
82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
83 |
84 | @rem Execute Gradle
85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
86 |
87 | :end
88 | @rem End local scope for the variables with windows NT shell
89 | if "%ERRORLEVEL%"=="0" goto mainEnd
90 |
91 | :fail
92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
93 | rem the _cmd.exe /c_ return code!
94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
95 | exit /b 1
96 |
97 | :mainEnd
98 | if "%OS%"=="Windows_NT" endlocal
99 |
100 | :omega
101 |
--------------------------------------------------------------------------------
/template/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'HelloWorld'
2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 | include ':app'
4 |
--------------------------------------------------------------------------------
/template/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "HelloWorld",
3 | "displayName": "HelloWorld"
4 | }
--------------------------------------------------------------------------------
/template/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: ['module:metro-react-native-babel-preset', 'mobx'],
3 | plugins: [
4 | '@babel/plugin-transform-flow-strip-types',
5 | [
6 | 'babel-plugin-root-import',
7 | {
8 | rootPathSuffix: 'src',
9 | rootPathPrefix: '~',
10 | },
11 | ],
12 | ['import', { libraryName: '@ant-design/react-native' }],
13 | ],
14 | env: {
15 | production: {
16 | plugins: [['transform-remove-console', { exclude: ['info'] }]],
17 | },
18 | },
19 | }
20 |
--------------------------------------------------------------------------------
/template/global.ts:
--------------------------------------------------------------------------------
1 | import { Dimensions, Platform } from 'react-native'
2 | import { isIphoneX, getStatusBarHeight, getBottomSpace } from 'react-native-iphone-x-helper'
3 |
4 | global.windowWidth = Dimensions.get('window').width
5 | global.windowHeight = Dimensions.get('window').height
6 | global.ios = Platform.OS === 'ios'
7 | global.android = Platform.OS === 'android'
8 | global.isIphoneX = isIphoneX
9 | global.getStatusBarHeight = getStatusBarHeight
10 | global.getBottomSpace = getBottomSpace
11 |
--------------------------------------------------------------------------------
/template/iconfont.json:
--------------------------------------------------------------------------------
1 | {
2 | "symbol_url": "//at.alicdn.com/t/font_1610115_zaw19gt8nmi.js",
3 | "use_typescript": true,
4 | "save_dir": "./src/iconfont",
5 | "generate_mode": "all-in-one",
6 | "trim_icon_prefix": "icon-",
7 | "default_icon_size": 18,
8 | "summary_component_name": "Icon"
9 | }
10 |
--------------------------------------------------------------------------------
/template/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * @format
3 | */
4 |
5 | import { AppRegistry, Text, TextInput } from 'react-native'
6 | import 'react-native-gesture-handler'
7 | import KeyboardManager from 'react-native-keyboard-manager'
8 | import dayjs from 'dayjs'
9 | import { configure } from 'mobx'
10 | import './global'
11 | import App from './App.tsx'
12 | import { name as appName } from './app.json'
13 | import 'dayjs/locale/zh-cn'
14 |
15 | // dayjs 本地化
16 | dayjs.locale('zh-cn')
17 | // 设置 mobx 不允许在动作外部修改状态
18 | configure({ enforceActions: 'observed' })
19 | // 设置字体大小不随系统字体大小变化而变化
20 | Text.defaultProps = { ...Text.defaultProps, allowFontScaling: false }
21 | TextInput.defaultProps = { ...TextInput.defaultProps, allowFontScaling: false }
22 | // 屏蔽黄屏警告
23 | console.disableYellowBox = true
24 | // ios键盘解决方案
25 | if (global.ios) {
26 | KeyboardManager.setEnableAutoToolbar(false)
27 | KeyboardManager.setShouldResignOnTouchOutside(true)
28 | }
29 |
30 | AppRegistry.registerComponent(appName, () => App)
31 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld-tvOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | NSAppTransportSecurity
26 |
27 | NSExceptionDomains
28 |
29 | localhost
30 |
31 | NSExceptionAllowsInsecureHTTPLoads
32 |
33 |
34 |
35 |
36 | NSLocationWhenInUseUsageDescription
37 |
38 | UILaunchStoryboardName
39 | LaunchScreen
40 | UIRequiredDeviceCapabilities
41 |
42 | armv7
43 |
44 | UISupportedInterfaceOrientations
45 |
46 | UIInterfaceOrientationPortrait
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 | UIViewControllerBasedStatusBarAppearance
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld-tvOSTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; };
11 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
12 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
15 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
16 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
17 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
18 | 2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* HelloWorldTests.m */; };
19 | CC333C3339CC44A6B06DB6A4 /* antfill.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4812E7BA81134704B7477FE3 /* antfill.ttf */; };
20 | F964CDAA7D1042938CDEA6C0 /* antoutline.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C86F12B7380249F499BF7CB7 /* antoutline.ttf */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXContainerItemProxy section */
24 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = {
25 | isa = PBXContainerItemProxy;
26 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
27 | proxyType = 1;
28 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A;
29 | remoteInfo = HelloWorld;
30 | };
31 | 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */ = {
32 | isa = PBXContainerItemProxy;
33 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */;
34 | proxyType = 1;
35 | remoteGlobalIDString = 2D02E47A1E0B4A5D006451C7;
36 | remoteInfo = "HelloWorld-tvOS";
37 | };
38 | /* End PBXContainerItemProxy section */
39 |
40 | /* Begin PBXFileReference section */
41 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; };
42 | 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HelloWorldTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
43 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
44 | 00E356F21AD99517003FC87E /* HelloWorldTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HelloWorldTests.m; sourceTree = ""; };
45 | 13B07F961A680F5B00A75B9A /* HelloWorld.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorld.app; sourceTree = BUILT_PRODUCTS_DIR; };
46 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = HelloWorld/AppDelegate.h; sourceTree = ""; };
47 | 13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = HelloWorld/AppDelegate.m; sourceTree = ""; };
48 | 13B07FB21A68108700A75B9A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; };
49 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = HelloWorld/Images.xcassets; sourceTree = ""; };
50 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = HelloWorld/Info.plist; sourceTree = ""; };
51 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = HelloWorld/main.m; sourceTree = ""; };
52 | 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "HelloWorld-tvOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "HelloWorld-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
54 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
55 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.0.sdk/System/Library/Frameworks/JavaScriptCore.framework; sourceTree = DEVELOPER_DIR; };
56 | 4812E7BA81134704B7477FE3 /* antfill.ttf */ = {isa = PBXFileReference; name = "antfill.ttf"; path = "../node_modules/@ant-design/icons-react-native/fonts/antfill.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
57 | C86F12B7380249F499BF7CB7 /* antoutline.ttf */ = {isa = PBXFileReference; name = "antoutline.ttf"; path = "../node_modules/@ant-design/icons-react-native/fonts/antoutline.ttf"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
58 | /* End PBXFileReference section */
59 |
60 | /* Begin PBXFrameworksBuildPhase section */
61 | 00E356EB1AD99517003FC87E /* Frameworks */ = {
62 | isa = PBXFrameworksBuildPhase;
63 | buildActionMask = 2147483647;
64 | files = (
65 | );
66 | runOnlyForDeploymentPostprocessing = 0;
67 | };
68 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
69 | isa = PBXFrameworksBuildPhase;
70 | buildActionMask = 2147483647;
71 | files = (
72 | );
73 | runOnlyForDeploymentPostprocessing = 0;
74 | };
75 | 2D02E4781E0B4A5D006451C7 /* Frameworks */ = {
76 | isa = PBXFrameworksBuildPhase;
77 | buildActionMask = 2147483647;
78 | files = (
79 | );
80 | runOnlyForDeploymentPostprocessing = 0;
81 | };
82 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */ = {
83 | isa = PBXFrameworksBuildPhase;
84 | buildActionMask = 2147483647;
85 | files = (
86 | );
87 | runOnlyForDeploymentPostprocessing = 0;
88 | };
89 | /* End PBXFrameworksBuildPhase section */
90 |
91 | /* Begin PBXGroup section */
92 | 00E356EF1AD99517003FC87E /* HelloWorldTests */ = {
93 | isa = PBXGroup;
94 | children = (
95 | 00E356F21AD99517003FC87E /* HelloWorldTests.m */,
96 | 00E356F01AD99517003FC87E /* Supporting Files */,
97 | );
98 | path = HelloWorldTests;
99 | sourceTree = "";
100 | };
101 | 00E356F01AD99517003FC87E /* Supporting Files */ = {
102 | isa = PBXGroup;
103 | children = (
104 | 00E356F11AD99517003FC87E /* Info.plist */,
105 | );
106 | name = "Supporting Files";
107 | sourceTree = "";
108 | };
109 | 13B07FAE1A68108700A75B9A /* HelloWorld */ = {
110 | isa = PBXGroup;
111 | children = (
112 | 008F07F21AC5B25A0029DE68 /* main.jsbundle */,
113 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
114 | 13B07FB01A68108700A75B9A /* AppDelegate.m */,
115 | 13B07FB51A68108700A75B9A /* Images.xcassets */,
116 | 13B07FB61A68108700A75B9A /* Info.plist */,
117 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */,
118 | 13B07FB71A68108700A75B9A /* main.m */,
119 | );
120 | name = HelloWorld;
121 | sourceTree = "";
122 | };
123 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = {
124 | isa = PBXGroup;
125 | children = (
126 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
127 | ED2971642150620600B7C4FE /* JavaScriptCore.framework */,
128 | );
129 | name = Frameworks;
130 | sourceTree = "";
131 | };
132 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = {
133 | isa = PBXGroup;
134 | children = (
135 | );
136 | name = Libraries;
137 | sourceTree = "";
138 | };
139 | 83CBB9F61A601CBA00E9B192 = {
140 | isa = PBXGroup;
141 | children = (
142 | 13B07FAE1A68108700A75B9A /* HelloWorld */,
143 | 832341AE1AAA6A7D00B99B32 /* Libraries */,
144 | 00E356EF1AD99517003FC87E /* HelloWorldTests */,
145 | 83CBBA001A601CBA00E9B192 /* Products */,
146 | 2D16E6871FA4F8E400B85C8A /* Frameworks */,
147 | C288291491F64CDA80F4B608 /* Resources */,
148 | );
149 | indentWidth = 2;
150 | sourceTree = "";
151 | tabWidth = 2;
152 | usesTabs = 0;
153 | };
154 | 83CBBA001A601CBA00E9B192 /* Products */ = {
155 | isa = PBXGroup;
156 | children = (
157 | 13B07F961A680F5B00A75B9A /* HelloWorld.app */,
158 | 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */,
159 | 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */,
160 | 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */,
161 | );
162 | name = Products;
163 | sourceTree = "";
164 | };
165 | C288291491F64CDA80F4B608 /* Resources */ = {
166 | isa = "PBXGroup";
167 | children = (
168 | 4812E7BA81134704B7477FE3 /* antfill.ttf */,
169 | C86F12B7380249F499BF7CB7 /* antoutline.ttf */,
170 | );
171 | name = Resources;
172 | sourceTree = "";
173 | path = "";
174 | };
175 | /* End PBXGroup section */
176 |
177 | /* Begin PBXNativeTarget section */
178 | 00E356ED1AD99517003FC87E /* HelloWorldTests */ = {
179 | isa = PBXNativeTarget;
180 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */;
181 | buildPhases = (
182 | 00E356EA1AD99517003FC87E /* Sources */,
183 | 00E356EB1AD99517003FC87E /* Frameworks */,
184 | 00E356EC1AD99517003FC87E /* Resources */,
185 | );
186 | buildRules = (
187 | );
188 | dependencies = (
189 | 00E356F51AD99517003FC87E /* PBXTargetDependency */,
190 | );
191 | name = HelloWorldTests;
192 | productName = HelloWorldTests;
193 | productReference = 00E356EE1AD99517003FC87E /* HelloWorldTests.xctest */;
194 | productType = "com.apple.product-type.bundle.unit-test";
195 | };
196 | 13B07F861A680F5B00A75B9A /* HelloWorld */ = {
197 | isa = PBXNativeTarget;
198 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */;
199 | buildPhases = (
200 | FD10A7F022414F080027D42C /* Start Packager */,
201 | 13B07F871A680F5B00A75B9A /* Sources */,
202 | 13B07F8C1A680F5B00A75B9A /* Frameworks */,
203 | 13B07F8E1A680F5B00A75B9A /* Resources */,
204 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
205 | 0D5FCFA323A4B650009353E9 /* Get ipa Build Time */,
206 | );
207 | buildRules = (
208 | );
209 | dependencies = (
210 | );
211 | name = HelloWorld;
212 | productName = "HelloWorld";
213 | productReference = 13B07F961A680F5B00A75B9A /* HelloWorld.app */;
214 | productType = "com.apple.product-type.application";
215 | };
216 | 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */ = {
217 | isa = PBXNativeTarget;
218 | buildConfigurationList = 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOS" */;
219 | buildPhases = (
220 | FD10A7F122414F3F0027D42C /* Start Packager */,
221 | 2D02E4771E0B4A5D006451C7 /* Sources */,
222 | 2D02E4781E0B4A5D006451C7 /* Frameworks */,
223 | 2D02E4791E0B4A5D006451C7 /* Resources */,
224 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */,
225 | );
226 | buildRules = (
227 | );
228 | dependencies = (
229 | );
230 | name = "HelloWorld-tvOS";
231 | productName = "HelloWorld-tvOS";
232 | productReference = 2D02E47B1E0B4A5D006451C7 /* HelloWorld-tvOS.app */;
233 | productType = "com.apple.product-type.application";
234 | };
235 | 2D02E48F1E0B4A5D006451C7 /* HelloWorld-tvOSTests */ = {
236 | isa = PBXNativeTarget;
237 | buildConfigurationList = 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOSTests" */;
238 | buildPhases = (
239 | 2D02E48C1E0B4A5D006451C7 /* Sources */,
240 | 2D02E48D1E0B4A5D006451C7 /* Frameworks */,
241 | 2D02E48E1E0B4A5D006451C7 /* Resources */,
242 | );
243 | buildRules = (
244 | );
245 | dependencies = (
246 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */,
247 | );
248 | name = "HelloWorld-tvOSTests";
249 | productName = "HelloWorld-tvOSTests";
250 | productReference = 2D02E4901E0B4A5D006451C7 /* HelloWorld-tvOSTests.xctest */;
251 | productType = "com.apple.product-type.bundle.unit-test";
252 | };
253 | /* End PBXNativeTarget section */
254 |
255 | /* Begin PBXProject section */
256 | 83CBB9F71A601CBA00E9B192 /* Project object */ = {
257 | isa = PBXProject;
258 | attributes = {
259 | LastUpgradeCheck = 940;
260 | ORGANIZATIONNAME = Facebook;
261 | TargetAttributes = {
262 | 00E356ED1AD99517003FC87E = {
263 | CreatedOnToolsVersion = 6.2;
264 | TestTargetID = 13B07F861A680F5B00A75B9A;
265 | };
266 | 2D02E47A1E0B4A5D006451C7 = {
267 | CreatedOnToolsVersion = 8.2.1;
268 | ProvisioningStyle = Automatic;
269 | };
270 | 2D02E48F1E0B4A5D006451C7 = {
271 | CreatedOnToolsVersion = 8.2.1;
272 | ProvisioningStyle = Automatic;
273 | TestTargetID = 2D02E47A1E0B4A5D006451C7;
274 | };
275 | };
276 | };
277 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */;
278 | compatibilityVersion = "Xcode 3.2";
279 | developmentRegion = English;
280 | hasScannedForEncodings = 0;
281 | knownRegions = (
282 | en,
283 | Base,
284 | );
285 | mainGroup = 83CBB9F61A601CBA00E9B192;
286 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */;
287 | projectDirPath = "";
288 | projectRoot = "";
289 | targets = (
290 | 13B07F861A680F5B00A75B9A /* HelloWorld */,
291 | 00E356ED1AD99517003FC87E /* HelloWorldTests */,
292 | 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */,
293 | 2D02E48F1E0B4A5D006451C7 /* HelloWorld-tvOSTests */,
294 | );
295 | };
296 | /* End PBXProject section */
297 |
298 | /* Begin PBXResourcesBuildPhase section */
299 | 00E356EC1AD99517003FC87E /* Resources */ = {
300 | isa = PBXResourcesBuildPhase;
301 | buildActionMask = 2147483647;
302 | files = (
303 | );
304 | runOnlyForDeploymentPostprocessing = 0;
305 | };
306 | 13B07F8E1A680F5B00A75B9A /* Resources */ = {
307 | isa = PBXResourcesBuildPhase;
308 | buildActionMask = 2147483647;
309 | files = (
310 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
311 | 13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
312 | CC333C3339CC44A6B06DB6A4 /* antfill.ttf in Resources */,
313 | F964CDAA7D1042938CDEA6C0 /* antoutline.ttf in Resources */,
314 | );
315 | runOnlyForDeploymentPostprocessing = 0;
316 | };
317 | 2D02E4791E0B4A5D006451C7 /* Resources */ = {
318 | isa = PBXResourcesBuildPhase;
319 | buildActionMask = 2147483647;
320 | files = (
321 | 2D02E4BD1E0B4A84006451C7 /* Images.xcassets in Resources */,
322 | );
323 | runOnlyForDeploymentPostprocessing = 0;
324 | };
325 | 2D02E48E1E0B4A5D006451C7 /* Resources */ = {
326 | isa = PBXResourcesBuildPhase;
327 | buildActionMask = 2147483647;
328 | files = (
329 | );
330 | runOnlyForDeploymentPostprocessing = 0;
331 | };
332 | /* End PBXResourcesBuildPhase section */
333 |
334 | /* Begin PBXShellScriptBuildPhase section */
335 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
336 | isa = PBXShellScriptBuildPhase;
337 | buildActionMask = 2147483647;
338 | files = (
339 | );
340 | inputPaths = (
341 | );
342 | name = "Bundle React Native code and images";
343 | outputPaths = (
344 | );
345 | runOnlyForDeploymentPostprocessing = 0;
346 | shellPath = /bin/sh;
347 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
348 | };
349 | 0D5FCFA323A4B650009353E9 /* Get ipa Build Time */ = {
350 | isa = PBXShellScriptBuildPhase;
351 | buildActionMask = 2147483647;
352 | files = (
353 | );
354 | inputFileListPaths = (
355 | );
356 | inputPaths = (
357 | );
358 | name = "Get ipa Build Time";
359 | outputFileListPaths = (
360 | );
361 | outputPaths = (
362 | );
363 | runOnlyForDeploymentPostprocessing = 0;
364 | shellPath = /bin/sh;
365 | shellScript = "#!/bin/bash\ninfoplist=\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"\nbuilddate=`date +%Y-%m-%d_%H:%M`\nif [[ -n \"$builddate\" ]]; then\n/usr/libexec/PlistBuddy -c \"Set :BUILD_TIME $builddate\" ${infoplist}\nfi\n";
366 | };
367 | 2D02E4CB1E0B4B27006451C7 /* Bundle React Native Code And Images */ = {
368 | isa = PBXShellScriptBuildPhase;
369 | buildActionMask = 2147483647;
370 | files = (
371 | );
372 | inputPaths = (
373 | );
374 | name = "Bundle React Native Code And Images";
375 | outputPaths = (
376 | );
377 | runOnlyForDeploymentPostprocessing = 0;
378 | shellPath = /bin/sh;
379 | shellScript = "export NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh";
380 | };
381 | FD10A7F022414F080027D42C /* Start Packager */ = {
382 | isa = PBXShellScriptBuildPhase;
383 | buildActionMask = 2147483647;
384 | files = (
385 | );
386 | inputFileListPaths = (
387 | );
388 | inputPaths = (
389 | );
390 | name = "Start Packager";
391 | outputFileListPaths = (
392 | );
393 | outputPaths = (
394 | );
395 | runOnlyForDeploymentPostprocessing = 0;
396 | shellPath = /bin/sh;
397 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
398 | showEnvVarsInLog = 0;
399 | };
400 | FD10A7F122414F3F0027D42C /* Start Packager */ = {
401 | isa = PBXShellScriptBuildPhase;
402 | buildActionMask = 2147483647;
403 | files = (
404 | );
405 | inputFileListPaths = (
406 | );
407 | inputPaths = (
408 | );
409 | name = "Start Packager";
410 | outputFileListPaths = (
411 | );
412 | outputPaths = (
413 | );
414 | runOnlyForDeploymentPostprocessing = 0;
415 | shellPath = /bin/sh;
416 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n";
417 | showEnvVarsInLog = 0;
418 | };
419 | /* End PBXShellScriptBuildPhase section */
420 |
421 | /* Begin PBXSourcesBuildPhase section */
422 | 00E356EA1AD99517003FC87E /* Sources */ = {
423 | isa = PBXSourcesBuildPhase;
424 | buildActionMask = 2147483647;
425 | files = (
426 | 00E356F31AD99517003FC87E /* HelloWorldTests.m in Sources */,
427 | );
428 | runOnlyForDeploymentPostprocessing = 0;
429 | };
430 | 13B07F871A680F5B00A75B9A /* Sources */ = {
431 | isa = PBXSourcesBuildPhase;
432 | buildActionMask = 2147483647;
433 | files = (
434 | 13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */,
435 | 13B07FC11A68108700A75B9A /* main.m in Sources */,
436 | );
437 | runOnlyForDeploymentPostprocessing = 0;
438 | };
439 | 2D02E4771E0B4A5D006451C7 /* Sources */ = {
440 | isa = PBXSourcesBuildPhase;
441 | buildActionMask = 2147483647;
442 | files = (
443 | 2D02E4BF1E0B4AB3006451C7 /* main.m in Sources */,
444 | 2D02E4BC1E0B4A80006451C7 /* AppDelegate.m in Sources */,
445 | );
446 | runOnlyForDeploymentPostprocessing = 0;
447 | };
448 | 2D02E48C1E0B4A5D006451C7 /* Sources */ = {
449 | isa = PBXSourcesBuildPhase;
450 | buildActionMask = 2147483647;
451 | files = (
452 | 2DCD954D1E0B4F2C00145EB5 /* HelloWorldTests.m in Sources */,
453 | );
454 | runOnlyForDeploymentPostprocessing = 0;
455 | };
456 | /* End PBXSourcesBuildPhase section */
457 |
458 | /* Begin PBXTargetDependency section */
459 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = {
460 | isa = PBXTargetDependency;
461 | target = 13B07F861A680F5B00A75B9A /* HelloWorld */;
462 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */;
463 | };
464 | 2D02E4921E0B4A5D006451C7 /* PBXTargetDependency */ = {
465 | isa = PBXTargetDependency;
466 | target = 2D02E47A1E0B4A5D006451C7 /* HelloWorld-tvOS */;
467 | targetProxy = 2D02E4911E0B4A5D006451C7 /* PBXContainerItemProxy */;
468 | };
469 | /* End PBXTargetDependency section */
470 |
471 | /* Begin PBXVariantGroup section */
472 | 13B07FB11A68108700A75B9A /* LaunchScreen.xib */ = {
473 | isa = PBXVariantGroup;
474 | children = (
475 | 13B07FB21A68108700A75B9A /* Base */,
476 | );
477 | name = LaunchScreen.xib;
478 | path = HelloWorld;
479 | sourceTree = "";
480 | };
481 | /* End PBXVariantGroup section */
482 |
483 | /* Begin XCBuildConfiguration section */
484 | 00E356F61AD99517003FC87E /* Debug */ = {
485 | isa = XCBuildConfiguration;
486 | buildSettings = {
487 | BUNDLE_LOADER = "$(TEST_HOST)";
488 | GCC_PREPROCESSOR_DEFINITIONS = (
489 | "DEBUG=1",
490 | "$(inherited)",
491 | );
492 | INFOPLIST_FILE = HelloWorldTests/Info.plist;
493 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
494 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
495 | OTHER_LDFLAGS = (
496 | "-ObjC",
497 | "-lc++",
498 | "$(inherited)",
499 | );
500 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
501 | PRODUCT_NAME = "$(TARGET_NAME)";
502 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld";
503 | };
504 | name = Debug;
505 | };
506 | 00E356F71AD99517003FC87E /* Release */ = {
507 | isa = XCBuildConfiguration;
508 | buildSettings = {
509 | BUNDLE_LOADER = "$(TEST_HOST)";
510 | COPY_PHASE_STRIP = NO;
511 | INFOPLIST_FILE = HelloWorldTests/Info.plist;
512 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
513 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
514 | OTHER_LDFLAGS = (
515 | "-ObjC",
516 | "-lc++",
517 | "$(inherited)",
518 | );
519 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
520 | PRODUCT_NAME = "$(TARGET_NAME)";
521 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld.app/HelloWorld";
522 | };
523 | name = Release;
524 | };
525 | 13B07F941A680F5B00A75B9A /* Debug */ = {
526 | isa = XCBuildConfiguration;
527 | buildSettings = {
528 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
529 | CURRENT_PROJECT_VERSION = 1;
530 | DEAD_CODE_STRIPPING = NO;
531 | INFOPLIST_FILE = HelloWorld/Info.plist;
532 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
533 | OTHER_LDFLAGS = (
534 | "$(inherited)",
535 | "-ObjC",
536 | "-lc++",
537 | );
538 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
539 | PRODUCT_NAME = HelloWorld;
540 | VERSIONING_SYSTEM = "apple-generic";
541 | };
542 | name = Debug;
543 | };
544 | 13B07F951A680F5B00A75B9A /* Release */ = {
545 | isa = XCBuildConfiguration;
546 | buildSettings = {
547 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
548 | CURRENT_PROJECT_VERSION = 1;
549 | INFOPLIST_FILE = HelloWorld/Info.plist;
550 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
551 | OTHER_LDFLAGS = (
552 | "$(inherited)",
553 | "-ObjC",
554 | "-lc++",
555 | );
556 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
557 | PRODUCT_NAME = HelloWorld;
558 | VERSIONING_SYSTEM = "apple-generic";
559 | };
560 | name = Release;
561 | };
562 | 2D02E4971E0B4A5E006451C7 /* Debug */ = {
563 | isa = XCBuildConfiguration;
564 | buildSettings = {
565 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
566 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
567 | CLANG_ANALYZER_NONNULL = YES;
568 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
569 | CLANG_WARN_INFINITE_RECURSION = YES;
570 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
571 | DEBUG_INFORMATION_FORMAT = dwarf;
572 | ENABLE_TESTABILITY = YES;
573 | GCC_NO_COMMON_BLOCKS = YES;
574 | INFOPLIST_FILE = "HelloWorld-tvOS/Info.plist";
575 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
576 | OTHER_LDFLAGS = (
577 | "$(inherited)",
578 | "-ObjC",
579 | "-lc++",
580 | );
581 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.HelloWorld-tvOS";
582 | PRODUCT_NAME = "$(TARGET_NAME)";
583 | SDKROOT = appletvos;
584 | TARGETED_DEVICE_FAMILY = 3;
585 | TVOS_DEPLOYMENT_TARGET = 9.2;
586 | };
587 | name = Debug;
588 | };
589 | 2D02E4981E0B4A5E006451C7 /* Release */ = {
590 | isa = XCBuildConfiguration;
591 | buildSettings = {
592 | ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
593 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
594 | CLANG_ANALYZER_NONNULL = YES;
595 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
596 | CLANG_WARN_INFINITE_RECURSION = YES;
597 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
598 | COPY_PHASE_STRIP = NO;
599 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
600 | GCC_NO_COMMON_BLOCKS = YES;
601 | INFOPLIST_FILE = "HelloWorld-tvOS/Info.plist";
602 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
603 | OTHER_LDFLAGS = (
604 | "$(inherited)",
605 | "-ObjC",
606 | "-lc++",
607 | );
608 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.HelloWorld-tvOS";
609 | PRODUCT_NAME = "$(TARGET_NAME)";
610 | SDKROOT = appletvos;
611 | TARGETED_DEVICE_FAMILY = 3;
612 | TVOS_DEPLOYMENT_TARGET = 9.2;
613 | };
614 | name = Release;
615 | };
616 | 2D02E4991E0B4A5E006451C7 /* Debug */ = {
617 | isa = XCBuildConfiguration;
618 | buildSettings = {
619 | BUNDLE_LOADER = "$(TEST_HOST)";
620 | CLANG_ANALYZER_NONNULL = YES;
621 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
622 | CLANG_WARN_INFINITE_RECURSION = YES;
623 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
624 | DEBUG_INFORMATION_FORMAT = dwarf;
625 | ENABLE_TESTABILITY = YES;
626 | GCC_NO_COMMON_BLOCKS = YES;
627 | INFOPLIST_FILE = "HelloWorld-tvOSTests/Info.plist";
628 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
629 | OTHER_LDFLAGS = (
630 | "$(inherited)",
631 | "-ObjC",
632 | "-lc++",
633 | );
634 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.HelloWorld-tvOSTests";
635 | PRODUCT_NAME = "$(TARGET_NAME)";
636 | SDKROOT = appletvos;
637 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld-tvOS.app/HelloWorld-tvOS";
638 | TVOS_DEPLOYMENT_TARGET = 10.1;
639 | };
640 | name = Debug;
641 | };
642 | 2D02E49A1E0B4A5E006451C7 /* Release */ = {
643 | isa = XCBuildConfiguration;
644 | buildSettings = {
645 | BUNDLE_LOADER = "$(TEST_HOST)";
646 | CLANG_ANALYZER_NONNULL = YES;
647 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
648 | CLANG_WARN_INFINITE_RECURSION = YES;
649 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
650 | COPY_PHASE_STRIP = NO;
651 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
652 | GCC_NO_COMMON_BLOCKS = YES;
653 | INFOPLIST_FILE = "HelloWorld-tvOSTests/Info.plist";
654 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
655 | OTHER_LDFLAGS = (
656 | "$(inherited)",
657 | "-ObjC",
658 | "-lc++",
659 | );
660 | PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.HelloWorld-tvOSTests";
661 | PRODUCT_NAME = "$(TARGET_NAME)";
662 | SDKROOT = appletvos;
663 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/HelloWorld-tvOS.app/HelloWorld-tvOS";
664 | TVOS_DEPLOYMENT_TARGET = 10.1;
665 | };
666 | name = Release;
667 | };
668 | 83CBBA201A601CBA00E9B192 /* Debug */ = {
669 | isa = XCBuildConfiguration;
670 | buildSettings = {
671 | ALWAYS_SEARCH_USER_PATHS = NO;
672 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
673 | CLANG_CXX_LIBRARY = "libc++";
674 | CLANG_ENABLE_MODULES = YES;
675 | CLANG_ENABLE_OBJC_ARC = YES;
676 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
677 | CLANG_WARN_BOOL_CONVERSION = YES;
678 | CLANG_WARN_COMMA = YES;
679 | CLANG_WARN_CONSTANT_CONVERSION = YES;
680 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
681 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
682 | CLANG_WARN_EMPTY_BODY = YES;
683 | CLANG_WARN_ENUM_CONVERSION = YES;
684 | CLANG_WARN_INFINITE_RECURSION = YES;
685 | CLANG_WARN_INT_CONVERSION = YES;
686 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
687 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
688 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
689 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
690 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
691 | CLANG_WARN_STRICT_PROTOTYPES = YES;
692 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
693 | CLANG_WARN_UNREACHABLE_CODE = YES;
694 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
695 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
696 | COPY_PHASE_STRIP = NO;
697 | ENABLE_STRICT_OBJC_MSGSEND = YES;
698 | ENABLE_TESTABILITY = YES;
699 | GCC_C_LANGUAGE_STANDARD = gnu99;
700 | GCC_DYNAMIC_NO_PIC = NO;
701 | GCC_NO_COMMON_BLOCKS = YES;
702 | GCC_OPTIMIZATION_LEVEL = 0;
703 | GCC_PREPROCESSOR_DEFINITIONS = (
704 | "DEBUG=1",
705 | "$(inherited)",
706 | );
707 | GCC_SYMBOLS_PRIVATE_EXTERN = NO;
708 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
709 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
710 | GCC_WARN_UNDECLARED_SELECTOR = YES;
711 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
712 | GCC_WARN_UNUSED_FUNCTION = YES;
713 | GCC_WARN_UNUSED_VARIABLE = YES;
714 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
715 | MTL_ENABLE_DEBUG_INFO = YES;
716 | ONLY_ACTIVE_ARCH = YES;
717 | SDKROOT = iphoneos;
718 | };
719 | name = Debug;
720 | };
721 | 83CBBA211A601CBA00E9B192 /* Release */ = {
722 | isa = XCBuildConfiguration;
723 | buildSettings = {
724 | ALWAYS_SEARCH_USER_PATHS = NO;
725 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
726 | CLANG_CXX_LIBRARY = "libc++";
727 | CLANG_ENABLE_MODULES = YES;
728 | CLANG_ENABLE_OBJC_ARC = YES;
729 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
730 | CLANG_WARN_BOOL_CONVERSION = YES;
731 | CLANG_WARN_COMMA = YES;
732 | CLANG_WARN_CONSTANT_CONVERSION = YES;
733 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
734 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
735 | CLANG_WARN_EMPTY_BODY = YES;
736 | CLANG_WARN_ENUM_CONVERSION = YES;
737 | CLANG_WARN_INFINITE_RECURSION = YES;
738 | CLANG_WARN_INT_CONVERSION = YES;
739 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
740 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
741 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
742 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
743 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
744 | CLANG_WARN_STRICT_PROTOTYPES = YES;
745 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
746 | CLANG_WARN_UNREACHABLE_CODE = YES;
747 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
748 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
749 | COPY_PHASE_STRIP = YES;
750 | ENABLE_NS_ASSERTIONS = NO;
751 | ENABLE_STRICT_OBJC_MSGSEND = YES;
752 | GCC_C_LANGUAGE_STANDARD = gnu99;
753 | GCC_NO_COMMON_BLOCKS = YES;
754 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
755 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
756 | GCC_WARN_UNDECLARED_SELECTOR = YES;
757 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
758 | GCC_WARN_UNUSED_FUNCTION = YES;
759 | GCC_WARN_UNUSED_VARIABLE = YES;
760 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
761 | MTL_ENABLE_DEBUG_INFO = NO;
762 | SDKROOT = iphoneos;
763 | VALIDATE_PRODUCT = YES;
764 | };
765 | name = Release;
766 | };
767 | /* End XCBuildConfiguration section */
768 |
769 | /* Begin XCConfigurationList section */
770 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "HelloWorldTests" */ = {
771 | isa = XCConfigurationList;
772 | buildConfigurations = (
773 | 00E356F61AD99517003FC87E /* Debug */,
774 | 00E356F71AD99517003FC87E /* Release */,
775 | );
776 | defaultConfigurationIsVisible = 0;
777 | defaultConfigurationName = Release;
778 | };
779 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "HelloWorld" */ = {
780 | isa = XCConfigurationList;
781 | buildConfigurations = (
782 | 13B07F941A680F5B00A75B9A /* Debug */,
783 | 13B07F951A680F5B00A75B9A /* Release */,
784 | );
785 | defaultConfigurationIsVisible = 0;
786 | defaultConfigurationName = Release;
787 | };
788 | 2D02E4BA1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOS" */ = {
789 | isa = XCConfigurationList;
790 | buildConfigurations = (
791 | 2D02E4971E0B4A5E006451C7 /* Debug */,
792 | 2D02E4981E0B4A5E006451C7 /* Release */,
793 | );
794 | defaultConfigurationIsVisible = 0;
795 | defaultConfigurationName = Release;
796 | };
797 | 2D02E4BB1E0B4A5E006451C7 /* Build configuration list for PBXNativeTarget "HelloWorld-tvOSTests" */ = {
798 | isa = XCConfigurationList;
799 | buildConfigurations = (
800 | 2D02E4991E0B4A5E006451C7 /* Debug */,
801 | 2D02E49A1E0B4A5E006451C7 /* Release */,
802 | );
803 | defaultConfigurationIsVisible = 0;
804 | defaultConfigurationName = Release;
805 | };
806 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "HelloWorld" */ = {
807 | isa = XCConfigurationList;
808 | buildConfigurations = (
809 | 83CBBA201A601CBA00E9B192 /* Debug */,
810 | 83CBBA211A601CBA00E9B192 /* Release */,
811 | );
812 | defaultConfigurationIsVisible = 0;
813 | defaultConfigurationName = Release;
814 | };
815 | /* End XCConfigurationList section */
816 | };
817 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */;
818 | }
819 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (nonatomic, strong) UIWindow *window;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import "AppDelegate.h"
9 |
10 | #import
11 | #import
12 | #import
13 | #import "RNSplashScreen.h"
14 |
15 | @implementation AppDelegate
16 |
17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
18 | {
19 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
20 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
21 | moduleName:@"HelloWorld"
22 | initialProperties:nil];
23 |
24 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
25 |
26 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
27 | UIViewController *rootViewController = [UIViewController new];
28 | rootViewController.view = rootView;
29 | self.window.rootViewController = rootViewController;
30 | [self.window makeKeyAndVisible];
31 | // [RNSplashScreen show];
32 | return YES;
33 | }
34 |
35 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
36 | {
37 | #if DEBUG
38 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
39 | #else
40 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
41 | #endif
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld/Base.lproj/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/template/ios/HelloWorld/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | APP_NAME
6 | Hello App Display Name
7 | BUILD_TIME
8 |
9 | BUILD_TYPE
10 | $(CONFIGURATION)
11 | CFBundleDevelopmentRegion
12 | en
13 | CFBundleDisplayName
14 | Hello App Display Name
15 | CFBundleExecutable
16 | $(EXECUTABLE_NAME)
17 | CFBundleIdentifier
18 | $(PRODUCT_BUNDLE_IDENTIFIER)
19 | CFBundleInfoDictionaryVersion
20 | 6.0
21 | CFBundleName
22 | $(PRODUCT_NAME)
23 | CFBundlePackageType
24 | APPL
25 | CFBundleShortVersionString
26 | 1.0
27 | CFBundleSignature
28 | ????
29 | CFBundleVersion
30 | 1
31 | LSRequiresIPhoneOS
32 |
33 | NSAppTransportSecurity
34 |
35 | NSAllowsArbitraryLoads
36 |
37 | NSExceptionDomains
38 |
39 | localhost
40 |
41 | NSExceptionAllowsInsecureHTTPLoads
42 |
43 |
44 |
45 |
46 | NSCameraUsageDescription
47 | cameraDescription
48 | NSMicrophoneUsageDescription
49 | microphoneDescription
50 | NSPhotoLibraryUsageDescription
51 | photoLibraryDescription
52 | NSLocationWhenInUseUsageDescription
53 |
54 | UILaunchStoryboardName
55 | LaunchScreen
56 | UIRequiredDeviceCapabilities
57 |
58 | armv7
59 |
60 | UISupportedInterfaceOrientations
61 |
62 | UIInterfaceOrientationPortrait
63 | UIInterfaceOrientationLandscapeLeft
64 | UIInterfaceOrientationLandscapeRight
65 |
66 | UIViewControllerBasedStatusBarAppearance
67 |
68 | UIAppFonts
69 |
70 | antfill.ttf
71 | antoutline.ttf
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/template/ios/HelloWorld/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 |
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/template/ios/HelloWorldTests/HelloWorldTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) Facebook, Inc. and its affiliates.
3 | *
4 | * This source code is licensed under the MIT license found in the
5 | * LICENSE file in the root directory of this source tree.
6 | */
7 |
8 | #import
9 | #import
10 |
11 | #import
12 | #import
13 |
14 | #define TIMEOUT_SECONDS 600
15 | #define TEXT_TO_LOOK_FOR @"Welcome to React"
16 |
17 | @interface HelloWorldTests : XCTestCase
18 |
19 | @end
20 |
21 | @implementation HelloWorldTests
22 |
23 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
24 | {
25 | if (test(view)) {
26 | return YES;
27 | }
28 | for (UIView *subview in [view subviews]) {
29 | if ([self findSubviewInView:subview matching:test]) {
30 | return YES;
31 | }
32 | }
33 | return NO;
34 | }
35 |
36 | - (void)testRendersWelcomeScreen
37 | {
38 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
39 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
40 | BOOL foundElement = NO;
41 |
42 | __block NSString *redboxError = nil;
43 | #ifdef DEBUG
44 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
45 | if (level >= RCTLogLevelError) {
46 | redboxError = message;
47 | }
48 | });
49 | #endif
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | #ifdef DEBUG
64 | RCTSetLogFunction(RCTDefaultLogFunction);
65 | #endif
66 |
67 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
68 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
69 | }
70 |
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/template/ios/HelloWorldTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/template/ios/Podfile:
--------------------------------------------------------------------------------
1 | platform :ios, '9.0'
2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 |
4 | target 'HelloWorld' do
5 | # Pods for HelloWorld
6 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
7 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
8 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
9 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety"
10 | pod 'React', :path => '../node_modules/react-native/'
11 | pod 'React-Core', :path => '../node_modules/react-native/'
12 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules'
13 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/'
14 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS'
15 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation'
16 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob'
17 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image'
18 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
19 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network'
20 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings'
21 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text'
22 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration'
23 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/'
24 |
25 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact'
26 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi'
27 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor'
28 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector'
29 | pod 'ReactCommon/jscallinvoker', :path => "../node_modules/react-native/ReactCommon"
30 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon"
31 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga'
32 |
33 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
34 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
35 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
36 |
37 | target 'HelloWorldTests' do
38 | inherit! :search_paths
39 | # Pods for testing
40 | end
41 |
42 | use_native_modules!
43 | end
44 |
45 | target 'HelloWorld-tvOS' do
46 | # Pods for HelloWorld-tvOS
47 |
48 | target 'HelloWorld-tvOSTests' do
49 | inherit! :search_paths
50 | # Pods for testing
51 | end
52 |
53 | end
54 |
--------------------------------------------------------------------------------
/template/metro.config.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Metro configuration for React Native
3 | * https://github.com/facebook/react-native
4 | *
5 | * @format
6 | */
7 |
8 | module.exports = {
9 | transformer: {
10 | getTransformOptions: async () => ({
11 | transform: {
12 | experimentalImportSupport: false,
13 | inlineRequires: false,
14 | },
15 | }),
16 | },
17 | }
18 |
--------------------------------------------------------------------------------
/template/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "HelloWorld",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "postinstall": "npx jetifier && node scripts/react-scrollview-fix.js",
7 | "android": "react-native run-android",
8 | "ios": "react-native run-ios",
9 | "start": "react-native start",
10 | "test": "jest",
11 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx",
12 | "pod": "cd ios && pod install",
13 | "gradle:clean": "cd android && ./gradlew clean",
14 | "an:release": "yarn gradle:clean && cd android && ./gradlew app:assembleRelease",
15 | "an:installRelease": "yarn gradle:clean && cd android && ./gradlew app:installRelease",
16 | "an:releaseStaging": "yarn gradle:clean && cd android && ./gradlew app:assembleReleaseStaging",
17 | "an:installReleaseStaging": "yarn gradle:clean && cd android && ./gradlew app:installReleaseStaging",
18 | "an:genkeypair": "keytool -genkeypair -v -keystore release.keystore -alias androidreleasekey -keyalg RSA -keysize 2048 -validity 10000",
19 | "an:key-debug": "keytool -list -v -keystore ./android/app/debug.keystore",
20 | "an:key-release": "keytool -v -list -keystore ./android/app/release.keystore",
21 | "icon": "npx iconfont-rn"
22 | },
23 | "dependencies": {
24 | "@ant-design/icons-react-native": "1.0.2",
25 | "@ant-design/react-native": "3.2.2",
26 | "@react-native-community/async-storage": "1.3.3",
27 | "@react-native-community/blur": "3.4.1",
28 | "@react-native-community/masked-view": "0.1.6",
29 | "@react-native-community/netinfo": "5.5.1",
30 | "@react-native-community/viewpager": "3.3.0",
31 | "@react-navigation/bottom-tabs": "5.0.6",
32 | "@react-navigation/native": "5.0.6",
33 | "@react-navigation/stack": "5.0.6",
34 | "axios": "0.19.2",
35 | "clean-deep": "3.3.0",
36 | "dayjs": "1.8.21",
37 | "lodash": "4.17.15",
38 | "mobx": "5.15.4",
39 | "mobx-react": "6.1.8",
40 | "qs": "6.9.1",
41 | "react": "16.9.0",
42 | "react-native": "0.61.5",
43 | "react-native-animatable": "1.3.3",
44 | "react-native-config-reader": "4.1.0",
45 | "react-native-device-info": "5.5.3",
46 | "react-native-echarts-wrapper": "2.0.0",
47 | "react-native-gesture-handler": "1.6.0",
48 | "react-native-image-crop-picker": "0.28.0",
49 | "react-native-image-zoom-viewer": "2.2.27",
50 | "react-native-iphone-x-helper": "1.2.1",
51 | "react-native-keyboard-manager": "4.0.13-16",
52 | "react-native-largelist-v3": "3.0.15",
53 | "react-native-linear-gradient": "2.5.6",
54 | "react-native-permissions": "2.0.9",
55 | "react-native-reanimated": "1.7.0",
56 | "react-native-safe-area-context": "0.7.3",
57 | "react-native-screens": "2.0.0-beta.8",
58 | "react-native-scrollable-tab-view": "1.0.0",
59 | "react-native-simple-store": "2.0.2",
60 | "react-native-splash-screen": "3.2.0",
61 | "react-native-spring-scrollview": "2.0.23",
62 | "react-native-svg": "11.0.1",
63 | "react-native-webview": "8.1.1",
64 | "react-navigation-header-buttons": "3.0.5",
65 | "rn-fetch-blob": "0.12.0"
66 | },
67 | "resolutions": {
68 | "@react-native-community/viewpager": "2.0.2"
69 | },
70 | "devDependencies": {
71 | "@babel/core": "^7.6.2",
72 | "@babel/plugin-transform-flow-strip-types": "^7.8.3",
73 | "@babel/runtime": "^7.6.2",
74 | "@sishuguojixuefu/eslint-config": "^0.8.4",
75 | "@types/jest": "^24.0.24",
76 | "@types/lodash": "^4.14.149",
77 | "@types/qs": "^6.9.1",
78 | "@types/react-native": "^0.61.23",
79 | "@types/react-test-renderer": "16.9.1",
80 | "babel-jest": "^24.9.0",
81 | "babel-plugin-import": "^1.13.0",
82 | "babel-plugin-root-import": "^6.4.1",
83 | "babel-plugin-transform-remove-console": "^6.9.4",
84 | "babel-preset-mobx": "^2.0.0",
85 | "eslint-import-resolver-babel-plugin-root-import": "^1.1.1",
86 | "husky": "^3.1.0",
87 | "jest": "^24.9.0",
88 | "jetifier": "^1.6.5",
89 | "lint-staged": "^9.5.0",
90 | "metro-react-native-babel-preset": "^0.56.0",
91 | "react-native-iconfont-cli": "^1.6.3",
92 | "react-test-renderer": "16.9.0",
93 | "typescript": "^3.7.3"
94 | },
95 | "jest": {
96 | "preset": "react-native",
97 | "moduleFileExtensions": [
98 | "ts",
99 | "tsx",
100 | "js",
101 | "jsx",
102 | "json",
103 | "node"
104 | ]
105 | },
106 | "eslintConfig": {
107 | "extends": [
108 | "@sishuguojixuefu"
109 | ],
110 | "env": {
111 | "react-native/react-native": true
112 | },
113 | "settings": {
114 | "import/resolver": {
115 | "babel-plugin-root-import": {
116 | "rootPathSuffix": "src",
117 | "rootPathPrefix": "~"
118 | }
119 | }
120 | }
121 | },
122 | "eslintIgnore": [
123 | "__tests__/App-test.tsx"
124 | ],
125 | "prettier": "@sishuguojixuefu/eslint-config/.prettierrc.js",
126 | "husky": {
127 | "hooks": {
128 | "pre-commit": "lint-staged"
129 | }
130 | },
131 | "lint-staged": {
132 | "**/*.{js,jsx,ts,tsx}": [
133 | "eslint --fix",
134 | "git add"
135 | ],
136 | "**/*.{md,json}": [
137 | "prettier --write",
138 | "git add"
139 | ]
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/template/scripts/react-scrollview-fix.js:
--------------------------------------------------------------------------------
1 | /* eslint no-throw-literal:0 */
2 | const fs = require('fs')
3 |
4 | try {
5 | console.log('React spring scroll view fix...')
6 | const rootDir = process.cwd()
7 |
8 | const file = `${rootDir}/node_modules/react-native-spring-scrollview/SpringScrollView.js`
9 | const data = fs.readFileSync(file, 'utf8')
10 | const dataFix = 'react-native/Libraries/Components/TextInput/TextInputState'
11 |
12 | if (data.indexOf(dataFix) !== -1) {
13 | throw '> Already fixed'
14 | }
15 |
16 | const result = data.replace(/react-native\/lib\/TextInputState/g, dataFix)
17 | fs.writeFileSync(file, result, 'utf8')
18 | console.log('Fixed Done')
19 | } catch (error) {
20 | console.error(error)
21 | }
22 |
--------------------------------------------------------------------------------
/template/src/App.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { StatusBar } from 'react-native'
3 | import { Provider } from '@ant-design/react-native'
4 | import AppContainer from '~/routes/AppContainer'
5 |
6 | const App = () => {
7 | return (
8 |
9 |
10 |
11 |
12 | )
13 | }
14 |
15 | export default App
16 |
--------------------------------------------------------------------------------
/template/src/common/enums/index.ts:
--------------------------------------------------------------------------------
1 | export default () => {
2 | console.log('hello veronica_utils')
3 | }
4 |
--------------------------------------------------------------------------------
/template/src/common/index.ts:
--------------------------------------------------------------------------------
1 | import utils from './utils'
2 | import enums from './enums'
3 | import stores from './stores'
4 |
5 | export default { utils, enums, stores }
6 |
--------------------------------------------------------------------------------
/template/src/common/stores/index.ts:
--------------------------------------------------------------------------------
1 | export default () => {
2 | console.log('hello veronica_utils')
3 | }
4 |
--------------------------------------------------------------------------------
/template/src/common/utils/index.ts:
--------------------------------------------------------------------------------
1 | export default () => {
2 | console.log('hello veronica_utils')
3 | }
4 |
--------------------------------------------------------------------------------
/template/src/request/Api.ts:
--------------------------------------------------------------------------------
1 | import axios, { AxiosInstance, AxiosRequestConfig } from 'axios'
2 | import qs from 'qs'
3 | import cleanDeep from 'clean-deep'
4 |
5 | const handleRequestConfig = (config: AxiosRequestConfig) => {
6 | // 在发送请求之前做些什么
7 | const Config = cleanDeep(config, {
8 | emptyArrays: false,
9 | emptyObjects: false,
10 | })
11 | if (Config.method === 'get') {
12 | Config.paramsSerializer = params =>
13 | qs.stringify(params, {
14 | arrayFormat: 'repeat',
15 | })
16 | }
17 | return Config
18 | }
19 |
20 | const handleResponseSuccess = response => {
21 | // 对响应数据做点什么
22 | return response.data
23 | }
24 |
25 | const handleResponseFail = error => {
26 | // 对响应错误做点什么
27 | return Promise.reject(error)
28 | }
29 |
30 | class Api {
31 | instance: AxiosInstance
32 | constructor(baseConfig?: AxiosRequestConfig) {
33 | this.instance = axios.create({
34 | baseURL: '',
35 | timeout: 10000,
36 | ...baseConfig,
37 | })
38 | // 请求拦截器
39 | this.instance.interceptors.request.use(handleRequestConfig, error => Promise.reject(error))
40 | // 响应拦截器
41 | this.instance.interceptors.response.use(handleResponseSuccess, handleResponseFail)
42 | }
43 | }
44 |
45 | export const api: AxiosInstance = new Api().instance
46 |
47 | export default Api
48 |
--------------------------------------------------------------------------------
/template/src/routes/AppContainer.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { NavigationContainer } from '@react-navigation/native'
3 | import { createStackNavigator } from '@react-navigation/stack'
4 | import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'
5 | import getActiveRoute from './getActiveRoute'
6 | import getScreenOptions from './getScreenOptions'
7 | import { RootStackParamList } from './RootStackParamList'
8 | import Icon from '~/iconfont/Icon'
9 | import HomeScreen from '~/screens/HomeScreen'
10 | import MineScreen from '~/screens/MineScreen'
11 | import DetailScreen from '~/screens/DetailScreen'
12 |
13 | type BottomTabParamList = {
14 | HomeStackScreen: undefined
15 | MineStackScreen: undefined
16 | }
17 |
18 | const RootStack = createStackNavigator()
19 | const BottomTab = createBottomTabNavigator()
20 | const Stack = createStackNavigator()
21 |
22 | const HomeStackScreen = () => {
23 | return (
24 |
25 |
32 |
33 | )
34 | }
35 |
36 | const MineStackScreen = () => {
37 | return (
38 |
39 |
46 |
47 | )
48 | }
49 |
50 | const BottomTabScreen = () => (
51 | ({
53 | tabBarIcon: ({ focused, color, size }) => {
54 | let iconName
55 | if (route.name === 'HomeStackScreen') {
56 | iconName = focused ? 'shouye1' : 'shouye'
57 | } else if (route.name === 'MineStackScreen') {
58 | iconName = focused ? 'wode1' : 'wode'
59 | }
60 | return
61 | },
62 | })}
63 | tabBarOptions={{
64 | activeTintColor: 'tomato',
65 | inactiveTintColor: 'gray',
66 | }}
67 | >
68 |
69 |
70 |
71 | )
72 |
73 | export default () => {
74 | const routeNameRef = React.useRef(null)
75 | return (
76 | {
78 | global.navigation = navigationRef
79 | }}
80 | onStateChange={state => {
81 | const previousRouteName = routeNameRef.current
82 | const currentRoute = getActiveRoute(state)
83 | if (previousRouteName !== currentRoute.name) {
84 | console.log('[onStateChange]', currentRoute)
85 | // 动态设置 StatusBar
86 | // 接入APM系统
87 | }
88 | // Save the current route name for later comparision
89 | routeNameRef.current = currentRoute.name
90 | }}
91 | >
92 |
93 |
94 |
95 | {/* Add other Screens */}
96 |
97 |
98 | )
99 | }
100 |
--------------------------------------------------------------------------------
/template/src/routes/RootStackParamList.ts:
--------------------------------------------------------------------------------
1 | export type RootStackParamList = {
2 | BottomTabScreen: undefined
3 | HomeStackScreen: undefined
4 | HomeScreen: undefined
5 | MineStackScreen: undefined
6 | MineScreen: undefined
7 | DetailScreen: undefined
8 | }
9 |
--------------------------------------------------------------------------------
/template/src/routes/RouteType.ts:
--------------------------------------------------------------------------------
1 | import { RouteProp } from '@react-navigation/native'
2 | import { StackNavigationProp } from '@react-navigation/stack'
3 | import { RootStackParamList } from './RootStackParamList'
4 |
5 | type routeNameKeys = keyof RootStackParamList
6 |
7 | type ScreenNavigationProp = StackNavigationProp
8 |
9 | type ScreenRouteProp = RouteProp
10 |
11 | export type RouteType = {
12 | navigation: ScreenNavigationProp
13 | route: ScreenRouteProp
14 | }
15 |
--------------------------------------------------------------------------------
/template/src/routes/getActiveRoute.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Gets the current screen from navigation state
3 | * @param state
4 | */
5 | const getActiveRoute = state => {
6 | const route = state.routes[state.index]
7 |
8 | if (route.state) {
9 | // Dive into nested navigators
10 | return getActiveRoute(route.state)
11 | }
12 |
13 | return route
14 | }
15 |
16 | export default getActiveRoute
17 |
--------------------------------------------------------------------------------
/template/src/routes/getScreenOptions.ts:
--------------------------------------------------------------------------------
1 | import { TransitionPresets, StackNavigationOptions } from '@react-navigation/stack'
2 |
3 | const getScreenOptions = (): StackNavigationOptions => {
4 | return {
5 | headerStyle: {
6 | backgroundColor: '#ffffff',
7 | }, // 一个应用于 header 的最外层 View 的 样式对象
8 | headerTintColor: '#000000', // 返回按钮和标题都使用这个属性作为它们的颜色
9 | headerBackTitleVisible: false,
10 | headerTitleAlign: 'center',
11 | cardStyle: {
12 | flex: 1,
13 | backgroundColor: '#f5f5f9',
14 | },
15 | ...TransitionPresets.SlideFromRightIOS,
16 | }
17 | }
18 |
19 | export default getScreenOptions
20 |
--------------------------------------------------------------------------------
/template/src/screens/DetailScreen.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { SafeAreaView, StyleSheet, Text } from 'react-native'
3 | import { RouteType } from '~/routes/RouteType'
4 |
5 | type Props = RouteType<'DetailScreen'>
6 |
7 | const DetailScreen: React.FC = ({ navigation, route }) => {
8 | return (
9 |
10 | DetailScreen
11 |
12 | )
13 | }
14 |
15 | DetailScreen.displayName = 'DetailScreen'
16 |
17 | const styles = StyleSheet.create({
18 | container: {
19 | alignItems: 'center',
20 | flex: 1,
21 | justifyContent: 'flex-end',
22 | },
23 | })
24 |
25 | export default DetailScreen
26 |
--------------------------------------------------------------------------------
/template/src/screens/HomeScreen.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { List } from '@ant-design/react-native'
3 | import { RouteType } from '~/routes/RouteType'
4 |
5 | const HomeScreen: React.FC> = ({ route, navigation }) => {
6 | return (
7 |
8 | {
10 | navigation.navigate('DetailScreen')
11 | }}
12 | arrow="horizontal"
13 | >
14 | Go DetailScreen
15 |
16 |
17 | )
18 | }
19 |
20 | export default HomeScreen
21 |
--------------------------------------------------------------------------------
/template/src/screens/MineScreen.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { StyleSheet, Text, View } from 'react-native'
3 | import { RouteType } from '~/routes/RouteType'
4 |
5 | type Props = RouteType<'MineScreen'>
6 |
7 | export default class MineScreen extends React.Component {
8 | constructor(props: Props) {
9 | super(props)
10 | }
11 |
12 | render() {
13 | return (
14 |
15 | MineScreen
16 |
17 | )
18 | }
19 | }
20 |
21 | const styles = StyleSheet.create({
22 | container: {
23 | alignItems: 'center',
24 | flex: 1,
25 | justifyContent: 'center',
26 | },
27 | })
28 |
--------------------------------------------------------------------------------
/template/src/views/HeaderButtons.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { HeaderButtons as RNHeaderButtons, HeaderButton as RNHeaderButton, Item } from 'react-navigation-header-buttons'
3 | import Icon from '../iconfont/Icon'
4 |
5 | const HeaderButton = props => {
6 | return
7 | }
8 |
9 | const HeaderButtons = props => {
10 | return
11 | }
12 |
13 | HeaderButtons.Item = Item
14 |
15 | export default HeaderButtons
16 |
--------------------------------------------------------------------------------
/template/src/views/IconWithBadge.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { View } from 'react-native'
3 | import { Badge } from '@ant-design/react-native'
4 |
5 | const IconWithBadge = ({ children, badgeCount, ...props }) => {
6 | return (
7 |
8 | {children}
9 |
10 |
11 | )
12 | }
13 |
14 | export default IconWithBadge
15 |
--------------------------------------------------------------------------------
/template/src/views/index.ts:
--------------------------------------------------------------------------------
1 | import HeaderButtons from './HeaderButtons'
2 |
3 | export {
4 | HeaderButtons
5 | }
6 |
7 | export default {
8 | HeaderButtons,
9 | }
10 |
--------------------------------------------------------------------------------
/template/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | /* Basic Options */
4 | "target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
5 | "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
6 | "lib": ["es6"] /* Specify library files to be included in the compilation. */,
7 | "allowJs": true /* Allow javascript files to be compiled. */,
8 | // "checkJs": true, /* Report errors in .js files. */
9 | "jsx": "react-native" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
10 | // "declaration": true, /* Generates corresponding '.d.ts' file. */
11 | // "sourceMap": true, /* Generates corresponding '.map' file. */
12 | // "outFile": "./", /* Concatenate and emit output to single file. */
13 | // "outDir": "./", /* Redirect output structure to the directory. */
14 | // "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
15 | // "removeComments": true, /* Do not emit comments to output. */
16 | "noEmit": true /* Do not emit outputs. */,
17 | // "incremental": true /* Enable incremental compilation */,
18 | // "importHelpers": true, /* Import emit helpers from 'tslib'. */
19 | // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
20 | "isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
21 |
22 | /* Strict Type-Checking Options */
23 | "strict": true /* Enable all strict type-checking options. */,
24 | "noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
25 | // "strictNullChecks": true, /* Enable strict null checks. */
26 | // "strictFunctionTypes": true, /* Enable strict checking of function types. */
27 | // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
28 | // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
29 | // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
30 |
31 | /* Additional Checks */
32 | // "noUnusedLocals": true, /* Report errors on unused locals. */
33 | // "noUnusedParameters": true, /* Report errors on unused parameters. */
34 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
35 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
36 |
37 | /* Module Resolution Options */
38 | "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
39 | "baseUrl": "./" /* Base directory to resolve non-absolute module names. */,
40 | "paths": {
41 | "~/*": ["src/*"]
42 | } /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */,
43 | // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
44 | // "typeRoots": [], /* List of folders to include type definitions from. */
45 | // "types": [], /* Type declaration files to be included in compilation. */
46 | "allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
47 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
48 | // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
49 |
50 | /* Source Map Options */
51 | // "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
52 | // "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
53 | // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
54 | // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
55 |
56 | /* Experimental Options */
57 | "experimentalDecorators": true /* Enables experimental support for ES7 decorators. */,
58 | "emitDecoratorMetadata": true /* Enables experimental support for emitting type metadata for decorators. */,
59 | "resolveJsonModule": true /* Allows for importing, extracting types from and generating .json files */,
60 | "skipLibCheck": true /* 忽略所有的声明文件( *.d.ts)的类型检查。 */
61 | },
62 | "exclude": ["node_modules", "babel.config.js", "metro.config.js", "jest.config.js"]
63 | }
64 |
--------------------------------------------------------------------------------
/template/types/global.d.ts:
--------------------------------------------------------------------------------
1 | declare const global: {
2 | HermesInternal: null | {}
3 | windowWidth: number
4 | windowHeight: number
5 | ios: boolean
6 | android: boolean
7 | isIphoneX: () => boolean
8 | getStatusBarHeight: () => number
9 | getBottomSpace: () => number
10 | navigation?: import('@react-navigation/native').NavigationContainerRef
11 | }
12 |
--------------------------------------------------------------------------------