Skip to content

Commit 12c3f4b

Browse files
authored
v8 (#10)
* v8 * 1.0.5-0 * fix * 1.0.6-0 * fix * fix * fix * 1.0.7-0 * fix * 1.0.8-0
1 parent 7d95877 commit 12c3f4b

28 files changed

+228
-156
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-template-storybook",
3-
"version": "1.0.4",
3+
"version": "1.0.8-0",
44
"description": "React Native template for a quick start with storybook.",
55
"scripts": {
66
"test": "exit 0"

template.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = {
22
placeholderName: "HelloWorld",
3+
titlePlaceholder: "Hello App Display Name",
34
templateDir: "./template",
45
postInitScript: "./after_init.js",
56
};

template/Gemfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.13'
7-
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
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'

template/__tests__/App-test.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

template/__tests__/App.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @format
3+
*/
4+
5+
import 'react-native';
6+
import React from 'react';
7+
import App from '../App';
8+
9+
// Note: import explicitly to use the types shipped with jest.
10+
import {it} from '@jest/globals';
11+
12+
// Note: test renderer must be required after react-native.
13+
import renderer from 'react-test-renderer';
14+
15+
it('renders correctly', () => {
16+
renderer.create(<App />);
17+
});

template/_gitignore

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
ios/.xcode.env.local
23+
**/.xcode.env.local
2424

2525
# Android/IntelliJ
2626
#
@@ -56,11 +56,19 @@ yarn-error.log
5656
*.jsbundle
5757

5858
# Ruby / CocoaPods
59-
/ios/Pods/
59+
**/Pods/
6060
/vendor/bundle/
6161

6262
# Temporary files created by Metro to check the health of the file watcher
6363
.metro-health-check*
6464

6565
# testing
6666
/coverage
67+
68+
# Yarn
69+
.yarn/*
70+
!.yarn/patches
71+
!.yarn/plugins
72+
!.yarn/releases
73+
!.yarn/sdks
74+
!.yarn/versions

template/_ondevice/storybook.requires.ts

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/* do not change this file, it is auto generated by storybook. */
2-
3-
import { start } from "@storybook/react-native";
2+
import { start, updateView } from "@storybook/react-native";
43

54
import "@storybook/addon-ondevice-notes/register";
65
import "@storybook/addon-ondevice-controls/register";
@@ -23,14 +22,29 @@ const normalizedStories = [
2322
},
2423
];
2524

26-
// @ts-ignore
25+
declare global {
26+
var view: ReturnType<typeof start>;
27+
var STORIES: typeof normalizedStories;
28+
}
29+
30+
const annotations = [
31+
require("./preview"),
32+
require("@storybook/react-native/dist/preview"),
33+
require("@storybook/addon-actions/preview"),
34+
];
35+
2736
global.STORIES = normalizedStories;
2837

29-
export const view = start({
30-
annotations: [
31-
require("./preview"),
32-
require("@storybook/react-native/dist/preview"),
33-
require("@storybook/addon-actions/preview"),
34-
],
35-
storyEntries: normalizedStories,
36-
});
38+
// @ts-ignore
39+
module?.hot?.accept?.();
40+
41+
if (!global.view) {
42+
global.view = start({
43+
annotations,
44+
storyEntries: normalizedStories,
45+
});
46+
} else {
47+
updateView(global.view, annotations, normalizedStories);
48+
}
49+
50+
export const view = global.view;

template/_storybook/main.ts

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
/** @type{import("@storybook/react-webpack5").StorybookConfig} */
22
module.exports = {
3-
stories: ['../components/**/*.stories.?(ts|tsx|js|jsx)'],
3+
stories: [
4+
"../components/**/*.stories.mdx",
5+
"../components/**/*.stories.@(js|jsx|ts|tsx)",
6+
],
7+
48
addons: [
5-
'@storybook/addon-links',
6-
'@storybook/addon-essentials',
7-
'@storybook/addon-react-native-web',
9+
"@storybook/addon-links",
10+
"@storybook/addon-essentials",
11+
"@storybook/addon-webpack5-compiler-babel",
12+
"@chromatic-com/storybook",
13+
"@storybook/addon-react-native-web",
814
],
15+
916
framework: {
10-
name: '@storybook/react-webpack5',
17+
name: "@storybook/react-webpack5",
1118
options: {},
1219
},
13-
docs: {
14-
autodocs: true,
20+
21+
docs: {},
22+
23+
typescript: {
24+
reactDocgen: "react-docgen-typescript",
1525
},
1626
};

template/android/app/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
88
*/
99
react {
1010
/* Folders */
11-
// The root of your project, i.e. where "package.json" lives. Default is '..'
12-
// root = file("../")
13-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
14-
// reactNativeDir = file("../node_modules/react-native")
15-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16-
// codegenDir = file("../node_modules/@react-native/codegen")
17-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18-
// cliFile = file("../node_modules/react-native/cli.js")
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
1919

2020
/* Variants */
2121
// The list of variants to that are debuggable. For those we're going to
@@ -49,6 +49,9 @@ react {
4949
//
5050
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5151
// hermesFlags = ["-O", "-output-source-map"]
52+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
5255
}
5356

5457
/**
@@ -107,13 +110,10 @@ android {
107110
dependencies {
108111
// The version of react-native is set by the React Native Gradle Plugin
109112
implementation("com.facebook.react:react-android")
110-
implementation("com.facebook.react:flipper-integration")
111113

112114
if (hermesEnabled.toBoolean()) {
113115
implementation("com.facebook.react:hermes-android")
114116
} else {
115117
implementation jscFlavor
116118
}
117119
}
118-
119-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

template/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
android:icon="@mipmap/ic_launcher"
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
11-
android:theme="@style/AppTheme">
11+
android:theme="@style/AppTheme"
12+
android:supportsRtl="true">
1213
<activity
1314
android:name=".MainActivity"
1415
android:label="@string/app_name"

0 commit comments

Comments
 (0)