@nx/docker 21.4.0-beta.6 → 21.4.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.
- package/package.json +3 -3
- package/src/release/version-pattern-utils.d.ts +1 -0
- package/src/release/version-pattern-utils.d.ts.map +1 -1
- package/src/release/version-pattern-utils.js +8 -2
- package/src/release/version-utils.d.ts +1 -1
- package/src/release/version-utils.d.ts.map +1 -1
- package/src/release/version-utils.js +14 -7
- package/README.md +0 -70
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": "21.4.0-beta.
|
|
4
|
+
"version": "21.4.0-beta.8",
|
|
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": "21.4.0-beta.
|
|
50
|
+
"@nx/devkit": "21.4.0-beta.8",
|
|
51
51
|
"enquirer": "~2.3.6",
|
|
52
52
|
"tslib": "^2.3.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"nx": "21.4.0-beta.
|
|
55
|
+
"nx": "21.4.0-beta.8"
|
|
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
|
|
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 = /\{([^|{}]+)(?:\|([^{}]+))
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ProjectGraphProjectNode } from '@nx/devkit';
|
|
2
2
|
import type { FinalConfigForProject } from 'nx/src/command-line/release/version/release-group-processor';
|
|
3
3
|
export declare const getDockerVersionPath: (workspaceRoot: string, projectRoot: string) => string;
|
|
4
|
-
export declare function handleDockerVersion(workspaceRoot: string, projectGraphNode: ProjectGraphProjectNode, finalConfigForProject: FinalConfigForProject, dockerVersionScheme?: string): Promise<{
|
|
4
|
+
export declare function handleDockerVersion(workspaceRoot: string, projectGraphNode: ProjectGraphProjectNode, finalConfigForProject: FinalConfigForProject, dockerVersionScheme?: string, dockerVersion?: string): Promise<{
|
|
5
5
|
newVersion: string;
|
|
6
6
|
logs: string[];
|
|
7
7
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/release/version-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAQzG,eAAO,MAAM,oBAAoB,GAC/B,eAAe,MAAM,EACrB,aAAa,MAAM,WAGpB,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,uBAAuB,EACzC,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,CAAC,EAAE,MAAM;;;
|
|
1
|
+
{"version":3,"file":"version-utils.d.ts","sourceRoot":"","sources":["../../../../../packages/docker/src/release/version-utils.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6DAA6D,CAAC;AAQzG,eAAO,MAAM,oBAAoB,GAC/B,eAAe,MAAM,EACrB,aAAa,MAAM,WAGpB,CAAC;AAEF,wBAAsB,mBAAmB,CACvC,aAAa,EAAE,MAAM,EACrB,gBAAgB,EAAE,uBAAuB,EACzC,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,CAAC,EAAE,MAAM,EAC5B,aAAa,CAAC,EAAE,MAAM;;;GAkCvB"}
|
|
@@ -15,13 +15,20 @@ const getDockerVersionPath = (workspaceRoot, projectRoot) => {
|
|
|
15
15
|
return (0, path_1.join)(workspaceRoot, 'tmp', projectRoot, '.docker-version');
|
|
16
16
|
};
|
|
17
17
|
exports.getDockerVersionPath = getDockerVersionPath;
|
|
18
|
-
async function handleDockerVersion(workspaceRoot, projectGraphNode, finalConfigForProject, dockerVersionScheme) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
async function handleDockerVersion(workspaceRoot, projectGraphNode, finalConfigForProject, dockerVersionScheme, dockerVersion) {
|
|
19
|
+
// If an explicit dockerVersion is provided, use it directly
|
|
20
|
+
let newVersion;
|
|
21
|
+
if (dockerVersion) {
|
|
22
|
+
newVersion = dockerVersion;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
const availableVersionSchemes = finalConfigForProject.dockerOptions.versionSchemes ??
|
|
26
|
+
DEFAULT_VERSION_SCHEMES;
|
|
27
|
+
const versionScheme = dockerVersionScheme && dockerVersionScheme in availableVersionSchemes
|
|
28
|
+
? dockerVersionScheme
|
|
29
|
+
: await promptForNewVersion(availableVersionSchemes, projectGraphNode.name);
|
|
30
|
+
newVersion = calculateNewVersion(projectGraphNode.name, versionScheme, availableVersionSchemes);
|
|
31
|
+
}
|
|
25
32
|
const logs = updateProjectVersion(newVersion, workspaceRoot, projectGraphNode.data.root, finalConfigForProject.dockerOptions.repositoryName, finalConfigForProject.dockerOptions.registryUrl);
|
|
26
33
|
return {
|
|
27
34
|
newVersion,
|
package/README.md
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
<p style="text-align: center;">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-dark.svg">
|
|
4
|
-
<img alt="Nx - Smart Repos · Fast Builds" src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-light.svg" width="100%">
|
|
5
|
-
</picture>
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
<div style="text-align: center;">
|
|
9
|
-
|
|
10
|
-
[](https://circleci.com/gh/nrwl/nx)
|
|
11
|
-
[]()
|
|
12
|
-
[](https://www.npmjs.com/package/nx)
|
|
13
|
-
[]()
|
|
14
|
-
[](http://commitizen.github.io/cz-cli/)
|
|
15
|
-
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
16
|
-
[](https://go.nx.dev/community)
|
|
17
|
-
|
|
18
|
-
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<hr>
|
|
22
|
-
|
|
23
|
-
# Nx: Smart Repos · Fast Builds
|
|
24
|
-
|
|
25
|
-
An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
|
|
26
|
-
|
|
27
|
-
This package is a [Docker plugin for Nx](https://nx.dev/nx-api/docker).
|
|
28
|
-
|
|
29
|
-
**Experimental**: Support for Docker is currently experimental. Breaking changes may occur and not adhere to semver versioning.
|
|
30
|
-
|
|
31
|
-
## Getting Started
|
|
32
|
-
|
|
33
|
-
### Creating an Nx Workspace
|
|
34
|
-
|
|
35
|
-
**Using `npx`**
|
|
36
|
-
|
|
37
|
-
```bash
|
|
38
|
-
npx create-nx-workspace
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
**Using `npm init`**
|
|
42
|
-
|
|
43
|
-
```bash
|
|
44
|
-
npm init nx-workspace
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Using `yarn create`**
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
yarn create nx-workspace
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Adding Nx to an Existing Repository
|
|
54
|
-
|
|
55
|
-
Run:
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
npx nx@latest init
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## Documentation & Resources
|
|
62
|
-
|
|
63
|
-
- [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
|
|
64
|
-
- [Intro to Nx](https://nx.dev/getting-started/intro)
|
|
65
|
-
- [Official Nx YouTube Channel](https://www.youtube.com/@NxDevtools)
|
|
66
|
-
- [Blog Posts About Nx](https://nx.dev/blog)
|
|
67
|
-
|
|
68
|
-
<p style="text-align: center;"><a href="https://nx.dev/#learning-materials" target="_blank" rel="noreferrer"><img src="https://raw.githubusercontent.com/nrwl/nx/master/images/nx-courses-and-videos.svg"
|
|
69
|
-
width="100%" alt="Nx - Smart Repos · Fast Builds"></a></p>
|
|
70
|
-
|