@nx/workspace 18.0.1 → 18.0.3

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/workspace",
3
- "version": "18.0.1",
3
+ "version": "18.0.3",
4
4
  "private": false,
5
5
  "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
6
6
  "repository": {
@@ -61,13 +61,13 @@
61
61
  }
62
62
  },
63
63
  "dependencies": {
64
- "@nx/devkit": "18.0.1",
64
+ "@nx/devkit": "18.0.3",
65
65
  "chalk": "^4.1.0",
66
66
  "enquirer": "~2.3.6",
67
67
  "tslib": "^2.3.0",
68
68
  "yargs-parser": "21.1.1",
69
- "nx": "18.0.1",
70
- "@nrwl/workspace": "18.0.1"
69
+ "nx": "18.0.3",
70
+ "@nrwl/workspace": "18.0.3"
71
71
  },
72
72
  "publishConfig": {
73
73
  "access": "public"
@@ -21,6 +21,26 @@ jobs:
21
21
  pool:
22
22
  vmImage: 'ubuntu-latest'
23
23
  steps:
24
+ - checkout: self
25
+ fetchDepth: 0
26
+ # Set Azure Devops CLI default settings
27
+ - bash: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject)
28
+ displayName: 'Set default Azure DevOps organization and project'
29
+ # Get last successfull commit from Azure Devops CLI
30
+ - displayName: 'Get last successful commit SHA'
31
+ condition: ne(variables['Build.Reason'], 'PullRequest')
32
+ env:
33
+ AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)
34
+ bash: |
35
+ LAST_SHA=$(az pipelines build list --branch $(Build.SourceBranchName) --definition-ids $(System.DefinitionId) --result succeeded --top 1 --query "[0].triggerInfo.\"ci.sourceSha\"")
36
+ if [ -z "$LAST_SHA" ]
37
+ then
38
+ echo "Last successful commit not found. Using fallback 'HEAD~1': $BASE_SHA"
39
+ else
40
+ echo "Last successful commit SHA: $LAST_SHA"
41
+ echo "##vso[task.setvariable variable=BASE_SHA]$LAST_SHA"
42
+ fi
43
+
24
44
  # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
25
45
  # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
26
46
  # - script: <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
@@ -6,20 +6,36 @@ clone:
6
6
  pipelines:
7
7
  pull-requests:
8
8
  '**':
9
- - parallel:
10
- - step:
11
- name: <%= workflowName %>
12
- script:
13
- - export NX_BRANCH=$BITBUCKET_PR_ID
14
-
15
- # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
16
- # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
17
- # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
18
-
19
- <% if(packageManager == 'pnpm'){ %>
20
- - npm install --prefix=$HOME/.local -g pnpm@8
21
- <% } %>
22
- - <%= packageManagerInstall %>
23
-
24
- - <%= packageManagerPrefix %> nx-cloud record -- nx format:check
25
- - <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
9
+ - step:
10
+ name: 'Build and test affected apps on Pull Requests'
11
+ script:
12
+ - export NX_BRANCH=$BITBUCKET_PR_ID
13
+
14
+ # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
15
+ # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
16
+ # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
17
+
18
+ <% if(packageManager == 'pnpm'){ %>
19
+ - npm install --prefix=$HOME/.local -g pnpm@8
20
+ <% } %>
21
+ - <%= packageManagerInstall %>
22
+
23
+ - <%= packageManagerPrefix %> nx-cloud record -- nx format:check
24
+ - <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> --base=origin/<%= mainBranch %>
25
+
26
+ branches:
27
+ main:
28
+ - step:
29
+ name: 'Build and test affected apps on "<%= mainBranch %>" branch changes'
30
+ script:
31
+ # Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
32
+ # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>" targets have been requested
33
+ # - <%= packageManagerPrefix %> nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="<% if(hasE2E){ %>e2e-ci<% } else { %>build<% } %>"
34
+
35
+ <% if(packageManager == 'pnpm'){ %>
36
+ - npm install --prefix=$HOME/.local -g pnpm@8
37
+ <% } %>
38
+ - <%= packageManagerInstall %>
39
+
40
+ - <%= packageManagerPrefix %> nx-cloud record -- nx format:check
41
+ - <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> --base=HEAD~1