@nx/docker 0.0.0-pr-31634-787d0f6 → 21.4.0-beta.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 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": "0.0.0-pr-31634-787d0f6",
4
+ "version": "21.4.0-beta.2",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -19,7 +19,7 @@
19
19
  "Docker",
20
20
  "Containers"
21
21
  ],
22
- "author": "Colum Ferry",
22
+ "author": "Victor Savkin",
23
23
  "license": "MIT",
24
24
  "homepage": "https://nx.dev",
25
25
  "main": "index.js",
@@ -43,12 +43,12 @@
43
43
  "executors": "./executors.json",
44
44
  "generators": "./generators.json",
45
45
  "dependencies": {
46
- "@nx/devkit": "0.0.0-pr-31634-787d0f6",
46
+ "@nx/devkit": "21.4.0-beta.2",
47
47
  "enquirer": "~2.3.6",
48
48
  "tslib": "^2.3.0"
49
49
  },
50
50
  "devDependencies": {
51
- "nx": "0.0.0-pr-31634-787d0f6"
51
+ "nx": "21.4.0-beta.2"
52
52
  },
53
53
  "types": "./src/index.d.ts"
54
54
  }
@@ -1,5 +1,11 @@
1
- import { ExecutorContext } from '@nx/devkit';
2
- import { DockerReleasePublishSchema } from './schema';
1
+ import { type ExecutorContext } from '@nx/devkit';
2
+ import type { DockerReleasePublishSchema } from './schema';
3
+ export interface NormalizedDockerReleasePublishSchema {
4
+ quiet: boolean;
5
+ imageReference: string;
6
+ dryRun: boolean;
7
+ }
8
+ export declare const LARGE_BUFFER: number;
3
9
  export default function dockerReleasePublish(schema: DockerReleasePublishSchema, context: ExecutorContext): Promise<{
4
10
  success: boolean;
5
11
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"release-publish.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/docker/src/executors/release-publish/release-publish.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAIhB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,0BAA0B,EAE3B,MAAM,UAAU,CAAC;AAIlB,wBAA8B,oBAAoB,CAChD,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,eAAe;;GAiBzB"}
1
+ {"version":3,"file":"release-publish.impl.d.ts","sourceRoot":"","sources":["../../../../../../packages/docker/src/executors/release-publish/release-publish.impl.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EAIrB,MAAM,YAAY,CAAC;AAEpB,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAI3D,MAAM,WAAW,oCAAoC;IACnD,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,QAAiB,CAAC;AAE3C,wBAA8B,oBAAoB,CAChD,MAAM,EAAE,0BAA0B,EAClC,OAAO,EAAE,eAAe;;GAiBzB"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LARGE_BUFFER = void 0;
3
4
  exports.default = dockerReleasePublish;
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const child_process_1 = require("child_process");
6
7
  const fs_1 = require("fs");
7
8
  const version_utils_1 = require("../../release/version-utils");
9
+ exports.LARGE_BUFFER = 1024 * 1000000;
8
10
  async function dockerReleasePublish(schema, context) {
9
11
  const projectConfig = context.projectGraph.nodes[context.projectName];
10
12
  const options = normalizeOptions(projectConfig, schema);
@@ -45,7 +47,7 @@ function readVersionFromFile(projectRoot) {
45
47
  }
46
48
  function checkDockerImageExistsLocally(imageRef) {
47
49
  try {
48
- const result = (0, child_process_1.execSync)(`docker images --filter "reference=${imageRef}" --quiet`, { encoding: 'utf8' });
50
+ const result = (0, child_process_1.execSync)(`docker images --filter "reference=${imageRef}" --quiet`, { encoding: 'utf8', stdio: 'inherit', maxBuffer: exports.LARGE_BUFFER });
49
51
  return result.trim().length > 0;
50
52
  }
51
53
  catch {
@@ -2,9 +2,3 @@ export interface DockerReleasePublishSchema {
2
2
  dryRun?: boolean;
3
3
  quiet?: boolean;
4
4
  }
5
-
6
- export interface NormalizedDockerReleasePublishSchema {
7
- quiet: boolean;
8
- imageReference: string;
9
- dryRun: boolean;
10
- }
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,YAAY,CAAC;AAQpB,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAkC5D,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/plugins/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAOnB,MAAM,YAAY,CAAC;AAQpB,MAAM,WAAW,mBAAmB;IAClC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD,eAAO,MAAM,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAmC5D,CAAC"}
@@ -23,6 +23,7 @@ exports.createNodesV2 = [
23
23
  const targetsCache = readTargetsCache(cachePath);
24
24
  const projectRoots = configFilePaths.map((c) => (0, path_1.dirname)(c));
25
25
  const normalizedOptions = normalizePluginOptions(options);
26
+ // TODO(colum): investigate hashing only the dockerfile
26
27
  const hashes = await (0, calculate_hash_for_create_nodes_1.calculateHashesForCreateNodes)(projectRoots, normalizedOptions, context);
27
28
  try {
28
29
  return await (0, devkit_1.createNodesFromFiles)((configFile, _, context, idx) => createNodesInternal(configFile, hashes[idx] + configFile, normalizedOptions, context, targetsCache), configFilePaths, options, context);
@@ -32,7 +32,7 @@ async function promptForNewVersion(versionSchemes, projectName) {
32
32
  const { versionScheme } = await (0, enquirer_1.prompt)({
33
33
  name: 'versionScheme',
34
34
  type: 'select',
35
- message: `What type of release would you like to make for project "${projectName}"?`,
35
+ message: `What type of docker release would you like to make for project "${projectName}"?`,
36
36
  choices: Object.keys(versionSchemes).map((vs) => ({
37
37
  name: vs,
38
38
  message: vs,
@@ -58,7 +58,9 @@ function updateProjectVersion(newVersion, workspaceRoot, projectRoot, repository
58
58
  if (!isDryRun) {
59
59
  (0, child_process_1.execSync)(`docker tag ${imageRef} ${fullImageRef}`);
60
60
  }
61
- const logs = [`Image tagged with ${fullImageRef}.`];
61
+ const logs = isDryRun
62
+ ? [`Image would be tagged with ${fullImageRef} but dry run is enabled.`]
63
+ : [`Image tagged with ${fullImageRef}.`];
62
64
  if (isDryRun) {
63
65
  logs.push(`No changes were applied as --dry-run is enabled.`);
64
66
  }