@trackunit/iris-app-build-utilities 2.0.44 → 2.0.47
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,21 @@
|
|
|
1
|
+
## 2.0.47 (2026-07-01)
|
|
2
|
+
|
|
3
|
+
### 🧱 Updated Dependencies
|
|
4
|
+
|
|
5
|
+
- Updated iris-app-api to 2.0.44
|
|
6
|
+
- Updated shared-utils to 1.15.52
|
|
7
|
+
|
|
8
|
+
## 2.0.46 (2026-07-01)
|
|
9
|
+
|
|
10
|
+
### 🧱 Updated Dependencies
|
|
11
|
+
|
|
12
|
+
- Updated iris-app-api to 2.0.43
|
|
13
|
+
- Updated shared-utils to 1.15.51
|
|
14
|
+
|
|
15
|
+
## 2.0.45 (2026-07-01)
|
|
16
|
+
|
|
17
|
+
This was a version bump only for iris-app-build-utilities to align it with other projects, there were no code changes.
|
|
18
|
+
|
|
1
19
|
## 2.0.44 (2026-06-30)
|
|
2
20
|
|
|
3
21
|
### 🧱 Updated Dependencies
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/iris-app-build-utilities",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.47",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"repository": "https://github.com/Trackunit/manager",
|
|
6
6
|
"engines": {
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"tslib": "^2.6.2",
|
|
16
16
|
"csp-header": "^6.3.1",
|
|
17
17
|
"@rspack/core": "1.6.7",
|
|
18
|
-
"@trackunit/iris-app-api": "2.0.
|
|
18
|
+
"@trackunit/iris-app-api": "2.0.44",
|
|
19
19
|
"@nx/devkit": "22.7.5",
|
|
20
|
-
"@trackunit/shared-utils": "1.15.
|
|
20
|
+
"@trackunit/shared-utils": "1.15.52",
|
|
21
21
|
"http-proxy-middleware": "3.0.5",
|
|
22
22
|
"marked": "14.1.2",
|
|
23
23
|
"pacote": "^21.0.4",
|
|
@@ -42,7 +42,7 @@ const getLatestRemoteVersion = async (pkg, throwError = true) => {
|
|
|
42
42
|
const manifest = await pacote.manifest(pkg);
|
|
43
43
|
return manifest.version;
|
|
44
44
|
}
|
|
45
|
-
catch
|
|
45
|
+
catch {
|
|
46
46
|
if (throwError) {
|
|
47
47
|
throw new Error(`Error fetching manifest for package ${pkg}. This package might need to be published, or it has been included as a dependency by mistake.`);
|
|
48
48
|
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.updateConditions = exports.updateExtensions = void 0;
|
|
4
4
|
const iris_app_api_1 = require("@trackunit/iris-app-api");
|
|
5
|
+
const consoleUtils_1 = require("./consoleUtils");
|
|
5
6
|
const irisAppTranslationUtils_1 = require("./irisAppTranslationUtils");
|
|
7
|
+
const validateMenuIcon_1 = require("./validateMenuIcon");
|
|
6
8
|
const fixUrl = (image, extensionId) => {
|
|
7
9
|
if ((0, iris_app_api_1.isIconByPath)(image) || (0, iris_app_api_1.isImageByPath)(image)) {
|
|
8
10
|
if (image.path.toString().startsWith("/")) {
|
|
@@ -53,6 +55,13 @@ const updateExtensions = (extensions) => {
|
|
|
53
55
|
(0, exports.updateConditions)(extension);
|
|
54
56
|
}
|
|
55
57
|
if (extension.type === "FLEET_EXTENSION") {
|
|
58
|
+
const iconValidation = (0, validateMenuIcon_1.validateMenuIcon)(extension.menuItem, extension.id);
|
|
59
|
+
if (iconValidation.status === "warning") {
|
|
60
|
+
(0, consoleUtils_1.logWarning)(iconValidation.message);
|
|
61
|
+
}
|
|
62
|
+
else if (iconValidation.status === "error") {
|
|
63
|
+
throw new Error(iconValidation.message);
|
|
64
|
+
}
|
|
56
65
|
if ((0, iris_app_api_1.isIconByPath)(extension.menuItem.image) && !extension.menuItem.image.path.startsWith(extension.id)) {
|
|
57
66
|
fixUrl(extension.menuItem.image, extension.id);
|
|
58
67
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { IconByName, IconByPath } from "@trackunit/iris-app-api";
|
|
2
|
+
export type MenuIconValidation = {
|
|
3
|
+
status: "ok";
|
|
4
|
+
} | {
|
|
5
|
+
status: "warning";
|
|
6
|
+
message: string;
|
|
7
|
+
} | {
|
|
8
|
+
status: "error";
|
|
9
|
+
message: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Validates a fleet extension's menu icon configuration without side effects.
|
|
13
|
+
*
|
|
14
|
+
* Priority order:
|
|
15
|
+
* 1. `image` present (it supersedes the deprecated `icon`):
|
|
16
|
+
* - path-based image is a file reference and is not name-validated; a present
|
|
17
|
+
* `icon` is then redundant (warning).
|
|
18
|
+
* - name-based image is validated; an invalid name is an error, otherwise a
|
|
19
|
+
* present `icon` is redundant (warning).
|
|
20
|
+
* - any other (malformed) image shape, e.g. a non-`.svg` path, is an error.
|
|
21
|
+
* 2. No `image`, deprecated `icon` present (including `""`): invalid name errors,
|
|
22
|
+
* valid name warns about the deprecation.
|
|
23
|
+
* 3. Neither present: ok.
|
|
24
|
+
*
|
|
25
|
+
* @param menuItem - The fleet extension menu item (icon and/or image)
|
|
26
|
+
* @param menuItem.icon - The deprecated icon name
|
|
27
|
+
* @param menuItem.image - The image (icon name or file path)
|
|
28
|
+
* @param extensionId - The extension id, used in messages
|
|
29
|
+
* @returns {MenuIconValidation} The validation result
|
|
30
|
+
*/
|
|
31
|
+
export declare const validateMenuIcon: (menuItem: {
|
|
32
|
+
icon?: string;
|
|
33
|
+
image?: IconByName | IconByPath;
|
|
34
|
+
}, extensionId: string) => MenuIconValidation;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateMenuIcon = void 0;
|
|
4
|
+
const iris_app_api_1 = require("@trackunit/iris-app-api");
|
|
5
|
+
/**
|
|
6
|
+
* Exact-match check of an icon name against the supported icon names from
|
|
7
|
+
* `@trackunit/iris-app-api`. There is intentionally no fuzzy matching or
|
|
8
|
+
* "...Icon" suffix stripping: names must match exactly.
|
|
9
|
+
*/
|
|
10
|
+
const isValidIconName = (name) => Object.prototype.hasOwnProperty.call(iris_app_api_1.iconNames, name);
|
|
11
|
+
const redundantIconWarning = (extensionId) => `Fleet extension "${extensionId}": menuItem.icon is redundant because menuItem.image takes precedence. ` +
|
|
12
|
+
`Remove the deprecated menuItem.icon.`;
|
|
13
|
+
const invalidImageNameError = (name, extensionId) => `Fleet extension "${extensionId}": menuItem.image name "${name}" is not a valid icon name. ` +
|
|
14
|
+
`Use one of the supported icon names exported as iconNames from @trackunit/iris-app-api (names must match exactly).`;
|
|
15
|
+
const invalidIconError = (icon, extensionId) => `Fleet extension "${extensionId}": deprecated menuItem.icon "${icon}" is not a valid icon name. ` +
|
|
16
|
+
`Migrate to menuItem.image: { name: "<icon name>" } using a supported icon name from @trackunit/iris-app-api ` +
|
|
17
|
+
`(names must match exactly).`;
|
|
18
|
+
const invalidImageError = (extensionId) => `Fleet extension "${extensionId}": menuItem.image is not a valid icon. ` +
|
|
19
|
+
`Provide { name: "<icon name>" } using a supported icon name from @trackunit/iris-app-api, ` +
|
|
20
|
+
`or { path: "<file>.svg" } pointing to an SVG asset.`;
|
|
21
|
+
const deprecatedIconWarning = (icon, extensionId) => `Fleet extension "${extensionId}": menuItem.icon is deprecated. ` +
|
|
22
|
+
`Migrate menuItem.icon "${icon}" to menuItem.image: { name: "${icon}" }.`;
|
|
23
|
+
/**
|
|
24
|
+
* Validates a fleet extension's menu icon configuration without side effects.
|
|
25
|
+
*
|
|
26
|
+
* Priority order:
|
|
27
|
+
* 1. `image` present (it supersedes the deprecated `icon`):
|
|
28
|
+
* - path-based image is a file reference and is not name-validated; a present
|
|
29
|
+
* `icon` is then redundant (warning).
|
|
30
|
+
* - name-based image is validated; an invalid name is an error, otherwise a
|
|
31
|
+
* present `icon` is redundant (warning).
|
|
32
|
+
* - any other (malformed) image shape, e.g. a non-`.svg` path, is an error.
|
|
33
|
+
* 2. No `image`, deprecated `icon` present (including `""`): invalid name errors,
|
|
34
|
+
* valid name warns about the deprecation.
|
|
35
|
+
* 3. Neither present: ok.
|
|
36
|
+
*
|
|
37
|
+
* @param menuItem - The fleet extension menu item (icon and/or image)
|
|
38
|
+
* @param menuItem.icon - The deprecated icon name
|
|
39
|
+
* @param menuItem.image - The image (icon name or file path)
|
|
40
|
+
* @param extensionId - The extension id, used in messages
|
|
41
|
+
* @returns {MenuIconValidation} The validation result
|
|
42
|
+
*/
|
|
43
|
+
const validateMenuIcon = (menuItem, extensionId) => {
|
|
44
|
+
const { icon, image } = menuItem;
|
|
45
|
+
if (image !== undefined) {
|
|
46
|
+
if ((0, iris_app_api_1.isIconByPath)(image)) {
|
|
47
|
+
return icon !== undefined ? { status: "warning", message: redundantIconWarning(extensionId) } : { status: "ok" };
|
|
48
|
+
}
|
|
49
|
+
if ((0, iris_app_api_1.isIconByName)(image)) {
|
|
50
|
+
if (!isValidIconName(image.name)) {
|
|
51
|
+
return { status: "error", message: invalidImageNameError(image.name, extensionId) };
|
|
52
|
+
}
|
|
53
|
+
return icon !== undefined ? { status: "warning", message: redundantIconWarning(extensionId) } : { status: "ok" };
|
|
54
|
+
}
|
|
55
|
+
// image is present but is neither a name-based icon nor an SVG path (e.g. a
|
|
56
|
+
// non-.svg path or a malformed shape). Fail the build instead of silently
|
|
57
|
+
// rendering a broken menu image at runtime.
|
|
58
|
+
return { status: "error", message: invalidImageError(extensionId) };
|
|
59
|
+
}
|
|
60
|
+
if (icon !== undefined) {
|
|
61
|
+
if (!isValidIconName(icon)) {
|
|
62
|
+
return { status: "error", message: invalidIconError(icon, extensionId) };
|
|
63
|
+
}
|
|
64
|
+
return { status: "warning", message: deprecatedIconWarning(icon, extensionId) };
|
|
65
|
+
}
|
|
66
|
+
return { status: "ok" };
|
|
67
|
+
};
|
|
68
|
+
exports.validateMenuIcon = validateMenuIcon;
|
|
69
|
+
//# sourceMappingURL=validateMenuIcon.js.map
|