diff --git a/package.json b/package.json index 9064e0266c9ed691790caf26555be8037aa1271b..1f9482514e443de397dcaa99fed0a3fc887ea060 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "semver": "^7.3.4", "ts-jest": "^27.0.3", "typescript": "^4.4.3", - "vite": "^2.6.10", + "vite": "^2.6.11", "vue": "^3.2.20", "yorkie": "^2.0.0" }, diff --git a/packages/playground/ssr/package.json b/packages/playground/ssr/package.json index 5295d035f0ba5e7abdf8a8cc2011f01c56d167ad..55199b66370251f460af053f245198b71fc4a012 100644 --- a/packages/playground/ssr/package.json +++ b/packages/playground/ssr/package.json @@ -32,6 +32,6 @@ "compression": "^1.7.4", "cypress": "^7.3.0", "serve-static": "^1.14.1", - "vite": "^2.6.10" + "vite": "^2.6.11" } } diff --git a/packages/playground/ssr/yarn.lock b/packages/playground/ssr/yarn.lock index 58d7615616c3f297094d7dd6929fc87b74cf5791..f8e4caa8545a83dda5253689512bc088e029626d 100644 --- a/packages/playground/ssr/yarn.lock +++ b/packages/playground/ssr/yarn.lock @@ -54,10 +54,10 @@ lodash.once "^4.1.1" "@dcloudio/uni-app@../../uni-app": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-cli-shared@../../uni-cli-shared": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" dependencies: "@babel/parser" "^7.15.0" "@babel/types" "^7.15.0" @@ -78,19 +78,19 @@ xregexp "3.1.0" "@dcloudio/uni-cloud@../../uni-cloud": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-components@../../uni-components": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-h5-vite@../../uni-h5-vite": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-h5-vue@../../uni-h5-vue": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-h5@../../uni-h5": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" dependencies: localstorage-polyfill "^1.0.1" pako "^2.0.3" @@ -98,16 +98,16 @@ xmlhttprequest "^1.8.0" "@dcloudio/uni-i18n@../../uni-i18n": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-shared@../../uni-shared": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/uni-stat@../../uni-stat": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" "@dcloudio/vite-plugin-uni@../../vite-plugin-uni": - version "3.0.0-alpha-3021020211012005" + version "3.0.0-alpha-3021020211025001" dependencies: "@rollup/pluginutils" "^4.1.0" cac "^6.7.3" @@ -169,14 +169,14 @@ integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ== "@types/node@*": - version "16.11.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.1.tgz#2e50a649a50fc403433a14f829eface1a3443e97" - integrity sha512-PYGcJHL9mwl1Ek3PLiYgyEKtwTMmkMw4vbiyz/ps3pfdRYLVv+SN7qHVAImrjdAXxgluDEw6Ph4lyv+m9UpRmA== + version "16.11.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae" + integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w== "@types/node@^14.14.31": - version "14.17.27" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.27.tgz#5054610d37bb5f6e21342d0e6d24c494231f3b85" - integrity sha512-94+Ahf9IcaDuJTle/2b+wzvjmutxXAEXU6O81JHblYXUg2BDG+dnBy7VxIPHKAyEEDHzCMQydTJuWvrE+Aanzw== + version "14.17.32" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.32.tgz#2ca61c9ef8c77f6fa1733be9e623ceb0d372ad96" + integrity sha512-JcII3D5/OapPGx+eJ+Ik1SQGyt6WvuqdRfh9jUwL6/iHGjmyOriBDciBUu7lEIBTL2ijxwrR70WUnw5AEDmFvQ== "@types/sinonjs__fake-timers@^6.0.2": version "6.0.4" @@ -526,7 +526,7 @@ chokidar@^3.5.2: optionalDependencies: fsevents "~2.3.2" -ci-info@^3.1.1: +ci-info@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== @@ -573,11 +573,16 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -colorette@^1.1.0, colorette@^1.4.0: +colorette@^1.1.0: version "1.4.0" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40" integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g== +colorette@^2.0.16: + version "2.0.16" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.16.tgz#713b9af84fdb000139f04546bd4a93f62a5085da" + integrity sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g== + colors@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" @@ -820,113 +825,113 @@ es-module-lexer@^0.9.3: resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== -esbuild-android-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.8.tgz#c20e875c3c98164b1ffba9b28637bdf96f5e9e7c" - integrity sha512-AilbChndywpk7CdKkNSZ9klxl+9MboLctXd9LwLo3b0dawmOF/i/t2U5d8LM6SbT1Xw36F8yngSUPrd8yPs2RA== - -esbuild-darwin-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.8.tgz#f46e6b471ddbf62265234808a6a1aa91df18a417" - integrity sha512-b6sdiT84zV5LVaoF+UoMVGJzR/iE2vNUfUDfFQGrm4LBwM/PWXweKpuu6RD9mcyCq18cLxkP6w/LD/w9DtX3ng== - -esbuild-darwin-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.8.tgz#a991157a6013facd4f2e14159b7da52626c90154" - integrity sha512-R8YuPiiJayuJJRUBG4H0VwkEKo6AvhJs2m7Tl0JaIer3u1FHHXwGhMxjJDmK+kXwTFPriSysPvcobXC/UrrZCQ== - -esbuild-freebsd-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.8.tgz#301601d2e443ad458960e359b402a17d9500be9d" - integrity sha512-zBn6urrn8FnKC+YSgDxdof9jhPCeU8kR/qaamlV4gI8R3KUaUK162WYM7UyFVAlj9N0MyD3AtB+hltzu4cysTw== - -esbuild-freebsd-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.8.tgz#039a63acc12ec0892006c147ea221e55f9125a9f" - integrity sha512-pWW2slN7lGlkx0MOEBoUGwRX5UgSCLq3dy2c8RIOpiHtA87xAUpDBvZK10MykbT+aMfXc0NI2lu1X+6kI34xng== - -esbuild-linux-32@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.8.tgz#c537b67d7e694b60bfa2786581412838c6ba0284" - integrity sha512-T0I0ueeKVO/Is0CAeSEOG9s2jeNNb8jrrMwG9QBIm3UU18MRB60ERgkS2uV3fZ1vP2F8i3Z2e3Zju4lg9dhVmw== - -esbuild-linux-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.8.tgz#0092fc8a064001a777bfa0e3b425bb8be8f96e6a" - integrity sha512-Bm8SYmFtvfDCIu9sjKppFXzRXn2BVpuCinU1ChTuMtdKI/7aPpXIrkqBNOgPTOQO9AylJJc1Zw6EvtKORhn64w== - -esbuild-linux-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.8.tgz#5cd3f2bb924212971482e8dbc25c4afd09b28110" - integrity sha512-X4pWZ+SL+FJ09chWFgRNO3F+YtvAQRcWh0uxKqZSWKiWodAB20flsW/OWFYLXBKiVCTeoGMvENZS/GeVac7+tQ== - -esbuild-linux-arm@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.8.tgz#ad634f96bf2975536907aeb9fdb75a3194f4ddce" - integrity sha512-4/HfcC40LJ4GPyboHA+db0jpFarTB628D1ifU+/5bunIgY+t6mHkJWyxWxAAE8wl/ZIuRYB9RJFdYpu1AXGPdg== - -esbuild-linux-mips64le@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.8.tgz#57857edfebf9bf65766dc8be1637f2179c990572" - integrity sha512-o7e0D+sqHKT31v+mwFircJFjwSKVd2nbkHEn4l9xQ1hLR+Bv8rnt3HqlblY3+sBdlrOTGSwz0ReROlKUMJyldA== - -esbuild-linux-ppc64le@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.8.tgz#fdb82a059a5b86bb10fb42091b4ebcf488b9cd46" - integrity sha512-eZSQ0ERsWkukJp2px/UWJHVNuy0lMoz/HZcRWAbB6reoaBw7S9vMzYNUnflfL3XA6WDs+dZn3ekHE4Y2uWLGig== - -esbuild-netbsd-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.8.tgz#d7879e7123d3b2c04754ece8bd061aa6866deeff" - integrity sha512-gZX4kP7gVvOrvX0ZwgHmbuHczQUwqYppxqtoyC7VNd80t5nBHOFXVhWo2Ad/Lms0E8b+wwgI/WjZFTCpUHOg9Q== - -esbuild-openbsd-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.8.tgz#88b280b6cb0a3f6adb60abf27fc506c506a35cf0" - integrity sha512-afzza308X4WmcebexbTzAgfEWt9MUkdTvwIa8xOu4CM2qGbl2LanqEl8/LUs8jh6Gqw6WsicEK52GPrS9wvkcw== - -esbuild-sunos-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.8.tgz#229ae7c7703196a58acd0f0291ad9bebda815d63" - integrity sha512-mWPZibmBbuMKD+LDN23LGcOZ2EawMYBONMXXHmbuxeT0XxCNwadbCVwUQ/2p5Dp5Kvf6mhrlIffcnWOiCBpiVw== - -esbuild-windows-32@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.8.tgz#892d093e32a21c0c9135e5a0ffdc380aeb70e763" - integrity sha512-QsZ1HnWIcnIEApETZWw8HlOhDSWqdZX2SylU7IzGxOYyVcX7QI06ety/aDcn437mwyO7Ph4RrbhB+2ntM8kX8A== - -esbuild-windows-64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.8.tgz#7defd8d79ae3bb7e6f53b65a7190be7daf901686" - integrity sha512-76Fb57B9eE/JmJi1QmUW0tRLQZfGo0it+JeYoCDTSlbTn7LV44ecOHIMJSSgZADUtRMWT9z0Kz186bnaB3amSg== - -esbuild-windows-arm64@0.13.8: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.8.tgz#e59ae004496fd8a5ab67bfc7945a2e47480d6fb9" - integrity sha512-HW6Mtq5eTudllxY2YgT62MrVcn7oq2o8TAoAvDUhyiEmRmDY8tPwAhb1vxw5/cdkbukM3KdMYtksnUhF/ekWeg== +esbuild-android-arm64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.13.9.tgz#6cc4a0c623332c0830a311ddd8242b1f496ff940" + integrity sha512-Ty0hKldtjJVLHwUwbKR4GFPiXBo5iQ3aE1OLBar9lh3myaRkUGEb+Ypl74LEKa0+t/9lS3Ev1N5+5P2Sq6UvNQ== + +esbuild-darwin-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.13.9.tgz#df44297c2438032cda2b21548a82bb007e2105cc" + integrity sha512-Ay0/b98v0oYp3ApXNQ7QPbaSkCT9WjBU6h8bMB1SYrQ/PmHgwph91fb9V0pfOLKK1rYWypfrNbI0MyT2tWN+rQ== + +esbuild-darwin-arm64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.13.9.tgz#704ef404a6a38eda190d40ed354e7f2c1c839081" + integrity sha512-nJB8chaJdWathCe6EyIiMIqfyEzbuXPyNsPlL3bYRB1zFCF8feXT874D4IHbJ/w8B6BpY3sM1Clr/I/DK8E4ow== + +esbuild-freebsd-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.13.9.tgz#fbbf22c99e15f27d0f8a1a040d7961a86f0d3a4e" + integrity sha512-ktaBujf12XLkVXLGx7WjFcmh1tt34tm7gP4pHkhvbzbHrq+BbXwcl4EsW+5JT9VNKl7slOGf4Qnua/VW7ZcnIw== + +esbuild-freebsd-arm64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.13.9.tgz#809fff4c43653dbbf071ffce9f80a030b278098e" + integrity sha512-vVa5zps4dmwpXwv/amxVpIWvFJuUPWQkpV+PYtZUW9lqjXsQ3LBHP51Q1cXZZBIrqwszLsEyJPa5GuDOY15hzQ== + +esbuild-linux-32@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.13.9.tgz#f9fd3423481e51674e9817d5eea25689889a5f5a" + integrity sha512-HxoW9QNqhO8VW1l7aBiYQH4lobeHq85+blZ4nlZ7sg5CNhGRRwnMlV6S08VYKz6V0YKnHb5OqJxx2HZuTZ7tgQ== + +esbuild-linux-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.13.9.tgz#9d7f66866dae1abaff7cbc3749f2847d5fb72fd5" + integrity sha512-L+eAR8o1lAUr9g64RXnBLuWZjAItAOWSUpvkchpa6QvSnXFA/nG6PgGsOBEqhDXl9qYEpGI0ReDrFkf8ByapvQ== + +esbuild-linux-arm64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.13.9.tgz#669202e71b9ced4d285bfd1d69de948e013ac28f" + integrity sha512-IjbhZpW5VQYK4nVI4dj/mLvH5oXAIf57OI8BYVkCqrdVXJwR8nVrSqux3zJSY+ElrkOK3DtG9iTPpmqvBXaU0g== + +esbuild-linux-arm@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.13.9.tgz#c3ceb56ec0e3dbd1a3a89dca6cb7fc0ca360bcc8" + integrity sha512-DT0S+ufCVXatPZHjkCaBgZSFIV8FzY4GEHz/BlkitTWzUvT1dIUXjPIRPnqBUVa+0AyS1bZSfHzv9hTT4LHz7A== + +esbuild-linux-mips64le@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.13.9.tgz#bf4bd389ee14b67c5c77669952f2de6b2cc8a003" + integrity sha512-ec9RgAM4r+fe1ZmG16qeMwEHdcIvqeW8tpnpkfSQu9T4487KtQF6lg3TQasTarrLLEe7Qpy+E+r4VwC8eeZySQ== + +esbuild-linux-ppc64le@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.13.9.tgz#465b7bdc70577da606b3b5d463028292b6d834ad" + integrity sha512-7b2/wg8T1n/L1BgCWlMSez0aXfGkNjFuOqMBQdnTti3LRuUwzGJcrhRf/FdZGJ5/evML9mqu60vLRuXW1TdXCg== + +esbuild-netbsd-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.13.9.tgz#94f2dabe83520066cc1e1fae3ecff78695a8ebb1" + integrity sha512-PiZu3h4+Szj0iZPgvuD2Y0isOXnlNetmF6jMcOwW54BScwynW24/baE+z7PfDyNFgjV04Ga2THdcpbKBDhgWQw== + +esbuild-openbsd-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.13.9.tgz#b47f6a641ca37358aeedb2b7c4bb73dd0682c6d5" + integrity sha512-SJKN4Ez+ilY7mu+1gAdGQ9N6dktBfbEkiOAvw+hT7xHrNnTnrTGH0FT4qx9dazB9HX6D04L4PXmVOyynqi+oEQ== + +esbuild-sunos-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.13.9.tgz#b0df4a316b7c98eb490f4bd0db381cf2c391ae73" + integrity sha512-9N0RjZ7cElE8ifrS0nBrLQgBMQNPiIIKO2GzLXy7Ms8AM3KjfLiV2G2+9O0B9paXjRAHchIwazTeOyeWb1vyWA== + +esbuild-windows-32@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.13.9.tgz#e229563e134e634f9748cc8315c691e2013259ef" + integrity sha512-awxWs1kns+RfjhqBbTbdlePjqZrAE2XMaAQJNg9dtu+C7ghC3QKsqXbu0C26OuF5YeAdJcq9q+IdG6WPLjvj9w== + +esbuild-windows-64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.13.9.tgz#103ad3f13e1a0e44934b91f358e81dd201b86b34" + integrity sha512-VmA9GQMCzOr8rFfD72Dum1+AWhJui7ZO6sYwp6rBHYu4vLmWITTSUsd/zgXXmZuHBPkkvxLJLF8XsKFCRKflJA== + +esbuild-windows-arm64@0.13.9: + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.9.tgz#545bb58848008258b339b1b00fcfe92c85bc7251" + integrity sha512-P/jPY2JwmTpgEPh9BkXpCe690tcDSSo0K9BHTniSeEAEz26kPpqldVa4XDm0R+hNnFA7ecEgNskr4QAxE1ry0w== esbuild@^0.13.2: - version "0.13.8" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.13.8.tgz#bd7cc51b881ab067789f88e17baca74724c1ec4f" - integrity sha512-A4af7G7YZLfG5OnARJRMtlpEsCkq/zHZQXewgPA864l9D6VjjbH1SuFYK/OSV6BtHwDGkdwyRrX0qQFLnMfUcw== + version "0.13.9" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.13.9.tgz#aafc4b3375ac443ae7b223c26c4e58d10d2d535b" + integrity sha512-8bYcckmisXjGvBMeylp1PRtu21uOoCDFAgXGGF2BR241zYQDN6ZLNvcmQlnQ7olG0p6PRWmJI8WVH3ca8viPuw== optionalDependencies: - esbuild-android-arm64 "0.13.8" - esbuild-darwin-64 "0.13.8" - esbuild-darwin-arm64 "0.13.8" - esbuild-freebsd-64 "0.13.8" - esbuild-freebsd-arm64 "0.13.8" - esbuild-linux-32 "0.13.8" - esbuild-linux-64 "0.13.8" - esbuild-linux-arm "0.13.8" - esbuild-linux-arm64 "0.13.8" - esbuild-linux-mips64le "0.13.8" - esbuild-linux-ppc64le "0.13.8" - esbuild-netbsd-64 "0.13.8" - esbuild-openbsd-64 "0.13.8" - esbuild-sunos-64 "0.13.8" - esbuild-windows-32 "0.13.8" - esbuild-windows-64 "0.13.8" - esbuild-windows-arm64 "0.13.8" + esbuild-android-arm64 "0.13.9" + esbuild-darwin-64 "0.13.9" + esbuild-darwin-arm64 "0.13.9" + esbuild-freebsd-64 "0.13.9" + esbuild-freebsd-arm64 "0.13.9" + esbuild-linux-32 "0.13.9" + esbuild-linux-64 "0.13.9" + esbuild-linux-arm "0.13.9" + esbuild-linux-arm64 "0.13.9" + esbuild-linux-mips64le "0.13.9" + esbuild-linux-ppc64le "0.13.9" + esbuild-netbsd-64 "0.13.9" + esbuild-openbsd-64 "0.13.9" + esbuild-sunos-64 "0.13.9" + esbuild-windows-32 "0.13.9" + esbuild-windows-64 "0.13.9" + esbuild-windows-arm64 "0.13.9" escape-html@~1.0.3: version "1.0.3" @@ -1351,11 +1356,11 @@ is-binary-path@~2.1.0: binary-extensions "^2.0.0" is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== + version "3.0.1" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.1.tgz#db6ecbed1bd659c43dac0f45661e7674103d1867" + integrity sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ== dependencies: - ci-info "^3.1.1" + ci-info "^3.2.0" is-core-module@^2.2.0: version "2.8.0" @@ -1486,12 +1491,12 @@ lazy-ass@^1.6.0: integrity sha1-eZllXoZGwX8In90YfRUNMyTVRRM= listr2@^3.8.3: - version "3.12.2" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.12.2.tgz#2d55cc627111603ad4768a9e87c9c7bb9b49997e" - integrity sha512-64xC2CJ/As/xgVI3wbhlPWVPx0wfTqbUAkpb7bjDi0thSWMqrf07UFhrfsGoo8YSXmF049Rp9C0cjLC8rZxK9A== + version "3.13.1" + resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.1.tgz#816e8c1728d50f223795f530d72d248c7fa14602" + integrity sha512-pk4YBDA2cxtpM8iLHbz6oEsfZieJKHf6Pt19NlKaHZZVpqHyVs/Wqr7RfBBCeAFCJchGO7WQHVkUPZTvJMHk8w== dependencies: cli-truncate "^2.1.0" - colorette "^1.4.0" + colorette "^2.0.16" log-update "^4.0.0" p-map "^4.0.0" rxjs "^6.6.7" @@ -1640,7 +1645,7 @@ ms@^2.1.1: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -nanoid@^3.1.28: +nanoid@^3.1.30: version "3.1.30" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.30.tgz#63f93cc548d2a113dc5dfbc63bfa09e2b9b64362" integrity sha512-zJpuPDwOv8D2zq2WRoMe1HsfZthVewpel9CAvTfc/2mBD1uUT/agc5f7GHGWXlYkFvi1mVxe4IjvP2HNrop7nQ== @@ -1750,10 +1755,10 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -picocolors@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-0.2.1.tgz#570670f793646851d1ba135996962abad587859f" - integrity sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA== +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3: version "2.3.0" @@ -1774,12 +1779,12 @@ postcss-selector-parser@^6.0.6: util-deprecate "^1.0.2" postcss@^8.1.10, postcss@^8.3.8: - version "8.3.9" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.9.tgz#98754caa06c4ee9eb59cc48bd073bb6bd3437c31" - integrity sha512-f/ZFyAKh9Dnqytx5X62jgjhhzttjZS7hMsohcI7HEI5tjELX/HxCy3EFhsRxyzGvrzFF+82XPvCS8T9TFleVJw== + version "8.3.11" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.3.11.tgz#c3beca7ea811cd5e1c4a3ec6d2e7599ef1f8f858" + integrity sha512-hCmlUAIlUiav8Xdqw3Io4LcpA1DOt7h3LSTAC4G6JGHFFaWzI6qvFt9oilvl8BmkbBRX1IhM90ZAmpk68zccQA== dependencies: - nanoid "^3.1.28" - picocolors "^0.2.1" + nanoid "^3.1.30" + picocolors "^1.0.0" source-map-js "^0.6.2" pretty-bytes@^5.6.0: @@ -1912,9 +1917,9 @@ rollup-plugin-copy@^3.4.0: is-plain-object "^3.0.0" rollup@^2.57.0: - version "2.58.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.0.tgz#a643983365e7bf7f5b7c62a8331b983b7c4c67fb" - integrity sha512-NOXpusKnaRpbS7ZVSzcEXqxcLDOagN6iFS8p45RkoiMqPHDLwJm758UF05KlMoCRbLBTZsPOIa887gZJ1AiXvw== + version "2.58.3" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.58.3.tgz#71a08138d9515fb65043b6a18618b2ed9ac8d239" + integrity sha512-ei27MSw1KhRur4p87Q0/Va2NAYqMXOX++FNEumMBcdreIRLURKy+cE2wcDJKBn0nfmhP2ZGrJkP1XPO+G8FJQw== optionalDependencies: fsevents "~2.3.2" @@ -2237,10 +2242,10 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" -vite@^2.6.10: - version "2.6.10" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.10.tgz#7a4f420c6e2c7d9062c7f9ce4578a817c72b3842" - integrity sha512-XbevwpDJMs3lKiGEj0UQScsOCpwHIjFgfzPnFVkPgnxsF9oPv1uGyckLg58XkXv6LnO46KN9yZqJzINFmAxtUg== +vite@^2.6.11: + version "2.6.11" + resolved "https://registry.yarnpkg.com/vite/-/vite-2.6.11.tgz#20d3d8f4b4fe38904a2e425356aab1cb23325e12" + integrity sha512-JWnGmiO1IFwou9aUWS4N0kMyHcgTTt1+2f4bJyzgBJLJDyAqGEX3HewE4jgrL6V4d9+mxs+lZ4L8HL2kyVBe7A== dependencies: esbuild "^0.13.2" postcss "^8.3.8" diff --git a/packages/uni-cli-shared/src/json/mp/pages.ts b/packages/uni-cli-shared/src/json/mp/pages.ts index a0dc7a02ba25d2c23021bf6ae66bb42b074b0631..cc96b36eb3bad697f17584121d9479b3b857b916 100644 --- a/packages/uni-cli-shared/src/json/mp/pages.ts +++ b/packages/uni-cli-shared/src/json/mp/pages.ts @@ -57,7 +57,11 @@ function parsePagesJson( ) { nvuePages.push(pagePath) } - pageJsons[pagePath] = parseWindowOptions(style, platform, windowOptionsMap) + pageJsons[pagePath] = parseWindowOptions( + style, + platform, + windowOptionsMap + ) as PageWindowOptions } // pages validatePages(pagesJson, jsonStr) diff --git a/packages/uni-cli-shared/src/json/mp/types.ts b/packages/uni-cli-shared/src/json/mp/types.ts index 624a52336c6c61b9dee3cc691509e864f7aa2520..08fbd8e65364063bbd54867ed9a7a6e4d3932f80 100644 --- a/packages/uni-cli-shared/src/json/mp/types.ts +++ b/packages/uni-cli-shared/src/json/mp/types.ts @@ -21,6 +21,7 @@ type Style = 'v2' | string type RestartStrategy = 'homePage' | 'homePageAndLatestPage' | string export interface PageWindowOptions extends ShareWindowOptions { + component: true // 百度小程序页面必须配置component: true disableScroll?: boolean // false usingComponents?: UsingComponents initialRenderingCache?: 'static' | string diff --git a/packages/uni-cli-shared/src/json/mp/utils.ts b/packages/uni-cli-shared/src/json/mp/utils.ts index b13047852b09bfcab8e2289a3fb21f17c3b8bee4..d8772559f3d1deed693de4ec74f18cc22bd1c3a3 100644 --- a/packages/uni-cli-shared/src/json/mp/utils.ts +++ b/packages/uni-cli-shared/src/json/mp/utils.ts @@ -32,11 +32,15 @@ export function parseWindowOptions( windowOptionsMap?: Record ): PageWindowOptions | AppWindowOptions { if (!style) { - return {} + return { + component: true, + } } const platformStyle = style[platform] || {} removePlatformStyle(trimJson(style) as any) - const res: PageWindowOptions | AppWindowOptions = {} + const res: PageWindowOptions | AppWindowOptions = { + component: true, + } if (windowOptionsMap) { return extend(convert(res, style, windowOptionsMap), platformStyle) } diff --git a/packages/uni-h5/dist/uni-h5.es.js b/packages/uni-h5/dist/uni-h5.es.js index 1f72f2adbf1d167c3d9c7cd226a60afbbb75d141..4985fa96b0572130431c7ec34fe4fa6794ec8570 100644 --- a/packages/uni-h5/dist/uni-h5.es.js +++ b/packages/uni-h5/dist/uni-h5.es.js @@ -187,6 +187,31 @@ const initI18nShowModalMsgsOnce = /* @__PURE__ */ once(() => { useI18n().add(LOCALE_ZH_HANT, normalizeMessages(name, keys, ["\u53D6\u6D88", "\u78BA\u5B9A"]), false); } }); +const initI18nChooseFileMsgsOnce = /* @__PURE__ */ once(() => { + const name = "uni.chooseFile."; + const keys = ["notUserActivation"]; + if (__UNI_FEATURE_I18N_EN__) { + useI18n().add(LOCALE_EN, normalizeMessages(name, keys, [ + "File chooser dialog can only be shown with a user activation" + ]), false); + } + if (__UNI_FEATURE_I18N_ES__) { + useI18n().add(LOCALE_ES, normalizeMessages(name, keys, [ + "El cuadro de di\xE1logo del selector de archivos solo se puede mostrar con la activaci\xF3n del usuario" + ]), false); + } + if (__UNI_FEATURE_I18N_FR__) { + useI18n().add(LOCALE_FR, normalizeMessages(name, keys, [ + "La bo\xEEte de dialogue du s\xE9lecteur de fichier ne peut \xEAtre affich\xE9e qu'avec une activation par l'utilisateur" + ]), false); + } + if (__UNI_FEATURE_I18N_ZH_HANS__) { + useI18n().add(LOCALE_ZH_HANS, normalizeMessages(name, keys, ["\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u53EA\u80FD\u5728\u7528\u6237\u6FC0\u6D3B\u65F6\u663E\u793A"]), false); + } + if (__UNI_FEATURE_I18N_ZH_HANT__) { + useI18n().add(LOCALE_ZH_HANT, normalizeMessages(name, keys, ["\u6587\u4EF6\u9078\u64C7\u5668\u5C0D\u8A71\u6846\u53EA\u80FD\u5728\u7528\u6236\u6FC0\u6D3B\u6642\u986F\u793A"]), false); + } +}); const initI18nSetClipboardDataMsgsOnce = /* @__PURE__ */ once(() => { const name = "uni.setClipboardData."; const keys = ["success", "fail"]; @@ -8032,7 +8057,8 @@ const passiveOptions$1 = passive(true); const states = []; let userInteract = 0; let inited; -function addInteractListener(vm) { +const setUserAction = (userAction) => states.forEach((vm) => vm.userAction = userAction); +function addInteractListener(vm = { userAction: false }) { if (!inited) { const eventNames = [ "touchstart", @@ -8043,16 +8069,11 @@ function addInteractListener(vm) { ]; eventNames.forEach((eventName) => { document.addEventListener(eventName, function() { - states.forEach((vm2) => { - vm2.userAction = true; - userInteract++; - setTimeout(() => { - userInteract--; - if (!userInteract) { - vm2.userAction = false; - } - }, 0); - }); + !userInteract && setUserAction(true); + userInteract++; + setTimeout(() => { + !--userInteract && setUserAction(false); + }, 0); }, passiveOptions$1); }); inited = true; @@ -8065,6 +8086,7 @@ function removeInteractListener(vm) { states.splice(index2, 1); } } +const getInteractStatus = () => !!userInteract; function useUserAction() { const state2 = reactive({ userAction: false @@ -16518,6 +16540,7 @@ const MIMEType = { } }; const ALL = "all"; +addInteractListener(); function isWXEnv() { const ua2 = window.navigator.userAgent.toLowerCase(); const matchUA = ua2.match(/MicroMessenger/i); @@ -16566,6 +16589,8 @@ const chooseFile = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_FILE, ({ type, extension }, { resolve, reject }) => { + initI18nChooseFileMsgsOnce(); + const { t: t2 } = useI18n(); if (fileInput) { document.body.removeChild(fileInput); fileInput = null; @@ -16603,7 +16628,11 @@ const chooseFile = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_FILE, ({ }; resolve(res); }); - fileInput.click(); + if (getInteractStatus()) { + fileInput.click(); + } else { + reject(t2("uni.chooseFile.notUserActivation")); + } }, ChooseFileProtocol, ChooseFileOptions); let imageInput = null; const chooseImage = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_IMAGE, ({ @@ -16611,6 +16640,8 @@ const chooseImage = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_IMAGE, ({ sourceType, extension }, { resolve, reject }) => { + initI18nChooseFileMsgsOnce(); + const { t: t2 } = useI18n(); if (imageInput) { document.body.removeChild(imageInput); imageInput = null; @@ -16648,7 +16679,11 @@ const chooseImage = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_IMAGE, ({ }; resolve(res); }); - imageInput.click(); + if (getInteractStatus()) { + imageInput.click(); + } else { + reject(t2("uni.chooseFile.notUserActivation")); + } }, ChooseImageProtocol, ChooseImageOptions); let index$c = 0; let overflow = ""; @@ -16881,6 +16916,8 @@ const previewImage = /* @__PURE__ */ defineAsyncApi(API_PREVIEW_IMAGE, (args, { }, PreviewImageProtocol, PreviewImageOptions); let videoInput = null; const chooseVideo = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_VIDEO, ({ sourceType, extension }, { resolve, reject }) => { + initI18nChooseFileMsgsOnce(); + const { t: t2 } = useI18n(); if (videoInput) { document.body.removeChild(videoInput); videoInput = null; @@ -16931,7 +16968,11 @@ const chooseVideo = /* @__PURE__ */ defineAsyncApi(API_CHOOSE_VIDEO, ({ sourceTy resolve(callbackResult); } }); - videoInput.click(); + if (getInteractStatus()) { + videoInput.click(); + } else { + reject(t2("uni.chooseFile.notUserActivation")); + } }, ChooseVideoProtocol, ChooseVideoOptions); const request = /* @__PURE__ */ defineTaskApi(API_REQUEST, ({ url, diff --git a/packages/uni-mp-baidu/__tests__/testUtils.ts b/packages/uni-mp-baidu/__tests__/testUtils.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8e9f1dd98fa6f9d8d7cd9735b91aafcdb00fbe9 --- /dev/null +++ b/packages/uni-mp-baidu/__tests__/testUtils.ts @@ -0,0 +1,40 @@ +import { isCustomElement, isNativeTag } from '@dcloudio/uni-shared' +import { compile, CompilerOptions } from '@dcloudio/uni-mp-compiler' +import { transformFor } from '../src/plugin/transforms/vFor' + +export function assert( + template: string, + templateCode: string, + renderCode: string, + options: CompilerOptions = {} +) { + const res = compile(template, { + mode: 'module', + filename: 'foo.vue', + prefixIdentifiers: true, + inline: true, + isNativeTag, + isCustomElement, + generatorOpts: { + concise: true, + }, + nodeTransforms: [transformFor], + miniProgram: { + slot: { + fallback: false, + }, + directive: 's-', + emitFile({ source }) { + // console.log(source) + if (!options.onError) { + expect(source).toBe(templateCode) + } + return '' + }, + }, + ...options, + }) + if (!options.onError) { + expect(res.code).toBe(renderCode) + } +} diff --git a/packages/uni-mp-baidu/__tests__/vFor.spec.ts b/packages/uni-mp-baidu/__tests__/vFor.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..af48124a607a571dff67cfc34424146410ecb5f0 --- /dev/null +++ b/packages/uni-mp-baidu/__tests__/vFor.spec.ts @@ -0,0 +1,22 @@ +import { assert } from './testUtils' + +describe(`mp-baidu: transform v-for`, () => { + test(`with key`, () => { + assert( + ``, + ``, + `(_ctx, _cache) => { + return { a: _f(_ctx.items, (item, k0, i0) => { return {}; }) } +}` + ) + }) + test(`without key`, () => { + assert( + ``, + ``, + `(_ctx, _cache) => { + return { a: _f(_ctx.items, (item, k0, i0) => { return {}; }) } +}` + ) + }) +}) diff --git a/packages/uni-mp-baidu/__tests__/vIf.spec.ts b/packages/uni-mp-baidu/__tests__/vIf.spec.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb2c22636e94201a3cb75731d06e1f60e8321fd9 --- /dev/null +++ b/packages/uni-mp-baidu/__tests__/vIf.spec.ts @@ -0,0 +1,13 @@ +import { assert } from './testUtils' + +describe(`mp-baidu: transform v-if`, () => { + test(`basic`, () => { + assert( + ``, + ``, + `(_ctx, _cache) => { + return _e({ a: _ctx.ok }, _ctx.ok ? {} : _ctx.ok1 ? {} : {}, { b: _ctx.ok1 }) +}` + ) + }) +}) diff --git a/packages/uni-mp-baidu/build.json b/packages/uni-mp-baidu/build.json index 0dc8d8e5587a7350061863fcd302a52c04f1e8a0..60515614a126b13d49a93a977f8801f6990292b9 100644 --- a/packages/uni-mp-baidu/build.json +++ b/packages/uni-mp-baidu/build.json @@ -1,24 +1,40 @@ -{ - "input": { - "src/runtime/index.ts": "dist/uni.mp.esm.js", - "src/api/index.ts": "dist/uni.api.esm.js" - }, - "alias": { - "entries": [ - { - "find": "@dcloudio/uni-platform", - "replacement": "packages/uni-mp-baidu/src/platform/index.ts" - }, - { - "find": "@dcloudio/uni-mp-platform", - "replacement": "packages/uni-mp-core/src/platform/index.ts" - } +[ + { + "input": { + "src/plugin/index.ts": "dist/uni.compiler.js" + }, + "output": { + "format": "cjs" + }, + "external": [ + "@dcloudio/uni-cli-shared", + "@dcloudio/uni-mp-compiler", + "@dcloudio/uni-mp-vite", + "@vue/compiler-core" ] }, - "replacements": { - "__GLOBAL__": "swan", - "__PLATFORM__": "\"mp-baidu\"", - "__PLATFORM_TITLE__": "百度小程序" - }, - "external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"] -} + { + "input": { + "src/runtime/index.ts": "dist/uni.mp.esm.js", + "src/api/index.ts": "dist/uni.api.esm.js" + }, + "alias": { + "entries": [ + { + "find": "@dcloudio/uni-platform", + "replacement": "packages/uni-mp-baidu/src/platform/index.ts" + }, + { + "find": "@dcloudio/uni-mp-platform", + "replacement": "packages/uni-mp-core/src/platform/index.ts" + } + ] + }, + "replacements": { + "__GLOBAL__": "swan", + "__PLATFORM__": "\"mp-baidu\"", + "__PLATFORM_TITLE__": "百度小程序" + }, + "external": ["@dcloudio/uni-i18n", "@vue/shared", "vue"] + } +] diff --git a/packages/uni-mp-baidu/dist/uni.compiler.js b/packages/uni-mp-baidu/dist/uni.compiler.js new file mode 100644 index 0000000000000000000000000000000000000000..deaf2feccc9f7cc637e22ba69079a86a1885436e --- /dev/null +++ b/packages/uni-mp-baidu/dist/uni.compiler.js @@ -0,0 +1,114 @@ +'use strict'; + +var uniCliShared = require('@dcloudio/uni-cli-shared'); +var initMiniProgramPlugin = require('@dcloudio/uni-mp-vite'); +var uniMpCompiler = require('@dcloudio/uni-mp-compiler'); + +function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } + +var initMiniProgramPlugin__default = /*#__PURE__*/_interopDefaultLegacy(initMiniProgramPlugin); + +var appid = ""; +var host = "baiduboxapp"; +var projectname = ""; +var setting = { + autoAudits: false, + urlCheck: false +}; +var source = { + appid: appid, + "compilation-args": { + common: { + babelSetting: { + ignore: [ + ] + }, + enhance: true, + ignorePrefixCss: false + }, + selected: -3 +}, + host: host, + projectname: projectname, + setting: setting +}; + +const transformFor = (node) => { + if (!uniMpCompiler.isForElementNode(node)) { + return; + } + const keyProp = uniMpCompiler.findProp(node, 'key', true); + if (keyProp) { + const { exp } = keyProp; + if (exp) { + const key = uniMpCompiler.genExpr(exp); + node.vFor.sourceCode = `${node.vFor.sourceAlias} trackBy ${key}`; + node.props.splice(node.props.indexOf(keyProp), 1); + } + } +}; + +const uniMiniProgramBaiduPlugin = { + name: 'vite:uni-mp-baidu', + config() { + return { + define: { + __VUE_CREATED_DEFERRED__: false, + }, + }; + }, +}; +const projectConfigFilename = 'project.swan.json'; +const options = { + vite: { + inject: { + uni: [ + uniCliShared.resolveBuiltIn('@dcloudio/uni-mp-baidu/dist/uni.api.esm.js'), + 'default', + ], + }, + alias: { + 'uni-mp-runtime': uniCliShared.resolveBuiltIn('@dcloudio/uni-mp-baidu/dist/uni.mp.esm.js'), + }, + copyOptions: { + assets: ['swancomponents'], + }, + }, + global: 'swan', + app: { + darkmode: false, + subpackages: true, + }, + project: { + filename: projectConfigFilename, + source, + }, + template: { + filter: { + extname: '.swan', + lang: 'sjs', + generate(filter, filename) { + if (filename) { + return ``; + } + return ` +${filter.code} +`; + }, + }, + slot: { + fallback: false, + }, + extname: '.swan', + directive: 's-', + compilerOptions: { + nodeTransforms: [transformFor], + }, + }, + style: { + extname: '.css', + }, +}; +var index = [uniMiniProgramBaiduPlugin, ...initMiniProgramPlugin__default["default"](options)]; + +module.exports = index; diff --git a/packages/uni-mp-baidu/dist/uni.mp.esm.js b/packages/uni-mp-baidu/dist/uni.mp.esm.js index c55fa4eaf30003d9a88f4267ae1f9cf423638665..b1d1fe69b99f8989f1804279308df086b1e7e950 100644 --- a/packages/uni-mp-baidu/dist/uni.mp.esm.js +++ b/packages/uni-mp-baidu/dist/uni.mp.esm.js @@ -835,7 +835,7 @@ function parse$1(componentOptions) { fixSetDataStart(this); oldAttached.call(this); this.pageinstance.$vm = this.$vm; - this.$vm.__call_hook('onInit', query); + this.$vm.$callHook('onInit', query); }; lifetimes.attached = function attached() { if (!this.$vm) { diff --git a/packages/uni-mp-baidu/package.json b/packages/uni-mp-baidu/package.json index 275d94e01cd14099157f56bd0be7fb7661230834..f03e1c0791d0dd3585e1118bf5a7766cab7cde30 100644 --- a/packages/uni-mp-baidu/package.json +++ b/packages/uni-mp-baidu/package.json @@ -18,7 +18,9 @@ "license": "Apache-2.0", "uni-app": { "name": "mp-baidu", - "title": "百度小程序" + "title": "百度小程序", + "apply": "mp-baidu", + "main": "dist/uni.compiler.js" }, "gitHead": "1efa8efd0a9eddeabdba75c020d015ebf31b8177" } diff --git a/packages/uni-mp-baidu/src/plugin/index.ts b/packages/uni-mp-baidu/src/plugin/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..c8c363cb11bf289fcc48ebf410fb361ad8ebb225 --- /dev/null +++ b/packages/uni-mp-baidu/src/plugin/index.ts @@ -0,0 +1,76 @@ +import type { Plugin } from 'vite' +import { resolveBuiltIn } from '@dcloudio/uni-cli-shared' +import initMiniProgramPlugin, { + UniMiniProgramPluginOptions, +} from '@dcloudio/uni-mp-vite' + +import source from './project.swan.json' +import { transformFor } from './transforms/vFor' + +const uniMiniProgramBaiduPlugin: Plugin = { + name: 'vite:uni-mp-baidu', + config() { + return { + define: { + __VUE_CREATED_DEFERRED__: false, + }, + } + }, +} + +const projectConfigFilename = 'project.swan.json' + +const options: UniMiniProgramPluginOptions = { + vite: { + inject: { + uni: [ + resolveBuiltIn('@dcloudio/uni-mp-baidu/dist/uni.api.esm.js'), + 'default', + ], + }, + alias: { + 'uni-mp-runtime': resolveBuiltIn( + '@dcloudio/uni-mp-baidu/dist/uni.mp.esm.js' + ), + }, + copyOptions: { + assets: ['swancomponents'], + }, + }, + global: 'swan', + app: { + darkmode: false, + subpackages: true, + }, + project: { + filename: projectConfigFilename, + source, + }, + template: { + filter: { + extname: '.swan', + lang: 'sjs', + generate(filter, filename) { + if (filename) { + return `` + } + return ` +${filter.code} +` + }, + }, + slot: { + fallback: false, + }, + extname: '.swan', + directive: 's-', + compilerOptions: { + nodeTransforms: [transformFor], + }, + }, + style: { + extname: '.css', + }, +} + +export default [uniMiniProgramBaiduPlugin, ...initMiniProgramPlugin(options)] diff --git a/packages/uni-mp-baidu/src/plugin/project.swan.json b/packages/uni-mp-baidu/src/plugin/project.swan.json new file mode 100644 index 0000000000000000000000000000000000000000..2b872467b4697206022278564e506499917ee12e --- /dev/null +++ b/packages/uni-mp-baidu/src/plugin/project.swan.json @@ -0,0 +1,19 @@ +{ + "appid": "", + "compilation-args": { + "common": { + "babelSetting": { + "ignore": [] + }, + "enhance": true, + "ignorePrefixCss": false + }, + "selected": -3 + }, + "host": "baiduboxapp", + "projectname": "", + "setting": { + "autoAudits": false, + "urlCheck": false + } +} diff --git a/packages/uni-mp-baidu/src/plugin/transforms/vFor.ts b/packages/uni-mp-baidu/src/plugin/transforms/vFor.ts new file mode 100644 index 0000000000000000000000000000000000000000..aef36574457057e1dc4cf8dfa9d6222e63dec76a --- /dev/null +++ b/packages/uni-mp-baidu/src/plugin/transforms/vFor.ts @@ -0,0 +1,22 @@ +import { + genExpr, + findProp, + isForElementNode, + DirectiveNode, + NodeTransform, +} from '@dcloudio/uni-mp-compiler' + +export const transformFor: NodeTransform = (node) => { + if (!isForElementNode(node)) { + return + } + const keyProp = findProp(node, 'key', true) + if (keyProp) { + const { exp } = keyProp as DirectiveNode + if (exp) { + const key = genExpr(exp) + node.vFor.sourceCode = `${node.vFor.sourceAlias} trackBy ${key}` + node.props.splice(node.props.indexOf(keyProp), 1) + } + } +} diff --git a/packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts b/packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts index 2fc0929da790e90caf3f249b87c47a1afaaed0aa..0d11ebdbbb5a2a7462b278ee205b13b5a496ce63 100644 --- a/packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts +++ b/packages/uni-mp-baidu/src/runtime/parseComponentOptions.ts @@ -48,7 +48,7 @@ export function parse(componentOptions: MPComponentOptions) { fixSetDataStart(this as MPComponentInstance) oldAttached.call(this) this.pageinstance.$vm = this.$vm - this.$vm.__call_hook('onInit', query) + this.$vm.$callHook('onInit', query) } lifetimes.attached = function attached(this: MPComponentInstance) { if (!this.$vm) { diff --git a/packages/uni-mp-compiler/__tests__/class.spec.ts b/packages/uni-mp-compiler/__tests__/class.spec.ts index ecf394ba3dfa9c4ff4e3f22094cd98d987095a53..f9d1780549f4ed17d8f0e3ddbf59c60134ca3b2f 100644 --- a/packages/uni-mp-compiler/__tests__/class.spec.ts +++ b/packages/uni-mp-compiler/__tests__/class.spec.ts @@ -75,28 +75,28 @@ describe('compiler: transform class', () => { test('v-bind:class object syntax + class', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _ctx.isRed ? 1 : 0 } }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _ctx.isRed ? 1 : 0 } }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _ctx.ok ? 1 : 0, b: _ctx.handle(_ctx.ok) ? 1 : 0, c: _ctx.ok > 1 ? 1 : 0, d: _ctx.j ? 1 : 0, e: _ctx.k, f: _ctx.l, g: _ctx.m ? 1 : 0, h: _n(_ctx.n), i: _n({ a: true }), j: _n({ b: _ctx.o }) } }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _ctx.ok ? 1 : 0, b: _ctx.handle(_ctx.ok) ? 1 : 0, c: _ctx.ok > 1 ? 1 : 0, d: _ctx.j ? 1 : 0, e: _ctx.k, f: _ctx.l, g: _ctx.m ? 1 : 0, h: _n(_ctx.n), i: _n({ a: true }), j: _n({ b: _ctx.o }) } }` @@ -128,28 +128,28 @@ describe('compiler: transform class', () => { test('v-bind:class array syntax + class', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _n(_ctx.classA), b: _n(_ctx.classB) } }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _n(_ctx.classA), b: _n(_ctx.classB) } }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _n(_ctx.classA), b: _n(_ctx.classB), c: _n({ classC: _ctx.isC, classD: _ctx.isD }), d: _n(_ctx.isF ? 'classF' : ''), e: _n(_ctx.isG && 'classG'), f: _n(_ctx.classH), g: _n([_ctx.classI, _ctx.classJ]), h: _n(_ctx.handle(_ctx.classK)) } }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _n(_ctx.classA), b: _n(_ctx.classB), c: _n({ classC: _ctx.isC, classD: _ctx.isD }), d: _n(_ctx.isF ? 'classF' : ''), e: _n(_ctx.isG && 'classG'), f: _n(_ctx.classH), g: _n([_ctx.classI, _ctx.classJ]), h: _n(_ctx.handle(_ctx.classK)) } }` diff --git a/packages/uni-mp-compiler/__tests__/component.spec.ts b/packages/uni-mp-compiler/__tests__/component.spec.ts index d3d49fffc0b011ed452d09b5a58ae5762bd99215..5add1d3ec8e04d98a1dfdf69aebc0d67c876e9a2 100644 --- a/packages/uni-mp-compiler/__tests__/component.spec.ts +++ b/packages/uni-mp-compiler/__tests__/component.spec.ts @@ -5,7 +5,7 @@ describe('compiler: transform component', () => { // test('basic', () => { // assert( // ``, - // ``, + // ``, // `(_ctx, _cache) => { // return {} // }`, @@ -17,7 +17,7 @@ describe('compiler: transform component', () => { test('component + component', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return {} }`, @@ -29,7 +29,7 @@ describe('compiler: transform component', () => { test('component + component + component', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return {} }`, @@ -41,7 +41,7 @@ describe('compiler: transform component', () => { test('component with v-for', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _f(_ctx.items, (item, k0, i0) => { return { a: '2a9ec0b0-0' + '-' + i0 }; }) } }`, @@ -51,7 +51,7 @@ describe('compiler: transform component', () => { ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _f(_ctx.items, (item, key, index) => { return { a: '2a9ec0b0-0' + '-' + index }; }) } }`, @@ -63,7 +63,7 @@ describe('compiler: transform component', () => { test('component + component with v-for', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _f(_ctx.items, (item, k0, i0) => { return { a: '2a9ec0b0-1' + '-' + i0 + ',' + '2a9ec0b0-0' }; }) } }`, @@ -75,7 +75,7 @@ describe('compiler: transform component', () => { test('component with v-for + component', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _f(_ctx.items, (item, k0, i0) => { return { a: '2a9ec0b0-1' + '-' + i0 + ',' + ('2a9ec0b0-0' + '-' + i0), b: '2a9ec0b0-0' + '-' + i0 }; }) } }`, @@ -87,7 +87,7 @@ describe('compiler: transform component', () => { test('component with v-for + component with v-for', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _f(_ctx.items, (item, k0, i0) => { return { a: _f(item.items, (item1, k1, i1) => { return { a: '2a9ec0b0-1' + '-' + i0 + '-' + i1 + ',' + ('2a9ec0b0-0' + '-' + i0) }; }), b: '2a9ec0b0-0' + '-' + i0 }; }) } }`, diff --git a/packages/uni-mp-compiler/__tests__/ref.spec.ts b/packages/uni-mp-compiler/__tests__/ref.spec.ts index e6a1511ecfb04cbd5da0fee3e6f655d412fa9cf0..1ddf840705fd8bb21d5a6fdcb2db4eff10f91f9e 100644 --- a/packages/uni-mp-compiler/__tests__/ref.spec.ts +++ b/packages/uni-mp-compiler/__tests__/ref.spec.ts @@ -1,28 +1,19 @@ import { assert } from './testUtils' describe('compiler: transform ref', () => { - test('v-r', () => { + test('without ref', () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return {} }` ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return {} -}` - ) - }) - test('v-r-i-f', () => { - assert( - ``, - ``, - `(_ctx, _cache) => { - return { a: _f(_ctx.items, (item, k0, i0) => { return { a: '2a9ec0b0-0' + '-' + i0 }; }) } }` ) }) @@ -32,6 +23,13 @@ describe('compiler: transform ref', () => { ``, `(_ctx, _cache) => { return {} +}` + ) + assert( + ``, + ``, + `(_ctx, _cache) => { + return { a: _f(_ctx.items, (item, k0, i0) => { return { a: '2a9ec0b0-0' + '-' + i0 }; }) } }` ) }) @@ -41,6 +39,13 @@ describe('compiler: transform ref', () => { ``, `(_ctx, _cache) => { return { a: _ctx.custom } +}` + ) + assert( + ``, + ``, + `(_ctx, _cache) => { + return { a: _f(_ctx.items, (item, k0, i0) => { return { a: '2a9ec0b0-0' + '-' + i0 }; }), b: _ctx.custom } }` ) }) diff --git a/packages/uni-mp-compiler/__tests__/scopeId.spec.ts b/packages/uni-mp-compiler/__tests__/scopeId.spec.ts index 04b3b4815cd99447d7db3fdb1d9cf0bf5755b35a..9fa68c68613ac9316ea0a59002b6c43ad7884459 100644 --- a/packages/uni-mp-compiler/__tests__/scopeId.spec.ts +++ b/packages/uni-mp-compiler/__tests__/scopeId.spec.ts @@ -33,7 +33,7 @@ describe('compiler: transform scopeId', () => { ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _n(_ctx.foo) } }`, @@ -41,7 +41,7 @@ describe('compiler: transform scopeId', () => { ) assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _n(_ctx.foo) } }`, diff --git a/packages/uni-mp-compiler/__tests__/vModel.spec.ts b/packages/uni-mp-compiler/__tests__/vModel.spec.ts index ba68395edb9cdceb365666997085e2b55ec60098..7ac6132c542a4995392eb2768936a93c19bda664 100644 --- a/packages/uni-mp-compiler/__tests__/vModel.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vModel.spec.ts @@ -4,7 +4,7 @@ describe('compiler: transform v-model', () => { test(`component v-model`, () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _ctx.model, b: _o($event => _ctx.model = $event) } }` @@ -13,7 +13,7 @@ describe('compiler: transform v-model', () => { test(`component v-model with cache`, () => { assert( ``, - ``, + ``, `(_ctx, _cache) => { return { a: _ctx.model, b: _o($event => _ctx.model = $event) } }`, diff --git a/packages/uni-mp-compiler/__tests__/vSlot.spec.ts b/packages/uni-mp-compiler/__tests__/vSlot.spec.ts index 9738f1d29fe721c6b5a1899de84c71e1c84d961e..192092d5bebf4b1c38ca2579447fb74532e20807 100644 --- a/packages/uni-mp-compiler/__tests__/vSlot.spec.ts +++ b/packages/uni-mp-compiler/__tests__/vSlot.spec.ts @@ -4,14 +4,14 @@ describe('compiler: transform v-slot', () => { test('default slot', () => { assert( `