Skip to content

Commit 5720901

Browse files
authored
chore: update license info (#21)
1 parent ce1733c commit 5720901

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "web-component-base",
3-
"version": "2.0.0",
3+
"version": "2.0.1",
44
"description": "A zero-dependency & tiny JS base class for creating reactive custom elements easily",
55
"type": "module",
66
"exports": {
@@ -32,7 +32,7 @@
3232
"site": "npm start -w site",
3333
"build": "npm run clean && tsc && npm run copy:meta && npm run copy:source",
3434
"clean": "rm -rf dist",
35-
"copy:meta": "node prepare.js && cp README.md ./dist && cp LICENSE ./dist",
35+
"copy:meta": "node prepare.js && cp README.md ./dist && cp LICENSE ./dist && cp -r ./src/vendors ./dist",
3636
"copy:source": "esbuild --minify --bundle ./src/*.js ./src/utils/* --outdir=\"./dist\" --format=\"esm\"",
3737
"pub": "npm run clean && npm run build && cd ./dist && npm publish",
3838
"pub:beta": "npm run clean && npm run build && cd ./dist && npm publish --tag beta",

src/WebComponent.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @license MIT <https://opensource.org/licenses/MIT>
3+
* @author Ayo Ayco <https://ayo.ayco.io>
4+
*/
5+
16
import {
27
createElement,
38
getKebabCase,
@@ -8,9 +13,7 @@ import {
813

914
/**
1015
* A minimal base class to reduce the complexity of creating reactive custom elements
11-
* @license MIT <https://opensource.org/licenses/MIT>
12-
* @author Ayo Ayco <https://ayo.ayco.io>
13-
* @see https://www.npmjs.com/package/web-component-base#readme
16+
* @see https://WebComponent.io
1417
*/
1518
export class WebComponent extends HTMLElement {
1619
/**
@@ -21,6 +24,8 @@ export class WebComponent extends HTMLElement {
2124

2225
/**
2326
* Blueprint for the Proxy props
27+
* @typedef {{[name: string]: any}} PropStringMap
28+
* @type {PropStringMap}
2429
*/
2530
static props;
2631

@@ -35,7 +40,6 @@ export class WebComponent extends HTMLElement {
3540

3641
/**
3742
* Read-only property containing camelCase counterparts of observed attributes.
38-
* @typedef {{[name: string]: any}} PropStringMap
3943
* @see https://www.npmjs.com/package/web-component-base#prop-access
4044
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset
4145
* @type {PropStringMap}
@@ -141,7 +145,7 @@ export class WebComponent extends HTMLElement {
141145
throw TypeError(
142146
`Cannot assign ${typeof value} to ${
143147
typeMap[prop]
144-
} property (setting '${prop}' of ${meta.constructor.name})`,
148+
} property (setting '${prop}' of ${meta.constructor.name})`
145149
);
146150
} else if (oldValue !== value) {
147151
obj[prop] = value;
@@ -176,7 +180,7 @@ export class WebComponent extends HTMLElement {
176180
if (!this.#props) {
177181
this.#props = new Proxy(
178182
initialProps,
179-
this.#handler((key, value) => this.setAttribute(key, value), this),
183+
this.#handler((key, value) => this.setAttribute(key, value), this)
180184
);
181185
}
182186
}
@@ -185,13 +189,11 @@ export class WebComponent extends HTMLElement {
185189
render() {
186190
if (typeof this.template === "string") {
187191
this.innerHTML = this.template;
188-
return;
189192
} else if (typeof this.template === "object") {
190193
const tree = this.template;
191194

192195
// TODO: smart diffing
193196
if (JSON.stringify(this.#prevDOM) !== JSON.stringify(tree)) {
194-
// render
195197
const el = createElement(tree);
196198
if (el) {
197199
if (Array.isArray(el)) this.replaceChildren(...el);

src/html.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/**
2-
* htm -- https://github.com/developit/htm
3-
* For license information please see ./vendors/htm/LICENSE.txt
4-
*/
51
const htm =
62
(new Map(),
73
function (n) {
@@ -77,4 +73,9 @@ function h(type, props, ...children) {
7773
return { type, props, children };
7874
}
7975

76+
/**
77+
* For htm license information please see ./vendors/htm/LICENSE.txt
78+
* @license Apache <https://www.apache.org/licenses/LICENSE-2.0>
79+
* @author Jason Miller <[email protected]>
80+
*/
8081
export const html = htm.bind(h);

src/vendors/htm/LICENSE.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
This license applies to parts of the `html` function originating from https://github.com/developit/htm project:
2+
13

24
Apache License
35
Version 2.0, January 2004

0 commit comments

Comments
 (0)