redgin 0.1.7 → 0.1.9
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 +40 -107
- package/dist/redgin.min.js +2 -2
- package/package.json +2 -3
- package/tsconfig.json +0 -110
package/README.md
CHANGED
|
@@ -1,74 +1,48 @@
|
|
|
1
1
|
# RedGin
|
|
2
|
-
# Simplified library for building [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components)
|
|
2
|
+
# ~5.3kb Simplified library for building [Web Components](https://developer.mozilla.org/en-US/docs/Web/Web_Components), works on Vanilla JS / all JS framework
|
|
3
3
|
|
|
4
|
-
* Javascript [Template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) for Template syntax
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Use Javascript [Template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) for Template syntax
|
|
5
|
+
* Rerender element with [<code>watch</code>](https://stackblitz.com/edit/typescript-t3fqo8?file=sampleWatch.ts)
|
|
6
|
+
* Create getter/setters with [<code>getset</code>](https://stackblitz.com/edit/typescript-t3fqo8?file=sampleWatch.ts)
|
|
7
|
+
* Create Property reflection with [<code>propReflect</code>](https://stackblitz.com/edit/typescript-hlms7u?file=index.html)
|
|
8
|
+
* Create Inline Events with [<code>event</code>](https://stackblitz.com/edit/typescript-t3fqo8?file=sampleWatch.ts)
|
|
9
|
+
* Create custom events with [<code>emit</code>](https://stackblitz.com/edit/redgin-childtoparent?file=index.ts)
|
|
10
|
+
* Inject Global Styles with [<code>injectStyles</code>](https://stackblitz.com/edit/redgin-bootstrap?file=index.ts)
|
|
11
|
+
* [Support Typescript](https://stackblitz.com/edit/typescript-ue61k6?file=index.ts)
|
|
9
12
|
|
|
10
13
|
|
|
11
|
-
##
|
|
14
|
+
## Install
|
|
12
15
|
|
|
13
|
-
|
|
16
|
+
### Plug & Play, Import directly from cdn
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
20
|
-
<title>RedGin</title>
|
|
21
|
-
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
|
|
22
|
-
</head>
|
|
23
|
-
<body>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
<script type="module">
|
|
27
|
-
|
|
28
|
-
/* to handle flicker add spinner?? */
|
|
29
|
-
document.body.innerHTML = `
|
|
30
|
-
<div class="spinner-grow" role="status">
|
|
31
|
-
<span class="visually-hidden">Loading...</span>
|
|
32
|
-
</div>
|
|
33
|
-
`
|
|
34
|
-
|
|
35
|
-
import("https://josnin.sgp1.cdn.digitaloceanspaces.com/redgin/redgin.min.js")
|
|
36
|
-
.then( ({ injectStyles }) => {
|
|
37
|
-
/*
|
|
38
|
-
* inject global styles to all components
|
|
39
|
-
*/
|
|
40
|
-
injectStyles.push('<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">')
|
|
41
|
-
|
|
42
|
-
/* load components */
|
|
43
|
-
import('./bootStrap.js')
|
|
18
|
+
```js
|
|
19
|
+
import { RedGin } from 'https://josnin.sgp1.cdn.digitaloceanspaces.com/redgin/redgin.min.js'
|
|
20
|
+
|
|
21
|
+
```
|
|
44
22
|
|
|
45
|
-
|
|
46
|
-
document.body.innerHTML = `
|
|
47
|
-
<btn-bootstrap></btn-bootstrap>
|
|
48
|
-
`
|
|
23
|
+
### Or Install using NPM
|
|
49
24
|
|
|
50
|
-
|
|
51
|
-
|
|
25
|
+
```js
|
|
26
|
+
npm i redgin
|
|
27
|
+
```
|
|
52
28
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</body>
|
|
56
|
-
</html>
|
|
29
|
+
#### then import the library, helpers
|
|
57
30
|
|
|
31
|
+
```js
|
|
32
|
+
import { Redgin } from 'redgin'
|
|
58
33
|
```
|
|
59
34
|
|
|
60
35
|
|
|
61
|
-
## How to?
|
|
36
|
+
## How to use?
|
|
62
37
|
### Inline Events
|
|
63
|
-
it uses
|
|
38
|
+
it uses <code>event</code> directive to create event listener behind the scene and automatically clear once the component is remove from DOM
|
|
64
39
|
```js
|
|
65
|
-
import { RedGin,
|
|
40
|
+
import { RedGin, event } from 'redgin'
|
|
66
41
|
|
|
67
42
|
class Event extends RedGin {
|
|
68
43
|
render() {
|
|
69
|
-
return `<button ${ click
|
|
70
|
-
}
|
|
71
|
-
|
|
44
|
+
return `<button ${ event('click', () => alert('Click Me') )} >Submit</button>`
|
|
45
|
+
}
|
|
72
46
|
}
|
|
73
47
|
|
|
74
48
|
customElements.define('sample-event', Event);
|
|
@@ -76,14 +50,15 @@ customElements.define('sample-event', Event);
|
|
|
76
50
|
```
|
|
77
51
|
|
|
78
52
|
### List Render (Reactive)
|
|
79
|
-
* dynamically create reactive props define in observedAttributes()
|
|
80
|
-
* its uses watch directives to rerender inside html when value change
|
|
53
|
+
* its uses <code>propReflect</code> to dynamically create reactive props reflection define in observedAttributes()
|
|
54
|
+
* its uses <code>watch</code> directives to rerender inside html when value change
|
|
81
55
|
```js
|
|
82
|
-
import { RedGin, watch } from '
|
|
56
|
+
import { RedGin, watch, propReflect } from 'redgin';
|
|
83
57
|
|
|
84
58
|
class Loop extends RedGin {
|
|
85
59
|
|
|
86
|
-
|
|
60
|
+
arr = propReflect([1, 2, 3])
|
|
61
|
+
static get observedAttributes() { return ['arr'] }
|
|
87
62
|
|
|
88
63
|
render() {
|
|
89
64
|
return `<ul> ${ watch(['arr'], () =>
|
|
@@ -96,49 +71,17 @@ class Loop extends RedGin {
|
|
|
96
71
|
|
|
97
72
|
customElements.define('sample-loop', Loop);
|
|
98
73
|
|
|
99
|
-
```
|
|
100
|
-
#### results
|
|
101
|
-
```html
|
|
102
|
-
|
|
103
|
-
<ul>
|
|
104
|
-
<li>Number: 1</li>
|
|
105
|
-
<li>Number: 2</li>
|
|
106
|
-
<li>Number: 3</li>
|
|
107
|
-
</ul>
|
|
108
|
-
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
### IF condition (Static)
|
|
114
|
-
```js
|
|
115
|
-
import { RedGin } from 'https://josnin.sgp1.cdn.digitaloceanspaces.com/redgin/redgin.min.js';
|
|
116
|
-
|
|
117
|
-
class If extends RedGin {
|
|
118
|
-
isDisabled = true
|
|
119
|
-
|
|
120
|
-
render() {
|
|
121
|
-
return `<button
|
|
122
|
-
${ this.isDisabled ? `disabled` : ``}
|
|
123
|
-
> Submit
|
|
124
|
-
</button>
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
customElements.define('sample-if', If);
|
|
129
|
-
|
|
130
74
|
```
|
|
131
75
|
|
|
132
76
|
### IF condition (Reactive)
|
|
133
|
-
* dynamically create reactive props define in observedAttributes()
|
|
134
|
-
* its uses
|
|
77
|
+
* its uses <code>propReflect</code> to dynamically create reactive props reflection define in observedAttributes()
|
|
78
|
+
* its uses <code>watch</code> directives to rerender inside html when value change
|
|
135
79
|
```js
|
|
136
|
-
import { RedGin, watch } from
|
|
80
|
+
import { RedGin, watch, propReflect } from 'redgin'
|
|
137
81
|
|
|
138
82
|
class If extends RedGin {
|
|
139
|
-
|
|
83
|
+
isDisable = propReflect(false)
|
|
140
84
|
static get observedAttributes() { return ['is-disable']; }
|
|
141
|
-
// dynamically create camelCase props. ie. this.isDisable
|
|
142
85
|
|
|
143
86
|
render() {
|
|
144
87
|
return `
|
|
@@ -177,7 +120,7 @@ render() {
|
|
|
177
120
|
|
|
178
121
|
### Render List of Obj (Reactive)
|
|
179
122
|
```js
|
|
180
|
-
onInit()
|
|
123
|
+
onInit() {
|
|
181
124
|
this.obj = [{id:1, name:'John Doe'}]
|
|
182
125
|
}
|
|
183
126
|
|
|
@@ -190,28 +133,18 @@ render() {
|
|
|
190
133
|
|
|
191
134
|
|
|
192
135
|
|
|
193
|
-
### PropReflect Custom
|
|
194
|
-
Can only define single variable to each attr
|
|
195
|
-
IF define , auto creation of attr props is ignored
|
|
196
|
-
```js
|
|
197
|
-
msg = propReflect('Hello?', { type: String } )
|
|
198
|
-
```
|
|
199
|
-
|
|
200
136
|
## Reference
|
|
201
137
|
https://web.dev/custom-elements-best-practices/
|
|
202
138
|
|
|
203
139
|
https://web.dev/shadowdom-v1/
|
|
204
140
|
|
|
205
|
-
## Installation
|
|
206
|
-
```
|
|
207
|
-
npm install
|
|
208
|
-
```
|
|
209
141
|
|
|
210
142
|
## How to run development server?
|
|
211
143
|
```
|
|
144
|
+
git clone git@github.com:josnin/redgin.git
|
|
212
145
|
cd ~/Documents/redgin/
|
|
213
|
-
npm
|
|
214
|
-
npm
|
|
146
|
+
npm install
|
|
147
|
+
npm run dev
|
|
215
148
|
```
|
|
216
149
|
|
|
217
150
|
## Help
|
package/dist/redgin.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var D=Object.defineProperty;var L=(s,t,e)=>t in s?D(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var d=(s,t,e)=>(L(s,typeof t!="symbol"?t+"":t,e),e);var x=()=>crypto.randomUUID().split("-")[0],v=s=>s.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),u=s=>s.replace(/-./g,t=>t[1].toUpperCase());function A(s){let t=!1;for(let e of p.reg)t=e.call(this,s);return!0}var m=class{static define(t){m.reg.push(t)}},p=m;d(p,"reg",[]);var h={},b=class extends HTMLElement{};customElements.get("in-watch")||customElements.define("in-watch",b);var _=(s,t)=>{let e=document.createElement("in-watch"),o=x();for(let n of s)Object.hasOwn(h,n)||(h[n]={}),h[n][o]=t;return e.dataset.watch__=o,e.outerHTML};function T(s){let t=u(s),e=!1;if(Object.hasOwn(h,t)){for(let o of Object.keys(h[t]))if(this.shadowRoot){let n=this.shadowRoot.querySelector(`[data-watch__="${o}"]`);n&&(n.innerHTML=h[t][o]?h[t][o].call(this):this[t],e=!0)}}return e}p.define(T);var S=()=>crypto.randomUUID().split("-")[0];var U=[],f;(function(s){s[s.ADD=0]="ADD",s[s.REMOVE=1]="REMOVE"})(f||(f={}));var j=(s,t)=>{let e=S();return U.push([s,t,e]),`data-evt__=${e}`};function I(s,t,e){let o={detail:t,composed:!0},n=new CustomEvent(s,{...o,...e});this.shadowRoot&&this.shadowRoot.dispatchEvent(n)}function E(s){for(let t of U){let[e,o,n]=t;if(this.shadowRoot){let i=this.shadowRoot.querySelector(`[data-evt__="${n}"]`);i&&(s===f.ADD?i.addEventListener(e,o):i.removeEventListener(e,o))}}}function R(){E.call(this,f.ADD)}function O(){E.call(this,f.REMOVE)}function $(s,t){for(let e of c.reg)e.call(this,s,t)}var g=class{static define(t){g.reg.push(t)}},c=g;d(c,"reg",[]);var P=["^class$","^style$","^className$","^classList$","^id$","^dataset$","^data-","^aria-"],y=["disabled"],k=s=>{let t=!0;for(let e of P){let o=new RegExp(e,"g");if(s.match(o)){t=!1,console.error(`Please remove attribute '${s}' in the observedAttributes,
|
|
2
2
|
DOM already provided built-in props reflection for this attribute.`);break}}return t};function B(s,t){if(t===void 0||t.name!="propReflect")return;let{type:e,value:o,serializerFn:n,deserializerFn:i}=t,l=this.constructor.observedAttributes,w=u(s),r=v(s);if(l===void 0||!l.includes(r)){console.error(`Unable to apply propReflect '${w}' for attribute '${r}',
|
|
3
|
-
Please add '${r}' in the observedAttributes of ${this.constructor.name} component`);return}!k(r)||Object.defineProperty(this,w,{configurable:!0,set(a){if(i)return i.call(this,r,e,o,a);(e===Boolean||typeof a=="boolean"||y.includes(r))&&a===!0?this.setAttribute(r,""):(e===Boolean||y.includes(r))&&a===!1?this.removeAttribute(r):([Object,Array].includes(e)||["object","array"].includes(typeof a))&&a?this.setAttribute(r,JSON.stringify(a)):([String,Number].includes(e)||["string","number"].includes(typeof a))&&a?this.setAttribute(r,a):this.removeAttribute(r)},get(){if(n)return n.call(this,r,e,o);if(r in y||e===Boolean||typeof o=="boolean")return this.hasAttribute(r);if(([String,Array,Object].includes(e)||["string","array","object"].includes(typeof o))&&!this.hasAttribute(r))return o;if((e===String||typeof o=="string")&&this.hasAttribute(r))return this.getAttribute(r);if((e===Number||typeof o=="number")&&this.hasAttribute(r))return Number(this.getAttribute(r));if(([Array,Object].includes(e)||["array","object"].includes(typeof o))&&this.hasAttribute(r))return JSON.parse(this.getAttribute(r))}})}function M(s,t){return{value:s,...t,name:"propReflect"}}c.define(B);function N(s,t){if(t===void 0||t.name!="getset")return;let{value:e,forWatch:o}=t;this[`#${s}`]=e,Object.defineProperty(this,s,{configurable:!0,set(n){this[`#${s}`]=n,o&&this.updateContents(s)},get(){return this[`#${s}`]}})}function q(s,t){return{value:s,...{forWatch:!0},...t,name:"getset"}}c.define(N);var F={mode:"open",delegatesFocus:!0},H=[],K=[` /* Custom elements are display: inline by default,
|
|
3
|
+
Please add '${r}' in the observedAttributes of ${this.constructor.name} component`);return}!k(r)||Object.defineProperty(this,w,{configurable:!0,set(a){if(i)return i.call(this,r,e,o,a);(e===Boolean||typeof a=="boolean"||y.includes(r))&&a===!0?this.setAttribute(r,""):(e===Boolean||y.includes(r))&&a===!1?this.removeAttribute(r):([Object,Array].includes(e)||["object","array"].includes(typeof a))&&a?this.setAttribute(r,JSON.stringify(a)):([String,Number].includes(e)||["string","number"].includes(typeof a))&&a?this.setAttribute(r,a):this.removeAttribute(r)},get(){if(n)return n.call(this,r,e,o);if(r in y||e===Boolean||typeof o=="boolean")return this.hasAttribute(r);if(([String,Array,Object].includes(e)||["number","string","array","object"].includes(typeof o))&&!this.hasAttribute(r))return o;if((e===String||typeof o=="string")&&this.hasAttribute(r))return this.getAttribute(r);if((e===Number||typeof o=="number")&&this.hasAttribute(r))return Number(this.getAttribute(r));if(([Array,Object].includes(e)||["array","object"].includes(typeof o))&&this.hasAttribute(r))return JSON.parse(this.getAttribute(r))}})}function M(s,t){return{value:s,...t,name:"propReflect"}}c.define(B);function N(s,t){if(t===void 0||t.name!="getset")return;let{value:e,forWatch:o}=t;this[`#${s}`]=e,Object.defineProperty(this,s,{configurable:!0,set(n){this[`#${s}`]=n,o&&this.updateContents(s)},get(){return this[`#${s}`]}})}function q(s,t){return{value:s,...{forWatch:!0},...t,name:"getset"}}c.define(N);var F={mode:"open",delegatesFocus:!0},H=[],K=[` /* Custom elements are display: inline by default,
|
|
4
4
|
* so setting their width or height will have no effect
|
|
5
5
|
*/
|
|
6
6
|
:host { display: block; }
|
|
7
|
-
`],C=class extends HTMLElement{constructor(){super(),this.attachShadow(F)}connectedCallback(){this._onInit(),this._onDoUpdate()}attributeChangedCallback(t,e,o){if(e===o)return;this.updateContents(t)&&this._onUpdated()}disconnectedCallback(){O.call(this)}updateContents(t){return A.call(this,t)}setEventListeners(){R.call(this)}setPropsBehavior(){let t=Object.getOwnPropertyNames(this);for(let e of t){let o=this[e];$.call(this,e,o)}}getStyles(t){let e=[],o=[],n=this.shadowRoot?.adoptedStyleSheets;for(let i of t)if(i.startsWith("<link"))e.push(i);else if(i.startsWith("@import")||!n){let l=document.createElement("style");l.innerHTML=i,e.push(l.outerHTML)}else{let l=new CSSStyleSheet;l.replaceSync(i),o.push(l)}return this.shadowRoot&&o.length>0&&(this.shadowRoot.adoptedStyleSheets=o),e.join("")}_onInit(){this.setPropsBehavior(),this.shadowRoot&&(this.shadowRoot.innerHTML=`
|
|
7
|
+
`],C=class extends HTMLElement{constructor(){super(),this.attachShadow(F)}connectedCallback(){this._onInit(),this._onDoUpdate()}attributeChangedCallback(t,e,o){if(e===o)return;this.updateContents(t)&&this._onUpdated()}disconnectedCallback(){O.call(this)}updateContents(t){return A.call(this,t)}setEventListeners(){R.call(this)}setPropsBehavior(){let t=Object.getOwnPropertyNames(this).filter(e=>e!="styles");for(let e of t){let o=this[e];$.call(this,e,o)}}getStyles(t){let e=[],o=[],n=this.shadowRoot?.adoptedStyleSheets;for(let i of t)if(i.startsWith("<link"))e.push(i);else if(i.startsWith("@import")||!n){let l=document.createElement("style");l.innerHTML=i,e.push(l.outerHTML)}else{let l=new CSSStyleSheet;l.replaceSync(i),o.push(l)}return this.shadowRoot&&o.length>0&&(this.shadowRoot.adoptedStyleSheets=o),e.join("")}_onInit(){this.setPropsBehavior(),this.shadowRoot&&(this.shadowRoot.innerHTML=`
|
|
8
8
|
${this.getStyles(H)}
|
|
9
9
|
${this.getStyles(K)}
|
|
10
10
|
${this.getStyles(this.styles)}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "redgin",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Simplified library for building
|
|
3
|
+
"version": "0.1.9",
|
|
4
|
+
"description": "~5.3kb Simplified library for building Web Components, works on Vanilla JS / all JS framework",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"redgin",
|
|
7
7
|
"web components",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
18
18
|
"build": "tsc -w",
|
|
19
19
|
"bundle": "npx esbuild --bundle src/redgin.js --minify --sourcemap --format=esm --outfile=dist/redgin.min.js --target=es2022",
|
|
20
|
-
"bundle_ts": "npx esbuild --bundle src/redgin.ts --minify --sourcemap --outfile=dist/redgin.min.ts",
|
|
21
20
|
"dev": "node node_modules/vite/bin/vite.js"
|
|
22
21
|
},
|
|
23
22
|
"repository": {
|
package/tsconfig.json
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
/* Visit https://aka.ms/tsconfig to read more about this file */
|
|
4
|
-
|
|
5
|
-
/* Projects */
|
|
6
|
-
// "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
|
|
7
|
-
// "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
|
|
8
|
-
// "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
|
|
9
|
-
// "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
|
|
10
|
-
// "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
|
|
11
|
-
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
|
12
|
-
|
|
13
|
-
/* Language and Environment */
|
|
14
|
-
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
15
|
-
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
|
16
|
-
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
|
17
|
-
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
|
18
|
-
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
|
|
19
|
-
// "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
|
|
20
|
-
// "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
|
|
21
|
-
// "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
|
|
22
|
-
// "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
|
|
23
|
-
// "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
|
|
24
|
-
// "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
|
|
25
|
-
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
|
26
|
-
|
|
27
|
-
/* Modules */
|
|
28
|
-
"module": "es2022", /* Specify what module code is generated. */
|
|
29
|
-
// "rootDir": "./", /* Specify the root folder within your source files. */
|
|
30
|
-
"moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
|
31
|
-
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
|
32
|
-
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
|
33
|
-
"paths": {
|
|
34
|
-
"https://josnin.sgp1.cdn.digitaloceanspaces.com/redgin/redgin.min.js": [
|
|
35
|
-
"./src/redgin.d.ts"
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
|
39
|
-
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
|
|
40
|
-
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
|
41
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
42
|
-
// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
|
|
43
|
-
// "resolveJsonModule": true, /* Enable importing .json files. */
|
|
44
|
-
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
|
|
45
|
-
|
|
46
|
-
/* JavaScript Support */
|
|
47
|
-
// "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
|
|
48
|
-
// "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
|
|
49
|
-
// "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
|
|
50
|
-
|
|
51
|
-
/* Emit */
|
|
52
|
-
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
|
53
|
-
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
|
54
|
-
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
|
55
|
-
// "sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
|
56
|
-
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
|
57
|
-
// "outDir": "./", /* Specify an output folder for all emitted files. */
|
|
58
|
-
// "removeComments": true, /* Disable emitting comments. */
|
|
59
|
-
// "noEmit": true, /* Disable emitting files from a compilation. */
|
|
60
|
-
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
|
61
|
-
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
|
|
62
|
-
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
|
|
63
|
-
// "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
|
|
64
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
65
|
-
// "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
|
|
66
|
-
// "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
|
|
67
|
-
// "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
|
|
68
|
-
// "newLine": "crlf", /* Set the newline character for emitting files. */
|
|
69
|
-
// "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
|
|
70
|
-
// "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
|
|
71
|
-
// "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
|
|
72
|
-
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
|
|
73
|
-
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
|
|
74
|
-
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
|
|
75
|
-
|
|
76
|
-
/* Interop Constraints */
|
|
77
|
-
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
|
78
|
-
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
79
|
-
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
80
|
-
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
|
81
|
-
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
|
82
|
-
|
|
83
|
-
/* Type Checking */
|
|
84
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
85
|
-
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
|
86
|
-
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
|
87
|
-
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
|
88
|
-
// "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
|
|
89
|
-
// "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
|
|
90
|
-
// "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
|
|
91
|
-
// "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
|
|
92
|
-
// "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
|
|
93
|
-
// "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
|
|
94
|
-
// "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
|
|
95
|
-
// "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
|
|
96
|
-
// "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
|
|
97
|
-
// "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
|
|
98
|
-
// "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
|
|
99
|
-
// "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
|
|
100
|
-
// "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
|
|
101
|
-
// "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
|
|
102
|
-
// "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
|
|
103
|
-
|
|
104
|
-
/* Completeness */
|
|
105
|
-
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
|
106
|
-
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
|
107
|
-
},
|
|
108
|
-
"exclude": ["node_modules", "**/node_modules/*"],
|
|
109
|
-
"include": ["src", "dist"]
|
|
110
|
-
}
|