fix(ci): restore custom widget checks

This commit is contained in:
Thomas Camlong committed 2026-07-18 17:14:10 +02:00
1 parent eae48f50fd
commit a31a8fd4dd
5 files changed
+65 -111

No files matched your search

+12
View File
@@ -312,6 +312,18 @@ jobs:
"${PREVIEW_IMAGE}@${AMD64_DIGEST}" \ "${PREVIEW_IMAGE}@${AMD64_DIGEST}" \
"${PREVIEW_IMAGE}@${ARM64_DIGEST}" "${PREVIEW_IMAGE}@${ARM64_DIGEST}"
- name: Verify preview manifest platforms
if: "!env.ACT"
run: |
image="${PREVIEW_IMAGE}:${PREVIEW_TAG}"
manifest="$(docker buildx imagetools inspect "$image" --raw)"
for architecture in amd64 arm64; do
jq --exit-status --arg architecture "$architecture" \
'any(.manifests[]; .platform.os == "linux" and .platform.architecture == $architecture)' \
<<<"$manifest" >/dev/null
done
docker buildx imagetools inspect "$image"
cleanup: cleanup:
name: Clean up preview image name: Clean up preview image
if: github.event_name == 'pull_request_target' || (github.event_name == 'workflow_dispatch' && inputs.operation == 'cleanup') if: github.event_name == 'pull_request_target' || (github.event_name == 'workflow_dispatch' && inputs.operation == 'cleanup')
@@ -105,7 +105,7 @@ External redis is currently not supported with Proxmox Community Scripts
The advanced deployments environment variables should only be used if you know what you are doing. The advanced deployments environment variables should only be used if you know what you are doing.
::: :::
| Environment Variable | Description | | Environment Variable | Description |
| ------------------------ | -------------------------------------------------- | | ------------------------------ | --------------------------------------------------------------------------------------------------------------- |
| `DB_MIGRATIONS_DISABLED` | Disable db migrations. For example for helm charts | | `DB_MIGRATIONS_DISABLED` | Disable db migrations. For example for helm charts |
| `NEXT_PUBLIC_WORKSHOP_API_URL` | Build-time public origin for a separately hosted Workshop PocketBase service. Defaults to `https://homarr.dev`. | | `NEXT_PUBLIC_WORKSHOP_API_URL` | Build-time public origin for a separately hosted Workshop PocketBase service. Defaults to `https://homarr.dev`. |
+1 -2
View File
@@ -6,13 +6,12 @@ ENV COREPACK_HOME=/corepack
RUN mkdir -p /corepack && corepack enable pnpm && corepack install --global pnpm@11.11.0 RUN mkdir -p /corepack && corepack enable pnpm && corepack install --global pnpm@11.11.0
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json turbo.json ./ COPY pnpm-lock.yaml pnpm-workspace.yaml package.json turbo.json ./
COPY patches ./patches COPY patches ./patches
RUN --mount=type=cache,id=workshop-pnpm-store,target=/pnpm/store pnpm config set store-dir /pnpm/store && pnpm fetch --ignore-scripts
COPY apps/docs ./apps/docs COPY apps/docs ./apps/docs
COPY packages/custom-widgets ./packages/custom-widgets COPY packages/custom-widgets ./packages/custom-widgets
COPY packages/definitions ./packages/definitions COPY packages/definitions ./packages/definitions
COPY packages/workshop ./packages/workshop COPY packages/workshop ./packages/workshop
COPY tooling/typescript ./tooling/typescript COPY tooling/typescript ./tooling/typescript
RUN --mount=type=cache,id=workshop-pnpm-store,target=/pnpm/store pnpm install --recursive --offline --frozen-lockfile RUN --mount=type=cache,id=workshop-pnpm-store,target=/pnpm/store pnpm config set store-dir /pnpm/store && pnpm install --filter @homarr/docs... --frozen-lockfile
FROM dependencies AS website FROM dependencies AS website
RUN CI=true SKIP_ENV_VALIDATION=true pnpm turbo build --filter=@homarr/docs RUN CI=true SKIP_ENV_VALIDATION=true pnpm turbo build --filter=@homarr/docs
@@ -6862,16 +6862,8 @@
"width", "width",
"wrapperProps" "wrapperProps"
], ],
"Chip.Group": [ "Chip.Group": ["defaultValue", "multiple", "value"],
"defaultValue", "ChipGroup": ["defaultValue", "multiple", "value"],
"multiple",
"value"
],
"ChipGroup": [
"defaultValue",
"multiple",
"value"
],
"CloseButton": [ "CloseButton": [
"attributes", "attributes",
"bd", "bd",
@@ -8171,10 +8163,7 @@
"vocab", "vocab",
"w" "w"
], ],
"CopyButton": [ "CopyButton": ["timeout", "value"],
"timeout",
"value"
],
"DataList": [ "DataList": [
"about", "about",
"accessKey", "accessKey",
@@ -12187,10 +12176,7 @@
"withOverlay", "withOverlay",
"withRoles" "withRoles"
], ],
"HoverCard.Target": [ "HoverCard.Target": ["eventPropsWrapperName", "popupType"],
"eventPropsWrapperName",
"popupType"
],
"HoverCard.Dropdown": [ "HoverCard.Dropdown": [
"about", "about",
"accessKey", "accessKey",
@@ -12346,10 +12332,7 @@
"vocab", "vocab",
"w" "w"
], ],
"HoverCard.Group": [ "HoverCard.Group": ["closeDelay", "openDelay"],
"closeDelay",
"openDelay"
],
"HoverCardDropdown": [ "HoverCardDropdown": [
"about", "about",
"accessKey", "accessKey",
@@ -12505,14 +12488,8 @@
"vocab", "vocab",
"w" "w"
], ],
"HoverCardGroup": [ "HoverCardGroup": ["closeDelay", "openDelay"],
"closeDelay", "HoverCardTarget": ["eventPropsWrapperName", "popupType"],
"openDelay"
],
"HoverCardTarget": [
"eventPropsWrapperName",
"popupType"
],
"HueSlider": [ "HueSlider": [
"about", "about",
"accessKey", "accessKey",
@@ -15762,10 +15739,7 @@
"vocab", "vocab",
"w" "w"
], ],
"Menu.CheckboxGroup": [ "Menu.CheckboxGroup": ["defaultValue", "value"],
"defaultValue",
"value"
],
"Menu.RadioItem": [ "Menu.RadioItem": [
"about", "about",
"accessKey", "accessKey",
@@ -15930,18 +15904,9 @@
"vocab", "vocab",
"w" "w"
], ],
"Menu.RadioGroup": [ "Menu.RadioGroup": ["defaultValue", "value"],
"defaultValue", "Menu.ContextMenu": ["disabled", "longPressDelay"],
"value" "MenuCheckboxGroup": ["defaultValue", "value"],
],
"Menu.ContextMenu": [
"disabled",
"longPressDelay"
],
"MenuCheckboxGroup": [
"defaultValue",
"value"
],
"MenuCheckboxItem": [ "MenuCheckboxItem": [
"about", "about",
"accessKey", "accessKey",
@@ -16106,10 +16071,7 @@
"vocab", "vocab",
"w" "w"
], ],
"MenuContextMenu": [ "MenuContextMenu": ["disabled", "longPressDelay"],
"disabled",
"longPressDelay"
],
"MenuDivider": [ "MenuDivider": [
"about", "about",
"accessKey", "accessKey",
@@ -16638,10 +16600,7 @@
"vocab", "vocab",
"w" "w"
], ],
"MenuRadioGroup": [ "MenuRadioGroup": ["defaultValue", "value"],
"defaultValue",
"value"
],
"MenuRadioItem": [ "MenuRadioItem": [
"about", "about",
"accessKey", "accessKey",
@@ -21530,10 +21489,7 @@
"withOverlay", "withOverlay",
"withRoles" "withRoles"
], ],
"Popover.Target": [ "Popover.Target": ["key", "popupType"],
"key",
"popupType"
],
"Popover.Dropdown": [ "Popover.Dropdown": [
"about", "about",
"accessKey", "accessKey",
@@ -21689,14 +21645,8 @@
"vocab", "vocab",
"w" "w"
], ],
"Popover.ContextMenu": [ "Popover.ContextMenu": ["disabled", "longPressDelay"],
"disabled", "PopoverContextMenu": ["disabled", "longPressDelay"],
"longPressDelay"
],
"PopoverContextMenu": [
"disabled",
"longPressDelay"
],
"PopoverDropdown": [ "PopoverDropdown": [
"about", "about",
"accessKey", "accessKey",
@@ -21852,10 +21802,7 @@
"vocab", "vocab",
"w" "w"
], ],
"PopoverTarget": [ "PopoverTarget": ["key", "popupType"],
"key",
"popupType"
],
"Progress": [ "Progress": [
"about", "about",
"accessKey", "accessKey",
@@ -30320,9 +30267,7 @@
"vocab", "vocab",
"w" "w"
], ],
"Table.DataRenderer": [ "Table.DataRenderer": ["data"],
"data"
],
"TableCaption": [ "TableCaption": [
"about", "about",
"accessKey", "accessKey",
@@ -34705,10 +34650,7 @@
"vocab", "vocab",
"w" "w"
], ],
"Tooltip.Group": [ "Tooltip.Group": ["closeDelay", "openDelay"],
"closeDelay",
"openDelay"
],
"TooltipFloating": [ "TooltipFloating": [
"about", "about",
"accessKey", "accessKey",
@@ -34872,10 +34814,7 @@
"vocab", "vocab",
"w" "w"
], ],
"TooltipGroup": [ "TooltipGroup": ["closeDelay", "openDelay"],
"closeDelay",
"openDelay"
],
"Tree": [ "Tree": [
"about", "about",
"accessKey", "accessKey",
@@ -39832,12 +39771,7 @@
"withSuccessStyles", "withSuccessStyles",
"wrapperProps" "wrapperProps"
], ],
"TimeValue": [ "TimeValue": ["amPmLabels", "format", "value", "withSeconds"],
"amPmLabels",
"format",
"value",
"withSeconds"
],
"WeekdaysRow": [ "WeekdaysRow": [
"about", "about",
"accessKey", "accessKey",
+28 -19
View File
@@ -6,37 +6,46 @@ import { createLanguageMapping } from "@homarr/translation";
import { widgetImports } from ".."; import { widgetImports } from "..";
const doesOptionRenderTranslatedCopy = (option: unknown) => {
if (typeof option !== "object" || option === null || !("type" in option)) return false;
return option.type !== "internal" && option.type !== "customWidgetConfiguration";
};
describe("Widget properties with description should have matching translations", async () => { describe("Widget properties with description should have matching translations", async () => {
const enTranslation = await createLanguageMapping().en(); const enTranslation = await createLanguageMapping().en();
objectEntries(widgetImports).forEach(([key, value]) => { objectEntries(widgetImports).forEach(([key, value]) => {
Object.entries(value.definition.createOptions({} as SettingsContextProps)).forEach(([optionKey, optionValue_]) => { Object.entries(value.definition.createOptions({} as SettingsContextProps))
const optionValue = optionValue_ as { withDescription: boolean }; .filter(([, option]) => doesOptionRenderTranslatedCopy(option))
it(`should have matching translations for ${optionKey} option description of ${key} widget`, () => { .forEach(([optionKey, optionValue_]) => {
const option = enTranslation.default.widget[key].option; const optionValue = optionValue_ as { withDescription: boolean };
if (!(optionKey in option)) { it(`should have matching translations for ${optionKey} option description of ${key} widget`, () => {
throw new Error(`Option ${optionKey} not found in translation`); const option = enTranslation.default.widget[key].option;
} if (!(optionKey in option)) {
const value = option[optionKey as keyof typeof option]; throw new Error(`Option ${optionKey} not found in translation`);
}
const value = option[optionKey as keyof typeof option];
expect("description" in value).toBe(optionValue.withDescription); expect("description" in value).toBe(optionValue.withDescription);
});
}); });
});
}); });
}); });
describe("Widget properties should have matching name translations", async () => { describe("Widget properties should have matching name translations", async () => {
const enTranslation = await createLanguageMapping().en(); const enTranslation = await createLanguageMapping().en();
objectEntries(widgetImports).forEach(([key, value]) => { objectEntries(widgetImports).forEach(([key, value]) => {
Object.keys(value.definition.createOptions({} as SettingsContextProps)).forEach((optionKey) => { Object.entries(value.definition.createOptions({} as SettingsContextProps))
it(`should have matching translations for ${optionKey} option name of ${key} widget`, () => { .filter(([, option]) => doesOptionRenderTranslatedCopy(option))
const option = enTranslation.default.widget[key].option; .forEach(([optionKey]) => {
if (!(optionKey in option)) { it(`should have matching translations for ${optionKey} option name of ${key} widget`, () => {
throw new Error(`Option ${optionKey} not found in translation`); const option = enTranslation.default.widget[key].option;
} if (!(optionKey in option)) {
const value = option[optionKey as keyof typeof option]; throw new Error(`Option ${optionKey} not found in translation`);
}
const value = option[optionKey as keyof typeof option];
expect("label" in value).toBe(true); expect("label" in value).toBe(true);
});
}); });
});
}); });
}); });