Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions after_init.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

const fs = require("fs");

fs.rename("_ondevice", ".ondevice", function (err) {
fs.rename("_rnstorybook", ".rnstorybook", function (err) {
if (err) {
throw err;
} else {
console.log("\nSuccessfully configured the ondevice folder!");
console.log("\nSuccessfully configured the rnstorybook folder!");
}
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-template-storybook",
"version": "1.0.8",
"version": "2.0.4",
"description": "React Native template for a quick start with storybook.",
"scripts": {
"test": "exit 0"
Expand Down
2 changes: 1 addition & 1 deletion template/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function App() {
let AppEntryPoint = App;

if (process.env.STORYBOOK_ENABLED) {
AppEntryPoint = require("./.ondevice").default;
AppEntryPoint = require("./.rnstorybook").default;
}

export default AppEntryPoint;
8 changes: 8 additions & 0 deletions template/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,11 @@ ruby ">= 2.6.10"
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'

# Ruby 3.4.0 has removed some libraries from the standard library.
gem 'bigdecimal'
gem 'logger'
gem 'benchmark'
gem 'mutex_m'
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* do not change this file, it is auto generated by storybook. */

import { start, updateView } from "@storybook/react-native";

import "@storybook/addon-ondevice-notes/register";
Expand Down Expand Up @@ -29,8 +30,8 @@ declare global {

const annotations = [
require("./preview"),
require("@storybook/react-native/dist/preview"),
require("@storybook/addon-actions/preview"),
require("@storybook/react-native/preview"),
require("@storybook/addon-ondevice-actions/preview"),
];

global.STORIES = normalizedStories;
Expand Down
24 changes: 7 additions & 17 deletions template/_storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,16 @@
/** @type{import("@storybook/react-webpack5").StorybookConfig} */
module.exports = {
stories: [
"../components/**/*.stories.mdx",
"../components/**/*.stories.@(js|jsx|ts|tsx)",
],

addons: [
"@storybook/addon-links",
"@storybook/addon-essentials",
"@storybook/addon-webpack5-compiler-babel",
"@chromatic-com/storybook",
"@storybook/addon-react-native-web",
],

stories: ['../components/**/*.stories.?(ts|tsx|js|jsx)'],
addons: ['@storybook/addon-essentials'],
framework: {
name: "@storybook/react-webpack5",
name: '@storybook/react-native-web-vite',
options: {},
},

docs: {},
docs: {
autodocs: true,
},

typescript: {
reactDocgen: "react-docgen-typescript",
reactDocgen: 'react-docgen',
},
};
4 changes: 2 additions & 2 deletions template/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,14 @@ def enableProguardInReleaseBuilds = false
* The preferred build flavor of JavaScriptCore (JSC)
*
* For example, to use the international variant, you can use:
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
*
* The international variant includes ICU i18n library and necessary data
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
* give correct results when using with locales other than en-US. Note that
* this variant is about 6MiB larger per architecture than default.
*/
def jscFlavor = 'org.webkit:android-jsc:+'
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'

android {
ndkVersion rootProject.ext.ndkVersion
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader

class MainApplication : Application(), ReactApplication {
Expand All @@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {

override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()
Expand Down
12 changes: 6 additions & 6 deletions template/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.24"
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 35
ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion template/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
Binary file modified template/android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion template/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 4 additions & 2 deletions template/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -203,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
2 changes: 2 additions & 0 deletions template/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
4 changes: 2 additions & 2 deletions template/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// stories/MyButton.stories.tsx
import type {Meta, StoryObj} from '@storybook/react';
import {action} from '@storybook/addon-actions';
import {fn} from '@storybook/test';
import {MyButton} from './Button';

const meta = {
Expand All @@ -16,6 +16,6 @@ export const Basic: Story = {
args: {
text: 'Hello World',
color: 'purple',
onPress: action('onPress'),
onPress: fn(),
},
};
Loading