@servicetitan/startup 36.3.0-far-1776.3 → 36.3.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 (75) hide show
  1. package/bin/_run.js +19 -8
  2. package/dist/cli/commands/mfe-check.d.ts.map +1 -1
  3. package/dist/cli/commands/mfe-check.js +1 -5
  4. package/dist/cli/commands/mfe-check.js.map +1 -1
  5. package/dist/utils/find-up.js +4 -4
  6. package/dist/utils/find-up.js.map +1 -1
  7. package/dist/utils/get-jest-config.js +1 -1
  8. package/dist/utils/get-jest-config.js.map +1 -1
  9. package/dist/utils/get-package-data.d.ts +1 -0
  10. package/dist/utils/get-package-data.d.ts.map +1 -1
  11. package/dist/utils/get-package-data.js +22 -3
  12. package/dist/utils/get-package-data.js.map +1 -1
  13. package/dist/utils/index.d.ts +0 -1
  14. package/dist/utils/index.d.ts.map +1 -1
  15. package/dist/utils/index.js +0 -1
  16. package/dist/utils/index.js.map +1 -1
  17. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
  18. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +1 -3
  19. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
  20. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.d.ts.map +1 -1
  21. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js +11 -1
  22. package/dist/webpack/configs/utils/get-launchdarkly-sdk-version.js.map +1 -1
  23. package/dist/webpack/configs/utils/get-web-components-version.d.ts.map +1 -1
  24. package/dist/webpack/configs/utils/get-web-components-version.js +7 -5
  25. package/dist/webpack/configs/utils/get-web-components-version.js.map +1 -1
  26. package/package.json +13 -12
  27. package/src/cli/commands/__tests__/mfe-check.test.ts +10 -12
  28. package/src/cli/commands/mfe-check.ts +1 -5
  29. package/src/utils/__tests__/get-jest-config.test.ts +1 -1
  30. package/src/utils/__tests__/get-package-data.test.ts +45 -1
  31. package/src/utils/find-up.ts +1 -1
  32. package/src/utils/get-jest-config.ts +1 -1
  33. package/src/utils/get-package-data.ts +14 -0
  34. package/src/utils/index.ts +0 -1
  35. package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +6 -4
  36. package/src/webpack/__tests__/create-webpack-config.test.ts +5 -3
  37. package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +3 -6
  38. package/src/webpack/configs/utils/__tests__/get-launchdarkly-sdk-version.test.ts +12 -29
  39. package/src/webpack/configs/utils/__tests__/get-web-components-version.test.ts +12 -37
  40. package/src/webpack/configs/utils/get-launchdarkly-sdk-version.ts +12 -2
  41. package/src/webpack/configs/utils/get-web-components-version.ts +5 -8
  42. package/dist/utils/package-lock/find-package-lock.d.ts +0 -2
  43. package/dist/utils/package-lock/find-package-lock.d.ts.map +0 -1
  44. package/dist/utils/package-lock/find-package-lock.js +0 -26
  45. package/dist/utils/package-lock/find-package-lock.js.map +0 -1
  46. package/dist/utils/package-lock/get-lock-file-entry.d.ts +0 -3
  47. package/dist/utils/package-lock/get-lock-file-entry.d.ts.map +0 -1
  48. package/dist/utils/package-lock/get-lock-file-entry.js +0 -22
  49. package/dist/utils/package-lock/get-lock-file-entry.js.map +0 -1
  50. package/dist/utils/package-lock/get-lock-file-version.d.ts +0 -3
  51. package/dist/utils/package-lock/get-lock-file-version.d.ts.map +0 -1
  52. package/dist/utils/package-lock/get-lock-file-version.js +0 -16
  53. package/dist/utils/package-lock/get-lock-file-version.js.map +0 -1
  54. package/dist/utils/package-lock/index.d.ts +0 -6
  55. package/dist/utils/package-lock/index.d.ts.map +0 -1
  56. package/dist/utils/package-lock/index.js +0 -23
  57. package/dist/utils/package-lock/index.js.map +0 -1
  58. package/dist/utils/package-lock/read-package-lock.d.ts +0 -3
  59. package/dist/utils/package-lock/read-package-lock.d.ts.map +0 -1
  60. package/dist/utils/package-lock/read-package-lock.js +0 -22
  61. package/dist/utils/package-lock/read-package-lock.js.map +0 -1
  62. package/dist/utils/package-lock/types.d.ts +0 -12
  63. package/dist/utils/package-lock/types.d.ts.map +0 -1
  64. package/dist/utils/package-lock/types.js +0 -6
  65. package/dist/utils/package-lock/types.js.map +0 -1
  66. package/src/utils/package-lock/__tests__/find-package-lock.test.ts +0 -35
  67. package/src/utils/package-lock/__tests__/get-lock-file-entry.test.ts +0 -97
  68. package/src/utils/package-lock/__tests__/get-lock-file-version.test.ts +0 -32
  69. package/src/utils/package-lock/__tests__/read-package-lock.test.ts +0 -47
  70. package/src/utils/package-lock/find-package-lock.ts +0 -10
  71. package/src/utils/package-lock/get-lock-file-entry.ts +0 -14
  72. package/src/utils/package-lock/get-lock-file-version.ts +0 -6
  73. package/src/utils/package-lock/index.ts +0 -5
  74. package/src/utils/package-lock/read-package-lock.ts +0 -13
  75. package/src/utils/package-lock/types.ts +0 -13
