From 45644d16920c97e913a0bb63a5b15869a20d32a3 Mon Sep 17 00:00:00 2001 From: Eric Mika Date: Sat, 7 Sep 2024 13:01:52 -0400 Subject: [PATCH] Dependency updates. ESLint and import sort order style changes. --- package.json | 2 +- pnpm-lock.yaml | 286 ++++++++++-------- scripts/build-cli.ts | 2 +- scripts/build-lib.ts | 2 +- .../esbuild-plugin-iife.extensions.d.ts | 1 + src/cli/cli.ts | 8 +- src/lib/index.ts | 4 +- src/lib/local-tldraw-server.ts | 6 +- src/lib/tldraw-controller.ts | 16 +- src/lib/tldraw-open.ts | 10 +- src/lib/tldraw-to-image.ts | 6 +- src/lib/utilities/log.ts | 1 + src/lib/validation.ts | 2 +- src/tldraw/app.tsx | 6 +- src/tldraw/main.tsx | 2 +- test/api-stability.test.ts | 4 +- test/tldr-to-image.test.ts | 6 +- test/url-to-image.test.ts | 4 +- test/validation.test.ts | 2 +- 19 files changed, 197 insertions(+), 173 deletions(-) diff --git a/package.json b/package.json index f9331ae..043c759 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "yargs": "^17.7.2" }, "devDependencies": { - "@kitschpatrol/shared-config": "^4.7.2", + "@kitschpatrol/shared-config": "^4.7.5", "@sindresorhus/slugify": "^2.2.1", "@tldraw/assets": "2.4.6", "@types/express": "^4.17.21", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c45d57b..cbfab59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -25,8 +25,8 @@ importers: version: 17.7.2 devDependencies: '@kitschpatrol/shared-config': - specifier: ^4.7.2 - version: 4.7.2(cspell@8.13.2)(eslint@8.57.0)(mdat@0.7.2(typescript@5.5.4))(postcss-html@1.7.0)(prettier@3.3.3)(stylelint@16.8.1(typescript@5.5.4))(svelte@4.2.18)(typescript@5.5.4) + specifier: ^4.7.5 + version: 4.7.5(cspell@8.13.2)(eslint@8.57.0)(mdat@0.7.2(typescript@5.5.4))(postcss-html@1.7.0)(prettier@3.3.3)(stylelint@16.8.1(typescript@5.5.4))(svelte-eslint-parser@0.41.0(svelte@4.2.18))(svelte@4.2.18)(typescript@5.5.4) '@sindresorhus/slugify': specifier: ^2.2.1 version: 2.2.1 @@ -674,10 +674,6 @@ packages: resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@eslint/eslintrc@3.1.0': - resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@8.57.0': resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -700,12 +696,12 @@ packages: '@fontsource/inter@5.0.20': resolution: {integrity: sha512-rtw2F7xfM7rJmmnncXnR4ADr5wXsp4GyN1O1jmQJ1PMjAK+bm620/ZkQkeOYOkGoa09OksGinOeMA+Mkt6K9PQ==} - '@html-eslint/eslint-plugin@0.24.1': - resolution: {integrity: sha512-JwNDQBrNIWEPcxgSpla/2jaUXyQCqL7Xp8CmON4Bk5qg8MwiDLXOgjylfVC+tN52i8JeHWMca34I9DqBGRj9Qg==} + '@html-eslint/eslint-plugin@0.26.0': + resolution: {integrity: sha512-ovmAYVN/Wv+OX77FrSSyPxBokOg6hvxuiTRXhbN1rnZ7DwCmHjnvVyDlkTeWQHmuwFF2n8yLu2B/X9AMA9KxNw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - '@html-eslint/parser@0.24.1': - resolution: {integrity: sha512-O13xX/+Ldh0P7VZMpDDYc3XtWiE1cYm5QhVJ0VB5i7D8Q69HrrGN+5BjS17vkCoLTz+3zWWIiJv4oFmyS5LReA==} + '@html-eslint/parser@0.26.0': + resolution: {integrity: sha512-o82iUf7HLV6W48voPByAVTPALlWyF4PR9/2YOUlyXY9Ff7bbu9IdxU9Oc5t82Jwx4kOH5gJiZi3cee+CFB9OBQ==} engines: {node: '>=8.10.0'} '@humanwhocodes/config-array@0.11.14': @@ -852,51 +848,51 @@ packages: resolution: {integrity: sha512-f5DRIOZf7wxogefH03RjMPMdBF7ADTWUMoOs9kaJo06EfwF+aFhMZMDZxHg/Xe12hptN9xoZjGso2fdjapBRIA==} engines: {node: '>=10'} - '@kitschpatrol/cspell-config@4.7.2': - resolution: {integrity: sha512-2wUr13vLmm9/Jw1bLG+mUy14MqC+qkQqYV2sjfKUU3Umqw35mwixwQ2rYSBskHA06bTtLPBIQpICHqBo02mJbw==} + '@kitschpatrol/cspell-config@4.7.5': + resolution: {integrity: sha512-A+KraYUsvGQM3y3mgNUf9dLygfeyMtfHRwk4Cht+0I+L9x3XU6sim43+x3BKs7c8RGuYFCaDZm423T5Dm5ZFow==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true peerDependencies: cspell: ^8.8.4 - '@kitschpatrol/eslint-config@4.7.2': - resolution: {integrity: sha512-SWV135Ohn81r3BPLmqwNcCxijhHMy9pT1pvqvLk695iA61B4URrpQtAqCik+aD4hHNVWHkhpisIjL3FJhDqMjA==} + '@kitschpatrol/eslint-config@4.7.5': + resolution: {integrity: sha512-u6a4FBZVoZwH0oVyXedVZfdPTgoobFB6cC2oPcvWGsN3/6srxAPqi6mbVrdvLh5Tjq8gF+A/1958NvdqvRm6Jw==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true peerDependencies: eslint: ^8.57.0 - '@kitschpatrol/mdat-config@4.7.2': - resolution: {integrity: sha512-nht83QsHdI9i6p024PGDbmPHMs1yVj/tV6bjXv3tKRzqr/RpaKzRgF6tkjeIXGp1LdCODmHd++c4SbVqbclMtQ==} + '@kitschpatrol/mdat-config@4.7.5': + resolution: {integrity: sha512-JrqYJP4RKv+tPR6XW2QUDTh/B4oF8eV020vZN1/1W3ApWxAnz6C/ulN6W18puImLZqD6TspO2o2YPB2bchEwWA==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true peerDependencies: mdat: ^0.7.1 - '@kitschpatrol/prettier-config@4.7.2': - resolution: {integrity: sha512-IKClXOzT8aSx4Wi7Q+fE6A0ZoG3qCB3wbWdDK5iQWTz0qYTaom8noDpiDBrdQcVdUhKpVVfxtOFzWlBxFOpe3w==} + '@kitschpatrol/prettier-config@4.7.5': + resolution: {integrity: sha512-fLKpp6i/2/HPg6kLHFxDhUDOqTa+eQpbDkuAmVSXbNaOuls2iXohktf8eUaKnswPb/PQ5Sd7Gz7uF59dk1BbWA==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true peerDependencies: prettier: ^3.3.1 - '@kitschpatrol/remark-config@4.7.2': - resolution: {integrity: sha512-xRBwD0QMJcu3n5L3Kx2bLVU06ZqTY7aNXQ435gvZXYOKtlNIaKkt8a/TzzZBUi4942IDCSKWrx5/tVLJmvClyA==} + '@kitschpatrol/remark-config@4.7.5': + resolution: {integrity: sha512-uezPpVSuPb8QZfYzWnIgufORkpmA0KxqPNwQjQ8jvVee7qY0t80mCwMIaVWxwB/AsJgmpAwNUqzIAOlNmAc1/A==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true - '@kitschpatrol/repo-config@4.7.2': - resolution: {integrity: sha512-xApzmafRbNxTER91d8XdaP0hYXf/ow/tQckbyz1t8BXbefA1nV6jdunDCT1+k0rZJBhYzpw84NjcVRF9/2Rgzw==} + '@kitschpatrol/repo-config@4.7.5': + resolution: {integrity: sha512-AhpCRYTXAyPEugQfaH81qNNCXDnTqd1WIueBrjSEFVEKBwRJQ4R6QB6Kv0mWTvh6/iKIOLnVtskRp9okSnQH/A==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true - '@kitschpatrol/shared-config@4.7.2': - resolution: {integrity: sha512-Xch/NWA87DJhh5E4w2/B/OZGCvPdlnoqO6wLQF9qq3frOY4Rqui8BTDAqjOSqphx+KOo8DKoQNeOaqNHjVWDyA==} + '@kitschpatrol/shared-config@4.7.5': + resolution: {integrity: sha512-BJwNgv3blO7czI16QIG+bRha7cX1NmqON8sExtDfy1nG035Cq/JH7DmjjYJSwm9oo9DZ8xkh/SZ+DXHGj3eFTA==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true - '@kitschpatrol/stylelint-config@4.7.2': - resolution: {integrity: sha512-DN3jxDXvo5gkKaM8t3egRLYeOGPTXxt215rwVzMXTaCfq5Ju80MYKqYbr41jZQumbH/rsPBW3ptugk9cRvx3Cg==} + '@kitschpatrol/stylelint-config@4.7.5': + resolution: {integrity: sha512-A27SmWFKZFVV5wkcTiLXwhjwhfumtxuPg9ZhBgMR3ZWOfGDQMPYAIL4M5I6r6twrhBt3QGkPgESvgalTwxB/bw==} engines: {node: '>=18.0.0', pnpm: '>=8.0.0'} hasBin: true peerDependencies: @@ -1931,6 +1927,10 @@ packages: resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/scope-manager@8.4.0': + resolution: {integrity: sha512-n2jFxLeY0JmKfUqy3P70rs6vdoPjHK8P/w+zJcV3fk0b0BwRXC/zxRTEnAsgYT7MwdQDt/ZEbtdzdVC+hcpF0A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/type-utils@7.18.0': resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1945,6 +1945,10 @@ packages: resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/types@8.4.0': + resolution: {integrity: sha512-T1RB3KQdskh9t3v/qv7niK6P8yvn7ja1mS7QK7XfRVL6wtZ8/mFs/FHf4fKvTA0rKnqnYxl/uHFNbnEt0phgbw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@typescript-eslint/typescript-estree@7.18.0': resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} engines: {node: ^18.18.0 || >=20.0.0} @@ -1954,16 +1958,35 @@ packages: typescript: optional: true + '@typescript-eslint/typescript-estree@8.4.0': + resolution: {integrity: sha512-kJ2OIP4dQw5gdI4uXsaxUZHRwWAGpREJ9Zq6D5L0BweyOrWsL6Sz0YcAZGWhvKnH7fm1J5YFE1JrQL0c9dd53A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + '@typescript-eslint/utils@7.18.0': resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 + '@typescript-eslint/utils@8.4.0': + resolution: {integrity: sha512-swULW8n1IKLjRAgciCkTCafyTHHfwVQFt8DovmaF69sKbOxTSFMmIZaSHjqO9i/RV0wIblaawhzvtva8Nmm7lQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + '@typescript-eslint/visitor-keys@7.18.0': resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} engines: {node: ^18.18.0 || >=20.0.0} + '@typescript-eslint/visitor-keys@8.4.0': + resolution: {integrity: sha512-zTQD6WLNTre1hj5wp09nBIDiOc2U5r/qmzo7wxPn4ZgAjHql09EofqhF9WF+fZHzL5aCyaIpPcT2hyxl73kr9A==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -2129,9 +2152,6 @@ packages: resolution: {integrity: sha512-Mr2ZakwQ7XUAjp7pAwQWRhhK8mQQ6JAaNWSjmjxil0R8BPioMtQsTLOolGYkji1rcL++3dCqZA3zWqpT+9Ew6g==} engines: {node: '>=4'} - axobject-query@3.1.1: - resolution: {integrity: sha512-goKlv8DZrK9hUh975fnHzhNIO4jUnFCfv/dszV5VwUGDFjI6vQ2VwoyjYjYNEbBE8AH87TduWP5uyDR1D+Iteg==} - axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -2793,12 +2813,12 @@ packages: peerDependencies: eslint: '>=7.0.0' - eslint-config-xo-typescript@4.0.0: - resolution: {integrity: sha512-pmSWzVpvzEjZHG7S/rN34cFXAoe6YbvWFBQSitEXD5CcT2SULfykYl8hcYXss37r5N3SmJYAiO6VlcfkPiDRxg==} + eslint-config-xo-typescript@5.0.0: + resolution: {integrity: sha512-ukAYCKf3p039pRai7hb6xaomZzsKlCjV5qx3NbYe27UC7Nz75If1HcpQL5sNW2b5aH8+Axb6dIIv28+bVtwlVQ==} engines: {node: '>=18'} peerDependencies: - '@typescript-eslint/eslint-plugin': '>=7.0.2' - '@typescript-eslint/parser': '>=7.0.2' + '@typescript-eslint/eslint-plugin': '>=7.16.0' + '@typescript-eslint/parser': '>=7.16.0' eslint: '>=8.56.0' typescript: '>=5.0.0' @@ -2830,11 +2850,11 @@ packages: resolution: {integrity: sha512-6qmlJsc40D2m3Dn9oEH+0PAOkJhxVu0f5sVItqpCE0YWgYnyP4xCjBc3UWTHaJcY9ARkWOLIIuXLq0ndRnQOHw==} engines: {node: '>=16.0.0'} - eslint-plugin-jsx-a11y@6.9.0: - resolution: {integrity: sha512-nOFOCaJG2pYqORjK19lqPqxMO/JpvdCZdPtNdxY3kvom3jTvkAbOvQvD8wuD0G8BYR0IGAGYDlzqWJOh/ybn2g==} + eslint-plugin-jsx-a11y@6.10.0: + resolution: {integrity: sha512-ySOHvXX8eSN6zz8Bywacm7CvGNhUtdjvqfQDVe6020TUK34Cywkw7m0KsCCk1Qtm9G1FayfTN1/7mMYnYO2Bhg==} engines: {node: '>=4.0'} peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9 eslint-plugin-markdown@3.0.1: resolution: {integrity: sha512-8rqoc148DWdGdmYF6WSQFT3uQ6PO7zXYgeBpHAOAakX/zpq+NvFYbDA/H7PYzHajwtmaOzAwfxyl++x0g1/N9A==} @@ -2854,13 +2874,14 @@ packages: peerDependencies: eslint: '>=8.23.0' - eslint-plugin-perfectionist@2.11.0: - resolution: {integrity: sha512-XrtBtiu5rbQv88gl+1e2RQud9te9luYNvKIgM9emttQ2zutHPzY/AQUucwxscDKV4qlTkvLTxjOFvxqeDpPorw==} + eslint-plugin-perfectionist@3.5.0: + resolution: {integrity: sha512-vwDNuxlAlbZJ3DjHo6GnfZrmMlJBLFrkOLBV/rYvVnLFD+x54u9VyJcGOfJ2DK9d1cd3a/C/vtBrbBNgAC6Mrg==} + engines: {node: ^18.0.0 || >=20.0.0} peerDependencies: astro-eslint-parser: ^1.0.2 eslint: '>=8.0.0' svelte: '>=3.0.0' - svelte-eslint-parser: ^0.37.0 + svelte-eslint-parser: ^0.41.0 vue-eslint-parser: '>=9.0.0' peerDependenciesMeta: astro-eslint-parser: @@ -2893,8 +2914,8 @@ packages: svelte: optional: true - eslint-plugin-unicorn@53.0.0: - resolution: {integrity: sha512-kuTcNo9IwwUCfyHGwQFOK/HjJAYzbODHN3wP0PgqbW+jbXqpNWxNVpVhj2tO9SixBwuAdmal8rVcWKBxwFnGuw==} + eslint-plugin-unicorn@55.0.0: + resolution: {integrity: sha512-n3AKiVpY2/uDcGrS3+QsYDkjPfaOrNrsfQxU9nt5nitd9KuvVXrfAvgCO9DYPSfap+Gqjw9EOrXIsBp5tlHZjA==} engines: {node: '>=18.18'} peerDependencies: eslint: '>=8.56.0' @@ -3202,10 +3223,6 @@ packages: resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} engines: {node: '>=8'} - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} - engines: {node: '>=18'} - globals@15.9.0: resolution: {integrity: sha512-SmSKyLLKFbSr6rptvP8izbyxJL4ILwqO9Jg23UA0sDlGlu58V59D1//I3vlc0KJphVdUR7vMjHIplYnzBxorQA==} engines: {node: '>=18'} @@ -4375,10 +4392,6 @@ packages: postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} - postcss@8.4.41: - resolution: {integrity: sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==} - engines: {node: ^10 || ^12 || >=14} - postcss@8.4.45: resolution: {integrity: sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==} engines: {node: ^10 || ^12 || >=14} @@ -4415,8 +4428,8 @@ packages: prettier: ^3.0.0 svelte: ^3.2.0 || ^4.0.0-next.0 || ^5.0.0-next.0 - prettier-plugin-tailwindcss@0.6.5: - resolution: {integrity: sha512-axfeOArc/RiGHjOIy9HytehlC0ZLeMaqY09mm8YCkMzznKiDkwFzOpBvtuhuv3xG5qB73+Mj7OCe2j/L1ryfuQ==} + prettier-plugin-tailwindcss@0.6.6: + resolution: {integrity: sha512-OPva5S7WAsPLEsOuOWXATi13QrCKACCiIonFgIR6V4lYv4QLp++UXVhZSzRbZxXGimkQtQT86CC6fQqTOybGng==} engines: {node: '>=14.21.3'} peerDependencies: '@ianvs/prettier-plugin-sort-imports': '*' @@ -4430,6 +4443,7 @@ packages: prettier-plugin-import-sort: '*' prettier-plugin-jsdoc: '*' prettier-plugin-marko: '*' + prettier-plugin-multiline-arrays: '*' prettier-plugin-organize-attributes: '*' prettier-plugin-organize-imports: '*' prettier-plugin-sort-imports: '*' @@ -4456,6 +4470,8 @@ packages: optional: true prettier-plugin-marko: optional: true + prettier-plugin-multiline-arrays: + optional: true prettier-plugin-organize-attributes: optional: true prettier-plugin-organize-imports: @@ -6065,20 +6081,6 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/eslintrc@3.1.0': - dependencies: - ajv: 6.12.6 - debug: 4.3.6 - espree: 10.1.0 - globals: 14.0.0 - ignore: 5.3.1 - import-fresh: 3.3.0 - js-yaml: 4.1.0 - minimatch: 3.1.2 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - '@eslint/js@8.57.0': {} '@floating-ui/core@1.6.7': @@ -6100,9 +6102,9 @@ snapshots: '@fontsource/inter@5.0.20': {} - '@html-eslint/eslint-plugin@0.24.1': {} + '@html-eslint/eslint-plugin@0.26.0': {} - '@html-eslint/parser@0.24.1': + '@html-eslint/parser@0.26.0': dependencies: es-html-parser: 0.0.9 @@ -6226,7 +6228,7 @@ snapshots: string-argv: 0.3.2 type-detect: 4.1.0 - '@kitschpatrol/cspell-config@4.7.2(cspell@8.13.2)(typescript@5.5.4)': + '@kitschpatrol/cspell-config@4.7.5(cspell@8.13.2)(typescript@5.5.4)': dependencies: '@pinojs/json-colorizer': 4.0.0 cosmiconfig: 9.0.0(typescript@5.5.4) @@ -6236,10 +6238,10 @@ snapshots: transitivePeerDependencies: - typescript - '@kitschpatrol/eslint-config@4.7.2(eslint@8.57.0)(svelte@4.2.18)(typescript@5.5.4)': + '@kitschpatrol/eslint-config@4.7.5(eslint@8.57.0)(svelte-eslint-parser@0.41.0(svelte@4.2.18))(svelte@4.2.18)(typescript@5.5.4)': dependencies: - '@html-eslint/eslint-plugin': 0.24.1 - '@html-eslint/parser': 0.24.1 + '@html-eslint/eslint-plugin': 0.26.0 + '@html-eslint/parser': 0.26.0 '@pinojs/json-colorizer': 4.0.0 '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) @@ -6247,15 +6249,15 @@ snapshots: eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) eslint-config-xo: 0.45.0(eslint@8.57.0) - eslint-config-xo-typescript: 4.0.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) + eslint-config-xo-typescript: 5.0.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) eslint-plugin-astro: 1.2.3(eslint@8.57.0)(typescript@5.5.4) eslint-plugin-html: 8.1.1 - eslint-plugin-jsx-a11y: 6.9.0(eslint@8.57.0) + eslint-plugin-jsx-a11y: 6.10.0(eslint@8.57.0) eslint-plugin-mdx: 3.1.5(eslint@8.57.0) eslint-plugin-n: 17.10.2(eslint@8.57.0) - eslint-plugin-perfectionist: 2.11.0(astro-eslint-parser@1.0.2(typescript@5.5.4))(eslint@8.57.0)(svelte@4.2.18)(typescript@5.5.4) + eslint-plugin-perfectionist: 3.5.0(astro-eslint-parser@1.0.2(typescript@5.5.4))(eslint@8.57.0)(svelte-eslint-parser@0.41.0(svelte@4.2.18))(svelte@4.2.18)(typescript@5.5.4) eslint-plugin-svelte: 2.43.0(eslint@8.57.0)(svelte@4.2.18) - eslint-plugin-unicorn: 53.0.0(eslint@8.57.0) + eslint-plugin-unicorn: 55.0.0(eslint@8.57.0) execa: 8.0.1 fs-extra: 11.2.0 transitivePeerDependencies: @@ -6267,7 +6269,7 @@ snapshots: - typescript - vue-eslint-parser - '@kitschpatrol/mdat-config@4.7.2(mdat@0.7.2(typescript@5.5.4))(typescript@5.5.4)': + '@kitschpatrol/mdat-config@4.7.5(mdat@0.7.2(typescript@5.5.4))(typescript@5.5.4)': dependencies: '@pinojs/json-colorizer': 4.0.0 cosmiconfig: 9.0.0(typescript@5.5.4) @@ -6277,7 +6279,7 @@ snapshots: transitivePeerDependencies: - typescript - '@kitschpatrol/prettier-config@4.7.2(prettier@3.3.3)(svelte@4.2.18)(typescript@5.5.4)': + '@kitschpatrol/prettier-config@4.7.5(prettier@3.3.3)(svelte@4.2.18)(typescript@5.5.4)': dependencies: '@pinojs/json-colorizer': 4.0.0 '@prettier/plugin-php': 0.22.2(prettier@3.3.3) @@ -6292,7 +6294,7 @@ snapshots: prettier-plugin-sh: 0.14.0(prettier@3.3.3) prettier-plugin-sql: 0.18.1(prettier@3.3.3) prettier-plugin-svelte: 3.2.6(prettier@3.3.3)(svelte@4.2.18) - prettier-plugin-tailwindcss: 0.6.5(prettier-plugin-astro@0.14.1)(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.18))(prettier@3.3.3) + prettier-plugin-tailwindcss: 0.6.6(prettier-plugin-astro@0.14.1)(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.18))(prettier@3.3.3) prettier-plugin-toml: 2.0.1(prettier@3.3.3) transitivePeerDependencies: - '@ianvs/prettier-plugin-sort-imports' @@ -6304,6 +6306,7 @@ snapshots: - prettier-plugin-import-sort - prettier-plugin-jsdoc - prettier-plugin-marko + - prettier-plugin-multiline-arrays - prettier-plugin-organize-attributes - prettier-plugin-organize-imports - prettier-plugin-sort-imports @@ -6311,7 +6314,7 @@ snapshots: - svelte - typescript - '@kitschpatrol/remark-config@4.7.2(prettier@3.3.3)(typescript@5.5.4)': + '@kitschpatrol/remark-config@4.7.5(prettier@3.3.3)(typescript@5.5.4)': dependencies: '@pinojs/json-colorizer': 4.0.0 cosmiconfig: 9.0.0(typescript@5.5.4) @@ -6370,7 +6373,7 @@ snapshots: - supports-color - typescript - '@kitschpatrol/repo-config@4.7.2(typescript@5.5.4)': + '@kitschpatrol/repo-config@4.7.5(typescript@5.5.4)': dependencies: '@pinojs/json-colorizer': 4.0.0 cosmiconfig: 9.0.0(typescript@5.5.4) @@ -6379,15 +6382,15 @@ snapshots: transitivePeerDependencies: - typescript - '@kitschpatrol/shared-config@4.7.2(cspell@8.13.2)(eslint@8.57.0)(mdat@0.7.2(typescript@5.5.4))(postcss-html@1.7.0)(prettier@3.3.3)(stylelint@16.8.1(typescript@5.5.4))(svelte@4.2.18)(typescript@5.5.4)': + '@kitschpatrol/shared-config@4.7.5(cspell@8.13.2)(eslint@8.57.0)(mdat@0.7.2(typescript@5.5.4))(postcss-html@1.7.0)(prettier@3.3.3)(stylelint@16.8.1(typescript@5.5.4))(svelte-eslint-parser@0.41.0(svelte@4.2.18))(svelte@4.2.18)(typescript@5.5.4)': dependencies: - '@kitschpatrol/cspell-config': 4.7.2(cspell@8.13.2)(typescript@5.5.4) - '@kitschpatrol/eslint-config': 4.7.2(eslint@8.57.0)(svelte@4.2.18)(typescript@5.5.4) - '@kitschpatrol/mdat-config': 4.7.2(mdat@0.7.2(typescript@5.5.4))(typescript@5.5.4) - '@kitschpatrol/prettier-config': 4.7.2(prettier@3.3.3)(svelte@4.2.18)(typescript@5.5.4) - '@kitschpatrol/remark-config': 4.7.2(prettier@3.3.3)(typescript@5.5.4) - '@kitschpatrol/repo-config': 4.7.2(typescript@5.5.4) - '@kitschpatrol/stylelint-config': 4.7.2(postcss-html@1.7.0)(stylelint@16.8.1(typescript@5.5.4))(typescript@5.5.4) + '@kitschpatrol/cspell-config': 4.7.5(cspell@8.13.2)(typescript@5.5.4) + '@kitschpatrol/eslint-config': 4.7.5(eslint@8.57.0)(svelte-eslint-parser@0.41.0(svelte@4.2.18))(svelte@4.2.18)(typescript@5.5.4) + '@kitschpatrol/mdat-config': 4.7.5(mdat@0.7.2(typescript@5.5.4))(typescript@5.5.4) + '@kitschpatrol/prettier-config': 4.7.5(prettier@3.3.3)(svelte@4.2.18)(typescript@5.5.4) + '@kitschpatrol/remark-config': 4.7.5(prettier@3.3.3)(typescript@5.5.4) + '@kitschpatrol/repo-config': 4.7.5(typescript@5.5.4) + '@kitschpatrol/stylelint-config': 4.7.5(postcss-html@1.7.0)(stylelint@16.8.1(typescript@5.5.4))(typescript@5.5.4) '@pinojs/json-colorizer': 4.0.0 cosmiconfig: 9.0.0(typescript@5.5.4) execa: 8.0.1 @@ -6408,6 +6411,7 @@ snapshots: - prettier-plugin-import-sort - prettier-plugin-jsdoc - prettier-plugin-marko + - prettier-plugin-multiline-arrays - prettier-plugin-organize-attributes - prettier-plugin-organize-imports - prettier-plugin-sort-imports @@ -6420,7 +6424,7 @@ snapshots: - typescript - vue-eslint-parser - '@kitschpatrol/stylelint-config@4.7.2(postcss-html@1.7.0)(stylelint@16.8.1(typescript@5.5.4))(typescript@5.5.4)': + '@kitschpatrol/stylelint-config@4.7.5(postcss-html@1.7.0)(stylelint@16.8.1(typescript@5.5.4))(typescript@5.5.4)': dependencies: '@pinojs/json-colorizer': 4.0.0 cosmiconfig: 9.0.0(typescript@5.5.4) @@ -7349,7 +7353,7 @@ snapshots: '@types/concat-stream@2.0.3': dependencies: - '@types/node': 20.14.14 + '@types/node': 22.1.0 '@types/connect@3.4.38': dependencies: @@ -7496,6 +7500,11 @@ snapshots: '@typescript-eslint/types': 7.18.0 '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/scope-manager@8.4.0': + dependencies: + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/visitor-keys': 8.4.0 + '@typescript-eslint/type-utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.5.4) @@ -7510,6 +7519,8 @@ snapshots: '@typescript-eslint/types@7.18.0': {} + '@typescript-eslint/types@8.4.0': {} + '@typescript-eslint/typescript-estree@7.18.0(typescript@5.5.4)': dependencies: '@typescript-eslint/types': 7.18.0 @@ -7525,6 +7536,21 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/typescript-estree@8.4.0(typescript@5.5.4)': + dependencies: + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/visitor-keys': 8.4.0 + debug: 4.3.6 + fast-glob: 3.3.2 + is-glob: 4.0.3 + minimatch: 9.0.5 + semver: 7.6.3 + ts-api-utils: 1.3.0(typescript@5.5.4) + optionalDependencies: + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/utils@7.18.0(eslint@8.57.0)(typescript@5.5.4)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) @@ -7536,11 +7562,27 @@ snapshots: - supports-color - typescript + '@typescript-eslint/utils@8.4.0(eslint@8.57.0)(typescript@5.5.4)': + dependencies: + '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) + '@typescript-eslint/scope-manager': 8.4.0 + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/typescript-estree': 8.4.0(typescript@5.5.4) + eslint: 8.57.0 + transitivePeerDependencies: + - supports-color + - typescript + '@typescript-eslint/visitor-keys@7.18.0': dependencies: '@typescript-eslint/types': 7.18.0 eslint-visitor-keys: 3.4.3 + '@typescript-eslint/visitor-keys@8.4.0': + dependencies: + '@typescript-eslint/types': 8.4.0 + eslint-visitor-keys: 3.4.3 + '@ungap/structured-clone@1.2.0': {} '@use-gesture/core@10.3.1': {} @@ -7745,10 +7787,6 @@ snapshots: axe-core@4.10.0: {} - axobject-query@3.1.1: - dependencies: - deep-equal: 2.2.3 - axobject-query@4.1.0: {} b4a@1.6.6: {} @@ -8586,7 +8624,7 @@ snapshots: dependencies: eslint: 8.57.0 - eslint-config-xo-typescript@4.0.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4): + eslint-config-xo-typescript@5.0.0(@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4))(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4): dependencies: '@typescript-eslint/eslint-plugin': 7.18.0(@typescript-eslint/parser@7.18.0(eslint@8.57.0)(typescript@5.5.4))(eslint@8.57.0)(typescript@5.5.4) '@typescript-eslint/parser': 7.18.0(eslint@8.57.0)(typescript@5.5.4) @@ -8628,7 +8666,7 @@ snapshots: eslint: 8.57.0 eslint-compat-utils: 0.5.1(eslint@8.57.0) globals: 15.9.0 - postcss: 8.4.41 + postcss: 8.4.45 postcss-selector-parser: 6.1.1 transitivePeerDependencies: - supports-color @@ -8645,14 +8683,14 @@ snapshots: dependencies: htmlparser2: 9.1.0 - eslint-plugin-jsx-a11y@6.9.0(eslint@8.57.0): + eslint-plugin-jsx-a11y@6.10.0(eslint@8.57.0): dependencies: aria-query: 5.1.3 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 ast-types-flow: 0.0.8 axe-core: 4.10.0 - axobject-query: 3.1.1 + axobject-query: 4.1.0 damerau-levenshtein: 1.0.8 emoji-regex: 9.2.2 es-iterator-helpers: 1.0.19 @@ -8699,15 +8737,17 @@ snapshots: minimatch: 9.0.5 semver: 7.6.3 - eslint-plugin-perfectionist@2.11.0(astro-eslint-parser@1.0.2(typescript@5.5.4))(eslint@8.57.0)(svelte@4.2.18)(typescript@5.5.4): + eslint-plugin-perfectionist@3.5.0(astro-eslint-parser@1.0.2(typescript@5.5.4))(eslint@8.57.0)(svelte-eslint-parser@0.41.0(svelte@4.2.18))(svelte@4.2.18)(typescript@5.5.4): dependencies: - '@typescript-eslint/utils': 7.18.0(eslint@8.57.0)(typescript@5.5.4) + '@typescript-eslint/types': 8.4.0 + '@typescript-eslint/utils': 8.4.0(eslint@8.57.0)(typescript@5.5.4) eslint: 8.57.0 minimatch: 9.0.5 natural-compare-lite: 1.4.0 optionalDependencies: astro-eslint-parser: 1.0.2(typescript@5.5.4) svelte: 4.2.18 + svelte-eslint-parser: 0.41.0(svelte@4.2.18) transitivePeerDependencies: - supports-color - typescript @@ -8728,9 +8768,9 @@ snapshots: eslint-compat-utils: 0.5.1(eslint@8.57.0) esutils: 2.0.3 known-css-properties: 0.34.0 - postcss: 8.4.41 - postcss-load-config: 3.1.4(postcss@8.4.41) - postcss-safe-parser: 6.0.0(postcss@8.4.41) + postcss: 8.4.45 + postcss-load-config: 3.1.4(postcss@8.4.45) + postcss-safe-parser: 6.0.0(postcss@8.4.45) postcss-selector-parser: 6.1.1 semver: 7.6.3 svelte-eslint-parser: 0.41.0(svelte@4.2.18) @@ -8739,16 +8779,16 @@ snapshots: transitivePeerDependencies: - ts-node - eslint-plugin-unicorn@53.0.0(eslint@8.57.0): + eslint-plugin-unicorn@55.0.0(eslint@8.57.0): dependencies: '@babel/helper-validator-identifier': 7.24.7 '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint/eslintrc': 3.1.0 ci-info: 4.0.0 clean-regexp: 1.0.0 core-js-compat: 3.38.0 eslint: 8.57.0 esquery: 1.6.0 + globals: 15.9.0 indent-string: 4.0.0 is-builtin-module: 3.2.1 jsesc: 3.0.2 @@ -8758,8 +8798,6 @@ snapshots: regjsparser: 0.10.0 semver: 7.6.3 strip-indent: 3.0.0 - transitivePeerDependencies: - - supports-color eslint-scope@7.2.2: dependencies: @@ -9171,8 +9209,6 @@ snapshots: dependencies: type-fest: 0.20.2 - globals@14.0.0: {} - globals@15.9.0: {} globalthis@1.0.4: @@ -10549,19 +10585,15 @@ snapshots: postcss: 8.4.45 postcss-safe-parser: 6.0.0(postcss@8.4.45) - postcss-load-config@3.1.4(postcss@8.4.41): + postcss-load-config@3.1.4(postcss@8.4.45): dependencies: lilconfig: 2.1.0 yaml: 1.10.2 optionalDependencies: - postcss: 8.4.41 + postcss: 8.4.45 postcss-resolve-nested-selector@0.1.5: {} - postcss-safe-parser@6.0.0(postcss@8.4.41): - dependencies: - postcss: 8.4.41 - postcss-safe-parser@6.0.0(postcss@8.4.45): dependencies: postcss: 8.4.45 @@ -10570,27 +10602,21 @@ snapshots: dependencies: postcss: 8.4.45 - postcss-scss@4.0.9(postcss@8.4.41): + postcss-scss@4.0.9(postcss@8.4.45): dependencies: - postcss: 8.4.41 + postcss: 8.4.45 postcss-selector-parser@6.1.1: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 - postcss-sorting@8.0.2(postcss@8.4.41): + postcss-sorting@8.0.2(postcss@8.4.45): dependencies: - postcss: 8.4.41 + postcss: 8.4.45 postcss-value-parser@4.2.0: {} - postcss@8.4.41: - dependencies: - nanoid: 3.3.7 - picocolors: 1.0.1 - source-map-js: 1.2.0 - postcss@8.4.45: dependencies: nanoid: 3.3.7 @@ -10628,7 +10654,7 @@ snapshots: prettier: 3.3.3 svelte: 4.2.18 - prettier-plugin-tailwindcss@0.6.5(prettier-plugin-astro@0.14.1)(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.18))(prettier@3.3.3): + prettier-plugin-tailwindcss@0.6.6(prettier-plugin-astro@0.14.1)(prettier-plugin-svelte@3.2.6(prettier@3.3.3)(svelte@4.2.18))(prettier@3.3.3): dependencies: prettier: 3.3.3 optionalDependencies: @@ -11701,8 +11727,8 @@ snapshots: stylelint-order@6.0.4(stylelint@16.8.1(typescript@5.5.4)): dependencies: - postcss: 8.4.41 - postcss-sorting: 8.0.2(postcss@8.4.41) + postcss: 8.4.45 + postcss-sorting: 8.0.2(postcss@8.4.45) stylelint: 16.8.1(typescript@5.5.4) stylelint@16.8.1(typescript@5.5.4): @@ -11776,8 +11802,8 @@ snapshots: eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 - postcss: 8.4.41 - postcss-scss: 4.0.9(postcss@8.4.41) + postcss: 8.4.45 + postcss-scss: 4.0.9(postcss@8.4.45) optionalDependencies: svelte: 4.2.18 diff --git a/scripts/build-cli.ts b/scripts/build-cli.ts index 63e5260..2beeda4 100755 --- a/scripts/build-cli.ts +++ b/scripts/build-cli.ts @@ -1,5 +1,5 @@ -import iifePlugin from './plugins/esbuild-plugin-iife' import esbuild from 'esbuild' +import iifePlugin from './plugins/esbuild-plugin-iife' await esbuild.build({ bundle: true, diff --git a/scripts/build-lib.ts b/scripts/build-lib.ts index f54c1e3..e1f4927 100755 --- a/scripts/build-lib.ts +++ b/scripts/build-lib.ts @@ -1,5 +1,5 @@ -import iifePlugin from './plugins/esbuild-plugin-iife' import esbuild from 'esbuild' +import iifePlugin from './plugins/esbuild-plugin-iife' await esbuild.build({ bundle: true, diff --git a/scripts/plugins/esbuild-plugin-iife.extensions.d.ts b/scripts/plugins/esbuild-plugin-iife.extensions.d.ts index 9be0efa..616ec4d 100644 --- a/scripts/plugins/esbuild-plugin-iife.extensions.d.ts +++ b/scripts/plugins/esbuild-plugin-iife.extensions.d.ts @@ -1,4 +1,5 @@ declare module '*?iife' { + // eslint-disable-next-line @typescript-eslint/naming-convention const content: string export default content } diff --git a/src/cli/cli.ts b/src/cli/cli.ts index 681017b..f047fcf 100644 --- a/src/cli/cli.ts +++ b/src/cli/cli.ts @@ -1,13 +1,13 @@ #!/usr/bin/env node -import { version } from '../../package.json' -import { type TldrawOpenOptions, type TldrawOpenResult, tldrawOpen } from '../lib/tldraw-open' -import { type TldrawFormat, tldrawToImage } from '../lib/tldraw-to-image' -import log from '../lib/utilities/log' import chalk from 'chalk' import plur from 'plur' import yargs from 'yargs' import { hideBin } from 'yargs/helpers' +import { version } from '../../package.json' +import { tldrawOpen, type TldrawOpenOptions, type TldrawOpenResult } from '../lib/tldraw-open' +import { type TldrawFormat, tldrawToImage } from '../lib/tldraw-to-image' +import log from '../lib/utilities/log' const yargsInstance = yargs(hideBin(process.argv)) diff --git a/src/lib/index.ts b/src/lib/index.ts index 6c5d7dc..ff32934 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,4 +1,4 @@ -export { type TldrawOpenOptions, type TldrawOpenResult, tldrawOpen } from './tldraw-open' -export { type TldrawFormat, type TldrawToImageOptions, tldrawToImage } from './tldraw-to-image' +export { tldrawOpen, type TldrawOpenOptions, type TldrawOpenResult } from './tldraw-open' +export { type TldrawFormat, tldrawToImage, type TldrawToImageOptions } from './tldraw-to-image' export { tldrawToShareUrl } from './tldraw-to-share-url' export { default as log } from './utilities/log' diff --git a/src/lib/local-tldraw-server.ts b/src/lib/local-tldraw-server.ts index 1833e9f..759f218 100644 --- a/src/lib/local-tldraw-server.ts +++ b/src/lib/local-tldraw-server.ts @@ -1,17 +1,15 @@ -import log from './utilities/log' import express from 'express' import getPort from 'get-port' import { type Server } from 'node:http' import { type AddressInfo } from 'node:net' import path from 'node:path' import { fileURLToPath } from 'node:url' +import log from './utilities/log' export default class LocalTldrawServer { private server?: Server - constructor(private readonly tldrData?: string) { - this.tldrData = tldrData - } + constructor(private readonly tldrData?: string) {} close(): void { if (!this.server) throw new Error('Server not started') diff --git a/src/lib/tldraw-controller.ts b/src/lib/tldraw-controller.ts index b7ad81a..a95733d 100644 --- a/src/lib/tldraw-controller.ts +++ b/src/lib/tldraw-controller.ts @@ -1,17 +1,17 @@ // Note special inline IIFE import, see ./plugins/esbuild-plugin-iife.ts -import getImageInlineScript from './inline/get-image?iife' -import getTldrInlineScript from './inline/get-tldr?iife' -import setTldrInlineScript from './inline/set-tldr?iife' -import type { TldrawToImageOptions } from './tldraw-to-image' -import log from './utilities/log' +import type { Browser, Page } from 'puppeteer' import slugify from '@sindresorhus/slugify' import * as cheerio from 'cheerio' import fs from 'node:fs/promises' import path from 'node:path' import puppeteer from 'puppeteer' -import type { Browser, Page } from 'puppeteer' import { base64ToString, base64ToUint8Array, stringToBase64 } from 'uint8array-extras' import untildify from 'untildify' +import type { TldrawToImageOptions } from './tldraw-to-image' +import getImageInlineScript from './inline/get-image?iife' +import getTldrInlineScript from './inline/get-tldr?iife' +import setTldrInlineScript from './inline/set-tldr?iife' +import log from './utilities/log' type TlPage = { frames: TlFrame[] @@ -32,9 +32,7 @@ export default class TldrawController { private isEmpty?: boolean private browser?: Browser - constructor(private readonly href: string) { - this.href = href - } + constructor(private readonly href: string) {} private get isLocal(): boolean { return this.href.startsWith('http://localhost') diff --git a/src/lib/tldraw-open.ts b/src/lib/tldraw-open.ts index 5d93342..8f395e8 100644 --- a/src/lib/tldraw-open.ts +++ b/src/lib/tldraw-open.ts @@ -1,14 +1,14 @@ -import LocalTldrawServer from './local-tldraw-server' -import { tldrawToImage } from './tldraw-to-image' -import { tldrawToShareUrl } from './tldraw-to-share-url' -import log from './utilities/log' -import { validatePathOrUrl } from './validation' import { nanoid } from 'nanoid' import { type ChildProcess } from 'node:child_process' import fs from 'node:fs/promises' import os from 'node:os' import { URL } from 'node:url' import open from 'open' +import LocalTldrawServer from './local-tldraw-server' +import { tldrawToImage } from './tldraw-to-image' +import { tldrawToShareUrl } from './tldraw-to-share-url' +import log from './utilities/log' +import { validatePathOrUrl } from './validation' const tldrawOpenDefaultOptions = { location: 'remote', diff --git a/src/lib/tldraw-to-image.ts b/src/lib/tldraw-to-image.ts index 94df485..b457597 100644 --- a/src/lib/tldraw-to-image.ts +++ b/src/lib/tldraw-to-image.ts @@ -1,10 +1,10 @@ +import fs from 'node:fs/promises' +import path from 'node:path' +import prettyMilliseconds from 'pretty-ms' import LocalTldrawServer from './local-tldraw-server' import TldrawController from './tldraw-controller' import log from './utilities/log' import { validatePathOrUrl } from './validation' -import fs from 'node:fs/promises' -import path from 'node:path' -import prettyMilliseconds from 'pretty-ms' // Essentially TLExportType + 'tldr' diff --git a/src/lib/utilities/log.ts b/src/lib/utilities/log.ts index 9441aa6..1e82add 100644 --- a/src/lib/utilities/log.ts +++ b/src/lib/utilities/log.ts @@ -5,6 +5,7 @@ import chalk from 'chalk' const isNode = process?.versions?.node !== undefined +// eslint-disable-next-line @typescript-eslint/naming-convention const log = { verbose: false, diff --git a/src/lib/validation.ts b/src/lib/validation.ts index 8496050..fd46d05 100644 --- a/src/lib/validation.ts +++ b/src/lib/validation.ts @@ -10,7 +10,7 @@ export function validatePathOrUrl( validFileExtensions?: string[] validHostnames?: string[] } = {}, -): URL | string { +): string | URL { const { requireFileExistence, validFileExtensions, validHostnames } = options if (URL.canParse(pathOrUrl)) { diff --git a/src/tldraw/app.tsx b/src/tldraw/app.tsx index 1b4d0be..11ffc2b 100644 --- a/src/tldraw/app.tsx +++ b/src/tldraw/app.tsx @@ -1,8 +1,8 @@ -import './index.css' /* eslint-disable @typescript-eslint/naming-convention */ import { getAssetUrls } from '@tldraw/assets/selfHosted' import { useState } from 'react' -import { type Editor, type TLStore, Tldraw, parseTldrawJsonFile } from 'tldraw' +import { type Editor, parseTldrawJsonFile, Tldraw, type TLStore } from 'tldraw' +import './index.css' // Can't get this to work // import { getAssetUrlsByImport } from '@tldraw/assets/imports' @@ -50,7 +50,7 @@ export default function App() { console.error(`Couldn't parse tldr file: ${String(parseFileResult.error.type)}`) } }) - .catch((error) => { + .catch((error: unknown) => { console.error("Couldn't fetch data:", error) }) } else { diff --git a/src/tldraw/main.tsx b/src/tldraw/main.tsx index c054b0c..bdb1a01 100644 --- a/src/tldraw/main.tsx +++ b/src/tldraw/main.tsx @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import App from './app.tsx' import React from 'react' import ReactDOM from 'react-dom/client' +import App from './app.tsx' ReactDOM.createRoot(document.querySelector('#root')!).render( diff --git a/test/api-stability.test.ts b/test/api-stability.test.ts index 4075e8d..b9f789b 100644 --- a/test/api-stability.test.ts +++ b/test/api-stability.test.ts @@ -1,7 +1,7 @@ -import { tldrawToImage, tldrawToShareUrl } from '../dist/lib' -import { expectFileToExist } from './utilities/file' import fs from 'node:fs/promises' import { describe, expect, it, vi } from 'vitest' +import { tldrawToImage, tldrawToShareUrl } from '../dist/lib' +import { expectFileToExist } from './utilities/file' const cleanUp = true diff --git a/test/tldr-to-image.test.ts b/test/tldr-to-image.test.ts index d7790a6..59fb9e3 100644 --- a/test/tldr-to-image.test.ts +++ b/test/tldr-to-image.test.ts @@ -1,7 +1,4 @@ // Note this tests the dist build, because of the IIFE inlining from esbuild -import { log, tldrawToImage } from '../dist/lib' -import { expectFileToBeValid, getStyleElementCount } from './utilities/file' -import { expectSingleLine } from './utilities/string' import { nanoid } from 'nanoid' import { mkdirSync, rmSync } from 'node:fs' import fs from 'node:fs/promises' @@ -9,6 +6,9 @@ import os from 'node:os' import path from 'node:path' import stripAnsi from 'strip-ansi' import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest' +import { log, tldrawToImage } from '../dist/lib' +import { expectFileToBeValid, getStyleElementCount } from './utilities/file' +import { expectSingleLine } from './utilities/string' const cleanUp = true const tldrTestFilePath = './test/assets/valid/2024-01-test-sketch-basic.tldr' diff --git a/test/url-to-image.test.ts b/test/url-to-image.test.ts index a7b11c4..e8df3c0 100644 --- a/test/url-to-image.test.ts +++ b/test/url-to-image.test.ts @@ -1,9 +1,9 @@ // Note this tests the dist build, because of the iife inlining from esbuild -import { tldrawToImage } from '../dist/lib' -import { expectFileToBeValid } from './utilities/file' import { nanoid } from 'nanoid' import { mkdirSync, rmSync } from 'node:fs' import { expect, it } from 'vitest' +import { tldrawToImage } from '../dist/lib' +import { expectFileToBeValid } from './utilities/file' const cleanUp = true const tldrawTestUrl = 'https://www.tldraw.com/s/v2_c_9nMYBwT8UQ99RGDWfGr8H' diff --git a/test/validation.test.ts b/test/validation.test.ts index b6a5948..59aa4ff 100644 --- a/test/validation.test.ts +++ b/test/validation.test.ts @@ -1,6 +1,6 @@ // Note this tests the src implementation, because it's not exported -import { validatePathOrUrl } from '../src/lib/validation' import { expect, it } from 'vitest' +import { validatePathOrUrl } from '../src/lib/validation' const validationOptions = { requireFileExistence: true,