nx 21.6.2 → 21.6.4

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 (38) hide show
  1. package/package.json +12 -12
  2. package/project.json +2 -1
  3. package/src/ai/utils.d.ts +6 -5
  4. package/src/ai/utils.d.ts.map +1 -1
  5. package/src/ai/utils.js +14 -13
  6. package/src/command-line/affected/affected.d.ts.map +1 -1
  7. package/src/command-line/affected/affected.js +1 -2
  8. package/src/command-line/configure-ai-agents/command-object.d.ts +1 -1
  9. package/src/command-line/configure-ai-agents/command-object.d.ts.map +1 -1
  10. package/src/command-line/configure-ai-agents/command-object.js +18 -4
  11. package/src/command-line/configure-ai-agents/configure-ai-agents.d.ts.map +1 -1
  12. package/src/command-line/configure-ai-agents/configure-ai-agents.js +134 -102
  13. package/src/command-line/format/format.js +1 -1
  14. package/src/command-line/init/ai-agent-prompts.d.ts +3 -0
  15. package/src/command-line/init/ai-agent-prompts.d.ts.map +1 -0
  16. package/src/command-line/init/ai-agent-prompts.js +28 -0
  17. package/src/command-line/init/command-object.js +6 -0
  18. package/src/command-line/init/init-v2.d.ts +2 -0
  19. package/src/command-line/init/init-v2.d.ts.map +1 -1
  20. package/src/command-line/init/init-v2.js +20 -0
  21. package/src/command-line/nx-cloud/login/command-object.d.ts.map +1 -1
  22. package/src/command-line/nx-cloud/login/command-object.js +2 -2
  23. package/src/command-line/nx-cloud/logout/command-object.js +1 -1
  24. package/src/command-line/release/utils/get-touched-projects-for-group.js +1 -1
  25. package/src/command-line/show/projects.js +1 -2
  26. package/src/core/graph/main.js +1 -1
  27. package/src/core/graph/styles.js +1 -1
  28. package/src/native/index.d.ts +2 -2
  29. package/src/native/nx.wasm32-wasi.wasm +0 -0
  30. package/src/plugins/js/project-graph/build-dependencies/target-project-locator.js +1 -1
  31. package/src/project-graph/file-utils.d.ts +5 -2
  32. package/src/project-graph/file-utils.d.ts.map +1 -1
  33. package/src/project-graph/file-utils.js +1 -5
  34. package/src/tasks-runner/run-command.js +2 -2
  35. package/src/utils/nx-console-prompt.d.ts.map +1 -1
  36. package/src/utils/nx-console-prompt.js +4 -1
  37. package/src/utils/provenance.d.ts.map +1 -1
  38. package/src/utils/provenance.js +28 -7
@@ -14,6 +14,9 @@ const versions_1 = require("../../utils/versions");
14
14
  const workspace_context_1 = require("../../utils/workspace-context");
15
15
  const connect_to_nx_cloud_1 = require("../nx-cloud/connect/connect-to-nx-cloud");
16
16
  const configure_plugins_1 = require("./configure-plugins");
17
+ const ai_agent_prompts_1 = require("./ai-agent-prompts");
18
+ const set_up_ai_agents_1 = require("../../ai/set-up-ai-agents/set-up-ai-agents");
19
+ const tree_1 = require("../../generators/tree");
17
20
  const add_nx_to_monorepo_1 = require("./implementation/add-nx-to-monorepo");
18
21
  const add_nx_to_npm_repo_1 = require("./implementation/add-nx-to-npm-repo");
19
22
  const add_nx_to_turborepo_1 = require("./implementation/add-nx-to-turborepo");
@@ -120,6 +123,23 @@ async function initHandler(options) {
120
123
  (0, configure_plugins_1.installPluginPackages)(repoRoot, pmc, plugins);
121
124
  await (0, configure_plugins_1.configurePlugins)(plugins, updatePackageScripts, pmc, repoRoot, options.verbose);
122
125
  }
126
+ const selectedAgents = await (0, ai_agent_prompts_1.determineAiAgents)(options.aiAgents, options.interactive && guided);
127
+ if (selectedAgents && selectedAgents.length > 0) {
128
+ const tree = new tree_1.FsTree(repoRoot, false);
129
+ const aiAgentsCallback = await (0, set_up_ai_agents_1.setupAiAgentsGenerator)(tree, {
130
+ directory: '.',
131
+ writeNxCloudRules: options.nxCloud !== false,
132
+ packageVersion: 'latest',
133
+ agents: [...selectedAgents],
134
+ });
135
+ const changes = tree.listChanges();
136
+ (0, tree_1.flushChanges)(repoRoot, changes);
137
+ if (aiAgentsCallback) {
138
+ const results = await aiAgentsCallback();
139
+ results.messages.forEach((m) => output_1.output.log(m));
140
+ results.errors.forEach((e) => output_1.output.error(e));
141
+ }
142
+ }
123
143
  let useNxCloud = options.nxCloud;
