Skip to content

Commit f131a6c

Browse files
Ulysse ARNAUDUlysse ARNAUD
authored andcommitted
updated to 0.3.5
1 parent 629dc78 commit f131a6c

File tree

5 files changed

+27
-10
lines changed

5 files changed

+27
-10
lines changed

build/index.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/index.min.js.gz

1.18 KB
Binary file not shown.

index.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
function init() {
2+
const EVENTS = getAllEventsNames();
3+
24
function getAllEventsNames() {
35
const events = Array.from(Object.keys(window).filter(key => /^on/.test(key)).map(e => e.slice(2)));
46
events.push('hover');
57
return events;
68
}
79

8-
function getAllElementsTagsNames() {
9-
return Array.from(document.querySelectorAll('*')).map(e => e.tagName);
10-
}
11-
1210
function getFullPathToElement(element) {
1311
const path = [];
1412
while (element.tagName !== 'HTML') {
@@ -152,13 +150,13 @@ function init() {
152150
element.className = element.className.replace(_, '').trim();
153151
}
154152
}
153+
154+
document.documentElement.setAttribute('aria-busy', 'false');
155+
155156
const event = new Event('css-in-js-in-html-ready');
156157
document.dispatchEvent(event);
157158
}
158159

159-
const EVENTS = getAllEventsNames();
160-
const ELEMENTS_TAGS = getAllElementsTagsNames();
161-
162160
main();
163161
}
164162
document.addEventListener('DOMContentLoaded', init);

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
{
22
"name": "@ulyssear/css-in-js-in-html",
3-
"version": "0.3.4",
3+
"version": "0.3.5",
44
"description": "CSS-in-JS-in-HTML is a library that allows you to use CSS-in-JS with HTML only.",
55
"main": "build/index.js",
66
"scripts": {
77
"tests": "echo \"Error: no test specified\" && exit 1",
8-
"build": "esbuild index.js --bundle --outfile=build/index.min.js --minify"
8+
"build": "esbuild index.js --bundle --outfile=build/index.min.js --minify",
9+
"compress": "node scripts/compress.js"
910
},
1011
"repository": {
1112
"type": "git",

scripts/compress.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const {
2+
createReadStream,
3+
createWriteStream,
4+
} = require('node:fs');
5+
const process = require('node:process');
6+
const { createGzip } = require('node:zlib');
7+
const { pipeline } = require('node:stream');
8+
9+
const gzip = createGzip();
10+
const source = createReadStream('build/index.min.js');
11+
const destination = createWriteStream('build/index.min.js.gz');
12+
13+
pipeline(source, gzip, destination, (err) => {
14+
if (err) {
15+
console.error('An error occurred:', err);
16+
process.exitCode = 1;
17+
}
18+
});

0 commit comments

Comments
 (0)