@servicetitan/startup 22.18.0 → 22.20.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.
Files changed (70) hide show
  1. package/dist/cli/commands/build.d.ts +1 -0
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +1 -0
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/bundle-package.d.ts +5 -3
  6. package/dist/cli/commands/bundle-package.d.ts.map +1 -1
  7. package/dist/cli/commands/bundle-package.js +7 -2
  8. package/dist/cli/commands/bundle-package.js.map +1 -1
  9. package/dist/cli/commands/mfe-publish.d.ts +1 -0
  10. package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
  11. package/dist/cli/commands/mfe-publish.js +3 -2
  12. package/dist/cli/commands/mfe-publish.js.map +1 -1
  13. package/dist/cli/commands/start.d.ts +5 -4
  14. package/dist/cli/commands/start.d.ts.map +1 -1
  15. package/dist/cli/commands/start.js +3 -0
  16. package/dist/cli/commands/start.js.map +1 -1
  17. package/dist/cli/utils/bundle.d.ts +2 -0
  18. package/dist/cli/utils/bundle.d.ts.map +1 -1
  19. package/dist/cli/utils/bundle.js +14 -7
  20. package/dist/cli/utils/bundle.js.map +1 -1
  21. package/dist/webpack/configs/plugins/provide-react-plugin.d.ts +1 -1
  22. package/dist/webpack/configs/plugins/provide-react-plugin.d.ts.map +1 -1
  23. package/dist/webpack/configs/plugins/provide-react-plugin.js +2 -2
  24. package/dist/webpack/configs/plugins/provide-react-plugin.js.map +1 -1
  25. package/dist/webpack/configs/rules/tsx-rules.d.ts +1 -1
  26. package/dist/webpack/configs/rules/tsx-rules.d.ts.map +1 -1
  27. package/dist/webpack/configs/rules/tsx-rules.js +27 -7
  28. package/dist/webpack/configs/rules/tsx-rules.js.map +1 -1
  29. package/dist/webpack/configs/types.d.ts +1 -0
  30. package/dist/webpack/configs/types.d.ts.map +1 -1
  31. package/dist/webpack/create-webpack-config.d.ts.map +1 -1
  32. package/dist/webpack/create-webpack-config.js +2 -1
  33. package/dist/webpack/create-webpack-config.js.map +1 -1
  34. package/dist/webpack/types.d.ts +2 -0
  35. package/dist/webpack/types.d.ts.map +1 -1
  36. package/package.json +7 -5
  37. package/src/cli/commands/__tests__/build.test.ts +14 -0
  38. package/src/cli/commands/__tests__/bundle-package.test.ts +8 -4
  39. package/src/cli/commands/__tests__/init.test.ts +5 -4
  40. package/src/cli/commands/__tests__/mfe-package-clean.test.ts +4 -3
  41. package/src/cli/commands/__tests__/mfe-package-publish.test.ts +15 -4
  42. package/src/cli/commands/__tests__/mfe-publish.test.ts +5 -3
  43. package/src/cli/commands/__tests__/start.test.ts +14 -0
  44. package/src/cli/commands/__tests__/styles-check.test.ts +12 -11
  45. package/src/cli/commands/build.ts +2 -0
  46. package/src/cli/commands/bundle-package.ts +13 -5
  47. package/src/cli/commands/mfe-publish.ts +3 -1
  48. package/src/cli/commands/start.ts +8 -4
  49. package/src/cli/utils/__tests__/bundle.test.ts +15 -14
  50. package/src/cli/utils/__tests__/eslint.test.ts +11 -4
  51. package/src/cli/utils/__tests__/get-module-type.test.ts +10 -15
  52. package/src/cli/utils/__tests__/is-module-installed.test.ts +6 -7
  53. package/src/cli/utils/__tests__/tcm.test.ts +6 -5
  54. package/src/cli/utils/__tests__/tsc.test.ts +6 -7
  55. package/src/cli/utils/bundle.ts +25 -7
  56. package/src/utils/__tests__/get-configuration.test.ts +20 -14
  57. package/src/utils/__tests__/get-destination-folders.test.ts +11 -13
  58. package/src/utils/__tests__/get-folders.test.ts +8 -6
  59. package/src/utils/__tests__/get-tsconfig.test.ts +6 -4
  60. package/src/utils/__tests__/read-json.test.ts +12 -16
  61. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +6 -5
  62. package/src/webpack/__tests__/create-webpack-config.test.ts +48 -9
  63. package/src/webpack/configs/plugins/provide-react-plugin.ts +2 -2
  64. package/src/webpack/configs/rules/tsx-rules.ts +32 -10
  65. package/src/webpack/configs/types.ts +1 -0
  66. package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +9 -12
  67. package/src/webpack/configs/utils/__tests__/get-startup-version.test.ts +6 -10
  68. package/src/webpack/create-webpack-config.ts +3 -1
  69. package/src/webpack/types.ts +2 -0
  70. package/template/.gitignore +4 -0
@@ -1,23 +1,19 @@
1
- import mockFS from 'mock-fs';
1
+ import { fs, vol } from 'memfs';
2
2
 
3
3
  import { getStartupVersion } from '../get-startup-version';
4
4
 
5
+ jest.mock('fs', () => fs);
6
+
5
7
  describe(`[startup] ${getStartupVersion.name}`, () => {
6
8
  const startupVersion = '1.2.3';
7
9
 
8
10
  beforeEach(() => {
9
- mockFS({
10
- // eslint-disable-next-line @typescript-eslint/naming-convention
11
- node_modules: {
12
- '@servicetitan': {
13
- 'package.json': JSON.stringify({ version: startupVersion }),
14
- 'startup': { 'index.js': '' },
15
- },
16
- },
11
+ vol.fromJSON({
12
+ 'packages/startup/package.json': JSON.stringify({ version: startupVersion }),
17
13
  });
18
14
  });
19
15
 
20
- afterEach(() => mockFS.restore());
16
+ afterEach(() => vol.reset());
21
17
 
22
18
  const subject = () => getStartupVersion();
23
19
 
@@ -41,7 +41,9 @@ export function createWebpackConfig(overrides: Overrides, options: Options = {})
41
41
 
42
42
  const context: Context = {
43
43
  destination,
44
- esbuild: !!(argv as Arguments).esbuild,
44
+ esbuild: options.esbuild ?? !!(argv as Arguments).esbuild ?? false,
45
+ experimentalBundlers:
46
+ options.experimentalBundlers ?? !!(argv as Arguments)['experimental-bundlers'] ?? false,
45
47
  isCustomStyleRules: isCustomStyleRules(),
46
48
  isExposeSharedDependencies: isExposeSharedDependencies(),
47
49
  isProduction: configuration.mode === 'production',
@@ -7,6 +7,8 @@ export interface Options {
7
7
  embed?: boolean;
8
8
  buildStat?: boolean;
9
9
  name?: string;
10
+ esbuild?: boolean;
11
+ experimentalBundlers?: boolean;
10
12
  }
11
13
 
12
14
  export interface Overrides {
@@ -6,6 +6,10 @@
6
6
  # Node.js
7
7
  node_modules/
8
8
 
9
+ # yalc store
10
+ .yalc/
11
+ yalc.lock
12
+
9
13
  *.css.d.ts
10
14
  *.less.d.ts
11
15
  *.scss.d.ts