@nx/workspace 19.0.0-rc.1 → 19.0.0-rc.2
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 +4 -4
- package/src/generators/ci-workflow/ci-workflow.js +6 -7
- package/src/generators/ci-workflow/files/azure/azure-pipelines.yml__tmpl__ +2 -1
- package/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__ +2 -1
- package/src/generators/ci-workflow/files/circleci/.circleci/config.yml__tmpl__ +2 -1
- package/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +2 -1
- package/src/generators/ci-workflow/files/gitlab/.gitlab-ci.yml__tmpl__ +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/workspace",
|
|
3
|
-
"version": "19.0.0-rc.
|
|
3
|
+
"version": "19.0.0-rc.2",
|
|
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": "19.0.0-rc.
|
|
64
|
+
"@nx/devkit": "19.0.0-rc.2",
|
|
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": "19.0.0-rc.
|
|
70
|
-
"@nrwl/workspace": "19.0.0-rc.
|
|
69
|
+
"nx": "19.0.0-rc.2",
|
|
70
|
+
"@nrwl/workspace": "19.0.0-rc.2"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
@@ -8,11 +8,6 @@ const nx_cloud_utils_1 = require("nx/src/utils/nx-cloud-utils");
|
|
|
8
8
|
async function ciWorkflowGenerator(tree, schema) {
|
|
9
9
|
const ci = schema.ci;
|
|
10
10
|
const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
|
|
11
|
-
const nxCloudUsed = nxJson.nxCloudAccessToken ??
|
|
12
|
-
Object.values(nxJson.tasksRunnerOptions ?? {}).find((r) => r.runner == '@nrwl/nx-cloud' || r.runner == 'nx-cloud');
|
|
13
|
-
if (!nxCloudUsed) {
|
|
14
|
-
throw new Error('This workspace is not connected to Nx Cloud.');
|
|
15
|
-
}
|
|
16
11
|
if (ci === 'bitbucket-pipelines' && defaultBranchNeedsOriginPrefix(nxJson)) {
|
|
17
12
|
(0, devkit_1.writeJson)(tree, 'nx.json', appendOriginPrefix(nxJson));
|
|
18
13
|
}
|
|
@@ -25,8 +20,12 @@ function normalizeOptions(options, tree) {
|
|
|
25
20
|
const { name: workflowName, fileName: workflowFileName } = (0, devkit_1.names)(options.name);
|
|
26
21
|
const packageManager = (0, devkit_1.detectPackageManager)();
|
|
27
22
|
const { exec: packageManagerPrefix, ciInstall: packageManagerInstall } = (0, devkit_1.getPackageManagerCommand)(packageManager);
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
let nxCloudHost = 'nx.app';
|
|
24
|
+
try {
|
|
25
|
+
const nxCloudUrl = (0, nx_cloud_utils_1.getNxCloudUrl)((0, devkit_1.readJson)(tree, 'nx.json'));
|
|
26
|
+
nxCloudHost = new URL(nxCloudUrl).host;
|
|
27
|
+
}
|
|
28
|
+
catch { }
|
|
30
29
|
const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
|
|
31
30
|
const allDependencies = {
|
|
32
31
|
...packageJson.dependencies,
|
|
@@ -54,5 +54,6 @@ jobs:
|
|
|
54
54
|
- script: git branch --track <%= mainBranch %> origin/<%= mainBranch %>
|
|
55
55
|
condition: eq(variables['Build.Reason'], 'PullRequest')
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
58
|
+
# - script: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
58
59
|
- script: <%= packageManagerPrefix %> nx affected --base=$(BASE_SHA) --head=$(HEAD_SHA) -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
|
package/src/generators/ci-workflow/files/bitbucket-pipelines/bitbucket-pipelines.yml__tmpl__
CHANGED
|
@@ -39,5 +39,6 @@ pipelines:
|
|
|
39
39
|
<% } %>
|
|
40
40
|
- <%= packageManagerInstall %>
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
43
|
+
# - <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
43
44
|
- <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %> --base=HEAD~1
|
|
@@ -23,7 +23,8 @@ jobs:
|
|
|
23
23
|
- nx/set-shas:
|
|
24
24
|
main-branch-name: '<%= mainBranch %>'
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
27
|
+
# - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
27
28
|
- run: <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
|
|
28
29
|
|
|
29
30
|
workflows:
|
package/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__
CHANGED
|
@@ -35,5 +35,6 @@ jobs:
|
|
|
35
35
|
- run: <%= packageManagerInstall %>
|
|
36
36
|
- uses: nrwl/nx-set-shas@v4
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
39
|
+
# - run: <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
39
40
|
- run: <%= packageManagerPrefix %> nx affected -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
|
|
@@ -20,5 +20,6 @@ variables:
|
|
|
20
20
|
- NX_HEAD=$CI_COMMIT_SHA
|
|
21
21
|
- NX_BASE=${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$CI_COMMIT_BEFORE_SHA}
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
|
|
24
|
+
# - <%= packageManagerPrefix %> nx-cloud record -- echo Hello World
|
|
24
25
|
- <%= packageManagerPrefix %> nx affected --base=$NX_BASE --head=$NX_HEAD -t lint test build<% if(hasE2E){ %> e2e-ci<% } %>
|