diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a621d8d..1ca2138 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -139,7 +139,7 @@ jobs: sudo apt install -y xvfb curl pnpm run test-prepare ls -l build - ls -l test/runner/nwjs/wcc/build/Release + ls -l test/runner/addon/wcc/build/Release # fix: 预先运行,做一下配置,不然第一次执行会有问题 ./test/wine/wcc.exe || true ./test/wine/wcc.exe -v || true diff --git a/package.json b/package.json index 0d2bcc8..8f5bde1 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "@babel/core": "^7.18.13", "@babel/preset-env": "^7.18.10", "@babel/register": "^7.18.9", + "@types/jest": "^30.0.0", "@types/mocha": "^10.0.1", "@types/node": "^20.4.5", "assert": "^2.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 66cf226..bf7c98d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,6 +33,9 @@ importers: '@babel/register': specifier: ^7.18.9 version: 7.18.9(@babel/core@7.18.13) + '@types/jest': + specifier: ^30.0.0 + version: 30.0.0 '@types/mocha': specifier: ^10.0.1 version: 10.0.1 @@ -69,6 +72,10 @@ packages: resolution: {integrity: sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==} engines: {node: '>=6.9.0'} + '@babel/code-frame@7.27.1': + resolution: {integrity: sha512-cjQ7ZlQ0Mv3b47hABuTevyTuYN4i+loJKGeV9flcCgIK37cCXRh+L1bd3iBHlynerhQ7BhCkn2BPbQUL+rGqFg==} + engines: {node: '>=6.9.0'} + '@babel/compat-data@7.22.9': resolution: {integrity: sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==} engines: {node: '>=6.9.0'} @@ -190,6 +197,10 @@ packages: resolution: {integrity: sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.28.5': + resolution: {integrity: sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.22.5': resolution: {integrity: sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==} engines: {node: '>=6.9.0'} @@ -771,6 +782,30 @@ packages: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} + '@jest/diff-sequences@30.0.1': + resolution: {integrity: sha512-n5H8QLDJ47QqbCNn5SuFjCRDrOLEZ0h8vAHCK5RL9Ls7Xa8AQLa/YxAc9UjFqoEDM48muwtBGjtMY5cr0PLDCw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/expect-utils@30.2.0': + resolution: {integrity: sha512-1JnRfhqpD8HGpOmQp180Fo9Zt69zNtC+9lR+kT7NVL05tNXIi+QC8Csz7lfidMoVLPD3FnOtcmp0CEFnxExGEA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/get-type@30.1.0': + resolution: {integrity: sha512-eMbZE2hUnx1WV0pmURZY9XoXPkUYjpc55mb0CrhtdWLtzMQPFvu/rZkTLZFTsdaVQa+Tr4eWAteqcUzoawq/uA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/pattern@30.0.1': + resolution: {integrity: sha512-gWp7NfQW27LaBQz3TITS8L7ZCQ0TLvtmI//4OwlQRx4rnWxcPNIYjxZpDcN4+UlGxgm3jS5QPz8IPTCkb59wZA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/schemas@30.0.5': + resolution: {integrity: sha512-DmdYgtezMkh3cpU8/1uyXakv3tJRcmcXxBOcO0tbaozPwpmh4YMsnWrQm9ZmZMfa5ocbxzbFk6O4bDPEc/iAnA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + '@jest/types@30.2.0': + resolution: {integrity: sha512-H9xg1/sfVvyfU7o3zMfBEjQ1gcsdeTMgqHoYdN79tuLqfTtuu7WckRA1R5whDwOzxaZAeMKTYWqP+WCAi0CHsg==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + '@jimp/bmp@0.9.8': resolution: {integrity: sha512-CZYQPEC3iUBMuaGWrtIG+GKNl93q/PkdudrCKJR/B96dfNngsmoosEm3LuFgJHEcJIfvnJkNqKw74l+zEiqCbg==} peerDependencies: @@ -966,6 +1001,9 @@ packages: '@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3': resolution: {integrity: sha512-s88O1aVtXftvp5bCPB7WnmXc5IwOZZ7YPuwNPt+GtOOXpPvad1LfbmjYv+qII7zP6RU2QGnqve27dnLycEnyEQ==} + '@sinclair/typebox@0.34.41': + resolution: {integrity: sha512-6gS8pZzSXdyRHTIqoqSVknxolr1kzfy4/CeDnrzsVz8TTIWUbOBr6gnzOmTYJ3eXQNh4IYHIGi5aIL7sOZ2G/g==} + '@trysound/sax@0.2.0': resolution: {integrity: sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==} engines: {node: '>=10.13.0'} @@ -982,12 +1020,33 @@ packages: '@tsconfig/node16@1.0.4': resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} + '@types/istanbul-lib-coverage@2.0.6': + resolution: {integrity: sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==} + + '@types/istanbul-lib-report@3.0.3': + resolution: {integrity: sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==} + + '@types/istanbul-reports@3.0.4': + resolution: {integrity: sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==} + + '@types/jest@30.0.0': + resolution: {integrity: sha512-XTYugzhuwqWjws0CVz8QpM36+T+Dz5mTEBKhNs/esGLnCIlGdRy+Dq78NRjd7ls7r8BC8ZRMOrKlkO1hU0JOwA==} + '@types/mocha@10.0.1': resolution: {integrity: sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q==} '@types/node@20.4.5': resolution: {integrity: sha512-rt40Nk13II9JwQBdeYqmbn2Q6IVTA5uPhvSO+JVqdXw/6/4glI6oR9ezty/A9Hg5u7JH4OmYmuQ+XvjKm0Datg==} + '@types/stack-utils@2.0.3': + resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + + '@types/yargs-parser@21.0.3': + resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} + + '@types/yargs@17.0.34': + resolution: {integrity: sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A==} + '@ungap/promise-all-settled@1.1.2': resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} @@ -1049,6 +1108,10 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} + ansi-styles@5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + any-base@1.1.0: resolution: {integrity: sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==} @@ -1392,6 +1455,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-stdout@1.3.1: resolution: {integrity: sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==} @@ -1465,6 +1532,10 @@ packages: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} + ci-info@4.3.1: + resolution: {integrity: sha512-Wdy2Igu8OcBpI2pZePZ5oWjPC38tmDVx5WKUXKwlLYkA0ozo85sLsLvkBbBn/sZaSCMFOGZJ14fvW9t5/d7kdA==} + engines: {node: '>=8'} + clean-css@4.2.4: resolution: {integrity: sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==} engines: {node: '>= 4.0'} @@ -1761,6 +1832,10 @@ packages: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} + escape-string-regexp@2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + escape-string-regexp@4.0.0: resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} engines: {node: '>=10'} @@ -1775,6 +1850,10 @@ packages: exif-parser@0.1.12: resolution: {integrity: sha512-c2bQfLNbMzLPmzQuOr8fy0csy84WmwnER81W88DzTp9CYNPJ6yzOj2EZAh9pywYpqHnshVLHQJ8WzldAyfY+Iw==} + expect@30.2.0: + resolution: {integrity: sha512-u/feCi0GPsI+988gU2FLcsHyAHTU0MX1Wg68NhAnN7z/+C5wqG+CY8J53N9ioe8RXgaoz0nBR/TYMf3AycUuPw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + extend@3.0.2: resolution: {integrity: sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==} @@ -1803,6 +1882,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-cache-dir@2.1.0: resolution: {integrity: sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==} engines: {node: '>=6'} @@ -2133,6 +2216,30 @@ packages: isstream@0.1.2: resolution: {integrity: sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==} + jest-diff@30.2.0: + resolution: {integrity: sha512-dQHFo3Pt4/NLlG5z4PxZ/3yZTZ1C7s9hveiOj+GCN+uT109NC2QgsoVZsVOAvbJ3RgKkvyLGXZV9+piDpWbm6A==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + jest-matcher-utils@30.2.0: + resolution: {integrity: sha512-dQ94Nq4dbzmUWkQ0ANAWS9tBRfqCrn0bV9AMYdOi/MHW726xn7eQmMeRTpX2ViC00bpNaWXq+7o4lIQ3AX13Hg==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + jest-message-util@30.2.0: + resolution: {integrity: sha512-y4DKFLZ2y6DxTWD4cDe07RglV88ZiNEdlRfGtqahfbIjfsw1nMCPx49Uev4IA/hWn3sDKyAnSPwoYSsAEdcimw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + jest-mock@30.2.0: + resolution: {integrity: sha512-JNNNl2rj4b5ICpmAcq+WbLH83XswjPbjH4T7yvGzfAGCPh1rw+xVNbtk+FnRslvt9lkCcdn9i1oAoKUuFsOxRw==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + jest-regex-util@30.0.1: + resolution: {integrity: sha512-jHEQgBXAgc+Gh4g0p3bCevgRCVRkB4VB70zhoAE48gxeSr1hfUOsM/C2WoJgVL7Eyg//hudYENbm3Ne+/dRVVA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + + jest-util@30.2.0: + resolution: {integrity: sha512-QKNsM0o3Xe6ISQU869e+DhG+4CK/48aHYdJZGlFQVTjnbvgpcKyxpzk29fGiO7i/J8VENZ+d2iGnSsvmuHywlA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + jimp@0.9.8: resolution: {integrity: sha512-DHN4apKMwLIvD/TKO9tFfPuankNuVK98vCwHm/Jv9z5cJnrd38xhi+4I7IAGmDU3jIDlrEVhzTkFH1Ymv5yTQQ==} @@ -2297,6 +2404,10 @@ packages: memory-stream@1.0.0: resolution: {integrity: sha512-Wm13VcsPIMdG96dzILfij09PvuS3APtcKNh7M28FsCA/w6+1mjR7hhPmfFNoilX9xU7wTdhsH5lJAm6XNzdtww==} + 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'} @@ -2535,10 +2646,17 @@ packages: picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + picomatch@4.0.3: + resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==} + engines: {node: '>=12'} + pify@3.0.0: resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} engines: {node: '>=4'} @@ -2739,6 +2857,10 @@ packages: resolution: {integrity: sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==} engines: {node: ^10 || ^12 || >=14} + pretty-format@30.2.0: + resolution: {integrity: sha512-9uBdv/B4EefsuAL+pWqueZyZS2Ba+LxfFeQ9DN14HU4bN8bhaxKdkpjpB6fs9+pSjIBu+FXQHImEg8j/Lw0+vA==} + engines: {node: ^18.14.0 || ^20.0.0 || ^22.0.0 || >=24.0.0} + private@0.1.8: resolution: {integrity: sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==} engines: {node: '>= 0.6'} @@ -2784,6 +2906,9 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true + react-is@18.3.1: + resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} + read-package-json@2.1.2: resolution: {integrity: sha512-D1KmuLQr6ZSJS0tW8hf3WGpRlwszJOXZ3E8Yd/DNRaM5d+1wVRZdHlpGBLAuovjr28LbWvjpWkBHMxpRGGjzNA==} @@ -2929,6 +3054,10 @@ packages: resolution: {integrity: sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==} engines: {node: '>=6'} + slash@3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -2968,6 +3097,10 @@ packages: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' + stack-utils@2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + string-hash-64@1.0.3: resolution: {integrity: sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw==} @@ -3295,6 +3428,12 @@ snapshots: dependencies: '@babel/highlight': 7.22.5 + '@babel/code-frame@7.27.1': + dependencies: + '@babel/helper-validator-identifier': 7.28.5 + js-tokens: 4.0.0 + picocolors: 1.1.1 + '@babel/compat-data@7.22.9': {} '@babel/core@7.18.13': @@ -3532,6 +3671,8 @@ snapshots: '@babel/helper-validator-identifier@7.22.5': {} + '@babel/helper-validator-identifier@7.28.5': {} + '@babel/helper-validator-option@7.22.5': {} '@babel/helper-wrap-function@7.22.9': @@ -4702,6 +4843,33 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 + '@jest/diff-sequences@30.0.1': {} + + '@jest/expect-utils@30.2.0': + dependencies: + '@jest/get-type': 30.1.0 + + '@jest/get-type@30.1.0': {} + + '@jest/pattern@30.0.1': + dependencies: + '@types/node': 20.4.5 + jest-regex-util: 30.0.1 + + '@jest/schemas@30.0.5': + dependencies: + '@sinclair/typebox': 0.34.41 + + '@jest/types@30.2.0': + dependencies: + '@jest/pattern': 30.0.1 + '@jest/schemas': 30.0.5 + '@types/istanbul-lib-coverage': 2.0.6 + '@types/istanbul-reports': 3.0.4 + '@types/node': 20.4.5 + '@types/yargs': 17.0.34 + chalk: 4.1.2 + '@jimp/bmp@0.9.8(@jimp/custom@0.9.8)': dependencies: '@babel/runtime': 7.22.6 @@ -5001,6 +5169,8 @@ snapshots: '@nicolo-ribaudo/chokidar-2@2.1.8-no-fsevents.3': optional: true + '@sinclair/typebox@0.34.41': {} + '@trysound/sax@0.2.0': {} '@tsconfig/node10@1.0.9': {} @@ -5011,10 +5181,33 @@ snapshots: '@tsconfig/node16@1.0.4': {} + '@types/istanbul-lib-coverage@2.0.6': {} + + '@types/istanbul-lib-report@3.0.3': + dependencies: + '@types/istanbul-lib-coverage': 2.0.6 + + '@types/istanbul-reports@3.0.4': + dependencies: + '@types/istanbul-lib-report': 3.0.3 + + '@types/jest@30.0.0': + dependencies: + expect: 30.2.0 + pretty-format: 30.2.0 + '@types/mocha@10.0.1': {} '@types/node@20.4.5': {} + '@types/stack-utils@2.0.3': {} + + '@types/yargs-parser@21.0.3': {} + + '@types/yargs@17.0.34': + dependencies: + '@types/yargs-parser': 21.0.3 + '@ungap/promise-all-settled@1.1.2': {} '@vue/reactivity@3.0.5': @@ -5063,6 +5256,8 @@ snapshots: dependencies: color-convert: 2.0.1 + ansi-styles@5.2.0: {} + any-base@1.1.0: {} anymatch@3.1.3: @@ -5724,6 +5919,10 @@ snapshots: dependencies: fill-range: 7.0.1 + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + browser-stdout@1.3.1: {} browserslist@4.21.10: @@ -5814,6 +6013,8 @@ snapshots: chownr@2.0.0: {} + ci-info@4.3.1: {} + clean-css@4.2.4: dependencies: source-map: 0.6.1 @@ -6129,6 +6330,8 @@ snapshots: escape-string-regexp@1.0.5: {} + escape-string-regexp@2.0.0: {} + escape-string-regexp@4.0.0: {} esutils@2.0.3: {} @@ -6137,6 +6340,15 @@ snapshots: exif-parser@0.1.12: {} + expect@30.2.0: + dependencies: + '@jest/expect-utils': 30.2.0 + '@jest/get-type': 30.1.0 + jest-matcher-utils: 30.2.0 + jest-message-util: 30.2.0 + jest-mock: 30.2.0 + jest-util: 30.2.0 + extend@3.0.2: {} extsprintf@1.3.0: {} @@ -6157,6 +6369,10 @@ snapshots: dependencies: to-regex-range: 5.0.1 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + find-cache-dir@2.1.0: dependencies: commondir: 1.0.1 @@ -6486,6 +6702,49 @@ snapshots: isstream@0.1.2: {} + jest-diff@30.2.0: + dependencies: + '@jest/diff-sequences': 30.0.1 + '@jest/get-type': 30.1.0 + chalk: 4.1.2 + pretty-format: 30.2.0 + + jest-matcher-utils@30.2.0: + dependencies: + '@jest/get-type': 30.1.0 + chalk: 4.1.2 + jest-diff: 30.2.0 + pretty-format: 30.2.0 + + jest-message-util@30.2.0: + dependencies: + '@babel/code-frame': 7.27.1 + '@jest/types': 30.2.0 + '@types/stack-utils': 2.0.3 + chalk: 4.1.2 + graceful-fs: 4.2.11 + micromatch: 4.0.8 + pretty-format: 30.2.0 + slash: 3.0.0 + stack-utils: 2.0.6 + + jest-mock@30.2.0: + dependencies: + '@jest/types': 30.2.0 + '@types/node': 20.4.5 + jest-util: 30.2.0 + + jest-regex-util@30.0.1: {} + + jest-util@30.2.0: + dependencies: + '@jest/types': 30.2.0 + '@types/node': 20.4.5 + chalk: 4.1.2 + ci-info: 4.3.1 + graceful-fs: 4.2.11 + picomatch: 4.0.3 + jimp@0.9.8: dependencies: '@babel/runtime': 7.22.6 @@ -6656,6 +6915,11 @@ snapshots: dependencies: readable-stream: 3.6.2 + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mime-db@1.52.0: {} mime-types@2.1.35: @@ -6937,8 +7201,12 @@ snapshots: picocolors@1.0.0: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} + picomatch@4.0.3: {} + pify@3.0.0: {} pify@4.0.1: {} @@ -7120,6 +7388,12 @@ snapshots: picocolors: 1.0.0 source-map-js: 1.0.2 + pretty-format@30.2.0: + dependencies: + '@jest/schemas': 30.0.5 + ansi-styles: 5.2.0 + react-is: 18.3.1 + private@0.1.8: {} process-nextick-args@2.0.1: {} @@ -7153,6 +7427,8 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 + react-is@18.3.1: {} + read-package-json@2.1.2: dependencies: glob: 7.2.3 @@ -7325,6 +7601,8 @@ snapshots: slash@2.0.0: {} + slash@3.0.0: {} + source-map-js@1.0.2: {} source-map-support@0.4.18: @@ -7368,6 +7646,10 @@ snapshots: stable@0.1.8: {} + stack-utils@2.0.6: + dependencies: + escape-string-regexp: 2.0.0 + string-hash-64@1.0.3: {} string-width@4.2.3: diff --git a/test/runner/nwjs/module-prepare.sh b/test/runner/addon/addon-prepare.sh similarity index 50% rename from test/runner/nwjs/module-prepare.sh rename to test/runner/addon/addon-prepare.sh index e8fac00..6de89ce 100755 --- a/test/runner/nwjs/module-prepare.sh +++ b/test/runner/addon/addon-prepare.sh @@ -1,37 +1,25 @@ #! /bin/bash +set -ex + Xvfb :98 & # Start xvfb on display :98 export DISPLAY=:98 -set -ex root_dir=$(cd `dirname $0`/../../.. && pwd -P) cur_dir=$(cd `dirname $0` && pwd -P) nw_version="0.55.0" mkdir -p "$root_dir/cache" -if [ ! -f "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64.zip" ];then - wget -c -O "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64.zip.tmp" "https://dl.nwjs.io/v0.55.0/nwjs-sdk-v0.55.0-win-x64.zip" - mv "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64.zip.tmp" "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64.zip" -fi -if [ ! -d "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64" ];then - cd "$root_dir/cache" - unzip "nwjs-sdk-v$nw_version-win-x64.zip" +if [ ! -f "$root_dir/cache/node.exe" ];then + wget -c -O "$root_dir/cache/node.exe.tmp" "https://github.com/msojocs/skyline-node/releases/download/v16.4.0-1/node.exe" + mv "$root_dir/cache/node.exe.tmp" "$root_dir/cache/node.exe" fi - -if [ ! -f "$root_dir/cache/nwjs-sdk-v$nw_version-linux-x64.tar.gz" ];then - wget -c -O "$root_dir/cache/nwjs-sdk-v$nw_version-linux-x64.tar.gz.tmp" "https://dl.nwjs.io/v0.55.0/nwjs-sdk-v0.55.0-linux-x64.tar.gz" - mv "$root_dir/cache/nwjs-sdk-v$nw_version-linux-x64.tar.gz.tmp" "$root_dir/cache/nwjs-sdk-v$nw_version-linux-x64.tar.gz" -fi - -if [ ! -d "$root_dir/cache/nwjs-sdk-v$nw_version-linux-x64" ];then - cd "$root_dir/cache" - tar -zxf "nwjs-sdk-v$nw_version-linux-x64.tar.gz" +if [ ! -f "$root_dir/cache/node.dll" ];then + wget -c -O "$root_dir/cache/node.dll.tmp" "https://github.com/msojocs/skyline-node/releases/download/v16.4.0-1/node.dll" + mv "$root_dir/cache/node.dll.tmp" "$root_dir/cache/node.dll" fi -rm -rf "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64/package.nw" -cp -r "$cur_dir/package.nw" "$root_dir/cache/nwjs-sdk-v$nw_version-win-x64" - docker_start(){ - docker run -d -i\ + docker run -d -it\ --rm\ --volume=$root_dir:/workspace\ --env=USE_XVFB=yes\ @@ -42,12 +30,11 @@ docker_start(){ --hostname=DESKTOP-1TV4OA1\ --name=wine\ --shm-size=1g\ - --workdir=/home/wineuser\ + --workdir=/workspace/cache\ --env=TZ=Asia/Shanghai\ - --volume=winehome:/home/wineuser\ -p 8083:8083\ scottyhardy/docker-wine\ - wine /workspace/cache/nwjs-sdk-v$nw_version-win-x64/nw.exe + wine node.exe ../test/runner/addon/win/main.js i=0 until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8083/check); do diff --git a/test/runner/nwjs/compiler.js b/test/runner/addon/compiler.js similarity index 100% rename from test/runner/nwjs/compiler.js rename to test/runner/addon/compiler.js diff --git a/test/runner/nwjs/wcc/build/Release/wcc.node b/test/runner/addon/wcc/build/Release/wcc.node similarity index 100% rename from test/runner/nwjs/wcc/build/Release/wcc.node rename to test/runner/addon/wcc/build/Release/wcc.node diff --git a/test/runner/nwjs/wcc/build/Release/wcsc.node b/test/runner/addon/wcc/build/Release/wcsc.node similarity index 100% rename from test/runner/nwjs/wcc/build/Release/wcsc.node rename to test/runner/addon/wcc/build/Release/wcsc.node diff --git a/test/runner/nwjs/package.nw/wcc/lib/index.js b/test/runner/addon/wcc/lib/index.js similarity index 100% rename from test/runner/nwjs/package.nw/wcc/lib/index.js rename to test/runner/addon/wcc/lib/index.js diff --git a/test/runner/nwjs/package.nw/wcc/lib/util.js b/test/runner/addon/wcc/lib/util.js similarity index 100% rename from test/runner/nwjs/package.nw/wcc/lib/util.js rename to test/runner/addon/wcc/lib/util.js diff --git a/test/runner/nwjs/package.nw/wcc/lib/wcc.js b/test/runner/addon/wcc/lib/wcc.js similarity index 100% rename from test/runner/nwjs/package.nw/wcc/lib/wcc.js rename to test/runner/addon/wcc/lib/wcc.js diff --git a/test/runner/nwjs/package.nw/wcc/lib/wcsc.js b/test/runner/addon/wcc/lib/wcsc.js similarity index 100% rename from test/runner/nwjs/package.nw/wcc/lib/wcsc.js rename to test/runner/addon/wcc/lib/wcsc.js diff --git a/test/runner/nwjs/package.nw/wcc/package.json b/test/runner/addon/wcc/package.json similarity index 100% rename from test/runner/nwjs/package.nw/wcc/package.json rename to test/runner/addon/wcc/package.json diff --git a/test/runner/nwjs/package.nw/main.js b/test/runner/addon/win/main.js similarity index 91% rename from test/runner/nwjs/package.nw/main.js rename to test/runner/addon/win/main.js index a47c2cb..821ca8f 100644 --- a/test/runner/nwjs/package.nw/main.js +++ b/test/runner/addon/win/main.js @@ -4,10 +4,11 @@ console.log("===================================================================="); console.log("==============================main.js==============================="); console.log("===================================================================="); -const fs = require("fs"); -console.log("fs:", fs); -const wcc = require("./wcc"); +const path = require("path"); +const wcc = require(path.resolve(__dirname, "./wcc")); console.log("wcc:", wcc); +require(path.resolve(__dirname, "./wcc/build/Release/wcc.node")); +require(path.resolve(__dirname, "./wcc/build/Release/wcsc.node")); const { createServer } = require("http"); diff --git a/test/runner/nwjs/package.nw/package.json b/test/runner/addon/win/package.json similarity index 100% rename from test/runner/nwjs/package.nw/package.json rename to test/runner/addon/win/package.json diff --git a/test/runner/nwjs/package.nw/wcc/build/Release/wcc.node b/test/runner/addon/win/wcc/build/Release/wcc.node similarity index 100% rename from test/runner/nwjs/package.nw/wcc/build/Release/wcc.node rename to test/runner/addon/win/wcc/build/Release/wcc.node diff --git a/test/runner/nwjs/package.nw/wcc/build/Release/wcsc.node b/test/runner/addon/win/wcc/build/Release/wcsc.node similarity index 100% rename from test/runner/nwjs/package.nw/wcc/build/Release/wcsc.node rename to test/runner/addon/win/wcc/build/Release/wcsc.node diff --git a/test/runner/nwjs/wcc/lib/index.js b/test/runner/addon/win/wcc/lib/index.js similarity index 100% rename from test/runner/nwjs/wcc/lib/index.js rename to test/runner/addon/win/wcc/lib/index.js diff --git a/test/runner/nwjs/wcc/lib/util.js b/test/runner/addon/win/wcc/lib/util.js similarity index 100% rename from test/runner/nwjs/wcc/lib/util.js rename to test/runner/addon/win/wcc/lib/util.js diff --git a/test/runner/nwjs/wcc/lib/wcc.js b/test/runner/addon/win/wcc/lib/wcc.js similarity index 100% rename from test/runner/nwjs/wcc/lib/wcc.js rename to test/runner/addon/win/wcc/lib/wcc.js diff --git a/test/runner/nwjs/wcc/lib/wcsc.js b/test/runner/addon/win/wcc/lib/wcsc.js similarity index 100% rename from test/runner/nwjs/wcc/lib/wcsc.js rename to test/runner/addon/win/wcc/lib/wcsc.js diff --git a/test/runner/nwjs/wcc/package.json b/test/runner/addon/win/wcc/package.json similarity index 100% rename from test/runner/nwjs/wcc/package.json rename to test/runner/addon/win/wcc/package.json diff --git a/test/runner/module-linux.ts b/test/runner/module-linux.ts index 769b6e3..7c4cc78 100644 --- a/test/runner/module-linux.ts +++ b/test/runner/module-linux.ts @@ -8,12 +8,13 @@ const NW_VERSION = '0.55.0' const wcscNative = (optionsPath: string, projectPath: string, outputPath: string | undefined = undefined): Promise => { const nodeExec = spawn( - path.resolve(__dirname, `../../cache/nwjs-sdk-v${NW_VERSION}-linux-x64/nw`), - [ path.resolve(__dirname, './nwjs/compiler.js'), 'wcsc', optionsPath ], + 'node', + [ path.resolve(__dirname, './addon/compiler.js'), 'wcsc', optionsPath ], { cwd: projectPath, env: { WX_DEBUG_COMPILER_OUTPUT: outputPath, + ...process.env }, // stdio: 'inherit' } @@ -63,11 +64,12 @@ const wcscNative = (optionsPath: string, projectPath: string, outputPath: string const wccNative = (optionsPath: string, outputPath: string | undefined = undefined): Promise => { const nodeExec = spawn( - path.resolve(__dirname, `../../cache/nwjs-sdk-v${NW_VERSION}-linux-x64/nw`), - [path.resolve(__dirname, './nwjs/compiler.js'), 'wcc', optionsPath], + 'node', + [path.resolve(__dirname, './addon/compiler.js'), 'wcc', optionsPath], { env: { WX_DEBUG_COMPILER_OUTPUT: outputPath, + ...process.env }, // stdio: 'inherit' } diff --git a/test/runner/module-windows.ts b/test/runner/module-windows.ts index 0c4ed34..a73d3df 100644 --- a/test/runner/module-windows.ts +++ b/test/runner/module-windows.ts @@ -102,7 +102,7 @@ export default { wcsc: wcscNative, wcc: wccNative, start: () => { - execFileSync(path.resolve(__dirname, './nwjs/module-prepare.sh'), { stdio: 'inherit' }) + execFileSync(path.resolve(__dirname, './addon/addon-prepare.sh'), { stdio: 'inherit' }) }, close: () => { request('http://127.0.0.1:8083/close').end() diff --git a/test/runner/nwjs/package.nw/index.html b/test/runner/nwjs/package.nw/index.html deleted file mode 100644 index b5ce08f..0000000 --- a/test/runner/nwjs/package.nw/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - Hello World! - - -

