@servicetitan/docs-uikit 29.0.0 → 30.0.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.
@@ -2,6 +2,16 @@
2
2
  title: BREAKING CHANGES
3
3
  ---
4
4
 
5
+ ## v30.0.0
6
+
7
+ ### [@servicetitan/startup](./startup)
8
+
9
+ - Upgraded ESLint to v9.x and dropped support for legacy "eslintrc" configuration. See [Upgrading to ESLint v9.x](/docs/frontend/upgrading-to-eslint-v9) for guidance.
10
+
11
+ ### [@servicetitan/eslint-config](./eslint-config)
12
+
13
+ - Dropped support for legacy "eslintrc" configuration
14
+
5
15
  ## v29.0.0
6
16
 
7
17
  ### [@servicetitan/startup](./startup)
@@ -86,7 +86,7 @@ See [Authentication Adapters](#authentication-adapters) for more information.
86
86
 
87
87
  The authentication endpoint for protected resources.
88
88
 
89
- - For **Bearer** authentication, this is the endpoint that returns the bearer token to send in **Authorization** headers. Defaults to `${baseURL}/bff/silent-login`.
89
+ - For **Bearer** authentication, this is the endpoint that returns the bearer token to send in **Authorization** headers. Defaults to `${baseURL}/auth`.
90
90
 
91
91
  - For **Token server** authentication, this is the "silent login" endpoint. Defaults to `${baseURL}/bff/silent-login`.
92
92
 
@@ -20,18 +20,20 @@ title: ESLint & Stylelint configurations
20
20
 
21
21
  #### In the Lerna project
22
22
 
23
- ```json title=".eslintrc.json"
24
- {
25
- "extends": ["@servicetitan/eslint-config/mono"]
26
- }
23
+ ```js title="eslint.config.js"
24
+ import { defineConfig } from 'eslint/config';
25
+ import mono from '@servicetitan/eslint-config/mono';
26
+
27
+ export default defineConfig(mono);
27
28
  ```
28
29
 
29
30
  #### Without Lerna
30
31
 
31
- ```json title=".eslintrc.json"
32
- {
33
- "extends": ["@servicetitan/eslint-config/single"]
34
- }
32
+ ```js title="eslint.config.js"
33
+ import { defineConfig } from 'eslint/config';
34
+ import single from '@servicetitan/eslint-config/single';
35
+
36
+ export default defineConfig(single);
35
37
  ```
36
38
 
37
39
  ### Stylelint
@@ -18,9 +18,22 @@ Folder schema is a flexible tool to configure a strict hierarchy of files in you
18
18
 
19
19
  Contains `@servicetitan/folder-schema/check` rule with the next options:
20
20
 
21
- - `root` - entry point to start recursive checking
22
- - `config` - object with a configuration of files hierarchy
23
- - `docLink?` - link to a document describing a required files hierarchy
21
+ | Name | Description |
22
+ | :--------- | :------------------------------------------------------------------------------------------------------------------------------ |
23
+ | `config` | Object with a configuration of files hierarchy |
24
+ | `root?` | Optional entry point to start recursive checking. Defaults to the current working directory. |
25
+ | `docLink?` | Optional link to a document describing a required files hierarchy. Defaults to https://docs.st.dev/docs/frontend/file-structure |
26
+
27
+ ### Configuration
28
+
29
+ Use the `eslint.config.{js,cjs,mjs}` file to configure rules using the [flag config](https://eslint.org/docs/latest/use/configure/configuration-files) style.
30
+
31
+ ```js title="eslint.config.js"
32
+ import folderSchemaPlugin from '@servicetitan/eslint-plugin-folder-schema';
33
+
34
+ // Call configs.recommended with desired options
35
+ export = [...folderSchemaPlugin.configs.recommended({ config: require.resolve('./config') })];
36
+ ```
24
37
 
25
38
  ## @servicetitan/folder-lint
26
39
 
package/docs/startup.mdx CHANGED
@@ -26,31 +26,22 @@ Updating build tooling is typically a daunting and time-consuming task. When new
26
26
  Experimental flags don't follow semver. There might be breaking changes in minor versions of `@servicetitan/startup` when you opt-in to experimental flags.
27
27
  :::
28
28
 
29
- ### init
29
+ ### convert-eslint-config
30
30
 
31
- Generates initial project structure. This command should be run via `npx` in an empty folder.
31
+ Convert an ESLint v8 configuration to v9 format.
32
32
 
33
33
  ```sh
34
- $ npx -y @servicetitan/startup@latest init
34
+ $ npx startup convert-eslint-config
35
35
  ```
36
36
 
37
- ### install
38
-
39
- Installs the package dependencies. This command should be run via `npx` before the build.
37
+ Use this command when upgrading from ESLint v8 to v9, to convert a v8 `.eslintrc.json` to the equivalent `eslint.config.mjs`. See [Upgrading to ESLint v9.x](/docs/frontend/upgrading-to-eslint-v9) for guidance on upgrading to ESLint v9.
40
38
 
41
- See [package.json in the example project](https://github.com/search?q=repo%3Aservicetitan%2Ffrontend-example+path%3A**%2Fpackage.json+%22startup+install%22&type=code).
39
+ The command takes no arguments. Simply run it from a directory with `.eslintrc.json` and it creates `eslint.config.mjs` in the same location.
42
40
 
43
- ### start
44
-
45
- Runs package in the development mode. Applications will be hosted on sequential free ports starting from 8080. Pages will automatically reload on changes to the code.
46
-
47
- #### Arguments
48
-
49
- - `--scope <glob>` - Include only packages with names matching the given glob.
50
- - `--ignore <glob>` - Exclude packages with names matching the given glob.
51
- - `--esbuild` - Use [esbuild-loader](https://github.com/privatenumber/esbuild-loader) to process TypeScript files instead of ts-loader.
52
- - `--experimental-bundlers` - Use experimental build optimizations (alternative loaders and bundlers)
53
- - `--code-coverage` - Add [instrumentation](https://github.com/JS-DevTools/coverage-istanbul-loader) to bundled code in order to collect code coverage
41
+ :::caution
42
+ Comments are not copied from the source `.eslintrc.json` to the output file.
43
+ If the source file contains important comments, copy them manually to the output file.
44
+ :::
54
45
 
55
46
  ### build
56
47
 
@@ -66,14 +57,37 @@ Build packages for production to the `dist/bundle` folders. It bundles them in p
66
57
  - `--experimental-bundlers` - Use experimental build optimizations (alternative loaders and bundlers)
67
58
  - `--code-coverage` - Add [instrumentation](https://github.com/JS-DevTools/coverage-istanbul-loader) to bundled code in order to collect code coverage
68
59
 
69
- ### test
60
+ ### init
70
61
 
71
- Runs all existing tests in all packages.
62
+ Generates initial project structure. This command should be run via `npx` in an empty folder.
72
63
 
73
- To run tests a subset of tests is possible to pass paths to specific directories or test files as positional parameters.
64
+ ```sh
65
+ $ npx -y @servicetitan/startup@latest init
66
+ ```
67
+
68
+ ### install
69
+
70
+ Installs the package dependencies. This command should be run via `npx` before the build.
71
+
72
+ See [package.json in the example project](https://github.com/search?q=repo%3Aservicetitan%2Ffrontend-example+path%3A**%2Fpackage.json+%22startup+install%22&type=code).
73
+
74
+ ### kendo-ui-license
75
+
76
+ Activates KendoReact components by installing the license key. The license key is only installed if the project depends on `@progress/kendo` components. Otherwise, this command has no effect.
77
+
78
+ **Note:** The [build](#build) command automatically detects when a project uses KendoRect components and runs this command.
79
+
80
+ Use it to install the license key separately from a build, or to override the default license key.
74
81
 
75
82
  ```sh
76
- $ npx startup test -- packages/desktop/app/modules/inventory/
83
+ $ npx startup kendo-ui-license
84
+ ```
85
+
86
+ To install a different license, set the KENDO_UI_LICENSE environment variable to the key to use.
87
+
88
+ ```sh
89
+ $ export KENDO_UI_LICENSE=<license-key>
90
+ $ npx startup kendo-ui-license
77
91
  ```
78
92
 
79
93
  ### lint
@@ -143,23 +157,26 @@ To customize the recognized branches for an MFE set `cli.web-component.branches`
143
157
 
144
158
  - `publishTag: string` - Tag used when publishing package.
145
159
 
146
- ### kendo-ui-license
160
+ ### start
147
161
 
148
- Activates KendoReact components by installing the license key. The license key is only installed if the project depends on `@progress/kendo` components. Otherwise, this command has no effect.
162
+ Runs package in the development mode. Applications will be hosted on sequential free ports starting from 8080. Pages will automatically reload on changes to the code.
149
163
 
150
- **Note:** The [build](#build) command automatically detects when a project uses KendoRect components and runs this command.
164
+ #### Arguments
151
165
 
152
- Use it to install the license key separately from a build, or to override the default license key.
166
+ - `--scope <glob>` - Include only packages with names matching the given glob.
167
+ - `--ignore <glob>` - Exclude packages with names matching the given glob.
168
+ - `--esbuild` - Use [esbuild-loader](https://github.com/privatenumber/esbuild-loader) to process TypeScript files instead of ts-loader.
169
+ - `--experimental-bundlers` - Use experimental build optimizations (alternative loaders and bundlers)
170
+ - `--code-coverage` - Add [instrumentation](https://github.com/JS-DevTools/coverage-istanbul-loader) to bundled code in order to collect code coverage
153
171
 
154
- ```sh
155
- $ npx startup kendo-ui-license
156
- ```
172
+ ### test
157
173
 
158
- To install a different license, set the KENDO_UI_LICENSE environment variable to the key to use.
174
+ Runs all existing tests in all packages.
175
+
176
+ To run tests a subset of tests is possible to pass paths to specific directories or test files as positional parameters.
159
177
 
160
178
  ```sh
161
- $ export KENDO_UI_LICENSE=<license-key>
162
- $ npx startup kendo-ui-license
179
+ $ npx startup test -- packages/desktop/app/modules/inventory/
163
180
  ```
164
181
 
165
182
  ## Build Steps
@@ -155,7 +155,7 @@ The following metadata about an MFE is available from `useMFEMetadataContext` ho
155
155
 
156
156
  ### getValueForEnvironment
157
157
 
158
- `getValueForEnvironment` detects the Monolith environment and returns a corresponding value.
158
+ `getValueForEnvironment` detects the host environment and returns a corresponding value.
159
159
 
160
160
  :::caution
161
161
  When no value is provided for the detected environment, `getValueForEnvironment` returns `undefined`.
@@ -163,22 +163,36 @@ When no value is provided for the detected environment, `getValueForEnvironment`
163
163
 
164
164
  #### Props
165
165
 
166
- | Name | Type | Description |
167
- | :------------------- | :----------------------------- | :----------------------------------------------------------------------------------------- |
168
- | `values` | `Record<Environment, string>` | Object that maps each environment to a value (see below). |
169
- | `defaultEnvironment` | `Environment` | The environment to use when the current environment is not recognized. Defaults to `"qa"`. |
170
- | `hostname` | `string` | The hostname of the current environment. Defaults to `window.location.hostname` |
166
+ | Name | Type | Description |
167
+ | :------------------- | :----------------------- | :------------------------------------------------------------------------------------------------------------------------ |
168
+ | `values` | `Record<string, string>` | Object that maps each environment to a value (see below). |
169
+ | `defaultEnvironment` | `keyof typeof values` | The environment to use when the current environment is not recognized or is not included in `values`. Defaults to `"qa"`. |
170
+ | `hostname` | `string` | The hostname of the current environment. Defaults to `window.location.hostname` |
171
171
 
172
172
  The recognized environments are:
173
173
 
174
- | Environment | Description |
175
- | :---------- | :-------------------------------------------------------------- |
176
- | **dev** | Development environment (e.g., `localhost`) |
177
- | **go** | Production environment |
178
- | **qa** | QA environment |
179
- | **next** | Next environment |
180
- | **stage** | Staging environment |
181
- | **test** | Unit test environment (i.e., `process.env.NODE_ENV === 'test'`) |
174
+ | Environment | Description |
175
+ | :---------------- | :----------------------------------------------------------------- |
176
+ | **dev** | Development environment (i.e., `localhost`, `127.0.0.1`) |
177
+ | **go** | Production environment |
178
+ | **qa** | QA environment |
179
+ | **next** | Next environment |
180
+ | **stage** | Staging environment |
181
+ | **test** | Unit test environment (i.e., `process.env.NODE_ENV === 'test'`) |
182
+ | `<string>` | Custom environment that matches against`<string>.servicetitan.com` |
183
+ | `<string>.st.dev` | Custom environment that matches against `<string>.st.dev` |
184
+
185
+ #### Custom environments
186
+
187
+ Custom environments are for applications and services that run separately from the Monolith.
188
+ For example, to associate **prod** with `my-service.servicetitan.com` and **stage** with `my-service-stage.st.dev`:
189
+
190
+ ```json
191
+ {
192
+ "my-service": "prod", // Matches my-service.servicetitan.com
193
+ "stage.st.dev": "stage" // Matches *stage.st.dev
194
+ }
195
+ ```
182
196
 
183
197
  #### Examples
184
198
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "29.0.0",
3
+ "version": "30.0.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": "67b2763ad7c21532ea47c920974f87e8de433d32"
19
+ "gitHead": "e182cbb85cf66d62f235a9ca172fc04dc705fd0a"
20
20
  }