decue 1.0.0 → 1.1.0
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/README.md +15 -1
- package/dist/decue.js +333 -191
- package/dist/decue.min.js +1 -1
- package/eslint.config.js +53 -0
- package/examples.html +82 -12
- package/external.html +1 -0
- package/npm.sh +1 -1
- package/package.json +24 -11
- package/src/decue.js +333 -191
- package/test/debug.test.js +201 -0
- package/test/decue.test.js +78 -0
- package/test/errors.test.js +212 -0
- package/test/eventHandlers.test.js +95 -0
- package/test/formAssociated.test.js +477 -0
- package/test/init.test.js +43 -0
- package/test/lifecycle.test.js +110 -0
- package/test/memory.test.js +283 -0
- package/test/piped.test.js +152 -0
- package/test/placeholders.test.js +396 -0
- package/test/predefined.test.js +131 -0
- package/test/scriptAttributes.test.js +464 -0
- package/test/slots.test.js +293 -0
- package/test/test-helpers.js +36 -0
- package/tsconfig.json +1 -1
- package/web-test-runner.config.mjs +30 -0
- package/serve.sh +0 -4
- package/test/decue-tests.js +0 -84
- package/test/index.html +0 -65
- package/test/util/util.js +0 -17
package/dist/decue.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var decue=function(){
|
|
1
|
+
var decue=function(){var r=("currentScript"in document&&document["currentScript"]?document["currentScript"].hasAttribute("debug"):false)||false;var n=("currentScript"in document&&document["currentScript"]?document["currentScript"].getAttribute("shadow"):undefined)||"none";if(!["open","closed","none"].includes(n)){throw new Error('Invalid default shadow DOM mode "'+n+'". Must be one of "open", "closed" or "none".')}var s=/{(\.?[a-zA-Z_0-9]+)((?:[.|][a-zA-Z_0-9]+)*)}/g;var l=function(e){return!(e==="shadow"||e.startsWith("decue-"))};var a=function(o){return function(e,t){var n=t.startsWith(".")?t.substring(1):undefined;var r=n&&typeof e[n]==="function";var i=c[t];if(!n&&!i){throw new Error('Global function "'+t+'" not found. Make sure to include it (not deferred) before this element is created.')}return n?r?e[n]():e[n]:i.apply(o,[e])}};var u=function(i,o,e){return e.replaceAll(s,function(e,t,n){var r=(t+n).replaceAll(/([^|])\./g,"$1|.").split("|");return o.hasAttribute(t)?r.slice(1).reduce(a(i),o.getAttribute(t)):t.startsWith(".")?r.reduce(a(i),o):e})};var d=function(e,t){var n=t[0];var r=t[1];var i=t[2];var o=u(n,e,r);if(n.nodeType===Node.TEXT_NODE){var a=n;if(o!==a.data){a.data=o}}else if(n.nodeType===Node.ELEMENT_NODE){var s=n;if(o!==s.getAttribute(i)){s.setAttribute(i,o)}}};var f=function(e,r){var t=document.createTreeWalker(e,4|1);while(t.nextNode()){var n=t.currentNode;if(n.nodeType===Node.TEXT_NODE){var i=n;var o;while((o=s.exec(i.data))!==null){r(i,null,o[1])}}else if(n.nodeType===Node.ELEMENT_NODE){var a=n;a.getAttributeNames().forEach(function(e){var t=a.getAttribute(e);var n;while((n=s.exec(t))!==null){r(a,e,n[1])}})}}};var h=function(r,e){e.querySelectorAll("slot[name]").forEach(function(e){var t=r.querySelectorAll(':scope > [slot="'+e.getAttribute("name")+'"]');var n=t.length>0?t:e.children;e.replaceWith.apply(e,n)});var t=e.querySelector("slot:not([name])");if(t){var n=Array.prototype.slice.call(r.childNodes).filter(function(e){return e.nodeType!==Node.ELEMENT_NODE||!e.hasAttribute("slot")});var i=n.length>0?n:t.children;t.replaceWith.apply(t,i)}};var b=function(r){return r.getAttributeNames().filter(function(e){return e.startsWith("decue-on:")}).map(function(e){return e.substring("decue-on:".length)}).map(function(e){var t=r.getAttribute("decue-on:"+e);var n=globalThis[t];if(!n){throw'Global handler function "'+t+'" for event "'+e+'" not found.'}r.addEventListener(e,n);return[e,n]})};var v=function(t,e){if(e){var n=e.filter(function(e){return e[0].ownerDocument!==undefined});if(n.length!==e.length){e=n}e.forEach(function(e){d(t,e)})}return e};var i=function(i,o,a,s,e){var u=function(){if(i&&console){console.log.apply(null,[o].concat(Array.prototype.slice.call(arguments)))}};var c=e;if(a){f(a.content,function(e,t,n){c.push(n)})}c=c.filter(l).filter(function(e,t,n){return n.indexOf(e)===t});globalThis.customElements.define(o,class extends HTMLElement{static get formAssociated(){return s}static get observedAttributes(){return c}constructor(){super();this._template=a||Array.prototype.slice.call(document.getElementsByTagName("template")).filter(function(e){return e.getAttribute("decue")===o}).concat([undefined])[0];if(!this._template){throw`Template for "${o}" not found. Make sure it comes in the DOM before any corresponding custom element.`}if(!s&&this._template.hasAttribute("formAssociated")){throw`Cannot declare a predefined custom element "${o}" as formAssociated. Move it from elements="..." to formAssociated="...".`}if(s){var n=this.attachInternals();var r;var i=this;Object.defineProperties(this,{internals:{value:n,writable:false},value:{get:function(){return r},set:function(e){r=e;n.setFormValue(r);i.checkValidity();i._boundNodes=v(i,i._boundNodes)}},name:{get:function(){return this.getAttribute("name")}},form:{get:function(){return n.form}},labels:{get:function(){return n.labels}},validity:{get:function(){return n.validity}},validationMessage:{get:function(){return n.validationMessage}},willValidate:{get:function(){return n.willValidate}},setFormValue:{value:function(e,t){n.setFormValue(r=e,t);i._boundNodes=v(i,i._boundNodes)},writable:false},setValidity:{value:n.setValidity.bind(n),writable:false},checkValidity:{value:function(){m(i,"checkvalidity");return n.checkValidity()},writable:false},reportValidity:{value:n.reportValidity.bind(n),writable:false}})}}connectedCallback(){this._shadow=this.getAttribute("shadow")||this._template.getAttribute("shadow")||n;if(!["open","closed","none"].includes(this._shadow)){throw`Invalid shadow DOM mode "${this._shadow}" for element "${o}". Must be one of "open", "closed" or "none".`}if(!this._shadowRoot){this._shadowRoot=this._shadow==="none"?this:this.attachShadow({mode:this._shadow,delegatesFocus:true});if(s){this.value=this.getAttribute("value");u("Making form-associated with value",this.value);if(!this.hasAttribute("tabindex")){this.tabIndex=0}}this._eventListeners=b(this);var r=this;var e=function(){u("Finalizing...");var e=r._template.content.cloneNode(true);if(r._shadow==="none"){h(r._shadowRoot,e);u("Slots initialized")}r._boundNodes=[];[e,r].forEach(function(e){f(e,function(e,t){r._boundNodes.push(e.nodeType==Node.ELEMENT_NODE?[e,e.getAttribute(t),t]:[e,e.data,undefined])})});var n=r.getAttributeNames().filter(l).filter(function(e){return!c.includes(e)});if(n.length>0&&r._boundNodes.length>0){if(typeof MutationObserver==="undefined"){console.info(`Decue: Element "${o}" has attributes (${n.join(" ")}) which are not declared in observedAttributes, but no MutationObserver is available. These attributes won't be observed.`)}else{r._observer=new MutationObserver(function(e){e.forEach(function(e){if(n.includes(e.attributeName)){var t=e.target.getAttribute(e.attributeName);u("Attribute observer hit",e.attributeName,t,"(unobserved attributes: ",n,")");r.attributeChangedCallback(e.attributeName,e.oldValue,t)}})});r._observer.observe(r,{attributeOldValue:true});r._decueMutationObserved=true;if(i){u("Observing attributes with MutationObserver",n);r.setAttribute("data-decue-mutation-observed-attributes",n.join(" "))}}}if(i&&c.length>0){u("Observing attributes with observedAttributes",c);r.setAttribute("data-decue-observed-attributes",c.join(" "))}r._shadowRoot.append(e);r._boundNodes.forEach(function(e){d(r,e)});m(r,"connect")};if(a||r.ownerDocument.readyState!="loading"){e()}else if(typeof MutationObserver==="undefined"){throw new Error(`No MutationObserver available, cannot use predefined elements`)}else{var t=new MutationObserver(function(){t.disconnect();e()});t.observe(r.parentElement,{childList:true})}}}attributeChangedCallback(e,t,n){if(t!==n){if(s&&e==="value"&&this.value!==n){this.value=n}this._boundNodes=v(this,this._boundNodes);m(this,"attributechange",{name:e,oldValue:t,newValue:n})}}disconnectedCallback(){m(this,"disconnect");if(this._observer){u("Disconnecting MutationObserver");this._observer.disconnect();delete this._observer}if(this._eventListeners){u("Removing event listeners");this._eventListeners.forEach(function(e){this.removeEventListener(e[0],e[1])},this);delete this._eventListeners}}adoptedCallback(){m(this,"adopt")}formAssociatedCallback(e){m(this,"formassociate",{form:e})}formDisabledCallback(e){m(this,"formdisable",{disabled:e})}formResetCallback(){m(this,"formreset")}formStateRestoreCallback(e,t){m(this,"formstaterestore",{state:e,mode:t})}})};var m=function(e,t,n){if(typeof CustomEvent!=="undefined"){e.dispatchEvent(new CustomEvent(t,{detail:n||{},bubbles:true}))}else{e.dispatchEvent(new Event(t,{detail:n||{},bubbles:true}))}};[{attr:"elements",formAssociated:false},{attr:"form-associated",formAssociated:true}].forEach(function(n){if(document.currentScript.hasAttribute(n.attr)){document.currentScript.getAttribute(n.attr).split(/\s+/).map(function(e){return e.split(/\[|]/)}).forEach(function([e,t]){i(r,e,null,n.formAssociated,t?t.split(","):[])})}});var c={};if(document.currentScript&&document.currentScript.hasAttribute("functions")){document.currentScript.getAttribute("functions").split(/\s+/).forEach(function(n){var e=n;var t=n;var r=n.indexOf(":");if(r>=0){e=n.substring(0,r);t=n.substring(r+1)}var i=t.split(".").reduce(function(e,t){if(e&&t in e){return e[t]}else{throw`Cannot find namespace "${t}" while resolving function "${n}".`}},globalThis);if(typeof i!=="function"){throw`Function "${n}" not found. Make sure to include it (not deferred) before Decue script.`}c[e]=i})}var t=function(e){var t=e.getAttribute("decue");if(t&&!globalThis.customElements.get(t)){i(r,t,e,e.hasAttribute("form-associated"),[])}};var e=function(){[...document.getElementsByTagName("template")].forEach(t);[...document.getElementsByTagName("object")].filter(function(e){return e.getAttribute("type")==="text/html"}).forEach(function(e){e.addEventListener("load",function(){if(e.contentDocument){[...e.contentDocument.getElementsByTagName("template")].forEach(t)}});if(e.contentDocument){[...e.contentDocument.getElementsByTagName("template")].forEach(t)}})};if(typeof globalThis!=="undefined"){globalThis.addEventListener("DOMContentLoaded",e)}else if(typeof window!=="undefined"){window.addEventListener("DOMContentLoaded",e)}return{processTemplate:t,defineElement:i,registeredFunctions:c}}();if(typeof globalThis!=="undefined"){globalThis.decue=decue}else if(typeof window!=="undefined"){window.decue=decue}
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import compat from 'eslint-plugin-compat';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
js.configs.recommended,
|
|
6
|
+
{
|
|
7
|
+
ignores: ['coverage/', 'dist/', 'node_modules/', '**/*.min.js']
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
files: ['src/**/*.js'],
|
|
11
|
+
languageOptions: {
|
|
12
|
+
ecmaVersion: 2015,
|
|
13
|
+
sourceType: 'script',
|
|
14
|
+
globals: {
|
|
15
|
+
// Browser globals
|
|
16
|
+
globalThis: 'readonly',
|
|
17
|
+
window: 'readonly',
|
|
18
|
+
document: 'readonly',
|
|
19
|
+
console: 'readonly',
|
|
20
|
+
setTimeout: 'readonly',
|
|
21
|
+
clearTimeout: 'readonly',
|
|
22
|
+
performance: 'readonly',
|
|
23
|
+
customElements: 'readonly',
|
|
24
|
+
HTMLElement: 'readonly',
|
|
25
|
+
HTMLTableElement: 'readonly',
|
|
26
|
+
HTMLTableRowElement: 'readonly',
|
|
27
|
+
HTMLTableCellElement: 'readonly',
|
|
28
|
+
Element: 'readonly',
|
|
29
|
+
Node: 'readonly',
|
|
30
|
+
NodeList: 'readonly',
|
|
31
|
+
Event: 'readonly',
|
|
32
|
+
CustomEvent: 'readonly',
|
|
33
|
+
// Test globals
|
|
34
|
+
describe: 'readonly',
|
|
35
|
+
it: 'readonly',
|
|
36
|
+
beforeEach: 'readonly',
|
|
37
|
+
afterEach: 'readonly',
|
|
38
|
+
expect: 'readonly',
|
|
39
|
+
sinon: 'readonly',
|
|
40
|
+
assert: 'readonly'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
plugins: {
|
|
44
|
+
compat
|
|
45
|
+
},
|
|
46
|
+
rules: {
|
|
47
|
+
'compat/compat': 'error'
|
|
48
|
+
},
|
|
49
|
+
settings: {
|
|
50
|
+
polyfills: []
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
];
|
package/examples.html
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
|
+
<meta http-equiv="Content-Security-Policy" content="default-src 'self' 'nonce-a' 'nonce-b' 'nonce-c' 'nonce-d'" />
|
|
5
6
|
<title>DeCuE examples</title>
|
|
6
|
-
<style>
|
|
7
|
+
<style nonce="a">
|
|
8
|
+
object {
|
|
9
|
+
position:absolute;
|
|
10
|
+
left: -99999px;
|
|
11
|
+
}
|
|
7
12
|
main {
|
|
8
13
|
display: flex;
|
|
9
14
|
}
|
|
@@ -20,12 +25,12 @@
|
|
|
20
25
|
outline: 2px solid blue;
|
|
21
26
|
}
|
|
22
27
|
</style>
|
|
23
|
-
<script>
|
|
28
|
+
<script nonce="b">
|
|
24
29
|
function toLower(str) {
|
|
25
30
|
return str.toLowerCase();
|
|
26
31
|
}
|
|
27
32
|
</script>
|
|
28
|
-
<script>
|
|
33
|
+
<script nonce="c">
|
|
29
34
|
function validateme(ev) {
|
|
30
35
|
const target = ev.target;
|
|
31
36
|
if (target.value.indexOf('hello') < 0) {
|
|
@@ -45,9 +50,26 @@
|
|
|
45
50
|
document.querySelector('[data-modifyvalues]').addEventListener('click', () => {
|
|
46
51
|
document.querySelectorAll('[value]').forEach(x => {x.value = 'hello ' + x.value; x.dispatchEvent(new Event('change'));});
|
|
47
52
|
});
|
|
53
|
+
|
|
54
|
+
setTimeout(() => {
|
|
55
|
+
document.querySelectorAll('.remove-then-append nested-element-with-attribute').forEach(el => {
|
|
56
|
+
const parent = el.parentNode;
|
|
57
|
+
parent.removeChild(el);
|
|
58
|
+
parent.appendChild(el);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
document.querySelectorAll('.move nested-element-with-attribute').forEach(el => {
|
|
63
|
+
if (el.parentNode.moveBefore) {
|
|
64
|
+
el.parentNode.moveBefore(el, null);
|
|
65
|
+
} else {
|
|
66
|
+
el.parentNode.querySelector('.text').textContent = "(browser doesn't support moveBefore)";
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}, 1000);
|
|
48
70
|
});
|
|
49
71
|
</script>
|
|
50
|
-
<script src="src/decue.js" debug elements="predefined-element predefined-element-with-attributes predefined-element-with-slot"></script>
|
|
72
|
+
<script src="src/decue.js" debug elements="predefined-element predefined-element-with-attributes predefined-element-with-slot" functions="toLower"></script>
|
|
51
73
|
</head>
|
|
52
74
|
<body>
|
|
53
75
|
|
|
@@ -67,7 +89,7 @@
|
|
|
67
89
|
</template>
|
|
68
90
|
<template decue="nesting-element">
|
|
69
91
|
<nested-element title="a nesting element"></nested-element>
|
|
70
|
-
<nested-element-with-attribute greetings="
|
|
92
|
+
<nested-element-with-attribute greetings="{greetings}" title="a nesting element with an attribute"></nested-element-with-attribute>
|
|
71
93
|
</template>
|
|
72
94
|
|
|
73
95
|
<template decue="default-slotted-element">
|
|
@@ -88,11 +110,11 @@
|
|
|
88
110
|
<template decue="element-with-function">
|
|
89
111
|
<div data-function="{greetings|toLower}" title="an element with a function {greetings|toLower}">Hello {greetings|toLower}</div>
|
|
90
112
|
</template>
|
|
91
|
-
<template decue="element-with-method" title="an element with a method {greetings
|
|
92
|
-
<div data-method="{greetings
|
|
113
|
+
<template decue="element-with-method" title="an element with a method {greetings.toUpperCase}">
|
|
114
|
+
<div data-method="{greetings.toUpperCase}">Hello {greetings.toUpperCase}</div>
|
|
93
115
|
</template>
|
|
94
116
|
<template decue="element-with-pipe">
|
|
95
|
-
<div data-piped="{greetings
|
|
117
|
+
<div data-piped="{greetings.toUpperCase|toLower}" title="an element with a piping function {greetings.toUpperCase|toLower}">Hello {greetings.toUpperCase|toLower}</div>
|
|
96
118
|
</template>
|
|
97
119
|
|
|
98
120
|
<template decue="predefined-element">
|
|
@@ -148,7 +170,7 @@
|
|
|
148
170
|
<td>
|
|
149
171
|
<fieldset>
|
|
150
172
|
<legend>Nesting</legend>
|
|
151
|
-
<nesting-element></nesting-element>
|
|
173
|
+
<nesting-element greetings="World!"></nesting-element>
|
|
152
174
|
</fieldset>
|
|
153
175
|
|
|
154
176
|
<fieldset>
|
|
@@ -190,7 +212,7 @@
|
|
|
190
212
|
<td>
|
|
191
213
|
<fieldset>
|
|
192
214
|
<legend>Nesting</legend>
|
|
193
|
-
<nesting-element shadow="open"></nesting-element>
|
|
215
|
+
<nesting-element greetings="World!" shadow="open"></nesting-element>
|
|
194
216
|
</fieldset>
|
|
195
217
|
|
|
196
218
|
<fieldset>
|
|
@@ -231,7 +253,7 @@
|
|
|
231
253
|
<td>
|
|
232
254
|
<fieldset>
|
|
233
255
|
<legend>Nesting</legend>
|
|
234
|
-
<nesting-element shadow="closed"></nesting-element>
|
|
256
|
+
<nesting-element greetings="World!" shadow="closed"></nesting-element>
|
|
235
257
|
</fieldset>
|
|
236
258
|
|
|
237
259
|
<fieldset>
|
|
@@ -270,9 +292,57 @@
|
|
|
270
292
|
</fieldset>
|
|
271
293
|
</td>
|
|
272
294
|
</tr>
|
|
295
|
+
|
|
296
|
+
<tr>
|
|
297
|
+
<td>
|
|
298
|
+
<fieldset class="remove-then-append">
|
|
299
|
+
<legend>remove-then-append</legend>
|
|
300
|
+
<nested-element-with-attribute greetings="World!"></nested-element-with-attribute>
|
|
301
|
+
<div class="text">text originally in the end</div>
|
|
302
|
+
</fieldset>
|
|
303
|
+
</td>
|
|
304
|
+
<td>
|
|
305
|
+
<fieldset class="remove-then-append">
|
|
306
|
+
<legend>remove-then-append</legend>
|
|
307
|
+
<nested-element-with-attribute greetings="World!" shadow="open"></nested-element-with-attribute>
|
|
308
|
+
<div class="text">text originally in the end</div>
|
|
309
|
+
</fieldset>
|
|
310
|
+
</td>
|
|
311
|
+
<td>
|
|
312
|
+
<fieldset class="remove-then-append">
|
|
313
|
+
<legend>remove-then-append</legend>
|
|
314
|
+
<nested-element-with-attribute greetings="World!" shadow="closed"></nested-element-with-attribute>
|
|
315
|
+
<div class="text">text originally in the end</div>
|
|
316
|
+
</fieldset>
|
|
317
|
+
</td>
|
|
318
|
+
</tr>
|
|
319
|
+
|
|
320
|
+
<tr>
|
|
321
|
+
<td>
|
|
322
|
+
<fieldset class="move">
|
|
323
|
+
<legend>move</legend>
|
|
324
|
+
<nested-element-with-attribute greetings="World!"></nested-element-with-attribute>
|
|
325
|
+
<div class="text">text originally in the end</div>
|
|
326
|
+
</fieldset>
|
|
327
|
+
</td>
|
|
328
|
+
<td>
|
|
329
|
+
<fieldset class="move">
|
|
330
|
+
<legend>move</legend>
|
|
331
|
+
<nested-element-with-attribute greetings="World!" shadow="open"></nested-element-with-attribute>
|
|
332
|
+
<div class="text">text originally in the end</div>
|
|
333
|
+
</fieldset>
|
|
334
|
+
</td>
|
|
335
|
+
<td>
|
|
336
|
+
<fieldset class="move">
|
|
337
|
+
<legend>move</legend>
|
|
338
|
+
<nested-element-with-attribute greetings="World!" shadow="closed"></nested-element-with-attribute>
|
|
339
|
+
<div class="text">text originally in the end</div>
|
|
340
|
+
</fieldset>
|
|
341
|
+
</td>
|
|
342
|
+
</tr>
|
|
273
343
|
</table>
|
|
274
344
|
</main>
|
|
275
345
|
|
|
276
|
-
<object data="external.html" type="text/html"
|
|
346
|
+
<object nonce="d" data="external.html" type="text/html"></object>
|
|
277
347
|
</body>
|
|
278
348
|
</html>
|
package/external.html
CHANGED
package/npm.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,25 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "decue",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Declarative Custom Elements. Create simple web components with just HTML, parameterized with slots and attributes. With or without shadow-dom.",
|
|
5
5
|
"author": "Jyri-Matti Lähteenmäki <jyri-matti@lahteenmaki.net>",
|
|
6
|
-
"keywords": [
|
|
6
|
+
"keywords": [
|
|
7
|
+
"html",
|
|
8
|
+
"web-component",
|
|
9
|
+
"custom-element"
|
|
10
|
+
],
|
|
7
11
|
"license": "MIT",
|
|
12
|
+
"browserslist": [
|
|
13
|
+
"since 2010"
|
|
14
|
+
],
|
|
8
15
|
"scripts": {
|
|
9
|
-
"test": "
|
|
10
|
-
"
|
|
16
|
+
"test": "npx playwright install && web-test-runner",
|
|
17
|
+
"test:watch": "web-test-runner --watch",
|
|
18
|
+
"lint": "eslint src/",
|
|
19
|
+
"lint:fix": "eslint src/ --fix",
|
|
20
|
+
"compat": "eslint src/ --rule 'compat/compat: error'",
|
|
21
|
+
"dist": "npm test && npm run lint && npm run compat && cp -r src/* dist/ && npm run-script uglify",
|
|
11
22
|
"uglify": "uglifyjs -m eval -o dist/decue.min.js dist/decue.js"
|
|
12
23
|
},
|
|
13
24
|
"repository": {
|
|
14
25
|
"type": "git",
|
|
15
|
-
"url": "
|
|
26
|
+
"url": "https://codeberg.org/jyri-matti/decue.git"
|
|
16
27
|
},
|
|
17
28
|
"devDependencies": {
|
|
18
|
-
"chai": "^4.3.
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
29
|
+
"@esm-bundle/chai": "^4.3.4",
|
|
30
|
+
"@web/test-runner": "^0.18.0",
|
|
31
|
+
"@web/test-runner-playwright": "^0.11.0",
|
|
32
|
+
"browserslist": "^4.28.1",
|
|
33
|
+
"eslint": "^9.39.2",
|
|
34
|
+
"eslint-plugin-compat": "^6.1.0",
|
|
35
|
+
"sinon": "^17.0.0",
|
|
23
36
|
"uglify-js": "^3.15.0"
|
|
24
37
|
}
|
|
25
38
|
}
|