@nx/js 0.0.0-pr-28808-bceb02f → 0.0.0-pr-28808-ae8ea8d

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/js",
3
- "version": "0.0.0-pr-28808-bceb02f",
3
+ "version": "0.0.0-pr-28808-ae8ea8d",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "@babel/preset-env": "^7.23.2",
40
40
  "@babel/preset-typescript": "^7.22.5",
41
41
  "@babel/runtime": "^7.22.6",
42
- "@nx/devkit": "0.0.0-pr-28808-bceb02f",
43
- "@nx/workspace": "0.0.0-pr-28808-bceb02f",
42
+ "@nx/devkit": "0.0.0-pr-28808-ae8ea8d",
43
+ "@nx/workspace": "0.0.0-pr-28808-ae8ea8d",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^2.8.0",
@@ -47,7 +47,14 @@ function generateTaskProjectTsConfig(task, tasksOptions, context, taskInMemoryTs
47
47
  return tsConfigPath;
48
48
  }
49
49
  function getDependencyTasksInOtherProjects(task, project, context) {
50
- return context.taskGraph.dependencies[task].filter((t) => t !== task && (0, devkit_1.parseTargetString)(t, context).project !== project);
50
+ const implicitDependencies = new Set(context.projectGraph.nodes[project].data.implicitDependencies ?? []);
51
+ return context.taskGraph.dependencies[task].filter((t) => {
52
+ const { project: dependencyProject } = (0, devkit_1.parseTargetString)(t, context);
53
+ // Tasks for implicit dependencies are skipped since incremental builds only apply to explicit dependencies
54
+ return (t !== task &&
55
+ dependencyProject !== project &&
56
+ !implicitDependencies.has(dependencyProject));
57
+ });
51
58
  }
52
59
  function getDependencyTasksInSameProject(task, context) {
53
60
  const { project: taskProject } = (0, devkit_1.parseTargetString)(task, context);
@@ -2,4 +2,4 @@ import { type Tree } from '@nx/devkit';
2
2
  export declare function isUsingTypeScriptPlugin(tree: Tree): boolean;
3
3
  export declare function isUsingTsSolutionSetup(tree?: Tree): boolean;
4
4
  export declare function assertNotUsingTsSolutionSetup(tree: Tree, pluginName: string, generatorName: string): void;
5
- export declare function updateTsconfigFiles(tree: Tree, projectRoot: string, runtimeTsconfigFileName: string, compilerOptions: Record<string, string | boolean | string[]>, exclude?: string[]): void;
5
+ export declare function updateTsconfigFiles(tree: Tree, projectRoot: string, runtimeTsconfigFileName: string, compilerOptions: Record<string, string | boolean | string[]>, exclude?: string[], rootDir?: string): void;
@@ -7,7 +7,6 @@ exports.updateTsconfigFiles = updateTsconfigFiles;
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  const tree_1 = require("nx/src/generators/tree");
9
9
  const package_manager_workspaces_1 = require("../package-manager-workspaces");
10
- const posix_1 = require("node:path/posix");
11
10
  function isUsingTypeScriptPlugin(tree) {
12
11
  const nxJson = (0, devkit_1.readNxJson)(tree);
13
12
  return (nxJson?.plugins?.some((p) => typeof p === 'string'
@@ -67,7 +66,7 @@ function assertNotUsingTsSolutionSetup(tree, pluginName, generatorName) {
67
66
  });
68
67
  process.exit(1);
69
68
  }
70
- function updateTsconfigFiles(tree, projectRoot, runtimeTsconfigFileName, compilerOptions, exclude = []) {
69
+ function updateTsconfigFiles(tree, projectRoot, runtimeTsconfigFileName, compilerOptions, exclude = [], rootDir = 'src') {
71
70
  if (!isUsingTsSolutionSetup(tree))
72
71
  return;
73
72
  const offset = (0, devkit_1.offsetFromRoot)(projectRoot);
@@ -83,6 +82,7 @@ function updateTsconfigFiles(tree, projectRoot, runtimeTsconfigFileName, compile
83
82
  // Make sure d.ts files from typecheck does not conflict with bundlers.
84
83
  // Other tooling like jest write to "out-tsc/jest" to we just default to "out-tsc/<project-name>".
85
84
  outDir: (0, devkit_1.joinPathFragments)('out-tsc', projectRoot.split('/').at(-1)),
85
+ rootDir,
86
86
  ...compilerOptions,
87
87
  };
88
88
  const excludeSet = json.exclude
@@ -107,11 +107,9 @@ function updateTsconfigFiles(tree, projectRoot, runtimeTsconfigFileName, compile
107
107
  });
108
108
  }
109
109
  if (tree.exists(tsconfigE2E)) {
110
+ // tsconfig.json for e2e projects need to have references array
110
111
  (0, devkit_1.updateJson)(tree, tsconfigE2E, (json) => {
111
112
  json.references ??= [];
112
- const projectPath = (0, posix_1.relative)(e2eRoot, projectRoot);
113
- if (!json.references.some((x) => x.path === projectPath))
114
- json.references.push({ path: projectPath });
115
113
  return json;
116
114
  });
117
115
  }