@servicetitan/startup 24.0.3 → 24.1.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 (110) 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 +3 -0
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/bundle-package.d.ts +1 -0
  6. package/dist/cli/commands/bundle-package.d.ts.map +1 -1
  7. package/dist/cli/commands/bundle-package.js +3 -0
  8. package/dist/cli/commands/bundle-package.js.map +1 -1
  9. package/dist/cli/commands/eslint.d.ts +1 -0
  10. package/dist/cli/commands/eslint.d.ts.map +1 -1
  11. package/dist/cli/commands/eslint.js +3 -0
  12. package/dist/cli/commands/eslint.js.map +1 -1
  13. package/dist/cli/commands/get-command.d.ts +6 -0
  14. package/dist/cli/commands/get-command.d.ts.map +1 -0
  15. package/dist/cli/commands/get-command.js +50 -0
  16. package/dist/cli/commands/get-command.js.map +1 -0
  17. package/dist/cli/commands/get-user-commands.d.ts +7 -0
  18. package/dist/cli/commands/get-user-commands.d.ts.map +1 -0
  19. package/dist/cli/commands/get-user-commands.js +17 -0
  20. package/dist/cli/commands/get-user-commands.js.map +1 -0
  21. package/dist/cli/commands/index.d.ts +3 -3
  22. package/dist/cli/commands/index.d.ts.map +1 -1
  23. package/dist/cli/commands/index.js +3 -0
  24. package/dist/cli/commands/index.js.map +1 -1
  25. package/dist/cli/commands/init.d.ts +2 -1
  26. package/dist/cli/commands/init.d.ts.map +1 -1
  27. package/dist/cli/commands/init.js +5 -2
  28. package/dist/cli/commands/init.js.map +1 -1
  29. package/dist/cli/commands/install.d.ts +1 -0
  30. package/dist/cli/commands/install.d.ts.map +1 -1
  31. package/dist/cli/commands/install.js +3 -0
  32. package/dist/cli/commands/install.js.map +1 -1
  33. package/dist/cli/commands/kendo-ui-license.d.ts +1 -0
  34. package/dist/cli/commands/kendo-ui-license.d.ts.map +1 -1
  35. package/dist/cli/commands/kendo-ui-license.js +3 -0
  36. package/dist/cli/commands/kendo-ui-license.js.map +1 -1
  37. package/dist/cli/commands/lint.d.ts +1 -0
  38. package/dist/cli/commands/lint.d.ts.map +1 -1
  39. package/dist/cli/commands/lint.js +3 -0
  40. package/dist/cli/commands/lint.js.map +1 -1
  41. package/dist/cli/commands/mfe-publish.d.ts +7 -2
  42. package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
  43. package/dist/cli/commands/mfe-publish.js +25 -11
  44. package/dist/cli/commands/mfe-publish.js.map +1 -1
  45. package/dist/cli/commands/prepare-package.d.ts +1 -0
  46. package/dist/cli/commands/prepare-package.d.ts.map +1 -1
  47. package/dist/cli/commands/prepare-package.js +3 -0
  48. package/dist/cli/commands/prepare-package.js.map +1 -1
  49. package/dist/cli/commands/start.d.ts +1 -0
  50. package/dist/cli/commands/start.d.ts.map +1 -1
  51. package/dist/cli/commands/start.js +3 -0
  52. package/dist/cli/commands/start.js.map +1 -1
  53. package/dist/cli/commands/styles-check.d.ts +1 -0
  54. package/dist/cli/commands/styles-check.d.ts.map +1 -1
  55. package/dist/cli/commands/styles-check.js +3 -0
  56. package/dist/cli/commands/styles-check.js.map +1 -1
  57. package/dist/cli/commands/tests.d.ts +1 -0
  58. package/dist/cli/commands/tests.d.ts.map +1 -1
  59. package/dist/cli/commands/tests.js +3 -0
  60. package/dist/cli/commands/tests.js.map +1 -1
  61. package/dist/cli/commands/types.d.ts +5 -0
  62. package/dist/cli/commands/types.d.ts.map +1 -0
  63. package/dist/cli/commands/types.js +3 -0
  64. package/dist/cli/commands/types.js.map +1 -0
  65. package/dist/cli/index.js +24 -37
  66. package/dist/cli/index.js.map +1 -1
  67. package/dist/cli/utils/lerna-exec.d.ts +1 -0
  68. package/dist/cli/utils/lerna-exec.d.ts.map +1 -1
  69. package/dist/cli/utils/lerna-exec.js +3 -0
  70. package/dist/cli/utils/lerna-exec.js.map +1 -1
  71. package/dist/utils/get-packages.d.ts.map +1 -1
  72. package/dist/utils/get-packages.js +29 -12
  73. package/dist/utils/get-packages.js.map +1 -1
  74. package/dist/utils/maybe-create-git-folder.d.ts +10 -0
  75. package/dist/utils/maybe-create-git-folder.d.ts.map +1 -0
  76. package/dist/utils/maybe-create-git-folder.js +25 -0
  77. package/dist/utils/maybe-create-git-folder.js.map +1 -0
  78. package/package.json +12 -12
  79. package/src/cli/commands/__tests__/get-command.test.ts +17 -0
  80. package/src/cli/commands/__tests__/get-user-commands.test.ts +24 -0
  81. package/src/cli/commands/__tests__/init.test.ts +4 -4
  82. package/src/cli/commands/__tests__/install.test.ts +4 -0
  83. package/src/cli/commands/__tests__/mfe-publish.test.ts +11 -0
  84. package/src/cli/commands/build.ts +4 -0
  85. package/src/cli/commands/bundle-package.ts +4 -0
  86. package/src/cli/commands/eslint.ts +4 -0
  87. package/src/cli/commands/get-command.ts +50 -0
  88. package/src/cli/commands/get-user-commands.ts +19 -0
  89. package/src/cli/commands/index.ts +3 -4
  90. package/src/cli/commands/init.ts +7 -3
  91. package/src/cli/commands/install.ts +4 -0
  92. package/src/cli/commands/kendo-ui-license.ts +4 -0
  93. package/src/cli/commands/lint.ts +4 -0
  94. package/src/cli/commands/mfe-publish.ts +31 -12
  95. package/src/cli/commands/prepare-package.ts +4 -0
  96. package/src/cli/commands/start.ts +4 -0
  97. package/src/cli/commands/styles-check.ts +4 -0
  98. package/src/cli/commands/tests.ts +4 -0
  99. package/src/cli/commands/types.ts +4 -0
  100. package/src/cli/index.ts +27 -59
  101. package/src/cli/utils/__tests__/lerna-exec.test.ts +2 -0
  102. package/src/cli/utils/lerna-exec.ts +4 -0
  103. package/src/utils/__tests__/get-packages.test.ts +67 -20
  104. package/src/utils/__tests__/maybe-create-git-folder.test.ts +41 -0
  105. package/src/utils/get-packages.ts +34 -17
  106. package/src/utils/maybe-create-git-folder.ts +18 -0
  107. package/template-react18/packages/application/package.json +1 -1
  108. package/template-react18/packages/feature-a/package.json +1 -1
  109. package/template-react18/packages/feature-b/package.json +1 -1
  110. package/template-react18/packages/feature-c/package.json +1 -1
