@projectwallace/format-css 2.1.1 → 2.2.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/dist/format-css.js +203 -181
- package/dist/index.d.ts +8 -21
- package/package.json +64 -59
package/dist/format-css.js
CHANGED
|
@@ -1,196 +1,218 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
function ne(y, {
|
|
7
|
-
minify: O = !1,
|
|
8
|
-
tab_size: S = void 0
|
|
9
|
-
} = /* @__PURE__ */ Object.create(null)) {
|
|
10
|
-
if (S !== void 0 && Number(S) < 1)
|
|
1
|
+
import { parse as X, NODE_TYPES as l, ATTR_FLAG_CASE_INSENSITIVE as z, ATTR_FLAG_CASE_SENSITIVE as tt, ATTR_OPERATOR_EQUAL as et, ATTR_OPERATOR_STAR_EQUAL as rt, ATTR_OPERATOR_DOLLAR_EQUAL as st, ATTR_OPERATOR_CARET_EQUAL as it, ATTR_OPERATOR_PIPE_EQUAL as lt, ATTR_OPERATOR_TILDE_EQUAL as nt } from "@projectwallace/css-parser";
|
|
2
|
+
const f = " ", c = "", k = ":", b = ";", $ = '"', P = "(", N = ")", ut = "[", ct = "]", w = "{", g = "}", D = ",";
|
|
3
|
+
function pt(R, { minify: O = !1, tab_size: L = void 0 } = /* @__PURE__ */ Object.create(null)) {
|
|
4
|
+
if (L !== void 0 && Number(L) < 1)
|
|
11
5
|
throw new TypeError("tab_size must be a number greater than 0");
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
onComment: (n, e) => {
|
|
18
|
-
T.push(e.start.offset, e.end.offset);
|
|
6
|
+
const E = O ? c : `
|
|
7
|
+
`, p = O ? c : f, M = O ? c : b;
|
|
8
|
+
let A = [], d = X(R, {
|
|
9
|
+
on_comment: ({ start: t, end: e }) => {
|
|
10
|
+
A.push(t, e);
|
|
19
11
|
}
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
let s = 0;
|
|
24
|
-
function i(n) {
|
|
25
|
-
return O === !0 ? c : S !== void 0 ? a.repeat(S * n) : " ".repeat(n);
|
|
26
|
-
}
|
|
27
|
-
function P(n) {
|
|
28
|
-
let e = n.loc;
|
|
29
|
-
return e == null ? c : y.slice(e.start.offset, e.end.offset);
|
|
12
|
+
}), a = 0;
|
|
13
|
+
function o(t) {
|
|
14
|
+
return O === !0 ? c : L !== void 0 ? f.repeat(L * t) : " ".repeat(t);
|
|
30
15
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
16
|
+
function _(t, e, r = a) {
|
|
17
|
+
if (O || t === void 0 || e === void 0)
|
|
18
|
+
return c;
|
|
19
|
+
let s = c;
|
|
20
|
+
for (let i = 0; i < A.length; i += 2) {
|
|
21
|
+
let n = A[i];
|
|
22
|
+
if (n === void 0 || n < t) continue;
|
|
23
|
+
let u = A[i + 1];
|
|
24
|
+
if (u === void 0 || u > e) break;
|
|
25
|
+
s.length > 0 && (s += E + o(r)), s += R.slice(n, u);
|
|
26
|
+
}
|
|
27
|
+
return s;
|
|
28
|
+
}
|
|
29
|
+
function Q(t) {
|
|
30
|
+
return t.replace(/(?:^['"])|(?:['"]$)/g, c);
|
|
31
|
+
}
|
|
32
|
+
function m(t) {
|
|
33
|
+
return t = (t == null ? void 0 : t.toString()) || "", $ + Q(t) + $;
|
|
34
|
+
}
|
|
35
|
+
function B(t) {
|
|
36
|
+
let e = [], r = t.text, s = r.charCodeAt(0);
|
|
37
|
+
return s === 43 || s === 45 ? e.push(f) : s !== 44 && e.push(p), e.push(r), s === 43 || s === 45 ? e.push(f) : e.push(p), e.join(c);
|
|
38
|
+
}
|
|
39
|
+
function S(t) {
|
|
40
|
+
var r, s;
|
|
41
|
+
let e = [];
|
|
42
|
+
for (let i of t) {
|
|
43
|
+
if (i.type === l.FUNCTION) {
|
|
44
|
+
let n = i.name.toLowerCase();
|
|
45
|
+
e.push(n, P), e.push(S(i.children)), e.push(N);
|
|
46
|
+
} else i.type === l.DIMENSION ? e.push(i.value, (r = i.unit) == null ? void 0 : r.toLowerCase()) : i.type === l.STRING ? e.push(m(i.text)) : i.type === l.OPERATOR ? e.push(B(i)) : i.type === l.PARENTHESIS ? e.push(P, S(i.children), N) : i.type === l.URL && typeof i.value == "string" ? (e.push("url("), e.push(m(i.value)), e.push(N)) : e.push(i.text);
|
|
47
|
+
i.type !== l.OPERATOR && i.has_next && ((s = i.next_sibling) == null ? void 0 : s.type) !== l.OPERATOR && e.push(f);
|
|
48
|
+
}
|
|
49
|
+
return e.join(c);
|
|
33
50
|
}
|
|
34
|
-
function
|
|
35
|
-
return
|
|
51
|
+
function H(t) {
|
|
52
|
+
return t === null ? c : S(t);
|
|
36
53
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
function F(t) {
|
|
55
|
+
let e = [];
|
|
56
|
+
if (t.is_important) {
|
|
57
|
+
let i = t.text, n = i.endsWith(b), u = i.lastIndexOf("!"), T = n ? -1 : void 0;
|
|
58
|
+
e.push(p, i.slice(u, T).toLowerCase());
|
|
59
|
+
}
|
|
60
|
+
let r = H(t.value), s = t.property;
|
|
61
|
+
return s === "font" && (r = r.replace(/\s*\/\s*/, "/")), r === c && O === !0 && (r += f), s.startsWith("--") || (s = s.toLowerCase()), s + k + p + r + e.join(c);
|
|
62
|
+
}
|
|
63
|
+
function G(t) {
|
|
64
|
+
switch (t) {
|
|
65
|
+
case nt:
|
|
66
|
+
return "~=";
|
|
67
|
+
case lt:
|
|
68
|
+
return "|=";
|
|
69
|
+
case it:
|
|
70
|
+
return "^=";
|
|
71
|
+
case st:
|
|
72
|
+
return "$=";
|
|
73
|
+
case rt:
|
|
74
|
+
return "*=";
|
|
75
|
+
case et:
|
|
76
|
+
default:
|
|
77
|
+
return "=";
|
|
47
78
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case "Combinator": {
|
|
73
|
-
e += a, r.name !== " " && (e += r.name + a);
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
case "PseudoClassSelector":
|
|
77
|
-
case "PseudoElementSelector": {
|
|
78
|
-
e += $;
|
|
79
|
-
let l = C(r.name);
|
|
80
|
-
(l === "before" || l === "after" || r.type === "PseudoElementSelector") && (e += $), e += l, r.children !== null && (e += I + A(r) + v);
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
case Q: {
|
|
84
|
-
r.children.forEach((l, f) => {
|
|
85
|
-
l.type === Y && (e += A(l)), f.next !== null && f.next.data.type === Y && (e += Z + p);
|
|
86
|
-
});
|
|
87
|
-
break;
|
|
88
|
-
}
|
|
89
|
-
case "Nth": {
|
|
90
|
-
let l = r.nth;
|
|
91
|
-
if (l.type === "AnPlusB") {
|
|
92
|
-
let f = l.a, o = l.b;
|
|
93
|
-
f !== null && (e += f + "n"), f !== null && o !== null && (e += a), o !== null && (f !== null && !o.startsWith("-") && (e += "+" + a), e += o);
|
|
94
|
-
} else
|
|
95
|
-
e += P(l);
|
|
96
|
-
r.selector !== null && (e += a + "of" + a + A(r.selector));
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
99
|
-
case "AttributeSelector": {
|
|
100
|
-
e += ee, e += r.name.name, r.matcher !== null && r.value !== null && (e += r.matcher, e += g, r.value.type === "String" ? e += r.value.value : r.value.type === "Identifier" && (e += r.value.name), e += g), r.flags !== null && (e += a + r.flags), e += te;
|
|
101
|
-
break;
|
|
102
|
-
}
|
|
103
|
-
case "NestingSelector": {
|
|
104
|
-
e += "&";
|
|
105
|
-
break;
|
|
106
|
-
}
|
|
107
|
-
default: {
|
|
108
|
-
e += P(r);
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
79
|
+
}
|
|
80
|
+
function I(t) {
|
|
81
|
+
let e = [], r = t.nth_a, s = t.nth_b;
|
|
82
|
+
return r && e.push(r), r && s && e.push(p), s && (r && !s.startsWith("-") && e.push("+", p), e.push(parseFloat(s))), e.join(c);
|
|
83
|
+
}
|
|
84
|
+
function Y(t) {
|
|
85
|
+
var r, s;
|
|
86
|
+
let e = [];
|
|
87
|
+
return ((r = t.children[0]) == null ? void 0 : r.type) === l.NTH_SELECTOR && (e.push(I(t.children[0])), e.push(f, "of", f)), ((s = t.children[1]) == null ? void 0 : s.type) === l.SELECTOR_LIST && e.push(y(t.children[1])), e.join(c);
|
|
88
|
+
}
|
|
89
|
+
function W(t, e = !1) {
|
|
90
|
+
switch (t.type) {
|
|
91
|
+
case l.TYPE_SELECTOR:
|
|
92
|
+
return t.name.toLowerCase();
|
|
93
|
+
case l.COMBINATOR: {
|
|
94
|
+
let r = t.text;
|
|
95
|
+
return /^\s+$/.test(r) ? f : (e ? c : p) + r + p;
|
|
96
|
+
}
|
|
97
|
+
case l.PSEUDO_ELEMENT_SELECTOR:
|
|
98
|
+
case l.PSEUDO_CLASS_SELECTOR: {
|
|
99
|
+
let r = [k], s = t.name.toLowerCase();
|
|
100
|
+
return (s === "before" || s === "after" || t.type === l.PSEUDO_ELEMENT_SELECTOR) && r.push(k), r.push(s), t.has_children && (r.push(P), t.children.length > 0 && (s === "highlight" ? r.push(S(t.children)) : r.push(y(t))), r.push(N)), r.join(c);
|
|
111
101
|
}
|
|
112
|
-
|
|
102
|
+
case l.ATTRIBUTE_SELECTOR: {
|
|
103
|
+
let r = [ut, t.name.toLowerCase()];
|
|
104
|
+
return t.attr_operator && (r.push(G(t.attr_operator)), typeof t.value == "string" && r.push(m(t.value)), t.attr_flags === z ? r.push(f, "i") : t.attr_flags === tt && r.push(f, "s")), r.push(ct), r.join(c);
|
|
105
|
+
}
|
|
106
|
+
default:
|
|
107
|
+
return t.text;
|
|
108
|
+
}
|
|
113
109
|
}
|
|
114
|
-
function
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
return
|
|
110
|
+
function v(t) {
|
|
111
|
+
if (t.type === l.NTH_SELECTOR)
|
|
112
|
+
return I(t);
|
|
113
|
+
if (t.type === l.NTH_OF_SELECTOR)
|
|
114
|
+
return Y(t);
|
|
115
|
+
if (t.type === l.SELECTOR_LIST)
|
|
116
|
+
return y(t);
|
|
117
|
+
if (t.type === l.LANG_SELECTOR)
|
|
118
|
+
return m(t.text);
|
|
119
|
+
let e = [];
|
|
120
|
+
return t.children.forEach((r, s) => {
|
|
121
|
+
const i = W(r, s === 0);
|
|
122
|
+
e.push(i);
|
|
123
|
+
}), e.join(c);
|
|
124
|
+
}
|
|
125
|
+
function y(t) {
|
|
126
|
+
let e = [];
|
|
127
|
+
for (let r of t)
|
|
128
|
+
e.push(v(r)), r.has_next && e.push(D, p);
|
|
129
|
+
return e.join(c);
|
|
130
|
+
}
|
|
131
|
+
function K(t) {
|
|
132
|
+
let e = [], r;
|
|
133
|
+
for (let s of t) {
|
|
134
|
+
if (r !== void 0) {
|
|
135
|
+
let n = _(r, s.start);
|
|
136
|
+
n && e.push(o(a) + n);
|
|
137
|
+
}
|
|
138
|
+
let i = v(s);
|
|
139
|
+
s.has_next && (i += D), e.push(o(a) + i), r = s.end;
|
|
119
140
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
141
|
+
return e.join(E);
|
|
142
|
+
}
|
|
143
|
+
function x(t) {
|
|
144
|
+
var T;
|
|
145
|
+
let e = [];
|
|
146
|
+
a++;
|
|
147
|
+
let r = t.children;
|
|
148
|
+
if (r.length === 0) {
|
|
149
|
+
let h = _(t.start, t.end);
|
|
150
|
+
if (h)
|
|
151
|
+
return e.push(o(a) + h), a--, e.push(o(a) + g), e.join(E);
|
|
152
|
+
}
|
|
153
|
+
let s = r[0], i = _(t.start, s == null ? void 0 : s.start);
|
|
154
|
+
i && e.push(o(a) + i);
|
|
155
|
+
let n;
|
|
156
|
+
for (let h of r) {
|
|
157
|
+
if (n !== void 0) {
|
|
158
|
+
let C = _(n, h.start);
|
|
159
|
+
C && e.push(o(a) + C);
|
|
129
160
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
e.
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
function
|
|
156
|
-
let e =
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
let n = m(0, b(L.first));
|
|
174
|
-
n && (_ += n + u), L.forEach((t, r) => {
|
|
175
|
-
if (t.type === F ? _ += M(t) : t.type === j ? _ += U(t) : _ += R(t, s), r.next !== null) {
|
|
176
|
-
_ += u;
|
|
177
|
-
let l = m(E(t), b(r.next.data));
|
|
178
|
-
l && (_ += i(s) + l), _ += u;
|
|
161
|
+
let Z = ((T = h.next_sibling) == null ? void 0 : T.type) !== l.DECLARATION;
|
|
162
|
+
if (h.type === l.DECLARATION) {
|
|
163
|
+
let C = F(h), J = Z ? M : b;
|
|
164
|
+
e.push(o(a) + C + J);
|
|
165
|
+
} else h.type === l.STYLE_RULE ? (n !== void 0 && e.length !== 0 && e.push(c), e.push(j(h))) : h.type === l.AT_RULE && (n !== void 0 && e.length !== 0 && e.push(c), e.push(o(a) + U(h)));
|
|
166
|
+
n = h.end;
|
|
167
|
+
}
|
|
168
|
+
let u = _(n, t.end);
|
|
169
|
+
return u && e.push(o(a) + u), a--, e.push(o(a) + g), e.join(E);
|
|
170
|
+
}
|
|
171
|
+
function j(t) {
|
|
172
|
+
var r, s;
|
|
173
|
+
let e = [];
|
|
174
|
+
if (((r = t.first_child) == null ? void 0 : r.type) === l.SELECTOR_LIST) {
|
|
175
|
+
let i = K(t.first_child), n = _(t.first_child.end, (s = t.block) == null ? void 0 : s.start);
|
|
176
|
+
n && (i += E + o(a) + n), i += p + w, t.block && (t.block.has_children || _(t.block.start, t.block.end)) || (i += g), e.push(i);
|
|
177
|
+
}
|
|
178
|
+
return t.block && (t.block.has_children || _(t.block.start, t.block.end)) && e.push(x(t.block)), e.join(E);
|
|
179
|
+
}
|
|
180
|
+
function V(t) {
|
|
181
|
+
return t.replace(/\s*([:,])/g, t.toLowerCase().includes("selector(") ? "$1" : "$1 ").replace(/\)([a-zA-Z])/g, ") $1").replace(/\s*(=>|<=)\s*/g, " $1 ").replace(/([^<>=\s])([<>])([^<>=\s])/g, `$1${p}$2${p}$3`).replace(/\s+/g, p).replace(/calc\(\s*([^()+\-*/]+)\s*([*/+-])\s*([^()+\-*/]+)\s*\)/g, (e, r, s, i) => {
|
|
182
|
+
let n = s === "+" || s === "-" ? f : p;
|
|
183
|
+
return `calc(${r.trim()}${n}${s}${n}${i.trim()})`;
|
|
184
|
+
}).replace(/selector|url|supports|layer\(/gi, (e) => e.toLowerCase());
|
|
185
|
+
}
|
|
186
|
+
function U(t) {
|
|
187
|
+
let e = [], r = ["@", t.name.toLowerCase()];
|
|
188
|
+
return t.prelude && r.push(f, V(t.prelude.text)), t.block === null ? r.push(b) : (r.push(p, w), !t.block.is_empty || _(t.block.start, t.block.end) || r.push(g)), e.push(r.join(c)), t.block !== null && (!t.block.is_empty || _(t.block.start, t.block.end)) && e.push(x(t.block)), e.join(E);
|
|
189
|
+
}
|
|
190
|
+
function q(t) {
|
|
191
|
+
let e = [], r = t.children;
|
|
192
|
+
if (r.length === 0)
|
|
193
|
+
return _(0, t.end, 0);
|
|
194
|
+
let s = r[0];
|
|
195
|
+
if (s) {
|
|
196
|
+
let u = _(0, s.start, 0);
|
|
197
|
+
u && e.push(u);
|
|
198
|
+
}
|
|
199
|
+
let i;
|
|
200
|
+
for (let u of t) {
|
|
201
|
+
if (i !== void 0) {
|
|
202
|
+
let T = _(i, u.start, 0);
|
|
203
|
+
T && e.push(T);
|
|
179
204
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
} else
|
|
187
|
-
_ += m(0, E(k));
|
|
188
|
-
return _;
|
|
205
|
+
u.type === l.STYLE_RULE ? e.push(j(u)) : u.type === l.AT_RULE && e.push(U(u)), i = u.end, u.has_next && (u.next_sibling && _(u.end, u.next_sibling.start, 0) || e.push(c));
|
|
206
|
+
}
|
|
207
|
+
let n = _(i, t.end, 0);
|
|
208
|
+
return n && e.push(n), e.join(E);
|
|
209
|
+
}
|
|
210
|
+
return q(d).trimEnd();
|
|
189
211
|
}
|
|
190
|
-
function
|
|
191
|
-
return
|
|
212
|
+
function _t(R) {
|
|
213
|
+
return pt(R, { minify: !0 });
|
|
192
214
|
}
|
|
193
215
|
export {
|
|
194
|
-
|
|
195
|
-
|
|
216
|
+
pt as format,
|
|
217
|
+
_t as minify
|
|
196
218
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
|
+
export type FormatOptions = {
|
|
2
|
+
/** Whether to minify the CSS or keep it formatted */
|
|
3
|
+
minify?: boolean;
|
|
4
|
+
/** Tell the formatter to use N spaces instead of tabs */
|
|
5
|
+
tab_size?: number;
|
|
6
|
+
};
|
|
1
7
|
/**
|
|
2
|
-
* @typedef {Object} Options
|
|
3
|
-
* @property {boolean} [minify] Whether to minify the CSS or keep it formatted
|
|
4
|
-
* @property {number} [tab_size] Tell the formatter to use N spaces instead of tabs
|
|
5
|
-
*
|
|
6
8
|
* Format a string of CSS using some simple rules
|
|
7
|
-
* @param {string} css The original CSS
|
|
8
|
-
* @param {Options} [options]
|
|
9
|
-
* @returns {string} The formatted CSS
|
|
10
9
|
*/
|
|
11
|
-
export function format(css: string, { minify, tab_size
|
|
10
|
+
export declare function format(css: string, { minify, tab_size }?: FormatOptions): string;
|
|
12
11
|
/**
|
|
13
12
|
* Minify a string of CSS
|
|
14
13
|
* @param {string} css The original CSS
|
|
15
14
|
* @returns {string} The minified CSS
|
|
16
15
|
*/
|
|
17
|
-
export function minify(css: string): string;
|
|
18
|
-
export type Options = {
|
|
19
|
-
/**
|
|
20
|
-
* Whether to minify the CSS or keep it formatted
|
|
21
|
-
*/
|
|
22
|
-
minify?: boolean | undefined;
|
|
23
|
-
/**
|
|
24
|
-
* Tell the formatter to use N spaces instead of tabs
|
|
25
|
-
*
|
|
26
|
-
* Format a string of CSS using some simple rules
|
|
27
|
-
*/
|
|
28
|
-
tab_size?: number | undefined;
|
|
29
|
-
};
|
|
16
|
+
export declare function minify(css: string): string;
|
package/package.json
CHANGED
|
@@ -1,60 +1,65 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
2
|
+
"name": "@projectwallace/format-css",
|
|
3
|
+
"version": "2.2.0",
|
|
4
|
+
"description": "Fast, small, zero-config library to format or minify CSS with basic rules.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/projectwallace/format-css.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/projectwallace/format-css",
|
|
10
|
+
"issues": "https://github.com/projectwallace/format-css/issues",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "Bart Veneman <bart@projectwallace.com>",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=18.0.0"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "./dist/format-css.js",
|
|
18
|
+
"exports": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"default": "./dist/format-css.js"
|
|
21
|
+
},
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "vite build",
|
|
25
|
+
"test": "vitest --coverage",
|
|
26
|
+
"check": "tsc",
|
|
27
|
+
"prettier": "prettier --check index.ts test/**/*.ts",
|
|
28
|
+
"lint": "oxlint",
|
|
29
|
+
"lint-package": "publint"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@codecov/vite-plugin": "^1.9.1",
|
|
33
|
+
"@vitest/coverage-v8": "^4.0.3",
|
|
34
|
+
"c8": "^10.1.3",
|
|
35
|
+
"oxlint": "^1.24.0",
|
|
36
|
+
"prettier": "^3.6.2",
|
|
37
|
+
"publint": "^0.3.15",
|
|
38
|
+
"typescript": "^5.9.3",
|
|
39
|
+
"vite": "^6.2.6",
|
|
40
|
+
"vite-plugin-dts": "^4.5.4",
|
|
41
|
+
"vitest": "^4.0.3"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"dist"
|
|
45
|
+
],
|
|
46
|
+
"keywords": [
|
|
47
|
+
"css",
|
|
48
|
+
"stylesheet",
|
|
49
|
+
"formatter",
|
|
50
|
+
"format",
|
|
51
|
+
"print",
|
|
52
|
+
"prettifier",
|
|
53
|
+
"pretty",
|
|
54
|
+
"prettier"
|
|
55
|
+
],
|
|
56
|
+
"prettier": {
|
|
57
|
+
"semi": false,
|
|
58
|
+
"useTabs": true,
|
|
59
|
+
"printWidth": 140,
|
|
60
|
+
"singleQuote": true
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@projectwallace/css-parser": "^0.12.2"
|
|
64
|
+
}
|
|
65
|
+
}
|