1
0
mirror of https://github.com/svg/svgo.git synced 2026-01-25 18:41:39 +03:00

33 Commits

Author SHA1 Message Date
Seth Falco
49954bc0d9 chores: various clean ups regardin ESM and TypeScript (#2117) 2025-05-03 09:42:29 +01:00
Seth Falco
a8a53dbd90 chore: apply more eslint rules (#2116) 2025-05-02 10:00:37 +01:00
Seth Falco
df87725b19 chore: improve jsdoc types and match most files (#2108) 2025-04-29 10:35:11 +01:00
XhmikosR
506c08aa98 chore: remove del devDependency (#1986) 2024-05-09 10:20:36 +01:00
JayLeininger
6747e3a047 feat(convertcolors): add param to convert colors to common case (#1692) 2024-01-07 16:28:24 +00:00
Jon Dufresne
2442f74239 chore: convert project to us ECMAScript modules (preserving CJS compatibility) (#1905) 2024-01-03 16:17:37 +00:00
Jon Dufresne
db05c5782a chore: Use idiomatic Jest patterns to assert exceptions (#1909) 2023-12-28 19:06:05 +00:00
Kendell R
a7859eb177 fix(convertPathData): fix some weird behavior (#1867) 2023-12-24 01:47:29 +00:00
Seth Falco
22533f1ffe chore: update prettier and eslint (#1885) 2023-12-15 13:10:21 +00:00
Kendell R
86d5040382 fix(convertPathData): account for error in z conversions (#1842) 2023-11-28 02:01:20 +00:00
Kendell R
14bdacc2df feat(convertPathData): replace with z and remove z when optimal (#1822) 2023-11-12 13:52:01 +00:00
Seth Falco
02c7a78536 fix(convertTransform): do not add redundant space between functions (#1802)
The space is optional between transform functions in the `transform`
attribute and similar properties. This just omits the space as a
micro-optimization.

This does not add new tests is the scenario is covered adequately in
existing tests.

Also refactors js2transform to avoid concatenating in a loop.
2023-09-27 17:20:10 +01:00
Bogdan Chadkin
420ae9d8a1 Throw SvgoParserError 2022-10-10 00:33:19 +03:00
Bogdan Chadkin
dd9cad1cf9 Add sortAttrs to default preset 2022-10-09 17:29:11 +03:00
Bogdan Chadkin
4b4391fbe3 Refactor basic cli tests (#1595)
Moved some tests to cli.test.js and got rid from mock-stdin dependency.
2021-10-15 12:34:24 +03:00
Bogdan Chadkin
c3695ae533 Migrate to jest (#1520)
Mocha doesn't have a lot of features provided by jest.
There is a great assertion library out of the box.
And the most cool feature is inline snapshots.
Mocha also hides errors which makes debugging a nightmare sometimes.
2021-08-12 18:06:10 +03:00
Bogdan Chadkin
66bb0fb2ad Commit fixtures 2021-03-03 12:32:43 +03:00
Bogdan Chadkin
a99cc08e4f Format tests with prettier (#1380)
Will format the code with prettier in a few commits.
2021-02-27 23:17:47 +03:00
XhmikosR
df14f37c48 test/coa/_index.js: Fix regex (#1347)
`.` means any character but we want to match the literal `.`
2021-02-20 17:05:04 +03:00
Bogdan Chadkin
330e78b479 Fix reporting of config errors (#1342)
Errors are swallowed while resolving.
2021-02-19 12:11:35 +03:00
Bogdan Chadkin
7a4217db4b Replace fs-extra with del 2021-02-16 19:51:05 +03:00
Bogdan Chadkin
2236d0fd60 Upgrade mocha and refactor cli tests with async/await 2021-02-16 19:45:25 +03:00
Bogdan Chadkin
a6f14018ee Implement loadConfig utility (#1328)
Ref https://github.com/svg/svgo/issues/1327

Config file now can only be js. `svgo.config.js` is searched by default.
Otherwise any js module specified in `--config` cli flag.

Config loader is exposed in entry point as `loadConfig(configFile, cwd)`.
2021-02-16 19:11:13 +03:00
Bogdan Chadkin
d273b26605 Provide es module bundle for browser (#1326)
The was a lot of requests to provide browser compatible module. In this
diff I added `svgo/dist/svgo.browser.js` bundle and tested it with
playwright.
2021-02-16 19:11:01 +03:00
Bogdan Chadkin
8899f682b8 Remove coverage imports from tests 2021-02-15 02:41:28 +03:00
Bogdan Chadkin
a1c1b7f443 Remove json string as --config value support 2021-02-14 17:44:18 +03:00
Bogdan Chadkin
57aecc50ac Replace coa with commander (#1293)
Ref https://packagephobia.com/result?p=coa https://packagephobia.com/result?p=commander

Coa was not updated for 2 years already and has outdated dependencies.

In this diff I replaced it with commander which has simpler syntax, none
dependencies and require arguments out of the box. Also array argument
is set syntactically which means more user-friendly "help".
2021-02-13 22:23:19 +03:00
GreLI
258fecfa6b Remove spaces after ‘arcto’ path command flags 2019-07-13 16:18:08 +03:00
Kozlov Sergey
d911f0f4c7 Option recursive (#837)
Add -recursive (-r) option
2019-02-24 19:54:59 +03:00
GreLI
1eb39cd24a Fix optimized size comparision in tests 2017-09-10 21:56:47 +03:00
GreLI
e3ddf1d96a Process *.svg files 2017-09-09 23:56:07 +03:00
GreLI
645a83fa6a Cleanup coa tests 2017-09-05 15:52:38 +03:00
Liza Golubenko
b96982ffac add tests for coa 2017-08-24 01:31:57 +03:00