@@ -1,32 +0,0 @@
1
- import { getLockFileVersion } from '../get-lock-file-version';
2
- import type { PackageLock } from '../types';
3
-
4
- describe(`[startup] ${getLockFileVersion.name}`, () => {
5
- const packageName = '@servicetitan/web-components';
6
- const version = '1.2.3';
7
- let lockFile: PackageLock;
8
-
9
- beforeEach(() => {
10
- lockFile = {
11
- packages: {
12
- [`node_modules/${packageName}`]: { version },
13
- },
14
- };
15
- });
16
-
17
- const subject = () => getLockFileVersion(lockFile, packageName);
18
-
19
- test('returns version for a found package', () => {
20
- expect(subject()).toBe(version);
21
- });
22
-
23
- describe('when entry has no version', () => {
24
- beforeEach(() => {
25
- delete lockFile.packages[`node_modules/${packageName}`].version;
26
- });
27
-
28
- test('returns undefined', () => {
29
- expect(subject()).toBeUndefined();
30
- });
31
- });
32
- });
@@ -1,47 +0,0 @@
1
- import { fs, vol } from 'memfs';
2
- import { readPackageLock } from '../read-package-lock';
3
-
4
- jest.mock('fs', () => fs);
5
-
6
- describe(`[startup] ${readPackageLock.name}`, () => {
7
- const mockLockFile = {
8
- packages: { 'node_modules/foo': { version: '1.2.3' } },
9
- };
10
-
11
- beforeEach(() => {
12
- vol.fromJSON({ './package-lock.json': JSON.stringify(mockLockFile) });
13
- });
14
-
15
- afterEach(() => {
16
- jest.resetModules();
17
- vol.reset();
18
- });
19
-
20
- const subject = async () => {
21
- const { readPackageLock } = await import('../read-package-lock');
22
- return readPackageLock();
23
- };
24
-
25
- test('returns parsed lock file', async () => {
26
- expect(await subject()).toEqual(mockLockFile);
27
- });
28
-
29
- describe('when called multiple times', () => {
30
- test('reads file only once', async () => {
31
- jest.spyOn(fs, 'readFileSync');
32
-
33
- await subject();
34
- await subject();
35
-
36
- expect(fs.readFileSync).toHaveBeenCalledTimes(1);
37
- });
38
- });
39
-
40
- describe('when package-lock.json does not exist', () => {
41
- beforeEach(() => fs.rmSync('package-lock.json'));
42
-
43
- test('throws error', async () => {
44
- await expect(subject()).rejects.toThrow();
45
- });
46
- });
47
- });
@@ -1,10 +0,0 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { findUp } from '../find-up';
4
-
5
- export function findPackageLock() {
6
- return findUp(directory => {
7
- const lockFile = path.resolve(directory, 'package-lock.json');
8
- return fs.existsSync(lockFile) ? lockFile : undefined;
9
- });
10
- }
@@ -1,14 +0,0 @@
1
- import type { PackageLock } from './types';
2
-
3
- export function getLockFileEntry(lockFile: PackageLock, packageName: string, scope?: string) {
4
- const { packages } = lockFile;
5
- const entry =
6
- (scope ? packages?.[`node_modules/${scope}/node_modules/${packageName}`] : undefined) ??
7
- packages?.[`node_modules/${packageName}`];
8
-
9
- if (entry?.link && entry.resolved) {
10
- return packages?.[entry.resolved] ?? {};
11
- }
12
-
13
- return entry ?? {};
14
- }
@@ -1,6 +0,0 @@
1
- import { getLockFileEntry } from './get-lock-file-entry';
2
- import type { PackageLock } from './types';
3
-
4
- export function getLockFileVersion(lockFile: PackageLock, packageName: string) {
5
- return getLockFileEntry(lockFile, packageName).version;
6
- }
@@ -1,5 +0,0 @@
1
- export * from './find-package-lock';
2
- export * from './get-lock-file-entry';
3
- export * from './get-lock-file-version';
4
- export * from './read-package-lock';
5
- export type { PackageLock, PackageLockPackages } from './types';
@@ -1,13 +0,0 @@
1
- import { readJson } from '../read-json';
2
- import { findPackageLock } from './find-package-lock';
3
- import type { PackageLock } from './types';
4
-
5
- let cachedLockFile: PackageLock | undefined;
6
-
7
- export function readPackageLock(): PackageLock {
8
- if (!cachedLockFile) {
9
- const lockFilePath = findPackageLock();
10
- cachedLockFile = readJson<PackageLock>(lockFilePath!);
11
- }
12
- return cachedLockFile;
13
- }
@@ -1,13 +0,0 @@
1
- export interface PackageLockEntry {
2
- version?: string;
3
- resolved?: string;
4
- link?: boolean;
5
- dependencies?: Record<string, string>;
6
- peerDependencies?: Record<string, string>;
7
- }
8
-
9
- export type PackageLockPackages = Record<string, PackageLockEntry>;
10
-
11
- export interface PackageLock {
12
- packages: PackageLockPackages;
13
- }