From fa7732425f2a880379946af3ab6ff83818d60605 Mon Sep 17 00:00:00 2001 From: Paik Date: Sun, 1 Sep 2024 19:32:53 +0900 Subject: [PATCH 01/10] Install husky and lint-staged --- .husky/pre-commit | 1 + package.json | 8 +- packages/sdk/package.json | 6 - pnpm-lock.yaml | 302 +++++++++++++++++++++++++++++++++++++- 4 files changed, 303 insertions(+), 14 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..d0a778429 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 097fbaeea..00bd40acb 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "vanilla-codemirror6": "pnpm --filter=vanilla-codemirror6", "vanilla-quill": "pnpm --filter=vanilla-quill", "vuejs-kanban": "pnpm --filter=vuejs-kanban", - "build:examples": "pnpm --filter './examples/*' run build" + "build:examples": "pnpm --filter './examples/*' run build", + "prepare": "husky" }, "keywords": [], "author": { @@ -25,6 +26,11 @@ }, "license": "Apache-2.0", "devDependencies": { + "husky": "^9.1.5", + "lint-staged": "^15.2.9", "only-allow": "^1.2.1" + }, + "lint-staged": { + "packages/sdk/**/*.{js,ts,tsx}": "pnpm sdk lint" } } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 8c263d572..f6146152a 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -57,7 +57,6 @@ "eslint-plugin-jsdoc": "^39.3.3", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", - "husky": "^8.0.3", "prettier": "^2.7.1", "ts-node": "^10.9.1", "typedoc": "^0.25.13", @@ -74,10 +73,5 @@ "@connectrpc/connect": "^1.4.0", "@connectrpc/connect-web": "^1.4.0", "long": "^5.2.0" - }, - "husky": { - "hooks": { - "pre-commit": "pnpm lint" - } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d1ce7d1cb..1ec1ecdd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,12 @@ importers: .: devDependencies: + husky: + specifier: ^9.1.5 + version: 9.1.5 + lint-staged: + specifier: ^15.2.9 + version: 15.2.9 only-allow: specifier: ^1.2.1 version: 1.2.1 @@ -402,9 +408,6 @@ importers: eslint-plugin-tsdoc: specifier: ^0.2.16 version: 0.2.16 - husky: - specifier: ^8.0.3 - version: 8.0.3 prettier: specifier: ^2.7.1 version: 2.7.1 @@ -3272,6 +3275,10 @@ packages: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} + ansi-escapes@7.0.0: + resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} + engines: {node: '>=18'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -3444,6 +3451,10 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + browser-fs-access@0.31.2: resolution: {integrity: sha512-wZSA7UgKMwR6oxddFQeSIoD7cxiNiaZT+iuVJw4/avr9t2ROwu80gxENT0YJChsLxJ7xBbLZDGHTAXfAg3Pq5Q==} @@ -3549,10 +3560,18 @@ packages: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} + cli-width@4.1.0: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} @@ -3612,6 +3631,10 @@ packages: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -3740,6 +3763,15 @@ packages: supports-color: optional: true + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -3861,6 +3893,9 @@ packages: electron-to-chromium@1.5.6: resolution: {integrity: sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -3894,6 +3929,10 @@ packages: engines: {node: '>=4'} hasBin: true + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} + errno@0.1.8: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true @@ -4140,6 +4179,9 @@ packages: eventemitter3@2.0.3: resolution: {integrity: sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==} + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -4148,6 +4190,10 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + expand-template@2.0.3: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} @@ -4216,6 +4262,10 @@ packages: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -4283,6 +4333,10 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} @@ -4302,6 +4356,10 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + get-symbol-description@1.0.2: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} @@ -4479,9 +4537,13 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - husky@8.0.3: - resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} - engines: {node: '>=14'} + human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + + husky@9.1.5: + resolution: {integrity: sha512-rowAVRUBfI0b4+niA4SJMhfQwc107VLkBUgEYYAOQAbqDCnra1nYh83hF/MDmhYs9t9n1E3DuKOrs2LYNC+0Ag==} + engines: {node: '>=18'} hasBin: true iconv-lite@0.4.24: @@ -4614,6 +4676,14 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + + is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + is-generator-function@1.0.10: resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} engines: {node: '>= 0.4'} @@ -4972,6 +5042,15 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + lint-staged@15.2.9: + resolution: {integrity: sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==} + engines: {node: '>=18.12.0'} + hasBin: true + + listr2@8.2.4: + resolution: {integrity: sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==} + engines: {node: '>=18.0.0'} + lmdb@2.5.2: resolution: {integrity: sha512-V5V5Xa2Hp9i2XsbDALkBTeHXnBXh/lEmk9p22zdr7jtuOIY9TGhjK6vAvTpOOx9IKU4hJkRWZxn/HsvR1ELLtA==} @@ -5029,6 +5108,10 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} + log-update@6.1.0: + resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} + engines: {node: '>=18'} + long@5.2.0: resolution: {integrity: sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==} @@ -5096,6 +5179,10 @@ packages: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -5118,6 +5205,14 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -5269,6 +5364,10 @@ packages: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -5318,6 +5417,14 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} + onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + only-allow@1.2.1: resolution: {integrity: sha512-M7CJbmv7UCopc0neRKdzfoGWaVZC+xC1925GitKH9EAqYFzX9//25Q7oX4+jw0tiCCj+t5l6VZh8UPH23NZkMA==} hasBin: true @@ -5394,6 +5501,10 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -5427,6 +5538,11 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} @@ -5835,10 +5951,17 @@ packages: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} deprecated: Rimraf versions prior to v4 are no longer supported @@ -5975,6 +6098,14 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + + slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -6043,6 +6174,10 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + string.prototype.includes@2.0.0: resolution: {integrity: sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==} @@ -6083,6 +6218,10 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -6742,6 +6881,10 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -10247,6 +10390,10 @@ snapshots: dependencies: type-fest: 0.21.3 + ansi-escapes@7.0.0: + dependencies: + environment: 1.1.0 + ansi-regex@5.0.1: {} ansi-regex@6.0.1: {} @@ -10440,6 +10587,10 @@ snapshots: dependencies: fill-range: 7.0.1 + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + browser-fs-access@0.31.2: {} browserslist@4.21.10: @@ -10560,8 +10711,17 @@ snapshots: dependencies: restore-cursor: 3.1.0 + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + cli-spinners@2.9.2: {} + cli-truncate@4.0.0: + dependencies: + slice-ansi: 5.0.0 + string-width: 7.2.0 + cli-width@4.1.0: {} client-only@0.0.1: {} @@ -10626,6 +10786,8 @@ snapshots: commander@10.0.1: {} + commander@12.1.0: {} + commander@2.20.3: {} commander@4.1.1: {} @@ -10751,6 +10913,10 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.3.6: + dependencies: + ms: 2.1.2 + decompress-response@6.0.0: dependencies: mimic-response: 3.1.0 @@ -10879,6 +11045,8 @@ snapshots: electron-to-chromium@1.5.6: {} + emoji-regex@10.4.0: {} + emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -10902,6 +11070,8 @@ snapshots: envinfo@7.13.0: {} + environment@1.1.0: {} + errno@0.1.8: dependencies: prr: 1.0.1 @@ -11332,6 +11502,8 @@ snapshots: eventemitter3@2.0.3: {} + eventemitter3@5.0.1: {} + events@3.3.0: {} execa@5.1.1: @@ -11346,6 +11518,18 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + execa@8.0.1: + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + expand-template@2.0.3: {} extend@3.0.2: {} @@ -11425,6 +11609,10 @@ snapshots: dependencies: to-regex-range: 5.0.1 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -11492,6 +11680,8 @@ snapshots: gensync@1.0.0-beta.2: {} + get-east-asian-width@1.2.0: {} + get-func-name@2.0.2: {} get-intrinsic@1.2.4: @@ -11508,6 +11698,8 @@ snapshots: get-stream@6.0.1: {} + get-stream@8.0.1: {} + get-symbol-description@1.0.2: dependencies: call-bind: 1.0.7 @@ -11695,7 +11887,9 @@ snapshots: human-signals@2.1.0: {} - husky@8.0.3: {} + human-signals@5.0.0: {} + + husky@9.1.5: {} iconv-lite@0.4.24: dependencies: @@ -11836,6 +12030,12 @@ snapshots: is-fullwidth-code-point@3.0.0: {} + is-fullwidth-code-point@4.0.0: {} + + is-fullwidth-code-point@5.0.0: + dependencies: + get-east-asian-width: 1.2.0 + is-generator-function@1.0.10: dependencies: has-tostringtag: 1.0.2 @@ -12151,6 +12351,30 @@ snapshots: lines-and-columns@1.2.4: {} + lint-staged@15.2.9: + dependencies: + chalk: 5.3.0 + commander: 12.1.0 + debug: 4.3.6 + execa: 8.0.1 + lilconfig: 3.1.2 + listr2: 8.2.4 + micromatch: 4.0.8 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.5.0 + transitivePeerDependencies: + - supports-color + + listr2@8.2.4: + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.1.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.0 + lmdb@2.5.2: dependencies: msgpackr: 1.11.0 @@ -12216,6 +12440,14 @@ snapshots: chalk: 4.1.1 is-unicode-supported: 0.1.0 + log-update@6.1.0: + dependencies: + ansi-escapes: 7.0.0 + cli-cursor: 5.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + long@5.2.0: {} loose-envify@1.4.0: @@ -12273,6 +12505,11 @@ snapshots: braces: 3.0.2 picomatch: 2.3.1 + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mime-db@1.52.0: {} mime-types@2.1.35: @@ -12286,6 +12523,10 @@ snapshots: mimic-fn@2.1.0: {} + mimic-fn@4.0.0: {} + + mimic-function@5.0.1: {} + mimic-response@3.1.0: {} mimic-response@4.0.0: {} @@ -12430,6 +12671,10 @@ snapshots: dependencies: path-key: 3.1.1 + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + nth-check@2.1.1: dependencies: boolbase: 1.0.0 @@ -12487,6 +12732,14 @@ snapshots: dependencies: mimic-fn: 2.1.0 + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + only-allow@1.2.1: dependencies: which-pm-runs: 1.1.0 @@ -12564,6 +12817,8 @@ snapshots: path-key@3.1.1: {} + path-key@4.0.0: {} + path-parse@1.0.7: {} path-scurry@1.11.1: @@ -12591,6 +12846,8 @@ snapshots: picomatch@2.3.1: {} + pidtree@0.6.0: {} + pify@4.0.1: optional: true @@ -13118,8 +13375,15 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + reusify@1.0.4: {} + rfdc@1.4.1: {} + rimraf@3.0.2: dependencies: glob: 7.2.0 @@ -13287,6 +13551,16 @@ snapshots: slash@3.0.0: {} + slice-ansi@5.0.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + + slice-ansi@7.1.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + source-map-js@1.2.0: {} source-map-support@0.5.20: @@ -13349,6 +13623,12 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + string.prototype.includes@2.0.0: dependencies: define-properties: 1.1.3 @@ -13409,6 +13689,8 @@ snapshots: strip-final-newline@2.0.0: {} + strip-final-newline@3.0.0: {} + strip-json-comments@2.0.1: {} strip-json-comments@3.1.1: {} @@ -14168,6 +14450,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrappy@1.0.2: {} xxhash-wasm@0.4.2: {} From 14a2ae77d49f2abc59da56f37b0f9dfc3c11b206 Mon Sep 17 00:00:00 2001 From: Paik Date: Sun, 1 Sep 2024 20:24:49 +0900 Subject: [PATCH 02/10] Exclude files in packages/sdk/.eslintignore from linting --- lint-staged-filter.js | 36 ++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 lint-staged-filter.js diff --git a/lint-staged-filter.js b/lint-staged-filter.js new file mode 100644 index 000000000..2e9bd9649 --- /dev/null +++ b/lint-staged-filter.js @@ -0,0 +1,36 @@ +const { execSync } = require('child_process'); +const { ESLint } = require('eslint'); +const path = require('path'); + +(async function main() { + try { + // Define the path to the .eslintignore file in the sdk package + const eslintIgnorePath = path.resolve('packages/sdk/.eslintignore'); + + const eslint = new ESLint({ ignorePath: eslintIgnorePath }); + const files = process.argv.slice(2); + + // Filter out files that are ignored by ESLint using the specified .eslintignore file + const filteredFiles = ( + await Promise.all( + files.map(async (file) => { + const isIgnored = await eslint.isPathIgnored(file); + return isIgnored ? null : file; + }), + ) + ).filter(Boolean); + + if (filteredFiles.length > 0) { + const fileArgs = filteredFiles.join(' '); + const command = `pnpm --filter sdk eslint --fix --ignore-path ${eslintIgnorePath} ${fileArgs}`; + + console.log(`Running command: ${command}`); + execSync(command, { stdio: 'inherit' }); + } else { + console.log('No files to lint after filtering with .eslintignore.'); + } + } catch (error) { + console.error('Error running lint command:', error.message); + process.exit(1); + } +})(); diff --git a/package.json b/package.json index 00bd40acb..7dd2c6ccf 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,6 @@ "only-allow": "^1.2.1" }, "lint-staged": { - "packages/sdk/**/*.{js,ts,tsx}": "pnpm sdk lint" + "packages/sdk/**/*.{js,ts,tsx}": "node lint-staged-filter.js" } } From 2e16d533114dfff5476dd769a2b5fb4217293835 Mon Sep 17 00:00:00 2001 From: Paik Date: Sun, 1 Sep 2024 19:32:53 +0900 Subject: [PATCH 03/10] Install husky and lint-staged --- .husky/pre-commit | 1 + package.json | 8 +- packages/sdk/package.json | 6 - pnpm-lock.yaml | 302 +++++++++++++++++++++++++++++++++++++- 4 files changed, 303 insertions(+), 14 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 000000000..d0a778429 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged \ No newline at end of file diff --git a/package.json b/package.json index 097fbaeea..00bd40acb 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "vanilla-codemirror6": "pnpm --filter=vanilla-codemirror6", "vanilla-quill": "pnpm --filter=vanilla-quill", "vuejs-kanban": "pnpm --filter=vuejs-kanban", - "build:examples": "pnpm --filter './examples/*' run build" + "build:examples": "pnpm --filter './examples/*' run build", + "prepare": "husky" }, "keywords": [], "author": { @@ -25,6 +26,11 @@ }, "license": "Apache-2.0", "devDependencies": { + "husky": "^9.1.5", + "lint-staged": "^15.2.9", "only-allow": "^1.2.1" + }, + "lint-staged": { + "packages/sdk/**/*.{js,ts,tsx}": "pnpm sdk lint" } } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 8c263d572..f6146152a 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -57,7 +57,6 @@ "eslint-plugin-jsdoc": "^39.3.3", "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", - "husky": "^8.0.3", "prettier": "^2.7.1", "ts-node": "^10.9.1", "typedoc": "^0.25.13", @@ -74,10 +73,5 @@ "@connectrpc/connect": "^1.4.0", "@connectrpc/connect-web": "^1.4.0", "long": "^5.2.0" - }, - "husky": { - "hooks": { - "pre-commit": "pnpm lint" - } } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d1ce7d1cb..1ec1ecdd3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,12 @@ importers: .: devDependencies: + husky: + specifier: ^9.1.5 + version: 9.1.5 + lint-staged: + specifier: ^15.2.9 + version: 15.2.9 only-allow: specifier: ^1.2.1 version: 1.2.1 @@ -402,9 +408,6 @@ importers: eslint-plugin-tsdoc: specifier: ^0.2.16 version: 0.2.16 - husky: - specifier: ^8.0.3 - version: 8.0.3 prettier: specifier: ^2.7.1 version: 2.7.1 @@ -3272,6 +3275,10 @@ packages: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} + ansi-escapes@7.0.0: + resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} + engines: {node: '>=18'} + ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -3444,6 +3451,10 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + browser-fs-access@0.31.2: resolution: {integrity: sha512-wZSA7UgKMwR6oxddFQeSIoD7cxiNiaZT+iuVJw4/avr9t2ROwu80gxENT0YJChsLxJ7xBbLZDGHTAXfAg3Pq5Q==} @@ -3549,10 +3560,18 @@ packages: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} + cli-cursor@5.0.0: + resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} + engines: {node: '>=18'} + cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} + cli-truncate@4.0.0: + resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} + engines: {node: '>=18'} + cli-width@4.1.0: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} @@ -3612,6 +3631,10 @@ packages: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} @@ -3740,6 +3763,15 @@ packages: supports-color: optional: true + debug@4.3.6: + resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -3861,6 +3893,9 @@ packages: electron-to-chromium@1.5.6: resolution: {integrity: sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -3894,6 +3929,10 @@ packages: engines: {node: '>=4'} hasBin: true + environment@1.1.0: + resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} + engines: {node: '>=18'} + errno@0.1.8: resolution: {integrity: sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==} hasBin: true @@ -4140,6 +4179,9 @@ packages: eventemitter3@2.0.3: resolution: {integrity: sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==} + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} @@ -4148,6 +4190,10 @@ packages: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} + execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + expand-template@2.0.3: resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} engines: {node: '>=6'} @@ -4216,6 +4262,10 @@ packages: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -4283,6 +4333,10 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} + get-east-asian-width@1.2.0: + resolution: {integrity: sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==} + engines: {node: '>=18'} + get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} @@ -4302,6 +4356,10 @@ packages: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + get-symbol-description@1.0.2: resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} engines: {node: '>= 0.4'} @@ -4479,9 +4537,13 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} - husky@8.0.3: - resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} - engines: {node: '>=14'} + human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + + husky@9.1.5: + resolution: {integrity: sha512-rowAVRUBfI0b4+niA4SJMhfQwc107VLkBUgEYYAOQAbqDCnra1nYh83hF/MDmhYs9t9n1E3DuKOrs2LYNC+0Ag==} + engines: {node: '>=18'} hasBin: true iconv-lite@0.4.24: @@ -4614,6 +4676,14 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + is-fullwidth-code-point@4.0.0: + resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} + engines: {node: '>=12'} + + is-fullwidth-code-point@5.0.0: + resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} + engines: {node: '>=18'} + is-generator-function@1.0.10: resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} engines: {node: '>= 0.4'} @@ -4972,6 +5042,15 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + lint-staged@15.2.9: + resolution: {integrity: sha512-BZAt8Lk3sEnxw7tfxM7jeZlPRuT4M68O0/CwZhhaw6eeWu0Lz5eERE3m386InivXB64fp/mDID452h48tvKlRQ==} + engines: {node: '>=18.12.0'} + hasBin: true + + listr2@8.2.4: + resolution: {integrity: sha512-opevsywziHd3zHCVQGAj8zu+Z3yHNkkoYhWIGnq54RrCVwLz0MozotJEDnKsIBLvkfLGN6BLOyAeRrYI0pKA4g==} + engines: {node: '>=18.0.0'} + lmdb@2.5.2: resolution: {integrity: sha512-V5V5Xa2Hp9i2XsbDALkBTeHXnBXh/lEmk9p22zdr7jtuOIY9TGhjK6vAvTpOOx9IKU4hJkRWZxn/HsvR1ELLtA==} @@ -5029,6 +5108,10 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} + log-update@6.1.0: + resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} + engines: {node: '>=18'} + long@5.2.0: resolution: {integrity: sha512-9RTUNjK60eJbx3uz+TEGF7fUr29ZDxR5QzXcyDpeSfeH28S9ycINflOgOlppit5U+4kNTe83KQnMEerw7GmE8w==} @@ -5096,6 +5179,10 @@ packages: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} @@ -5118,6 +5205,14 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + + mimic-function@5.0.1: + resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} + engines: {node: '>=18'} + mimic-response@3.1.0: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} @@ -5269,6 +5364,10 @@ packages: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + nth-check@2.1.1: resolution: {integrity: sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==} @@ -5318,6 +5417,14 @@ packages: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} + onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} + + onetime@7.0.0: + resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} + engines: {node: '>=18'} + only-allow@1.2.1: resolution: {integrity: sha512-M7CJbmv7UCopc0neRKdzfoGWaVZC+xC1925GitKH9EAqYFzX9//25Q7oX4+jw0tiCCj+t5l6VZh8UPH23NZkMA==} hasBin: true @@ -5394,6 +5501,10 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} @@ -5427,6 +5538,11 @@ packages: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} @@ -5835,10 +5951,17 @@ packages: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} + restore-cursor@5.1.0: + resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} + engines: {node: '>=18'} + reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} deprecated: Rimraf versions prior to v4 are no longer supported @@ -5975,6 +6098,14 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + slice-ansi@5.0.0: + resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} + engines: {node: '>=12'} + + slice-ansi@7.1.0: + resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} + engines: {node: '>=18'} + source-map-js@1.2.0: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} @@ -6043,6 +6174,10 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + string.prototype.includes@2.0.0: resolution: {integrity: sha512-E34CkBgyeqNDcrbU76cDjL5JLcVrtSdYq0MEh/B10r17pRP4ciHLwTgnuLV8Ay6cgEMLkcBkFCKyFZ43YldYzg==} @@ -6083,6 +6218,10 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + strip-json-comments@2.0.1: resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} engines: {node: '>=0.10.0'} @@ -6742,6 +6881,10 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -10247,6 +10390,10 @@ snapshots: dependencies: type-fest: 0.21.3 + ansi-escapes@7.0.0: + dependencies: + environment: 1.1.0 + ansi-regex@5.0.1: {} ansi-regex@6.0.1: {} @@ -10440,6 +10587,10 @@ snapshots: dependencies: fill-range: 7.0.1 + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + browser-fs-access@0.31.2: {} browserslist@4.21.10: @@ -10560,8 +10711,17 @@ snapshots: dependencies: restore-cursor: 3.1.0 + cli-cursor@5.0.0: + dependencies: + restore-cursor: 5.1.0 + cli-spinners@2.9.2: {} + cli-truncate@4.0.0: + dependencies: + slice-ansi: 5.0.0 + string-width: 7.2.0 + cli-width@4.1.0: {} client-only@0.0.1: {} @@ -10626,6 +10786,8 @@ snapshots: commander@10.0.1: {} + commander@12.1.0: {} + commander@2.20.3: {} commander@4.1.1: {} @@ -10751,6 +10913,10 @@ snapshots: dependencies: ms: 2.1.2 + debug@4.3.6: + dependencies: + ms: 2.1.2 + decompress-response@6.0.0: dependencies: mimic-response: 3.1.0 @@ -10879,6 +11045,8 @@ snapshots: electron-to-chromium@1.5.6: {} + emoji-regex@10.4.0: {} + emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} @@ -10902,6 +11070,8 @@ snapshots: envinfo@7.13.0: {} + environment@1.1.0: {} + errno@0.1.8: dependencies: prr: 1.0.1 @@ -11332,6 +11502,8 @@ snapshots: eventemitter3@2.0.3: {} + eventemitter3@5.0.1: {} + events@3.3.0: {} execa@5.1.1: @@ -11346,6 +11518,18 @@ snapshots: signal-exit: 3.0.7 strip-final-newline: 2.0.0 + execa@8.0.1: + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + expand-template@2.0.3: {} extend@3.0.2: {} @@ -11425,6 +11609,10 @@ snapshots: dependencies: to-regex-range: 5.0.1 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -11492,6 +11680,8 @@ snapshots: gensync@1.0.0-beta.2: {} + get-east-asian-width@1.2.0: {} + get-func-name@2.0.2: {} get-intrinsic@1.2.4: @@ -11508,6 +11698,8 @@ snapshots: get-stream@6.0.1: {} + get-stream@8.0.1: {} + get-symbol-description@1.0.2: dependencies: call-bind: 1.0.7 @@ -11695,7 +11887,9 @@ snapshots: human-signals@2.1.0: {} - husky@8.0.3: {} + human-signals@5.0.0: {} + + husky@9.1.5: {} iconv-lite@0.4.24: dependencies: @@ -11836,6 +12030,12 @@ snapshots: is-fullwidth-code-point@3.0.0: {} + is-fullwidth-code-point@4.0.0: {} + + is-fullwidth-code-point@5.0.0: + dependencies: + get-east-asian-width: 1.2.0 + is-generator-function@1.0.10: dependencies: has-tostringtag: 1.0.2 @@ -12151,6 +12351,30 @@ snapshots: lines-and-columns@1.2.4: {} + lint-staged@15.2.9: + dependencies: + chalk: 5.3.0 + commander: 12.1.0 + debug: 4.3.6 + execa: 8.0.1 + lilconfig: 3.1.2 + listr2: 8.2.4 + micromatch: 4.0.8 + pidtree: 0.6.0 + string-argv: 0.3.2 + yaml: 2.5.0 + transitivePeerDependencies: + - supports-color + + listr2@8.2.4: + dependencies: + cli-truncate: 4.0.0 + colorette: 2.0.20 + eventemitter3: 5.0.1 + log-update: 6.1.0 + rfdc: 1.4.1 + wrap-ansi: 9.0.0 + lmdb@2.5.2: dependencies: msgpackr: 1.11.0 @@ -12216,6 +12440,14 @@ snapshots: chalk: 4.1.1 is-unicode-supported: 0.1.0 + log-update@6.1.0: + dependencies: + ansi-escapes: 7.0.0 + cli-cursor: 5.0.0 + slice-ansi: 7.1.0 + strip-ansi: 7.1.0 + wrap-ansi: 9.0.0 + long@5.2.0: {} loose-envify@1.4.0: @@ -12273,6 +12505,11 @@ snapshots: braces: 3.0.2 picomatch: 2.3.1 + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mime-db@1.52.0: {} mime-types@2.1.35: @@ -12286,6 +12523,10 @@ snapshots: mimic-fn@2.1.0: {} + mimic-fn@4.0.0: {} + + mimic-function@5.0.1: {} + mimic-response@3.1.0: {} mimic-response@4.0.0: {} @@ -12430,6 +12671,10 @@ snapshots: dependencies: path-key: 3.1.1 + npm-run-path@5.3.0: + dependencies: + path-key: 4.0.0 + nth-check@2.1.1: dependencies: boolbase: 1.0.0 @@ -12487,6 +12732,14 @@ snapshots: dependencies: mimic-fn: 2.1.0 + onetime@6.0.0: + dependencies: + mimic-fn: 4.0.0 + + onetime@7.0.0: + dependencies: + mimic-function: 5.0.1 + only-allow@1.2.1: dependencies: which-pm-runs: 1.1.0 @@ -12564,6 +12817,8 @@ snapshots: path-key@3.1.1: {} + path-key@4.0.0: {} + path-parse@1.0.7: {} path-scurry@1.11.1: @@ -12591,6 +12846,8 @@ snapshots: picomatch@2.3.1: {} + pidtree@0.6.0: {} + pify@4.0.1: optional: true @@ -13118,8 +13375,15 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 + restore-cursor@5.1.0: + dependencies: + onetime: 7.0.0 + signal-exit: 4.1.0 + reusify@1.0.4: {} + rfdc@1.4.1: {} + rimraf@3.0.2: dependencies: glob: 7.2.0 @@ -13287,6 +13551,16 @@ snapshots: slash@3.0.0: {} + slice-ansi@5.0.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 4.0.0 + + slice-ansi@7.1.0: + dependencies: + ansi-styles: 6.2.1 + is-fullwidth-code-point: 5.0.0 + source-map-js@1.2.0: {} source-map-support@0.5.20: @@ -13349,6 +13623,12 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.2.0 + strip-ansi: 7.1.0 + string.prototype.includes@2.0.0: dependencies: define-properties: 1.1.3 @@ -13409,6 +13689,8 @@ snapshots: strip-final-newline@2.0.0: {} + strip-final-newline@3.0.0: {} + strip-json-comments@2.0.1: {} strip-json-comments@3.1.1: {} @@ -14168,6 +14450,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrappy@1.0.2: {} xxhash-wasm@0.4.2: {} From 6fa194876ede888c390da35b6161c6c0a45b8968 Mon Sep 17 00:00:00 2001 From: Paik Date: Tue, 3 Sep 2024 08:53:06 +0900 Subject: [PATCH 04/10] Ignore file paths in .eslintignore --- lint-staged.config.js | 42 ++++++++++++++++++++++++++++++++++++++++++ package.json | 3 --- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 lint-staged.config.js diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 000000000..54624fa0c --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,42 @@ +const { ESLint } = require('eslint'); +const { execSync } = require('child_process'); +const path = require('path'); + +const removeIgnoredFiles = async (files) => { + const eslintIgnorePath = path.resolve('packages/sdk/.eslintignore'); + const eslint = new ESLint({ ignorePath: eslintIgnorePath }); + + const ignoreFileDir = path.dirname(eslintIgnorePath); + + const isIgnored = await Promise.all( + files.map(async (file) => { + const relativeFilePath = path.relative(ignoreFileDir, file); + const ignored = await eslint.isPathIgnored(relativeFilePath); + return ignored; + }), + ); + + const filteredFiles = files.filter((_, i) => !isIgnored[i]); + return filteredFiles; +}; + +module.exports = { + 'packages/sdk/**/*.{js,ts,tsx}': async (files) => { + const filesToLint = await removeIgnoredFiles(files); + + if (filesToLint.length > 0) { + const fileArgs = filesToLint.join(' '); + const command = `pnpm sdk lint ${fileArgs}`; + try { + execSync(command, { stdio: 'inherit' }); + process.exit(0); // Explicitly exit with 0 on success + } catch (error) { + console.error('Linting failed. Commit will be aborted.'); + process.exit(1); // Exit with 1 on failure to block the commit + } + } else { + console.log('No eligible files to lint. Skipping lint-staged command.'); + process.exit(0); // Exit with 0 since there's nothing to lint + } + }, +}; diff --git a/package.json b/package.json index 00bd40acb..3b9855040 100644 --- a/package.json +++ b/package.json @@ -29,8 +29,5 @@ "husky": "^9.1.5", "lint-staged": "^15.2.9", "only-allow": "^1.2.1" - }, - "lint-staged": { - "packages/sdk/**/*.{js,ts,tsx}": "pnpm sdk lint" } } From a28fc2986c573f2546e5c59cef501adf9d17f287 Mon Sep 17 00:00:00 2001 From: Paik Date: Tue, 3 Sep 2024 09:52:23 +0900 Subject: [PATCH 05/10] Fix the bug where unstaged file linted --- lint-staged.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lint-staged.config.js b/lint-staged.config.js index 54624fa0c..3aab53f4a 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -26,7 +26,7 @@ module.exports = { if (filesToLint.length > 0) { const fileArgs = filesToLint.join(' '); - const command = `pnpm sdk lint ${fileArgs}`; + const command = `pnpm exec eslint ${fileArgs} --fix --max-warnings=0 --ext .ts`; try { execSync(command, { stdio: 'inherit' }); process.exit(0); // Explicitly exit with 0 on success From c574f04c76a8c8031634bed601f3b5c9ddaa8848 Mon Sep 17 00:00:00 2001 From: Paik Date: Wed, 4 Sep 2024 09:39:07 +0900 Subject: [PATCH 06/10] Relocate ESLint configuration and ignore logic to root - Ensured all sub-projects follow the unified ESLint rules from the root configuration. - Moved .eslintignore to the project root for centralized management. - Updated scripts to reference the root .eslintignore file directly. - Simplified path handling logic by removing unnecessary relative path calculations. --- .eslintignore | 8 ++ .eslintrc.js | 37 +++++ examples/nextjs-scheduler/.eslintrc.js | 3 +- examples/nextjs-scheduler/package.json | 1 - lint-staged.config.js | 13 +- package.json | 6 +- packages/sdk/.eslintignore | 7 - packages/sdk/.eslintrc.js | 21 +-- packages/sdk/package.json | 4 - packages/sdk/src/document/crdt/tree.ts | 4 +- packages/sdk/src/document/document.ts | 134 +++++++++--------- packages/sdk/src/document/json/array.ts | 16 +-- packages/sdk/src/util/error.ts | 5 +- packages/sdk/test/helper/helper.ts | 11 +- .../test/unit/document/crdt/counter_test.ts | 9 +- pnpm-lock.yaml | 40 ++---- 16 files changed, 164 insertions(+), 155 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js delete mode 100644 packages/sdk/.eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..18d1b7429 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,8 @@ +# sdk +packages/sdk/src/api/yorkie/v1/yorkie_grpc_web_pb.d.ts +packages/sdk/src/api/yorkie/v1/yorkie_pb.d.ts +packages/sdk/src/api/yorkie/v1/resources_grpc_web_pb.d.ts +packages/sdk/src/api/yorkie/v1/resources_pb.d.ts +packages/sdk/test/vitest.d.ts +packages/sdk/dist +packages/sdk/lib diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 000000000..393a9fd1f --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,37 @@ +module.exports = { + root: true, + plugins: ['prettier', 'jsdoc'], + extends: ['eslint:recommended'], + rules: { + 'prettier/prettier': 'error', + 'object-shorthand': ['error', 'always'], + 'no-unreachable': 'error', + }, + overrides: [ + { + // TypeScript-specific configuration + files: ['**/*.ts', '**/*.tsx'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + extends: [ + 'plugin:@typescript-eslint/recommended', // TypeScript linting rules + ], + rules: { + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/ban-ts-comment': 'off', + 'jsdoc/require-jsdoc': [ + 'error', + { + contexts: ['MethodDefinition:not([accessibility="private"])'], + require: { + ClassDeclaration: true, + }, + checkConstructors: false, + enableFixer: false, + }, + ], + }, + }, + ], +}; diff --git a/examples/nextjs-scheduler/.eslintrc.js b/examples/nextjs-scheduler/.eslintrc.js index e457beedc..3c064b7d4 100644 --- a/examples/nextjs-scheduler/.eslintrc.js +++ b/examples/nextjs-scheduler/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: ['next', 'plugin:prettier/recommended'], + extends: ['next', 'plugin:prettier/recommended', '../../.eslintrc.js'], rules: { 'prettier/prettier': [ 'error', @@ -7,5 +7,6 @@ module.exports = { endOfLine: 'auto', }, ], + '@next/next/no-html-link-for-pages': 'off', }, }; diff --git a/examples/nextjs-scheduler/package.json b/examples/nextjs-scheduler/package.json index 99e1e154a..1363f0dbe 100644 --- a/examples/nextjs-scheduler/package.json +++ b/examples/nextjs-scheduler/package.json @@ -21,7 +21,6 @@ "@types/react-dom": "18.2.0", "eslint-config-next": "^14.2.5", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.0.0", "prettier": "^3.3.3", "typescript": "5.3.3" } diff --git a/lint-staged.config.js b/lint-staged.config.js index 3aab53f4a..7a2bfc2af 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -3,15 +3,12 @@ const { execSync } = require('child_process'); const path = require('path'); const removeIgnoredFiles = async (files) => { - const eslintIgnorePath = path.resolve('packages/sdk/.eslintignore'); + const eslintIgnorePath = path.resolve('.eslintignore'); // Pointing to the root .eslintignore const eslint = new ESLint({ ignorePath: eslintIgnorePath }); - const ignoreFileDir = path.dirname(eslintIgnorePath); - const isIgnored = await Promise.all( files.map(async (file) => { - const relativeFilePath = path.relative(ignoreFileDir, file); - const ignored = await eslint.isPathIgnored(relativeFilePath); + const ignored = await eslint.isPathIgnored(file); return ignored; }), ); @@ -29,14 +26,14 @@ module.exports = { const command = `pnpm exec eslint ${fileArgs} --fix --max-warnings=0 --ext .ts`; try { execSync(command, { stdio: 'inherit' }); - process.exit(0); // Explicitly exit with 0 on success + process.exit(0); } catch (error) { console.error('Linting failed. Commit will be aborted.'); - process.exit(1); // Exit with 1 on failure to block the commit + process.exit(1); } } else { console.log('No eligible files to lint. Skipping lint-staged command.'); - process.exit(0); // Exit with 0 since there's nothing to lint + process.exit(0); } }, }; diff --git a/package.json b/package.json index 3b9855040..9e91c575e 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "vanilla-quill": "pnpm --filter=vanilla-quill", "vuejs-kanban": "pnpm --filter=vuejs-kanban", "build:examples": "pnpm --filter './examples/*' run build", + "lint": "eslint . --fix --max-warnings=0 --ext .ts", "prepare": "husky" }, "keywords": [], @@ -26,8 +27,11 @@ }, "license": "Apache-2.0", "devDependencies": { + "eslint": "^8.19.0", "husky": "^9.1.5", "lint-staged": "^15.2.9", - "only-allow": "^1.2.1" + "only-allow": "^1.2.1", + "eslint-plugin-jsdoc": "^39.3.3", + "eslint-plugin-prettier": "^5.0.0" } } diff --git a/packages/sdk/.eslintignore b/packages/sdk/.eslintignore deleted file mode 100644 index 74db35493..000000000 --- a/packages/sdk/.eslintignore +++ /dev/null @@ -1,7 +0,0 @@ -src/api/yorkie/v1/yorkie_grpc_web_pb.d.ts -src/api/yorkie/v1/yorkie_pb.d.ts -src/api/yorkie/v1/resources_grpc_web_pb.d.ts -src/api/yorkie/v1/resources_pb.d.ts -test/vitest.d.ts -dist -lib diff --git a/packages/sdk/.eslintrc.js b/packages/sdk/.eslintrc.js index 9a97ca422..4a1eee5d8 100644 --- a/packages/sdk/.eslintrc.js +++ b/packages/sdk/.eslintrc.js @@ -1,15 +1,13 @@ // eslint-disable-next-line no-undef module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'prettier', 'eslint-plugin-tsdoc', 'jsdoc'], extends: [ - 'eslint:recommended', + '../../.eslintrc.js', // Extends the root ESLint configuration (which includes prettier) 'plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended', ], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], // No need to include prettier here rules: { - 'prettier/prettier': 'error', '@typescript-eslint/naming-convention': [ 'error', { @@ -30,19 +28,6 @@ module.exports = { ], '@typescript-eslint/array-type': ['error', { default: 'generic' }], 'tsdoc/syntax': 'error', - 'object-shorthand': ['error', 'always'], - 'no-unreachable': 'error', - 'jsdoc/require-jsdoc': [ - 'error', - { - contexts: ['MethodDefinition:not([accessibility="private"])'], - require: { - ClassDeclaration: true, - }, - checkConstructors: false, - enableFixer: false, - }, - ], '@typescript-eslint/no-this-alias': [ 'error', { diff --git a/packages/sdk/package.json b/packages/sdk/package.json index f6146152a..36114d18d 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -22,7 +22,6 @@ "test:bench": "vitest bench", "test:ci": "vitest run --coverage", "test:yorkie.dev": "TEST_RPC_ADDR=https://api.yorkie.dev vitest run --coverage", - "lint": "eslint . --fix --max-warnings=0 --ext .ts", "prepare": "pnpm build" }, "engines": { @@ -53,9 +52,6 @@ "@typescript-eslint/parser": "^6.21.0", "@vitest/coverage-istanbul": "^0.34.5", "@vitest/coverage-v8": "^0.34.5", - "eslint": "^8.19.0", - "eslint-plugin-jsdoc": "^39.3.3", - "eslint-plugin-prettier": "^4.2.1", "eslint-plugin-tsdoc": "^0.2.16", "prettier": "^2.7.1", "ts-node": "^10.9.1", diff --git a/packages/sdk/src/document/crdt/tree.ts b/packages/sdk/src/document/crdt/tree.ts index 7c5800205..03127041a 100644 --- a/packages/sdk/src/document/crdt/tree.ts +++ b/packages/sdk/src/document/crdt/tree.ts @@ -1371,8 +1371,8 @@ export class CRDTTree extends CRDTElement implements GCParent { const treePos = node.isText ? { node, offset: 0 } : parentNode && leftChildNode - ? this.toTreePos(parentNode, leftChildNode) - : null; + ? this.toTreePos(parentNode, leftChildNode) + : null; if (treePos) { index = this.indexTree.indexOf(treePos); diff --git a/packages/sdk/src/document/document.ts b/packages/sdk/src/document/document.ts index 9343b6353..bf4e2fb8e 100644 --- a/packages/sdk/src/document/document.ts +++ b/packages/sdk/src/document/document.ts @@ -412,14 +412,14 @@ export type DocumentKey = string; type OperationInfoOfElement = TElement extends Text ? TextOperationInfo : TElement extends Counter - ? CounterOperationInfo - : TElement extends Tree - ? TreeOperationInfo - : TElement extends BaseArray - ? ArrayOperationInfo - : TElement extends BaseObject - ? ObjectOperationInfo - : OperationInfo; + ? CounterOperationInfo + : TElement extends Tree + ? TreeOperationInfo + : TElement extends BaseArray + ? ArrayOperationInfo + : TElement extends BaseObject + ? ObjectOperationInfo + : OperationInfo; /** * `OperationInfoOfInternal` represents the type of the operation info of the @@ -440,24 +440,24 @@ type OperationInfoOfInternal< > = TDepth extends 0 ? TElement : TKeyOrPath extends `${infer TFirst}.${infer TRest}` - ? TFirst extends keyof TElement - ? TElement[TFirst] extends BaseArray - ? OperationInfoOfInternal< - TElement[TFirst], - number, - DecreasedDepthOf - > - : OperationInfoOfInternal< - TElement[TFirst], - TRest, - DecreasedDepthOf - > - : OperationInfo - : TKeyOrPath extends keyof TElement - ? TElement[TKeyOrPath] extends BaseArray - ? ArrayOperationInfo - : OperationInfoOfElement - : OperationInfo; + ? TFirst extends keyof TElement + ? TElement[TFirst] extends BaseArray + ? OperationInfoOfInternal< + TElement[TFirst], + number, + DecreasedDepthOf + > + : OperationInfoOfInternal< + TElement[TFirst], + TRest, + DecreasedDepthOf + > + : OperationInfo + : TKeyOrPath extends keyof TElement + ? TElement[TKeyOrPath] extends BaseArray + ? ArrayOperationInfo + : OperationInfoOfElement + : OperationInfo; /** * `DecreasedDepthOf` represents the type of the decreased depth of the given depth. @@ -465,24 +465,24 @@ type OperationInfoOfInternal< type DecreasedDepthOf = Depth extends 10 ? 9 : Depth extends 9 - ? 8 - : Depth extends 8 - ? 7 - : Depth extends 7 - ? 6 - : Depth extends 6 - ? 5 - : Depth extends 5 - ? 4 - : Depth extends 4 - ? 3 - : Depth extends 3 - ? 2 - : Depth extends 2 - ? 1 - : Depth extends 1 - ? 0 - : -1; + ? 8 + : Depth extends 8 + ? 7 + : Depth extends 7 + ? 6 + : Depth extends 6 + ? 5 + : Depth extends 5 + ? 4 + : Depth extends 4 + ? 3 + : Depth extends 3 + ? 2 + : Depth extends 2 + ? 1 + : Depth extends 1 + ? 0 + : -1; /** * `PathOfInternal` represents the type of the path of the given element. @@ -494,29 +494,29 @@ type PathOfInternal< > = Depth extends 0 ? Prefix : TElement extends Record - ? { - [TKey in keyof TElement]: TElement[TKey] extends LeafElement - ? `${Prefix}${TKey & string}` - : TElement[TKey] extends BaseArray - ? - | `${Prefix}${TKey & string}` - | `${Prefix}${TKey & string}.${number}` - | PathOfInternal< - TArrayElement, - `${Prefix}${TKey & string}.${number}.`, - DecreasedDepthOf - > - : - | `${Prefix}${TKey & string}` - | PathOfInternal< - TElement[TKey], - `${Prefix}${TKey & string}.`, - DecreasedDepthOf - >; - }[keyof TElement] - : Prefix extends `${infer TRest}.` - ? TRest - : Prefix; + ? { + [TKey in keyof TElement]: TElement[TKey] extends LeafElement + ? `${Prefix}${TKey & string}` + : TElement[TKey] extends BaseArray + ? + | `${Prefix}${TKey & string}` + | `${Prefix}${TKey & string}.${number}` + | PathOfInternal< + TArrayElement, + `${Prefix}${TKey & string}.${number}.`, + DecreasedDepthOf + > + : + | `${Prefix}${TKey & string}` + | PathOfInternal< + TElement[TKey], + `${Prefix}${TKey & string}.`, + DecreasedDepthOf + >; + }[keyof TElement] + : Prefix extends `${infer TRest}.` + ? TRest + : Prefix; /** * `OperationInfoOf` represents the type of the operation info of the given diff --git a/packages/sdk/src/document/json/array.ts b/packages/sdk/src/document/json/array.ts index f319aecb0..fd054cd87 100644 --- a/packages/sdk/src/document/json/array.ts +++ b/packages/sdk/src/document/json/array.ts @@ -557,8 +557,8 @@ export class ArrayProxy { deleteCount === undefined ? length : deleteCount < 0 - ? from - : Math.min(from + deleteCount, length); + ? from + : Math.min(from + deleteCount, length); const removeds: JSONArray = []; for (let i = from; i < to; i++) { const removed = ArrayProxy.deleteInternalByIndex(context, target, from); @@ -598,8 +598,8 @@ export class ArrayProxy { fromIndex === undefined ? 0 : fromIndex < 0 - ? Math.max(fromIndex + length, 0) - : fromIndex; + ? Math.max(fromIndex + length, 0) + : fromIndex; if (from >= length) return false; @@ -634,8 +634,8 @@ export class ArrayProxy { fromIndex === undefined ? 0 : fromIndex < 0 - ? Math.max(fromIndex + length, 0) - : fromIndex; + ? Math.max(fromIndex + length, 0) + : fromIndex; if (from >= length) return -1; @@ -670,8 +670,8 @@ export class ArrayProxy { fromIndex === undefined || fromIndex >= length ? length - 1 : fromIndex < 0 - ? fromIndex + length - : fromIndex; + ? fromIndex + length + : fromIndex; if (from < 0) return -1; diff --git a/packages/sdk/src/util/error.ts b/packages/sdk/src/util/error.ts index bf83407d4..bd6a64707 100644 --- a/packages/sdk/src/util/error.ts +++ b/packages/sdk/src/util/error.ts @@ -68,7 +68,10 @@ export class YorkieError extends Error { name = 'YorkieError'; stack?: string; - constructor(readonly code: Code, readonly message: string) { + constructor( + readonly code: Code, + readonly message: string, + ) { super(message); this.toString = (): string => `[code=${this.code}]: ${this.message}`; } diff --git a/packages/sdk/test/helper/helper.ts b/packages/sdk/test/helper/helper.ts index 167698d82..041ed557f 100644 --- a/packages/sdk/test/helper/helper.ts +++ b/packages/sdk/test/helper/helper.ts @@ -118,10 +118,13 @@ export function deepSort(target: any): any { if (typeof target === 'object') { return Object.keys(target) .sort() - .reduce((result, key) => { - result[key] = deepSort(target[key]); - return result; - }, {} as Record); + .reduce( + (result, key) => { + result[key] = deepSort(target[key]); + return result; + }, + {} as Record, + ); } return target; } diff --git a/packages/sdk/test/unit/document/crdt/counter_test.ts b/packages/sdk/test/unit/document/crdt/counter_test.ts index d4d4f0a0e..e11446b66 100644 --- a/packages/sdk/test/unit/document/crdt/counter_test.ts +++ b/packages/sdk/test/unit/document/crdt/counter_test.ts @@ -53,9 +53,12 @@ describe('Counter', function () { ? counter.getValue() : operand.getValue(); - assert.throw(() => { - counter.increase(operand); - }, `Unsupported type of value: ${typeof errValue}`); + assert.throw( + () => { + counter.increase(operand); + }, + `Unsupported type of value: ${typeof errValue}`, + ); } const str = Primitive.of('hello', InitialTimeTicket); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1ec1ecdd3..f2c3564b2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,15 @@ importers: .: devDependencies: + eslint: + specifier: ^8.19.0 + version: 8.19.0 + eslint-plugin-jsdoc: + specifier: ^39.3.3 + version: 39.3.3(eslint@8.19.0) + eslint-plugin-prettier: + specifier: ^5.0.0 + version: 5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@8.19.0))(eslint@8.19.0)(prettier@3.3.3) husky: specifier: ^9.1.5 version: 9.1.5 @@ -51,9 +60,6 @@ importers: eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@8.19.0) - eslint-plugin-prettier: - specifier: ^5.0.0 - version: 5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@8.19.0))(eslint@8.19.0)(prettier@3.3.3) prettier: specifier: ^3.3.3 version: 3.3.3 @@ -396,15 +402,6 @@ importers: '@vitest/coverage-v8': specifier: ^0.34.5 version: 0.34.6(vitest@0.34.6(less@4.2.0)(lightningcss@1.23.0)(sass@1.70.0)(terser@5.31.3)) - eslint: - specifier: ^8.19.0 - version: 8.19.0 - eslint-plugin-jsdoc: - specifier: ^39.3.3 - version: 39.3.3(eslint@8.19.0) - eslint-plugin-prettier: - specifier: ^4.2.1 - version: 4.2.1(eslint@8.19.0)(prettier@2.7.1) eslint-plugin-tsdoc: specifier: ^0.2.16 version: 0.2.16 @@ -4075,17 +4072,6 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 - eslint-plugin-prettier@4.2.1: - resolution: {integrity: sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==} - engines: {node: '>=12.0.0'} - peerDependencies: - eslint: '>=7.28.0' - eslint-config-prettier: '*' - prettier: '>=2.0.0' - peerDependenciesMeta: - eslint-config-prettier: - optional: true - eslint-plugin-prettier@5.2.1: resolution: {integrity: sha512-gH3iR3g4JfF+yYPaJYkN7jEl9QbweL/YfkoRlNnuIEHEz1vHVlCmWOS+eGGiRuzHQXdJFCOTxRgvju9b8VUmrw==} engines: {node: ^14.18.0 || >=16.0.0} @@ -11337,7 +11323,7 @@ snapshots: dependencies: '@es-joy/jsdoccomment': 0.31.0 comment-parser: 1.3.1 - debug: 4.3.4 + debug: 4.3.6 escape-string-regexp: 4.0.0 eslint: 8.19.0 esquery: 1.4.0 @@ -11366,12 +11352,6 @@ snapshots: safe-regex-test: 1.0.3 string.prototype.includes: 2.0.0 - eslint-plugin-prettier@4.2.1(eslint@8.19.0)(prettier@2.7.1): - dependencies: - eslint: 8.19.0 - prettier: 2.7.1 - prettier-linter-helpers: 1.0.0 - eslint-plugin-prettier@5.2.1(@types/eslint@9.6.0)(eslint-config-prettier@9.1.0(eslint@8.19.0))(eslint@8.19.0)(prettier@3.3.3): dependencies: eslint: 8.19.0 From 110b9f6d0a89292324347498489c0339bef2030c Mon Sep 17 00:00:00 2001 From: Paik Date: Wed, 4 Sep 2024 09:45:47 +0900 Subject: [PATCH 07/10] Update ci.yml lint command --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0488472fd..9f399dc4b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,7 +41,7 @@ jobs: if: steps.cache.outputs.cache-hit != 'true' run: pnpm install - - run: pnpm sdk lint + - run: pnpm lint - run: pnpm sdk build - run: pnpm build:examples - run: docker compose -f docker/docker-compose-ci.yml up --build -d From f0b4c6fbf241f446fe4f7dbff2177d448babd18d Mon Sep 17 00:00:00 2001 From: Paik Date: Fri, 6 Sep 2024 09:13:41 +0900 Subject: [PATCH 08/10] Remove unncessary files --- .eslintrc.js | 36 ++++++++++++++++++++++++++++++------ lint-staged-filter.js | 36 ------------------------------------ lint-staged.config.js | 2 +- package.json | 3 --- packages/sdk/.eslintrc.js | 35 ++--------------------------------- 5 files changed, 33 insertions(+), 79 deletions(-) delete mode 100644 lint-staged-filter.js diff --git a/.eslintrc.js b/.eslintrc.js index 393a9fd1f..98c033a23 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,11 @@ module.exports = { root: true, - plugins: ['prettier', 'jsdoc'], - extends: ['eslint:recommended'], + plugins: ['prettier', 'jsdoc', '@typescript-eslint'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/eslint-recommended', + 'plugin:@typescript-eslint/recommended', + ], rules: { 'prettier/prettier': 'error', 'object-shorthand': ['error', 'always'], @@ -9,13 +13,10 @@ module.exports = { }, overrides: [ { - // TypeScript-specific configuration files: ['**/*.ts', '**/*.tsx'], parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], - extends: [ - 'plugin:@typescript-eslint/recommended', // TypeScript linting rules - ], + extends: ['plugin:@typescript-eslint/recommended'], rules: { '@typescript-eslint/no-non-null-assertion': 'off', '@typescript-eslint/no-explicit-any': 'off', @@ -31,6 +32,29 @@ module.exports = { enableFixer: false, }, ], + '@typescript-eslint/naming-convention': [ + 'error', + { + selector: 'variable', + format: ['camelCase', 'PascalCase'], + leadingUnderscore: 'allowDouble', + trailingUnderscore: 'allowDouble', + }, + ], + '@typescript-eslint/ban-types': [ + 'error', + { + types: { null: 'Use undefined instead of null' }, + }, + ], + '@typescript-eslint/array-type': ['error', { default: 'generic' }], + '@typescript-eslint/no-this-alias': [ + 'error', + { + allowDestructuring: true, + allowedNames: ['node'], + }, + ], }, }, ], diff --git a/lint-staged-filter.js b/lint-staged-filter.js deleted file mode 100644 index 2e9bd9649..000000000 --- a/lint-staged-filter.js +++ /dev/null @@ -1,36 +0,0 @@ -const { execSync } = require('child_process'); -const { ESLint } = require('eslint'); -const path = require('path'); - -(async function main() { - try { - // Define the path to the .eslintignore file in the sdk package - const eslintIgnorePath = path.resolve('packages/sdk/.eslintignore'); - - const eslint = new ESLint({ ignorePath: eslintIgnorePath }); - const files = process.argv.slice(2); - - // Filter out files that are ignored by ESLint using the specified .eslintignore file - const filteredFiles = ( - await Promise.all( - files.map(async (file) => { - const isIgnored = await eslint.isPathIgnored(file); - return isIgnored ? null : file; - }), - ) - ).filter(Boolean); - - if (filteredFiles.length > 0) { - const fileArgs = filteredFiles.join(' '); - const command = `pnpm --filter sdk eslint --fix --ignore-path ${eslintIgnorePath} ${fileArgs}`; - - console.log(`Running command: ${command}`); - execSync(command, { stdio: 'inherit' }); - } else { - console.log('No files to lint after filtering with .eslintignore.'); - } - } catch (error) { - console.error('Error running lint command:', error.message); - process.exit(1); - } -})(); diff --git a/lint-staged.config.js b/lint-staged.config.js index 7a2bfc2af..e066e6e0a 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -18,7 +18,7 @@ const removeIgnoredFiles = async (files) => { }; module.exports = { - 'packages/sdk/**/*.{js,ts,tsx}': async (files) => { + '**/*.ts': async (files) => { const filesToLint = await removeIgnoredFiles(files); if (filesToLint.length > 0) { diff --git a/package.json b/package.json index 4b83bee66..9e91c575e 100644 --- a/package.json +++ b/package.json @@ -33,8 +33,5 @@ "only-allow": "^1.2.1", "eslint-plugin-jsdoc": "^39.3.3", "eslint-plugin-prettier": "^5.0.0" - }, - "lint-staged": { - "packages/sdk/**/*.{js,ts,tsx}": "node lint-staged-filter.js" } } diff --git a/packages/sdk/.eslintrc.js b/packages/sdk/.eslintrc.js index 4a1eee5d8..b0b46766e 100644 --- a/packages/sdk/.eslintrc.js +++ b/packages/sdk/.eslintrc.js @@ -1,40 +1,9 @@ // eslint-disable-next-line no-undef module.exports = { - extends: [ - '../../.eslintrc.js', // Extends the root ESLint configuration (which includes prettier) - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - ], - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc'], // No need to include prettier here + extends: ['../../.eslintrc.js'], + plugins: ['eslint-plugin-tsdoc'], rules: { - '@typescript-eslint/naming-convention': [ - 'error', - { - selector: 'variable', - format: ['camelCase', 'PascalCase'], - leadingUnderscore: 'allowDouble', - trailingUnderscore: 'allowDouble', - }, - ], - '@typescript-eslint/no-non-null-assertion': 'off', - '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/ban-ts-comment': 'off', - '@typescript-eslint/ban-types': [ - 'error', - { - types: { null: 'Use undefined instead of null' }, - }, - ], - '@typescript-eslint/array-type': ['error', { default: 'generic' }], 'tsdoc/syntax': 'error', - '@typescript-eslint/no-this-alias': [ - 'error', - { - allowDestructuring: true, - allowedNames: ['node'], - }, - ], }, overrides: [ { From fa5f976451ee1a7070e996dfb4eb942632f359d9 Mon Sep 17 00:00:00 2001 From: Paik Date: Fri, 6 Sep 2024 09:39:49 +0900 Subject: [PATCH 09/10] Add dist folder to .eslintignore --- .eslintignore | 4 +++- examples/nextjs-scheduler/.eslintrc.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.eslintignore b/.eslintignore index 18d1b7429..4d21e2a15 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,8 +1,10 @@ +# common +**/dist/* + # sdk packages/sdk/src/api/yorkie/v1/yorkie_grpc_web_pb.d.ts packages/sdk/src/api/yorkie/v1/yorkie_pb.d.ts packages/sdk/src/api/yorkie/v1/resources_grpc_web_pb.d.ts packages/sdk/src/api/yorkie/v1/resources_pb.d.ts packages/sdk/test/vitest.d.ts -packages/sdk/dist packages/sdk/lib diff --git a/examples/nextjs-scheduler/.eslintrc.js b/examples/nextjs-scheduler/.eslintrc.js index 3c064b7d4..30dbe7adb 100644 --- a/examples/nextjs-scheduler/.eslintrc.js +++ b/examples/nextjs-scheduler/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - extends: ['next', 'plugin:prettier/recommended', '../../.eslintrc.js'], + extends: ['next', 'plugin:prettier/recommended'], rules: { 'prettier/prettier': [ 'error', From aa95c5525c2602113e4a72ef160e8ad1a6f8690f Mon Sep 17 00:00:00 2001 From: Youngteac Hong Date: Fri, 6 Sep 2024 10:25:15 +0900 Subject: [PATCH 10/10] Update .husky/pre-commit --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index d0a778429..2312dc587 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npx lint-staged \ No newline at end of file +npx lint-staged