@containerbase/base 14.51.1 → 14.52.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.
@@ -1,8 +1,8 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { createRequire } from 'node:module';
3
- // semver has no exports map, native ESM needs the file extension
4
3
  import semverGte from 'semver/functions/gte.js';
5
4
  import semverParse from 'semver/functions/parse.js';
5
+ import { isReleaseVersion } from "./release-version.js";
6
6
  /**
7
7
  * Where the containerbase image embeds the tool-versions data: the extracted
8
8
  * release archive, with the root `index.json` and one folder per format, eg.
@@ -43,14 +43,6 @@ export function isCompatibleVersion(imageVersion, version = packageVersion) {
43
43
  const pkg = semverParse(version);
44
44
  return !!image && !!pkg && image.major === pkg.major && semverGte(image, pkg);
45
45
  }
46
- /**
47
- * Checks if an image version comes from a release. Development builds write
48
- * the git sha or `0.0.0-PLACEHOLDER` instead.
49
- */
50
- function isReleaseVersion(imageVersion) {
51
- const image = semverParse(imageVersion);
52
- return (!!image && !(image.major === 0 && image.minor === 0 && image.patch === 0));
53
- }
54
46
  /**
55
47
  * Reads the version of the containerbase image and throws when it isn't
56
48
  * compatible with this package, see `isCompatibleVersion`. Call it only when
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Checks if an image version comes from a release. Development builds write
3
+ * `0.0.0-PLACEHOLDER`, CI builds add the git sha as build metadata.
4
+ */
5
+ export declare function isReleaseVersion(imageVersion: string): boolean;
@@ -0,0 +1,9 @@
1
+ import semverParse from 'semver/functions/parse.js';
2
+ /**
3
+ * Checks if an image version comes from a release. Development builds write
4
+ * `0.0.0-PLACEHOLDER`, CI builds add the git sha as build metadata.
5
+ */
6
+ export function isReleaseVersion(imageVersion) {
7
+ const image = semverParse(imageVersion);
8
+ return (!!image && !(image.major === 0 && image.minor === 0 && image.patch === 0));
9
+ }
@@ -46,6 +46,10 @@ export declare const ToolVersions: z.ZodObject<{
46
46
  homepage: z.ZodExactOptional<z.ZodURL>;
47
47
  minVersion: z.ZodExactOptional<z.ZodString>;
48
48
  distroMinVersion: z.ZodExactOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
49
+ minCb: z.ZodExactOptional<z.ZodArray<z.ZodObject<{
50
+ version: z.ZodString;
51
+ cb: z.ZodString;
52
+ }, z.core.$strip>>>;
49
53
  updatedAt: z.ZodISODateTime;
50
54
  versions: z.ZodArray<z.ZodObject<{
51
55
  version: z.ZodString;
@@ -93,6 +93,21 @@ export const ToolVersions = z.object({
93
93
  distroMinVersion: z
94
94
  .record(z.string().min(1), z.string().min(1))
95
95
  .exactOptional(),
96
+ /**
97
+ * the oldest containerbase version, like `14.51.0`, which can install a
98
+ * version. A range applies to its `version` and every version above it in
99
+ * `versions`. Omitted for tools without a limit. Lenient, so a slip of the
100
+ * writer doesn't reject the file: a `cb` which isn't valid semver is never
101
+ * met by a reader.
102
+ */
103
+ minCb: z
104
+ .array(z.object({
105
+ /** the version where the range starts, a version of `versions` */
106
+ version: z.string().min(1),
107
+ /** the oldest containerbase version, in semver */
108
+ cb: z.string(),
109
+ }))
110
+ .exactOptional(),
96
111
  updatedAt: z.iso.datetime(),
97
112
  /** newest first */
98
113
  versions: z.array(ToolVersion),
@@ -97,6 +97,23 @@ export interface ToolVersions {
97
97
  * don't break readers.
98
98
  */
99
99
  distroMinVersion?: Record<string, string>;
100
+ /**
101
+ * The oldest containerbase version, like `14.51.0`, which can install a
102
+ * version. A range applies to its `version` and every version above it in
103
+ * `versions`. Omitted for tools without a limit. Lenient, so a slip of the
104
+ * writer doesn't reject the file: a `cb` which isn't valid semver is never
105
+ * met by a reader.
106
+ */
107
+ minCb?: {
108
+ /**
109
+ * The version where the range starts, a version of `versions`.
110
+ */
111
+ version: string;
112
+ /**
113
+ * The oldest containerbase version, in semver.
114
+ */
115
+ cb: string;
116
+ }[];
100
117
  updatedAt: string;
101
118
  /**
102
119
  * Newest first.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@containerbase/base",
3
- "version": "14.51.1",
3
+ "version": "14.52.0",
4
4
  "description": "Metadata about the tools supported by containerbase",
5
5
  "keywords": [
6
6
  "containerbase",