nanosplash 3.0.1 → 3.0.2
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/.github/workflows/ci.yml +50 -44
- package/.github/workflows/vitepress.yml +69 -0
- package/.prettierignore +1 -0
- package/.prettierrc +10 -10
- package/README.md +11 -172
- package/bun.lockb +0 -0
- package/coverage/{core/Dom.ts.html → DomUtilities.ts.html} +141 -138
- package/coverage/{core/Service.ts.html → Service.ts.html} +250 -322
- package/coverage/{core/Splash.ts.html → Splash.ts.html} +145 -154
- package/coverage/SplashQueue.ts.html +232 -0
- package/coverage/clover.xml +557 -552
- package/coverage/coverage-final.json +5 -9043
- package/coverage/index.html +53 -23
- package/dist/cjs/ns.cjs +2 -0
- package/dist/es/ns.js +342 -0
- package/dist/iife/ns.iife.js +2 -0
- package/docs/.vitepress/config.ts +75 -0
- package/docs/.vitepress/theme/css/style.css +157 -0
- package/docs/.vitepress/theme/index.ts +16 -0
- package/docs/.vitepress/theme/vue/Card.vue +31 -0
- package/docs/.vitepress/theme/vue/CardGrid.vue +17 -0
- package/docs/.vitepress/theme/vue/Exe.vue +86 -0
- package/docs/.vitepress/theme/vue/PlayGround.vue +50 -0
- package/docs/api/doc/hide.md +69 -0
- package/docs/api/doc/show.md +47 -0
- package/docs/api/start/features.md +17 -0
- package/docs/api/start/install.md +53 -0
- package/docs/api/start/playground.md +11 -0
- package/docs/api/start/usage.md +25 -0
- package/docs/index.md +30 -0
- package/package.json +86 -87
- package/src/style/ns.sass +95 -0
- package/src/ts/core/{Dom.ts → DomUtilities.ts} +58 -57
- package/src/ts/core/Service.ts +66 -90
- package/src/ts/core/ServiceInterface.ts +5 -7
- package/src/ts/core/Splash.ts +23 -26
- package/src/ts/core/SplashInterface.ts +12 -20
- package/src/ts/core/SplashQueue.ts +49 -0
- package/src/ts/types/Types.ts +0 -9
- package/tests/{Dom.spec.ts → DomUtilities.spec.ts} +13 -23
- package/tests/Guid.spec.ts +3 -3
- package/tests/Service.spec.ts +146 -67
- package/tests/Splash.spec.ts +26 -26
- package/tests/TestUtilities.ts +48 -0
- package/tsconfig.json +1 -0
- package/vite.config.ts +1 -15
- package/coverage/core/index.html +0 -146
- package/coverage/types/Types.ts.html +0 -121
- package/coverage/types/index.html +0 -116
- package/dist/latest/cjs/ns.cjs +0 -1
- package/dist/latest/cjs/style.css +0 -1
- package/dist/latest/es/ns.js +0 -306
- package/dist/latest/es/style.css +0 -1
- package/dist/latest/iife/ns.iife.js +0 -4
- package/dist/versioned/3.0.1/cjs/ns.cjs +0 -1
- package/dist/versioned/3.0.1/cjs/style.css +0 -1
- package/dist/versioned/3.0.1/es/ns.js +0 -306
- package/dist/versioned/3.0.1/es/style.css +0 -1
- package/dist/versioned/3.0.1/iife/ns.iife.js +0 -2
- package/docs/index.6d66a821.js +0 -1
- package/docs/index.74dbd99e.css +0 -1
- package/docs/index.f34144dc.js +0 -1
- package/docs/index.html +0 -107
- package/index.html +0 -105
- package/src/sass/ns.sass +0 -95
- package/vite.demo.config.ts +0 -16
package/tests/Service.spec.ts
CHANGED
|
@@ -1,119 +1,198 @@
|
|
|
1
|
-
// @ts-strict
|
|
2
|
-
|
|
3
|
-
import { JSDOM } from 'jsdom'
|
|
4
1
|
import { beforeEach, expect, describe, it } from 'vitest'
|
|
5
|
-
import { getRecycledNS } from '../src/ts/core/Dom'
|
|
6
2
|
import { Service } from '../src/ts/core/Service'
|
|
7
3
|
import { Splash } from '../src/ts/core/Splash'
|
|
4
|
+
import { GUIDString } from '../src/ts/types/Types'
|
|
5
|
+
import { ExpectedParsedValues, div, resetDOM } from './TestUtilities'
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
resetDOM()
|
|
8
|
+
|
|
9
|
+
declare global {
|
|
10
|
+
interface Window {
|
|
11
|
+
ns: Service
|
|
12
|
+
}
|
|
13
|
+
}
|
|
13
14
|
|
|
15
|
+
describe('NanosplashService', () => {
|
|
14
16
|
// Reset the DOM before each test
|
|
15
17
|
beforeEach(() => {
|
|
16
|
-
|
|
17
|
-
// @ts-ignore
|
|
18
|
-
globalThis.window = dom.window
|
|
19
|
-
globalThis.document = dom.window.document
|
|
20
|
-
globalThis.DOMParser = dom.window.DOMParser
|
|
21
|
-
globalThis.Node = dom.window.Node
|
|
22
|
-
globalThis.Element = dom.window.Element
|
|
18
|
+
resetDOM()
|
|
23
19
|
})
|
|
24
20
|
|
|
25
21
|
it('Should be able to create an instance', () => {
|
|
22
|
+
const nss = Service.getInstance()
|
|
26
23
|
expect(nss).toBeInstanceOf(Service)
|
|
27
24
|
})
|
|
28
25
|
|
|
29
|
-
it('Should be
|
|
26
|
+
it('Should be a valid singleton instance', () => {
|
|
30
27
|
const nss1 = Service.getInstance()
|
|
31
28
|
const nss2 = Service.getInstance()
|
|
32
29
|
expect(nss1).toBe(nss2)
|
|
33
30
|
})
|
|
34
31
|
|
|
35
|
-
it('Should be able to start the service', () => {
|
|
32
|
+
it('Should be able to start the service and attach it to Window', () => {
|
|
36
33
|
Service.start()
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
it('Should be able to retrieve an existing Nanosplash instance from a destination node', () => {
|
|
41
|
-
const destinationNode = document.createElement('div')
|
|
42
|
-
document.body.appendChild(destinationNode)
|
|
43
|
-
destinationNode.id = 'test-id'
|
|
44
|
-
const nsInstance1 = getRecycledNS(destinationNode) as Splash
|
|
45
|
-
expect(nsInstance1).toBeNull()
|
|
46
|
-
let nsId = nss.showInside('erroneous-selector', 'Hello World!')
|
|
47
|
-
expect(nsId).toBeNull()
|
|
48
|
-
nsId = nss.showInside('div[id="test-id"]', 'Hello World!')
|
|
49
|
-
const nsInstance2 = getRecycledNS(destinationNode)
|
|
50
|
-
expect(nsInstance2).toBeInstanceOf(Splash)
|
|
51
|
-
expect(nsInstance2?.getId()).toBe(nsId)
|
|
34
|
+
const nss = Service.getInstance()
|
|
35
|
+
expect(nss).toBe(window.ns)
|
|
52
36
|
})
|
|
53
37
|
|
|
54
38
|
it('Should be able to show a Nanosplash in the browser window', () => {
|
|
55
39
|
const text = 'Hello World!'
|
|
56
|
-
const
|
|
40
|
+
const nss = Service.getInstance()
|
|
41
|
+
const nsId = <GUIDString>nss.show(text)
|
|
42
|
+
|
|
43
|
+
// Compare the elements:
|
|
57
44
|
const element = document.getElementById(nsId)
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
const splash = nss.nsQueue.get(nsId)
|
|
46
|
+
expect(element).toBe(splash?.getElement())
|
|
47
|
+
|
|
48
|
+
// Compare the text:
|
|
49
|
+
const nsText = splash?.getTextElement().innerText
|
|
61
50
|
expect(nsText).toBe(text)
|
|
62
51
|
})
|
|
63
52
|
|
|
64
53
|
it('Should be able to show a Nanosplash over a given element', () => {
|
|
54
|
+
const id = 'test-id'
|
|
65
55
|
const text = 'Hello World!'
|
|
66
56
|
const destination = document.createElement('div')
|
|
67
|
-
|
|
57
|
+
|
|
58
|
+
// Assign ID and append to DOM
|
|
59
|
+
destination.id = id
|
|
68
60
|
document.body.appendChild(destination)
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
|
|
62
|
+
const nss = Service.getInstance()
|
|
63
|
+
|
|
64
|
+
// Show Splash inside element
|
|
65
|
+
const nsId = nss.showInside(`#${id}`, text)
|
|
66
|
+
|
|
67
|
+
// Get element from DOM with the same ID
|
|
68
|
+
const element = document.getElementById(<string>nsId)
|
|
69
|
+
|
|
70
|
+
// Get Splash instance from NS Service with the same ID
|
|
71
|
+
const ns = nss.nsQueue.get(<string>nsId)
|
|
72
|
+
|
|
73
|
+
// Compare the two
|
|
74
|
+
expect(element).toBe(ns?.getElement())
|
|
75
|
+
|
|
76
|
+
// Compare the text
|
|
77
|
+
const nsText = ns?.getTextElement().innerText
|
|
74
78
|
expect(nsText).toBe(text)
|
|
75
79
|
})
|
|
76
80
|
|
|
77
|
-
it('Should be able to hide a
|
|
78
|
-
const
|
|
81
|
+
it('Should be able to hide a Splash', () => {
|
|
82
|
+
const nss = Service.getInstance()
|
|
83
|
+
const nsId = <GUIDString>nss.show()
|
|
84
|
+
nss.hide()
|
|
85
|
+
const splash = nss.nsQueue.get(nsId)
|
|
86
|
+
expect(splash).toBeUndefined()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('Should be able to hide multiple Splashes in FIFO-order', () => {
|
|
90
|
+
document.body.append(div('a'), div('b'), div('c'))
|
|
91
|
+
|
|
92
|
+
const nss = Service.getInstance()
|
|
93
|
+
const a = nss.showInside('#a', 'A')
|
|
94
|
+
const b = nss.showInside('#b', 'B')
|
|
95
|
+
const c = nss.showInside('#c', 'C')
|
|
96
|
+
|
|
97
|
+
expect(nss.nsQueue.queue.length).toBe(3)
|
|
98
|
+
|
|
79
99
|
nss.hide()
|
|
80
|
-
|
|
81
|
-
expect(
|
|
100
|
+
expect(nss.nsQueue.queue.length).toBe(2)
|
|
101
|
+
expect(nss.nsQueue.get(a as string)).toBeUndefined()
|
|
102
|
+
expect(nss.nsQueue.get(b as string)).toBeInstanceOf(Splash)
|
|
103
|
+
expect(nss.nsQueue.get(c as string)).toBeInstanceOf(Splash)
|
|
104
|
+
|
|
105
|
+
nss.hide()
|
|
106
|
+
expect(nss.nsQueue.queue.length).toBe(1)
|
|
107
|
+
expect(nss.nsQueue.get(a as string)).toBeUndefined()
|
|
108
|
+
expect(nss.nsQueue.get(b as string)).toBeUndefined()
|
|
109
|
+
expect(nss.nsQueue.get(c as string)).toBeInstanceOf(Splash)
|
|
110
|
+
|
|
111
|
+
nss.hide()
|
|
112
|
+
expect(nss.nsQueue.queue.length).toBe(0)
|
|
113
|
+
expect(nss.nsQueue.get(a as string)).toBeUndefined()
|
|
114
|
+
expect(nss.nsQueue.get(b as string)).toBeUndefined()
|
|
115
|
+
expect(nss.nsQueue.get(c as string)).toBeUndefined()
|
|
82
116
|
})
|
|
83
117
|
|
|
84
118
|
it('Should be able to hide all Nanosplashes', () => {
|
|
85
|
-
const div = (id: string) => {
|
|
86
|
-
const d = document.createElement('div')
|
|
87
|
-
d.id = id
|
|
88
|
-
return d
|
|
89
|
-
}
|
|
90
119
|
document.body.append(div('a'), div('b'), div('c'))
|
|
91
|
-
|
|
92
|
-
|
|
120
|
+
|
|
121
|
+
const nss = Service.getInstance()
|
|
122
|
+
|
|
123
|
+
nss.hideAll() // Reset the queue
|
|
124
|
+
expect(nss.nsQueue.queue.length).toBe(0)
|
|
125
|
+
|
|
126
|
+
// Add three Nanosplashes to the queue
|
|
93
127
|
nss.showInside('#a', 'A')
|
|
94
128
|
nss.showInside('#b', 'B')
|
|
95
129
|
nss.showInside('#c', 'C')
|
|
96
|
-
|
|
130
|
+
|
|
131
|
+
// Expect the queue to have three items
|
|
132
|
+
expect(nss.nsQueue.queue.length).toBe(3)
|
|
133
|
+
|
|
134
|
+
// Hide all Nanosplashes
|
|
97
135
|
nss.hideAll()
|
|
98
|
-
|
|
136
|
+
|
|
137
|
+
// Expect the queue to be empty
|
|
138
|
+
expect(nss.nsQueue.queue.length).toBe(0)
|
|
99
139
|
})
|
|
100
140
|
|
|
101
141
|
it('Should be able to hide a Nanosplash based on its ID', () => {
|
|
102
|
-
const
|
|
142
|
+
const nss = Service.getInstance()
|
|
143
|
+
const nsId = <GUIDString>nss.show()
|
|
103
144
|
nss.hideId(nsId)
|
|
104
|
-
const
|
|
105
|
-
expect(
|
|
145
|
+
const splash = nss.nsQueue.get(nsId)
|
|
146
|
+
expect(splash).toBeUndefined()
|
|
106
147
|
})
|
|
107
148
|
|
|
108
149
|
it('Should be able to hide a Nanosplash residing inside a given element', () => {
|
|
109
|
-
const
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
nsId = <
|
|
116
|
-
|
|
117
|
-
|
|
150
|
+
const id = 'test-id'
|
|
151
|
+
const parent = document.createElement('div')
|
|
152
|
+
parent.id = id
|
|
153
|
+
document.body.appendChild(parent)
|
|
154
|
+
|
|
155
|
+
const nss = Service.getInstance()
|
|
156
|
+
const nsId = <GUIDString>nss.showInside(`#${id}`)
|
|
157
|
+
|
|
158
|
+
// Confirm existence.
|
|
159
|
+
const element = document.getElementById(<string>nsId)
|
|
160
|
+
expect(element?.parentElement).toBe(parent)
|
|
161
|
+
|
|
162
|
+
// Hide using API.
|
|
163
|
+
nss.hideInside(`#${id}`)
|
|
164
|
+
|
|
165
|
+
// Confirm non-existence.
|
|
166
|
+
expect(element?.isConnected).toBe(false)
|
|
167
|
+
expect(nss.nsQueue.get(nsId)).toBeUndefined()
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
it('Should take any argument as text without breaking', () => {
|
|
171
|
+
const nss = Service.getInstance()
|
|
172
|
+
|
|
173
|
+
// Destructure the expected values
|
|
174
|
+
const {
|
|
175
|
+
numValues,
|
|
176
|
+
arrValues,
|
|
177
|
+
objValues,
|
|
178
|
+
boolValues,
|
|
179
|
+
nullValues,
|
|
180
|
+
undefValues,
|
|
181
|
+
} = ExpectedParsedValues
|
|
182
|
+
|
|
183
|
+
// Create functions to test the values
|
|
184
|
+
const testValues = (raw: any, parsed: any) => {
|
|
185
|
+
const id = <GUIDString>nss.show(raw)
|
|
186
|
+
const value = nss.nsQueue.get(id)?.getTextElement().innerText
|
|
187
|
+
expect(value).toBe(parsed)
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Test the values
|
|
191
|
+
testValues(numValues.raw, numValues.parsed)
|
|
192
|
+
testValues(arrValues.raw, arrValues.parsed)
|
|
193
|
+
testValues(objValues.raw, objValues.parsed)
|
|
194
|
+
testValues(boolValues.raw, boolValues.parsed)
|
|
195
|
+
testValues(nullValues.raw, nullValues.parsed)
|
|
196
|
+
testValues(undefValues.raw, undefValues.parsed)
|
|
118
197
|
})
|
|
119
198
|
})
|
package/tests/Splash.spec.ts
CHANGED
|
@@ -1,51 +1,49 @@
|
|
|
1
|
-
// @ts-strict
|
|
2
|
-
|
|
3
1
|
import { describe, it, expect, beforeEach } from 'vitest'
|
|
4
|
-
import { JSDOM } from 'jsdom'
|
|
5
2
|
import { Splash } from '../src/ts/core/Splash'
|
|
3
|
+
import { resetDOM } from './TestUtilities'
|
|
4
|
+
|
|
5
|
+
resetDOM()
|
|
6
6
|
|
|
7
7
|
describe('Splash', () => {
|
|
8
8
|
// Reset the DOM before each test
|
|
9
9
|
beforeEach(() => {
|
|
10
|
-
|
|
11
|
-
// @ts-ignore
|
|
12
|
-
globalThis.window = dom.window
|
|
13
|
-
globalThis.document = dom.window.document
|
|
14
|
-
globalThis.DOMParser = dom.window.DOMParser
|
|
10
|
+
resetDOM()
|
|
15
11
|
})
|
|
16
12
|
|
|
17
|
-
it('Should be a valid Splash', () => {
|
|
13
|
+
it('Should be a valid Splash element', () => {
|
|
18
14
|
const ns = new Splash()
|
|
19
|
-
const element = ns.
|
|
15
|
+
const element = ns.getElement() as HTMLElement
|
|
20
16
|
|
|
17
|
+
// The element should be a valid HTMLDivElement
|
|
21
18
|
expect(element).not.toBeUndefined()
|
|
22
|
-
expect(element
|
|
23
|
-
expect(element.classList.contains(Splash.NSClass)).toBe(true)
|
|
19
|
+
expect(element).toBeInstanceOf(HTMLDivElement)
|
|
24
20
|
|
|
25
|
-
|
|
26
|
-
expect(
|
|
27
|
-
|
|
28
|
-
const textElement = ns.getNSTextElement()
|
|
29
|
-
expect(textElement).not.toBeUndefined()
|
|
21
|
+
// The element and the splash instance should have the same ID
|
|
22
|
+
expect(element.id).toBe(ns.getId())
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
expect(
|
|
24
|
+
// The element should have the main Nanosplash CSS class
|
|
25
|
+
expect(element.classList.contains(Splash.NSClass)).toBe(true)
|
|
33
26
|
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
// The element should have the correct, inner structure
|
|
28
|
+
const textSelector = '.nsc > .nst'
|
|
29
|
+
const spinnerSelector = '.nsc > .nss'
|
|
30
|
+
const textElement = element.querySelector(textSelector)
|
|
31
|
+
const spinnerElement = element.querySelector(spinnerSelector)
|
|
32
|
+
expect(textElement).not.toBeNull()
|
|
33
|
+
expect(spinnerElement).not.toBeNull()
|
|
36
34
|
})
|
|
37
35
|
|
|
38
36
|
it('Should be able to set text', () => {
|
|
39
37
|
const ns = new Splash()
|
|
40
38
|
const text = 'Hello World!'
|
|
41
39
|
ns.setText(text)
|
|
42
|
-
expect(ns.
|
|
40
|
+
expect(ns.getTextElement().innerText).toBe(text)
|
|
43
41
|
})
|
|
44
42
|
|
|
45
43
|
it('Should be able to hide text', () => {
|
|
46
44
|
const ns = new Splash()
|
|
47
45
|
ns.hideText()
|
|
48
|
-
expect(ns.
|
|
46
|
+
expect(ns.getTextElement().style.display).toBe('none')
|
|
49
47
|
})
|
|
50
48
|
|
|
51
49
|
it('Should be able to show text', () => {
|
|
@@ -53,12 +51,14 @@ describe('Splash', () => {
|
|
|
53
51
|
ns.setText('Hello World!')
|
|
54
52
|
ns.hideText()
|
|
55
53
|
ns.showText()
|
|
56
|
-
expect(ns.
|
|
54
|
+
expect(ns.getTextElement().style.display).toBe('flex')
|
|
57
55
|
})
|
|
58
56
|
|
|
59
57
|
it('Should be able to remove itself from DOM', () => {
|
|
60
58
|
const ns = new Splash()
|
|
61
|
-
ns.
|
|
62
|
-
|
|
59
|
+
const deleteResult = ns.delete()
|
|
60
|
+
const element = ns.getElement()
|
|
61
|
+
expect(deleteResult).toBe(true)
|
|
62
|
+
expect(element).toBeNull()
|
|
63
63
|
})
|
|
64
64
|
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { JSDOM } from 'jsdom'
|
|
2
|
+
import { Service } from '../src/ts/core/Service'
|
|
3
|
+
|
|
4
|
+
export function resetDOM() {
|
|
5
|
+
const dom = new JSDOM()
|
|
6
|
+
// @ts-ignore
|
|
7
|
+
globalThis.window = dom.window
|
|
8
|
+
globalThis.document = dom.window.document
|
|
9
|
+
globalThis.DOMParser = dom.window.DOMParser
|
|
10
|
+
globalThis.Node = dom.window.Node
|
|
11
|
+
globalThis.Element = dom.window.Element
|
|
12
|
+
globalThis.HTMLElement = dom.window.HTMLElement
|
|
13
|
+
globalThis.HTMLDivElement = dom.window.HTMLDivElement
|
|
14
|
+
Service.getInstance().hideAll()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function div(id: string): HTMLDivElement {
|
|
18
|
+
const div = document.createElement('div')
|
|
19
|
+
div.id = id
|
|
20
|
+
return div
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ExpectedParsedValues = {
|
|
24
|
+
numValues: {
|
|
25
|
+
raw: 123,
|
|
26
|
+
parsed: '123',
|
|
27
|
+
},
|
|
28
|
+
arrValues: {
|
|
29
|
+
raw: [1, 2, 3],
|
|
30
|
+
parsed: '1,2,3',
|
|
31
|
+
},
|
|
32
|
+
objValues: {
|
|
33
|
+
raw: {},
|
|
34
|
+
parsed: '[object Object]',
|
|
35
|
+
},
|
|
36
|
+
boolValues: {
|
|
37
|
+
raw: true,
|
|
38
|
+
parsed: 'true',
|
|
39
|
+
},
|
|
40
|
+
nullValues: {
|
|
41
|
+
raw: null,
|
|
42
|
+
parsed: '',
|
|
43
|
+
},
|
|
44
|
+
undefValues: {
|
|
45
|
+
raw: undefined,
|
|
46
|
+
parsed: '',
|
|
47
|
+
},
|
|
48
|
+
}
|
package/tsconfig.json
CHANGED
package/vite.config.ts
CHANGED
|
@@ -1,30 +1,16 @@
|
|
|
1
1
|
import { LibraryFormats, defineConfig } from 'vite'
|
|
2
|
-
import { version } from './package.json'
|
|
3
|
-
import { resolve } from 'path'
|
|
4
2
|
|
|
5
|
-
const dist = 'dist'
|
|
6
|
-
const versioned = process.env?.versioned ?? false
|
|
7
3
|
const format = (process.env?.format ?? '') as LibraryFormats
|
|
8
4
|
const entry = (process.env?.entry ?? '') as string
|
|
9
5
|
|
|
10
|
-
const outDirFolders = [dist]
|
|
11
|
-
if (versioned) {
|
|
12
|
-
outDirFolders.push('versioned', version, format)
|
|
13
|
-
} else {
|
|
14
|
-
outDirFolders.push('latest', format)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const outDir = resolve(__dirname, ...outDirFolders)
|
|
18
|
-
|
|
19
6
|
export default defineConfig({
|
|
20
7
|
build: {
|
|
21
|
-
outDir
|
|
8
|
+
outDir: `dist/${format}`,
|
|
22
9
|
lib: {
|
|
23
10
|
entry,
|
|
24
11
|
name: 'Nanosplash',
|
|
25
12
|
formats: [format] as LibraryFormats[],
|
|
26
13
|
fileName: 'ns',
|
|
27
14
|
},
|
|
28
|
-
cssCodeSplit: format === 'iife',
|
|
29
15
|
},
|
|
30
16
|
})
|
package/coverage/core/index.html
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html lang="en">
|
|
4
|
-
|
|
5
|
-
<head>
|
|
6
|
-
<title>Code coverage report for core</title>
|
|
7
|
-
<meta charset="utf-8" />
|
|
8
|
-
<link rel="stylesheet" href="../prettify.css" />
|
|
9
|
-
<link rel="stylesheet" href="../base.css" />
|
|
10
|
-
<link rel="shortcut icon" type="image/x-icon" href="../favicon.png" />
|
|
11
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
|
-
<style type='text/css'>
|
|
13
|
-
.coverage-summary .sorter {
|
|
14
|
-
background-image: url(../sort-arrow-sprite.png);
|
|
15
|
-
}
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
|
|
19
|
-
<body>
|
|
20
|
-
<div class='wrapper'>
|
|
21
|
-
<div class='pad1'>
|
|
22
|
-
<h1><a href="../index.html">All files</a> core</h1>
|
|
23
|
-
<div class='clearfix'>
|
|
24
|
-
|
|
25
|
-
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">99.8% </span>
|
|
27
|
-
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>518/519</span>
|
|
29
|
-
</div>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">91.54% </span>
|
|
34
|
-
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>65/71</span>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">100% </span>
|
|
41
|
-
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>42/42</span>
|
|
43
|
-
</div>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">99.8% </span>
|
|
48
|
-
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>518/519</span>
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</div>
|
|
54
|
-
<p class="quiet">
|
|
55
|
-
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
|
56
|
-
</p>
|
|
57
|
-
<template id="filterTemplate">
|
|
58
|
-
<div class="quiet">
|
|
59
|
-
Filter:
|
|
60
|
-
<input oninput="onInput()" type="search" id="fileSearch">
|
|
61
|
-
</div>
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
<div class='status-line high'></div>
|
|
65
|
-
<div class="pad1">
|
|
66
|
-
<table class="coverage-summary">
|
|
67
|
-
<thead>
|
|
68
|
-
<tr>
|
|
69
|
-
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
|
70
|
-
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
|
71
|
-
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
|
72
|
-
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
73
|
-
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
|
74
|
-
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
75
|
-
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
|
76
|
-
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
77
|
-
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
|
78
|
-
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
|
79
|
-
</tr>
|
|
80
|
-
</thead>
|
|
81
|
-
<tbody><tr>
|
|
82
|
-
<td class="file high" data-value="Dom.ts"><a href="Dom.ts.html">Dom.ts</a></td>
|
|
83
|
-
<td data-value="100" class="pic high">
|
|
84
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
85
|
-
</td>
|
|
86
|
-
<td data-value="100" class="pct high">100%</td>
|
|
87
|
-
<td data-value="160" class="abs high">160/160</td>
|
|
88
|
-
<td data-value="86.36" class="pct high">86.36%</td>
|
|
89
|
-
<td data-value="22" class="abs high">19/22</td>
|
|
90
|
-
<td data-value="100" class="pct high">100%</td>
|
|
91
|
-
<td data-value="11" class="abs high">11/11</td>
|
|
92
|
-
<td data-value="100" class="pct high">100%</td>
|
|
93
|
-
<td data-value="160" class="abs high">160/160</td>
|
|
94
|
-
</tr>
|
|
95
|
-
|
|
96
|
-
<tr>
|
|
97
|
-
<td class="file high" data-value="Service.ts"><a href="Service.ts.html">Service.ts</a></td>
|
|
98
|
-
<td data-value="99.57" class="pic high">
|
|
99
|
-
<div class="chart"><div class="cover-fill" style="width: 99%"></div><div class="cover-empty" style="width: 1%"></div></div>
|
|
100
|
-
</td>
|
|
101
|
-
<td data-value="99.57" class="pct high">99.57%</td>
|
|
102
|
-
<td data-value="235" class="abs high">234/235</td>
|
|
103
|
-
<td data-value="90.62" class="pct high">90.62%</td>
|
|
104
|
-
<td data-value="32" class="abs high">29/32</td>
|
|
105
|
-
<td data-value="100" class="pct high">100%</td>
|
|
106
|
-
<td data-value="19" class="abs high">19/19</td>
|
|
107
|
-
<td data-value="99.57" class="pct high">99.57%</td>
|
|
108
|
-
<td data-value="235" class="abs high">234/235</td>
|
|
109
|
-
</tr>
|
|
110
|
-
|
|
111
|
-
<tr>
|
|
112
|
-
<td class="file high" data-value="Splash.ts"><a href="Splash.ts.html">Splash.ts</a></td>
|
|
113
|
-
<td data-value="100" class="pic high">
|
|
114
|
-
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
|
115
|
-
</td>
|
|
116
|
-
<td data-value="100" class="pct high">100%</td>
|
|
117
|
-
<td data-value="124" class="abs high">124/124</td>
|
|
118
|
-
<td data-value="100" class="pct high">100%</td>
|
|
119
|
-
<td data-value="17" class="abs high">17/17</td>
|
|
120
|
-
<td data-value="100" class="pct high">100%</td>
|
|
121
|
-
<td data-value="12" class="abs high">12/12</td>
|
|
122
|
-
<td data-value="100" class="pct high">100%</td>
|
|
123
|
-
<td data-value="124" class="abs high">124/124</td>
|
|
124
|
-
</tr>
|
|
125
|
-
|
|
126
|
-
</tbody>
|
|
127
|
-
</table>
|
|
128
|
-
</div>
|
|
129
|
-
<div class='push'></div><!-- for sticky footer -->
|
|
130
|
-
</div><!-- /wrapper -->
|
|
131
|
-
<div class='footer quiet pad2 space-top1 center small'>
|
|
132
|
-
Code coverage generated by
|
|
133
|
-
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
134
|
-
at 2023-09-06T08:51:33.390Z
|
|
135
|
-
</div>
|
|
136
|
-
<script src="../prettify.js"></script>
|
|
137
|
-
<script>
|
|
138
|
-
window.onload = function () {
|
|
139
|
-
prettyPrint();
|
|
140
|
-
};
|
|
141
|
-
</script>
|
|
142
|
-
<script src="../sorter.js"></script>
|
|
143
|
-
<script src="../block-navigation.js"></script>
|
|
144
|
-
</body>
|
|
145
|
-
</html>
|
|
146
|
-
|