Skip to content

Commit

Permalink
refactor: refactor and add component registration #54
Browse files Browse the repository at this point in the history
  • Loading branch information
rmenner committed Dec 5, 2024
1 parent 6e33716 commit b46d51f
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 8 deletions.
56 changes: 54 additions & 2 deletions components/counter/demo/api.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions components/counter/demo/index.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/counter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"build": "run-s build:sass bundler types",
"build:sass": "sass --no-source-map --load-path=../../node_modules \"./src/styles/:./src/styles/\"",
"build:watch": "nodemon -e scss,js --watch src --ignore \"*.css\" --ignore \"*-css.js\" --exec \"npm run build\"",
"bundler": "rollup -c node:@auro-formkit/config/rollup --input src/index.js",
"bundler": "rollup -c node:@auro-formkit/config/rollup",
"clean": "rm -rf dist build",
"dev": "concurrently \"npm run build:watch\" \"npm run serve\"",
"postCss:component": "node ../../node_modules/@aurodesignsystem/auro-library/scripts/build/postCss.mjs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
import { html } from "lit/static-html.js";
import { LitElement } from "lit";

import styleCss from "./styles/countergroup-css.js";
import styleCss from "./styles/counter-group-css.js";

export class AuroCountergroup extends LitElement {
export class AuroCounterGroup extends LitElement {

static get styles() {
return [styleCss];
Expand Down Expand Up @@ -40,3 +40,9 @@ export class AuroCountergroup extends LitElement {
`;
}
}

/* istanbul ignore else */
// define the name of the custom component
if (!customElements.get("auro-counter-group")) {
customElements.define("auro-counter-group", AuroCounterGroup);
}
6 changes: 6 additions & 0 deletions components/counter/src/auro-counter.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,9 @@ export class AuroCounter extends LitElement {
`;
}
}

/* istanbul ignore else */
// define the name of the custom component
if (!customElements.get("auro-counter")) {
customElements.define("auro-counter", AuroCounter);
}
5 changes: 5 additions & 0 deletions components/counter/src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import { AuroCounter } from './auro-counter.js';
import { AuroCounterGroup } from './auro-counter-group.js';

AuroCounter.register();
AuroCounterGroup.register();

// Enable TypeScript support
export { AuroCounter, AuroCounterGroup };

0 comments on commit b46d51f

Please sign in to comment.