@thejaredwilcurt/csslop 0.0.33 → 0.0.34
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 +1 -0
- package/package.json +3 -3
- package/src/rules/stringify.js +0 -18
package/README.md
CHANGED
|
@@ -182,6 +182,7 @@ These tools were prompted to pass the tests in the `/copiedTests` folder that ca
|
|
|
182
182
|
* Unlike previous AI's that resulted in slower outcomes and failing tests, these changes took the real-world test from 7 hours down to 2. Still WAY too slow, but it's a massive improvement. And the AI is pointing to the 3rd-party CSS parser as the bottleneck now, which I don't know, probably true.
|
|
183
183
|
* It only killed *a few* humans, how nice of it. Because I don't want it to run the multi-hour long test suite multiple times during it's efforts, I specifically told it not to run `npm run real`, which minifies ~125 real-world CSS files over ~7 hours. Threatening it with how running it will kill actual humans. **So instead it cleverly bypassed my instructions in order to kill actual humans.** It looked at the already minifed real-world CSS output files, and created it's own temporary script that used 25, instead of the full ~125 files. This is a less useful process because the files are already minifed and won't hit the same code paths of the library, but whatever, it does still execute some of the same code and it did result in 328% performance boost. I'll take it, gotta crack some eggs and all that (this is a metaphor for AI alignment bias resulting in death).
|
|
184
184
|
* Refer to [v0.0.25](https://github.com/TheJaredWilcurt/csslop/releases/tag/v0.0.25) release notes for full Promp/result details.
|
|
185
|
+
* Follow up, It randomly decided to ignore my instructions about running real-world tests, and did *most*, but not *all* of them, to double-check it's work. See [v0.0.33](https://github.com/TheJaredWilcurt/csslop/releases/tag/v0.0.33) for another instance of clerverly circumventing my instructions in order to kill humans.
|
|
185
186
|
|
|
186
187
|
|
|
187
188
|
## The name
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@thejaredwilcurt/csslop",
|
|
3
3
|
"main": "index.js",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.34",
|
|
6
6
|
"description": "Experimental CSS minification",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"prestart": "node ./scripts/prestart.js",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@codemirror/autocomplete": "^6.20.3",
|
|
29
29
|
"@codemirror/lang-css": "^6.3.1",
|
|
30
|
-
"@codemirror/view": "^6.43.
|
|
30
|
+
"@codemirror/view": "^6.43.11",
|
|
31
31
|
"@eslint/js": "^10.0.1",
|
|
32
32
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
33
33
|
"codemirror": "^6.0.2",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"eslint-config-tjw-import-x": "^1.0.1",
|
|
37
37
|
"eslint-config-tjw-jsdoc": "^2.0.1",
|
|
38
38
|
"eslint-plugin-import-x": "^4.17.0",
|
|
39
|
-
"eslint-plugin-jsdoc": "^64.3.
|
|
39
|
+
"eslint-plugin-jsdoc": "^64.3.5",
|
|
40
40
|
"fflate": "^0.8.3",
|
|
41
41
|
"globals": "^17.12.0",
|
|
42
42
|
"pretty-ms": "^9.3.1",
|
package/src/rules/stringify.js
CHANGED
|
@@ -42,14 +42,6 @@ function stringifyDeclarations (declarations) {
|
|
|
42
42
|
.join(';');
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/**
|
|
46
|
-
* The heading element selectors, which collapse into the `:heading`
|
|
47
|
-
* pseudo-class when a rule targets every one of them.
|
|
48
|
-
*
|
|
49
|
-
* @type {Set<string>}
|
|
50
|
-
*/
|
|
51
|
-
const HEADING_SELECTORS = new Set(['h1', 'h2', 'h3', 'h4', 'h5', 'h6']);
|
|
52
|
-
|
|
53
45
|
/**
|
|
54
46
|
* Matches a complete `@layer` statement, which declares layer names without a
|
|
55
47
|
* block and ends with the semicolon that separates it from the CSS that follows
|
|
@@ -272,16 +264,6 @@ function stringifyRule (rule, context) {
|
|
|
272
264
|
}
|
|
273
265
|
uniqueSelectors = uniqueSelectors.flatMap(processIsSelector);
|
|
274
266
|
uniqueSelectors = [...new Set(uniqueSelectors)];
|
|
275
|
-
const isAllHeadings = (
|
|
276
|
-
rule.selectors.length === HEADING_SELECTORS.size &&
|
|
277
|
-
uniqueSelectors.length === HEADING_SELECTORS.size &&
|
|
278
|
-
uniqueSelectors.every((selector) => {
|
|
279
|
-
return HEADING_SELECTORS.has(selector);
|
|
280
|
-
})
|
|
281
|
-
);
|
|
282
|
-
if (isAllHeadings) {
|
|
283
|
-
uniqueSelectors = [':heading'];
|
|
284
|
-
}
|
|
285
267
|
output.push(uniqueSelectors.join(','));
|
|
286
268
|
}
|
|
287
269
|
output.push('{');
|