@@ -1,6 +1,8 @@
1
1
  import execa from 'execa';
2
2
  import { isBundle, isLegacy } from './get-configuration';
3
+ import { maybeCreateGitFolder } from './maybe-create-git-folder';
3
4
  import { toArray } from './to-array';
5
+ import { log } from './log';
4
6
 
5
7
  export enum PackageType {
6
8
  TSC,
@@ -27,23 +29,14 @@ export function getPackages(options: GetPackagesOptions = {}) {
27
29
  const scope = toArray(options.scope);
28
30
  const ignore = toArray(options.ignore);
29
31
 
30
- const allPackages: RawPackage[] = JSON.parse(
31
- execa.sync('npx', ['lerna', 'la', '--json']).stdout
32
- );
32
+ maybeCreateGitFolder();
33
+ const allPackages: RawPackage[] = listPackages();
33
34
 
34
35
  if (!scope.length && !ignore.length) {
35
36
  return withMetadata(allPackages);
36
37
  }
37
38
 
38
- const filteredPackages: RawPackage[] = JSON.parse(
39
- execa.sync('npx', [
40
- 'lerna',
41
- 'la',
42
- ...scope.map(v => ['--scope', v]).flat(),
43
- ...ignore.map(v => ['--ignore', v]).flat(),
44
- '--json',
45
- ]).stdout
46
- );
39
+ const filteredPackages: RawPackage[] = listPackages(options);
47
40
 
48
41
  const graph: Record<string, string[]> = getPackagesGraph();
49
42
 
@@ -84,18 +77,42 @@ interface GetPackagesGraphOptions {
84
77
  * Returns packages and their direct dependencies
85
78
  */
86
79
  export function getPackagesGraph(options: GetPackagesGraphOptions = {}): Record<string, string[]> {
80
+ return listPackages({ ...options, graph: true });
81
+ }
82
+
83
+ function listPackages(options: GetPackagesOptions & { graph?: boolean } = {}) {
87
84
  const scope = toArray(options.scope);
88
85
  const ignore = toArray(options.ignore);
89
86
 
90
- return JSON.parse(
91
- execa.sync('npx', [
87
+ let execaOptions: execa.SyncOptions | undefined;
88
+ if (process.platform === 'win32') {
89
+ /*
90
+ * Disabled the project graph cache to workaround issue when nx fails with
91
+ * "Error: EPERM: operation not permitted, rename ..." error when multiple
92
+ * processes simultaneously generate the project graph.
93
+ */
94
+ // eslint-disable-next-line @typescript-eslint/naming-convention
95
+ execaOptions = { extendEnv: true, env: { NX_CACHE_PROJECT_GRAPH: 'false' } };
96
+ }
97
+
98
+ const output = execa.sync(
99
+ 'npx',
100
+ [
92
101
  'lerna',
93
102
  'la',
94
103
  ...scope.map(v => ['--scope', v]).flat(),
95
104
  ...ignore.map(v => ['--ignore', v]).flat(),
96
- '--graph',
97
- ]).stdout
98
- );
105
+ options.graph ? '--graph' : '--json',
106
+ ],
107
+ execaOptions
108
+ ).stdout;
109
+
110
+ try {
111
+ return JSON.parse(output);
112
+ } catch (error) {
113
+ log.error(`error: could not parse lerna output:\n${output}`);
114
+ throw error;
115
+ }
99
116
  }
100
117
 
101
118
  function withMetadata(packages: RawPackage[]): Package[] {
@@ -0,0 +1,18 @@
1
+ import fs from 'fs';
2
+
3
+ /**
4
+ * Create empty .git folder to workaround issue where Lerna does not
5
+ * detect workspace packages on Windows systems. The empty .git folder
6
+ * causes nx to use the git-hasher when building the project graph.
7
+ * Note this gets fixed (e.g., https://github.com/nrwl/nx/issues/8601) but
8
+ * keeps reappearing (e.g., https://github.com/nrwl/nx/issues/9584 and
9
+ * https://github.com/nrwl/nx/issues/18094)
10
+ */
11
+ export function maybeCreateGitFolder() {
12
+ if (process.platform !== 'win32') {
13
+ return;
14
+ }
15
+ if (!fs.existsSync('.git')) {
16
+ fs.mkdirSync('.git');
17
+ }
18
+ }
@@ -28,7 +28,7 @@
28
28
  "@testing-library/jest-dom": "^6.4.2",
29
29
  "@testing-library/react": "^14.2.1",
30
30
  "@testing-library/react-hooks": "^8.0.1",
31
- "@types/react": "^18.3.1",
31
+ "@types/react": "^18.3.3",
32
32
  "@types/react-dom": "^18.3.0",
33
33
  "@types/react-router-dom": "^5.3.2"
34
34
  }
@@ -10,7 +10,7 @@
10
10
  "react-dom": "^18.3.1"
11
11
  },
12
12
  "devDependencies": {
13
- "@types/react": "^18.3.1",
13
+ "@types/react": "^18.3.3",
14
14
  "@types/react-dom": "^18.3.0"
15
15
  },
16
16
  "cli": {
@@ -10,7 +10,7 @@
10
10
  "react-dom": "^18.3.1"
11
11
  },
12
12
  "devDependencies": {
13
- "@types/react": "^18.3.1",
13
+ "@types/react": "^18.3.3",
14
14
  "@types/react-dom": "^18.3.0"
15
15
  },
16
16
  "cli": {
@@ -10,7 +10,7 @@
10
10
  "react-dom": "^18.3.1"
11
11
  },
12
12
  "devDependencies": {
13
- "@types/react": "^18.3.1",
13
+ "@types/react": "^18.3.3",
14
14
  "@types/react-dom": "^18.3.0"
15
15
  },
16
16
  "cli": {