@servicetitan/docs-uikit 39.1.0 → 39.2.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.
@@ -25,37 +25,34 @@ RUM events go through three enrichment stages: built-in attribution (MFE name, v
25
25
  <TabItem value="host">
26
26
 
27
27
  ```ts title="datadog-entry.ts"
28
- import { init, type RumServiceRegistration } from '@servicetitan/datadog-rum';
28
+ import { init } from '@servicetitan/datadog-rum';
29
29
 
30
30
  export const isEnabled = /.*go\d*\.servicetitan\.com/.test(window.location.hostname);
31
31
 
32
- let desktopRegistration: RumServiceRegistration | undefined;
33
-
34
- if (isEnabled) {
35
- desktopRegistration = init({
36
- service: {
37
- name: 'desktop',
38
- beforeSend: event => {
39
- // enrich with 'desktop' service-specific context
40
- },
32
+ const desktopRegistration = init({
33
+ service: {
34
+ name: 'desktop',
35
+ beforeSend: event => {
36
+ // enrich with 'desktop' service-specific context
41
37
  },
42
- application: {
43
- applicationId: '<APPLICATION_ID>',
44
- clientToken: '<CLIENT_TOKEN>',
45
- env: window.location.hostname,
46
- version: '<APPLICATION_VERSION>',
47
- // Host-wide noise suppression. Locked at init, applies app-wide.
48
- excludedActivityUrls: [/fullstory\.com/, /pendo\.io/, /\/Log\/Send/],
49
- beforeSend: event => {
50
- // optional: drop or transform events application-wide
51
- return true;
52
- },
38
+ },
39
+ application: {
40
+ applicationId: '<APPLICATION_ID>',
41
+ clientToken: '<CLIENT_TOKEN>',
42
+ env: window.location.hostname,
43
+ version: '<APPLICATION_VERSION>',
44
+ // Host-wide noise suppression. Locked at init, applies app-wide.
45
+ excludedActivityUrls: [/fullstory\.com/, /pendo\.io/, /\/Log\/Send/],
46
+ beforeSend: event => {
47
+ // optional: drop or transform events application-wide
48
+ return true;
53
49
  },
54
- });
50
+ },
51
+ enabled: isEnabled,
52
+ });
55
53
 
56
- // Attach session-lifetime context to every 'desktop'-tagged event
57
- desktopRegistration.setServiceContext({ logicalEnvironment: 'go5' });
58
- }
54
+ // Attach session-lifetime context to every 'desktop'-tagged event
55
+ desktopRegistration.setServiceContext({ logicalEnvironment: 'go5' });
59
56
  ```
60
57
 
61
58
  ```tsx title="root.tsx"
@@ -160,6 +157,8 @@ Any caller — host or MFE — may pass `application`. The first call that inclu
160
157
  ```ts
161
158
  import { init } from '@servicetitan/datadog-rum';
162
159
 
160
+ const isEnabled = /.*go\d*\.servicetitan\.com/.test(window.location.hostname);
161
+
163
162
  const { cleanup, setServiceContext } = init({
164
163
  service: {
165
164
  name: 'task-hub',
@@ -180,6 +179,7 @@ const { cleanup, setServiceContext } = init({
180
179
  return true; // return false to drop the event app-wide
181
180
  },
182
181
  },
182
+ enabled: isEnabled,
183
183
  });
184
184
 
185
185
  // Attach session-lifetime context merged into every 'task-hub'-tagged event
@@ -281,23 +281,7 @@ The hook accepts a [`ServiceConfig`](#serviceconfig) — the same shape used by
281
281
 
282
282
  To exercise RUM-related changes in an environment where the application ships RUM but leaves it off (for example a local or QA build), you can turn RUM on for your own browser — no code change. It only ever turns RUM **on**; it has no effect where RUM is already enabled.
283
283
 
284
- An application opts in once by always calling [`init`](#init) and passing its enablement decision as `enabled`, instead of gating the `init` call:
285
-
286
- ```ts title="datadog-entry.ts"
287
- import { init } from '@servicetitan/datadog-rum';
288
-
289
- const isEnabled = /.*go\d*\.servicetitan\.com/.test(window.location.hostname);
290
-
291
- init({
292
- service: { name: 'desktop' },
293
- application: {
294
- applicationId: '<APPLICATION_ID>',
295
- clientToken: '<CLIENT_TOKEN>',
296
- env: window.location.hostname,
297
- },
298
- enabled: isEnabled,
299
- });
300
- ```
284
+ An application opts in once by always calling [`init`](#init) and passing its enablement decision as `enabled`, instead of gating the `init` call. The [end-to-end example](#end-to-end-example) shows this.
301
285
 
302
286
  In any environment where the application ships RUM but leaves it disabled (`enabled` is `false`), the package exposes `datadogRumForDev` on the global scope. A developer controls it directly from the browser devtools console — no import, no code change:
303
287
 
@@ -311,7 +295,7 @@ datadogRumForDev.stop(); // clear the override; return to the shipped default
311
295
 
312
296
  Sessions enabled this way are tagged with a `datadogRumForDev` context attribute. Filter `@context.datadogRumForDev:true` in Datadog RUM to find them, or `-@context.datadogRumForDev:true` to exclude them from production dashboards.
313
297
 
314
- **Set `env` per host before relying on this** (e.g. `env: window.location.hostname`, as above). Because the override turns RUM on in an environment that normally doesn't report, a static or hardcoded `env` would file those dev sessions under your **production** `env` — colliding with prod data in dashboards and SLOs. A dynamic `env` keeps override-enabled lower-environment sessions in their own bucket.
298
+ **Set `env` per host before relying on this** (e.g. `env: window.location.hostname`). Because the override turns RUM on in an environment that normally doesn't report, a static or hardcoded `env` would file those dev sessions under your **production** `env` — colliding with prod data in dashboards and SLOs. A dynamic `env` keeps override-enabled lower-environment sessions in their own bucket.
315
299
 
316
300
  #### Multiple tabs
317
301
 
@@ -13,22 +13,38 @@ This document describes using UNPKG + Verdaccio, the recommended way to publish
13
13
 
14
14
  ## Publishing Locally
15
15
 
16
- Before you can publish locally, run the following command to add an authorization token for Verdaccio to the local NPM configuration:
16
+ The production Verdaccio instance only allows publishing from CI environments with the provided `ST_VERDACCIO_PUBLISH_TOKEN` authorization token.
17
+
18
+ Non-CI environments must use https://verdaccio.st.dev. Pass `--registry https://verdaccio.st.dev` to `mfe-publish`.
19
+
20
+ Before you can publish to https://verdaccio.st.dev, run the following command to add an authorization token to the local NPM configuration:
17
21
 
18
22
  ```sh
19
- npx verdaccio-okta-oauth@latest --registry https://verdaccio.servicetitan.com
23
+ npx verdaccio-okta-oauth@latest --registry https://verdaccio.st.dev
20
24
  ```
21
25
 
22
26
  [Build](../startup/build) the MFE, then to publish it run:
23
27
 
24
28
  ```sh
25
- npx startup mfe-publish
29
+ npx startup mfe-publish --registry https://verdaccio.st.dev
26
30
  ```
27
31
 
32
+ Load the published MFE from https://unpkg.st.dev.
33
+
28
34
  :::info
29
35
  If the project contains multiple MFEs `startup` publishes all of them.
30
36
  :::
31
37
 
38
+ :::note
39
+ Local publishes skip the Datadog sourcemap upload, because the required `DATADOG_API_KEY` is only available in CI. See [sourcemaps](../startup/mfe-publish#sourcemaps).
40
+ :::
41
+
42
+ To list locally published MFEs, run:
43
+
44
+ ```sh
45
+ npx startup mfe-list --registry https://verdaccio.st.dev
46
+ ```
47
+
32
48
  ## Publishing From CI
33
49
 
34
50
  To publish an MFE from a Github or Teamcity workflow, use the `ST_VERDACCIO_PUBLISH_TOKEN` organization secret to authorize access to Verdaccio. For example,
@@ -89,5 +105,6 @@ When a tag is switched to a new version, it could take ServiceTitan's infrastruc
89
105
 
90
106
  - [Example `mfe-publish` workflow](https://github.com/servicetitan/frontend-example/blob/master/.github/workflows/mfe-publish.yml)
91
107
  - [startup mfe-publish](../startup/mfe-publish) -- how to tag releases
108
+ - [startup mfe-list](../startup/mfe-list) -- how to see what MFE versions are published
92
109
  - [Using tags](./hosting#using-tags) -- how to load MFEs with tags
93
110
  - [Verdaccio + UNPKG](/docs/frontend/verdaccio-unpkg) -- publishing infrastructure
@@ -42,12 +42,17 @@ For example,
42
42
 
43
43
  ## Options
44
44
 
45
- | Option | Description |
46
- | :---------------- | :------------------------------------------------------------------ |
47
- | `--all` | List all published versions. |
48
- | `--ignore <glob>` | Exclude MFEs with names matching the given glob pattern. |
49
- | `--limit <count>` | List the last `<count>` published versions. Ignores `<count> <= 0`. |
50
- | `--tagged` | List only tagged versions. |
45
+ | Option | Description |
46
+ | :----------------- | :------------------------------------------------------------------ |
47
+ | `--all` | List all published versions. |
48
+ | `--ignore <glob>` | Exclude MFEs with names matching the given glob pattern. |
49
+ | `--limit <count>` | List the last `<count>` published versions. Ignores `<count> <= 0`. |
50
+ | `--registry <url>` | List versions published to the given registry. |
51
+ | `--tagged` | List only tagged versions. |
52
+
53
+ :::tip
54
+ Use `--registry https://verdaccio.st.dev` to list locally published MFEs. See [Publishing locally](../microfrontends/publishing.mdx#publishing-locally).
55
+ :::
51
56
 
52
57
  ## Listing specific MFEs
53
58
 
@@ -71,3 +76,7 @@ This machine is not authorized to access https://verdaccio.servicetitan.com. Aut
71
76
  ```
72
77
 
73
78
  Enter `y` to confirm, or `n` to cancel. If you confirm, `startup` runs [verdaccio-okta-oauth](/docs/frontend/verdaccio-unpkg/#authorzation) then proceeds with the command.
79
+
80
+ ## See Also
81
+
82
+ - [Publishing](../microfrontends/publishing.mdx) - how to publish MFEs
@@ -12,6 +12,7 @@ This is an umbrella command for publishing, unpublishing (cleaning up), and roll
12
12
  | `--branch <string>` | Optional branch name. The current branch name is used if no value is specified. The branch name is used in constructing the build version in case `--build` is not specified. |
13
13
  | `--build <glob>` | Optional build version that normally should not be specified. Defaults to `<branch_name>.<commit_hash>`. For example, if git commit `bdac90f5` is published from branch `next`, the build version is`next.bdac90f5`, and the full version is `0.0.0-next.bdac90f5`. This ensures each release has a unique version with no collisions. |
14
14
  | `--force` | Forces publishing the package when no configuration was found for the specified branch (`--branch` or current branch). |
15
+ | `--registry <url>` | The registry to publish to. Defaults to `https://verdaccio.servicetitan.com`. See [Publishing](../microfrontends/publishing). |
15
16
  | `--upload-sourcemaps`, `--no-upload-sourcemaps` | Whether or not to [upload sourcemaps](#sourcemaps) to Datadog. Defaults to uploading sourcemaps. |
16
17
  | `--purge-cache`, `--no-purge-cache` | Whether or not to [purge the unpkg cache](#cache-purging) after publishing. Defaults to purging the cache. |
17
18
  | `--tag <string>` | The [tag](https://docs.npmjs.com/cli/v7/commands/npm-publish#tag) to assign to the published version. Defaults to the tag associated with the branch from the custom [branch config](#branch-configs) or, if there is no custom branch config, from the [default branch config](https://github.com/servicetitan/uikit/blob/master/packages/startup/src/utils/get-branch-configs.ts#L3). For example, by default a package published from the `master` branch is tagged `prod`. |
@@ -111,7 +112,7 @@ which you can get from the Github or TeamCity organization secret. For example,
111
112
  run: npx startup mfe-publish
112
113
  ```
113
114
 
114
- If `DATADOG_API_KEY` is not provided `mfe-publish` fails with an error. In CI environments, instead of failing it logs a warning and completes successfully.
115
+ If `DATADOG_API_KEY` is not provided, `mfe-publish` logs a warning and skips uploading sourcemaps.
115
116
 
116
117
  :::tip
117
118
  Use `--no-upload-sourcemaps` to prevent `mfe-publish` from attempting to upload sourcemaps, for example, for pre-release versions. See [Publishing options](#publishing-options).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "39.1.0",
3
+ "version": "39.2.0",
4
4
  "description": "Documentation content for Uikit packages published at docs.st.dev",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,6 +15,5 @@
15
15
  },
16
16
  "cli": {
17
17
  "webpack": false
18
- },
19
- "gitHead": "a2471578a506e8c40e90956a5c70cc1638bbe9c1"
18
+ }
20
19
  }