Skip to content

Commit

Permalink
feat(customization): initial feature for custom component versioning #…
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-capsule42 committed Jan 13, 2023
1 parent 317c198 commit 5810f7d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
4 changes: 1 addition & 3 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@
Prism.highlightAll();
});
</script>
<script type="module" src="../src/auro-hyperlink.js"></script>
<script type="module" src="../src/define.js"></script>
<script type="module" src="../src/defineCustom.js"></script>
<script type="module" src="./../src/define.js"></script>

<!-- If additional elements are needed for the demo, add them here. -->
<script src="https://unpkg.com/@alaskaairux/auro-accordion@latest/dist/auro-accordion__bundled.js" type="module"></script>
Expand Down
9 changes: 7 additions & 2 deletions src/define.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { AuroHyperlink } from './auro-hyperlink.js';

if (!customElements.get("auro-hyperlink")) {
customElements.define("auro-hyperlink", AuroHyperlink);
export function registerComponent(name = 'custom-hyperlink') {
// alias definition
if (!customElements.get(name)) {
customElements.define(name, class extends AuroHyperlink {});
}
}

registerComponent('auro-hyperlink');
9 changes: 0 additions & 9 deletions src/defineCustom.js

This file was deleted.

3 changes: 1 addition & 2 deletions test/auro-hyperlink.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { fixture, html, expect } from '@open-wc/testing';
import '../src/auro-hyperlink.js';
import '../src/define.js';
import './../src/define.js';

describe('auro-hyperlink', () => {

Expand Down

0 comments on commit 5810f7d

Please sign in to comment.