@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.
- package/dist/cli/utils/bundle.d.ts.map +1 -1
- package/dist/cli/utils/bundle.js +25 -14
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/utils/read-json.d.ts +1 -0
- package/dist/utils/read-json.d.ts.map +1 -1
- package/dist/utils/read-json.js +10 -1
- package/dist/utils/read-json.js.map +1 -1
- package/dist/webpack/development.config.d.ts +1 -1
- package/dist/webpack/development.config.d.ts.map +1 -1
- package/dist/webpack/development.config.js +1 -1
- package/dist/webpack/development.config.js.map +1 -1
- package/dist/webpack/index.d.ts +2 -1
- package/dist/webpack/index.d.ts.map +1 -1
- package/dist/webpack/index.js.map +1 -1
- package/dist/webpack/production.config.d.ts +1 -1
- package/dist/webpack/production.config.d.ts.map +1 -1
- package/dist/webpack/production.config.js +1 -1
- package/dist/webpack/production.config.js.map +1 -1
- package/dist/webpack/shared.config.d.ts +1 -1
- package/dist/webpack/shared.config.d.ts.map +1 -1
- package/dist/webpack/shared.config.js +5 -6
- package/dist/webpack/shared.config.js.map +1 -1
- package/package.json +14 -14
- package/src/cli/utils/bundle.ts +54 -24
- package/src/utils/read-json.ts +8 -0
- package/src/webpack/development.config.ts +1 -1
- package/src/webpack/index.ts +2 -1
- package/src/webpack/production.config.ts +1 -1
- package/src/webpack/shared.config.ts +6 -8
- package/template/packages/application/package.json +1 -1
- package/template/packages/application/src/app.css +1 -1
- package/CHANGELOG.md +0 -974
- package/template/.gitignore +0 -12
package/src/webpack/index.ts
CHANGED
|
@@ -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
|
|
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
|
-
<${
|
|
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(
|
|
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/
|
|
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}['${
|
|
280
|
+
[dependency]: `${variable}['${name}']`,
|
|
283
281
|
}),
|
|
284
282
|
{}
|
|
285
283
|
),
|