Skip to content

Commit a488036

Browse files
committed
feat(example): example support workspaces.
1 parent c1c41d3 commit a488036

File tree

9 files changed

+384
-169
lines changed

9 files changed

+384
-169
lines changed

example/base/App.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
* Sample React Native App
33
* https://github.com/facebook/react-native
44
*
5-
* @format
6-
* @flow strict-local
75
*/
86

97
import React from 'react';
@@ -16,6 +14,7 @@ import {
1614
useColorScheme,
1715
View,
1816
} from 'react-native';
17+
import {Button, Icon} from '@uiw/react-native';
1918

2019
import {
2120
Colors,
@@ -69,6 +68,8 @@ const App = () => {
6968
style={{
7069
backgroundColor: isDarkMode ? Colors.black : Colors.white,
7170
}}>
71+
<Button type="primary">按钮之间的间距</Button>
72+
<Icon name='apple' size={46} color='#50CB42' />
7273
<Section title="Step One">
7374
Edit <Text style={styles.highlight}>App.js</Text> to change this
7475
screen and then come back to see your edits.

example/base/ios/AwesomeProject.xcodeproj/project.pbxproj

Lines changed: 61 additions & 61 deletions
Large diffs are not rendered by default.

example/base/ios/Podfile.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ PODS:
316316
- React-cxxreact (= 0.64.2)
317317
- React-jsi (= 0.64.2)
318318
- React-perflogger (= 0.64.2)
319+
- RNSVG (12.1.1):
320+
- React
319321
- Yoga (1.14.0)
320322
- YogaKit (1.18.1):
321323
- Yoga (~> 1.14)
@@ -369,6 +371,7 @@ DEPENDENCIES:
369371
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
370372
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
371373
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
374+
- RNSVG (from `../node_modules/react-native-svg`)
372375
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
373376

374377
SPEC REPOS:
@@ -441,6 +444,8 @@ EXTERNAL SOURCES:
441444
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
442445
ReactCommon:
443446
:path: "../node_modules/react-native/ReactCommon"
447+
RNSVG:
448+
:path: "../node_modules/react-native-svg"
444449
Yoga:
445450
:path: "../node_modules/react-native/ReactCommon/yoga"
446451

@@ -483,6 +488,7 @@ SPEC CHECKSUMS:
483488
React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3
484489
React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9
485490
ReactCommon: 149906e01aa51142707a10665185db879898e966
491+
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
486492
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
487493
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a
488494

example/base/metro.config.js

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,36 @@
22
* Metro configuration for React Native
33
* https://github.com/facebook/react-native
44
*
5-
* @format
65
*/
76

7+
const path = require('path');
8+
// module.exports = watchHoistedModules(__dirname, {
9+
// // ...
10+
// transformer: {
11+
// getTransformOptions: async () => ({
12+
// transform: {
13+
// experimentalImportSupport: false,
14+
// inlineRequires: true,
15+
// },
16+
// }), server: { enableVisualizer: true, }
17+
// },
18+
// });
19+
20+
console.log(path.resolve(`${__dirname}/../../packages/core/`))
21+
console.log(path.resolve(`${__dirname}/../../`))
22+
823
module.exports = {
24+
resolver: {
25+
extraNodeModules: {
26+
'@uiw/react-native': path.resolve(`${__dirname}/lib/`),
27+
// '@uiw/react-native': path.resolve(`${__dirname}/../../packages/core/`),
28+
// 'react-native-svg': path.resolve(
29+
// `${__dirname}/../../node_modules/react-native-svg/`,
30+
// ),
31+
}
32+
},
933
transformer: {
34+
// babelTransformerPath: require.resolve('react-native-svg-transformer'),
1035
getTransformOptions: async () => ({
1136
transform: {
1237
experimentalImportSupport: false,

example/base/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"lint": "eslint ."
1111
},
1212
"dependencies": {
13-
"@uiw/react-native": "^2.0.3",
13+
"@uiw/react-native": "2.0.3",
1414
"react": "17.0.1",
1515
"react-native": "0.64.2",
1616
"react-native-svg": "12.1.1"
@@ -23,6 +23,8 @@
2323
"eslint": "7.14.0",
2424
"jest": "26.6.3",
2525
"metro-react-native-babel-preset": "^0.64.0",
26+
"react-native-svg-transformer": "0.14.3",
27+
"react-native-watch-hoisted-modules": "0.0.5",
2628
"react-test-renderer": "17.0.1"
2729
},
2830
"jest": {

package.json

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,20 @@
22
"license": "MIT",
33
"private": true,
44
"scripts": {
5-
"====>": "<====",
6-
"lib:build:type": "lerna exec --scope @uiw/react-native -- tsbb types",
7-
"lib:build": "lerna exec --scope @uiw/react-native -- tsbb build",
8-
"lib:watch": "lerna exec --scope @uiw/react-native -- tsbb watch",
9-
"lib:watch:type": "lerna exec --scope @uiw/react-native -- tsbb types --watch",
10-
"build": "npm run lib:build && npm run lib:build:type",
5+
"====>": "====>",
6+
"lib:build:type": "lerna exec --scope @uiw/react-native -- tsbb types --outDir --outDir lib",
7+
"lib:build:type:example": "lerna exec --scope @uiw/react-native -- tsbb types --outDir ../../example/base/lib",
8+
"lib:build": "lerna exec --scope @uiw/react-native -- tsbb build --babel-option=none --output ../../example/base/lib",
9+
"lib:build:example": "lerna exec --scope @uiw/react-native -- tsbb build --babel-option=none --output lib",
10+
"lib:watch": "lerna exec --scope @uiw/react-native -- tsbb watch --babel-option=none --output lib ",
11+
"lib:watch:example": "lerna exec --scope @uiw/react-native -- tsbb watch --babel-option=none --output ../../example/base/lib ",
12+
"lib:watch:type": "lerna exec --scope @uiw/react-native -- tsbb types --watch --outDir lib",
13+
"lib:watch:type:example": "lerna exec --scope @uiw/react-native -- tsbb types --watch --outDir ../../example/base/lib",
14+
"watch": "npm run lib:watch & npm run lib:watch:example & npm run lib:watch:type & npm run lib:watch:type:example",
15+
"build": "npm run lib:build && npm run lib:build:example && npm run lib:build:type && npm run lib:build:type:example",
1116
"start": "lerna exec --scope website -- npm run start",
1217
"doc": "lerna exec --scope website -- npm run build",
13-
"=---===>": "<====",
18+
"<====": "<====",
1419
"version": "lerna version --no-changelog --no-push --no-git-tag-version",
1520
"pretty-quick": "pretty-quick",
1621
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\""
@@ -28,7 +33,7 @@
2833
"react-native": "0.64.2"
2934
},
3035
"dependencies": {
31-
"tsbb": "2.2.1",
36+
"tsbb": "2.3.1",
3237
"husky": "7.0.1",
3338
"lerna": "4.0.0",
3439
"prettier": "2.3.2",
@@ -52,6 +57,8 @@
5257
"**/react*",
5358
"**/react/**",
5459
"**/react*/**",
60+
"**/@uiw",
61+
"**/@uiw/**",
5562
"**/@babel",
5663
"**/@babel/**",
5764
"**/webpack",

packages/core/.babelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"presets": [
3+
"@babel/preset-typescript"
4+
]
5+
}

packages/core/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,8 @@
6868
"devDependencies": {
6969
"@babel/core": "7.14.8",
7070
"@babel/preset-typescript": "7.14.5"
71+
},
72+
"engines": {
73+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
7174
}
7275
}

0 commit comments

Comments
 (0)