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
{{ message }}
Repository navigation
Commit d0f444e
Browse filesBrowse the repository at this point in the historyBrowse files
docs: complete the samples in the ship-a-plugin guide
The guide now says apps install the devtools package themselves, since it is an optional peer. flagsView is said to live in the same file, both tool schemas take the optional page argument as the example does, the FeatureFlags service is shown with its store, and the Vite sample imports and calls analog().
`flagsView()` returns a stats section and a table of flags, and lists the `reset` action while a flag is overridden. An error a page action throws reaches the agent as the tool's answer. The [sections table](./write-a-plugin.md#sections) lists every section kind.
107
+
`flagsView()`, in the same file, returns a stats section and a table of flags, and lists the `reset` action while a flag is overridden. An error a page action throws reaches the agent as the tool's answer. The [sections table](./write-a-plugin.md#sections) lists every section kind.
107
108
108
109
Keep the plugin id and version in a file both entry points import (`src/ids.ts` in the example), so the page plugin and the server plugin always match.
109
110
@@ -116,6 +117,10 @@ The server plugin adds agent tools over what the page reports. A tool that runs
@@ -160,7 +166,13 @@ The tools register as `pangular:plugin:feature-flags:flags` and `pangular:plugin
160
166
161
167
## Use it in an app
162
168
163
-
Tell the apps that use your library to make two changes.
169
+
Your library lists `@pangular-inspector/devtools` as an optional peer dependency, so an app that wants the tab installs it as its own development dependency first:
170
+
171
+
```bash
172
+
npm install -D @pangular-inspector/devtools
173
+
```
174
+
175
+
Then tell the apps that use your library to make two changes.
164
176
165
177
<ngmd-workflow>
166
178
<ngmd-steptitle="Register the page plugin in development">
@@ -179,10 +191,23 @@ import {isPlatformBrowser} from '@angular/common';
@@ -198,19 +223,17 @@ export function provideFeatureFlagsPangularPlugin(): EnvironmentProviders {
198
223
}
199
224
```
200
225
201
-
`FeatureFlags` is the demo's service that holds the store, in the same file. Add `provideFeatureFlagsPangularPlugin()` to the app's providers. Then pass the server plugin to the Vite plugin:
226
+
`FeatureFlags` is the demo's service that holds the store; the real one also turns store changes into a signal for templates. Add `provideFeatureFlagsPangularPlugin()` to the app's providers. Then pass the server plugin to the Vite plugin:
0 commit comments