Fix failing check-plugin-gates

- caused by shell/scripts/test-plugins-build.sh importing list/catalog.cattle.io.clusterrepo.vue
- the component had been updated to a TS component
- check-plugin build outputs TS errors for a component file imports
- vs code shows no errors for imported file
This commit is contained in:
Richard Cox 2024-12-18 19:37:01 +00:00
parent 7e4ee6acbc
commit 5916758b12
3 changed files with 21 additions and 5 deletions

View File

@ -96,8 +96,8 @@ export default defineComponent({
},
computed: {
safeHeaders() {
const customHeaders = this.canPaginate ? this.paginationHeaders : this.headers;
safeHeaders(): any[] {
const customHeaders: any[] = this.canPaginate ? this.paginationHeaders : this.headers;
return customHeaders || this.$store.getters['type-map/headersFor'](this.schema, this.canPaginate);
}

View File

@ -1,6 +1,9 @@
<script>
/**
* file used in shell/scripts/test-plugins-build.sh to validate imports
*/
import { mapGetters } from 'vuex';
import { NS_SNAPSHOT_QUOTA } from '../config/table-headers';
import { NS_SNAPSHOT_QUOTA } from '@shell/config/table-headers';
import ResourceTable from '@shell/components/ResourceTable';
import { HCI } from '@shell/config/types';
export default {

View File

@ -93,6 +93,19 @@ update_version_in_package_json "${SHELL_DIR}/package.json" "${SHELL_VERSION}"
update_version_in_package_json "${BASE_DIR}/pkg/rancher-components/package.json" "${SHELL_VERSION}"
update_version_in_package_json "${BASE_DIR}/creators/extension/package.json" "${SHELL_VERSION}"
createTestComponent() {
# Add test list component to the test package
# Validates rancher-components imports
# NOTE - This fails if importing some components with TS imports...
# cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue pkg/test-pkg/list
# See https://github.com/rancher/dashboard/issues/12918
# Use a basic list instead
cp ${SHELL_DIR}/list/namespace.vue pkg/test-pkg/list
}
# Publish shell pkg (tag is needed as publish-shell is optimized to work with release-shell-pkg workflow)
echo "Publishing Shell package to local registry"
yarn install
@ -133,7 +146,7 @@ if [ "${SKIP_STANDALONE}" == "false" ]; then
# Add test list component to the test package
# Validates rancher-components imports
mkdir -p pkg/test-pkg/list
cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue pkg/test-pkg/list
createTestComponent
FORCE_COLOR=true yarn build-pkg test-pkg | cat
@ -159,7 +172,7 @@ if [ "${TEST_PERSIST_BUILD}" != "true" ]; then
fi
yarn create @rancher/extension test-pkg -i
cp ${SHELL_DIR}/list/catalog.cattle.io.clusterrepo.vue ./pkg/test-pkg/list
createTestComponent
FORCE_COLOR=true yarn build-pkg test-pkg | cat
if [ "${TEST_PERSIST_BUILD}" != "true" ]; then