nx 20.1.0-canary.20241023-12cbfc3 → 20.1.0-canary.20241024-0bea5b2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{71970:()=>{}},s=>{var e;e=71970,s(s.s=e)}]);
1
+ "use strict";(self.webpackChunk=self.webpackChunk||[]).push([[532],{8476:()=>{}},s=>{var e;e=8476,s(s.s=e)}]);
@@ -28,7 +28,7 @@ export declare class ImportResult {
28
28
 
29
29
  export declare class NxCache {
30
30
  cacheDirectory: string
31
- constructor(workspaceRoot: string, cachePath: string, dbConnection: ExternalObject<Connection>, linkTaskDetails?: boolean | undefined | null)
31
+ constructor(workspaceRoot: string, cachePath: string, dbConnection: ExternalObject<NxDbConnection>, linkTaskDetails?: boolean | undefined | null)
32
32
  get(hash: string): CachedResult | null
33
33
  put(hash: string, terminalOutput: string, outputs: Array<string>, code: number): void
34
34
  applyRemoteCacheResults(hash: string, result: CachedResult): void
@@ -39,7 +39,7 @@ export declare class NxCache {
39
39
  }
40
40
 
41
41
  export declare class NxTaskHistory {
42
- constructor(db: ExternalObject<Connection>)
42
+ constructor(db: ExternalObject<NxDbConnection>)
43
43
  recordTaskRuns(taskRuns: Array<TaskRun>): void
44
44
  getFlakyTasks(hashes: Array<string>): Array<string>
45
45
  getEstimatedTaskTimings(targets: Array<TaskTarget>): Record<string, number>
@@ -56,7 +56,7 @@ export declare class RustPseudoTerminal {
56
56
  }
57
57
 
58
58
  export declare class TaskDetails {
59
- constructor(db: ExternalObject<Connection>)
59
+ constructor(db: ExternalObject<NxDbConnection>)
60
60
  recordTaskDetails(tasks: Array<HashedTask>): void
61
61
  }
62
62
 
@@ -97,7 +97,7 @@ export interface CachedResult {
97
97
  outputsPath: string
98
98
  }
99
99
 
100
- export declare export function connectToNxDb(cacheDir: string, nxVersion: string, dbName?: string | undefined | null): ExternalObject<Connection>
100
+ export declare export function connectToNxDb(cacheDir: string, nxVersion: string, dbName?: string | undefined | null): ExternalObject<NxDbConnection>
101
101
 
102
102
  export declare export function copy(src: string, dest: string): void
103
103
 
Binary file
@@ -18,6 +18,7 @@ export declare class DbCache {
18
18
  private cache;
19
19
  private remoteCache;
20
20
  private remoteCachePromise;
21
+ private isVerbose;
21
22
  constructor(options: {
22
23
  nxCloudRemoteCache: RemoteCache;
23
24
  });
@@ -39,6 +39,7 @@ class DbCache {
39
39
  constructor(options) {
40
40
  this.options = options;
41
41
  this.cache = new native_1.NxCache(workspace_root_1.workspaceRoot, cache_directory_1.cacheDir, (0, db_connection_1.getDbConnection)());
42
+ this.isVerbose = process.env.NX_VERBOSE_LOGGING === 'true';
42
43
  }
43
44
  async init() {
44
45
  // This should be cheap because we've already loaded
@@ -2,4 +2,4 @@ import { ExternalObject } from '../native';
2
2
  export declare function getDbConnection(opts?: {
3
3
  directory?: string;
4
4
  dbName?: string;
5
- }): ExternalObject<Connection>;
5
+ }): ExternalObject<NxDbConnection>;
@@ -1,2 +0,0 @@
1
- import { Tree } from '../../generators/tree';
2
- export default function (tree: Tree): Promise<void>;
@@ -1,102 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = default_1;
4
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
5
- const project_configuration_1 = require("../../generators/utils/project-configuration");
6
- const nx_json_1 = require("../../generators/utils/nx-json");
7
- const path_1 = require("../../utils/path");
8
- const path_2 = require("path");
9
- const json_1 = require("../../generators/utils/json");
10
- const skippedFiles = [
11
- 'package.json', // Not to be added to filesets
12
- 'babel.config.json', // Will be handled by various plugins
13
- 'karma.conf.js', // Will be handled by @nx/angular
14
- 'jest.preset.js', // Will be handled by @nx/jest
15
- '.storybook', // Will be handled by @nx/storybook
16
- // Will be handled by @nx/eslint
17
- '.eslintrc.json',
18
- '.eslintrc.js',
19
- ];
20
- async function default_1(tree) {
21
- // If the workspace doesn't have a nx.json, don't make any changes
22
- if (!tree.exists('nx.json')) {
23
- return;
24
- }
25
- const nxJson = (0, nx_json_1.readNxJson)(tree);
26
- // If this is a npm workspace, don't make any changes
27
- if (nxJson.extends === 'nx/presets/npm.json') {
28
- return;
29
- }
30
- nxJson.namedInputs ??= {
31
- default: ['{projectRoot}/**/*', 'sharedGlobals'],
32
- sharedGlobals: [],
33
- production: ['default'],
34
- };
35
- if (nxJson.namedInputs.default) {
36
- if (!nxJson.namedInputs.production) {
37
- nxJson.namedInputs.production = ['default'];
38
- }
39
- else if (!nxJson.namedInputs.production.includes('default')) {
40
- nxJson.namedInputs.production = [
41
- 'default',
42
- ...nxJson.namedInputs.production,
43
- ];
44
- }
45
- }
46
- if (isBuildATarget(tree)) {
47
- nxJson.targetDefaults ??= {};
48
- nxJson.targetDefaults.build ??= {};
49
- nxJson.targetDefaults.build.inputs ??= ['production', '^production'];
50
- }
51
- if (nxJson.implicitDependencies) {
52
- const projects = (0, project_configuration_1.getProjects)(tree);
53
- for (const [files, dependents] of Object.entries(nxJson.implicitDependencies)) {
54
- // Skip these because other plugins take care of them
55
- if (skippedFiles.includes(files)) {
56
- continue;
57
- }
58
- else if (Array.isArray(dependents)) {
59
- nxJson.namedInputs.projectSpecificFiles = [];
60
- const defaultFileset = new Set(nxJson.namedInputs.default ?? ['{projectRoot}/**/*', 'sharedGlobals']);
61
- defaultFileset.add('projectSpecificFiles');
62
- nxJson.namedInputs.default = Array.from(defaultFileset);
63
- for (const dependent of dependents) {
64
- const project = projects.get(dependent);
65
- project.namedInputs ??= {};
66
- const projectSpecificFileset = new Set(project.namedInputs.projectSpecificFiles ?? []);
67
- projectSpecificFileset.add((0, path_1.joinPathFragments)('{workspaceRoot}', files));
68
- project.namedInputs.projectSpecificFiles = Array.from(projectSpecificFileset);
69
- try {
70
- (0, project_configuration_1.updateProjectConfiguration)(tree, dependent, project);
71
- }
72
- catch {
73
- if (tree.exists((0, path_2.join)(project.root, 'package.json'))) {
74
- (0, json_1.updateJson)(tree, (0, path_2.join)(project.root, 'package.json'), (json) => {
75
- json.nx ??= {};
76
- json.nx.namedInputs ??= {};
77
- json.nx.namedInputs.projectSpecificFiles ??=
78
- project.namedInputs.projectSpecificFiles;
79
- return json;
80
- });
81
- }
82
- }
83
- }
84
- }
85
- else {
86
- nxJson.namedInputs.sharedGlobals.push((0, path_1.joinPathFragments)('{workspaceRoot}', files));
87
- }
88
- }
89
- delete nxJson.implicitDependencies;
90
- }
91
- (0, nx_json_1.updateNxJson)(tree, nxJson);
92
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
93
- }
94
- function isBuildATarget(tree) {
95
- const projects = (0, project_configuration_1.getProjects)(tree);
96
- for (const [_, project] of projects) {
97
- if (project.targets?.build) {
98
- return true;
99
- }
100
- }
101
- return false;
102
- }
@@ -1,2 +0,0 @@
1
- import { Tree } from '../../generators/tree';
2
- export default function removeProjectNameAndRootFormat(tree: Tree): Promise<void>;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = removeProjectNameAndRootFormat;
4
- const json_1 = require("../../generators/utils/json");
5
- const format_changed_files_with_prettier_if_available_1 = require("../../generators/internal-utils/format-changed-files-with-prettier-if-available");
6
- async function removeProjectNameAndRootFormat(tree) {
7
- if (!tree.exists('nx.json')) {
8
- return;
9
- }
10
- (0, json_1.updateJson)(tree, 'nx.json', (nxJson) => {
11
- if (!nxJson.workspaceLayout) {
12
- return nxJson;
13
- }
14
- delete nxJson.workspaceLayout.projectNameAndRootFormat;
15
- if (Object.keys(nxJson.workspaceLayout).length === 0) {
16
- delete nxJson.workspaceLayout;
17
- }
18
- return nxJson;
19
- });
20
- await (0, format_changed_files_with_prettier_if_available_1.formatChangedFilesWithPrettierIfAvailable)(tree);
21
- }