@nx/docker 22.1.0-rc.3 → 22.1.0-rc.4
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 +3 -3
- package/src/plugins/plugin.d.ts +11 -0
- package/src/plugins/plugin.d.ts.map +1 -1
- package/src/plugins/plugin.js +13 -3
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": "22.1.0-rc.
|
|
4
|
+
"version": "22.1.0-rc.4",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
"executors": "./executors.json",
|
|
52
52
|
"generators": "./generators.json",
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@nx/devkit": "22.1.0-rc.
|
|
54
|
+
"@nx/devkit": "22.1.0-rc.4",
|
|
55
55
|
"enquirer": "~2.3.6",
|
|
56
56
|
"tslib": "^2.3.0"
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
|
-
"nx": "22.1.0-rc.
|
|
59
|
+
"nx": "22.1.0-rc.4"
|
|
60
60
|
},
|
|
61
61
|
"types": "./src/index.d.ts"
|
|
62
62
|
}
|
package/src/plugins/plugin.d.ts
CHANGED
|
@@ -5,6 +5,17 @@ export interface DockerTargetOptions {
|
|
|
5
5
|
env?: Record<string, string>;
|
|
6
6
|
envFile?: string;
|
|
7
7
|
cwd?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Skip adding the default `--tag` argument to the Docker build command.
|
|
10
|
+
* When set to `true`, you must provide your own tag via the `args` property.
|
|
11
|
+
*
|
|
12
|
+
* **Important:** Setting this to `true` opts out of Nx Release support for this project.
|
|
13
|
+
* The automatic versioning and publishing features of `nx release` will not work
|
|
14
|
+
* with Docker projects that have `skipDefaultTag` enabled.
|
|
15
|
+
*
|
|
16
|
+
* @default false
|
|
17
|
+
*/
|
|
18
|
+
skipDefaultTag?: boolean;
|
|
8
19
|
configurations?: Record<string, Omit<DockerTargetOptions, 'configurations' | 'name'>>;
|
|
9
20
|
}
|
|
10
21
|
export interface DockerPluginOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CACrB,MAAM,EACN,IAAI,CAAC,mBAAmB,EAAE,gBAAgB,GAAG,MAAM,CAAC,CACrD,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;CAC1C;AAsBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAmC5D,CAAC;AAmDF,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACpB,MAAM,CAOR"}
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAQnB,MAAM,YAAY,CAAC;AAUpB,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;;;;;;OASG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,CACrB,MAAM,EACN,IAAI,CAAC,mBAAmB,EAAE,gBAAgB,GAAG,MAAM,CAAC,CACrD,CAAC;CACH;AAED,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC;CAC1C;AAsBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAmC5D,CAAC;AAmDF,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,GACpB,MAAM,CAOR"}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -99,8 +99,13 @@ function buildTargetOptions(interpolatedTarget, projectRoot, imageRef, isRunTarg
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
else {
|
|
102
|
-
// Build target
|
|
103
|
-
|
|
102
|
+
// Build target includes --tag default unless skipDefaultTag is true
|
|
103
|
+
if (interpolatedTarget.skipDefaultTag) {
|
|
104
|
+
options.args = interpolatedTarget.args ?? [];
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
options.args = [`--tag ${imageRef}`, ...(interpolatedTarget.args ?? [])];
|
|
108
|
+
}
|
|
104
109
|
}
|
|
105
110
|
if (interpolatedTarget.env) {
|
|
106
111
|
options.env = interpolatedTarget.env;
|
|
@@ -117,7 +122,12 @@ function buildTargetConfigurations(interpolatedTarget, projectRoot, imageRef, is
|
|
|
117
122
|
const configurations = {};
|
|
118
123
|
for (const [configName, configOptions] of Object.entries(interpolatedTarget.configurations)) {
|
|
119
124
|
// Each configuration gets the full treatment with defaults
|
|
120
|
-
|
|
125
|
+
// Inherit skipDefaultTag from parent if not explicitly set in config
|
|
126
|
+
configurations[configName] = buildTargetOptions({
|
|
127
|
+
...configOptions,
|
|
128
|
+
name: interpolatedTarget.name,
|
|
129
|
+
skipDefaultTag: configOptions.skipDefaultTag ?? interpolatedTarget.skipDefaultTag,
|
|
130
|
+
}, projectRoot, imageRef, isRunTarget);
|
|
121
131
|
}
|
|
122
132
|
return configurations;
|
|
123
133
|
}
|