Hello World!

- - - \ No newline at end of file diff --git a/test/spec/issue/115/issue115.spec.ts b/test/spec/issue/115/issue115.spec.ts index 29be378..49921e4 100644 --- a/test/spec/issue/115/issue115.spec.ts +++ b/test/spec/issue/115/issue115.spec.ts @@ -22,8 +22,8 @@ describe("issue - 115", function () { // console.log('windows:', typeof w) // console.log('linux:', typeof n) - assert.equal(typeof n, typeof w); - assert.equal(w.success, false) + assert.equal(typeof n, typeof w, 'Type mismatch'); + assert.equal(w.success, false, 'Success flag mismatch'); fs.writeFileSync( `${storagePath}/wine-output.json`, JSON.stringify(w, null, 4) @@ -32,7 +32,7 @@ describe("issue - 115", function () { `${storagePath}/node-output.json`, JSON.stringify(n, null, 4) ); - assert.deepEqual(n, w); + assert.deepEqual(n, w, 'Output data mismatch'); }); }); }); diff --git a/test/spec/prepare.sh b/test/spec/prepare.sh index bd25656..79bbf0c 100755 --- a/test/spec/prepare.sh +++ b/test/spec/prepare.sh @@ -2,7 +2,7 @@ set -e test_dir=$(cd `dirname $0`/.. && pwd -P) -"$test_dir/runner/nwjs/module-prepare.sh" +"$test_dir/runner/addon/addon-prepare.sh" "$test_dir/spec/issue/prepare.sh" project_dir="$test_dir/projects" diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c24a994 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "strict": true, + "target": "esnext", + "allowJs": false, + "lib": ["ES6"], + "module": "NodeNext", + "moduleResolution": "NodeNext", + "noImplicitThis": false, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true + }, + "types": ["jest", "node"], + "include": [ + "test/**/*.ts" + ], + "ts-node": { + "esm": true, + "experimentalSpecifierResolution": "node" + } +}