You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/healthChecks.md
+17-18
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Health Check Plugins
2
2
3
-
Plugins can be used to extend the health checks that `npx react-native doctor` runs. This can be used to add additional checks for out of tree platforms, or other checks that are specific to a community module.
3
+
Plugins can be used to extend the health checks that `npx react-native doctor` runs. This can be used to add additional checks for out of tree platforms, or other checks that are specific to a community module.
4
4
5
-
See [`Plugins`](./plugins.md) for information about how plugins work.
5
+
See [`Plugins`](./plugins.md) for information about how plugins work.
@@ -94,7 +92,7 @@ Longer description of this health check
94
92
95
93
##### `getDiagnostics`
96
94
97
-
Functions which performs the actual check. Simple checks can just return `needsToBeFixed`. Checks which are looking at versions of an installed component (such as the version of node), can also return `version`, `versions` and `versionRange` to provide better information to be displayed in `react-native doctor` when running the check
95
+
Functions which performs the actual check. Simple checks can just return `needsToBeFixed`. Checks which are looking at versions of an installed component (such as the version of node), can also return `version`, `versions` and `versionRange` to provide better information to be displayed in `react-native doctor` when running the check
98
96
99
97
##### `win32AutomaticFix`
100
98
@@ -116,7 +114,7 @@ This function will be used to try to fix the issue when `react-native doctor` is
116
114
117
115
```ts
118
116
typeRunAutomaticFix= (args: {
119
-
loader:Ora;
117
+
loader:Spinner;
120
118
logManualInstallation: ({
121
119
healthcheck,
122
120
url,
@@ -134,7 +132,7 @@ type RunAutomaticFix = (args: {
134
132
135
133
##### `loader`
136
134
137
-
A reference to a [`ora`](https://www.npmjs.com/package/ora) instance which should be used to report success / failure, and progress of the fix. The fix function should always call either `loader.succeed()` or `loader.fail()` before returning.
135
+
A reference to a [`nanospinner`](https://www.npmjs.com/package/nanospinner) instance which should be used to report success / failure, and progress of the fix. The fix function should always call either `loader.success()` or `loader.error()` before returning.
138
136
139
137
##### `logManualInstallation`
140
138
@@ -146,26 +144,27 @@ Provides information about the current system
146
144
147
145
### Examples of RunAutomaticFix implementations
148
146
149
-
A health check that requires the user to manually go download/install something. This check will immediately display a message to notify the user how to fix the issue.
147
+
A health check that requires the user to manually go download/install something. This check will immediately display a message to notify the user how to fix the issue.
A health check that runs some commands locally which may fix the issue. This check will display a spinner while the exec commands are running. Then once the commands are complete, the spinner will change to a checkmark.
160
+
A health check that runs some commands locally which may fix the issue. This check will display a spinner while the exec commands are running. Then once the commands are complete, the spinner will change to a checkmark.
Copy file name to clipboardExpand all lines: docs/init.md
+14-10
Original file line number
Diff line number
Diff line change
@@ -78,25 +78,29 @@ module.exports = {
78
78
79
79
## Post init script loading
80
80
81
-
The responsibility of showing the user progress of the "Executing post init script" goes to the implementor. In the cli, the `ora` package is used to display progress.
82
-
For a simple usage in a custom template, `ora` can be used like this in a postInitScript :
81
+
The responsibility of showing the user progress of the "Executing post init script" goes to the implementor. In the cli, the `nanospinner` package is used to display progress.
82
+
For a simple usage in a custom template, `nanospinner` can be used like this in a postInitScript :
83
83
84
84
```javascript
85
85
#!/usr/bin/env node
86
-
constora=require('ora');
86
+
const{createSpinner}=require('nanospinner');
87
87
88
-
constspinner=ora('Executing post init script ');
88
+
constspinner=createSpinner('Executing post init script ');
89
89
90
90
newPromise((resolve) => {
91
91
spinner.start();
92
92
// do something
93
93
resolve();
94
-
}).then(() => {
95
-
spinner.succeed();
96
-
}).catch(() => {
97
-
spinner.fail();
98
-
thrownewError('Something went wrong during the post init script execution');
99
-
});
94
+
})
95
+
.then(() => {
96
+
spinner.success();
97
+
})
98
+
.catch(() => {
99
+
spinner.error();
100
+
thrownewError(
101
+
'Something went wrong during the post init script execution',
102
+
);
103
+
});
100
104
```
101
105
102
106
You can find example custom template [here](https://github.com/Esemesek/react-native-new-template).
0 commit comments