@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
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "__PACKAGE_NAME__",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "description": "__DISPLAY_NAME__ Nebula host application",
6
+ "scripts": {
7
+ "android": "react-native run-android",
8
+ "ios": "react-native run-ios",
9
+ "start": "react-native start",
10
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
11
+ },
12
+ "dependencies": {
13
+ "@nebula-rn/host": "^__NEBULA_HOST_VERSION__",
14
+ "@nebula-rn/host-apis": "^__NEBULA_HOST_APIS_VERSION__",
15
+ "@nebula-rn/sdk": "^__NEBULA_SDK_VERSION__",
16
+ "@nebula-rn/components": "^__NEBULA_SDK_VERSION__",
17
+ "@react-native-camera-roll/camera-roll": "^7.10.2",
18
+ "@react-native-clipboard/clipboard": "^1.16.3",
19
+ "@react-native-community/geolocation": "^3.4.0",
20
+ "@react-native-community/netinfo": "^12.0.1",
21
+ "@react-native-community/slider": "5.1.2",
22
+ "@react-native-picker/picker": "2.11.4",
23
+ "react": "19.2.0",
24
+ "react-native": "0.83.1",
25
+ "react-native-device-info": "^15.0.2",
26
+ "react-native-gesture-handler": "^2.30.0",
27
+ "react-native-image-zoom-viewer": "^3.0.1",
28
+ "react-native-maps": "1.26.1",
29
+ "react-native-mmkv": "^4.2.0",
30
+ "react-native-nitro-modules": "^0.35.2",
31
+ "react-native-reanimated": "~4.2.3",
32
+ "react-native-reanimated-carousel": "^4.0.3",
33
+ "react-native-safe-area-context": "^5.5.2",
34
+ "react-native-svg": "^15.3.0",
35
+ "react-native-video": "^6.19.1",
36
+ "react-native-vision-camera": "^4.7.3",
37
+ "react-native-webview": "13.16.1",
38
+ "react-native-worklets": "~0.8.1",
39
+ "@bam.tech/react-native-image-resizer": "^3.0.11",
40
+ "dpdm": "^3.14.0",
41
+ "react-native-root-siblings": "^5.0.1",
42
+ "@dr.pogodin/react-native-fs": "^2.37.0",
43
+ "base64-js": "^1.5.1",
44
+ "react-native-image-picker": "^8.2.1",
45
+ "react-native-screenshot-aware": "^2.0.0",
46
+ "react-native-sensors": "^7.3.6"
47
+ },
48
+ "devDependencies": {
49
+ "@babel/core": "^7.25.2",
50
+ "@babel/preset-env": "^7.25.3",
51
+ "@babel/runtime": "^7.25.0",
52
+ "@react-native-community/cli": "20.0.0",
53
+ "@react-native-community/cli-platform-android": "20.0.0",
54
+ "@react-native-community/cli-platform-ios": "20.0.0",
55
+ "@react-native/babel-preset": "0.83.1",
56
+ "@react-native/eslint-config": "0.83.1",
57
+ "@react-native/metro-config": "0.83.1",
58
+ "@react-native/typescript-config": "0.83.1",
59
+ "@types/react": "^19.2.0",
60
+ "eslint": "^8.19.0",
61
+ "typescript": "^5.8.3"
62
+ },
63
+ "engines": {
64
+ "node": ">=20"
65
+ }
66
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "@react-native/typescript-config",
3
+ "compilerOptions": {
4
+ "types": ["jest"],
5
+ },
6
+ "include": ["**/*.ts", "**/*.tsx"],
7
+ "exclude": ["**/node_modules", "**/Pods"]
8
+ }
@@ -0,0 +1 @@
1
+ {}
@@ -0,0 +1,12 @@
1
+ {
2
+ "appId": "__APP_ID__",
3
+ "updateStrategy": "manual",
4
+ "pages": ["home"],
5
+ "entryPagePath": "/home",
6
+ "window": {
7
+ "backgroundColor": "#f8fafc",
8
+ "navigationBarBackgroundColor": "#ffffff",
9
+ "navigationBarTextColor": "#0f172a",
10
+ "visualEffectInBackground": "none"
11
+ }
12
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ['module:@react-native/babel-preset'],
3
+ };
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "__PACKAGE_NAME__",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "description": "__DISPLAY_NAME__ Nebula miniapp",
6
+ "scripts": {
7
+ "dev": "nebula miniapp dev",
8
+ "build": "nebula miniapp build",
9
+ "upload": "nebula miniapp upload",
10
+ "lint": "eslint src --ext .ts,.tsx",
11
+ "typecheck": "tsc --noEmit"
12
+ },
13
+ "dependencies": {
14
+ "@nebula-rn/client": "^__NEBULA_CLIENT_VERSION__",
15
+ "@nebula-rn/sdk": "^__NEBULA_SDK_VERSION__",
16
+ "react": "19.2.0",
17
+ "react-native": "0.83.1"
18
+ },
19
+ "devDependencies": {
20
+ "@react-native-community/cli": "20.0.0",
21
+ "@react-native-community/cli-platform-android": "20.0.0",
22
+ "@react-native-community/cli-platform-ios": "20.0.0",
23
+ "@react-native/babel-preset": "0.83.1",
24
+ "@react-native/eslint-config": "0.83.1",
25
+ "@react-native/metro-config": "0.83.1",
26
+ "@react-native/typescript-config": "0.83.1",
27
+ "@types/react": "^19.2.0",
28
+ "eslint": "^8.19.0",
29
+ "typescript": "^5.8.3"
30
+ },
31
+ "engines": {
32
+ "node": ">=20"
33
+ }
34
+ }
@@ -0,0 +1,122 @@
1
+ import React, { useState } from 'react';
2
+ import {
3
+ Alert,
4
+ Button,
5
+ ScrollView,
6
+ StyleSheet,
7
+ Text,
8
+ View,
9
+ } from 'react-native';
10
+ import { Miniapp, usePageOnLoad } from '@nebula-rn/sdk';
11
+
12
+ export default function HomePage() {
13
+ const [result, setResult] = useState('Ready');
14
+
15
+ usePageOnLoad(params => {
16
+ setResult(`Loaded __APP_ID__ with params: ${JSON.stringify(params)}`);
17
+ });
18
+
19
+ const showToast = async () => {
20
+ await Miniapp.showToast('Nebula miniapp starter is running');
21
+ Alert.alert(
22
+ 'Toast Triggered',
23
+ 'Check the connected runner or host output.',
24
+ );
25
+ };
26
+
27
+ const showHostInfo = async () => {
28
+ setResult(
29
+ [
30
+ 'This starter is intentionally minimal.',
31
+ 'Use built-in miniapp APIs immediately in Dev Runner or a connected host.',
32
+ 'Add custom Host APIs only when your host actually provides them.',
33
+ ].join('\n'),
34
+ );
35
+ };
36
+
37
+ return (
38
+ <ScrollView contentContainerStyle={styles.content}>
39
+ <Text style={styles.eyebrow}>Nebula Miniapp</Text>
40
+ <Text style={styles.title}>Nebula Miniapp Starter</Text>
41
+ <Text style={styles.subtitle}>
42
+ This starter only contains miniapp code. Keep the miniapp pure, and let
43
+ the host or runner provide native capabilities.
44
+ </Text>
45
+
46
+ <View style={styles.actions}>
47
+ <Button
48
+ title="Trigger toast helper"
49
+ onPress={() => showToast().catch(handleError)}
50
+ />
51
+ <View style={styles.spacer} />
52
+ <Button
53
+ title="Explain starter"
54
+ onPress={() => showHostInfo().catch(handleError)}
55
+ />
56
+ </View>
57
+
58
+ <Text style={styles.resultLabel}>Last Result</Text>
59
+ <View style={styles.resultCard}>
60
+ <Text style={styles.resultText}>{result}</Text>
61
+ </View>
62
+ </ScrollView>
63
+ );
64
+ }
65
+
66
+ function handleError(error: unknown) {
67
+ console.error('[Nebula] Miniapp action failed', error);
68
+ Alert.alert(
69
+ 'Action Failed',
70
+ error instanceof Error
71
+ ? error.message
72
+ : 'Unexpected miniapp development error.',
73
+ );
74
+ }
75
+
76
+ const styles = StyleSheet.create({
77
+ content: {
78
+ padding: 24,
79
+ gap: 14,
80
+ },
81
+ eyebrow: {
82
+ fontSize: 12,
83
+ fontWeight: '700',
84
+ letterSpacing: 1.1,
85
+ color: '#2563eb',
86
+ textTransform: 'uppercase',
87
+ },
88
+ title: {
89
+ fontSize: 30,
90
+ fontWeight: '700',
91
+ color: '#0f172a',
92
+ },
93
+ subtitle: {
94
+ fontSize: 16,
95
+ lineHeight: 24,
96
+ color: '#475569',
97
+ },
98
+ actions: {
99
+ marginTop: 8,
100
+ },
101
+ spacer: {
102
+ height: 12,
103
+ },
104
+ resultLabel: {
105
+ marginTop: 18,
106
+ fontSize: 14,
107
+ fontWeight: '600',
108
+ color: '#1e293b',
109
+ },
110
+ resultCard: {
111
+ borderRadius: 16,
112
+ backgroundColor: '#ffffff',
113
+ borderWidth: 1,
114
+ borderColor: '#dbe4f0',
115
+ padding: 16,
116
+ },
117
+ resultText: {
118
+ color: '#0f172a',
119
+ lineHeight: 22,
120
+ fontFamily: 'Courier',
121
+ },
122
+ });
@@ -0,0 +1,10 @@
1
+ import { definePageConfig } from '@nebula-rn/sdk';
2
+
3
+ export default definePageConfig({
4
+ route: '/home',
5
+ navigationBarTitleText: 'Home',
6
+ navigationBarBackgroundColor: '#ffffff',
7
+ navigationBarTextColor: '#0f172a',
8
+ backgroundColor: '#f8fafc',
9
+ visualEffectInBackground: 'none',
10
+ });
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "@react-native/typescript-config",
3
+ "compilerOptions": {
4
+ "jsx": "react-jsx",
5
+ "strict": true
6
+ },
7
+ "include": [
8
+ "src/**/*.ts",
9
+ "src/**/*.tsx"
10
+ ]
11
+ }
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ parserOptions: {
3
+ babelOptions: {
4
+ configFile: __dirname + '/babel.config.js',
5
+ },
6
+ },
7
+ };