Skip to content

Commit 759c239

Browse files
committed
Switch to Yarn workspaces
1 parent 17d5165 commit 759c239

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+8669
-11471
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ build
88
# Ignore lock files in examples for now
99
examples/**/yarn.lock
1010
.docusaurus
11+
12+
.expo

.prettierrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// added for Jest inline snapshots to not use default Prettier config
22
module.exports = {
33
singleQuote: true,
4-
trailingComma: "es5"
5-
}
4+
trailingComma: 'es5',
5+
};
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1-
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
1+
module.exports = function (api) {
2+
api.cache(true);
3+
return {
4+
presets: ['babel-preset-expo'],
5+
};
36
};

examples/reactnavigation/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import registerRootComponent from 'expo/build/launch/registerRootComponent';
2+
3+
import App from './src/App';
4+
5+
// registerRootComponent calls AppRegistry.registerComponent('main', () => App);
6+
// It also ensures that whether you load the app in the Expo client or in a native build,
7+
// the environment is set up appropriately
8+
registerRootComponent(App);

examples/reactnavigation/jest.config.js

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

examples/reactnavigation/package.json

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,44 @@
22
"name": "react-navigation-example",
33
"description": "Testing React Navigation with RNTL",
44
"version": "0.0.1",
5-
"private": true,
5+
"private": false,
6+
"main": "./index.js",
67
"scripts": {
8+
"start": "expo start",
9+
"android": "expo start --android",
10+
"ios": "expo start --ios",
11+
"eject": "expo eject",
712
"test": "jest"
813
},
914
"dependencies": {
10-
"@react-native-community/masked-view": "^0.1.9",
11-
"@react-navigation/native": "^5.1.6",
12-
"@react-navigation/stack": "^5.2.13",
13-
"prop-types": "^15.7.2",
14-
"react": "^16.13.1",
15-
"react-native": "^0.62.2",
16-
"react-native-gesture-handler": "^1.6.1",
17-
"react-native-reanimated": "^1.8.0",
18-
"react-native-safe-area-context": "^0.7.3",
19-
"react-native-screens": "^2.5.0"
15+
"@react-native-community/masked-view": "^0.1.10",
16+
"@react-navigation/native": "^5.7.3",
17+
"@react-navigation/stack": "^5.9.0",
18+
"expo": "~38.0.8",
19+
"expo-status-bar": "^1.0.2",
20+
"react": "*",
21+
"react-native": "*",
22+
"react-native-gesture-handler": "^1.7.0",
23+
"react-native-reanimated": "^1.13.0",
24+
"react-native-safe-area-context": "^3.1.4",
25+
"react-native-screens": "^2.10.1"
2026
},
2127
"devDependencies": {
22-
"@babel/core": "^7.9.0",
28+
"@babel/core": "^7.8.6",
2329
"@babel/runtime": "^7.9.2",
24-
"babel-jest": "^25.4.0",
25-
"jest": "^25.4.0",
26-
"metro-react-native-babel-preset": "^0.59.0",
27-
"@testing-library/react-native": "^7.0.0-rc.0",
28-
"react-test-renderer": "^16.13.1"
30+
"@testing-library/react-native": "*",
31+
"babel-jest": "*",
32+
"babel-preset-expo": "~8.1.0",
33+
"jest": "*",
34+
"react-test-renderer": "*"
35+
},
36+
"jest": {
37+
"preset": "react-native",
38+
"setupFiles": [
39+
"../../node_modules/react-native-gesture-handler/jestSetup.js"
40+
],
41+
"transformIgnorePatterns": [
42+
"node_modules/(?!(jest-)?react-native|@react-native-community|@react-navigation)"
43+
]
2944
}
3045
}
1.43 KB
642 Bytes
9.09 KB

examples/redux/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = function (api) {
22
api.cache(true);
33
return {
4-
presets: ['module:metro-react-native-babel-preset'],
4+
presets: ['babel-preset-expo'],
55
};
66
};

examples/redux/components/TodoList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { FlatList, Text } from 'react-native';
2+
import { FlatList } from 'react-native';
33
import { connect } from 'react-redux';
44
import { bindActionCreators } from 'redux';
55
import { removeTodo } from '../actions/todoActions';

examples/redux/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { registerRootComponent } from 'expo';
1+
import registerRootComponent from 'expo/build/launch/registerRootComponent';
22

33
import App from './App';
44

