@servicetitan/docs-uikit 28.0.0 → 28.1.1

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.
@@ -4,7 +4,7 @@ title: BREAKING CHANGES
4
4
 
5
5
  ## v28.0.0
6
6
 
7
- ### [servicetitan/startup](./startup)
7
+ ### [@servicetitan/startup](./startup)
8
8
 
9
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
10
 
package/docs/startup.mdx CHANGED
@@ -109,6 +109,8 @@ This is an umbrella command for both unpublishing (cleaning up, `mfe-package-cle
109
109
 
110
110
  - `--clean` - Start the clean-up script instead of publishing.
111
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.
112
114
 
113
115
  #### Publish arguments
114
116
 
@@ -116,7 +118,25 @@ This is an umbrella command for both unpublishing (cleaning up, `mfe-package-cle
116
118
  - `--dry` - Invoke [npm publish --dry-run](https://docs.npmjs.com/cli/v7/commands/npm-publish#dry-run) instead of actually publishing anything.
117
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.
118
120
  - `--force` - Attempts to force publish the package in case no branch configuration is found for the specified branch (`--branch` or current branch).
119
- - `--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/cli/commands/get-branch-configs.ts#L3). For example, in case of branch name `master` the package will be published with the `prod` tag, etc.
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.
120
140
 
121
141
  #### Other auxiliary mfe-publish commands
122
142
 
@@ -145,16 +165,45 @@ $ export KENDO_UI_LICENSE=<license-key>
145
165
  $ npx startup kendo-ui-license
146
166
  ```
147
167
 
148
- ## Build Stages
168
+ ## Build Steps
169
+
170
+ The `build` command executes these steps:
171
+
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.
149
175
 
150
- 1. Generation of TypeScript definition files from CSS, LESS, and SASS Modules (by `typed-css-modules`) for each Lerna package and copying all assets and style files to the `dist` folder for each non-webpack Lerna package in parallel.
151
- 1. Building all non-webpack Lerna packages by TypeScript CLI in hierarchical order via [TypeScript project references](https://www.typescriptlang.org/docs/handbook/project-references.html).
152
- 1. Running Webpack bundling for each webpack Lerna package in parallel.
176
+ The `start` command executes the same steps then watches for changes and automatically reruns each step as needed.
153
177
 
154
178
  #### Important Note
155
179
 
156
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.
157
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
+
158
207
  ## CSS Modules
159
208
 
160
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.
@@ -296,6 +345,32 @@ Set `web-component` to `true` to create the support files and `light` and `full`
296
345
  }
297
346
  ```
298
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
+
361
+ Or you can use relative path to a file that exports an object with detailed configs (useful to share configs between multiple MFEs in repo):
362
+ ```json title="package.json"
363
+ {
364
+ "cli": {
365
+ "web-component": "../../config/web-component.js"
366
+ }
367
+ }
368
+ ```
369
+ ###### Web component config options
370
+
371
+ - `branches` - Set git branch specific configs, used for publishing. See [Branch configs](#branch-configs).
372
+ - `legacyRoot` - Set to opt-out of automatic batching. See [Opting-out of automatic batching](/docs/frontend/react-18#opting-out-of-automatic-batching).
373
+
299
374
  See [MFE configuration](/docs/frontend/micro-frontends/#mfe-configuration) for detailed instructions on configuring MFE applications.
300
375
 
301
376
  ##### Minification
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/docs-uikit",
3
- "version": "28.0.0",
3
+ "version": "28.1.1",
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": "7b905cd6ecfd5bb4a748050a83ebd8ca4e185e09"
19
+ "gitHead": "35c714f4eaf0ba60dd6fa3fc583f0283edfb4a44"
20
20
  }