@nx/docker 23.2.0-beta.6 → 23.2.0-beta.8
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.
|
@@ -6,14 +6,13 @@ const internal_1 = require("@nx/devkit/internal");
|
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const internal_2 = require("@nx/devkit/internal");
|
|
10
9
|
const interpolate_pattern_1 = require("../utils/interpolate-pattern");
|
|
11
10
|
const dockerfileGlob = '**/Dockerfile';
|
|
12
11
|
exports.createNodes = [
|
|
13
12
|
dockerfileGlob,
|
|
14
13
|
async (configFilePaths, options, context) => {
|
|
15
14
|
const optionsHash = (0, internal_1.hashObject)(options);
|
|
16
|
-
const cachePath = (0, path_1.join)(
|
|
15
|
+
const cachePath = (0, path_1.join)(internal_1.workspaceDataDirectory, `docker-${optionsHash}.hash`);
|
|
17
16
|
const targetsCache = new internal_1.PluginCache(cachePath);
|
|
18
17
|
const projectRoots = configFilePaths.map((c) => (0, path_1.dirname)(c));
|
|
19
18
|
const normalizedOptions = normalizePluginOptions(options);
|
|
@@ -48,7 +47,7 @@ async function createNodesInternal(configFilePath, hash, normalizedOptions, cont
|
|
|
48
47
|
};
|
|
49
48
|
}
|
|
50
49
|
function interpolateDockerTargetOptions(options, projectRoot, imageRef, context) {
|
|
51
|
-
const commitSha = (0,
|
|
50
|
+
const commitSha = (0, internal_1.getLatestCommitSha)();
|
|
52
51
|
const projectName = getProjectName(projectRoot, context.workspaceRoot);
|
|
53
52
|
const tokens = {
|
|
54
53
|
projectRoot,
|
|
@@ -5,9 +5,9 @@ exports.handleDockerVersion = handleDockerVersion;
|
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const path_1 = require("path");
|
|
8
|
-
const enquirer_1 = require("enquirer");
|
|
9
8
|
const devkit_1 = require("@nx/devkit");
|
|
10
9
|
const version_pattern_utils_1 = require("./version-pattern-utils");
|
|
10
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
11
11
|
const DEFAULT_VERSION_SCHEMES = {
|
|
12
12
|
production: '{currentDate|YYMM.DD}.{shortCommitSha}',
|
|
13
13
|
hotfix: '{currentDate|YYMM.DD}.{shortCommitSha}-hotfix',
|
|
@@ -52,27 +52,16 @@ async function handleDockerVersion(workspaceRoot, projectGraphNode, finalConfigF
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
async function promptForNewVersion(versionSchemes, projectName) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
type: 'select',
|
|
55
|
+
// Each scheme's resolved pattern renders as its own hint.
|
|
56
|
+
return (0, internal_1.selectPrompt)({
|
|
58
57
|
message: `What type of docker release would you like to make for project "${projectName}"?`,
|
|
59
58
|
choices: Object.keys(versionSchemes).map((vs) => ({
|
|
60
|
-
name: vs,
|
|
61
|
-
message: vs,
|
|
62
59
|
value: vs,
|
|
63
|
-
|
|
60
|
+
hint: (0, version_pattern_utils_1.interpolateVersionPattern)(versionSchemes[vs], {
|
|
64
61
|
projectName,
|
|
65
62
|
}),
|
|
66
63
|
})),
|
|
67
|
-
// Show only the focused scheme's resolved pattern, not every row's at once.
|
|
68
|
-
footer: function () {
|
|
69
|
-
const focused = this.focused;
|
|
70
|
-
return focused?.description
|
|
71
|
-
? this.styles.muted(` ${focused.description}`)
|
|
72
|
-
: '';
|
|
73
|
-
},
|
|
74
64
|
});
|
|
75
|
-
return versionScheme;
|
|
76
65
|
}
|
|
77
66
|
function calculateNewVersion(projectName, versionScheme, versionSchemes, versionActionsVersion) {
|
|
78
67
|
if (!(versionScheme in versionSchemes)) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/docker",
|
|
3
3
|
"description": "The Nx Plugin for Docker to aid in containerizing projects.",
|
|
4
|
-
"version": "23.2.0-beta.
|
|
4
|
+
"version": "23.2.0-beta.8",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -85,11 +85,10 @@
|
|
|
85
85
|
"executors": "./executors.json",
|
|
86
86
|
"generators": "./generators.json",
|
|
87
87
|
"dependencies": {
|
|
88
|
-
"enquirer": "~2.3.6",
|
|
89
88
|
"tslib": "^2.3.0",
|
|
90
|
-
"@nx/devkit": "23.2.0-beta.
|
|
89
|
+
"@nx/devkit": "23.2.0-beta.8"
|
|
91
90
|
},
|
|
92
91
|
"devDependencies": {
|
|
93
|
-
"nx": "23.2.0-beta.
|
|
92
|
+
"nx": "23.2.0-beta.8"
|
|
94
93
|
}
|
|
95
94
|
}
|