@wtf/release-oci 1.0.0 → 2.0.0

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/README.md CHANGED
@@ -50,7 +50,7 @@ does this:
50
50
  - `smokeImages` (`./publish`) finds the tested image of each, its source, by its digest
51
51
  (`crane digest`), and the platforms of its index (`crane manifest`). A source the registry has
52
52
  not, or of fewer platforms than the release asks, fails (`EOCISMOKE`).
53
- - `publishImages` copies the digest of each source to the tags of the release
53
+ - `publishImages` copies the digest of each source to the tags the release gives
54
54
  (`crane copy <source>@<digest> <image>:<tag>`), which mounts each blob of the source's repository
55
55
  rather than moving it. The tag of the version is copied once: a registry that has it at the same
56
56
  digest is skipped, so a release that stopped part way is finished by running it again, and at
@@ -72,6 +72,32 @@ to each release of their line, so a consumer that pins `1` takes each fix and fe
72
72
  A minor of the major `0` breaks what the one before gave, so a release of `0.x` moves its minor
73
73
  alone; a prerelease moves no tag.
74
74
 
75
+ `publishImages` takes the tags of a release as they are given: `version`, the tag that is copied
76
+ once and never moved, and `moving`, each tag copied on every run, `[]` of none. It derives none:
77
+ `releaseTagsOf` gives those of a semver version, as the plugin passes them, and a release of a
78
+ version that is no semver, as `12.12-wtf.1` of an image of Debian 12.12, names its own. Each is a tag
79
+ an image can have, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none given twice, as `checkReleaseTags`
80
+ checks before anything is asked of the registry.
81
+
82
+ ```ts
83
+ import { publishImages } from '@wtf/release-oci/publish'
84
+ import type { System } from '@wtf/release-system/system'
85
+
86
+ /** The base image of Debian 12.12, its first build of ours, as `12.12-wtf.1`, `12.12` and `latest`. */
87
+ export const release = (system: System, source: string) =>
88
+ publishImages({
89
+ context: { system },
90
+ images: [
91
+ {
92
+ repository: 'registry.gitlab.com/acme/images/base',
93
+ source: { repository: 'registry.gitlab.com/acme/images/base', tag: source }
94
+ }
95
+ ],
96
+ version: '12.12-wtf.1',
97
+ moving: ['12.12', 'latest']
98
+ })
99
+ ```
100
+
75
101
  ```ts
76
102
  import { tagsOfRelease } from '@wtf/release-oci/tags'
77
103
 
@@ -93,7 +119,7 @@ build as an argument of its own.
93
119
  | `.` | `OciImage`, and the ecosystem as the default export |
94
120
  | `./ecosystem` | `ociEcosystem`, `packagesOfImages`, `packagesOfRepo`, `resolveTag`, `satisfiesTag` |
95
121
  | `./images` | `readImages`, `imagesAt`, `imagesOf`, `imageDirOf`, `repositoryOf` |
96
- | `./tags` | `tagsOfRelease`, `releaseTagsOf` |
122
+ | `./tags` | `tagsOfRelease`, `releaseTagsOf`, `checkReleaseTags` |
97
123
  | `./publish` | `smokeImages`, `publishImages`, `digestOf`, `platformsOf` |
98
124
  | `./registry` | `registryPageOf` |
99
125
  | `./errors` | `OciError`, `OCI_ERRORS` |
package/dist/publish.d.ts CHANGED
@@ -72,10 +72,16 @@ export interface ImagesRelease {
72
72
  readonly context: CraneContext;
73
73
  /** The images of the release, each of its source. */
74
74
  readonly images: readonly ImageToPublish[];
75
- /** The version of the release, as `1.4.2`. */
75
+ /**
76
+ * The version of the release, its tag, which is copied once and never moved: `1.4.2`, or of a
77
+ * version that is no semver, `12.12-wtf.1`. A tag of an image, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`.
78
+ */
76
79
  readonly version: string;
77
- /** Whether a release moves its minor and its major: `true` by default. */
78
- readonly moving?: boolean | undefined;
80
+ /**
81
+ * The tags that move to each release of their line, copied on every run, as `['1.4', '1']`, which
82
+ * `releaseTagsOf` of `./tags` gives of a semver version, or `['12.12', 'latest']`: none of `[]`.
83
+ */
84
+ readonly moving: readonly string[];
79
85
  /** The platforms each source must be of: any by default. */
80
86
  readonly platforms?: readonly string[] | undefined;
