From 88dcdf640ef38a31679faa6f58ee43ae1b7f6ec7 Mon Sep 17 00:00:00 2001 From: roudai Date: Sat, 2 May 2026 21:18:05 +0900 Subject: [PATCH 1/6] feat(ui): implement spec 003 - Vue 3 UI layer with Pinia store and LocalStorage persistence - Pinia store (cube.ts): applyMove/applySequence/reset/setSize actions wrapping pure logic functions - Vue SFCs: CubeDisplay (SVG via renderSVG), MoveInput (notation parsing + face buttons), SizeSelector (N=2-7) - useCubePersist composable: onMounted restore + watch-based auto-save to vce3-cube-state key - App.vue: root component wiring all three components with useCubePersist - Vite config, index.html, vue-tsc typecheck, happy-dom per-file environment annotations - 223 tests passing, all coverage thresholds met (95% stmts, 81% branches, 100% funcs, 98% lines) Co-Authored-By: Claude Sonnet 4.6 --- index.html | 12 + package.json | 12 +- pnpm-lock.yaml | 714 ++++++++++++++++++++++- src/App.vue | 21 + src/components/CubeDisplay.vue | 16 + src/components/MoveInput.vue | 68 +++ src/components/SizeSelector.vue | 21 + src/composables/useCubePersist.ts | 36 ++ src/main.ts | 5 + src/stores/cube.ts | 40 ++ tests/App.test.ts | 22 + tests/components/CubeDisplay.test.ts | 48 ++ tests/components/MoveInput.test.ts | 126 ++++ tests/components/SizeSelector.test.ts | 53 ++ tests/composables/useCubePersist.test.ts | 141 +++++ tests/stores/cube.test.ts | 115 ++++ tsconfig.json | 2 +- vite.config.ts | 6 + vitest.config.ts | 16 +- 19 files changed, 1460 insertions(+), 14 deletions(-) create mode 100644 index.html create mode 100644 src/App.vue create mode 100644 src/components/CubeDisplay.vue create mode 100644 src/components/MoveInput.vue create mode 100644 src/components/SizeSelector.vue create mode 100644 src/composables/useCubePersist.ts create mode 100644 src/main.ts create mode 100644 src/stores/cube.ts create mode 100644 tests/App.test.ts create mode 100644 tests/components/CubeDisplay.test.ts create mode 100644 tests/components/MoveInput.test.ts create mode 100644 tests/components/SizeSelector.test.ts create mode 100644 tests/composables/useCubePersist.test.ts create mode 100644 tests/stores/cube.test.ts create mode 100644 vite.config.ts diff --git a/index.html b/index.html new file mode 100644 index 0000000..f6f5b3b --- /dev/null +++ b/index.html @@ -0,0 +1,12 @@ + + + + + + Visual Cube Editor 3 + + +
+ + + diff --git a/package.json b/package.json index f120bcf..9b6f85d 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "test": "vitest run", "test:watch": "vitest", "test:coverage": "vitest run --coverage", - "typecheck": "tsc --noEmit", + "typecheck": "vue-tsc --noEmit", "lint": "eslint .", "format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"" }, @@ -19,17 +19,23 @@ "devDependencies": { "@typescript-eslint/eslint-plugin": "^8.59.0", "@typescript-eslint/parser": "^8.59.0", + "@vitejs/plugin-vue": "^6.0.6", "@vitest/coverage-v8": "^4.1.5", + "@vue/test-utils": "^2.4.10", "eslint": "^10.2.1", "eslint-config-prettier": "^10.1.8", + "happy-dom": "^20.9.0", "prettier": "^3.8.3", "typescript": "^6.0.3", "vite": "^8.0.10", - "vitest": "^4.1.5" + "vitest": "^4.1.5", + "vue-tsc": "^3.2.7" }, "dependencies": { "@resvg/resvg-js": "^2.6.2", + "pinia": "^3.0.4", "sr-visualizer": "^1.0.13", - "svgdom": "^0.1.23" + "svgdom": "^0.1.23", + "vue": "^3.5.33" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62dc36a..94ffdfb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,12 +11,18 @@ importers: '@resvg/resvg-js': specifier: ^2.6.2 version: 2.6.2 + pinia: + specifier: ^3.0.4 + version: 3.0.4(typescript@6.0.3)(vue@3.5.33(typescript@6.0.3)) sr-visualizer: specifier: ^1.0.13 version: 1.0.13 svgdom: specifier: ^0.1.23 version: 0.1.23 + vue: + specifier: ^3.5.33 + version: 3.5.33(typescript@6.0.3) devDependencies: '@typescript-eslint/eslint-plugin': specifier: ^8.59.0 @@ -24,15 +30,24 @@ importers: '@typescript-eslint/parser': specifier: ^8.59.0 version: 8.59.0(eslint@10.2.1)(typescript@6.0.3) + '@vitejs/plugin-vue': + specifier: ^6.0.6 + version: 6.0.6(vite@8.0.10(@types/node@25.6.0))(vue@3.5.33(typescript@6.0.3)) '@vitest/coverage-v8': specifier: ^4.1.5 version: 4.1.5(vitest@4.1.5) + '@vue/test-utils': + specifier: ^2.4.10 + version: 2.4.10(@vue/compiler-dom@3.5.33)(@vue/server-renderer@3.5.33(vue@3.5.33(typescript@6.0.3)))(vue@3.5.33(typescript@6.0.3)) eslint: specifier: ^10.2.1 version: 10.2.1 eslint-config-prettier: specifier: ^10.1.8 version: 10.1.8(eslint@10.2.1) + happy-dom: + specifier: ^20.9.0 + version: 20.9.0 prettier: specifier: ^3.8.3 version: 3.8.3 @@ -41,10 +56,13 @@ importers: version: 6.0.3 vite: specifier: ^8.0.10 - version: 8.0.10 + version: 8.0.10(@types/node@25.6.0) vitest: specifier: ^4.1.5 - version: 4.1.5(@vitest/coverage-v8@4.1.5)(vite@8.0.10) + version: 4.1.5(@types/node@25.6.0)(@vitest/coverage-v8@4.1.5)(happy-dom@20.9.0)(vite@8.0.10(@types/node@25.6.0)) + vue-tsc: + specifier: ^3.2.7 + version: 3.2.7(typescript@6.0.3) packages: @@ -128,6 +146,10 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} @@ -144,9 +166,16 @@ packages: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 + '@one-ini/wasm@0.1.1': + resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} + '@oxc-project/types@0.127.0': resolution: {integrity: sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==} + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + '@resvg/resvg-js-android-arm-eabi@2.6.2': resolution: {integrity: sha512-FrJibrAk6v29eabIPgcTUMPXiEz8ssrAk7TXxsiZzww9UTQ1Z5KAbFJs+Z0Ez+VZTYgnE5IQJqBcoSiMebtPHA==} engines: {node: '>= 10'} @@ -322,6 +351,9 @@ packages: cpu: [x64] os: [win32] + '@rolldown/pluginutils@1.0.0-rc.13': + resolution: {integrity: sha512-3ngTAv6F/Py35BsYbeeLeecvhMKdsKm4AoOETVhAA+Qc8nrA2I0kF7oa93mE9qnIurngOSpMnQ0x2nQY2FPviA==} + '@rolldown/pluginutils@1.0.0-rc.17': resolution: {integrity: sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==} @@ -349,6 +381,15 @@ packages: '@types/json-schema@7.0.15': resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} + '@types/node@25.6.0': + resolution: {integrity: sha512-+qIYRKdNYJwY3vRCZMdJbPLJAtGjQBudzZzdzwQYkEPQd+PJGixUL5QfvCLDaULoLv+RhT3LDkwEfKaAkgSmNQ==} + + '@types/whatwg-mimetype@3.0.2': + resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==} + + '@types/ws@8.18.1': + resolution: {integrity: sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==} + '@typescript-eslint/eslint-plugin@8.59.0': resolution: {integrity: sha512-HyAZtpdkgZwpq8Sz3FSUvCR4c+ScbuWa9AksK2Jweub7w4M3yTz4O11AqVJzLYjy/B9ZWPyc81I+mOdJU/bDQw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -408,6 +449,13 @@ packages: resolution: {integrity: sha512-/uejZt4dSere1bx12WLlPfv8GktzcaDtuJ7s42/HEZ5zGj9oxRaD4bj7qwSunXkf+pbAhFt2zjpHYUiT5lHf0Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vitejs/plugin-vue@6.0.6': + resolution: {integrity: sha512-u9HHgfrq3AjXlysn0eINFnWQOJQLO9WN6VprZ8FXl7A2bYisv3Hui9Ij+7QZ41F/WYWarHjwBbXtD7dKg3uxbg==} + engines: {node: ^20.19.0 || >=22.12.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + vue: ^3.2.25 + '@vitest/coverage-v8@4.1.5': resolution: {integrity: sha512-38C0/Ddb7HcRG0Z4/DUem8x57d2p9jYgp18mkaYswEOQBGsI1CG4f/hjm0ZCeaJfWhSZ4k7jgs29V1Zom7Ki9A==} peerDependencies: @@ -446,6 +494,70 @@ packages: '@vitest/utils@4.1.5': resolution: {integrity: sha512-76wdkrmfXfqGjueGgnb45ITPyUi1ycZ4IHgC2bhPDUfWHklY/q3MdLOAB+TF1e6xfl8NxNY0ZYaPCFNWSsw3Ug==} + '@volar/language-core@2.4.28': + resolution: {integrity: sha512-w4qhIJ8ZSitgLAkVay6AbcnC7gP3glYM3fYwKV3srj8m494E3xtrCv6E+bWviiK/8hs6e6t1ij1s2Endql7vzQ==} + + '@volar/source-map@2.4.28': + resolution: {integrity: sha512-yX2BDBqJkRXfKw8my8VarTyjv48QwxdJtvRgUpNE5erCsgEUdI2DsLbpa+rOQVAJYshY99szEcRDmyHbF10ggQ==} + + '@volar/typescript@2.4.28': + resolution: {integrity: sha512-Ja6yvWrbis2QtN4ClAKreeUZPVYMARDYZl9LMEv1iQ1QdepB6wn0jTRxA9MftYmYa4DQ4k/DaSZpFPUfxl8giw==} + + '@vue/compiler-core@3.5.33': + resolution: {integrity: sha512-3PZLQwFw4Za3TC8t0FvTy3wI16Kt+pmwcgNZca4Pj9iWL2E72a/gZlpBtAJvEdDMdCxdG/qq0C7PN0bsJuv0Rw==} + + '@vue/compiler-dom@3.5.33': + resolution: {integrity: sha512-PXq0yrfCLzzL07rbXO4awtXY1Z06LG2eu6Adg3RJFa/j3Cii217XxxLXG22N330gw7GmALCY0Z8RgXEviwgpjA==} + + '@vue/compiler-sfc@3.5.33': + resolution: {integrity: sha512-UTUvRO9cY+rROrx/pvN9P5Z7FgA6QGfokUCfhQE4EnmUj3rVnK+CHI0LsEO1pg+I7//iRYMUfcNcCPe7tg0CoA==} + + '@vue/compiler-ssr@3.5.33': + resolution: {integrity: sha512-IErjYdnj1qIupG5xxiVIYiiRvDhGWV4zuh/RCrwfYpuL+HWQzeU6lCk/nF9r7olWMnjKxCAkOctT2qFWFkzb1A==} + + '@vue/devtools-api@7.7.9': + resolution: {integrity: sha512-kIE8wvwlcZ6TJTbNeU2HQNtaxLx3a84aotTITUuL/4bzfPxzajGBOoqjMhwZJ8L9qFYDU/lAYMEEm11dnZOD6g==} + + '@vue/devtools-kit@7.7.9': + resolution: {integrity: sha512-PyQ6odHSgiDVd4hnTP+aDk2X4gl2HmLDfiyEnn3/oV+ckFDuswRs4IbBT7vacMuGdwY/XemxBoh302ctbsptuA==} + + '@vue/devtools-shared@7.7.9': + resolution: {integrity: sha512-iWAb0v2WYf0QWmxCGy0seZNDPdO3Sp5+u78ORnyeonS6MT4PC7VPrryX2BpMJrwlDeaZ6BD4vP4XKjK0SZqaeA==} + + '@vue/language-core@3.2.7': + resolution: {integrity: sha512-Gn4q/tRxbpVGLEuARQ43p3YELlNAFgRUVCgW9U5Cr+5q4vfD2bWDWpl3ABbJMXUt5xlE1dF8dkigg2aUq7JYYw==} + + '@vue/reactivity@3.5.33': + resolution: {integrity: sha512-p8UfIqyIhb0rYGlSgSBV+lPhF2iUSBcRy7enhTmPqKWadHy9kcOFYF1AejYBP9P+avnd3OBbD49DU4pLWX/94A==} + + '@vue/runtime-core@3.5.33': + resolution: {integrity: sha512-UpFF45RI9//a7rvq7RdOQblb4tup7hHG9QsmIrxkFQLzQ7R8/iNQ5LE15NhLZ1/WcHMU2b47u6P33CPUelHyIQ==} + + '@vue/runtime-dom@3.5.33': + resolution: {integrity: sha512-IOxMsAOwquhfITgmOgaPYl7/j8gKUxUFoflRc+u4LxyD3+783xne8vNta1PONVCvCV9A0w7hkyEepINDqfO0tw==} + + '@vue/server-renderer@3.5.33': + resolution: {integrity: sha512-0xylq/8/h44lVG0pZFknv1XIdEgymq2E9n59uTWJBG+dIgiT0TMCSsxrN7nO16Z0MU0MPjFcguBbZV8Itk52Hw==} + peerDependencies: + vue: 3.5.33 + + '@vue/shared@3.5.33': + resolution: {integrity: sha512-5vR2QIlmaLG77Ygd4pMP6+SGQ5yox9VhtnbDWTy9DzMzdmeLxZ1QqxrywEZ9sa1AVubfIJyaCG3ytyWU81ufcQ==} + + '@vue/test-utils@2.4.10': + resolution: {integrity: sha512-SmoZ5EA1kYiAFs9NkYdiFFQF+cSnUwnvlYEbY+DogWQZUiqOm/Y29eSbc5T6yi75SgSF9863SBeXniIEoPajCA==} + peerDependencies: + '@vue/compiler-dom': 3.x + '@vue/server-renderer': 3.x + vue: 3.x + peerDependenciesMeta: + '@vue/server-renderer': + optional: true + + abbrev@2.0.0: + resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -459,6 +571,25 @@ packages: ajv@6.15.0: resolution: {integrity: sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==} + alien-signals@3.1.2: + resolution: {integrity: sha512-d9dYqZTS90WLiU0I5c6DHj/HcKkF8ZyGN3G5x8wSbslulz70KOxaqCT0hQCo9KOyhVqzqGojvNdJXoTumZOtcw==} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} + engines: {node: '>=12'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} + engines: {node: '>=12'} + assertion-error@2.0.1: resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} engines: {node: '>=12'} @@ -466,6 +597,9 @@ packages: ast-v8-to-istanbul@1.0.0: resolution: {integrity: sha512-1fSfIwuDICFA4LKkCzRPO7F0hzFf0B7+Xqrl27ynQaa+Rh0e1Es0v6kWHPott3lU10AyAr7oKHa65OppjLn3Rg==} + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + balanced-match@4.0.4: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} @@ -473,6 +607,12 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + birpc@2.9.0: + resolution: {integrity: sha512-KrayHS5pBi69Xi9JmvoqrIgYGDkD6mcSe/i6YKi3w5kekCLzrX4+nawcXqrj2tIp50Kw/mT/s3p+GVK0A0sKxw==} + + brace-expansion@2.1.0: + resolution: {integrity: sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==} + brace-expansion@5.0.5: resolution: {integrity: sha512-VZznLgtwhn+Mact9tfiwx64fA9erHH/MCXEUfB/0bX/6Fz6ny5EGTXYltMocqg4xFAQZtnO3DHWWXi8RiuN7cQ==} engines: {node: 18 || 20 || >=22} @@ -488,13 +628,34 @@ packages: resolution: {integrity: sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==} engines: {node: '>=0.8'} + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + commander@10.0.1: + resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} + engines: {node: '>=14'} + + config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + copy-anything@4.0.5: + resolution: {integrity: sha512-7Vv6asjS4gMOuILabD3l739tsaxFQmC+a7pLZm02zyvs8p977bL3zEgq3yDk5rn9B0PbYgIv++jmHcuUab4RhA==} + engines: {node: '>=18'} + cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} + csstype@3.2.3: + resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + debug@4.4.3: resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} @@ -514,6 +675,24 @@ packages: dfa@1.2.0: resolution: {integrity: sha512-ED3jP8saaweFTjeGX8HQPjeC1YYyZs98jGNZx6IiBvxW7JG5v492kamAQB3m2wop07CvU/RQmzcKr6bgcC5D/Q==} + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + editorconfig@1.0.7: + resolution: {integrity: sha512-e0GOtq/aTQhVdNyDU9e02+wz9oDDM+SIOQxWME2QRjzRX5yyLAuHDE+0aE8vHb9XRC8XD37eO2u57+F09JqFhw==} + engines: {node: '>=14'} + hasBin: true + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + entities@7.0.1: + resolution: {integrity: sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==} + engines: {node: '>=0.12'} + es-module-lexer@2.1.0: resolution: {integrity: sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ==} @@ -565,6 +744,9 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} @@ -612,6 +794,10 @@ packages: fontkit@2.0.4: resolution: {integrity: sha512-syetQadaUEDNdxdugga9CpEYVaQIxOwk7GlwZWWZ19//qW4zE5bknOKeMBDYAASwnpaSHKJITRLMF9m1fp3s6g==} + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} + engines: {node: '>=14'} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -621,10 +807,22 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} + glob@10.5.0: + resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==} + deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me + hasBin: true + + happy-dom@20.9.0: + resolution: {integrity: sha512-GZZ9mKe8r646NUAf/zemnGbjYh4Bt8/MqASJY+pSm5ZDtc3YQox+4gsLI7yi1hba6o+eCsGxpHn5+iEVn31/FQ==} + engines: {node: '>=20.0.0'} + has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -648,14 +846,25 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + ini@1.3.8: + resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-what@5.5.0: + resolution: {integrity: sha512-oG7cgbmg5kLYae2N5IVd3jm2s+vldjxJzK1pcu9LfpGuQ93MQSzo0okvRna+7y5ifrD+20FE8FvjusyGaz14fw==} + engines: {node: '>=18'} + isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} @@ -671,6 +880,18 @@ packages: resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} engines: {node: '>=8'} + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + + js-beautify@1.15.4: + resolution: {integrity: sha512-9/KXeZUKKJwqCXUdBxFJ3vPh467OCckSBmYDwSK/EtV090K+iMJ7zx2S3HLVDIWFQdqMIsZWbnaGiba18aWhaA==} + engines: {node: '>=14'} + hasBin: true + + js-cookie@3.0.5: + resolution: {integrity: sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==} + engines: {node: '>=14'} + js-tokens@10.0.0: resolution: {integrity: sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==} @@ -768,6 +989,9 @@ packages: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} @@ -782,9 +1006,23 @@ packages: resolution: {integrity: sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==} engines: {node: 18 || 20 || >=22} + minimatch@9.0.9: + resolution: {integrity: sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==} + engines: {node: '>=16 || 14 >=14.17'} + + minipass@7.1.3: + resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} + engines: {node: '>=16 || 14 >=14.17'} + + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + muggle-string@0.4.1: + resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -793,6 +1031,11 @@ packages: natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + nopt@7.2.1: + resolution: {integrity: sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + hasBin: true + obug@2.1.1: resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==} @@ -808,9 +1051,15 @@ packages: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + pako@0.2.9: resolution: {integrity: sha512-NUcwaKxUxWrZLpDG+z/xZaCgQITkA/Dv4V/T6bw7VON6l1Xz/VnrBqrYjZQ12TamKHzITTfOEIYUj48y2KXImA==} + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} @@ -819,9 +1068,16 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -829,6 +1085,15 @@ packages: resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==} engines: {node: '>=12'} + pinia@3.0.4: + resolution: {integrity: sha512-l7pqLUFTI/+ESXn6k3nu30ZIzW5E2WZF/LaHJEpoq6ElcLD+wduZoB2kBN19du6K/4FDpPMazY2wJr+IndBtQw==} + peerDependencies: + typescript: '>=4.5.0' + vue: ^3.5.11 + peerDependenciesMeta: + typescript: + optional: true + postcss@8.5.10: resolution: {integrity: sha512-pMMHxBOZKFU6HgAZ4eyGnwXF/EvPGGqUr0MnZ5+99485wwW41kW91A4LOGxSHhgugZmSChL5AlElNdwlNgcnLQ==} engines: {node: ^10 || ^12 || >=14} @@ -842,6 +1107,9 @@ packages: engines: {node: '>=14'} hasBin: true + proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -852,6 +1120,9 @@ packages: restructure@3.0.2: resolution: {integrity: sha512-gSfoiOEA0VPE6Tukkrr7I0RBdE0s7H1eFCDBk05l1KIQT1UIKNc5JZy6jdyW6eYH3aR3g5b3PuL77rq0hvwtAw==} + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + rolldown@1.0.0-rc.17: resolution: {integrity: sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==} engines: {node: ^20.19.0 || >=22.12.0} @@ -877,10 +1148,18 @@ packages: siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} + speakingurl@14.0.1: + resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} + engines: {node: '>=0.10.0'} + sr-visualizer@1.0.13: resolution: {integrity: sha512-6/tivRwEttzIegF7jxtGBLpaQrYaBGNOmIpSGgp/9zYIH91rEGcpUG/TkmBqlqtxbWt6WF4y8cieUXE4V9F/Sw==} @@ -890,6 +1169,26 @@ packages: std-env@4.1.0: resolution: {integrity: sha512-Rq7ybcX2RuC55r9oaPVEW7/xu3tj8u4GeBYHBWCychFtzMIr86A7e3PPEBPT37sHStKX3+TiX/Fr/ACmJLVlLQ==} + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.2.0: + resolution: {integrity: sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==} + engines: {node: '>=12'} + + superjson@2.2.6: + resolution: {integrity: sha512-H+ue8Zo4vJmV2nRjpx86P35lzwDT3nItnIsocgumgr0hHMQ+ZGq5vrERg9kJBo5AWGmxZDhzDo+WVIJqkB0cGA==} + engines: {node: '>=16'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -936,6 +1235,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + undici-types@7.19.2: + resolution: {integrity: sha512-qYVnV5OEm2AW8cJMCpdV20CDyaN3g0AjDlOGf1OW4iaDEx8MwdtChUp4zu4H0VP3nDRF/8RKWH+IPp9uW0YGZg==} + unicode-properties@1.4.1: resolution: {integrity: sha512-CLjCCLQ6UuMxWnbIylkisbRj31qxHPAurvena/0iwSVbQ2G1VY5/HjV0IRabOEbDHlzZlRdCrD4NhB0JtU40Pg==} @@ -1029,6 +1331,30 @@ packages: jsdom: optional: true + vscode-uri@3.1.0: + resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} + + vue-component-type-helpers@3.2.7: + resolution: {integrity: sha512-+gPp5YGmhfsj1IN+xUo7y0fb4clfnOiiUA39y07yW1VzCRjzVgwLbtmdWlghh7mXrPsEaYc7rrIir/HT6C8vYQ==} + + vue-tsc@3.2.7: + resolution: {integrity: sha512-zc1tL3HoQni1zGTGrwBVRQb7rGP5SWdu/m4rGB6JcnAC5MT5LFZIxF7Y+EJEnt4hGF23d60rXH7gRjHGb5KQQQ==} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + + vue@3.5.33: + resolution: {integrity: sha512-1AgChhx5w3ALgT4oK3acm2Es/7jyZhWSVUfs3rOBlGQC0rjEDkS7G4lWlJJGGNQD+BV3reCwbQrOe1mPNwKHBQ==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + whatwg-mimetype@3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -1043,6 +1369,26 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + ws@8.20.0: + resolution: {integrity: sha512-sAt8BhgNbzCtgGbt2OxmpuryO63ZoDk/sqaB/znQm94T4fCEsy/yV+7CdC1kJhOU9lboAEU7R3kquuycDoibVA==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: '>=5.0.2' + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -1126,6 +1472,15 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} + '@isaacs/cliui@8.0.2': + dependencies: + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.2.0 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 + '@jridgewell/resolve-uri@3.1.2': {} '@jridgewell/sourcemap-codec@1.5.5': {} @@ -1142,8 +1497,13 @@ snapshots: '@tybys/wasm-util': 0.10.1 optional: true + '@one-ini/wasm@0.1.1': {} + '@oxc-project/types@0.127.0': {} + '@pkgjs/parseargs@0.11.0': + optional: true + '@resvg/resvg-js-android-arm-eabi@2.6.2': optional: true @@ -1244,6 +1604,8 @@ snapshots: '@rolldown/binding-win32-x64-msvc@1.0.0-rc.17': optional: true + '@rolldown/pluginutils@1.0.0-rc.13': {} + '@rolldown/pluginutils@1.0.0-rc.17': {} '@standard-schema/spec@1.1.0': {} @@ -1270,6 +1632,16 @@ snapshots: '@types/json-schema@7.0.15': {} + '@types/node@25.6.0': + dependencies: + undici-types: 7.19.2 + + '@types/whatwg-mimetype@3.0.2': {} + + '@types/ws@8.18.1': + dependencies: + '@types/node': 25.6.0 + '@typescript-eslint/eslint-plugin@8.59.0(@typescript-eslint/parser@8.59.0(eslint@10.2.1)(typescript@6.0.3))(eslint@10.2.1)(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 @@ -1361,6 +1733,12 @@ snapshots: '@typescript-eslint/types': 8.59.0 eslint-visitor-keys: 5.0.1 + '@vitejs/plugin-vue@6.0.6(vite@8.0.10(@types/node@25.6.0))(vue@3.5.33(typescript@6.0.3))': + dependencies: + '@rolldown/pluginutils': 1.0.0-rc.13 + vite: 8.0.10(@types/node@25.6.0) + vue: 3.5.33(typescript@6.0.3) + '@vitest/coverage-v8@4.1.5(vitest@4.1.5)': dependencies: '@bcoe/v8-coverage': 1.0.2 @@ -1373,7 +1751,7 @@ snapshots: obug: 2.1.1 std-env: 4.1.0 tinyrainbow: 3.1.0 - vitest: 4.1.5(@vitest/coverage-v8@4.1.5)(vite@8.0.10) + vitest: 4.1.5(@types/node@25.6.0)(@vitest/coverage-v8@4.1.5)(happy-dom@20.9.0)(vite@8.0.10(@types/node@25.6.0)) '@vitest/expect@4.1.5': dependencies: @@ -1384,13 +1762,13 @@ snapshots: chai: 6.2.2 tinyrainbow: 3.1.0 - '@vitest/mocker@4.1.5(vite@8.0.10)': + '@vitest/mocker@4.1.5(vite@8.0.10(@types/node@25.6.0))': dependencies: '@vitest/spy': 4.1.5 estree-walker: 3.0.3 magic-string: 0.30.21 optionalDependencies: - vite: 8.0.10 + vite: 8.0.10(@types/node@25.6.0) '@vitest/pretty-format@4.1.5': dependencies: @@ -1416,6 +1794,111 @@ snapshots: convert-source-map: 2.0.0 tinyrainbow: 3.1.0 + '@volar/language-core@2.4.28': + dependencies: + '@volar/source-map': 2.4.28 + + '@volar/source-map@2.4.28': {} + + '@volar/typescript@2.4.28': + dependencies: + '@volar/language-core': 2.4.28 + path-browserify: 1.0.1 + vscode-uri: 3.1.0 + + '@vue/compiler-core@3.5.33': + dependencies: + '@babel/parser': 7.29.2 + '@vue/shared': 3.5.33 + entities: 7.0.1 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + + '@vue/compiler-dom@3.5.33': + dependencies: + '@vue/compiler-core': 3.5.33 + '@vue/shared': 3.5.33 + + '@vue/compiler-sfc@3.5.33': + dependencies: + '@babel/parser': 7.29.2 + '@vue/compiler-core': 3.5.33 + '@vue/compiler-dom': 3.5.33 + '@vue/compiler-ssr': 3.5.33 + '@vue/shared': 3.5.33 + estree-walker: 2.0.2 + magic-string: 0.30.21 + postcss: 8.5.10 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.33': + dependencies: + '@vue/compiler-dom': 3.5.33 + '@vue/shared': 3.5.33 + + '@vue/devtools-api@7.7.9': + dependencies: + '@vue/devtools-kit': 7.7.9 + + '@vue/devtools-kit@7.7.9': + dependencies: + '@vue/devtools-shared': 7.7.9 + birpc: 2.9.0 + hookable: 5.5.3 + mitt: 3.0.1 + perfect-debounce: 1.0.0 + speakingurl: 14.0.1 + superjson: 2.2.6 + + '@vue/devtools-shared@7.7.9': + dependencies: + rfdc: 1.4.1 + + '@vue/language-core@3.2.7': + dependencies: + '@volar/language-core': 2.4.28 + '@vue/compiler-dom': 3.5.33 + '@vue/shared': 3.5.33 + alien-signals: 3.1.2 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + picomatch: 4.0.4 + + '@vue/reactivity@3.5.33': + dependencies: + '@vue/shared': 3.5.33 + + '@vue/runtime-core@3.5.33': + dependencies: + '@vue/reactivity': 3.5.33 + '@vue/shared': 3.5.33 + + '@vue/runtime-dom@3.5.33': + dependencies: + '@vue/reactivity': 3.5.33 + '@vue/runtime-core': 3.5.33 + '@vue/shared': 3.5.33 + csstype: 3.2.3 + + '@vue/server-renderer@3.5.33(vue@3.5.33(typescript@6.0.3))': + dependencies: + '@vue/compiler-ssr': 3.5.33 + '@vue/shared': 3.5.33 + vue: 3.5.33(typescript@6.0.3) + + '@vue/shared@3.5.33': {} + + '@vue/test-utils@2.4.10(@vue/compiler-dom@3.5.33)(@vue/server-renderer@3.5.33(vue@3.5.33(typescript@6.0.3)))(vue@3.5.33(typescript@6.0.3))': + dependencies: + '@vue/compiler-dom': 3.5.33 + js-beautify: 1.15.4 + vue: 3.5.33(typescript@6.0.3) + vue-component-type-helpers: 3.2.7 + optionalDependencies: + '@vue/server-renderer': 3.5.33(vue@3.5.33(typescript@6.0.3)) + + abbrev@2.0.0: {} + acorn-jsx@5.3.2(acorn@8.16.0): dependencies: acorn: 8.16.0 @@ -1429,6 +1912,18 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + alien-signals@3.1.2: {} + + ansi-regex@5.0.1: {} + + ansi-regex@6.2.2: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@6.2.3: {} + assertion-error@2.0.1: {} ast-v8-to-istanbul@1.0.0: @@ -1437,10 +1932,18 @@ snapshots: estree-walker: 3.0.3 js-tokens: 10.0.0 + balanced-match@1.0.2: {} + balanced-match@4.0.4: {} base64-js@1.5.1: {} + birpc@2.9.0: {} + + brace-expansion@2.1.0: + dependencies: + balanced-match: 1.0.2 + brace-expansion@5.0.5: dependencies: balanced-match: 4.0.4 @@ -1453,14 +1956,33 @@ snapshots: clone@2.1.2: {} + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + commander@10.0.1: {} + + config-chain@1.1.13: + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + convert-source-map@2.0.0: {} + copy-anything@4.0.5: + dependencies: + is-what: 5.5.0 + cross-spawn@7.0.6: dependencies: path-key: 3.1.1 shebang-command: 2.0.0 which: 2.0.2 + csstype@3.2.3: {} + debug@4.4.3: dependencies: ms: 2.1.3 @@ -1471,6 +1993,21 @@ snapshots: dfa@1.2.0: {} + eastasianwidth@0.2.0: {} + + editorconfig@1.0.7: + dependencies: + '@one-ini/wasm': 0.1.1 + commander: 10.0.1 + minimatch: 9.0.9 + semver: 7.7.4 + + emoji-regex@8.0.0: {} + + emoji-regex@9.2.2: {} + + entities@7.0.1: {} + es-module-lexer@2.1.0: {} escape-string-regexp@4.0.0: {} @@ -1541,6 +2078,8 @@ snapshots: estraverse@5.3.0: {} + estree-walker@2.0.2: {} + estree-walker@3.0.3: dependencies: '@types/estree': 1.0.8 @@ -1587,6 +2126,11 @@ snapshots: unicode-properties: 1.4.1 unicode-trie: 2.0.0 + foreground-child@3.3.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + fsevents@2.3.3: optional: true @@ -1594,8 +2138,31 @@ snapshots: dependencies: is-glob: 4.0.3 + glob@10.5.0: + dependencies: + foreground-child: 3.3.1 + jackspeak: 3.4.3 + minimatch: 9.0.9 + minipass: 7.1.3 + package-json-from-dist: 1.0.1 + path-scurry: 1.11.1 + + happy-dom@20.9.0: + dependencies: + '@types/node': 25.6.0 + '@types/whatwg-mimetype': 3.0.2 + '@types/ws': 8.18.1 + entities: 7.0.1 + whatwg-mimetype: 3.0.0 + ws: 8.20.0 + transitivePeerDependencies: + - bufferutil + - utf-8-validate + has-flag@4.0.0: {} + hookable@5.5.3: {} + html-escaper@2.0.2: {} ignore@5.3.2: {} @@ -1610,12 +2177,18 @@ snapshots: inherits@2.0.4: {} + ini@1.3.8: {} + is-extglob@2.1.1: {} + is-fullwidth-code-point@3.0.0: {} + is-glob@4.0.3: dependencies: is-extglob: 2.1.1 + is-what@5.5.0: {} + isexe@2.0.0: {} istanbul-lib-coverage@3.2.2: {} @@ -1631,6 +2204,22 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + + js-beautify@1.15.4: + dependencies: + config-chain: 1.1.13 + editorconfig: 1.0.7 + glob: 10.5.0 + js-cookie: 3.0.5 + nopt: 7.2.1 + + js-cookie@3.0.5: {} + js-tokens@10.0.0: {} json-buffer@3.0.1: {} @@ -1701,6 +2290,8 @@ snapshots: dependencies: p-locate: 5.0.0 + lru-cache@10.4.3: {} + magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 @@ -1719,12 +2310,26 @@ snapshots: dependencies: brace-expansion: 5.0.5 + minimatch@9.0.9: + dependencies: + brace-expansion: 2.1.0 + + minipass@7.1.3: {} + + mitt@3.0.1: {} + ms@2.1.3: {} + muggle-string@0.4.1: {} + nanoid@3.3.11: {} natural-compare@1.4.0: {} + nopt@7.2.1: + dependencies: + abbrev: 2.0.0 + obug@2.1.1: {} optionator@0.9.4: @@ -1744,18 +2349,36 @@ snapshots: dependencies: p-limit: 3.1.0 + package-json-from-dist@1.0.1: {} + pako@0.2.9: {} + path-browserify@1.0.1: {} + path-exists@4.0.0: {} path-key@3.1.1: {} + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.3 + pathe@2.0.3: {} + perfect-debounce@1.0.0: {} + picocolors@1.1.1: {} picomatch@4.0.4: {} + pinia@3.0.4(typescript@6.0.3)(vue@3.5.33(typescript@6.0.3)): + dependencies: + '@vue/devtools-api': 7.7.9 + vue: 3.5.33(typescript@6.0.3) + optionalDependencies: + typescript: 6.0.3 + postcss@8.5.10: dependencies: nanoid: 3.3.11 @@ -1766,6 +2389,8 @@ snapshots: prettier@3.8.3: {} + proto-list@1.2.4: {} + punycode@2.3.1: {} queue@6.0.2: @@ -1774,6 +2399,8 @@ snapshots: restructure@3.0.2: {} + rfdc@1.4.1: {} + rolldown@1.0.0-rc.17: dependencies: '@oxc-project/types': 0.127.0 @@ -1807,8 +2434,12 @@ snapshots: siginfo@2.0.0: {} + signal-exit@4.1.0: {} + source-map-js@1.2.1: {} + speakingurl@14.0.1: {} + sr-visualizer@1.0.13: dependencies: svg.js: 2.7.1 @@ -1817,6 +2448,30 @@ snapshots: std-env@4.1.0: {} + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + string-width@5.1.2: + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.2.0 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-ansi@7.2.0: + dependencies: + ansi-regex: 6.2.2 + + superjson@2.2.6: + dependencies: + copy-anything: 4.0.5 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -1854,6 +2509,8 @@ snapshots: typescript@6.0.3: {} + undici-types@7.19.2: {} + unicode-properties@1.4.1: dependencies: base64-js: 1.5.1 @@ -1868,7 +2525,7 @@ snapshots: dependencies: punycode: 2.3.1 - vite@8.0.10: + vite@8.0.10(@types/node@25.6.0): dependencies: lightningcss: 1.32.0 picomatch: 4.0.4 @@ -1876,12 +2533,13 @@ snapshots: rolldown: 1.0.0-rc.17 tinyglobby: 0.2.16 optionalDependencies: + '@types/node': 25.6.0 fsevents: 2.3.3 - vitest@4.1.5(@vitest/coverage-v8@4.1.5)(vite@8.0.10): + vitest@4.1.5(@types/node@25.6.0)(@vitest/coverage-v8@4.1.5)(happy-dom@20.9.0)(vite@8.0.10(@types/node@25.6.0)): dependencies: '@vitest/expect': 4.1.5 - '@vitest/mocker': 4.1.5(vite@8.0.10) + '@vitest/mocker': 4.1.5(vite@8.0.10(@types/node@25.6.0)) '@vitest/pretty-format': 4.1.5 '@vitest/runner': 4.1.5 '@vitest/snapshot': 4.1.5 @@ -1898,13 +2556,37 @@ snapshots: tinyexec: 1.1.1 tinyglobby: 0.2.16 tinyrainbow: 3.1.0 - vite: 8.0.10 + vite: 8.0.10(@types/node@25.6.0) why-is-node-running: 2.3.0 optionalDependencies: + '@types/node': 25.6.0 '@vitest/coverage-v8': 4.1.5(vitest@4.1.5) + happy-dom: 20.9.0 transitivePeerDependencies: - msw + vscode-uri@3.1.0: {} + + vue-component-type-helpers@3.2.7: {} + + vue-tsc@3.2.7(typescript@6.0.3): + dependencies: + '@volar/typescript': 2.4.28 + '@vue/language-core': 3.2.7 + typescript: 6.0.3 + + vue@3.5.33(typescript@6.0.3): + dependencies: + '@vue/compiler-dom': 3.5.33 + '@vue/compiler-sfc': 3.5.33 + '@vue/runtime-dom': 3.5.33 + '@vue/server-renderer': 3.5.33(vue@3.5.33(typescript@6.0.3)) + '@vue/shared': 3.5.33 + optionalDependencies: + typescript: 6.0.3 + + whatwg-mimetype@3.0.0: {} + which@2.0.2: dependencies: isexe: 2.0.0 @@ -1916,4 +2598,18 @@ snapshots: word-wrap@1.2.5: {} + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@8.1.0: + dependencies: + ansi-styles: 6.2.3 + string-width: 5.1.2 + strip-ansi: 7.2.0 + + ws@8.20.0: {} + yocto-queue@0.1.0: {} diff --git a/src/App.vue b/src/App.vue new file mode 100644 index 0000000..1cae14c --- /dev/null +++ b/src/App.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/components/CubeDisplay.vue b/src/components/CubeDisplay.vue new file mode 100644 index 0000000..798ba32 --- /dev/null +++ b/src/components/CubeDisplay.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/components/MoveInput.vue b/src/components/MoveInput.vue new file mode 100644 index 0000000..3b8c132 --- /dev/null +++ b/src/components/MoveInput.vue @@ -0,0 +1,68 @@ + + + diff --git a/src/components/SizeSelector.vue b/src/components/SizeSelector.vue new file mode 100644 index 0000000..7f65d0a --- /dev/null +++ b/src/components/SizeSelector.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/composables/useCubePersist.ts b/src/composables/useCubePersist.ts new file mode 100644 index 0000000..ea4f394 --- /dev/null +++ b/src/composables/useCubePersist.ts @@ -0,0 +1,36 @@ +import { watch, onMounted } from 'vue' +import { useCubeStore } from '../stores/cube.js' +import { serialize, deserialize } from '../logic/index.js' +import type { CubeSize } from '../logic/index.js' + +const STORAGE_KEY = 'vce3-cube-state' + +export function useCubePersist(): void { + const store = useCubeStore() + + onMounted(() => { + const raw = localStorage.getItem(STORAGE_KEY) + if (!raw) return + + let parsed: unknown + try { + parsed = JSON.parse(raw) as unknown + } catch { + return + } + + const result = deserialize(parsed) + if (result.ok) { + store.cubeState = result.value + store.size = result.value.size as CubeSize + } + }) + + watch( + () => store.cubeState, + (state) => { + const serialized = serialize(state) + localStorage.setItem(STORAGE_KEY, JSON.stringify(serialized)) + }, + ) +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..1aa6519 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import { createPinia } from 'pinia' +import App from './App.vue' + +createApp(App).use(createPinia()).mount('#app') diff --git a/src/stores/cube.ts b/src/stores/cube.ts new file mode 100644 index 0000000..085b46a --- /dev/null +++ b/src/stores/cube.ts @@ -0,0 +1,40 @@ +import { defineStore } from 'pinia' +import { ref } from 'vue' +import { + createCube, + applyMove as logicApplyMove, + applySequence as logicApplySequence, +} from '../logic/index.js' +import type { CubeState, CubeSize, Move, MoveSequence } from '../logic/index.js' + +function makeSolvedCube(n: CubeSize): CubeState { + const result = createCube(n) + if (!result.ok) throw new Error(result.error.message) + return result.value +} + +export const useCubeStore = defineStore('cube', () => { + const size = ref(3) + const cubeState = ref(makeSolvedCube(3)) + + function applyMove(move: Move): void { + const result = logicApplyMove(cubeState.value, move) + if (result.ok) cubeState.value = result.value + } + + function applySequence(moves: MoveSequence): void { + const result = logicApplySequence(cubeState.value, moves) + if (result.ok) cubeState.value = result.value + } + + function reset(): void { + cubeState.value = makeSolvedCube(size.value) + } + + function setSize(n: CubeSize): void { + size.value = n + cubeState.value = makeSolvedCube(n) + } + + return { size, cubeState, applyMove, applySequence, reset, setSize } +}) diff --git a/tests/App.test.ts b/tests/App.test.ts new file mode 100644 index 0000000..a626b96 --- /dev/null +++ b/tests/App.test.ts @@ -0,0 +1,22 @@ +// @vitest-environment happy-dom +import { describe, it, expect, vi } from 'vitest' +import { mount } from '@vue/test-utils' +import { createPinia } from 'pinia' + +vi.mock('./src/render/index.js', () => ({ + renderSVG: vi.fn(() => ({ ok: true, value: '' })), +})) +vi.mock('../src/render/index.js', () => ({ + renderSVG: vi.fn(() => ({ ok: true, value: '' })), +})) + +import App from '../src/App.vue' + +describe('App', () => { + it('マウントされ主要コンポーネントを含む', () => { + const wrapper = mount(App, { global: { plugins: [createPinia()] } }) + expect(wrapper.find('h1').text()).toContain('Visual Cube Editor 3') + expect(wrapper.find('select').exists()).toBe(true) + expect(wrapper.find('[data-testid="notation-input"]').exists()).toBe(true) + }) +}) diff --git a/tests/components/CubeDisplay.test.ts b/tests/components/CubeDisplay.test.ts new file mode 100644 index 0000000..d25e719 --- /dev/null +++ b/tests/components/CubeDisplay.test.ts @@ -0,0 +1,48 @@ +// @vitest-environment happy-dom +import { describe, it, expect, vi, beforeEach } from 'vitest' +import { mount } from '@vue/test-utils' +import { createPinia, setActivePinia } from 'pinia' + +// svgdom が happy-dom を上書きしないようレンダー層をモック +vi.mock('../../src/render/index.js', () => ({ + renderSVG: vi.fn(() => ({ ok: true, value: '' })), +})) + +import CubeDisplay from '../../src/components/CubeDisplay.vue' +import { useCubeStore } from '../../src/stores/cube.js' +import { renderSVG } from '../../src/render/index.js' +import { Face, Direction } from '../../src/logic/index.js' + +describe('CubeDisplay', () => { + beforeEach(() => { + setActivePinia(createPinia()) + vi.mocked(renderSVG).mockReturnValue({ ok: true, value: '' }) + }) + + it('SVG をレンダリングする', () => { + const wrapper = mount(CubeDisplay, { global: { plugins: [createPinia()] } }) + expect(wrapper.html()).toContain('') + }) + + it('キューブ状態が変わると renderSVG が再呼び出しされる', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(CubeDisplay, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + const callsBefore = vi.mocked(renderSVG).mock.calls.length + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + await wrapper.vm.$nextTick() + + expect(vi.mocked(renderSVG).mock.calls.length).toBeGreaterThan(callsBefore) + }) + + it('renderSVG が err を返した場合は空文字を表示する', () => { + vi.mocked(renderSVG).mockReturnValueOnce({ + ok: false, + error: { kind: 'INVALID_CUBE_SIZE', message: 'error' }, + }) + const wrapper = mount(CubeDisplay, { global: { plugins: [createPinia()] } }) + expect(wrapper.find('.cube-display').html()).not.toContain('') + }) +}) diff --git a/tests/components/MoveInput.test.ts b/tests/components/MoveInput.test.ts new file mode 100644 index 0000000..bbb59ba --- /dev/null +++ b/tests/components/MoveInput.test.ts @@ -0,0 +1,126 @@ +// @vitest-environment happy-dom +import { describe, it, expect, beforeEach } from 'vitest' +import { mount } from '@vue/test-utils' +import { createPinia, setActivePinia } from 'pinia' +import MoveInput from '../../src/components/MoveInput.vue' +import { useCubeStore } from '../../src/stores/cube.js' + +function isSolved(store: ReturnType): boolean { + return store.cubeState.faces.every((face) => + face.every((row) => row.every((c) => c === face[0]![0])), + ) +} + +describe('MoveInput', () => { + beforeEach(() => { + setActivePinia(createPinia()) + }) + + // --------------------------------------------------------------------------- + // テキスト入力フォーム + // --------------------------------------------------------------------------- + + it('フォーム送信でキューブ状態が変化する', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(MoveInput, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + await wrapper.find('[data-testid="notation-input"]').setValue('R') + await wrapper.find('form').trigger('submit') + + expect(isSolved(store)).toBe(false) + }) + + it('送信後に入力欄がクリアされる', async () => { + const wrapper = mount(MoveInput, { global: { plugins: [createPinia()] } }) + + await wrapper.find('[data-testid="notation-input"]').setValue('U') + await wrapper.find('form').trigger('submit') + + expect( + (wrapper.find('[data-testid="notation-input"]').element as HTMLInputElement).value, + ).toBe('') + }) + + it('不正な記法でエラーメッセージが表示される', async () => { + const wrapper = mount(MoveInput, { global: { plugins: [createPinia()] } }) + + await wrapper.find('[data-testid="notation-input"]').setValue('INVALID!!!') + await wrapper.find('form').trigger('submit') + + expect(wrapper.find('[data-testid="error-message"]').exists()).toBe(true) + }) + + it('不正な記法の場合はキューブ状態が変化しない', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(MoveInput, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + await wrapper.find('[data-testid="notation-input"]').setValue('INVALID!!!') + await wrapper.find('form').trigger('submit') + + expect(isSolved(store)).toBe(true) + }) + + it('正しい入力後はエラーメッセージが消える', async () => { + const wrapper = mount(MoveInput, { global: { plugins: [createPinia()] } }) + + await wrapper.find('[data-testid="notation-input"]').setValue('INVALID!!!') + await wrapper.find('form').trigger('submit') + expect(wrapper.find('[data-testid="error-message"]').exists()).toBe(true) + + await wrapper.find('[data-testid="notation-input"]').setValue('R') + await wrapper.find('form').trigger('submit') + expect(wrapper.find('[data-testid="error-message"]').exists()).toBe(false) + }) + + it('空欄送信ではキューブ状態が変化しない', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(MoveInput, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + await wrapper.find('[data-testid="notation-input"]').setValue('') + await wrapper.find('form').trigger('submit') + + expect(isSolved(store)).toBe(true) + }) + + // --------------------------------------------------------------------------- + // 面ムーブボタン + // --------------------------------------------------------------------------- + + it('各面ボタン(U / D / R / L / F / B)が存在する', () => { + const wrapper = mount(MoveInput, { global: { plugins: [createPinia()] } }) + const labels = wrapper.findAll('.face-buttons button').map((b) => b.text()) + for (const face of ['U', 'D', 'R', 'L', 'F', 'B']) { + expect(labels).toContain(face) + } + }) + + it('U ボタンクリックでキューブ状態が変化する', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(MoveInput, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + const btn = wrapper.findAll('.face-buttons button').find((b) => b.text() === 'U') + await btn!.trigger('click') + + expect(isSolved(store)).toBe(false) + }) + + it("R' ボタンクリックでキューブ状態が変化する", async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(MoveInput, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + const btn = wrapper.findAll('.face-buttons button').find((b) => b.text() === "R'") + await btn!.trigger('click') + + expect(isSolved(store)).toBe(false) + }) +}) diff --git a/tests/components/SizeSelector.test.ts b/tests/components/SizeSelector.test.ts new file mode 100644 index 0000000..b298cea --- /dev/null +++ b/tests/components/SizeSelector.test.ts @@ -0,0 +1,53 @@ +// @vitest-environment happy-dom +import { describe, it, expect, beforeEach } from 'vitest' +import { mount } from '@vue/test-utils' +import { createPinia, setActivePinia } from 'pinia' +import SizeSelector from '../../src/components/SizeSelector.vue' +import { useCubeStore } from '../../src/stores/cube.js' + +describe('SizeSelector', () => { + beforeEach(() => { + setActivePinia(createPinia()) + }) + + it('サイズ選択肢 2〜7(計 6 個)が表示される', () => { + const wrapper = mount(SizeSelector, { global: { plugins: [createPinia()] } }) + const options = wrapper.findAll('option') + expect(options).toHaveLength(6) + }) + + it('最小値 2×2・最大値 7×7 のラベルが存在する', () => { + const wrapper = mount(SizeSelector, { global: { plugins: [createPinia()] } }) + const options = wrapper.findAll('option') + expect(options[0]!.text()).toContain('2') + expect(options[5]!.text()).toContain('7') + }) + + it('デフォルト選択値は 3', () => { + const wrapper = mount(SizeSelector, { global: { plugins: [createPinia()] } }) + const select = wrapper.find('select') + expect((select.element as HTMLSelectElement).value).toBe('3') + }) + + it('select 変更で store.size が更新される', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(SizeSelector, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + await wrapper.find('select').setValue('5') + + expect(store.size).toBe(5) + }) + + it('select 変更で cubeState のサイズが変わる', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const wrapper = mount(SizeSelector, { global: { plugins: [pinia] } }) + const store = useCubeStore() + + await wrapper.find('select').setValue('2') + + expect(store.cubeState.size).toBe(2) + }) +}) diff --git a/tests/composables/useCubePersist.test.ts b/tests/composables/useCubePersist.test.ts new file mode 100644 index 0000000..d3eea36 --- /dev/null +++ b/tests/composables/useCubePersist.test.ts @@ -0,0 +1,141 @@ +// @vitest-environment happy-dom +import { describe, it, expect, beforeEach } from 'vitest' +import { defineComponent } from 'vue' +import { mount, flushPromises } from '@vue/test-utils' +import { setActivePinia, createPinia } from 'pinia' +import { useCubeStore } from '../../src/stores/cube.js' +import { useCubePersist } from '../../src/composables/useCubePersist.js' +import { Face, Direction, serialize } from '../../src/logic/index.js' + +const STORAGE_KEY = 'vce3-cube-state' + +const TestComponent = defineComponent({ + setup() { + useCubePersist() + return {} + }, + template: '
', +}) + +function mountPersist(pinia = createPinia()) { + setActivePinia(pinia) + return { wrapper: mount(TestComponent, { global: { plugins: [pinia] } }), pinia } +} + +describe('useCubePersist', () => { + beforeEach(() => { + setActivePinia(createPinia()) + localStorage.clear() + }) + + // --------------------------------------------------------------------------- + // 保存 + // --------------------------------------------------------------------------- + + it('キューブ状態変更時に localStorage へ保存される', async () => { + const { wrapper } = mountPersist() + const store = useCubeStore() + + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + await wrapper.vm.$nextTick() + + expect(localStorage.getItem(STORAGE_KEY)).not.toBeNull() + }) + + it('保存データは有効な JSON で SerializedCube 形式', async () => { + const { wrapper } = mountPersist() + const store = useCubeStore() + + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + await wrapper.vm.$nextTick() + + const raw = localStorage.getItem(STORAGE_KEY) + expect(raw).not.toBeNull() + const parsed = JSON.parse(raw!) as unknown + expect(typeof parsed).toBe('object') + expect((parsed as Record)['v']).toBe(1) + }) + + // --------------------------------------------------------------------------- + // 復元 + // --------------------------------------------------------------------------- + + it('マウント時に localStorage から状態が復元される', async () => { + // R ムーブ済み状態を保存 + const store0 = useCubeStore() + store0.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + const movedFaces = JSON.stringify(store0.cubeState.faces) + localStorage.setItem(STORAGE_KEY, JSON.stringify(serialize(store0.cubeState))) + + // 新しい Pinia でマウント → 復元されるはず + const pinia = createPinia() + setActivePinia(pinia) + const store = useCubeStore() + const { wrapper } = mountPersist(pinia) + await flushPromises() + await wrapper.vm.$nextTick() + + expect(JSON.stringify(store.cubeState.faces)).toBe(movedFaces) + }) + + it('復元後に store.size が正しく設定される', async () => { + const store0 = useCubeStore() + store0.setSize(5) + localStorage.setItem(STORAGE_KEY, JSON.stringify(serialize(store0.cubeState))) + + const pinia = createPinia() + setActivePinia(pinia) + const store = useCubeStore() + const { wrapper } = mountPersist(pinia) + await flushPromises() + await wrapper.vm.$nextTick() + + expect(store.size).toBe(5) + }) + + // --------------------------------------------------------------------------- + // フォールバック(不正データ) + // --------------------------------------------------------------------------- + + it('不正 JSON の場合は solved 状態のまま', async () => { + localStorage.setItem(STORAGE_KEY, 'NOT{JSON}}') + + const pinia = createPinia() + setActivePinia(pinia) + const store = useCubeStore() + const solvedFaces = JSON.stringify(store.cubeState.faces) + + const { wrapper } = mountPersist(pinia) + await flushPromises() + await wrapper.vm.$nextTick() + + expect(JSON.stringify(store.cubeState.faces)).toBe(solvedFaces) + }) + + it('不正スキーマの場合は solved 状態のまま', async () => { + localStorage.setItem(STORAGE_KEY, JSON.stringify({ v: 99, size: 3, data: [] })) + + const pinia = createPinia() + setActivePinia(pinia) + const store = useCubeStore() + const solvedFaces = JSON.stringify(store.cubeState.faces) + + const { wrapper } = mountPersist(pinia) + await flushPromises() + await wrapper.vm.$nextTick() + + expect(JSON.stringify(store.cubeState.faces)).toBe(solvedFaces) + }) + + it('localStorage が空の場合は solved 状態のまま', async () => { + const pinia = createPinia() + setActivePinia(pinia) + const store = useCubeStore() + + mountPersist(pinia) + await flushPromises() + + const isSolved = store.cubeState.faces.every((f) => f.every((r) => r.every((c) => c === f[0]![0]))) + expect(isSolved).toBe(true) + }) +}) diff --git a/tests/stores/cube.test.ts b/tests/stores/cube.test.ts new file mode 100644 index 0000000..7249cca --- /dev/null +++ b/tests/stores/cube.test.ts @@ -0,0 +1,115 @@ +import { describe, it, expect, beforeEach } from 'vitest' +import { setActivePinia, createPinia } from 'pinia' +import { useCubeStore } from '../../src/stores/cube.js' +import { Face, Direction, parseNotation } from '../../src/logic/index.js' + +function isSolved(state: ReturnType['cubeState']): boolean { + return state.faces.every((face) => face.every((row) => row.every((c) => c === face[0]![0]))) +} + +describe('useCubeStore', () => { + beforeEach(() => { + setActivePinia(createPinia()) + }) + + // --------------------------------------------------------------------------- + // 初期状態 + // --------------------------------------------------------------------------- + + it('初期サイズは 3', () => { + const store = useCubeStore() + expect(store.size).toBe(3) + }) + + it('初期 cubeState は 3×3 の完成状態', () => { + const store = useCubeStore() + expect(store.cubeState.size).toBe(3) + expect(isSolved(store.cubeState)).toBe(true) + }) + + // --------------------------------------------------------------------------- + // setSize + // --------------------------------------------------------------------------- + + it.each([2, 4, 5, 6, 7] as const)('setSize(%i) でサイズが変わり完成状態になる', (n) => { + const store = useCubeStore() + store.setSize(n) + expect(store.size).toBe(n) + expect(store.cubeState.size).toBe(n) + expect(isSolved(store.cubeState)).toBe(true) + }) + + // --------------------------------------------------------------------------- + // applyMove + // --------------------------------------------------------------------------- + + it('applyMove でキューブ状態が変化する', () => { + const store = useCubeStore() + const before = JSON.stringify(store.cubeState.faces) + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + expect(JSON.stringify(store.cubeState.faces)).not.toBe(before) + }) + + it('applyMove 4 回(CW×4)で元の状態に戻る', () => { + const store = useCubeStore() + const before = JSON.stringify(store.cubeState.faces) + for (let i = 0; i < 4; i++) { + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + } + expect(JSON.stringify(store.cubeState.faces)).toBe(before) + }) + + // --------------------------------------------------------------------------- + // applySequence + // --------------------------------------------------------------------------- + + it('applySequence でキューブ状態が変化する', () => { + const store = useCubeStore() + const before = JSON.stringify(store.cubeState.faces) + const result = parseNotation("R U R' U'") + expect(result.ok).toBe(true) + if (!result.ok) return + store.applySequence(result.value) + expect(JSON.stringify(store.cubeState.faces)).not.toBe(before) + }) + + it('空の sequence は状態を変えない', () => { + const store = useCubeStore() + const before = JSON.stringify(store.cubeState.faces) + store.applySequence([]) + expect(JSON.stringify(store.cubeState.faces)).toBe(before) + }) + + // --------------------------------------------------------------------------- + // reset + // --------------------------------------------------------------------------- + + it('reset でキューブが完成状態に戻る', () => { + const store = useCubeStore() + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + expect(isSolved(store.cubeState)).toBe(false) + store.reset() + expect(isSolved(store.cubeState)).toBe(true) + }) + + it('setSize(5) 後の reset は 5×5 完成状態になる', () => { + const store = useCubeStore() + store.setSize(5) + store.applyMove({ face: Face.Up, sliceIndex: 0, direction: Direction.CCW }) + store.reset() + expect(store.cubeState.size).toBe(5) + expect(isSolved(store.cubeState)).toBe(true) + }) + + // --------------------------------------------------------------------------- + // イミュータブル性 + // --------------------------------------------------------------------------- + + it('applyMove 後も元の cubeState オブジェクトは変更されない', () => { + const store = useCubeStore() + const snapshot = store.cubeState + const before = JSON.stringify(snapshot.faces) + store.applyMove({ face: Face.Right, sliceIndex: 0, direction: Direction.CW }) + expect(JSON.stringify(snapshot.faces)).toBe(before) + }) +}) diff --git a/tsconfig.json b/tsconfig.json index 61f2cbc..dd82b67 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,7 @@ "target": "ES2022", "module": "ESNext", "moduleResolution": "Bundler", - "lib": ["ES2022"], + "lib": ["ES2022", "DOM", "DOM.Iterable"], "strict": true, "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true, diff --git a/vite.config.ts b/vite.config.ts new file mode 100644 index 0000000..c40aa3c --- /dev/null +++ b/vite.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' + +export default defineConfig({ + plugins: [vue()], +}) diff --git a/vitest.config.ts b/vitest.config.ts index 7c4aa62..090d6a7 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,11 +1,25 @@ import { defineConfig } from 'vitest/config' +import vue from '@vitejs/plugin-vue' export default defineConfig({ + plugins: [vue()], test: { include: ['tests/**/*.test.ts'], + environmentMatchGlobs: [ + ['tests/components/**', 'happy-dom'], + ['tests/stores/**', 'happy-dom'], + ['tests/composables/**', 'happy-dom'], + ], coverage: { provider: 'v8', - include: ['src/logic/**/*.ts', 'src/render/**/*.ts'], + include: [ + 'src/logic/**/*.ts', + 'src/render/**/*.ts', + 'src/stores/**/*.ts', + 'src/composables/**/*.ts', + 'src/components/**/*.vue', + 'src/App.vue', + ], exclude: ['src/logic/index.ts'], thresholds: { lines: 90, From 92528ef1bbded207955a080a8ec5994c39b3525d Mon Sep 17 00:00:00 2001 From: roudai Date: Sat, 2 May 2026 21:23:41 +0900 Subject: [PATCH 2/6] docs(spec): add spec 003 UI layer documentation (retroactive) - spec.md: feature spec with 4 user stories (display, move input, size selector, LocalStorage) - plan.md: implementation plan with tech context, architecture decisions, svgdom conflict resolution - tasks.md: 22 tasks across 6 phases (all completed) - checklists/requirements.md: spec quality checklist with verification history - contracts/store-api.ts: CubeStore interface, useCubePersist signature, TEST_IDS Co-Authored-By: Claude Sonnet 4.6 --- specs/003-ui-layer/checklists/requirements.md | 54 +++++ specs/003-ui-layer/contracts/store-api.ts | 112 ++++++++++ specs/003-ui-layer/plan.md | 191 ++++++++++++++++++ specs/003-ui-layer/spec.md | 132 ++++++++++++ specs/003-ui-layer/tasks.md | 101 +++++++++ 5 files changed, 590 insertions(+) create mode 100644 specs/003-ui-layer/checklists/requirements.md create mode 100644 specs/003-ui-layer/contracts/store-api.ts create mode 100644 specs/003-ui-layer/plan.md create mode 100644 specs/003-ui-layer/spec.md create mode 100644 specs/003-ui-layer/tasks.md diff --git a/specs/003-ui-layer/checklists/requirements.md b/specs/003-ui-layer/checklists/requirements.md new file mode 100644 index 0000000..2fa1d0a --- /dev/null +++ b/specs/003-ui-layer/checklists/requirements.md @@ -0,0 +1,54 @@ +# 仕様品質チェックリスト: UI レイヤー(Vue 3 + Pinia) + +**目的**: 計画フェーズに進む前に仕様の完成度と品質を検証する +**作成日**: 2026-05-02 +**フィーチャー**: [spec.md](../spec.md) + +## コンテンツ品質 + +- [x] 実装の詳細(言語・フレームワーク・API)を含まない +- [x] ユーザー価値とビジネスニーズに焦点を当てている +- [x] 非技術系ステークホルダー向けに記述されている +- [x] 必須セクションがすべて完成している + +## 要件の完全性 + +- [x] [NEEDS CLARIFICATION] マーカーが残っていない +- [x] 要件はテスト可能で曖昧さがない +- [x] 成功基準は測定可能である +- [x] 成功基準は技術スタックに非依存である +- [x] 受け入れシナリオがすべて定義されている +- [x] エッジケースが特定されている +- [x] スコープが明確に区切られている +- [x] 依存関係と前提条件が特定されている + +## フィーチャーの準備状況 + +- [x] すべての機能要件に明確な受け入れ基準がある +- [x] ユーザーシナリオが主要フローをカバーしている +- [x] フィーチャーは成功基準で定義された測定可能なアウトカムを満たす +- [x] 仕様に実装の詳細が漏れ込んでいない + +## メモ + +- 本仕様は spec 001(ロジックレイヤー)と spec 002(描画レイヤー)に依存する。 + 両方完成済みであることを前提とする。 +- Undo/Redo・スクランブル生成・キーボードショートカット・クラウド同期はスコープ外。 + Constitution v1.2.1 の優先機能リストに含まれない。 +- LocalStorage の永続化は Constitution 原則VI の「作成状態の永続化」要件を満たす最小実装。 +- svgdom / happy-dom の競合は実装上の技術制約(plan.md に記録)。spec には含めない。 + +## 検証履歴 + +### 第1回検証(事後作成: 2026-05-02) + +| 項目 | 結果 | 補足 | +|---|---|---| +| 実装詳細の漏れ | ⚠️ 軽微 | FR-010 に vi.mock の記述あり。テスト実装詳細だが、svgdom 競合という制約を明示するため許容 | +| テスト可能性 | ✅ | 全 FR が観測可能なふるまいで記述 | +| 成功基準の測定可能性 | ✅ | SC-001〜006 はすべて自動テストまたはブラウザ確認で検証可能 | +| 技術非依存 | ⚠️ 一部技術名あり | Vue / Pinia / LocalStorage / Vitest は Constitution 確定スタック。spec 001/002 と同じ扱い | +| 受け入れシナリオ | ✅ | US1〜US4 すべて Given-When-Then 形式で記述 | +| エッジケース | ✅ | N=2/N=7・空入力・LocalStorage 破損など主要ケース網羅 | +| スコープ境界 | ✅ | Undo/Redo・スクランブル・クラウド同期は明確に除外 | +| 依存関係 | ✅ | spec 001/002 との依存関係を前提条件に明記 | diff --git a/specs/003-ui-layer/contracts/store-api.ts b/specs/003-ui-layer/contracts/store-api.ts new file mode 100644 index 0000000..e9af0aa --- /dev/null +++ b/specs/003-ui-layer/contracts/store-api.ts @@ -0,0 +1,112 @@ +/** + * UI レイヤー公開 API 契約 + * ファイル: src/stores/cube.ts として実装される + * + * このファイルはコントラクト定義のみ(実装なし)。 + * 実装は src/stores/ および src/composables/ に配置する。 + */ + +import type { CubeState } from '../../../src/logic/index.js' +import type { CubeSize } from '../../../src/logic/types.js' + +// --------------------------------------------------------------------------- +// Move 型(ロジックレイヤーからの再エクスポート参照) +// --------------------------------------------------------------------------- + +import type { Move, MoveSequence } from '../../../src/logic/index.js' + +// --------------------------------------------------------------------------- +// CubeStore — Pinia setup ストア +// --------------------------------------------------------------------------- + +/** + * useCubeStore() の戻り値型(概念定義)。 + * 実装は defineStore('cube', () => { ... }) で行う。 + */ +export interface CubeStore { + /** 現在のキューブサイズ(N=2〜7) */ + readonly size: CubeSize + + /** 現在のキューブ状態(Pinia reactive ref) */ + cubeState: CubeState + + /** + * 単一ムーブを適用する。 + * `applyMove(cubeState, move)` の結果を `cubeState` に反映する。 + */ + applyMove(move: Move): void + + /** + * ムーブ列を適用する。 + * `applySequence(cubeState, moves)` の結果を `cubeState` に反映する。 + */ + applySequence(moves: MoveSequence): void + + /** + * 現在のサイズで solved 状態にリセットする。 + */ + reset(): void + + /** + * キューブサイズを変更し、solved 状態にリセットする。 + * @param n 新しいサイズ(2〜7) + */ + setSize(n: CubeSize): void +} + +// --------------------------------------------------------------------------- +// useCubePersist — LocalStorage 永続化コンポーザブル +// --------------------------------------------------------------------------- + +/** + * LocalStorage へのキューブ状態の自動保存と起動時復元を行うコンポーザブル。 + * + * - `onMounted`: `vce3-cube-state` キーから JSON を読み込み `deserialize` で復元する。 + * 不正 JSON またはスキーマ不一致の場合は solved 状態を維持する(フォールバック)。 + * - `watch(() => store.cubeState)`: 変化のたびに `serialize(state)` を + * JSON 化して `vce3-cube-state` キーに保存する。 + * + * LocalStorage キー: `vce3-cube-state` + * シリアライズ形式: `SerializedCube`(`serialize` / `deserialize` から) + * + * 使用例: + * ```typescript + * // App.vue の