@servicetitan/startup 21.9.0 → 22.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.
@@ -14,13 +14,14 @@ export type Overrides = DevelopmentOverrides | ProductionOverrides;
14
14
 
15
15
  export interface Options {
16
16
  embed?: boolean;
17
+ name: string;
17
18
  }
18
19
 
19
20
  function isProduction(overrides: Overrides): overrides is ProductionOverrides {
20
21
  return overrides.configuration.mode === 'production';
21
22
  }
22
23
 
23
- export function createWebpackConfig(overrides: Overrides, options?: Options): Configuration {
24
+ export function createWebpackConfig(overrides: Overrides, options: Options): Configuration {
24
25
  return isProduction(overrides)
25
26
  ? createProductionConfig(overrides, options)
26
27
  : createDevelopmentConfig(overrides, options);
@@ -25,7 +25,7 @@ const cdnPath = process.env.CLIENT_CDN_PATH;
25
25
 
26
26
  export function createConfig(
27
27
  { configuration, plugins = {} }: Overrides,
28
- options: Options = {}
28
+ options: Options
29
29
  ): Configuration {
30
30
  const { MiniCssExtractPlugin: miniCssExtractPluginOptions = {} } = plugins;
31
31
 
@@ -21,7 +21,6 @@ import {
21
21
  getPackageDependencyVersion,
22
22
  isExposeSharedDependencies,
23
23
  isWebComponent,
24
- readJson,
25
24
  loadSharedDependencies,
26
25
  } from '../utils';
27
26
  import { splitByEntry } from './utils/split-by-entry';
@@ -37,13 +36,12 @@ export interface Overrides {
37
36
  }
38
37
 
39
38
  export function createConfig(
40
- { configuration = {}, plugins = {} }: Overrides = {},
41
- { embed }: Options = {}
39
+ { configuration = {}, plugins = {} }: Overrides,
40
+ { embed, name }: Options
42
41
  ): Configuration {
43
42
  const { source, destination } = getFolders();
44
43
  const packageData = getPackageData();
45
44
  const dependencies = isExposeSharedDependencies() ? packageData.dependencies : undefined;
46
- const metadata = isWebComponent() ? readJson(`./${destination}/metadata.json`) : undefined;
47
45
 
48
46
  const {
49
47
  ForkTsCheckerWebpackPlugin: forkTsCheckerWebpackPluginOptions = {},
@@ -179,7 +177,7 @@ export function createConfig(
179
177
  ${headTags}
180
178
  </head>
181
179
  <body>
182
- <${metadata.name} style-urls="${styleUrls}" />
180
+ <${name} style-urls="${styleUrls}" />
183
181
 
184
182
  ${bodyTags}
185
183
  </body>
@@ -223,7 +221,7 @@ export function createConfig(
223
221
  ? [
224
222
  new DefinePlugin({
225
223
  // eslint-disable-next-line @typescript-eslint/naming-convention
226
- WEB_COMPONENT_NAME: JSON.stringify(metadata.name),
224
+ WEB_COMPONENT_NAME: JSON.stringify(name),
227
225
  }),
228
226
  new VirtualModulesPlugin({
229
227
  ...(!fs.existsSync(
@@ -231,7 +229,7 @@ export function createConfig(
231
229
  )
232
230
  ? {
233
231
  [path.join(process.cwd(), `${source}/design-system.css`)]: [
234
- `@import '~@servicetitan/tokens/dist/tokens.css';`,
232
+ `@import '~@servicetitan/tokens/core/tokens.css';`,
235
233
  `@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,
236
234
  `@import '~@servicetitan/design-system/dist/system.min.css';`,
237
235
  ].join('\n'),
@@ -279,7 +277,7 @@ export function createConfig(
279
277
  externals: Object.entries(sharedDependencies).reduce(
280
278
  (result, [dependency, variable]) =>
281
279
  Object.assign(result, {
282
- [dependency]: `${variable}['${metadata.name}']`,
280
+ [dependency]: `${variable}['${name}']`,
283
281
  }),
284
282
  {}
285
283
  ),
@@ -7,7 +7,7 @@
7
7
  "typings": "./dist/index.d.ts",
8
8
  "scripts": {},
9
9
  "dependencies": {
10
- "@servicetitan/design-system": "~11.1.0",
10
+ "@servicetitan/design-system": "~12.2.0",
11
11
  "@servicetitan/link-item": "~20.0.0",
12
12
  "feature-a": "^0.0.0",
13
13
  "feature-b": "^0.0.0",
@@ -1,4 +1,4 @@
1
- @import '~@servicetitan/tokens/dist/tokens.css';
1
+ @import '~@servicetitan/tokens/core/tokens.css';
2
2
  @import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';
3
3
  @import '~@servicetitan/design-system/dist/system.min.css';
4
4