124
144
  if (useNxCloud === undefined) {
125
145
  output_1.output.log({ title: '🛠️ Setting up Self-Healing CI and Remote Caching' });
@@ -1 +1 @@
1
- {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/login/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE,aAmB/B,CAAC"}
1
+ {"version":3,"file":"command-object.d.ts","sourceRoot":"","sources":["../../../../../../../packages/nx/src/command-line/nx-cloud/login/command-object.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAGtC,eAAO,MAAM,iBAAiB,EAAE,aAkB/B,CAAC"}
@@ -4,9 +4,9 @@ exports.yargsLoginCommand = void 0;
4
4
  const shared_options_1 = require("../../yargs-utils/shared-options");
5
5
  exports.yargsLoginCommand = {
6
6
  command: 'login [nxCloudUrl]',
7
- describe: 'Login to Nx Cloud. This command is an alias for [`nx-cloud login`](/ci/reference/nx-cloud-cli#npx-nxcloud-login).',
7
+ describe: 'Login to Nx Cloud. This command is an alias for `nx-cloud login`.',
8
8
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs.positional('nxCloudUrl', {
9
- describe: 'The Nx Cloud URL of the instance you are trying to connect to. If no positional argument is provided, this command will connect to https://cloud.nx.app.',
9
+ describe: 'The Nx Cloud URL of the instance you are trying to connect to. If no positional argument is provided, this command will connect to your configured Nx Cloud instance by default.',
10
10
  type: 'string',
11
11
  required: false,
12
12
  }))
@@ -4,7 +4,7 @@ exports.yargsLogoutCommand = void 0;
4
4
  const shared_options_1 = require("../../yargs-utils/shared-options");
5
5
  exports.yargsLogoutCommand = {
6
6
  command: 'logout',
7
- describe: 'Logout from Nx Cloud. This command is an alias for [`nx-cloud logout`](/ci/reference/nx-cloud-cli#npx-nxcloud-logout).',
7
+ describe: 'Logout from Nx Cloud. This command is an alias for `nx-cloud logout`.',
8
8
  builder: (yargs) => (0, shared_options_1.withVerbose)(yargs)
9
9
  .help(false)
10
10
  .showHelpOnFail(false)
@@ -45,7 +45,7 @@ function createGetTouchedProjectsForGroup(nxArgs, projectGraph, changedFiles, fi
45
45
  }
46
46
  else {
47
47
  // We only care about directly touched projects, not implicitly affected ones etc
48
- const touchedProjectsArr = await (0, workspace_projects_1.getTouchedProjects)((0, file_utils_1.calculateFileChanges)(changedFiles, fileData, nxArgs, undefined, ignore), projectGraph.nodes);
48
+ const touchedProjectsArr = await (0, workspace_projects_1.getTouchedProjects)((0, file_utils_1.calculateFileChanges)(changedFiles, nxArgs, undefined, ignore), projectGraph.nodes);
49
49
  touchedProjects = touchedProjectsArr.reduce((acc, project) => ({ ...acc, [project]: true }), {});
50
50
  serializedIgnorePatternsToTouchedProjects.set(serializedIgnorePatterns, touchedProjects);
51
51
  }
@@ -7,7 +7,6 @@ const affected_project_graph_1 = require("../../project-graph/affected/affected-
7
7
  const file_utils_1 = require("../../project-graph/file-utils");
8
8
  const operators_1 = require("../../project-graph/operators");
9
9
  const project_graph_1 = require("../../project-graph/project-graph");
10
- const all_file_data_1 = require("../../utils/all-file-data");
11
10
  const command_line_utils_1 = require("../../utils/command-line-utils");
12
11
  const find_matching_projects_1 = require("../../utils/find-matching-projects");
13
12
  async function showProjectsHandler(args) {
@@ -77,5 +76,5 @@ function getAffectedGraph(touchedFiles, nxJson, graph) {
77
76
  return (0, affected_project_graph_1.filterAffected)(graph, touchedFiles, nxJson);
78
77
  }
79
78
  async function getTouchedFiles(nxArgs) {
80
- return (0, file_utils_1.calculateFileChanges)((0, command_line_utils_1.parseFiles)(nxArgs).files, await (0, all_file_data_1.allFileData)(), nxArgs);
79
+ return (0, file_utils_1.calculateFileChanges)((0, command_line_utils_1.parseFiles)(nxArgs).files, nxArgs);
81
80
  }