81
87
  /**
@@ -87,11 +93,12 @@ export interface ImagesRelease {
87
93
  }
88
94
  /**
89
95
  * The images of a release published: each source smoked ({@link smokeImages}), then copied by its
90
- * digest to the tag of the version, of an image the registry has not at it, and to each moving tag.
91
- * Throws, together, `EOCIRETAG` of each image whose version the registry has at another digest,
96
+ * digest to the tag of the version, of an image the registry has not at it, and to each moving tag:
97
+ * the tags the release gives. Throws a `TypeError` of a tag an image cannot have, or of one given
98
+ * twice, before it asks the registry anything; then, together, `EOCIRETAG` of each image whose version the registry has at another digest,
92
99
  * before anything is copied; and `EOCITAG` of a copy crane cannot make.
93
100
  *
94
- * @param release - The images, the version and where crane runs.
101
+ * @param release - The images, the version and the tags that move, and where crane runs.
95
102
  * @returns Each image, of the tags copied and skipped.
96
103
  */
97
104
  export declare function publishImages(release: ImagesRelease): Promise<PublishedImage[]>;
@@ -1 +1 @@
1
- {"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAkCA,OAAO,EAAE,KAAK,UAAU,EAAS,MAAM,yBAAyB,CAAA;AAKhE,0GAA0G;AAC1G,MAAM,WAAW,SAAS;IACxB,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,iCAAiC;IACjC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACrB;AAED,gGAAgG;AAChG,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;CAC3B;AAED,8FAA8F;AAC9F,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,qFAAqF;IACrF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CACpC;AAED,4DAA4D;AAC5D,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,8FAA8F;IAC9F,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;CACtC;AAED,2FAA2F;AAC3F,MAAM,WAAW,cAAe,SAAQ,WAAW;IACjD,8CAA8C;IAC9C,QAAQ,CAAC,OA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ACH,wBAAsB,WAAW,CAC/B,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,MAAM,EAAE,CAAC,CAmBnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,SAAS,cAAc,EAAE,EACjC,OAAO,EAAE,YAAY,EACrB,SAAS,GAAE,SAAS,MAAM,EAAO,GAChC,OAAO,CAAC,WAAW,EAAE,CAAC,CA+BxB;AAED,4CAA4C;AAC5C,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;IAC9B,qDAAqD;IACrD,QAAQ,CAAC,MAAM,EAAE,SAAS,cAAc,EAAE,CAAA;IAC1C;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IAClC,4DAA4D;IAC5D,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,CAAA;IAClD;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;CACpD;AAED;;;;;;;;;GASG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAiDrF"}
package/dist/publish.js CHANGED
@@ -5,13 +5,16 @@
5
5
  * each blob of the source's repository rather than moving it. The tag of the version is copied once:
6
6
  * a registry that has it at the same digest is skipped, so a release that stopped part way is
7
7
  * finished by running it again, and at another digest is refused (`EOCIRETAG`), as a released
8
- * version never moves. The moving tags, as `1.4` and `1`, are copied every time.
8
+ * version never moves. The moving tags the release gives, as `1.4` and `1`, of `releaseTagsOf` of
9
+ * `./tags`, or `12.12` and `latest` of a version that is no semver, as `12.12-wtf.1`, are copied
10
+ * every time.
9
11
  *
10
12
  * crane runs by the `System` it is given, of the environment it is given: it reads the credentials
11
13
  * of the registry of its own config, as `crane auth login` writes it, or of the docker config.
12
14
  *
13
15
  * ```ts
14
16
  * import { publishImages } from '@wtf/release-oci/publish'
17
+ * import { releaseTagsOf } from '@wtf/release-oci/tags'
15
18
  * import type { System } from '@wtf/release-system'
16
19
  *
17
20
  * export async function release(system: System): Promise<void> {
@@ -23,7 +26,8 @@
23
26
  * source: { repository: 'registry.gitlab.com/acme/images/base/snapshot', tag: 'base-v1-4-2' }
24
27
  * }
25
28
  * ],
26
- * version: '1.4.2'
29
+ * version: '1.4.2',
30
+ * moving: releaseTagsOf('1.4.2').moving
27
31
  * })
28
32
  * }
29
33
  * ```
@@ -34,7 +38,7 @@
34
38
  import { throwAll } from '@wtf/release-system/errors';
35
39
  import { gitOf } from '@wtf/release-system/git';
36
40
  import { OciError } from "./errors.js";
