@nx/workspace 19.5.0-canary.20240716-34da542 → 19.5.0-canary.20240717-039f91d
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": "19.5.0-canary.
|
|
3
|
+
"version": "19.5.0-canary.20240717-039f91d",
|
|
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.5.0-canary.
|
|
64
|
+
"@nx/devkit": "19.5.0-canary.20240717-039f91d",
|
|
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.5.0-canary.
|
|
70
|
-
"@nrwl/workspace": "19.5.0-canary.
|
|
69
|
+
"nx": "19.5.0-canary.20240717-039f91d",
|
|
70
|
+
"@nrwl/workspace": "19.5.0-canary.20240717-039f91d"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public"
|
|
@@ -7,12 +7,14 @@ const path_1 = require("path");
|
|
|
7
7
|
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
|
+
const options = normalizeOptions(schema, tree);
|
|
10
11
|
const nxJson = (0, devkit_1.readJson)(tree, 'nx.json');
|
|
11
12
|
if (ci === 'bitbucket-pipelines' && defaultBranchNeedsOriginPrefix(nxJson)) {
|
|
12
|
-
|
|
13
|
+
appendOriginPrefix(nxJson);
|
|
13
14
|
}
|
|
14
|
-
const options = normalizeOptions(schema, tree);
|
|
15
15
|
(0, devkit_1.generateFiles)(tree, (0, path_1.join)(__dirname, 'files', ci), '', options);
|
|
16
|
+
addWorkflowFileToSharedGlobals(nxJson, schema.ci, options.workflowFileName);
|
|
17
|
+
(0, devkit_1.writeJson)(tree, 'nx.json', nxJson);
|
|
16
18
|
await (0, devkit_1.formatFiles)(tree);
|
|
17
19
|
}
|
|
18
20
|
function normalizeOptions(options, tree) {
|
|
@@ -57,5 +59,19 @@ function appendOriginPrefix(nxJson) {
|
|
|
57
59
|
if (nxJson.defaultBase || !nxJson.affected) {
|
|
58
60
|
nxJson.defaultBase = `origin/${nxJson.defaultBase ?? (0, default_base_1.deduceDefaultBase)()}`;
|
|
59
61
|
}
|
|
60
|
-
|
|
62
|
+
}
|
|
63
|
+
const ciWorkflowInputs = {
|
|
64
|
+
azure: 'azure-pipelines.yml',
|
|
65
|
+
'bitbucket-pipelines': 'bitbucket-pipelines.yml',
|
|
66
|
+
circleci: '.circleci/config.yml',
|
|
67
|
+
github: '.github/workflows/',
|
|
68
|
+
gitlab: '.gitlab-ci.yml',
|
|
69
|
+
};
|
|
70
|
+
function addWorkflowFileToSharedGlobals(nxJson, ci, workflowFileName) {
|
|
71
|
+
let input = `{workspaceRoot}/${ciWorkflowInputs[ci]}`;
|
|
72
|
+
if (ci === 'github')
|
|
73
|
+
input += `${workflowFileName}.yml`;
|
|
74
|
+
nxJson.namedInputs ??= {};
|
|
75
|
+
nxJson.namedInputs.sharedGlobals ??= [];
|
|
76
|
+
nxJson.namedInputs.sharedGlobals.push(input);
|
|
61
77
|
}
|