nx 20.0.0-canary.20241001-8fa7065 → 20.0.0-canary.20241003-84a5c7a

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. package/.eslintrc.json +12 -2
  2. package/migrations.json +0 -37
  3. package/package.json +11 -11
  4. package/release/changelog-renderer/index.d.ts +60 -38
  5. package/release/changelog-renderer/index.js +260 -236
  6. package/src/command-line/add/add.js +2 -2
  7. package/src/command-line/nx-commands.js +31 -10
  8. package/src/command-line/release/changelog.d.ts +2 -2
  9. package/src/command-line/release/changelog.js +28 -29
  10. package/src/command-line/release/index.d.ts +5 -2
  11. package/src/command-line/release/publish.d.ts +6 -1
  12. package/src/command-line/release/publish.js +31 -25
  13. package/src/command-line/release/utils/print-changes.js +6 -4
  14. package/src/command-line/release/utils/resolve-changelog-renderer.d.ts +2 -2
  15. package/src/command-line/release/utils/resolve-changelog-renderer.js +3 -3
  16. package/src/command-line/release/utils/resolve-nx-json-error-message.js +4 -3
  17. package/src/command-line/release/version.d.ts +3 -3
  18. package/src/command-line/yargs-utils/shared-options.js +2 -2
  19. package/src/config/nx-json.d.ts +2 -1
  20. package/src/config/workspace-json-project-json.d.ts +14 -0
  21. package/src/core/graph/main.js +1 -1
  22. package/src/native/nx.wasm32-wasi.wasm +0 -0
  23. package/src/nx-cloud/utilities/axios.js +1 -2
  24. package/src/nx-cloud/utilities/onboarding.js +2 -2
  25. package/src/nx-cloud/utilities/url-shorten.js +5 -5
  26. package/src/project-graph/file-utils.d.ts +2 -2
  27. package/src/project-graph/file-utils.js +2 -2
  28. package/src/tasks-runner/cache.d.ts +2 -1
  29. package/src/tasks-runner/cache.js +10 -6
  30. package/src/tasks-runner/create-task-graph.d.ts +2 -0
  31. package/src/tasks-runner/create-task-graph.js +39 -5
  32. package/src/tasks-runner/run-command.js +15 -2
  33. package/src/tasks-runner/task-orchestrator.js +1 -1
  34. package/src/utils/command-line-utils.d.ts +3 -0
  35. package/src/utils/git-utils.js +2 -2
  36. package/src/migrations/update-15-0-0/prefix-outputs.d.ts +0 -2
  37. package/src/migrations/update-15-0-0/prefix-outputs.js +0 -49
  38. package/src/migrations/update-16-0-0/remove-nrwl-cli.d.ts +0 -2
  39. package/src/migrations/update-16-0-0/remove-nrwl-cli.js +0 -16
  40. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.d.ts +0 -2
  41. package/src/migrations/update-16-0-0/update-depends-on-to-tokens.js +0 -97
  42. package/src/migrations/update-16-0-0/update-nx-cloud-runner.d.ts +0 -2
  43. package/src/migrations/update-16-0-0/update-nx-cloud-runner.js +0 -29
  44. package/src/migrations/update-16-2-0/remove-run-commands-output-path.d.ts +0 -2
  45. package/src/migrations/update-16-2-0/remove-run-commands-output-path.js +0 -45
  46. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.d.ts +0 -12
  47. package/src/migrations/update-16-8-0/escape-dollar-sign-env-variables.js +0 -67
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = escapeDollarSignEnvVariables;
4
- const logger_1 = require("../../utils/logger");
5
- const project_configuration_1 = require("../../generators/utils/project-configuration");
6
- /**
7
- * This function escapes dollar sign in env variables
8
- * It will go through:
9
- * - '.env', '.local.env', '.env.local'
10
- * - .env.[target-name], .[target-name].env
11
- * - .env.[target-name].[configuration-name], .[target-name].[configuration-name].env
12
- * - .env.[configuration-name], .[configuration-name].env
13
- * at each project root and workspace root
14
- * @param tree
15
- */
16
- function escapeDollarSignEnvVariables(tree) {
17
- const envFiles = ['.env', '.local.env', '.env.local'];
18
- for (const [_, configuration] of (0, project_configuration_1.getProjects)(tree).entries()) {
19
- envFiles.push(`${configuration.root}/.env`, `${configuration.root}/.local.env`, `${configuration.root}/.env.local`);
20
- for (const targetName in configuration.targets) {
21
- const task = configuration.targets[targetName];
22
- envFiles.push(`.env.${targetName}`, `.${targetName}.env`, `${configuration.root}/.env.${targetName}`, `${configuration.root}/.${targetName}.env`);
23
- if (task.configurations) {
24
- for (const configurationName in task.configurations) {
25
- envFiles.push(`.env.${targetName}.${configurationName}`, `.${targetName}.${configurationName}.env`, `.env.${configurationName}`, `.${configurationName}.env`, `${configuration.root}/.env.${targetName}.${configurationName}`, `${configuration.root}/.${targetName}.${configurationName}.env`, `${configuration.root}/.env.${configurationName}`, `${configuration.root}/.${configurationName}.env`);
26
- }
27
- }
28
- }
29
- }
30
- for (const envFile of new Set(envFiles)) {
31
- parseEnvFile(tree, envFile);
32
- }
33
- }
34
- /**
35
- * This function parse the env file and escape dollar sign
36
- * @param tree
37
- * @param envFilePath
38
- * @returns
39
- */
40
- function parseEnvFile(tree, envFilePath) {
41
- if (!tree.exists(envFilePath)) {
42
- return;
43
- }
44
- let envFileContent = tree.read(envFilePath, 'utf-8');
45
- if (!envFileContent) {
46
- // envFileContent is null if we fail to read the file for any reason
47
- // e.g. the file is not utf-8 encoded
48
- logger_1.logger.info(`Unable to update ${envFilePath}. Nx interpolates environment variables in the form of $VAR_NAME. To escape the dollar sign, use \\$VAR_NAME.`);
49
- return;
50
- }
51
- envFileContent = envFileContent
52
- .split('\n')
53
- .map((line) => {
54
- line = line.trim();
55
- if (!line || !line.includes('$')) {
56
- return line;
57
- }
58
- const declarations = line.split('=');
59
- if (declarations[1].includes('$') && !declarations[1].includes(`\\$`)) {
60
- declarations[1] = declarations[1].replace('$', `\\$`);
61
- line = declarations.join('=');
62
- }
63
- return line;
64
- })
65
- .join('\n');
66
- tree.write(envFilePath, envFileContent);
67
- }