37
- import { releaseTagsOf } from "./tags.js";
41
+ import { checkReleaseTags } from "./tags.js";
38
42
  /** The reference of a source, of its repository and its tag. */
39
43
  const sourceRef = ({ repository, tag }) => `${repository}:${tag}`;
40
44
  /** Whether crane said the registry has no such repository or manifest. */
@@ -131,17 +135,18 @@ export async function smokeImages(images, context, platforms = []) {
131
135
  }
132
136
  /**
133
137
  * The images of a release published: each source smoked ({@link smokeImages}), then copied by its
134
- * digest to the tag of the version, of an image the registry has not at it, and to each moving tag.
135
- * Throws, together, `EOCIRETAG` of each image whose version the registry has at another digest,
138
+ * digest to the tag of the version, of an image the registry has not at it, and to each moving tag:
139
+ * the tags the release gives. Throws a `TypeError` of a tag an image cannot have, or of one given
140
+ * twice, before it asks the registry anything; then, together, `EOCIRETAG` of each image whose version the registry has at another digest,
136
141
  * before anything is copied; and `EOCITAG` of a copy crane cannot make.
137
142
  *
138
- * @param release - The images, the version and where crane runs.
143
+ * @param release - The images, the version and the tags that move, and where crane runs.
139
144
  * @returns Each image, of the tags copied and skipped.
140
145
  */
