@symbiotejs/symbiote 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/build/symbiote.base.jsdoc.js +697 -0
- package/build/symbiote.base.min.js +1 -0
- package/build/symbiote.jsdoc.js +1394 -0
- package/build/symbiote.min.js +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function O(o){let t=e=>{var s;for(let r in e)((s=e[r])==null?void 0:s.constructor)===Object&&(e[r]=t(e[r]));return{...e}};return t(o)}var a=class{constructor(t){this.uid=Symbol(),this.name=t.name||null,t.schema.constructor===Object?this.store=O(t.schema):(this._storeIsProxy=!0,this.store=t.schema),this.callbackMap=Object.create(null)}static warn(t,e){console.warn(`Symbiote Data: cannot ${t}. Prop name: `+e)}read(t){return!this._storeIsProxy&&!this.store.hasOwnProperty(t)?(a.warn("read",t),null):this.store[t]}has(t){return this._storeIsProxy?this.store[t]!==void 0:this.store.hasOwnProperty(t)}add(t,e,s=!0){!s&&Object.keys(this.store).includes(t)||(this.store[t]=e,this.callbackMap[t]&&this.callbackMap[t].forEach(r=>{r(this.store[t])}))}pub(t,e){if(!this._storeIsProxy&&!this.store.hasOwnProperty(t)){a.warn("publish",t);return}this.add(t,e)}multiPub(t){for(let e in t)this.pub(e,t[e])}notify(t){this.callbackMap[t]&&this.callbackMap[t].forEach(e=>{e(this.store[t])})}sub(t,e,s=!0){return!this._storeIsProxy&&!this.store.hasOwnProperty(t)?(a.warn("subscribe",t),null):(this.callbackMap[t]||(this.callbackMap[t]=new Set),this.callbackMap[t].add(e),s&&e(this.store[t]),{remove:()=>{this.callbackMap[t].delete(e),this.callbackMap[t].size||delete this.callbackMap[t]},callback:e})}remove(){delete a.globalStore[this.uid]}static registerLocalCtx(t){let e=new a({schema:t});return a.globalStore[e.uid]=e,e}static registerNamedCtx(t,e){let s=a.globalStore[t];return s?console.warn('State: context name "'+t+'" already in use'):(s=new a({name:t,schema:e}),a.globalStore[t]=s),s}static clearNamedCtx(t){delete a.globalStore[t]}static getNamedCtx(t,e=!0){return a.globalStore[t]||(e&&console.warn('State: wrong context name - "'+t+'"'),null)}};a.globalStore=Object.create(null);var l=Object.freeze({BIND_ATTR:"set",ATTR_BIND_PRFX:"@",EXT_DATA_CTX_PRFX:"*",NAMED_DATA_CTX_SPLTR:"/",CTX_NAME_ATTR:"ctx-name",CSS_CTX_PROP:"--ctx-name",EL_REF_ATTR:"ref",AUTO_TAG_PRFX:"sym"});var C="1234567890QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm",I=C.length-1,d=class{static generate(t="XXXXXXXXX-XXX"){let e="";for(let s=0;s<t.length;s++)e+=t[s]==="-"?t[s]:C.charAt(Math.random()*I);return e}};function j(o,t){if(t.renderShadow)return;let e=[...o.querySelectorAll("slot")];if(t.__initChildren.length&&e.length){let s={};e.forEach(r=>{let i=r.getAttribute("name");i?s[i]={slot:r,fr:document.createDocumentFragment()}:s.__default__={slot:r,fr:document.createDocumentFragment()}}),t.__initChildren.forEach(r=>{var n;let i=(n=r.getAttribute)==null?void 0:n.call(r,"slot");i?(r.removeAttribute("slot"),s[i].fr.appendChild(r)):s.__default__&&s.__default__.fr.appendChild(r)}),Object.values(s).forEach(r=>{r.slot.parentNode.insertBefore(r.fr,r.slot),r.slot.remove()})}else t.innerHTML=""}function $(o,t){[...o.querySelectorAll(`[${l.EL_REF_ATTR}]`)].forEach(e=>{let s=e.getAttribute(l.EL_REF_ATTR);t.ref[s]=e,e.removeAttribute(l.EL_REF_ATTR)})}function L(o,t){[...o.querySelectorAll(`[${l.BIND_ATTR}]`)].forEach(e=>{e.getAttribute(l.BIND_ATTR).split(";").forEach(i=>{if(!i)return;let n=i.split(":").map(_=>_.trim()),h=n[0],b;h.indexOf(l.ATTR_BIND_PRFX)===0&&(b=!0,h=h.replace(l.ATTR_BIND_PRFX,""));let p=n[1].split(",").map(_=>_.trim()),x,m,y,g;if(h.includes(".")){x=!0;let _=h.split(".");g=()=>{m=e,_.forEach((u,X)=>{X<_.length-1?m=m[u]:y=u})},g()}for(let _ of p)t.sub(_,u=>{b?(u==null?void 0:u.constructor)===Boolean?u?e.setAttribute(h,""):e.removeAttribute(h):e.setAttribute(h,u):x?m?m[y]=u:window.setTimeout(()=>{g(),m[y]=u}):e[h]=u})}),e.removeAttribute(l.BIND_ATTR)})}var A=[j,$,L];var S=0,c=class extends HTMLElement{render(t,e=this.renderShadow){let s;if(t||this.constructor.template){for(this.constructor.template&&!this.constructor.__tpl&&(this.constructor.__tpl=document.createElement("template"),this.constructor.__tpl.innerHTML=this.constructor.template);this.firstChild;)this.firstChild.remove();if((t==null?void 0:t.constructor)===DocumentFragment)s=t;else if((t==null?void 0:t.constructor)===String){let r=document.createElement("template");r.innerHTML=t,s=r.content.cloneNode(!0)}else this.constructor.__tpl&&(s=this.constructor.__tpl.content.cloneNode(!0));for(let r of this.tplProcessors)r(s,this)}e?(this.shadowRoot||this.attachShadow({mode:"open"}),s&&this.shadowRoot.appendChild(s)):s&&this.appendChild(s)}addTemplateProcessor(t){this.tplProcessors.add(t)}constructor(){super();this.init$=Object.create(null),this.tplProcessors=new Set,this.ref=Object.create(null),this.allSubs=new Set,this.pauseRender=!1,this.renderShadow=!1,this.readyToDestroy=!0}get autoCtxName(){return this.__autoCtxName||(this.__autoCtxName=d.generate(),this.style.setProperty(l.CSS_CTX_PROP,`'${this.__autoCtxName}'`)),this.__autoCtxName}get cssCtxName(){return this.getCssData(l.CSS_CTX_PROP,!0)}get ctxName(){var t;return((t=this.getAttribute(l.CTX_NAME_ATTR))==null?void 0:t.trim())||this.cssCtxName||this.autoCtxName}get localCtx(){return this.__localCtx||(this.__localCtx=a.registerLocalCtx({})),this.__localCtx}get nodeCtx(){return a.getNamedCtx(this.ctxName,!1)||a.registerNamedCtx(this.ctxName,{})}static __parseProp(t,e){let s,r;if(t.startsWith(l.EXT_DATA_CTX_PRFX))s=e.nodeCtx,r=t.replace(l.EXT_DATA_CTX_PRFX,"");else if(t.includes(l.NAMED_DATA_CTX_SPLTR)){let i=t.split(l.NAMED_DATA_CTX_SPLTR);s=a.getNamedCtx(i[0]),r=i[1]}else s=e.localCtx,r=t;return{ctx:s,name:r}}sub(t,e){let s=c.__parseProp(t,this);this.allSubs.add(s.ctx.sub(s.name,e))}notify(t){let e=c.__parseProp(t,this);e.ctx.notify(e.name)}has(t){let e=c.__parseProp(t,this);return e.ctx.has(e.name)}add(t,e){let s=c.__parseProp(t,this);s.ctx.add(s.name,e,!1)}add$(t){for(let e in t)this.add(e,t[e])}get $(){if(!this.__stateProxy){let t=Object.create(null);this.__stateProxy=new Proxy(t,{set:(e,s,r)=>{let i=c.__parseProp(s,this);return i.ctx.pub(i.name,r),!0},get:(e,s)=>{let r=c.__parseProp(s,this);return r.ctx.read(r.name)}})}return this.__stateProxy}set$(t){for(let e in t)this.$[e]=t[e]}initCallback(){}__initDataCtx(){let t=this.constructor.__attrDesc;if(t)for(let e of Object.values(t))Object.keys(this.init$).includes(e)||(this.init$[e]="");for(let e in this.init$)if(e.startsWith(l.EXT_DATA_CTX_PRFX))this.nodeCtx.add(e.replace(l.EXT_DATA_CTX_PRFX,""),this.init$[e]);else if(e.includes(l.NAMED_DATA_CTX_SPLTR)){let s=e.split(l.NAMED_DATA_CTX_SPLTR),r=s[0].trim(),i=s[1].trim();if(r&&i){let n=a.getNamedCtx(r,!1);n||(n=a.registerNamedCtx(r,{})),n.add(i,this.init$[e])}}else this.localCtx.add(e,this.init$[e]);this.__dataCtxInitialized=!0}connectedCallback(){var t,e;if(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),!this.connectedOnce){let s=(t=this.getAttribute(l.CTX_NAME_ATTR))==null?void 0:t.trim();s&&this.style.setProperty(l.CSS_CTX_PROP,`'${s}'`),this.__initDataCtx(),this.__initChildren=[...this.childNodes];for(let r of A)this.addTemplateProcessor(r);this.pauseRender||this.render(),(e=this.initCallback)==null||e.call(this)}this.connectedOnce=!0}destroyCallback(){}disconnectedCallback(){this.dropCssDataCache(),!!this.readyToDestroy&&(this.__disconnectTimeout&&window.clearTimeout(this.__disconnectTimeout),this.__disconnectTimeout=window.setTimeout(()=>{this.destroyCallback();for(let t of this.allSubs)t.remove(),this.allSubs.delete(t);for(let t of this.tplProcessors)this.tplProcessors.delete(t)},100))}static reg(t,e=!1){if(t||(S++,t=`${l.AUTO_TAG_PRFX}-${S}`),this.__tag=t,window.customElements.get(t)){console.warn(`${t} - is already in "customElements" registry`);return}window.customElements.define(t,e?class extends this{}:this)}static get is(){return this.__tag||this.reg(),this.__tag}static bindAttributes(t){this.observedAttributes=Object.keys(t),this.__attrDesc=t}attributeChangedCallback(t,e,s){if(e===s)return;let r=this.constructor.__attrDesc[t];r?this.__dataCtxInitialized?this.$[r]=s:this.init$[r]=s:this[t]=s}getCssData(t,e=!1){if(this.__cssDataCache||(this.__cssDataCache=Object.create(null)),!Object.keys(this.__cssDataCache).includes(t)){this.__computedStyle||(this.__computedStyle=window.getComputedStyle(this));let s=this.__computedStyle.getPropertyValue(t).trim();s.startsWith("'")&&s.endsWith("'")&&(s=s.replace(/\'/g,'"'));try{this.__cssDataCache[t]=JSON.parse(s)}catch{!e&&console.warn(`CSS Data error: ${t}`),this.__cssDataCache[t]=null}}return this.__cssDataCache[t]}dropCssDataCache(){this.__cssDataCache=null,this.__computedStyle=null}defineAccessor(t,e,s){let r="__"+t;this[r]=this[t],Object.defineProperty(this,t,{set:i=>{this[r]=i,s?window.setTimeout(()=>{e==null||e(i)}):e==null||e(i)},get:()=>this[r]}),this[t]=this[r]}};var E="[Typed State] Wrong property name: ",k="[Typed State] Wrong property type: ",T=class{constructor(t,e){this.__typedSchema=t,this.__ctxId=e||d.generate(),this.__schema=Object.keys(t).reduce((s,r)=>(s[r]=t[r].value,s),{}),this.__state=a.registerNamedCtx(this.__ctxId,this.__schema)}setValue(t,e){if(!this.__typedSchema.hasOwnProperty(t)){console.warn(E+t);return}if((e==null?void 0:e.constructor)!==this.__typedSchema[t].type){console.warn(k+t);return}this.__state.pub(t,e)}setMultipleValues(t){for(let e in t)this.setValue(e,t[e])}getValue(t){if(!this.__typedSchema.hasOwnProperty(t)){console.warn(E+t);return}return this.__state.read(t)}subscribe(t,e){return this.__state.sub(t,e)}remove(){this.__state.remove()}};var P=class{constructor(t){this.__typedSchema=t.typedSchema,this.__ctxId=t.ctxName||d.generate(),this.__state=a.registerNamedCtx(this.__ctxId,{}),this.__watchList=t.watchList||[],this.__handler=t.handler||null,this.__subsMap=Object.create(null),this.__observers=new Set,this.__items=new Set;let e=Object.create(null);this.__notifyObservers=(s,r)=>{this.__observeTimeout&&window.clearTimeout(this.__observeTimeout),e[s]||(e[s]=new Set),e[s].add(r),this.__observeTimeout=window.setTimeout(()=>{this.__observers.forEach(i=>{i({...e})}),e=Object.create(null)})}}notify(){this.__notifyTimeout&&window.clearTimeout(this.__notifyTimeout),this.__notifyTimeout=window.setTimeout(()=>{var t;(t=this.__handler)==null||t.call(this,[...this.__items])})}add(t){let e=new T(this.__typedSchema);for(let s in t)e.setValue(s,t[s]);return this.__state.add(e.__ctxId,e),this.__watchList.forEach(s=>{this.__subsMap[e.__ctxId]||(this.__subsMap[e.__ctxId]=[]),this.__subsMap[e.__ctxId].push(e.subscribe(s,()=>{this.__notifyObservers(s,e.__ctxId)}))}),this.__items.add(e.__ctxId),this.notify(),e}read(t){return this.__state.read(t)}readProp(t,e){return this.read(t).getValue(e)}publishProp(t,e,s){this.read(t).setValue(e,s)}remove(t){this.__items.delete(t),this.notify(),this.__state.pub(t,null),delete this.__subsMap[t]}clearAll(){this.__items.forEach(t=>{this.remove(t)})}observe(t){this.__observers.add(t)}unobserve(t){this.__observers.delete(t)}findItems(t){let e=[];return this.__items.forEach(s=>{let r=this.read(s);t(r)&&e.push(s)}),e}items(){return[...this.__items]}destroy(){this.__state.remove(),this.__observers=null;for(let t in this.__subsMap)this.__subsMap[t].forEach(e=>{e.remove()}),delete this.__subsMap[t]}};var f=class{static _print(t){console.warn(t)}static setDefaultTitle(t){this.defaultTitle=t}static setRoutingMap(t){Object.assign(this.appMap,t);for(let e in this.appMap)!this.defaultRoute&&this.appMap[e].default===!0?this.defaultRoute=e:!this.errorRoute&&this.appMap[e].error===!0&&(this.errorRoute=e)}static set routingEventName(t){this.__routingEventName=t}static get routingEventName(){return this.__routingEventName||"sym-on-route"}static readAddressBar(){let t={route:null,options:{}};return window.location.search.split(this.separator).forEach(s=>{if(s.includes("?"))t.route=s.replace("?","");else if(s.includes("=")){let r=s.split("=");t.options[r[0]]=decodeURI(r[1])}else t.options[s]=!0}),t}static notify(){let t=this.readAddressBar(),e=this.appMap[t.route];if(e&&e.title&&(document.title=e.title),t.route===null&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!e&&this.errorRoute){this.applyRoute(this.errorRoute);return}else if(!e&&this.defaultRoute){this.applyRoute(this.defaultRoute);return}else if(!e){this._print(`Route "${t.route}" not found...`);return}let s=new CustomEvent(f.routingEventName,{detail:{route:t.route,options:Object.assign(e||{},t.options)}});window.dispatchEvent(s)}static reflect(t,e={}){let s=this.appMap[t];if(!s){this._print("Wrong route: "+t);return}let r="?"+t;for(let n in e)e[n]===!0?r+=this.separator+n:r+=this.separator+n+`=${e[n]}`;let i=s.title||this.defaultTitle||"";window.history.pushState(null,i,r),document.title=i}static applyRoute(t,e={}){this.reflect(t,e),this.notify()}static setSeparator(t){this._separator=t}static get separator(){return this._separator||"&"}static createRouterData(t,e){this.setRoutingMap(e);let s=a.registerNamedCtx(t,{route:null,options:null,title:null});return window.addEventListener(this.routingEventName,r=>{var i;s.multiPub({route:r.detail.route,options:r.detail.options,title:((i=r.detail.options)==null?void 0:i.title)||this.defaultTitle||""})}),f.notify(),s}};f.appMap=Object.create(null);window.onpopstate=()=>{f.notify()};function R(o,t){for(let e in t)e.includes("-")?o.style.setProperty(e,t[e]):o.style[e]=t[e]}function D(o,t){for(let e in t)t[e].constructor===Boolean?t[e]?o.setAttribute(e,""):o.removeAttribute(e):o.setAttribute(e,t[e])}function N(o={tag:"div"}){let t=document.createElement(o.tag);if(o.attributes&&D(t,o.attributes),o.styles&&R(t,o.styles),o.properties)for(let e in o.properties)t[e]=o.properties[e];return o.processors&&o.processors.forEach(e=>{e(t)}),o.children&&o.children.forEach(e=>{let s=N(e);t.appendChild(s)}),t}var v="idb-store-ready",F="symbiote-db",B="symbiote-idb-update_",M=class{_notifyWhenReady(t=null){window.dispatchEvent(new CustomEvent(v,{detail:{dbName:this.name,storeName:this.storeName,event:t}}))}get _updEventName(){return B+this.name}_getUpdateEvent(t){return new CustomEvent(this._updEventName,{detail:{key:this.name,newValue:t}})}_notifySubscribers(t){window.localStorage.removeItem(this.name),window.localStorage.setItem(this.name,t),window.dispatchEvent(this._getUpdateEvent(t))}constructor(t,e){this.name=t,this.storeName=e,this.version=1,this.request=window.indexedDB.open(this.name,this.version),this.request.onupgradeneeded=s=>{this.db=s.target.result,this.objStore=this.db.createObjectStore(e,{keyPath:"_key"}),this.objStore.transaction.oncomplete=r=>{this._notifyWhenReady(r)}},this.request.onsuccess=s=>{this.db=s.target.result,this._notifyWhenReady(s)},this.request.onerror=s=>{console.error(s)},this._subscribtionsMap={},this._updateHandler=s=>{s.key===this.name&&this._subscribtionsMap[s.newValue]&&this._subscribtionsMap[s.newValue].forEach(async i=>{i(await this.read(s.newValue))})},this._localUpdateHandler=s=>{this._updateHandler(s.detail)},window.addEventListener("storage",this._updateHandler),window.addEventListener(this._updEventName,this._localUpdateHandler)}read(t){let s=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).get(t);return new Promise((r,i)=>{s.onsuccess=n=>{var h;((h=n.target.result)==null?void 0:h._value)?r(n.target.result._value):(r(null),console.warn(`IDB: cannot read "${t}"`))},s.onerror=n=>{i(n)}})}write(t,e,s=!1){let r={_key:t,_value:e},n=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).put(r);return new Promise((h,b)=>{n.onsuccess=p=>{s||this._notifySubscribers(t),h(p.target.result)},n.onerror=p=>{b(p)}})}delete(t,e=!1){let r=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).delete(t);return new Promise((i,n)=>{r.onsuccess=h=>{e||this._notifySubscribers(t),i(h)},r.onerror=h=>{n(h)}})}getAll(){let e=this.db.transaction(this.storeName,"readwrite").objectStore(this.storeName).getAll();return new Promise((s,r)=>{e.onsuccess=i=>{let n=i.target.result;s(n.map(h=>h._value))},e.onerror=i=>{r(i)}})}subscribe(t,e){this._subscribtionsMap[t]||(this._subscribtionsMap[t]=new Set);let s=this._subscribtionsMap[t];return s.add(e),{remove:()=>{s.delete(e),s.size||delete this._subscribtionsMap[t]}}}stop(){window.removeEventListener("storage",this._updateHandler),this.__subscribtionsMap=null,w.clear(this.name)}},w=class{static get readyEventName(){return v}static open(t=F,e="store"){let s=`${t}/${e}`;return this._reg[s]||(this._reg[s]=new M(t,e)),this._reg[s]}static clear(t){window.indexedDB.deleteDatabase(t);for(let e in this._reg)e.split("/")[0]===t&&delete this._reg[e]}};w._reg=Object.create(null);export{f as AppRouter,c as BaseComponent,a as Data,w as IDB,P as TypedCollection,T as TypedData,d as UID,D as applyAttributes,R as applyStyles,N as create};
|
package/package.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "module",
|
|
3
|
+
"name": "@symbiotejs/symbiote",
|
|
4
|
+
"scripts": {
|
|
5
|
+
"lint:types": "tsc",
|
|
6
|
+
"lint:eslint": "eslint --ext .js,.html . --ignore-path .gitignore",
|
|
7
|
+
"format:eslint": "eslint --ext .js,.html . --fix --ignore-path .gitignore",
|
|
8
|
+
"lint:prettier": "prettier \"**/*.js\" --check --ignore-path .gitignore",
|
|
9
|
+
"format:prettier": "prettier \"**/*.js\" --write --ignore-path .gitignore",
|
|
10
|
+
"lint": "npm run lint:types && npm run lint:eslint && npm run lint:prettier",
|
|
11
|
+
"format": "npm run format:eslint && npm run format:prettier",
|
|
12
|
+
"build": "node esbuild.js && rollup --config rollup.config.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"build/symbiote.min.js",
|
|
16
|
+
"build/symbiote.jsdoc.js",
|
|
17
|
+
"build/symbiote.base.min.js",
|
|
18
|
+
"build/symbiote.base.jsdoc.js",
|
|
19
|
+
"README.md",
|
|
20
|
+
"LICENSE"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@babel/eslint-parser": "^7.15.8",
|
|
27
|
+
"@babel/preset-env": "^7.15.8",
|
|
28
|
+
"esbuild": "^0.14.8",
|
|
29
|
+
"eslint": "^8.0.1",
|
|
30
|
+
"eslint-config-google": "^0.14.0",
|
|
31
|
+
"eslint-config-prettier": "^6.11.0",
|
|
32
|
+
"husky": "^1.3.1",
|
|
33
|
+
"lint-staged": "^11.2.3",
|
|
34
|
+
"prettier": "^2.0.5",
|
|
35
|
+
"prettier-plugin-jsdoc": "0.0.17",
|
|
36
|
+
"rollup": "^2.60.0",
|
|
37
|
+
"typescript": "^3.9.7"
|
|
38
|
+
},
|
|
39
|
+
"eslintConfig": {
|
|
40
|
+
"extends": [
|
|
41
|
+
"eslint-config-prettier"
|
|
42
|
+
],
|
|
43
|
+
"parserOptions": {
|
|
44
|
+
"ecmaVersion": 2020,
|
|
45
|
+
"sourceType": "module"
|
|
46
|
+
},
|
|
47
|
+
"rules": {
|
|
48
|
+
"no-unused-vars": "off",
|
|
49
|
+
"no-console": "off",
|
|
50
|
+
"max-classes-per-file": "off",
|
|
51
|
+
"prefer-const": "off",
|
|
52
|
+
"no-param-reassign": "off",
|
|
53
|
+
"guard-for-in": "off",
|
|
54
|
+
"no-restricted-syntax": "off",
|
|
55
|
+
"class-methods-use-this": "off",
|
|
56
|
+
"dot-notation": "off",
|
|
57
|
+
"no-plusplus": "off",
|
|
58
|
+
"no-return-await": "off",
|
|
59
|
+
"no-await-in-loop": "off",
|
|
60
|
+
"one-var": "off",
|
|
61
|
+
"default-case": "warn",
|
|
62
|
+
"no-shadow": "warn",
|
|
63
|
+
"no-prototype-builtins": "off",
|
|
64
|
+
"require-jsdoc": "off",
|
|
65
|
+
"valid-jsdoc": "off"
|
|
66
|
+
},
|
|
67
|
+
"env": {
|
|
68
|
+
"node": true,
|
|
69
|
+
"browser": true
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"prettier": {
|
|
73
|
+
"singleQuote": true,
|
|
74
|
+
"tabWidth": 2,
|
|
75
|
+
"semi": true,
|
|
76
|
+
"arrowParens": "always",
|
|
77
|
+
"printWidth": 200,
|
|
78
|
+
"parser": "jsdoc-parser"
|
|
79
|
+
},
|
|
80
|
+
"husky": {
|
|
81
|
+
"hooks": {
|
|
82
|
+
"pre-commit": "lint-staged"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"lint-staged": {
|
|
86
|
+
"*.js": [
|
|
87
|
+
"tsc --skipLibCheck --allowJs --noEmit",
|
|
88
|
+
"eslint --fix",
|
|
89
|
+
"prettier --write",
|
|
90
|
+
"git add"
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
"version": "1.1.1",
|
|
94
|
+
"description": "Symbiote.js",
|
|
95
|
+
"author": "hello@symbiotejs.org",
|
|
96
|
+
"license": "MIT",
|
|
97
|
+
"bugs": {
|
|
98
|
+
"url": "https://github.com/symbiotejs/symbiote.js/issues"
|
|
99
|
+
},
|
|
100
|
+
"homepage": "https://symbiotejs.org/",
|
|
101
|
+
"repository": {
|
|
102
|
+
"type": "git",
|
|
103
|
+
"url": "git+https://github.com/symbiotejs/symbiote.js.git"
|
|
104
|
+
},
|
|
105
|
+
"keywords": [
|
|
106
|
+
"symbiote.js, web components, custom elements, shadow dom, ui framework"
|
|
107
|
+
]
|
|
108
|
+
}
|