From 6e0c416db1bd36e69ba4529a83c73f6c4e62861f Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Tue, 25 Oct 2022 10:30:26 -0400 Subject: [PATCH 1/3] fix(icon): typescript errors --- elements/pfe-icon/demo/pfe-icon.js | 4 +++- elements/pfe-icon/pfe-icon.ts | 2 +- elements/pfe-icon/tsconfig.json | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/elements/pfe-icon/demo/pfe-icon.js b/elements/pfe-icon/demo/pfe-icon.js index 9197ac59a5..63189fb948 100644 --- a/elements/pfe-icon/demo/pfe-icon.js +++ b/elements/pfe-icon/demo/pfe-icon.js @@ -1,6 +1,8 @@ import '@patternfly/pfe-icon'; import '@patternfly/pfe-tooltip'; -import '@patternfly/pfe-button'; +// TS6202: Project references may not form a circular graph. +// import '@patternfly/pfe-button'; +import('@patternfly' + '/' + 'pfe-button'); import '@patternfly/pfe-autocomplete'; import { iconSets } from '@patternfly/pfe-tools/environment.js'; import { render, html } from 'lit'; diff --git a/elements/pfe-icon/pfe-icon.ts b/elements/pfe-icon/pfe-icon.ts index 5d340a8dfb..3324d011f7 100644 --- a/elements/pfe-icon/pfe-icon.ts +++ b/elements/pfe-icon/pfe-icon.ts @@ -67,7 +67,7 @@ export class PfeIcon extends LitElement { private static getters = new Map(); - private static instances = new Set(); + private static instances = new Set(); /** Icon set */ @property() set = PfeIcon.defaultIconSet; diff --git a/elements/pfe-icon/tsconfig.json b/elements/pfe-icon/tsconfig.json index 2072bf4071..3569d20e6f 100644 --- a/elements/pfe-icon/tsconfig.json +++ b/elements/pfe-icon/tsconfig.json @@ -4,7 +4,11 @@ "./**/*" ], "exclude": [ - "./icons/**/*.js" + "./icons/**/*.js", + "./demo/pfe-icon.js", + "./demo/custom-icon-sets.js", + "./test/rh-icon*.js", + "./custom-elements-manifest.config.js" ], "compilerOptions": { "module": "esnext", @@ -22,9 +26,6 @@ { "path": "../pfe-tooltip" }, - { - "path": "../pfe-button" - }, { "path": "../pfe-autocomplete" } From 699097b202b354ae9d205df8dc987a8f5aa86f08 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Tue, 25 Oct 2022 10:31:23 -0400 Subject: [PATCH 2/3] fix(label): style loading --- .changeset/breezy-steaks-melt.md | 5 +++++ elements/pfe-label/pfe-label.ts | 2 +- elements/pfe-label/test/pfe-label.spec.ts | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/breezy-steaks-melt.md diff --git a/.changeset/breezy-steaks-melt.md b/.changeset/breezy-steaks-melt.md new file mode 100644 index 0000000000..71a9fd57fb --- /dev/null +++ b/.changeset/breezy-steaks-melt.md @@ -0,0 +1,5 @@ +--- +"@patternfly/pfe-label": patch +--- + +Fix label style loading diff --git a/elements/pfe-label/pfe-label.ts b/elements/pfe-label/pfe-label.ts index 689032535d..e65009763a 100644 --- a/elements/pfe-label/pfe-label.ts +++ b/elements/pfe-label/pfe-label.ts @@ -96,7 +96,7 @@ import styles from './pfe-label.scss'; export class PfeLabel extends BaseLabel { static readonly version = '{{version}}'; - static readonly styles = [BaseLabel.styles, styles]; + static readonly styles = [...BaseLabel.styles, styles]; static readonly shadowRootOptions: ShadowRootInit = { ...BaseLabel.shadowRootOptions, delegatesFocus: true }; diff --git a/elements/pfe-label/test/pfe-label.spec.ts b/elements/pfe-label/test/pfe-label.spec.ts index 0414ee23e5..83c50cd143 100644 --- a/elements/pfe-label/test/pfe-label.spec.ts +++ b/elements/pfe-label/test/pfe-label.spec.ts @@ -39,8 +39,8 @@ describe('', function() { // replace the default built-in icon set resolveIconName function // with one that loads local icons. we don't want tests dependent on // prod servers. - PfeIcon.addIconSet('rh', '', function(name: string) { - return `/elements/pfe-icon/test/${name.replace('rh', 'rh-icon')}.svg`; + PfeIcon.addIconSet('rh', function(name: string) { + return new URL(`/elements/pfe-icon/test/${name.replace('rh', 'rh-icon')}.svg`); }); }); From e47c863227461ae492a3608e312f70ba52de2752 Mon Sep 17 00:00:00 2001 From: Benny Powers Date: Tue, 25 Oct 2022 10:31:37 -0400 Subject: [PATCH 3/3] chore: add release dry run to PR checks --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 815d8c4c6d..c6aac1d4d5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -120,6 +120,10 @@ jobs: id: build run: npm run build + - name: Release Dry Run + id: release-dry + run: npm run prepublishOnly -ws --if-present + # Upload compiled assets to make them available for downstream jobs - name: Upload artifacts uses: actions/upload-artifact@v2