141
146
  export async function publishImages(release) {
142
- const { context, version } = release;
147
+ const { context } = release;
143
148
  const log = release.log ?? (() => undefined);
144
- const tags = releaseTagsOf(version, release.moving ?? true);
149
+ const tags = checkReleaseTags({ version: release.version, moving: release.moving });
145
150
  const smoked = await smokeImages(release.images, context, release.platforms ?? []);
146
151
  const errors = [];
147
152
  const has = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"publish.js","sourceRoot":"","sources":["../src/publish.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACrD,OAAO,EAAmB,KAAK,EAAE,MAAM,yBAAyB,CAAA;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAA;AA0CzC,gEAAgE;AAChE,MAAM,SAAS,GAAG,CAAC,EAAE,UAAU,EAAE,GAAG,EAAa,EAAU,EAAE,CAAC,GAAG,UAAU,IAAI,GAAG,EAAE,CAAA;AAEpF,0EAA0E;AAC1E,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAW,EAAE,CAC3C,wDAAwD,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAEvE,yCAAyC;AACzC,MAAM,OAAO,GAAG,CAAC,OAAqB,EAAU,EAAE,CAAC,OAAO,CAAC,KAAK,IAAI,OAAO,CAAA;AAE3E;;;;;;GAMG;AACH,KAAK,UAAU,KAAK,CAClB,IAAuB,EACvB,OAAqB;IAErB,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC,CAAA;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,K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f(version: string, moving?: boolean): Releas
24
24
  * @returns The tags, as `['1.4.2', '1.4', '1']`.
25
25
  */
26
26
  export declare function tagsOfRelease(version: string, moving?: boolean): string[];
27
+ /**
28
+ * The tags of a release that its caller gives, as of a version that is no semver, checked: each a
29
+ * tag the OCI distribution spec takes, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none twice, and the tag
30
+ * of the version not among those that move.
31
+ *
32
+ * ```ts
33
+ * import { checkReleaseTags } from '@wtf/release-oci/tags'
34
+ *
35
+ * export const tags = checkReleaseTags({ version: '12.12-wtf.1', moving: ['12.12', 'latest'] })
36
+ * ```
37
+ *
38
+ * @param tags - The tag of the version, and those that move.
39
+ * @returns The same tags.
40
+ * @throws `TypeError` of a tag the spec does not take, or of a tag given twice.
41
+ */
42
+ export declare function checkReleaseTags(tags: ReleaseTags): ReleaseTags;
27
43
  //# sourceMappingURL=tags.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAiBA,8FAA8F;AAC9F,MAAM,WAAW,WAAW;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,gGAAgG;IAChG,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,WAAW,CASzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,MAAM,EAAE,CAGtE"}
1
+ {"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAkBA,8FAA8F;AAC9F,MAAM,WAAW,WAAW;IAC1B,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,gGAAgG;IAChG,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;CACnC;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,WAAW,CASzE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAO,GAAG,MAAM,EAAE,CAGtE;AAKD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAa/D"}
package/dist/tags.js CHANGED
@@ -2,7 +2,8 @@
2
2
  * The tags of a release of an image ({@link tagsOfRelease}): its version, and of a release, the
3
3
  * minor and the major that move with each release of them, as `1.4` and `1` of `1.4.2`, which a
4
4
  * consumer pins to take each fix of its line. A prerelease, as `2.0.0-next.1`, has its own tag
5
- * alone, so no moving tag points at a version that is not released.
5
+ * alone, so no moving tag points at a version that is not released. A release of a version that is
6
+ * no semver, as `12.12-wtf.1`, gives its own tags, which {@link checkReleaseTags} checks.
6
7
  *
7
8
  * ```ts
8
9
  * import { tagsOfRelease } from '@wtf/release-oci/tags'
@@ -47,4 +48,31 @@ export function tagsOfRelease(version, moving = true) {
47
48
  const tags = releaseTagsOf(version, moving);
48
49
  return [tags.version, ...tags.moving];
49
50
  }
51
+ /** A tag of an image, as the OCI distribution spec takes it: at most 128 characters. */
52
+ const TAG = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}$/;
53
+ /**
54
+ * The tags of a release that its caller gives, as of a version that is no semver, checked: each a
55
+ * tag the OCI distribution spec takes, `[A-Za-z0-9_][A-Za-z0-9_.-]{0,127}`, none twice, and the tag
56
+ * of the version not among those that move.
57
+ *
58
+ * ```ts
59
+ * import { checkReleaseTags } from '@wtf/release-oci/tags'
60
+ *
61
+ * export const tags = checkReleaseTags({ version: '12.12-wtf.1', moving: ['12.12', 'latest'] })
62
+ * ```
63
+ *
64
+ * @param tags - The tag of the version, and those that move.
65
+ * @returns The same tags.
66
+ * @throws `TypeError` of a tag the spec does not take, or of a tag given twice.
67
+ */
68
+ export function checkReleaseTags(tags) {
69
+ const all = [tags.version, ...tags.moving];
70
+ const invalid = all.filter((tag) => !TAG.test(tag));
71
+ if (invalid.length > 0)
72
+ throw new TypeError(`${invalid.map((tag) => JSON.stringify(tag)).join(', ')} is no tag of an image: a tag is [A-Za-z0-9_][A-Za-z0-9_.-]{0,127}.`);
73
+ const twice = all.filter((tag, index) => all.indexOf(tag) !== index);
74
+ if (twice.length > 0)
75
+ throw new TypeError(`The tags of the release name ${[...new Set(twice)].join(', ')} twice: the tag of the version moves never, and each other tag once.`);
76
+ return tags;
77
+ }
50
78
  //# sourceMappingURL=tags.js.map
package/dist/tags.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"tags.js","sourceRoot":"","sources":["../src/tags.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,MAAM,MAAM,QAAQ,CAAA;AAU3B;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,MAAM,GAAG,IAAI;IAC1D,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACpC,IAAI,MAAM,KAAK,IAAI;QAAE,MAAM,IAAI,SAAS,CAAC,GAAG,OAAO,wBAAwB,CAAC,CAAA;IAC5E,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,CAAA;IAC3F,MAAM,KAAK,GAAG,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,KAAK,EAAE,CAAA;IAC/C,OAAO;QACL,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,MAAM,EAAE,MAAM,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,C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I;IAC1D,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC3C,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;AACvC,CAAC;AAED,wFAAwF;AACxF,MAAM,GAAG,GAAG,qCAAqC,CAAA;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAiB;IAChD,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAA;IAC1C,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IACnD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QACpB,MAAM,IAAI,SAAS,CACjB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,qEAAqE,CAC7H,CAAA;IACH,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAA;IACpE,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QAClB,MAAM,IAAI,SAAS,CACjB,gCAAgC,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,sEAAsE,CACrI,CAAA;IACH,OAAO,IAAI,CAAA;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wtf/release-oci",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "The OCI images of a repo released in trains and tagged in their registry, of no release tool and no rebuild, each function by the System it is given: the ecosystem of OCI images, as the trains read it, its default export (., ./ecosystem), the images of a repo, each folder of a Dockerfile, a Containerfile or a .devcontainer/devcontainer.json git tracks, of the working tree or of a commit (./images), the tags of a release, its version and of a release the moving minor and major (./tags), the tested image of each found by its digest and copied to the tags of the release by crane, a full version the registry has at another digest refused (./publish), the page of each image in the container registry of GitLab (./registry), and OciError, the class of its errors, with their codes (./errors).",
5
5
  "keywords": [
6
6
  "container",