@eik/common 4.0.9 → 4.1.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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [4.1.0](https://github.com/eik-lib/common/compare/v4.0.9...v4.1.0) (2024-08-14)
2
+
3
+
4
+ ### Features
5
+
6
+ * add support for Eik image type ([75a5830](https://github.com/eik-lib/common/commit/75a5830df7bf59f7ef627b8d143cda5c0bbbba1b))
7
+
1
8
  ## [4.0.9](https://github.com/eik-lib/common/compare/v4.0.8...v4.0.9) (2024-08-13)
2
9
 
3
10
 
package/eikjson.d.ts CHANGED
@@ -20,9 +20,9 @@ export interface EikjsonSchema {
20
20
  */
21
21
  version: string;
22
22
  /**
23
- * The type of the Eik package. Must be one of 'package', 'npm' or 'map'. Setting this value changes the URL publish namespace between '/pkg' (default), '/npm' and '/map', use 'npm' when publishing NPM packages. Use 'map' when publishing import maps.
23
+ * The type of the Eik package. Must be one of 'package', 'npm', 'map' or 'image'. Setting this value changes the URL publish namespace between '/pkg' (default), '/npm', '/map' and '/img', use 'npm' when publishing NPM packages. Use 'image' when publishing images. Use 'map' when publishing import maps.
24
24
  */
25
- type?: "package" | "npm" | "map";
25
+ type?: "package" | "npm" | "map" | "image";
26
26
  /**
27
27
  * File mapping definition for the package. Keys represent files or paths to be created on the Eik Server. Values represent paths to local files to be published.
28
28
  */
@@ -6,5 +6,6 @@
6
6
  */
7
7
  export default (type) => {
8
8
  if (type === 'package') return 'pkg';
9
+ if (type === 'image') return 'img';
9
10
  return type;
10
11
  };
@@ -6,5 +6,6 @@
6
6
  export default (type) => {
7
7
  if (type === 'package') return 'PACKAGE';
8
8
  if (type === 'npm') return 'NPM';
9
+ if (type === 'image') return 'IMAGE';
9
10
  return 'MAP';
10
11
  };
@@ -32,7 +32,7 @@ const assert = (validate, message) => (value) => {
32
32
  .map((err) => {
33
33
  let msg = err.message;
34
34
  if (err.params && err.params.allowedValues) {
35
- msg += ` ("${err.params.allowedValues.join('", ')}")`;
35
+ msg += ` ("${err.params.allowedValues.join('", "')}")`;
36
36
  }
37
37
  return msg;
38
38
  })
@@ -24,9 +24,9 @@
24
24
  "minLength": 1
25
25
  },
26
26
  "type": {
27
- "description": "The type of the Eik package. Must be one of 'package', 'npm' or 'map'. Setting this value changes the URL publish namespace between '/pkg' (default), '/npm' and '/map', use 'npm' when publishing NPM packages. Use 'map' when publishing import maps.",
27
+ "description": "The type of the Eik package. Must be one of 'package', 'npm', 'map' or 'image'. Setting this value changes the URL publish namespace between '/pkg' (default), '/npm', '/map' and '/img', use 'npm' when publishing NPM packages. Use 'image' when publishing images. Use 'map' when publishing import maps.",
28
28
  "type": "string",
29
- "enum": ["package", "npm", "map"],
29
+ "enum": ["package", "npm", "map", "image"],
30
30
  "default": "package"
31
31
  },
32
32
  "files": {
@@ -77,7 +77,12 @@ export const alias = (value) => {
77
77
  * @throws {Error} if the value is not a valid Eik package type
78
78
  */
79
79
  export const type = (value) => {
80
- if (value === 'pkg' || value === 'map' || value === 'npm') {
80
+ if (
81
+ value === 'pkg' ||
82
+ value === 'map' ||
83
+ value === 'npm' ||
84
+ value === 'img'
85
+ ) {
81
86
  return value;
82
87
  }
83
88
  throw new Error(`Parameter "type" is not valid - Value: ${value}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eik/common",
3
- "version": "4.0.9",
3
+ "version": "4.1.0",
4
4
  "description": "Common utilities for Eik modules",
5
5
  "main": "lib/index.js",
6
6
  "types": "types/index.d.ts",
@@ -17,7 +17,7 @@ export default class EikConfig {
17
17
  /** @type {EikjsonSchema["version"]} */
18
18
  get version(): string;
19
19
  /** @type {EikjsonSchema["type"]} */
20
- get type(): "map" | "npm" | "package";
20
+ get type(): "map" | "npm" | "package" | "image";
21
21
  /** @type {string} */
22
22
  get server(): string;
23
23
  /** @type {[string, string][]} */
@@ -1,2 +1,2 @@
1
- declare function _default(type: string): "PACKAGE" | "NPM" | "MAP";
1
+ declare function _default(type: string): "PACKAGE" | "NPM" | "MAP" | "IMAGE";
2
2
  export default _default;