@servicetitan/startup 32.2.0 → 32.3.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.
- package/dist/cli/commands/build.d.ts +36 -7
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/build.js +35 -10
- package/dist/cli/commands/build.js.map +1 -1
- package/dist/cli/commands/bundle-package.d.ts +9 -10
- package/dist/cli/commands/bundle-package.d.ts.map +1 -1
- package/dist/cli/commands/bundle-package.js +6 -22
- package/dist/cli/commands/bundle-package.js.map +1 -1
- package/dist/cli/commands/clean.d.ts +2 -2
- package/dist/cli/commands/clean.d.ts.map +1 -1
- package/dist/cli/commands/clean.js +16 -4
- package/dist/cli/commands/clean.js.map +1 -1
- package/dist/cli/commands/convert-eslint-config.d.ts +2 -2
- package/dist/cli/commands/convert-eslint-config.d.ts.map +1 -1
- package/dist/cli/commands/convert-eslint-config.js +3 -4
- package/dist/cli/commands/convert-eslint-config.js.map +1 -1
- package/dist/cli/commands/eslint.d.ts +3 -5
- package/dist/cli/commands/eslint.d.ts.map +1 -1
- package/dist/cli/commands/eslint.js +2 -18
- package/dist/cli/commands/eslint.js.map +1 -1
- package/dist/cli/commands/get-command.d.ts.map +1 -1
- package/dist/cli/commands/get-command.js +2 -0
- package/dist/cli/commands/get-command.js.map +1 -1
- package/dist/cli/commands/index.d.ts +0 -1
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +0 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +10 -6
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +9 -8
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/install.d.ts +21 -7
- package/dist/cli/commands/install.d.ts.map +1 -1
- package/dist/cli/commands/install.js +33 -11
- package/dist/cli/commands/install.js.map +1 -1
- package/dist/cli/commands/kendo-ui-license.d.ts +3 -3
- package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
- package/dist/cli/commands/kendo-ui-license.js +17 -5
- package/dist/cli/commands/kendo-ui-license.js.map +1 -1
- package/dist/cli/commands/lint.d.ts +31 -12
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/commands/lint.js +34 -13
- package/dist/cli/commands/lint.js.map +1 -1
- package/dist/cli/commands/mfe-list.d.ts +46 -0
- package/dist/cli/commands/mfe-list.d.ts.map +1 -0
- package/dist/cli/commands/mfe-list.js +200 -0
- package/dist/cli/commands/mfe-list.js.map +1 -0
- package/dist/cli/commands/mfe-package-clean.d.ts +29 -5
- package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-clean.js +28 -5
- package/dist/cli/commands/mfe-package-clean.js.map +1 -1
- package/dist/cli/commands/mfe-package-publish.d.ts +37 -5
- package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-package-publish.js +36 -5
- package/dist/cli/commands/mfe-package-publish.js.map +1 -1
- package/dist/cli/commands/mfe-publish.d.ts +17 -4
- package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
- package/dist/cli/commands/mfe-publish.js +37 -7
- package/dist/cli/commands/mfe-publish.js.map +1 -1
- package/dist/cli/commands/prepare-package.d.ts +3 -5
- package/dist/cli/commands/prepare-package.d.ts.map +1 -1
- package/dist/cli/commands/prepare-package.js +2 -18
- package/dist/cli/commands/prepare-package.js.map +1 -1
- package/dist/cli/commands/review/review.d.ts +14 -6
- package/dist/cli/commands/review/review.d.ts.map +1 -1
- package/dist/cli/commands/review/review.js +27 -23
- package/dist/cli/commands/review/review.js.map +1 -1
- package/dist/cli/commands/run-task.d.ts +10 -6
- package/dist/cli/commands/run-task.d.ts.map +1 -1
- package/dist/cli/commands/run-task.js +16 -13
- package/dist/cli/commands/run-task.js.map +1 -1
- package/dist/cli/commands/start.d.ts +28 -7
- package/dist/cli/commands/start.d.ts.map +1 -1
- package/dist/cli/commands/start.js +27 -10
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/styles-check.d.ts +2 -2
- package/dist/cli/commands/styles-check.d.ts.map +1 -1
- package/dist/cli/commands/styles-check.js +2 -1
- package/dist/cli/commands/styles-check.js.map +1 -1
- package/dist/cli/commands/test/tests.d.ts +14 -5
- package/dist/cli/commands/test/tests.d.ts.map +1 -1
- package/dist/cli/commands/test/tests.js +26 -13
- package/dist/cli/commands/test/tests.js.map +1 -1
- package/dist/cli/commands/types.d.ts +13 -4
- package/dist/cli/commands/types.d.ts.map +1 -1
- package/dist/cli/commands/types.js +28 -0
- package/dist/cli/commands/types.js.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.d.ts +3 -5
- package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -1
- package/dist/cli/commands/upload-sourcemaps.js +5 -20
- package/dist/cli/commands/upload-sourcemaps.js.map +1 -1
- package/dist/cli/index.js +47 -39
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/tasks/swc-compile-package.d.ts +2 -2
- package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/swc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.d.ts +2 -2
- package/dist/cli/tasks/tsc-compile-package.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile-package.js +1 -1
- package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
- package/dist/cli/tasks/tsc-compile.d.ts +2 -2
- package/dist/cli/tasks/tsc-compile.d.ts.map +1 -1
- package/dist/cli/tasks/tsc-compile.js.map +1 -1
- package/dist/cli/utils/bundle.js +1 -1
- package/dist/cli/utils/bundle.js.map +1 -1
- package/dist/cli/utils/cli-npm.d.ts +14 -0
- package/dist/cli/utils/cli-npm.d.ts.map +1 -1
- package/dist/cli/utils/cli-npm.js +44 -0
- package/dist/cli/utils/cli-npm.js.map +1 -1
- package/dist/cli/utils/cli-os.d.ts +2 -2
- package/dist/cli/utils/cli-os.d.ts.map +1 -1
- package/dist/cli/utils/cli-os.js +13 -9
- package/dist/cli/utils/cli-os.js.map +1 -1
- package/dist/cli/utils/eslint.d.ts +2 -1
- package/dist/cli/utils/eslint.d.ts.map +1 -1
- package/dist/cli/utils/eslint.js.map +1 -1
- package/dist/cli/utils/index.d.ts +1 -0
- package/dist/cli/utils/index.d.ts.map +1 -1
- package/dist/cli/utils/index.js +1 -0
- package/dist/cli/utils/index.js.map +1 -1
- package/dist/cli/utils/is-tty.d.ts +2 -0
- package/dist/cli/utils/is-tty.d.ts.map +1 -0
- package/dist/cli/utils/is-tty.js +15 -0
- package/dist/cli/utils/is-tty.js.map +1 -0
- package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
- package/dist/cli/utils/lerna-exec.js +2 -0
- package/dist/cli/utils/lerna-exec.js.map +1 -1
- package/dist/cli/utils/maybe-create-git-folder.d.ts +2 -3
- package/dist/cli/utils/maybe-create-git-folder.d.ts.map +1 -1
- package/dist/cli/utils/maybe-create-git-folder.js +4 -9
- package/dist/cli/utils/maybe-create-git-folder.js.map +1 -1
- package/dist/cli/utils/process-tree.d.ts.map +1 -1
- package/dist/cli/utils/process-tree.js +2 -2
- package/dist/cli/utils/process-tree.js.map +1 -1
- package/dist/cli/utils/set-node-options.d.ts.map +1 -1
- package/dist/cli/utils/set-node-options.js +2 -1
- package/dist/cli/utils/set-node-options.js.map +1 -1
- package/dist/utils/find-packages.d.ts +1 -0
- package/dist/utils/find-packages.d.ts.map +1 -1
- package/dist/utils/find-packages.js.map +1 -1
- package/dist/utils/format-relative-date.d.ts +2 -0
- package/dist/utils/format-relative-date.d.ts.map +1 -0
- package/dist/utils/format-relative-date.js +60 -0
- package/dist/utils/format-relative-date.js.map +1 -0
- package/dist/utils/get-configuration.d.ts +1 -0
- package/dist/utils/get-configuration.d.ts.map +1 -1
- package/dist/utils/get-configuration.js +1 -0
- package/dist/utils/get-configuration.js.map +1 -1
- package/dist/utils/get-packages.d.ts +3 -5
- package/dist/utils/get-packages.d.ts.map +1 -1
- package/dist/utils/get-packages.js +1 -4
- package/dist/utils/get-packages.js.map +1 -1
- package/dist/utils/get-startup-version.d.ts.map +1 -1
- package/dist/utils/get-startup-version.js +1 -1
- package/dist/utils/get-startup-version.js.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.d.ts +1 -1
- package/dist/webpack/configs/loaders/style-loader.d.ts.map +1 -1
- package/dist/webpack/configs/loaders/style-loader.js +2 -2
- package/dist/webpack/configs/loaders/style-loader.js.map +1 -1
- package/dist/webpack/configs/optimization-config.js +5 -5
- package/dist/webpack/configs/optimization-config.js.map +1 -1
- package/dist/webpack/configs/output-config.d.ts.map +1 -1
- package/dist/webpack/configs/output-config.js +14 -7
- package/dist/webpack/configs/output-config.js.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js +10 -3
- package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
- package/package.json +9 -8
- package/src/cli/commands/__tests__/build.test.ts +1 -1
- package/src/cli/commands/__tests__/bundle-package.test.ts +22 -2
- package/src/cli/commands/__tests__/install.test.ts +42 -4
- package/src/cli/commands/__tests__/lint.test.ts +1 -1
- package/src/cli/commands/__tests__/mfe-list.test.ts +394 -0
- package/src/cli/commands/__tests__/mfe-publish.test.ts +25 -0
- package/src/cli/commands/__tests__/start.test.ts +1 -1
- package/src/cli/commands/build.ts +14 -10
- package/src/cli/commands/bundle-package.ts +19 -13
- package/src/cli/commands/clean.ts +2 -4
- package/src/cli/commands/convert-eslint-config.ts +3 -5
- package/src/cli/commands/eslint.ts +3 -5
- package/src/cli/commands/get-command.ts +2 -0
- package/src/cli/commands/index.ts +0 -1
- package/src/cli/commands/init.ts +7 -8
- package/src/cli/commands/install.ts +24 -11
- package/src/cli/commands/kendo-ui-license.ts +4 -6
- package/src/cli/commands/lint.ts +19 -19
- package/src/cli/commands/mfe-list.ts +173 -0
- package/src/cli/commands/mfe-package-clean.ts +25 -4
- package/src/cli/commands/mfe-package-publish.ts +33 -4
- package/src/cli/commands/mfe-publish.ts +37 -6
- package/src/cli/commands/prepare-package.ts +3 -5
- package/src/cli/commands/review/review.ts +9 -9
- package/src/cli/commands/run-task.ts +15 -11
- package/src/cli/commands/start.ts +12 -10
- package/src/cli/commands/styles-check.ts +2 -2
- package/src/cli/commands/test/__tests__/tests.test.ts +1 -1
- package/src/cli/commands/test/tests.ts +20 -10
- package/src/cli/commands/types.ts +14 -4
- package/src/cli/commands/upload-sourcemaps.ts +3 -5
- package/src/cli/index.ts +59 -37
- package/src/cli/tasks/swc-compile-package.ts +2 -2
- package/src/cli/tasks/tsc-compile-package.ts +4 -3
- package/src/cli/tasks/tsc-compile.ts +2 -2
- package/src/cli/utils/__tests__/bundle.test.ts +13 -0
- package/src/cli/utils/__tests__/cli-npm.test.ts +89 -0
- package/src/cli/utils/__tests__/is-tty.test.ts +17 -0
- package/src/cli/utils/__tests__/lerna-exec.test.ts +7 -0
- package/src/cli/utils/__tests__/maybe-create-git-folder.test.ts +11 -32
- package/src/cli/utils/__tests__/set-node-options.test.ts +10 -10
- package/src/cli/utils/bundle.ts +1 -1
- package/src/cli/utils/cli-npm.ts +34 -0
- package/src/cli/utils/cli-os.ts +12 -25
- package/src/cli/utils/eslint.ts +2 -1
- package/src/cli/utils/index.ts +1 -0
- package/src/cli/utils/is-tty.ts +3 -0
- package/src/cli/utils/lerna-exec.ts +3 -0
- package/src/cli/utils/maybe-create-git-folder.ts +5 -12
- package/src/cli/utils/process-tree.ts +4 -2
- package/src/cli/utils/set-node-options.ts +2 -1
- package/src/utils/__tests__/format-relative-date.test.ts +61 -0
- package/src/utils/__tests__/get-packages.test.ts +3 -0
- package/src/utils/find-packages.ts +1 -0
- package/src/utils/format-relative-date.ts +33 -0
- package/src/utils/get-configuration.ts +1 -0
- package/src/utils/get-packages.ts +3 -9
- package/src/utils/get-startup-version.ts +1 -3
- package/src/utils/index.ts +1 -0
- package/src/webpack/__mocks__/style-rules.ts +3 -3
- package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +6 -14
- package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +52 -29
- package/src/webpack/configs/loaders/style-loader.ts +5 -2
- package/src/webpack/configs/optimization-config.ts +5 -5
- package/src/webpack/configs/output-config.ts +10 -5
- package/src/webpack/configs/plugins/assets-manifest-plugin.ts +11 -4
- package/dist/cli/commands/get-user-commands.d.ts +0 -7
- package/dist/cli/commands/get-user-commands.d.ts.map +0 -1
- package/dist/cli/commands/get-user-commands.js +0 -27
- package/dist/cli/commands/get-user-commands.js.map +0 -1
- package/src/cli/commands/__tests__/get-user-commands.test.ts +0 -27
- package/src/cli/commands/get-user-commands.ts +0 -19
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
isLegacyRoot,
|
|
16
16
|
isWebComponent,
|
|
17
17
|
} from '../../utils';
|
|
18
|
-
import {
|
|
18
|
+
import { miniCssPluginStyleRules } from '../__mocks__';
|
|
19
19
|
import { generateMetadata } from '../configs/utils';
|
|
20
20
|
import { getCallerFile, splitByEntry } from '../utils';
|
|
21
21
|
|
|
@@ -119,6 +119,20 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
119
119
|
const subject = () => createWebpackConfig(overrides, options);
|
|
120
120
|
|
|
121
121
|
describe('when package is a web component', () => {
|
|
122
|
+
const baseCacheGroups = {
|
|
123
|
+
styles: {
|
|
124
|
+
name: 'main',
|
|
125
|
+
type: 'css/mini-extract',
|
|
126
|
+
chunks: 'all',
|
|
127
|
+
enforce: true,
|
|
128
|
+
},
|
|
129
|
+
servicetitan: {
|
|
130
|
+
name: 'servicetitan',
|
|
131
|
+
test: /[\\/]node_modules[\\/]@servicetitan[\\/]/,
|
|
132
|
+
chunks: 'all',
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
|
|
122
136
|
beforeEach(() => jest.mocked(isWebComponent).mockReturnValue(true));
|
|
123
137
|
|
|
124
138
|
test('configures MiniCssExtractPlugIn plugin', () => {
|
|
@@ -127,7 +141,7 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
127
141
|
);
|
|
128
142
|
});
|
|
129
143
|
|
|
130
|
-
Object.entries(
|
|
144
|
+
Object.entries(miniCssPluginStyleRules).forEach(([extension, rule]) => {
|
|
131
145
|
test(`configures "${extension}" rules`, () => {
|
|
132
146
|
expect(subject().module?.rules).toContainEqual(rule);
|
|
133
147
|
});
|
|
@@ -139,13 +153,9 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
139
153
|
);
|
|
140
154
|
});
|
|
141
155
|
|
|
142
|
-
test('configures "optimization.splitChunks.cacheGroups
|
|
143
|
-
expect
|
|
144
|
-
|
|
145
|
-
type: 'css/mini-extract',
|
|
146
|
-
chunks: 'all',
|
|
147
|
-
enforce: true,
|
|
148
|
-
});
|
|
156
|
+
test('configures "optimization.splitChunks.cacheGroups', () => {
|
|
157
|
+
// @ts-expect-error because splitChunks is polymorphic
|
|
158
|
+
expect(subject().optimization?.splitChunks.cacheGroups).toEqual(baseCacheGroups);
|
|
149
159
|
});
|
|
150
160
|
|
|
151
161
|
test('configures WEB_COMPONENT_NAME', () => {
|
|
@@ -183,6 +193,25 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
183
193
|
});
|
|
184
194
|
});
|
|
185
195
|
|
|
196
|
+
test('WebpackAssetsManifest plugin moves design system css to precede other css', () => {
|
|
197
|
+
const assets = {
|
|
198
|
+
entrypoints: {
|
|
199
|
+
foo: {
|
|
200
|
+
assets: {
|
|
201
|
+
css: ['main.css', 'servicetitan.css', 'common.css'],
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
subject();
|
|
208
|
+
|
|
209
|
+
const transform: any = jest.mocked(WebpackAssetsManifest).mock.calls[0][0]?.transform;
|
|
210
|
+
expect(transform(assets)).toEqual(
|
|
211
|
+
expect.objectContaining({ css: ['servicetitan.css', 'main.css', 'common.css'] })
|
|
212
|
+
);
|
|
213
|
+
});
|
|
214
|
+
|
|
186
215
|
test('generates metadata when WebpackAssetsManifest plugin is done', () => {
|
|
187
216
|
subject();
|
|
188
217
|
|
|
@@ -373,27 +402,21 @@ describe(`[startup] ${createWebpackConfig.name}`, () => {
|
|
|
373
402
|
expect(subject().devtool).toBe('source-map');
|
|
374
403
|
});
|
|
375
404
|
|
|
376
|
-
test('
|
|
405
|
+
test('adds "common" and "kendo" to "optimization.splitChunks.cacheGroups"', () => {
|
|
377
406
|
// @ts-expect-error because splitChunks is polymorphic
|
|
378
|
-
expect(subject().optimization?.splitChunks.cacheGroups).toEqual(
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
name: 'servicetitan',
|
|
392
|
-
test: /[\\/]node_modules[\\/]@servicetitan[\\/]/,
|
|
393
|
-
chunks: 'all',
|
|
394
|
-
},
|
|
395
|
-
})
|
|
396
|
-
);
|
|
407
|
+
expect(subject().optimization?.splitChunks.cacheGroups).toEqual({
|
|
408
|
+
...baseCacheGroups,
|
|
409
|
+
common: {
|
|
410
|
+
name: 'common',
|
|
411
|
+
test: /[\\/]node_modules[\\/](axios|classnames|formstate|mobx|mobx-react|mobx-utils|react|react-dom|react-router|react-router-dom)[\\/]/,
|
|
412
|
+
chunks: 'all',
|
|
413
|
+
},
|
|
414
|
+
kendo: {
|
|
415
|
+
name: 'kendo',
|
|
416
|
+
test: /[\\/]node_modules[\\/](@progress|@telerik)[\\/]/,
|
|
417
|
+
chunks: 'all',
|
|
418
|
+
},
|
|
419
|
+
});
|
|
397
420
|
});
|
|
398
421
|
|
|
399
422
|
test('configures "output.uniqueName"', () => {
|
|
@@ -3,9 +3,12 @@ import { Context } from '../types';
|
|
|
3
3
|
import { LoaderOptions } from './types';
|
|
4
4
|
|
|
5
5
|
export function styleLoader(
|
|
6
|
-
{ isProduction, isWebComponent }: Context,
|
|
6
|
+
{ isProduction, isWebComponent, emitExposedDependencies }: Context,
|
|
7
7
|
{ esModule }: LoaderOptions = {}
|
|
8
8
|
) {
|
|
9
|
-
const loader =
|
|
9
|
+
const loader =
|
|
10
|
+
isProduction || isWebComponent || emitExposedDependencies
|
|
11
|
+
? MiniCssExtractPlugin.loader
|
|
12
|
+
: 'style-loader';
|
|
10
13
|
return esModule ? { loader, options: { esModule } } : loader;
|
|
11
14
|
}
|
|
@@ -88,6 +88,11 @@ function webComponentConfig(optimization: ConfigWithCacheGroups, context: Contex
|
|
|
88
88
|
chunks: 'all',
|
|
89
89
|
enforce: true,
|
|
90
90
|
},
|
|
91
|
+
servicetitan: {
|
|
92
|
+
name: 'servicetitan',
|
|
93
|
+
test: /[\\/]node_modules[\\/]@servicetitan[\\/]/,
|
|
94
|
+
chunks: 'all',
|
|
95
|
+
},
|
|
91
96
|
});
|
|
92
97
|
|
|
93
98
|
if (!isProduction) {
|
|
@@ -105,10 +110,5 @@ function webComponentConfig(optimization: ConfigWithCacheGroups, context: Contex
|
|
|
105
110
|
test: /[\\/]node_modules[\\/](@progress|@telerik)[\\/]/,
|
|
106
111
|
chunks: 'all',
|
|
107
112
|
},
|
|
108
|
-
servicetitan: {
|
|
109
|
-
name: 'servicetitan',
|
|
110
|
-
test: /[\\/]node_modules[\\/]@servicetitan[\\/]/,
|
|
111
|
-
chunks: 'all',
|
|
112
|
-
},
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -12,18 +12,14 @@ export function outputConfig(context: Context, _: Overrides): Result {
|
|
|
12
12
|
const output: Config = {
|
|
13
13
|
filename: '[name].bundle.js',
|
|
14
14
|
path: getOutputPath(context),
|
|
15
|
+
clean: getClean(context),
|
|
15
16
|
...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
if (isProduction) {
|
|
19
20
|
const cdnPath = process.env.CLIENT_CDN_PATH;
|
|
20
|
-
const exposedDependenciesDir = getBundleType({ ...context, emitExposedDependencies: true });
|
|
21
21
|
Object.assign(output, {
|
|
22
22
|
filename: '[name].[contenthash].bundle.js',
|
|
23
|
-
clean:
|
|
24
|
-
exposedDependenciesDir && !emitExposedDependencies
|
|
25
|
-
? { keep: new RegExp(exposedDependenciesDir) }
|
|
26
|
-
: true,
|
|
27
23
|
...(isWebComponent ? { uniqueName: name } : {}),
|
|
28
24
|
...(cdnPath ? { publicPath: cdnPath } : {}),
|
|
29
25
|
});
|
|
@@ -32,6 +28,15 @@ export function outputConfig(context: Context, _: Overrides): Result {
|
|
|
32
28
|
return { output };
|
|
33
29
|
}
|
|
34
30
|
|
|
31
|
+
function getClean(context: Context): NonNullable<Config>['clean'] {
|
|
32
|
+
const { emitExposedDependencies } = context;
|
|
33
|
+
if (emitExposedDependencies) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
const exposedDependenciesDir = getBundleType({ ...context, emitExposedDependencies: true });
|
|
37
|
+
return exposedDependenciesDir ? { keep: new RegExp(exposedDependenciesDir) } : true;
|
|
38
|
+
}
|
|
39
|
+
|
|
35
40
|
function getOutputPath(context: Context) {
|
|
36
41
|
const { destination, emitExposedDependencies } = context;
|
|
37
42
|
|
|
@@ -26,13 +26,13 @@ export function assetsManifestPlugin(context: Context, _: Overrides) {
|
|
|
26
26
|
entrypoints: Record<string, { assets: Record<string, string[]> }>;
|
|
27
27
|
}): EntryPoints {
|
|
28
28
|
const getAssetsByType = (type: string) => {
|
|
29
|
-
return Object.values(assets.entrypoints)
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
return Object.values(assets.entrypoints).flatMap(
|
|
30
|
+
({ assets }) => assets[type] ?? []
|
|
31
|
+
);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
return {
|
|
35
|
-
css: getAssetsByType('css'),
|
|
35
|
+
css: ensureDesignSystemCssIsFirst(getAssetsByType('css')),
|
|
36
36
|
js: getAssetsByType('js'),
|
|
37
37
|
};
|
|
38
38
|
},
|
|
@@ -47,6 +47,13 @@ export function assetsManifestPlugin(context: Context, _: Overrides) {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
function ensureDesignSystemCssIsFirst(cssAssets: string[]) {
|
|
51
|
+
const offset = cssAssets.findIndex(name => name.startsWith('servicetitan'));
|
|
52
|
+
return offset > 0
|
|
53
|
+
? [cssAssets[offset], ...cssAssets.filter((_, index) => index !== offset)]
|
|
54
|
+
: cssAssets;
|
|
55
|
+
}
|
|
56
|
+
|
|
50
57
|
export function getExposedDependenciesEntryPoints(context: Context) {
|
|
51
58
|
const metadataPath = getExposedDependenciesMetadataPath(context);
|
|
52
59
|
const metadata = readJsonSafe<Metadata>(metadataPath);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-user-commands.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/get-user-commands.ts"],"names":[],"mappings":"AAIA,UAAU,WAAW;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,eAAe,IAQwB,WAAW,EAAE,CACnE"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getUserCommands", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return getUserCommands;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _utils = require("../../utils");
|
|
12
|
-
const _getcommand = require("./get-command");
|
|
13
|
-
function getUserCommands() {
|
|
14
|
-
return Object.values(_utils.CommandName).sort((a, b)=>a.localeCompare(b)).map((name)=>{
|
|
15
|
-
var _description, _this;
|
|
16
|
-
const Command = (0, _getcommand.getCommand)(name);
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
18
|
-
return {
|
|
19
|
-
name,
|
|
20
|
-
description: (_description = (_this = new Command({
|
|
21
|
-
_: []
|
|
22
|
-
})).description) === null || _description === void 0 ? void 0 : _description.call(_this)
|
|
23
|
-
};
|
|
24
|
-
}).filter(({ description })=>!!description);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=get-user-commands.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/cli/commands/get-user-commands.ts"],"sourcesContent":["import { CommandName } from '../../utils';\n\nimport { getCommand } from './get-command';\n\ninterface UserCommand {\n name: string;\n description: string;\n}\n\nexport function getUserCommands() {\n return Object.values(CommandName)\n .sort((a, b) => a.localeCompare(b))\n .map(name => {\n const Command = getCommand(name)!;\n // eslint-disable-next-line @typescript-eslint/naming-convention\n return { name, description: new Command({ _: [] }).description?.() };\n })\n .filter(({ description }) => !!description) as UserCommand[];\n}\n"],"names":["getUserCommands","Object","values","CommandName","sort","a","b","localeCompare","map","name","Command","getCommand","description","_","filter"],"mappings":";;;;+BASgBA;;;eAAAA;;;uBATY;4BAED;AAOpB,SAASA;IACZ,OAAOC,OAAOC,MAAM,CAACC,kBAAW,EAC3BC,IAAI,CAAC,CAACC,GAAGC,IAAMD,EAAEE,aAAa,CAACD,IAC/BE,GAAG,CAACC,CAAAA;YAG2B,cAAA;QAF5B,MAAMC,UAAUC,IAAAA,sBAAU,EAACF;QAC3B,gEAAgE;QAChE,OAAO;YAAEA;YAAMG,WAAW,GAAE,eAAA,CAAA,QAAA,IAAIF,QAAQ;gBAAEG,GAAG,EAAE;YAAC,IAAGD,WAAW,cAAlC,mCAAA,kBAAA;QAAuC;IACvE,GACCE,MAAM,CAAC,CAAC,EAAEF,WAAW,EAAE,GAAK,CAAC,CAACA;AACvC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @jest-environment node
|
|
3
|
-
*/
|
|
4
|
-
import { CommandName } from '../../../utils';
|
|
5
|
-
import { getCommand } from '../get-command';
|
|
6
|
-
import { getUserCommands } from '../get-user-commands';
|
|
7
|
-
|
|
8
|
-
describe(`${getUserCommands.name}`, () => {
|
|
9
|
-
const subject = () => getUserCommands();
|
|
10
|
-
|
|
11
|
-
test('returns commands with descriptions', () => {
|
|
12
|
-
const descriptions = Object.values(CommandName)
|
|
13
|
-
.map(name => {
|
|
14
|
-
const Command = getCommand(name)!;
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
-
return new Command({ _: [] }).description?.();
|
|
17
|
-
})
|
|
18
|
-
.filter(description => !!description);
|
|
19
|
-
|
|
20
|
-
expect(subject().length).toBe(descriptions.length);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
test('returns commands in ascending order by name', () => {
|
|
24
|
-
const names = subject().map(({ name }) => name);
|
|
25
|
-
expect(names).toEqual([...names].sort((a, b) => a.localeCompare(b)));
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CommandName } from '../../utils';
|
|
2
|
-
|
|
3
|
-
import { getCommand } from './get-command';
|
|
4
|
-
|
|
5
|
-
interface UserCommand {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function getUserCommands() {
|
|
11
|
-
return Object.values(CommandName)
|
|
12
|
-
.sort((a, b) => a.localeCompare(b))
|
|
13
|
-
.map(name => {
|
|
14
|
-
const Command = getCommand(name)!;
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
16
|
-
return { name, description: new Command({ _: [] }).description?.() };
|
|
17
|
-
})
|
|
18
|
-
.filter(({ description }) => !!description) as UserCommand[];
|
|
19
|
-
}
|