examples/redux/package.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,30 @@
22
"name": "redux-example",
33
"description": "Testing Redux interactions with RNTL",
44
"version": "0.0.1",
5+
"main": "./index.js",
56
"scripts": {
7+
"start": "expo start",
8+
"android": "expo start --android",
9+
"ios": "expo start --ios",
10+
"eject": "expo eject",
611
"test": "jest"
712
},
813
"dependencies": {
9-
"react": "~16.9.0",
10-
"react-native": "~0.61.5",
14+
"expo": "~38.0.8",
15+
"expo-status-bar": "^1.0.2",
16+
"react": "*",
17+
"react-native": "*",
1118
"react-redux": "^7.2.0",
1219
"redux": "^4.0.5"
1320
},
1421
"devDependencies": {
1522
"@babel/core": "^7.8.6",
16-
"babel-jest": "~25.2.6",
17-
"jest": "~25.2.6",
18-
"metro-react-native-babel-preset": "^0.59.0",
19-
"@testing-library/react-native": "^7.0.0-rc.0",
20-
"react-test-renderer": "~16.9.0"
23+
"@babel/runtime": "^7.9.2",
24+
"babel-jest": "*",
25+
"babel-preset-expo": "~8.1.0",
26+
"jest": "*",
27+
"@testing-library/react-native": "*",
28+
"react-test-renderer": "*"
2129
},
2230
"private": true,
2331
"jest": {

examples/redux/public/favicon.png

1.43 KB

examples/redux/public/icon.png

642 Bytes

examples/redux/public/splash.png

9.09 KB

package.json

Lines changed: 19 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,27 @@
11
{
2-
"name": "@testing-library/react-native",
3-
"version": "7.0.1",
4-
"description": "Simple and complete React Native testing utilities that encourage good testing practices.",
5-
"main": "build/index.js",
6-
"typings": "./typings/index.d.ts",
7-
"repository": {
8-
"type": "git",
9-
"url": "https://www.github.com/callstack/react-native-testing-library.git"
10-
},
11-
"homepage": "https://callstack.github.io/react-native-testing-library",
12-
"author": "Michał Pierzchała <[email protected]>",
13-
"license": "MIT",
14-
"private": false,
15-
"keywords": [
16-
"react-native",
17-
"react",
18-
"test",
19-
"integration"
20-
],
21-
"files": [
22-
"build/",
23-
"typings/index.d.ts",
24-
"pure.js",
25-
"dont-cleanup-after-each.js"
2+
"name": "react-native-testing-library",
3+
"private": true,
4+
"workspaces": [
5+
"examples/*",
6+
"packages/*",
7+
"website"
268
],
27-
"devDependencies": {
28-
"@babel/cli": "^7.8.4",
29-
"@babel/core": "^7.9.0",
30-
"@babel/plugin-proposal-class-properties": "^7.8.3",
31-
"@babel/preset-env": "^7.9.6",
32-
"@babel/preset-flow": "^7.9.0",
33-
"@babel/preset-react": "^7.9.4",
34-
"@callstack/eslint-config": "^10.0.0",
35-
"@release-it/conventional-changelog": "^1.1.0",
36-
"@testing-library/jest-native": "~3.3.0",
37-
"@types/react": "^16.9.34",
38-
"@types/react-native": "^0.63.0",
39-
"@types/react-test-renderer": "^16.9.2",
40-
"babel-jest": "^26.0.1",
41-
"conventional-changelog-cli": "^2.0.11",
42-
"dedent": "^0.7.0",
43-
"eslint": "^7.0.0",
44-
"flow-bin": "^0.122.0",
45-
"flow-copy-source": "^2.0.9",
46-
"jest": "^26.0.1",
47-
"react": "^16.13.1",
48-
"react-native": "^0.63.0-rc.1",
49-
"react-test-renderer": "^16.13.1",
50-
"release-it": "^13.6.0",
51-
"strip-ansi": "^6.0.0",
52-
"typescript": "^3.8.3"
53-
},
549
"dependencies": {
55-
"pretty-format": "^26.0.1"
10+
"react": "^16.13.1",
11+
"react-native": "^0.63.2"
5612
},
57-
"peerDependencies": {
58-
"react": ">=16.0.0",
59-
"react-test-renderer": ">=16.0.0"
13+
"devDependencies": {
14+
"@callstack/eslint-config": "^10.0.1",
15+
"@types/react": "^16.9.46",
16+
"@types/react-native": "^0.63.8",
17+
"@types/react-test-renderer": "^16.9.3",
18+
"babel-jest": "^26.3.0",
19+
"eslint": "^7.7.0",
20+
"flow-mono-cli": "^1.5.3",
21+
"jest": "^26.4.0",
22+
"react-test-renderer": "^16.13.1"
6023
},
6124
"scripts": {
62-
"test": "jest",
63-
"flow-check": "flow check",
64-
"typescript-check": "tsc --noEmit --skipLibCheck --jsx react ./typings/__tests__/*",
65-
"lint": "eslint src --cache",
66-
"release": "release-it",
67-
"prepublish": "yarn build && yarn copy-flowtypes",
68-
"copy-flowtypes": "flow-copy-source --ignore __tests__/*.js src build",
69-
"build": "rm -rf build; babel src --out-dir build --ignore 'src/__tests__/*'"
70-
},
71-
"jest": {
72-
"preset": "react-native",
73-
"moduleFileExtensions": [
74-
"js",
75-
"json"
76-
],
77-
"rootDir": "./src"
25+
"postinstall": "flow-mono create-symlinks packages/react-native-testing-library/.flowconfig"
7826
}
7927
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"name": "@testing-library/react-native",
3+
"version": "7.0.1",
4+
"description": "Simple and complete React Native testing utilities that encourage good testing practices.",
5+
"main": "build/index.js",
6+
"typings": "./typings/index.d.ts",
7+
"repository": {
8+
"type": "git",
9+
"url": "https://www.github.com/callstack/react-native-testing-library.git"
10+
},
11+
"homepage": "https://callstack.github.io/react-native-testing-library",
12+
"author": "Michał Pierzchała <[email protected]>",
13+
"license": "MIT",
14+
"private": false,
15+
"keywords": [
16+
"react-native",
17+
"react",
18+
"test",
19+
"integration"
20+
],
21+
"files": [
22+
"build/",
23+
"typings/index.d.ts",
24+
"pure.js",
25+
"dont-cleanup-after-each.js"
26+
],
27+
"devDependencies": {
28+
"@babel/cli": "^7.8.4",
29+
"@babel/core": "^7.9.0",
30+
"@babel/plugin-proposal-class-properties": "^7.8.3",
31+
"@babel/preset-env": "^7.9.6",
32+
"@babel/preset-flow": "^7.9.0",
33+
"@babel/preset-react": "^7.9.4",
34+
"@callstack/eslint-config": "*",
35+
"@release-it/conventional-changelog": "^1.1.0",
36+
"@testing-library/jest-native": "~3.3.0",
37+
"@types/react": "*",
38+
"@types/react-native": "*",
39+
"@types/react-test-renderer": "*",
40+
"babel-jest": "*",
41+
"conventional-changelog-cli": "^2.0.11",
42+
"dedent": "^0.7.0",
43+
"eslint": "*",
44+
"flow-bin": "^0.122.0",
45+
"flow-copy-source": "^2.0.9",
46+
"jest": "*",
47+
"react": "*",
48+
"react-native": "*",
49+
"react-test-renderer": "*",
50+
"release-it": "^13.6.0",
51+
"strip-ansi": "^6.0.0",
52+
"typescript": "^3.8.3"
53+
},
54+
"dependencies": {
55+
"pretty-format": "^26.0.1"
56+
},
57+
"peerDependencies": {
58+
"react": ">=16.0.0",
59+
"react-test-renderer": ">=16.0.0"
60+
},
61+
"scripts": {
62+
"test": "jest",
63+
"flow-check": "flow check",
64+
"typescript-check": "tsc --noEmit --skipLibCheck --jsx react ./typings/__tests__/*",
65+
"lint": "eslint src --cache",
66+
"release": "release-it",
67+
"prepublish": "yarn build && yarn copy-flowtypes",
68+
"copy-flowtypes": "flow-copy-source --ignore __tests__/*.js src build",
69+
"build": "rm -rf build; babel src --out-dir build --ignore 'src/__tests__/*'"
70+
},
71+
"jest": {
72+
"preset": "react-native",
73+
"moduleFileExtensions": [
74+
"js",
75+
"json"
76+
],
77+
"rootDir": "./src"
78+
}
79+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

website/docusaurus.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const siteConfig = {
1919
alt: title,
2020
src: 'img/owl.png',
2121
},
22-
links: [
22+
items: [
2323
{ to: 'docs/getting-started', label: 'Docs', position: 'right' },
2424
{ href: repoUrl, label: 'GitHub', position: 'right' },
2525
],

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"@docusaurus/core": "^2.0.0-alpha.54",
1313
"@docusaurus/preset-classic": "^2.0.0-alpha.54",
1414
"classnames": "^2.2.6",
15-
"react": "^16.8.4",
15+
"react": "*",
1616
"react-dom": "^16.8.4"
1717
},
1818
"browserslist": {

0 commit comments

Comments
 (0)