@nebula-rn/cli 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +65 -0
  2. package/dist/create.js +12 -3
  3. package/package.json +20 -7
  4. package/templates/host/.eslintrc.js +7 -0
  5. package/templates/host/App.tsx +118 -0
  6. package/templates/host/Gemfile +16 -0
  7. package/templates/host/__tests__/App.test.tsx +13 -0
  8. package/templates/host/android/app/build.gradle +55 -0
  9. package/templates/host/android/app/debug.keystore +0 -0
  10. package/templates/host/android/app/proguard-rules.pro +10 -0
  11. package/templates/host/android/app/src/main/AndroidManifest.xml +54 -0
  12. package/templates/host/android/app/src/main/java/com/SuperApp/MainActivity.kt +28 -0
  13. package/templates/host/android/app/src/main/java/com/SuperApp/MainApplication.kt +35 -0
  14. package/templates/host/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  15. package/templates/host/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  16. package/templates/host/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  17. package/templates/host/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  18. package/templates/host/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  19. package/templates/host/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  20. package/templates/host/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  21. package/templates/host/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  22. package/templates/host/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  23. package/templates/host/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  24. package/templates/host/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  25. package/templates/host/android/app/src/main/res/values/strings.xml +3 -0
  26. package/templates/host/android/app/src/main/res/values/styles.xml +16 -0
  27. package/templates/host/android/build.gradle +21 -0
  28. package/templates/host/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  29. package/templates/host/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  30. package/templates/host/android/gradle.properties +44 -0
  31. package/templates/host/android/gradlew +251 -0
  32. package/templates/host/android/gradlew.bat +99 -0
  33. package/templates/host/android/settings.gradle +6 -0
  34. package/templates/host/app.json +4 -0
  35. package/templates/host/babel.config.js +4 -0
  36. package/templates/host/index.js +9 -0
  37. package/templates/host/ios/.xcode.env +11 -0
  38. package/templates/host/ios/Podfile +38 -0
  39. package/templates/host/ios/SuperApp/AppDelegate.swift +95 -0
  40. package/templates/host/ios/SuperApp/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  41. package/templates/host/ios/SuperApp/Images.xcassets/Contents.json +6 -0
  42. package/templates/host/ios/SuperApp/Info.plist +76 -0
  43. package/templates/host/ios/SuperApp/LaunchScreen.storyboard +47 -0
  44. package/templates/host/ios/SuperApp/PrivacyInfo.xcprivacy +48 -0
  45. package/templates/host/ios/SuperApp/SceneDelegate.swift +47 -0
  46. package/templates/host/ios/SuperApp/SuperApp-Bridging-Header.h +18 -0
  47. package/templates/host/ios/SuperApp-Bridging-Header.h +21 -0
  48. package/templates/host/ios/SuperApp.xcodeproj/project.pbxproj +500 -0
  49. package/templates/host/ios/SuperApp.xcodeproj/xcshareddata/xcschemes/RNTest.xcscheme +88 -0
  50. package/templates/host/jest.config.js +3 -0
  51. package/templates/host/metro.config.js +49 -0
  52. package/templates/host/package.json +66 -0
  53. package/templates/host/tsconfig.json +8 -0
  54. package/templates/miniapp/.watchmanconfig +1 -0
  55. package/templates/miniapp/app.json +12 -0
  56. package/templates/miniapp/babel.config.js +3 -0
  57. package/templates/miniapp/package.json +34 -0
  58. package/templates/miniapp/src/pages/home/index.tsx +122 -0
  59. package/templates/miniapp/src/pages/home/page.config.ts +10 -0
  60. package/templates/miniapp/tsconfig.json +11 -0
  61. package/templates/runner/.eslintrc.js +7 -0
  62. package/templates/runner/App.tsx +515 -0
  63. package/templates/runner/Gemfile +16 -0
  64. package/templates/runner/__tests__/App.test.tsx +13 -0
  65. package/templates/runner/android/app/build.gradle +55 -0
  66. package/templates/runner/android/app/debug.keystore +0 -0
  67. package/templates/runner/android/app/proguard-rules.pro +10 -0
  68. package/templates/runner/android/app/src/main/AndroidManifest.xml +60 -0
  69. package/templates/runner/android/app/src/main/java/com/devrunner/MainActivity.kt +14 -0
  70. package/templates/runner/android/app/src/main/java/com/devrunner/MainApplication.kt +35 -0
  71. package/templates/runner/android/app/src/main/res/drawable/rn_edit_text_material.xml +37 -0
  72. package/templates/runner/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
  73. package/templates/runner/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
  74. package/templates/runner/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
  75. package/templates/runner/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
  76. package/templates/runner/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
  77. package/templates/runner/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
  78. package/templates/runner/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
  79. package/templates/runner/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
  80. package/templates/runner/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
  81. package/templates/runner/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
  82. package/templates/runner/android/app/src/main/res/values/strings.xml +3 -0
  83. package/templates/runner/android/app/src/main/res/values/styles.xml +16 -0
  84. package/templates/runner/android/build.gradle +21 -0
  85. package/templates/runner/android/gradle/wrapper/gradle-wrapper.jar +0 -0
  86. package/templates/runner/android/gradle/wrapper/gradle-wrapper.properties +7 -0
  87. package/templates/runner/android/gradle.properties +44 -0
  88. package/templates/runner/android/gradlew +251 -0
  89. package/templates/runner/android/gradlew.bat +99 -0
  90. package/templates/runner/android/settings.gradle +6 -0
  91. package/templates/runner/app.json +4 -0
  92. package/templates/runner/babel.config.js +4 -0
  93. package/templates/runner/index.js +9 -0
  94. package/templates/runner/ios/.xcode.env +11 -0
  95. package/templates/runner/ios/DevRunner/AppDelegate.swift +53 -0
  96. package/templates/runner/ios/DevRunner/DevRunner-Bridging-Header.h +19 -0
  97. package/templates/runner/ios/DevRunner/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
  98. package/templates/runner/ios/DevRunner/Images.xcassets/Contents.json +6 -0
  99. package/templates/runner/ios/DevRunner/Info.plist +51 -0
  100. package/templates/runner/ios/DevRunner/LaunchScreen.storyboard +47 -0
  101. package/templates/runner/ios/DevRunner/PrivacyInfo.xcprivacy +48 -0
  102. package/templates/runner/ios/DevRunner/SceneDelegate.swift +21 -0
  103. package/templates/runner/ios/DevRunner-Bridging-Header.h +22 -0
  104. package/templates/runner/ios/DevRunner.xcodeproj/project.pbxproj +500 -0
  105. package/templates/runner/ios/DevRunner.xcodeproj/xcshareddata/xcschemes/DevRunner.xcscheme +88 -0
  106. package/templates/runner/ios/Podfile +38 -0
  107. package/templates/runner/jest.config.js +3 -0
  108. package/templates/runner/metro.config.js +3 -0
  109. package/templates/runner/package.json +38 -0
  110. package/templates/runner/src/RunnerHomeScreen.tsx +499 -0
  111. package/templates/runner/src/assets/icon_close.png +0 -0
  112. package/templates/runner/src/assets/icon_pic.png +0 -0
  113. package/templates/runner/src/runnerTypes.ts +31 -0
  114. package/templates/runner/tsconfig.json +8 -0
  115. package/templates/versions.json +6 -0
