@nx/docker 0.0.0-pr-32006-c835690 → 0.0.0-pr-32006-c757d1d

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-32006-c835690",
4
+ "version": "0.0.0-pr-32006-c757d1d",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -47,12 +47,12 @@
47
47
  "executors": "./executors.json",
48
48
  "generators": "./generators.json",
49
49
  "dependencies": {
50
- "@nx/devkit": "0.0.0-pr-32006-c835690",
50
+ "@nx/devkit": "0.0.0-pr-32006-c757d1d",
51
51
  "enquirer": "~2.3.6",
52
52
  "tslib": "^2.3.0"
53
53
  },
54
54
  "devDependencies": {
55
- "nx": "0.0.0-pr-32006-c835690"
55
+ "nx": "0.0.0-pr-32006-c757d1d"
56
56
  },
57
57
  "types": "./src/index.d.ts"
58
58
  }
@@ -5,6 +5,7 @@
5
5
  * {currentDate|DATE FORMAT} - the current date with custom format such as YYMM.DD
6
6
  * {commitSha} - The full commit sha for the current commit
7
7
  * {shortCommitSha} - The seven character commit sha for the current commit
8
+ * {env.VAR_NAME} - The value of the environment variable VAR_NAME
8
9
  */
9
10
  export interface PatternTokens {
10
11
  projectName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"version-pattern-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/release/version-pattern-utils.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAsBD,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,UA4B7B"}
1
+ {"version":3,"file":"version-pattern-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/release/version-pattern-utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,IAAI,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB;AAsBD,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,UAsC7B"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.interpolateVersionPattern = interpolateVersionPattern;
4
4
  const git_utils_1 = require("nx/src/utils/git-utils");
5
- const tokenRegex = /\{([^|{}]+)(?:\|([^{}]+))?\}/g;
5
+ const tokenRegex = /\{(env\.([^}]+)|([^|{}]+)(?:\|([^{}]+))?)\}/g;
6
6
  function formatDate(date, format) {
7
7
  const year = String(date.getUTCFullYear());
8
8
  const month = String(date.getUTCMonth() + 1).padStart(2, '0');
@@ -27,7 +27,13 @@ function interpolateVersionPattern(versionPattern, data) {
27
27
  commitSha: data.commitSha ?? commitSha,
28
28
  shortCommitSha: data.shortCommitSha ?? commitSha.slice(0, 7),
29
29
  };
30
- return versionPattern.replace(tokenRegex, (match, identifier, format) => {
30
+ return versionPattern.replace(tokenRegex, (match, fullMatch, envVarName, identifier, format) => {
31
+ // Handle environment variables
32
+ if (envVarName) {
33
+ const envValue = process.env[envVarName];
34
+ return envValue !== undefined ? envValue : match;
35
+ }
36
+ // Handle other tokens
31
37
  const value = substitutions[identifier];
32
38
  if (value === undefined) {
33
39
  return match; // Keep original token if no data