|
1 | | -**🎟 [Reason Conf US](https://www.reason-conf.us) is happening October 7-8th in Chicago 🎉** |
2 | | -Buy tickets or sponsor the event by visiting [https://www.reason-conf.us](https://www.reason-conf.us) |
| 1 | +#### 🎟 [Reason Conf US](https://www.reason-conf.us) is happening October 7-8th in Chicago 🎉 |
| 2 | + |
| 3 | +Buy tickets or sponsor the event by visiting |
| 4 | +[https://www.reason-conf.us](https://www.reason-conf.us) |
3 | 5 |
|
4 | 6 | --- |
5 | 7 |
|
@@ -44,27 +46,36 @@ so that you can understand what actions will and will not be tolerated. |
44 | 46 |
|
45 | 47 | ## 🚨 Usage from Git repo |
46 | 48 |
|
47 | | -If you use this bindings from the git repo, be sure to use |
| 49 | +If you use things unreleased from the git repo, you will need to link all |
| 50 | +folders (packages) that you need at the root of node_modules. The easiest way is |
| 51 | +to create the symlink you need in your `package.json` `prepare` step: |
| 52 | + |
| 53 | +First add this repo as a dep |
| 54 | + |
| 55 | +```console |
| 56 | +yarn add https://github.com/reasonml-community/reason-react-native |
| 57 | +``` |
| 58 | + |
| 59 | +Next, add this cross-platform symlink tool |
| 60 | + |
| 61 | +```console |
| 62 | +yarn add --dev symlink-dir |
| 63 | +``` |
| 64 | + |
| 65 | +Then add to you `package.json` |
48 | 66 |
|
49 | 67 | ```js |
50 | 68 | { |
51 | | - // ... |
52 | | - "bs-dependencies": [ |
53 | | - // bs-react-native, but compatible with jsx3 |
54 | | - "reason-react-native-monorepo/bs-react-native-jsx3-compat", |
55 | | - // new ReactNative, WIP on zero-cost bindings |
56 | | - "reason-react-native-monorepo/reason-react-native" |
57 | | - }, |
58 | | - // When used from git with the following path, bs-platform will use path that won't be working |
59 | | - // (because deps are pointing to folder in folder)` |
60 | | - // Your bundler (metro or webpack) will say that it can find and/or `reason-react-native/whatever` |
61 | | - // which is correct because it should be `reason-react-native-monorepo/reason-react-native/whatever` |
62 | | - // the trick below will correct path in generated JavaScript files |
63 | | - // and will just need to be removed when you won't use git directly anymore |
64 | | - "js-post-build": { |
65 | | - "cmd": "./node_modules/reason-react-native-monorepo/git-monorepo-usage-trick" |
66 | | - // if this tricky script doesn't work for you correctly, try |
67 | | - // "cmd": "./node_modules/reason-react-native-monorepo/git-monorepo-usage-trick-node" |
| 69 | + "scripts": { |
| 70 | + "reason-react-native-monorepo-trick": "symlink-dir ./node_modules/reason-react-native-monorepo/reason-react-native node_modules/reason-react-native && symlink-dir ./node_modules/reason-react-native-monorepo/bs-react-native-jsx3-compat node_modules/bs-react-native-jsx3-compat", |
| 71 | + "prepare": "yarn reason-react-native-monorepo-trick" |
68 | 72 | } |
69 | 73 | } |
70 | 74 | ``` |
| 75 | + |
| 76 | +⚠️ In the example above, we only linked `reason-react-native` and |
| 77 | +`bs-react-native-jsx3-compat`. Be sure to link all the package you have in your |
| 78 | +`bsconfig.json` that need to be used from git. |
| 79 | + |
| 80 | +👀 If you find a trick more easy to read/maintain (and still cross-platform), |
| 81 | +please share it with us via Discord, an issue, or a PR! |
0 commit comments