diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 1e672ee..ccee7e6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,8 @@ { "recommendations": [ "editorconfig.editorconfig", - "dbaeumer.vscode-eslint" + "dbaeumer.vscode-eslint", + "davidanson.vscode-markdownlint", + "zixuanchen.vitest-explorer" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 7ba8a14..e68949e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -18,5 +18,6 @@ ], "[json]": { "editor.defaultFormatter": "vscode.json-language-features" - } + }, + "vitest.enable": true } diff --git a/package-lock.json b/package-lock.json index a4f9136..3d4370d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "typedoc-plugin-markdown": "~3.14.0", "typescript": "~4.9.4", "vite": "~4.0.4", - "vitest": "~0.27.2" + "vitest": "~0.28.1" } }, "node_modules/@esbuild/android-arm": { @@ -755,6 +755,77 @@ "url": "https://opencollective.com/typescript-eslint" } }, + "node_modules/@vitest/expect": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.28.1.tgz", + "integrity": "sha512-BOvWjBoocKrrTTTC0opIvzOEa7WR/Ovx4++QYlbjYKjnQJfWRSEQkTpAIEfOURtZ/ICcaLk5jvsRshXvjarZew==", + "dev": true, + "dependencies": { + "@vitest/spy": "0.28.1", + "@vitest/utils": "0.28.1", + "chai": "^4.3.7" + } + }, + "node_modules/@vitest/runner": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.28.1.tgz", + "integrity": "sha512-kOdmgiNe+mAxZhvj2eUTqKnjfvzzknmrcS+SZXV7j6VgJuWPFAMCv3TWOe03nF9dkqDfVLCDRw/hwFuCzmzlQg==", + "dev": true, + "dependencies": { + "@vitest/utils": "0.28.1", + "p-limit": "^4.0.0", + "pathe": "^1.1.0" + } + }, + "node_modules/@vitest/runner/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/runner/node_modules/yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@vitest/spy": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.28.1.tgz", + "integrity": "sha512-XGlD78cG3IxXNnGwEF121l0MfTNlHSdI25gS2ik0z6f/D9wWUOru849QkJbuNl4CMlZCtNkx3b5IS6MRwKGKuA==", + "dev": true, + "dependencies": { + "tinyspy": "^1.0.2" + } + }, + "node_modules/@vitest/utils": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.28.1.tgz", + "integrity": "sha512-a7cV1fs5MeU+W+8sn8gM9gV+q7V/wYz3/4y016w/icyJEKm9AMdSHnrzxTWaElJ07X40pwU6m5353Jlw6Rbd8w==", + "dev": true, + "dependencies": { + "cli-truncate": "^3.1.0", + "diff": "^5.1.0", + "loupe": "^2.3.6", + "picocolors": "^1.0.0", + "pretty-format": "^27.5.1" + } + }, "node_modules/acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", @@ -977,6 +1048,22 @@ "node": "*" } }, + "node_modules/cli-truncate": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "dev": true, + "dependencies": { + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1068,6 +1155,15 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "node_modules/diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -1092,6 +1188,12 @@ "node": ">=6.0.0" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "node_modules/editorconfig": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.1.tgz", @@ -1110,6 +1212,12 @@ "node": ">=14" } }, + "node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "node_modules/esbuild": { "version": "0.16.17", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz", @@ -1877,6 +1985,18 @@ "node": ">=0.10.0" } }, + "node_modules/is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -2128,12 +2248,6 @@ "ufo": "^1.0.1" } }, - "node_modules/mlly/node_modules/pathe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", - "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==", - "dev": true - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -2299,9 +2413,9 @@ } }, "node_modules/pathe": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz", - "integrity": "sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz", + "integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==", "dev": true }, "node_modules/pathval": { @@ -2342,12 +2456,6 @@ "pathe": "^1.0.0" } }, - "node_modules/pkg-types/node_modules/pathe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", - "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==", - "dev": true - }, "node_modules/portfinder": { "version": "1.0.32", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.32.tgz", @@ -2404,6 +2512,32 @@ "node": ">= 0.8.0" } }, + "node_modules/pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/punycode": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", @@ -2448,6 +2582,12 @@ } ] }, + "node_modules/react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, "node_modules/rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -2695,6 +2835,34 @@ "node": ">=8" } }, + "node_modules/slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -2729,6 +2897,56 @@ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, + "node_modules/std-env": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.1.tgz", + "integrity": "sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==", + "dev": true + }, + "node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/string-width/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/string-width/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -3044,15 +3262,15 @@ } }, "node_modules/vite-node": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.27.2.tgz", - "integrity": "sha512-IDwuVhslF10qCnWOGJui7/2KksAOBHi+UbVo6Pqt4f5lgn+kS2sVvYDsETRG5PSuslisGB5CFGvb9I6FQgymBQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.28.1.tgz", + "integrity": "sha512-Mmab+cIeElkVn4noScCRjy8nnQdh5LDIR4QCH/pVWtY15zv5Z1J7u6/471B9JZ2r8CEIs42vTbngaamOVkhPLA==", "dev": true, "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", "mlly": "^1.1.0", - "pathe": "^0.2.0", + "pathe": "^1.1.0", "picocolors": "^1.0.0", "source-map": "^0.6.1", "source-map-support": "^0.5.21", @@ -3069,28 +3287,34 @@ } }, "node_modules/vitest": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.27.2.tgz", - "integrity": "sha512-y7tdsL2uaQy+KF18AlmNHZe29ukyFytlxrpSTwwmgLE2XHR/aPucJP9FLjWoqjgqFlXzRAjHlFJLU+HDyI/OsA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.28.1.tgz", + "integrity": "sha512-F6wAO3K5+UqJCCGt0YAl3Ila2f+fpBrJhl9n7qWEhREwfzQeXlMkkCqGqGtzBxCSa8kv5QHrkshX8AaPTXYACQ==", "dev": true, "dependencies": { "@types/chai": "^4.3.4", "@types/chai-subset": "^1.3.3", "@types/node": "*", + "@vitest/expect": "0.28.1", + "@vitest/runner": "0.28.1", + "@vitest/spy": "0.28.1", + "@vitest/utils": "0.28.1", "acorn": "^8.8.1", "acorn-walk": "^8.2.0", "cac": "^6.7.14", "chai": "^4.3.7", "debug": "^4.3.4", "local-pkg": "^0.4.2", + "pathe": "^1.1.0", "picocolors": "^1.0.0", "source-map": "^0.6.1", + "std-env": "^3.3.1", "strip-literal": "^1.0.0", "tinybench": "^2.3.1", "tinypool": "^0.3.0", "tinyspy": "^1.0.2", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.27.2", + "vite-node": "0.28.1", "why-is-node-running": "^2.2.2" }, "bin": { @@ -3251,38 +3475,23 @@ "version": "0.0.0", "dependencies": { "lil-gui": "~0.17.0", - "wtd-three-ext": "2.2.0-next.1", + "wtd-three-ext": "2.2.0-next.3", "wwobjloader2": "5.1.0-next.0" }, "devDependencies": { "http-server": "~14.1.1" } }, - "packages/examples/node_modules/wtd-core": { - "version": "2.2.0-next.1", - "license": "MIT" - }, - "packages/examples/node_modules/wtd-three-ext": { - "version": "2.2.0-next.1", - "license": "MIT", - "dependencies": { - "three": "~0.148.0", - "wtd-core": "2.2.0-next.1" - }, - "peerDependencies": { - "three": ">= 0.137.5 < 1" - } - }, "packages/wtd-core": { - "version": "2.2.0-next.2", + "version": "2.2.0-next.3", "license": "MIT" }, "packages/wtd-three-ext": { - "version": "2.2.0-next.2", + "version": "2.2.0-next.3", "license": "MIT", "dependencies": { "three": "~0.148.0", - "wtd-core": "2.2.0-next.2" + "wtd-core": "2.2.0-next.3" }, "devDependencies": { "@types/three": "~0.148.0" @@ -3708,6 +3917,67 @@ "eslint-visitor-keys": "^3.3.0" } }, + "@vitest/expect": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.28.1.tgz", + "integrity": "sha512-BOvWjBoocKrrTTTC0opIvzOEa7WR/Ovx4++QYlbjYKjnQJfWRSEQkTpAIEfOURtZ/ICcaLk5jvsRshXvjarZew==", + "dev": true, + "requires": { + "@vitest/spy": "0.28.1", + "@vitest/utils": "0.28.1", + "chai": "^4.3.7" + } + }, + "@vitest/runner": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.28.1.tgz", + "integrity": "sha512-kOdmgiNe+mAxZhvj2eUTqKnjfvzzknmrcS+SZXV7j6VgJuWPFAMCv3TWOe03nF9dkqDfVLCDRw/hwFuCzmzlQg==", + "dev": true, + "requires": { + "@vitest/utils": "0.28.1", + "p-limit": "^4.0.0", + "pathe": "^1.1.0" + }, + "dependencies": { + "p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "requires": { + "yocto-queue": "^1.0.0" + } + }, + "yocto-queue": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", + "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", + "dev": true + } + } + }, + "@vitest/spy": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.28.1.tgz", + "integrity": "sha512-XGlD78cG3IxXNnGwEF121l0MfTNlHSdI25gS2ik0z6f/D9wWUOru849QkJbuNl4CMlZCtNkx3b5IS6MRwKGKuA==", + "dev": true, + "requires": { + "tinyspy": "^1.0.2" + } + }, + "@vitest/utils": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.28.1.tgz", + "integrity": "sha512-a7cV1fs5MeU+W+8sn8gM9gV+q7V/wYz3/4y016w/icyJEKm9AMdSHnrzxTWaElJ07X40pwU6m5353Jlw6Rbd8w==", + "dev": true, + "requires": { + "cli-truncate": "^3.1.0", + "diff": "^5.1.0", + "loupe": "^2.3.6", + "picocolors": "^1.0.0", + "pretty-format": "^27.5.1" + } + }, "acorn": { "version": "8.8.1", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", @@ -3873,6 +4143,16 @@ "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", "dev": true }, + "cli-truncate": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-3.1.0.tgz", + "integrity": "sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==", + "dev": true, + "requires": { + "slice-ansi": "^5.0.0", + "string-width": "^5.0.0" + } + }, "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -3941,6 +4221,12 @@ "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, + "diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true + }, "dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -3959,6 +4245,12 @@ "esutils": "^2.0.2" } }, + "eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true + }, "editorconfig": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.1.tgz", @@ -3971,6 +4263,12 @@ "semver": "^7.3.8" } }, + "emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true + }, "esbuild": { "version": "0.16.17", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.17.tgz", @@ -4546,6 +4844,12 @@ "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", "dev": true }, + "is-fullwidth-code-point": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", + "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", + "dev": true + }, "is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -4734,14 +5038,6 @@ "pathe": "^1.0.0", "pkg-types": "^1.0.1", "ufo": "^1.0.1" - }, - "dependencies": { - "pathe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", - "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==", - "dev": true - } } }, "ms": { @@ -4867,9 +5163,9 @@ "dev": true }, "pathe": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-0.2.0.tgz", - "integrity": "sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.0.tgz", + "integrity": "sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==", "dev": true }, "pathval": { @@ -4899,14 +5195,6 @@ "jsonc-parser": "^3.2.0", "mlly": "^1.0.0", "pathe": "^1.0.0" - }, - "dependencies": { - "pathe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.0.0.tgz", - "integrity": "sha512-nPdMG0Pd09HuSsr7QOKUXO2Jr9eqaDiZvDwdyIhNG5SHYujkQHYKDfGQkulBxvbDHz8oHLsTgKN86LSwYzSHAg==", - "dev": true - } } }, "portfinder": { @@ -4948,6 +5236,25 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, + "pretty-format": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-27.5.1.tgz", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1", + "ansi-styles": "^5.0.0", + "react-is": "^17.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true + } + } + }, "punycode": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.2.0.tgz", @@ -4969,6 +5276,12 @@ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "dev": true }, + "react-is": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz", + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dev": true + }, "rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -5137,6 +5450,24 @@ "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", "dev": true }, + "slice-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", + "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", + "dev": true, + "requires": { + "ansi-styles": "^6.0.0", + "is-fullwidth-code-point": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + "dev": true + } + } + }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -5165,6 +5496,40 @@ "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", "dev": true }, + "std-env": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.1.tgz", + "integrity": "sha512-3H20QlwQsSm2OvAxWIYhs+j01MzzqwMwGiiO1NQaJYZgJZFPuAbf95/DiKRBSTYIJ2FeGUc+B/6mPGcWP9dO3Q==", + "dev": true + }, + "string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "requires": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "dev": true + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dev": true, + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, "strip-ansi": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", @@ -5367,15 +5732,15 @@ } }, "vite-node": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.27.2.tgz", - "integrity": "sha512-IDwuVhslF10qCnWOGJui7/2KksAOBHi+UbVo6Pqt4f5lgn+kS2sVvYDsETRG5PSuslisGB5CFGvb9I6FQgymBQ==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.28.1.tgz", + "integrity": "sha512-Mmab+cIeElkVn4noScCRjy8nnQdh5LDIR4QCH/pVWtY15zv5Z1J7u6/471B9JZ2r8CEIs42vTbngaamOVkhPLA==", "dev": true, "requires": { "cac": "^6.7.14", "debug": "^4.3.4", "mlly": "^1.1.0", - "pathe": "^0.2.0", + "pathe": "^1.1.0", "picocolors": "^1.0.0", "source-map": "^0.6.1", "source-map-support": "^0.5.21", @@ -5383,28 +5748,34 @@ } }, "vitest": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.27.2.tgz", - "integrity": "sha512-y7tdsL2uaQy+KF18AlmNHZe29ukyFytlxrpSTwwmgLE2XHR/aPucJP9FLjWoqjgqFlXzRAjHlFJLU+HDyI/OsA==", + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.28.1.tgz", + "integrity": "sha512-F6wAO3K5+UqJCCGt0YAl3Ila2f+fpBrJhl9n7qWEhREwfzQeXlMkkCqGqGtzBxCSa8kv5QHrkshX8AaPTXYACQ==", "dev": true, "requires": { "@types/chai": "^4.3.4", "@types/chai-subset": "^1.3.3", "@types/node": "*", + "@vitest/expect": "0.28.1", + "@vitest/runner": "0.28.1", + "@vitest/spy": "0.28.1", + "@vitest/utils": "0.28.1", "acorn": "^8.8.1", "acorn-walk": "^8.2.0", "cac": "^6.7.14", "chai": "^4.3.7", "debug": "^4.3.4", "local-pkg": "^0.4.2", + "pathe": "^1.1.0", "picocolors": "^1.0.0", "source-map": "^0.6.1", + "std-env": "^3.3.1", "strip-literal": "^1.0.0", "tinybench": "^2.3.1", "tinypool": "^0.3.0", "tinyspy": "^1.0.2", "vite": "^3.0.0 || ^4.0.0", - "vite-node": "0.27.2", + "vite-node": "0.28.1", "why-is-node-running": "^2.2.2" } }, @@ -5474,20 +5845,8 @@ "requires": { "http-server": "~14.1.1", "lil-gui": "~0.17.0", - "wtd-three-ext": "2.2.0-next.1", + "wtd-three-ext": "2.2.0-next.3", "wwobjloader2": "5.1.0-next.0" - }, - "dependencies": { - "wtd-core": { - "version": "2.2.0-next.1" - }, - "wtd-three-ext": { - "version": "2.2.0-next.1", - "requires": { - "three": "~0.148.0", - "wtd-core": "2.2.0-next.1" - } - } } }, "wtd-three-ext": { @@ -5495,7 +5854,7 @@ "requires": { "@types/three": "~0.148.0", "three": "~0.148.0", - "wtd-core": "2.2.0-next.2" + "wtd-core": "2.2.0-next.3" } }, "wwobjloader2": { diff --git a/package.json b/package.json index a82cad0..e551366 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "typedoc-plugin-markdown": "~3.14.0", "typescript": "~4.9.4", "vite": "~4.0.4", - "vitest": "~0.27.2" + "vitest": "~0.28.1" }, "workspaces": [ "packages/wtd-core", diff --git a/packages/examples/package.json b/packages/examples/package.json index 45a3052..a45e93c 100644 --- a/packages/examples/package.json +++ b/packages/examples/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "lil-gui": "~0.17.0", - "wtd-three-ext": "2.2.0-next.1", + "wtd-three-ext": "2.2.0-next.3", "wwobjloader2": "5.1.0-next.0" }, "devDependencies": { diff --git a/packages/examples/src/worker/OBJLoaderWorker.ts b/packages/examples/src/worker/OBJLoaderWorker.ts index c25e1d4..14e3885 100644 --- a/packages/examples/src/worker/OBJLoaderWorker.ts +++ b/packages/examples/src/worker/OBJLoaderWorker.ts @@ -49,7 +49,7 @@ class OBJLoaderWorker extends WorkerTaskDirectorDefaultWorker implements WorkerT this.localData.objLoader = new OBJLoader(); this.localData.objectId = message.id as number; - const materials: AssociatedArrayType = {}; + const materials: AssociatedArrayType = {}; materials.create = (name: string) => { return materials[name]; }; diff --git a/packages/wtd-core/package.json b/packages/wtd-core/package.json index edccce2..08ee507 100644 --- a/packages/wtd-core/package.json +++ b/packages/wtd-core/package.json @@ -1,6 +1,6 @@ { "name": "wtd-core", - "version": "2.2.0-next.2", + "version": "2.2.0-next.3", "license": "MIT", "type": "module", "main": "./dist/index.js", diff --git a/packages/wtd-core/src/DataPayload.ts b/packages/wtd-core/src/DataPayload.ts index bbbe7a4..236f49c 100644 --- a/packages/wtd-core/src/DataPayload.ts +++ b/packages/wtd-core/src/DataPayload.ts @@ -1,15 +1,15 @@ -export type AssociatedArrayType = { [key: string]: unknown } +export type AssociatedArrayType = { [key: string]: T } export type DataPayloadType = { type: string; - params?: AssociatedArrayType; + params?: AssociatedArrayType; buffers?: Map; } export class DataPayload implements DataPayloadType { static TYPE = 'DataPayload'; type = DataPayload.TYPE; - params?: AssociatedArrayType = {}; + params?: AssociatedArrayType = {}; buffers: Map = new Map(); progress = 0; } @@ -76,7 +76,7 @@ export class DataPayloadHandler implements PayloadHandlerType { * @param {boolean} forceCreation Force the creation of a property */ // eslint-disable-next-line @typescript-eslint/no-explicit-any - static applyProperties(objToAlter: any, params: AssociatedArrayType, forceCreation: boolean) { + static applyProperties(objToAlter: any, params: AssociatedArrayType, forceCreation: boolean) { for (const [k, v] of Object.entries(params)) { const funcName = 'set' + k.substring(0, 1).toLocaleUpperCase() + k.substring(1); diff --git a/packages/wtd-core/test/DataPayload.test.ts b/packages/wtd-core/test/DataPayload.test.ts index 576be89..925d2d3 100644 --- a/packages/wtd-core/test/DataPayload.test.ts +++ b/packages/wtd-core/test/DataPayload.test.ts @@ -71,13 +71,13 @@ describe('DataPayload applyProperties Tests', () => { } test('verify class', () => { - const testClassRef = new Class4ApplyProperties('columbian', 2, '0ml'); - const testClassAlter = new Class4ApplyProperties('columbian', 2, '0ml'); + const testClassRef = new Class4ApplyProperties('colombian', 2, '0ml'); + const testClassAlter = new Class4ApplyProperties('colombian', 2, '0ml'); const paramsWithProps = { 'milk': '20ml', 'sugar': 1 }; - const testClassTarget = new Class4ApplyProperties('columbian', 1, '20ml'); + const testClassTarget = new Class4ApplyProperties('colombian', 1, '20ml'); DataPayloadHandler.applyProperties(testClassAlter, paramsWithProps, false); expect(testClassAlter).toEqual(testClassTarget); diff --git a/packages/wtd-three-ext/package.json b/packages/wtd-three-ext/package.json index b227f43..23929db 100644 --- a/packages/wtd-three-ext/package.json +++ b/packages/wtd-three-ext/package.json @@ -1,6 +1,6 @@ { "name": "wtd-three-ext", - "version": "2.2.0-next.2", + "version": "2.2.0-next.3", "license": "MIT", "type": "module", "main": "./dist/index.js", @@ -51,7 +51,7 @@ "npm": "8.19.3" }, "dependencies": { - "wtd-core": "2.2.0-next.2", + "wtd-core": "2.2.0-next.3", "three": "~0.148.0" }, "devDependencies": { diff --git a/packages/wtd-three-ext/src/MaterialsPayload.ts b/packages/wtd-three-ext/src/MaterialsPayload.ts index 049900a..cf0d20a 100644 --- a/packages/wtd-three-ext/src/MaterialsPayload.ts +++ b/packages/wtd-three-ext/src/MaterialsPayload.ts @@ -61,7 +61,7 @@ export class MaterialsPayload extends DataPayload implements MaterialsPayloadTyp } private cleanMaterial(material: Material): Material { - const objToAlter = material as unknown as AssociatedArrayType; + const objToAlter = material as unknown as AssociatedArrayType; for (const [k, v] of Object.entries(objToAlter)) { if ((v instanceof Texture || v === null) && Object.prototype.hasOwnProperty.call(material, k)) { objToAlter[k] = undefined; diff --git a/packages/wtd-three-ext/src/MeshPayload.ts b/packages/wtd-three-ext/src/MeshPayload.ts index 57d2f87..d8cee48 100644 --- a/packages/wtd-three-ext/src/MeshPayload.ts +++ b/packages/wtd-three-ext/src/MeshPayload.ts @@ -21,7 +21,7 @@ export type AssociatedBufferAttributeArrayType = { [key: string]: BufferAttribut export type MeshPayloadType = DataPayloadType & { geometryType: 0 | 1 | 2; - bufferGeometry: BufferGeometry | AssociatedArrayType | undefined; + bufferGeometry: BufferGeometry | AssociatedArrayType | undefined; meshName: string | undefined; }; @@ -31,7 +31,7 @@ export class MeshPayload extends DataPayload implements MeshPayloadType { type = MeshPayload.TYPE; // 0: mesh, 1: line, 2: point geometryType: 0 | 1 | 2 = 0; - bufferGeometry: BufferGeometry | AssociatedArrayType | undefined; + bufferGeometry: BufferGeometry | AssociatedArrayType | undefined; meshName: string | undefined; /** @@ -80,7 +80,7 @@ export class MeshPayloadHandler implements PayloadHandlerType { unpack(transportObject: MeshPayloadType, cloneBuffers: boolean) { const meshPayload = Object.assign(new MeshPayload(), transportObject); - meshPayload.bufferGeometry = MeshPayloadHandler.reconstructBuffer(cloneBuffers, meshPayload.bufferGeometry as AssociatedArrayType); + meshPayload.bufferGeometry = MeshPayloadHandler.reconstructBuffer(cloneBuffers, meshPayload.bufferGeometry as AssociatedArrayType); return meshPayload; } @@ -113,7 +113,7 @@ export class MeshPayloadHandler implements PayloadHandlerType { } } - static reconstructBuffer(cloneBuffers: boolean, transferredGeometry: BufferGeometry | AssociatedArrayType): BufferGeometry { + static reconstructBuffer(cloneBuffers: boolean, transferredGeometry: BufferGeometry | AssociatedArrayType): BufferGeometry { const bufferGeometry = new BufferGeometry(); // fast-fail: transferredGeometry is either rubbish or already a bufferGeometry @@ -159,7 +159,7 @@ export class MeshPayloadHandler implements PayloadHandlerType { bufferGeometry.type = transferredGeometry.type as string; bufferGeometry.groups = transferredGeometry.groups as Array<{ start: number; count: number; materialIndex?: number | undefined }>; bufferGeometry.drawRange = transferredGeometry.drawRange as { start: number; count: number }; - bufferGeometry.userData = transferredGeometry.userData as AssociatedArrayType; + bufferGeometry.userData = transferredGeometry.userData as AssociatedArrayType; return bufferGeometry; }