@servicetitan/docs-uikit 32.6.0 → 32.7.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.
@@ -64,7 +64,7 @@ export interface LogError extends LogEntry {
64
64
 
65
65
  ### LogService
66
66
 
67
- Use `LogService` to provide a `Log` instance in standalone applications, or to copy an MFEs events to a private endpoint.
67
+ Use `LogService` to provide a `Log` instance in standalone applications, or to copy an MFE's events to a private endpoint.
68
68
 
69
69
  #### Props
70
70
 
@@ -24,7 +24,7 @@ Set `cli.webpack.expose-shared-dependencies` to `true` in the application's `pac
24
24
 
25
25
  ### Design system
26
26
 
27
- If the host uses `@servicetitan/design-system` remove all imports of design system styles form the code; `startup` handles that automatically. Alternatively, to customize the design system styles, move the imports to a file named `design-system.css` in the root directory of the application's source folder (the `rootDir` in `tsconfig.json`). E.g.,
27
+ If the host uses `@servicetitan/design-system` remove all imports of design system styles from the code; `startup` handles that automatically. Alternatively, to customize the design system styles, move the imports to a file named `design-system.css` in the root directory of the application's source folder (the `rootDir` in `tsconfig.json`). E.g.,
28
28
 
29
29
  ```css title="design-system.css"
30
30
  @import '@servicetitan/tokens/dist/tokens.css';
@@ -81,7 +81,7 @@ When a tag is switched to a new version, it could take ServiceTitan's infrastruc
81
81
  ### Common workflows
82
82
 
83
83
  - **Canary testing**: publish MFE as `0.0.0-develop.{hash}` and tag as **dev** for early testing.
84
- - **Staging promotion**: point **next** to the version used to use in pre-production environments.
84
+ - **Staging promotion**: point **next** to the version to use in pre-production environments.
85
85
  - **Production promotion**: point **prod** to the release that passed staging.
86
86
  - **Rollback**: repoint a tag to the previous good version to revert consumers.
87
87
 
@@ -9,7 +9,7 @@ When `startup` builds an MFE, it creates two bundles, named **full** and **light
9
9
 
10
10
  At runtime, the host loads the **light** bundle when its shared dependencies are compatible with the MFE's, else it loads the **full** bundle.
11
11
 
12
- To be compatible, the host's version of a dependency must satisfy the MFE's [semver](https://semver.org) range. To allow the widest compatibility MFEs should use `^` instead of `~` for shared dependencies. For example, a host using `react` `18.3.1` will consider itself compatible with an MFEs that depends on `^18.2.0`, and incompatible with an MFE that depends on `~18.2.0`.
12
+ To be compatible, the host's version of a dependency must satisfy the MFE's [semver](https://semver.org) range. To allow the widest compatibility MFEs should use `^` instead of `~` for shared dependencies. For example, a host using `react` `18.3.1` will consider itself compatible with an MFE that depends on `^18.2.0`, and incompatible with an MFE that depends on `~18.2.0`.
13
13
 
14
14
  By default, MFEs and hosts share the following dependencies (see [here](https://github.com/search?q=repo%3Aservicetitan%2Fuikit+getDefaultSharedDependencies&type=code) for the most up-to-date list):
15
15
 
@@ -258,10 +258,10 @@ For MFEs the approach is slightly different, see [Customizing Webpack for MFEs](
258
258
 
259
259
  `createWebpackConfig` takes an object with two fields, `configuration` and `plugins`.
260
260
 
261
- | Field | Description |
262
- | :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
263
- | `configuration` | Merged with the defaults to produce the final webpack configuration. For production builds, **configuration.mode** must be set to "production". For development builds, set it to "development". |
264
- | `plugins` | `HtmlWebpackPlugin` and `MiniCssExtractPlugin` subkeys are merged with the default configurations for the corresponding plugins. (Note, `MiniCssExtractPlugin` only applies to production builds.) |
261
+ | Field | Description |
262
+ | :-------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
263
+ | `configuration` | Merged with the defaults to produce the final webpack configuration. For production builds, **configuration.mode** must be set to "production". For development builds, set it to "development". |
264
+ | `plugins` | `HtmlWebpackPlugin` and `MiniCssExtractPlugin` subkeys are merged with the default configurations for the corresponding plugins. |
265
265
 
266
266
  For example,
267
267
 
@@ -66,6 +66,52 @@ Run a specific test with Vitest:
66
66
  npx startup test --runner vitest app.test.tsx
67
67
  ```
68
68
 
69
+ ## SVG Transformation
70
+
71
+ ✨ New in **v32.7.0** ✨
72
+
73
+ Startup automatically mocks SVG imports, allowing you to include SVGs in tests without additional configuration. It applies the same [SVG transformations](../build#svg-transformation) as the [build](../build) command.
74
+
75
+ - Imports from `@servicetitan/anvil2` become React components
76
+ - Imports from elsewhere become strings
77
+ - `?component` and `?asset` params override the default behavior
78
+
79
+ ### Component SVGs
80
+
81
+ Component SVGs render with `href` set to the asset's path and `id` set to the asset's filename. For example,
82
+
83
+ ```tsx
84
+ import ExpandMore from '@servicetitan/anvil2/icons/material/round/expand_more.svg';
85
+
86
+ export const MyIcon = () => <ExpandMore className="expand-more-icon" />;
87
+ ```
88
+
89
+ Renders,
90
+
91
+ ```html
92
+ <svg
93
+ class="expand-more-icon"
94
+ href="@servicetitan/anvil2/dist/assets/icons/material/round/expand_more.svg"
95
+ id="expand_more.svg"
96
+ />
97
+ ```
98
+
99
+ ### Asset SVGs
100
+
101
+ Asset SVGs render as the asset's path. For example,
102
+
103
+ ```tsx
104
+ import ExpandMore from '@servicetitan/anvil2/assets/icons/material/round/expand_more.svg?asset';
105
+
106
+ export const MyIcon = () => <img src={ExpandMore} />;
107
+ ```
108
+
109
+ Renders,
110
+
111
+ ```html
112
+ <img src="@servicetitan/anvil2/assets/icons/material/round/expand_more.svg" />
113
+ ```
114
+
69
115
  ## Configuration
70
116
 
71
117
  - [Jest](./jest)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "32.6.0",
3
+ "version": "32.7.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": "c771c468d179a828a75b0316bb9b01f311d13591"
19
+ "gitHead": "673fb6b56865da309c09f91b4ebf30aaf815a562"
20
20
  }