package/README.md ADDED
@@ -0,0 +1,65 @@
1
+ # @nebula-rn/cli
2
+
3
+ The command-line tool for [Nebula](https://github.com/Hector-Zhuang/nebula), an
4
+ enterprise-grade SuperApp framework for React Native. Scaffold host apps and
5
+ MiniApps, develop them against a universal Dev Runner, build production
6
+ bundles, and upload versions to Nebula Cloud.
7
+
8
+ > The bare npm name `nebula` belongs to an unrelated package. Always install
9
+ > and invoke the CLI via the `@nebula-rn/cli` package; the installed binary is
10
+ > named `nebula`.
11
+
12
+ ## Quick start
13
+
14
+ ```bash
15
+ # Scaffold a MiniApp
16
+ npx @nebula-rn/cli create miniapp my-miniapp
17
+ cd my-miniapp
18
+ npm install
19
+
20
+ # Develop with the universal Dev Runner
21
+ npx @nebula-rn/cli miniapp dev
22
+
23
+ # Build production bundles (iOS + Android) under build/
24
+ npx @nebula-rn/cli miniapp build
25
+ ```
26
+
27
+ You can also install it globally:
28
+
29
+ ```bash
30
+ npm install -g @nebula-rn/cli
31
+ nebula create host my-host
32
+ ```
33
+
34
+ ## Commands
35
+
36
+ | Command | Description |
37
+ |---|---|
38
+ | `nebula create host <name>` | Scaffold a native host project |
39
+ | `nebula create miniapp <name>` | Scaffold a pure-JS MiniApp project |
40
+ | `nebula create runner <name>` | Scaffold a development runner |
41
+ | `nebula miniapp dev` | Start Metro and launch the Dev Runner |
42
+ | `nebula miniapp build` | Build iOS and Android production bundles |
43
+ | `nebula miniapp upload` | Build and upload a version to Nebula Cloud |
44
+ | `nebula auth login` / `logout` | Authenticate against Nebula Cloud |
45
+ | `nebula config server` | Configure the Nebula Cloud API URL |
46
+
47
+ Scaffolding flags: `--app-id`, `--display-name`, `--bundle-id`, `--directory`.
48
+ Dev flags: `--platform ios|android`, `--no-runner`.
49
+
50
+ ## Requirements
51
+
52
+ - Node.js >= 20
53
+ - A React Native development environment (Xcode / Android Studio) for running
54
+ the Dev Runner
55
+
56
+ ## Documentation
57
+
58
+ - Getting started and guides:
59
+ https://github.com/Hector-Zhuang/nebula/tree/main/packages/nebula-docs/content/docs
60
+ - CLI reference:
61
+ https://github.com/Hector-Zhuang/nebula/blob/main/packages/nebula-docs/content/docs/reference/cli.mdx
62
+
63
+ ## License
64
+
65
+ Apache-2.0
package/dist/create.js CHANGED
@@ -36,6 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.createProject = createProject;
37
37
  const fs = __importStar(require("fs"));
38
38
  const path = __importStar(require("path"));
39
+ const PACKAGED_TEMPLATE_ROOT = path.resolve(__dirname, '../templates');
39
40
  const TEMPLATE_PACKAGE_ROOT = path.resolve(__dirname, '../../template');
40
41
  const TEXT_TEMPLATE_EXTENSIONS = new Set([
41
42
  '.js',
@@ -75,6 +76,10 @@ function readPackageVersion(packageDir) {
75
76
  return packageJson.version || '0.0.1';
76
77
  }
77
78
  function resolvePackageVersions() {
79
+ const packagedVersionsPath = path.join(PACKAGED_TEMPLATE_ROOT, 'versions.json');
80
+ if (fs.existsSync(packagedVersionsPath)) {
81
+ return JSON.parse(fs.readFileSync(packagedVersionsPath, 'utf8'));
82
+ }
78
83
  const packagesDir = path.resolve(__dirname, '../..');
79
84
  return {
80
85
  sdk: readPackageVersion(path.join(packagesDir, 'nebula-sdk')),
@@ -131,9 +136,13 @@ function ensureTargetDirectory(targetDir) {
131
136
  }
132
137
  }
133
138
  function getTemplateRoot(kind) {
134
- const templateRoot = path.join(TEMPLATE_PACKAGE_ROOT, kind);
135
- if (!fs.existsSync(templateRoot)) {
136
- fail(`Missing ${kind} template at ${templateRoot}`);
139
+ const candidates = [
140
+ path.join(PACKAGED_TEMPLATE_ROOT, kind),
141
+ path.join(TEMPLATE_PACKAGE_ROOT, kind),
142
+ ];
143
+ const templateRoot = candidates.find(candidate => fs.existsSync(candidate));
144
+ if (!templateRoot) {
145
+ fail(`Missing ${kind} template. Looked in: ${candidates.join(', ')}`);
137
146
  }
138
147
  return templateRoot;
139
148
  }
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@nebula-rn/cli",
3
- "version": "0.0.1",
3
+ "version": "0.1.0",
4
4
  "description": "Nebula CLI - build, bundle and upload mini-apps",
5
5
  "author": "Hector Zhuang",
6
- "license": "MIT",
6
+ "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",
9
9
  "url": "git+https://github.com/Hector-Zhuang/nebula.git",
@@ -13,17 +13,30 @@
13
13
  "url": "https://github.com/Hector-Zhuang/nebula/issues"
14
14
  },
15
15
  "homepage": "https://github.com/Hector-Zhuang/nebula/tree/main/packages/cli#readme",
16
- "keywords": ["nebula", "superapp", "miniapp", "cli"],
16
+ "keywords": [
17
+ "nebula",
18
+ "superapp",
19
+ "miniapp",
20
+ "cli"
21
+ ],
17
22
  "main": "./dist/cli.js",
18
23
  "types": "./dist/cli.d.ts",
19
24
  "bin": {
20
25
  "nebula": "./dist/cli.js"
21
26
  },
22
- "files": ["dist", "bin", "README.md"],
23
- "publishConfig": { "access": "public" },
27
+ "files": [
28
+ "dist",
29
+ "bin",
30
+ "templates",
31
+ "README.md"
32
+ ],
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
24
36
  "scripts": {
25
37
  "build": "tsc",
26
- "prepack": "npm run build"
38
+ "bundle:templates": "node scripts/copy-templates.mjs",
39
+ "prepack": "npm run build && npm run bundle:templates"
27
40
  },
28
41
  "dependencies": {
29
42
  "archiver": "^8.0.0"
@@ -31,4 +44,4 @@
31
44
  "devDependencies": {
32
45
  "@types/archiver": "^8.0.0"
33
46
  }
34
- }
47
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ parserOptions: {
3
+ babelOptions: {
4
+ configFile: __dirname + '/babel.config.js',
5
+ },
6
+ },
7
+ };
@@ -0,0 +1,118 @@
1
+ import React from 'react';
2
+ import { ScrollView, StyleSheet, Text, View } from 'react-native';
3
+ import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
4
+ import { defaultHostApis } from '@nebula-rn/host-apis';
5
+ import type { MiniappLoadingResolveContext } from '@nebula-rn/sdk';
6
+ import { NebulaAPI } from '@nebula-rn/sdk';
7
+
8
+ function DefaultMiniappLoadingScreen({
9
+ title,
10
+ appId,
11
+ status,
12
+ }: MiniappLoadingResolveContext) {
13
+ return (
14
+ <View style={styles.loadingOverlay}>
15
+ <View style={styles.loadingCard}>
16
+ <Text style={styles.loadingEyebrow}>Nebula</Text>
17
+ <Text style={styles.loadingTitle}>{title || appId}</Text>
18
+ <Text style={styles.loadingMessage}>
19
+ {status === 'installing'
20
+ ? 'Installing miniapp...'
21
+ : status === 'error'
22
+ ? 'Something went wrong while opening the miniapp.'
23
+ : 'Opening miniapp...'}
24
+ </Text>
25
+ </View>
26
+ </View>
27
+ );
28
+ }
29
+
30
+ function HostAppContent() {
31
+ return (
32
+ <SafeAreaProvider>
33
+ <SafeAreaView style={styles.screen}>
34
+ <ScrollView contentContainerStyle={styles.content}>
35
+ <Text style={styles.title}>Nebula Host Starter</Text>
36
+ <Text style={styles.subtitle}>
37
+ This starter is a clean Nebula host shell. Register your own host
38
+ APIs, connect Nebula Cloud, and decide how your host opens miniapps.
39
+ </Text>
40
+
41
+ <View style={styles.section}>
42
+ <Text style={styles.sectionTitle}>What is included</Text>
43
+ <Text style={styles.sectionBody}>• Nebula runtime wrapper</Text>
44
+ <Text style={styles.sectionBody}>
45
+ • Default host API set from @nebula-rn/host-apis
46
+ </Text>
47
+ <Text style={styles.sectionBody}>
48
+ • A minimal loading screen for miniapp startup
49
+ </Text>
50
+ </View>
51
+
52
+ <View style={styles.section}>
53
+ <Text style={styles.sectionTitle}>Next steps</Text>
54
+ <Text style={styles.sectionBody}>
55
+ 1. Configure serverBaseURL for Nebula Cloud
56
+ </Text>
57
+ <Text style={styles.sectionBody}>
58
+ 2. Register your own host APIs where needed
59
+ </Text>
60
+ <Text style={styles.sectionBody}>
61
+ 3. Open installed miniapps by appId or dev bundle URL
62
+ </Text>
63
+ </View>
64
+ </ScrollView>
65
+ </SafeAreaView>
66
+ </SafeAreaProvider>
67
+ );
68
+ }
69
+
70
+ export default NebulaAPI.wrap({
71
+ hostApis: [...defaultHostApis],
72
+ miniappLoading: {
73
+ component: DefaultMiniappLoadingScreen,
74
+ delayMs: 300,
75
+ enterContentDelayMs: 120,
76
+ },
77
+ })(HostAppContent);
78
+
79
+ const styles = StyleSheet.create({
80
+ screen: { flex: 1, backgroundColor: '#f8fafc' },
81
+ content: { padding: 20, gap: 16 },
82
+ title: { fontSize: 28, fontWeight: '700', color: '#0f172a' },
83
+ subtitle: { fontSize: 16, lineHeight: 24, color: '#475569' },
84
+ section: {
85
+ borderRadius: 18,
86
+ backgroundColor: '#ffffff',
87
+ borderWidth: 1,
88
+ borderColor: '#dbe4f0',
89
+ padding: 18,
90
+ gap: 8,
91
+ },
92
+ sectionTitle: { fontSize: 16, fontWeight: '700', color: '#0f172a' },
93
+ sectionBody: { fontSize: 14, lineHeight: 22, color: '#475569' },
94
+ loadingOverlay: {
95
+ flex: 1,
96
+ backgroundColor: 'rgba(15, 23, 42, 0.14)',
97
+ alignItems: 'center',
98
+ justifyContent: 'center',
99
+ padding: 24,
100
+ },
101
+ loadingCard: {
102
+ width: '100%',
103
+ maxWidth: 420,
104
+ borderRadius: 24,
105
+ backgroundColor: '#ffffff',
106
+ padding: 24,
107
+ gap: 10,
108
+ },
109
+ loadingEyebrow: {
110
+ fontSize: 12,
111
+ fontWeight: '700',
112
+ letterSpacing: 1.2,
113
+ color: '#2563eb',
114
+ textTransform: 'uppercase',
115
+ },
116
+ loadingTitle: { fontSize: 24, fontWeight: '700', color: '#0f172a' },
117
+ loadingMessage: { fontSize: 15, lineHeight: 22, color: '#475569' },
118
+ });
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4
+ ruby ">= 2.6.10"
5
+
6
+ # Exclude problematic versions of cocoapods and activesupport that causes build failures.
7
+ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8
+ gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9
+ gem 'xcodeproj', '< 1.26.0'
10
+ gem 'concurrent-ruby', '< 1.3.4'
11
+
12
+ # Ruby 3.4.0 has removed some libraries from the standard library.
13
+ gem 'bigdecimal'
14
+ gem 'logger'
15
+ gem 'benchmark'
16
+ gem 'mutex_m'
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @format
3
+ */
4
+
5
+ import React from 'react';
6
+ import ReactTestRenderer from 'react-test-renderer';
7
+ import App from '../App';
8
+
9
+ test('renders correctly', async () => {
10
+ await ReactTestRenderer.act(() => {
11
+ ReactTestRenderer.create(<App />);
12
+ });
13
+ });
@@ -0,0 +1,55 @@
1
+ apply plugin: "com.android.application"
2
+ apply plugin: "org.jetbrains.kotlin.android"
3
+ apply plugin: "com.facebook.react"
4
+
5
+ react {
6
+ autolinkLibrariesWithApp()
7
+ }
8
+
9
+ def enableProguardInReleaseBuilds = false
10
+ def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
11
+
12
+ android {
13
+ ndkVersion rootProject.ext.ndkVersion
14
+ buildToolsVersion rootProject.ext.buildToolsVersion
15
+ compileSdk rootProject.ext.compileSdkVersion
16
+
17
+ namespace "__BUNDLE_ID__"
18
+ defaultConfig {
19
+ applicationId "__BUNDLE_ID__"
20
+ minSdkVersion rootProject.ext.minSdkVersion
21
+ targetSdkVersion rootProject.ext.targetSdkVersion
22
+ versionCode 1
23
+ versionName "1.0"
24
+ manifestPlaceholders = [nebulaUrlScheme: "nebula"]
25
+ }
26
+ signingConfigs {
27
+ debug {
28
+ storeFile file('debug.keystore')
29
+ storePassword 'android'
30
+ keyAlias 'androiddebugkey'
31
+ keyPassword 'android'
32
+ }
33
+ }
34
+ buildTypes {
35
+ debug {
36
+ signingConfig signingConfigs.debug
37
+ }
38
+ release {
39
+ signingConfig signingConfigs.debug
40
+ minifyEnabled enableProguardInReleaseBuilds
41
+ proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
42
+ }
43
+ }
44
+ }
45
+
46
+ dependencies {
47
+ implementation("com.facebook.react:react-android")
48
+ implementation("androidx.appcompat:appcompat:1.7.1")
49
+
50
+ if (hermesEnabled.toBoolean()) {
51
+ implementation("com.facebook.react:hermes-android")
52
+ } else {
53
+ implementation jscFlavor
54
+ }
55
+ }
@@ -0,0 +1,10 @@
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:
@@ -0,0 +1,54 @@
1
+ <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2
+
3
+ <uses-permission android:name="android.permission.INTERNET" />
4
+ <uses-permission android:name="android.permission.CAMERA" />
5
+ <uses-permission android:name="android.permission.DETECT_SCREEN_CAPTURE" />
6
+ <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
7
+ <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
8
+ <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
9
+ <uses-permission android:name="android.permission.READ_MEDIA_VIDEO" />
10
+ <uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
11
+ <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
12
+ <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
13
+
14
+ <application
15
+ android:name=".MainApplication"
16
+ android:label="@string/app_name"
17
+ android:icon="@mipmap/ic_launcher"
18
+ android:roundIcon="@mipmap/ic_launcher_round"
19
+ android:allowBackup="false"
20
+ android:theme="@style/AppTheme"
21
+ android:usesCleartextTraffic="${usesCleartextTraffic}"
22
+ android:supportsRtl="true">
23
+ <activity
24
+ android:name=".MainActivity"
25
+ android:label="@string/app_name"
26
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
27
+ android:launchMode="singleTask"
28
+ android:windowSoftInputMode="adjustResize"
29
+ android:exported="true">
30
+ <intent-filter>
31
+ <action android:name="android.intent.action.MAIN" />
32
+ <category android:name="android.intent.category.LAUNCHER" />
33
+ </intent-filter>
34
+ <intent-filter>
35
+ <action android:name="android.intent.action.VIEW" />
36
+ <category android:name="android.intent.category.DEFAULT" />
37
+ <category android:name="android.intent.category.BROWSABLE" />
38
+ <data android:scheme="${nebulaUrlScheme}" android:host="review" android:pathPrefix="/install/" />
39
+ <data android:scheme="${nebulaUrlScheme}" android:host="miniapp" android:pathPrefix="/install/" />
40
+ </intent-filter>
41
+ </activity>
42
+ <activity
43
+ android:name="com.hectorzhuang.nebula.NebulaActivity"
44
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
45
+ android:windowSoftInputMode="adjustResize"
46
+ android:exported="false" />
47
+ <activity
48
+ android:name="com.hectorzhuang.nebula.NebulaHostModalActivity"
49
+ android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
50
+ android:theme="@style/NebulaHostModalTheme"
51
+ android:windowSoftInputMode="adjustResize"
52
+ android:exported="false" />
53
+ </application>
54
+ </manifest>
@@ -0,0 +1,28 @@
1
+ package com.SuperApp
2
+
3
+ import android.content.Intent
4
+ import android.os.Bundle
5
+ import com.facebook.react.ReactActivity
6
+ import com.facebook.react.ReactActivityDelegate
7
+ import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
8
+ import com.facebook.react.defaults.DefaultReactActivityDelegate
9
+ import com.hectorzhuang.nebula.NebulaHost
10
+
11
+ class MainActivity : ReactActivity() {
12
+
13
+ override fun getMainComponentName(): String = "__COMPONENT_NAME__"
14
+
15
+ override fun createReactActivityDelegate(): ReactActivityDelegate =
16
+ DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
17
+
18
+ override fun onCreate(savedInstanceState: Bundle?) {
19
+ super.onCreate(savedInstanceState)
20
+ NebulaHost.handleIncomingUrl(this, intent?.data)
21
+ }
22
+
23
+ override fun onNewIntent(intent: Intent) {
24
+ super.onNewIntent(intent)
25
+ setIntent(intent)
26
+ NebulaHost.handleIncomingUrl(this, intent.data)
27
+ }
28
+ }
@@ -0,0 +1,35 @@
1
+ package com.SuperApp
2
+
3
+ import android.app.Application
4
+ import com.hectorzhuang.nebula.NebulaHost
5
+ import com.hectorzhuang.nebula.NebulaHostDelegate
6
+ import com.facebook.react.PackageList
7
+ import com.facebook.react.ReactApplication
8
+ import com.facebook.react.ReactHost
9
+ import com.facebook.react.ReactPackage
10
+ import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
11
+ import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
12
+
13
+ class MainApplication : Application(), ReactApplication {
14
+
15
+ override val reactHost: ReactHost by lazy {
16
+ getDefaultReactHost(
17
+ context = applicationContext,
18
+ packageList = PackageList(this).packages,
19
+ )
20
+ }
21
+
22
+ override fun onCreate() {
23
+ super.onCreate()
24
+ loadReactNative(this)
25
+ NebulaHost.initialize(
26
+ this,
27
+ object : NebulaHostDelegate {
28
+ override fun isDebugBuild(): Boolean = BuildConfig.DEBUG
29
+
30
+ override fun createMiniAppPackages(application: Application): List<ReactPackage> =
31
+ PackageList(this@MainApplication).packages
32
+ },
33
+ )
34
+ }
35
+ }
@@ -0,0 +1,37 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Copyright (C) 2014 The Android Open Source Project
3
+
4
+ Licensed under the Apache License, Version 2.0 (the "License");
5
+ you may not use this file except in compliance with the License.
6
+ You may obtain a copy of the License at
7
+
8
+ http://www.apache.org/licenses/LICENSE-2.0
9
+
10
+ Unless required by applicable law or agreed to in writing, software
11
+ distributed under the License is distributed on an "AS IS" BASIS,
12
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ See the License for the specific language governing permissions and
14
+ limitations under the License.
15
+ -->
16
+ <inset xmlns:android="http://schemas.android.com/apk/res/android"
17
+ android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
18
+ android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
19
+ android:insetTop="@dimen/abc_edit_text_inset_top_material"
20
+ android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21
+ >
22
+
23
+ <selector>
24
+ <!--
25
+ This file is a copy of abc_edit_text_material (https://bit.ly/3k8fX7I).
26
+ The item below with state_pressed="false" and state_focused="false" causes a NullPointerException.
27
+ NullPointerException:tempt to invoke virtual method 'android.graphics.drawable.Drawable android.graphics.drawable.Drawable$ConstantState.newDrawable(android.content.res.Resources)'
28
+
29
+ <item android:state_pressed="false" android:state_focused="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
30
+
31
+ For more info, see https://bit.ly/3CdLStv (react-native/pull/29452) and https://bit.ly/3nxOMoR.
32
+ -->
33
+ <item android:state_enabled="false" android:drawable="@drawable/abc_textfield_default_mtrl_alpha"/>
34
+ <item android:drawable="@drawable/abc_textfield_activated_mtrl_alpha"/>
35
+ </selector>
36
+
37
+ </inset>
@@ -0,0 +1,3 @@
1
+ <resources>
2
+ <string name="app_name">__DISPLAY_NAME__</string>
3
+ </resources>
@@ -0,0 +1,16 @@
1
+ <resources>
2
+
3
+ <!-- Base application theme. -->
4
+ <style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
5
+ <!-- Customize your theme here. -->
6
+ <item name="android:editTextBackground">@drawable/rn_edit_text_material</item>
7
+ </style>
8
+
9
+ <style name="NebulaHostModalTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
10
+ <item name="android:windowIsTranslucent">true</item>
11
+ <item name="android:windowBackground">@android:color/transparent</item>
12
+ <item name="android:backgroundDimEnabled">false</item>
13
+ <item name="android:windowAnimationStyle">@null</item>
14
+ </style>
15
+
16
+ </resources>
@@ -0,0 +1,21 @@
1
+ buildscript {
2
+ ext {
3
+ buildToolsVersion = "36.0.0"
4
+ minSdkVersion = 24
5
+ compileSdkVersion = 36
6
+ targetSdkVersion = 36
7
+ ndkVersion = "27.1.12297006"
8
+ kotlinVersion = "2.1.20"
9
+ }
10
+ repositories {
11
+ google()
12
+ mavenCentral()
13
+ }
14
+ dependencies {
15
+ classpath("com.android.tools.build:gradle")
16
+ classpath("com.facebook.react:react-native-gradle-plugin")
17
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
18
+ }
19
+ }
20
+
21
+ apply plugin: "com.facebook.react.rootproject"
@@ -0,0 +1,7 @@
1
+ distributionBase=GRADLE_USER_HOME
2
+ distributionPath=wrapper/dists
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
4
+ networkTimeout=10000
5
+ validateDistributionUrl=true
6
+ zipStoreBase=GRADLE_USER_HOME
7
+ zipStorePath=wrapper/dists