@servicetitan/docs-uikit 32.0.1 → 32.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/startup/review.mdx +143 -0
- package/docs/startup/test.mdx +6 -6
- package/package.json +2 -2
package/docs/startup/review.mdx
CHANGED
|
@@ -43,6 +43,11 @@ npx startup review
|
|
|
43
43
|
|
|
44
44
|
## Options
|
|
45
45
|
|
|
46
|
+
| Option | Description |
|
|
47
|
+
| :------------------ | :---------------------------------------------------- |
|
|
48
|
+
| [`--fix`](#--fix) | Automatically fix problems detected by enabled rules. |
|
|
49
|
+
| [`--rule`](#--rule) | Limit checks to one or more rules. |
|
|
50
|
+
|
|
46
51
|
### --fix
|
|
47
52
|
|
|
48
53
|
You can run `startup review` with the `--fix` flag to automatically fix certain problems detected by enabled rules.
|
|
@@ -140,6 +145,132 @@ And, this configuration requires all libraries except `utils` to have explicit `
|
|
|
140
145
|
|
|
141
146
|
## Rules
|
|
142
147
|
|
|
148
|
+
### no-deprecated-content-base
|
|
149
|
+
|
|
150
|
+
Detects use of the deprecated `contentBase` `webpack-dev-server` option.
|
|
151
|
+
|
|
152
|
+
Previously, `contentBase` was used to specify the directory from which `webpack-dev-server` should serve static files. It was removed in `webpack-dev-server@4.0.0` and replaced with the `static` option.
|
|
153
|
+
|
|
154
|
+
#### ✅ Autofix
|
|
155
|
+
|
|
156
|
+
This rule supports autofix.
|
|
157
|
+
It migrates `cli.webpack.contentBase` to `cli.webpack.static.directory`.
|
|
158
|
+
For example, given:
|
|
159
|
+
|
|
160
|
+
```json title="packages/app/package.json"
|
|
161
|
+
{
|
|
162
|
+
"cli": {
|
|
163
|
+
"webpack": {
|
|
164
|
+
"contentBase": "src/public"
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
It runs:
|
|
171
|
+
|
|
172
|
+
```sh
|
|
173
|
+
npm pkg set cli.webpack.static.directory="src/public" -w packages/app
|
|
174
|
+
npm pkg delete cli.webpack.contentBase -w packages/app
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
### no-direct-peer-dependencies
|
|
180
|
+
|
|
181
|
+
Detects when a package is listed as both a direct dependency and a peer dependency.
|
|
182
|
+
|
|
183
|
+
Packages should declare a peer dependency when they expect the consumer to provide it; listing the same package as a direct dependency defeats that contract and can cause duplication and version conflicts.
|
|
184
|
+
|
|
185
|
+
#### ✅ Autofix
|
|
186
|
+
|
|
187
|
+
This rule supports autofix.
|
|
188
|
+
It moves the peer package from `dependencies` to `devDependencies`.
|
|
189
|
+
For example, given
|
|
190
|
+
|
|
191
|
+
```json title="packages/lib/package.json"
|
|
192
|
+
{
|
|
193
|
+
"dependencies": {
|
|
194
|
+
"react": "^18.3.1"
|
|
195
|
+
},
|
|
196
|
+
"peerDependencies": {
|
|
197
|
+
"react": ">=17"
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
It runs
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
npm pkg set devDependencies["react"]="^18.3.1" -w packages/lib
|
|
206
|
+
npm pkg delete dependencies["react"] -w packages/lib
|
|
207
|
+
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
---
|
|
211
|
+
|
|
212
|
+
### prefer-open-ended-peer-dependencies
|
|
213
|
+
|
|
214
|
+
Enforces open‑ended peer dependency ranges so consumers can choose compatible versions.
|
|
215
|
+
|
|
216
|
+
Closed‑ended ranges like `^1.2.3` or `~1.2.3` are discouraged for peer dependencies because they limit consumers' ability to resolve a single compatible version across a workspace. Closed-ended ranges should only be used when there is a known incompatibility with a later version.
|
|
217
|
+
|
|
218
|
+
#### ✅ Autofix
|
|
219
|
+
|
|
220
|
+
The rule supports autofix.
|
|
221
|
+
It converts simple closed-ended ranges, using tilde (`~`) or caret (`^`), to an open-ended `>=` range that preserves the original minimum version. For example,
|
|
222
|
+
|
|
223
|
+
- `^12.3.0` → `>=12.3.0`
|
|
224
|
+
- `~1.2.3` → `>=1.2.3`
|
|
225
|
+
|
|
226
|
+
For example, given
|
|
227
|
+
|
|
228
|
+
```json title="packages/lib/package.json"
|
|
229
|
+
{
|
|
230
|
+
"peerDependencies": {
|
|
231
|
+
"react": "^18.3.1"
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
It runs
|
|
237
|
+
|
|
238
|
+
```sh
|
|
239
|
+
npm pkg set peerDependencies["react"]=">=18.3.1" -w packages/lib
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
:::caution
|
|
243
|
+
Complex ranges that cannot be expressed as a single open‑ended minimum are not auto‑fixable and must be fixed manually. Examples:
|
|
244
|
+
|
|
245
|
+
- `<1`
|
|
246
|
+
- `^1 || ^2`
|
|
247
|
+
- `>1 <2`
|
|
248
|
+
- `1.0 - 2.0`
|
|
249
|
+
|
|
250
|
+
:::
|
|
251
|
+
|
|
252
|
+
#### ⚙️ Configuration
|
|
253
|
+
|
|
254
|
+
This rule supports an extended `exclude` configuration that allows you to omit specific dependencies from the check. The `exclude` option can be an object that maps packages to a list of peer dependencies.
|
|
255
|
+
|
|
256
|
+
For example, this configuration allows `@servicetitan/hash-browser-router` to use closed-ended peer dependencies for `history` and `react-router-dom`.
|
|
257
|
+
|
|
258
|
+
```json
|
|
259
|
+
"prefer-open-ended-peer-dependencies": [
|
|
260
|
+
"warn",
|
|
261
|
+
{
|
|
262
|
+
"exclude": {
|
|
263
|
+
"@servicetitan/hash-browser-router": [
|
|
264
|
+
"history",
|
|
265
|
+
"react-router-dom"
|
|
266
|
+
],
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
]
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
143
274
|
### no-typescript-entry-point
|
|
144
275
|
|
|
145
276
|
Ensures that no package uses a TypeScript file as its main entry point or in its `exports`.
|
|
@@ -218,6 +349,18 @@ npm pkg set dependencies["react-dom"]="^18.3.1"
|
|
|
218
349
|
|
|
219
350
|
---
|
|
220
351
|
|
|
352
|
+
### require-compatible-launch-darkly-sdk
|
|
353
|
+
|
|
354
|
+
Ensures that any package depending on `@servicetitan/launchdarkly-service` uses a compatible version of `launchdarkly-js-client-sdk`.
|
|
355
|
+
|
|
356
|
+
Using an incompatible version of `launchdarkly-js-client-sdk` prevents `@servicetitan/launchdarkly-service` from sharing and reusing client connections, which can degrade performance and cause the UI to behave inconsistently. It also harms performance to teardown and recreate connections each time an MFE is unloaded and reloaded.
|
|
357
|
+
|
|
358
|
+
#### ✅ Autofix
|
|
359
|
+
|
|
360
|
+
This rule supports autofix. It updates dependencies on `launchdarkly-js-client-sdk` to match `@servicetitan/launchdarkly-service`.
|
|
361
|
+
|
|
362
|
+
---
|
|
363
|
+
|
|
221
364
|
### require-explicit-side-effects
|
|
222
365
|
|
|
223
366
|
Warns if a package is missing the `sideEffects` property in its `package.json`.
|
package/docs/startup/test.mdx
CHANGED
|
@@ -146,21 +146,21 @@ Or override it per invocation with the `--runner` option.
|
|
|
146
146
|
The Vitest runner uses a layered configuration approach to provide sensible defaults while allowing full customization.
|
|
147
147
|
|
|
148
148
|
- Uses the default, built-in configuration as a base.
|
|
149
|
-
-
|
|
150
|
-
-
|
|
151
|
-
-
|
|
149
|
+
- Merges workspace settings from `package.json`.
|
|
150
|
+
- Merges settings from your Vitest config file.
|
|
151
|
+
- Merges command line options last.
|
|
152
152
|
|
|
153
153
|
1. **Default Configuration:**
|
|
154
154
|
The runner starts with a built-in default configuration optimized for ServiceTitan workspaces. This includes sensible coverage settings, the environment (`jsdom`), file exclusions, and more.
|
|
155
155
|
|
|
156
156
|
2. **Workspace Configuration:**
|
|
157
|
-
You can
|
|
157
|
+
You can customize the configuration by specifying [Vitest options](https://vitest.dev/config) in your workspace `package.json` under the `"cli.vitest"` key.
|
|
158
158
|
|
|
159
159
|
3. **Vitest Config File:**
|
|
160
|
-
If your project includes a standard Vitest config file (such as `vitest.config.ts` or `vite.config.ts`), its settings will
|
|
160
|
+
If your project includes a standard Vitest config file (such as `vitest.config.ts` or `vite.config.ts`), its settings will merged with the defaults and workspace configuration.
|
|
161
161
|
|
|
162
162
|
4. **Command Line Arguments:**
|
|
163
|
-
Any options passed directly via the command line (e.g., `npx startup test --runner vitest --coverage`) take highest precedence
|
|
163
|
+
Any options passed directly via the command line (e.g., `npx startup test --runner vitest --coverage`) take highest precedence over previous configuration layers.
|
|
164
164
|
|
|
165
165
|
### Examples
|
|
166
166
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/docs-uikit",
|
|
3
|
-
"version": "32.0
|
|
3
|
+
"version": "32.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -16,5 +16,5 @@
|
|
|
16
16
|
"cli": {
|
|
17
17
|
"webpack": false
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "5686f75473bd25104356c3fc6e7c8ffe478ca125"
|
|
20
20
|
}
|