@servicetitan/docs-uikit 27.4.0 → 28.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/BREAKING_CHANGES.mdx +6 -0
- package/docs/startup.mdx +78 -17
- package/docs/web-components.mdx +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
title: BREAKING CHANGES
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
## v28.0.0
|
|
6
|
+
|
|
7
|
+
### [@servicetitan/startup](./startup)
|
|
8
|
+
|
|
9
|
+
- Changed the default [moduleResolution](https://www.typescriptlang.org/tsconfig/#moduleResolution) from `node` to `bundler` to support importing from `@servicetitan/anvil2/token`. CommonJS packages that require the previous value must override `moduleResolution` in the package's `tsconfig.json`.
|
|
10
|
+
|
|
5
11
|
## v27.0.0
|
|
6
12
|
|
|
7
13
|
### [@servicetitan/startup](./startup)
|
package/docs/startup.mdx
CHANGED
|
@@ -30,19 +30,15 @@ Experimental flags don't follow semver. There might be breaking changes in minor
|
|
|
30
30
|
|
|
31
31
|
Generates initial project structure. This command should be run via `npx` in an empty folder.
|
|
32
32
|
|
|
33
|
+
```sh
|
|
34
|
+
$ npx -y @servicetitan/startup@latest init
|
|
33
35
|
```
|
|
34
|
-
npx -y @servicetitan/startup@latest init
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
#### Arguments
|
|
38
|
-
|
|
39
|
-
- `--react17` - Generate a project that uses React 17.x instead of React 18.x
|
|
40
36
|
|
|
41
37
|
### install
|
|
42
38
|
|
|
43
39
|
Installs the package dependencies. This command should be run via `npx` before the build.
|
|
44
40
|
|
|
45
|
-
See [
|
|
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).
|
|
46
42
|
|
|
47
43
|
### start
|
|
48
44
|
|
|
@@ -77,7 +73,7 @@ Runs all existing tests in all packages.
|
|
|
77
73
|
To run tests a subset of tests is possible to pass paths to specific directories or test files as positional parameters.
|
|
78
74
|
|
|
79
75
|
```sh
|
|
80
|
-
startup test -- packages/desktop/app/modules/inventory/
|
|
76
|
+
$ npx startup test -- packages/desktop/app/modules/inventory/
|
|
81
77
|
```
|
|
82
78
|
|
|
83
79
|
### lint
|
|
@@ -87,14 +83,14 @@ Runs ESLint and Stylelint for all codebase projects.
|
|
|
87
83
|
To run ESLint and Stylelint on certain packages or subsystems it is possible to pass paths to specific directories as positional parameters.
|
|
88
84
|
|
|
89
85
|
```sh
|
|
90
|
-
startup lint -- packages/desktop/app/modules/inventory/
|
|
86
|
+
$ npx startup lint -- packages/desktop/app/modules/inventory/
|
|
91
87
|
```
|
|
92
88
|
|
|
93
89
|
You can use multiple paths and your shell expressions which expand to directories.
|
|
94
90
|
|
|
95
91
|
```sh
|
|
96
|
-
startup lint -- packages/desktop/app/modules/lead/ packages/desktop/app/modules/inventory/
|
|
97
|
-
startup lint -- packages/desktop/app/modules/{lead,inventory}/
|
|
92
|
+
$ npx startup lint -- packages/desktop/app/modules/lead/ packages/desktop/app/modules/inventory/
|
|
93
|
+
$ npx startup lint -- packages/desktop/app/modules/{lead,inventory}/
|
|
98
94
|
```
|
|
99
95
|
|
|
100
96
|
#### Arguments
|
|
@@ -113,6 +109,8 @@ This is an umbrella command for both unpublishing (cleaning up, `mfe-package-cle
|
|
|
113
109
|
|
|
114
110
|
- `--clean` - Start the clean-up script instead of publishing.
|
|
115
111
|
- `--count <number>` - The number of packages to be unpublished (cleaned up). The default value is 5. This argument has effect only when `--clean` is specified too.
|
|
112
|
+
- `--branch` - Clean versions related to the current git branch. This argument has effect only when `--clean` is specified too.
|
|
113
|
+
- `--branch <branch_name>` - Clean versions related to the specified git branch. This argument has effect only when `--clean` is specified too.
|
|
116
114
|
|
|
117
115
|
#### Publish arguments
|
|
118
116
|
|
|
@@ -120,8 +118,25 @@ This is an umbrella command for both unpublishing (cleaning up, `mfe-package-cle
|
|
|
120
118
|
- `--dry` - Invoke [npm publish --dry-run](https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run) instead of actually publishing anything.
|
|
121
119
|
- `--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.
|
|
122
120
|
- `--force` - Attempts to force publish the package in case no branch configuration is found for the specified branch (`--branch` or current branch).
|
|
123
|
-
- `--tag <string> | false` - If the value is `false` the package will be published without a custom [tag](https://docs.npmjs.com/cli/v7/commands/npm-publish#tag) (meaning it will be published with the default `latest` tag). If another value is specified it will be used as the tag name otherwise the tag value will be mapped from [following object](https://github.com/servicetitan/uikit/blob/master/packages/startup/src/
|
|
124
|
-
|
|
121
|
+
- `--tag <string> | false` - If the value is `false` the package will be published without a custom [tag](https://docs.npmjs.com/cli/v7/commands/npm-publish#tag) (meaning it will be published with the default `latest` tag). If another value is specified it will be used as the tag name otherwise the tag value will be mapped from [branch configs](#branch-configs). If no branch configs specified, tag value will be mapped from [following object](https://github.com/servicetitan/uikit/blob/master/packages/startup/src/utils/get-branch-configs.ts#L3). For example, in case of branch name `master` the package will be published with the `prod` tag, etc.
|
|
122
|
+
|
|
123
|
+
#### Branch configs
|
|
124
|
+
|
|
125
|
+
To customize the publish tags for your MFE set `cli.web-component.branches` to an object that maps branch names to the associated tags. For example,
|
|
126
|
+
|
|
127
|
+
```json
|
|
128
|
+
"cli": {
|
|
129
|
+
"web-component": {
|
|
130
|
+
"branches": {
|
|
131
|
+
"qa": { "publishTag": "qa" },
|
|
132
|
+
"staging": { "publishTag": "staging" },
|
|
133
|
+
"master": { "publishTag": "prod" }
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
- `publishTag: string` - Tag used when publishing package.
|
|
125
140
|
|
|
126
141
|
#### Other auxiliary mfe-publish commands
|
|
127
142
|
|
|
@@ -150,16 +165,45 @@ $ export KENDO_UI_LICENSE=<license-key>
|
|
|
150
165
|
$ npx startup kendo-ui-license
|
|
151
166
|
```
|
|
152
167
|
|
|
153
|
-
## Build
|
|
168
|
+
## Build Steps
|
|
169
|
+
|
|
170
|
+
The `build` command executes these steps:
|
|
154
171
|
|
|
155
|
-
1.
|
|
156
|
-
1.
|
|
157
|
-
1.
|
|
172
|
+
1. For each non-webpack package, generate TypeScript definitions from CSS, LESS, and SASS modules, and copy assets and style files to the output folder. This step runs in parallel for each package.
|
|
173
|
+
1. Compile non-webpack packages in order (via [TypeScript project references](https://www.typescriptlang.org/docs/handbook/project-references.html)).
|
|
174
|
+
1. Bundle webpack packages, in parallel.
|
|
175
|
+
|
|
176
|
+
The `start` command executes the same steps then watches for changes and automatically reruns each step as needed.
|
|
158
177
|
|
|
159
178
|
#### Important Note
|
|
160
179
|
|
|
161
180
|
It doesn't support hierarchical watch because we are not maintaining hierarchy ourselves, so we have to build everything first and then run watch when order is no longer important. Also, it doesn't support dependencies between the Webpack bundles.
|
|
162
181
|
|
|
182
|
+
## Package Setup
|
|
183
|
+
|
|
184
|
+
Because `startup` compiles and builds in separate steps, packages should export the compiled output instead of the TypeScript source files.
|
|
185
|
+
|
|
186
|
+
For example, the Webpack documentation suggests a configuration that directs webpack to enter through `./src/index.ts` and load all `.ts` and `.tsx` files through `ts-loader`. However, because `startup` precompiles Typescript files, this is redundant and webpack should be configured to load the compiled Javascript.
|
|
187
|
+
|
|
188
|
+
```json title="package.json"
|
|
189
|
+
{
|
|
190
|
+
"main": "./dist/index.js",
|
|
191
|
+
"typings": "./dist/index.d.ts"
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
And, [TypeScript project references](https://www.typescriptlang.org/docs/handbook/project-references.html) should be used to describe the dependencies between components.
|
|
196
|
+
|
|
197
|
+
```json title="tsconfig.json"
|
|
198
|
+
{
|
|
199
|
+
"references": [
|
|
200
|
+
{ "path": "../component-a" },
|
|
201
|
+
{ "path": "../component-b" },
|
|
202
|
+
{ "path": "../component-c" }
|
|
203
|
+
]
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
163
207
|
## CSS Modules
|
|
164
208
|
|
|
165
209
|
This project supports [CSS Modules](https://github.com/css-modules/css-modules) alongside regular stylesheets using the `[name].module.{css,less,scss}` file naming convention. It allows the scoping of CSS by automatically creating a unique class name.
|
|
@@ -301,6 +345,23 @@ Set `web-component` to `true` to create the support files and `light` and `full`
|
|
|
301
345
|
}
|
|
302
346
|
```
|
|
303
347
|
|
|
348
|
+
Or you can set an object with detailed configs:
|
|
349
|
+
```json title="package.json"
|
|
350
|
+
{
|
|
351
|
+
"cli": {
|
|
352
|
+
"web-component": {
|
|
353
|
+
"branches": {
|
|
354
|
+
"qa": { "publishTag": "qa" }
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
```
|
|
360
|
+
###### Web component config options
|
|
361
|
+
|
|
362
|
+
- `branches` - Set git branch specific configs, used for publishing. See [Branch configs](#branch-configs).
|
|
363
|
+
- `legacyRoot` - Set to opt-out of automatic batching. See [Opting-out of automatic batching](/docs/frontend/react-18#opting-out-of-automatic-batching).
|
|
364
|
+
|
|
304
365
|
See [MFE configuration](/docs/frontend/micro-frontends/#mfe-configuration) for detailed instructions on configuring MFE applications.
|
|
305
366
|
|
|
306
367
|
##### Minification
|
package/docs/web-components.mdx
CHANGED
|
@@ -41,7 +41,7 @@ export const Foo: React.FC = () => {
|
|
|
41
41
|
| `loadingFallbackDelayed` | controls whether to render the loading fallback immediately, or after a short delay [(see below)](#fallback-delay) |
|
|
42
42
|
| `errorFallback` | optional JSX element to render when the MFE fails to load |
|
|
43
43
|
| `className` | additional CSS classes for the MFE web component element |
|
|
44
|
-
| `cache` | optional cache strategy for the MFE [(see below)](#cache)
|
|
44
|
+
| `cache` | optional cache strategy for the MFE [(see below)](#cache-strategy) |
|
|
45
45
|
|
|
46
46
|
#### Loading fallback delay {#fallback-delay}
|
|
47
47
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@servicetitan/docs-uikit",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.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": "27d173aad0e016014bed59385886d0fd7ca3fb17"
|
|
20
20
|
}
|