Skip to content

Commit

Permalink
feat(example): example support workspaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Aug 3, 2021
1 parent c1c41d3 commit a488036
Show file tree
Hide file tree
Showing 9 changed files with 384 additions and 169 deletions.
5 changes: 3 additions & 2 deletions example/base/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* Sample React Native App
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/

import React from 'react';
Expand All @@ -16,6 +14,7 @@ import {
useColorScheme,
View,
} from 'react-native';
import {Button, Icon} from '@uiw/react-native';

import {
Colors,
Expand Down Expand Up @@ -69,6 +68,8 @@ const App = () => {
style={{
backgroundColor: isDarkMode ? Colors.black : Colors.white,
}}>
<Button type="primary">按钮之间的间距</Button>
<Icon name='apple' size={46} color='#50CB42' />
<Section title="Step One">
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
Expand Down
122 changes: 61 additions & 61 deletions example/base/ios/AwesomeProject.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions example/base/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ PODS:
- React-cxxreact (= 0.64.2)
- React-jsi (= 0.64.2)
- React-perflogger (= 0.64.2)
- RNSVG (12.1.1):
- React
- Yoga (1.14.0)
- YogaKit (1.18.1):
- Yoga (~> 1.14)
Expand Down Expand Up @@ -369,6 +371,7 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNSVG (from `../node_modules/react-native-svg`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
Expand Down Expand Up @@ -441,6 +444,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNSVG:
:path: "../node_modules/react-native-svg"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand Down Expand Up @@ -483,6 +488,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 24600e3b1aaa77126989bc58b6747509a1ba14f3
React-runtimeexecutor: a9904c6d0218fb9f8b19d6dd88607225927668f9
ReactCommon: 149906e01aa51142707a10665185db879898e966
RNSVG: 551acb6562324b1d52a4e0758f7ca0ec234e278f
Yoga: 575c581c63e0d35c9a83f4b46d01d63abc1100ac
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

Expand Down
27 changes: 26 additions & 1 deletion example/base/metro.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,36 @@
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/

const path = require('path');
// module.exports = watchHoistedModules(__dirname, {
// // ...
// transformer: {
// getTransformOptions: async () => ({
// transform: {
// experimentalImportSupport: false,
// inlineRequires: true,
// },
// }), server: { enableVisualizer: true, }
// },
// });

console.log(path.resolve(`${__dirname}/../../packages/core/`))
console.log(path.resolve(`${__dirname}/../../`))

module.exports = {
resolver: {
extraNodeModules: {
'@uiw/react-native': path.resolve(`${__dirname}/lib/`),
// '@uiw/react-native': path.resolve(`${__dirname}/../../packages/core/`),
// 'react-native-svg': path.resolve(
// `${__dirname}/../../node_modules/react-native-svg/`,
// ),
}
},
transformer: {
// babelTransformerPath: require.resolve('react-native-svg-transformer'),
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
Expand Down
4 changes: 3 additions & 1 deletion example/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lint": "eslint ."
},
"dependencies": {
"@uiw/react-native": "^2.0.3",
"@uiw/react-native": "2.0.3",
"react": "17.0.1",
"react-native": "0.64.2",
"react-native-svg": "12.1.1"
Expand All @@ -23,6 +23,8 @@
"eslint": "7.14.0",
"jest": "26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"react-native-svg-transformer": "0.14.3",
"react-native-watch-hoisted-modules": "0.0.5",
"react-test-renderer": "17.0.1"
},
"jest": {
Expand Down
23 changes: 15 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@
"license": "MIT",
"private": true,
"scripts": {
"====>": "<====",
"lib:build:type": "lerna exec --scope @uiw/react-native -- tsbb types",
"lib:build": "lerna exec --scope @uiw/react-native -- tsbb build",
"lib:watch": "lerna exec --scope @uiw/react-native -- tsbb watch",
"lib:watch:type": "lerna exec --scope @uiw/react-native -- tsbb types --watch",
"build": "npm run lib:build && npm run lib:build:type",
"====>": "====>",
"lib:build:type": "lerna exec --scope @uiw/react-native -- tsbb types --outDir --outDir lib",
"lib:build:type:example": "lerna exec --scope @uiw/react-native -- tsbb types --outDir ../../example/base/lib",
"lib:build": "lerna exec --scope @uiw/react-native -- tsbb build --babel-option=none --output ../../example/base/lib",
"lib:build:example": "lerna exec --scope @uiw/react-native -- tsbb build --babel-option=none --output lib",
"lib:watch": "lerna exec --scope @uiw/react-native -- tsbb watch --babel-option=none --output lib ",
"lib:watch:example": "lerna exec --scope @uiw/react-native -- tsbb watch --babel-option=none --output ../../example/base/lib ",
"lib:watch:type": "lerna exec --scope @uiw/react-native -- tsbb types --watch --outDir lib",
"lib:watch:type:example": "lerna exec --scope @uiw/react-native -- tsbb types --watch --outDir ../../example/base/lib",
"watch": "npm run lib:watch & npm run lib:watch:example & npm run lib:watch:type & npm run lib:watch:type:example",
"build": "npm run lib:build && npm run lib:build:example && npm run lib:build:type && npm run lib:build:type:example",
"start": "lerna exec --scope website -- npm run start",
"doc": "lerna exec --scope website -- npm run build",
"=---===>": "<====",
"<====": "<====",
"version": "lerna version --no-changelog --no-push --no-git-tag-version",
"pretty-quick": "pretty-quick",
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\""
Expand All @@ -28,7 +33,7 @@
"react-native": "0.64.2"
},
"dependencies": {
"tsbb": "2.2.1",
"tsbb": "2.3.1",
"husky": "7.0.1",
"lerna": "4.0.0",
"prettier": "2.3.2",
Expand All @@ -52,6 +57,8 @@
"**/react*",
"**/react/**",
"**/react*/**",
"**/@uiw",
"**/@uiw/**",
"**/@babel",
"**/@babel/**",
"**/webpack",
Expand Down
5 changes: 5 additions & 0 deletions packages/core/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"presets": [
"@babel/preset-typescript"
]
}
3 changes: 3 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,8 @@
"devDependencies": {
"@babel/core": "7.14.8",
"@babel/preset-typescript": "7.14.5"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
}
}
Loading

0 comments on commit a488036

Please sign in to comment.