Commit b9dde72
authored
fix(cli): fix undeclared
## Summary:
macOS bundling fails because it tries to import `chalk` but does not
declare it.
```
/~/packages/app/example/node_modules/react-native-macos/react-native.config.js: node:internal/modules/cjs/loader:1421
const err = new Error(message);
^
Error: Cannot find module 'chalk'
Require stack:
- /~/node_modules/.store/react-native-macos-virtual-89732d1908/package/local-cli/runMacOS/runMacOS.js
- /~/node_modules/.store/react-native-macos-virtual-89732d1908/package/react-native.config.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1421:15)
at defaultResolveImpl (node:internal/modules/cjs/loader:1059:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1064:22)
at Module._load (node:internal/modules/cjs/loader:1227:37)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:245:24)
at Module.require (node:internal/modules/cjs/loader:1504:12)
at require (node:internal/modules/helpers:152:16)
at Object.<anonymous> (/~/node_modules/.store/react-native-macos-virtual-89732d1908/package/local-cli/runMacOS/runMacOS.js:38:15)
at Module._compile (node:internal/modules/cjs/loader:1761:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/~/node_modules/.store/react-native-macos-virtual-89732d1908/package/local-cli/runMacOS/runMacOS.js',
'/~/node_modules/.store/react-native-macos-virtual-89732d1908/package/react-native.config.js'
]
}
```
Instead of adding `chalk` as a dependency (and introducing a diff), we
inline the functions we use.
## Test Plan:
n/achalk dependency (microsoft#2819)1 parent c597bf8 commit b9dde72
1 file changed
Lines changed: 23 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | | - | |
40 | | - | |
| 38 | + | |
| 39 | + | |
41 | 40 | | |
42 | | - | |
43 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
44 | 59 | | |
45 | 60 | | |
46 | 61 | | |
| |||
92 | 107 | | |
93 | 108 | | |
94 | 109 | | |
95 | | - | |
| 110 | + | |
96 | 111 | | |
97 | 112 | | |
98 | 113 | | |
| |||
146 | 161 | | |
147 | 162 | | |
148 | 163 | | |
149 | | - | |
| 164 | + | |
150 | 165 | | |
151 | 166 | | |
152 | 167 | | |
| |||
179 | 194 | | |
180 | 195 | | |
181 | 196 | | |
182 | | - | |
| 197 | + | |
183 | 198 | | |
184 | 199 | | |
185 | 200 | | |
| |||
0 commit comments