@nx/devkit 20.1.0-canary.20241017-c902036 → 20.1.0-canary.20241019-19e765f

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/devkit",
3
- "version": "20.1.0-canary.20241017-c902036",
3
+ "version": "20.1.0-canary.20241019-19e765f",
4
4
  "private": false,
5
5
  "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more. Learn more about [extending Nx by leveraging the Nx Devkit](https://nx.dev/extending-nx/intro/getting-started) on our docs.",
6
6
  "repository": {
@@ -3,4 +3,10 @@ import { Tree } from 'nx/src/devkit-exports';
3
3
  * Formats all the created or updated files using Prettier
4
4
  * @param tree - the file system tree
5
5
  */
6
- export declare function formatFiles(tree: Tree): Promise<void>;
6
+ export declare function formatFiles(tree: Tree, options?: {
7
+ /**
8
+ * TODO(v21): Stop sorting tsconfig paths by default, paths are now less common/important
9
+ * in Nx workspace setups, and the sorting causes comments to be lost.
10
+ */
11
+ sortRootTsconfigPaths: boolean;
12
+ }): Promise<void>;
@@ -8,13 +8,21 @@ const devkit_internals_1 = require("nx/src/devkit-internals");
8
8
  * Formats all the created or updated files using Prettier
9
9
  * @param tree - the file system tree
10
10
  */
11
- async function formatFiles(tree) {
11
+ async function formatFiles(tree, options = {
12
+ /**
13
+ * TODO(v21): Stop sorting tsconfig paths by default, paths are now less common/important
14
+ * in Nx workspace setups, and the sorting causes comments to be lost.
15
+ */
16
+ sortRootTsconfigPaths: true,
17
+ }) {
12
18
  let prettier;
13
19
  try {
14
20
  prettier = await Promise.resolve().then(() => require('prettier'));
15
21
  }
16
22
  catch { }
17
- sortTsConfig(tree);
23
+ if (options.sortRootTsconfigPaths) {
24
+ sortTsConfig(tree);
25
+ }
18
26
  if (!prettier)
19
27
  return;
20
28
  const files = new Set(tree.listChanges().filter((file) => file.type !== 'DELETE'));
@@ -27,7 +27,7 @@ function installPackagesTask(tree, alwaysRun = false, cwd = '', packageManager =
27
27
  const execSyncOptions = {
28
28
  cwd: (0, path_1.join)(tree.root, cwd),
29
29
  stdio: process.env.NX_GENERATE_QUIET === 'true' ? 'ignore' : 'inherit',
30
- windowsHide: true,
30
+ windowsHide: false,
31
31
  };
32
32
  // ensure local registry from process is not interfering with the install
33
33
  // when we start the process from temp folder the local registry would override the custom registry
@@ -305,7 +305,7 @@ function ensurePackage(pkgOrTree, requiredVersionOrPackage, maybeRequiredVersion
305
305
  (0, child_process_1.execSync)(preInstallCommand, {
306
306
  cwd: tempDir,
307
307
  stdio: isVerbose ? 'inherit' : 'ignore',
308
- windowsHide: true,
308
+ windowsHide: false,
309
309
  });
310
310
  }
311
311
  let addCommand = (0, devkit_exports_1.getPackageManagerCommand)(packageManager).addDev;
@@ -315,7 +315,7 @@ function ensurePackage(pkgOrTree, requiredVersionOrPackage, maybeRequiredVersion
315
315
  (0, child_process_1.execSync)(`${addCommand} ${pkg}@${requiredVersion}`, {
316
316
  cwd: tempDir,
317
317
  stdio: isVerbose ? 'inherit' : 'ignore',
318
- windowsHide: true,
318
+ windowsHide: false,
319
319
  });
320
320
  addToNodePath((0, path_1.join)(devkit_exports_1.workspaceRoot, 'node_modules'));
321
321
  addToNodePath((0, path_1.join)(tempDir, 'node_modules'));