gitea push
This commit is contained in:
+638
-81
@@ -3,6 +3,56 @@
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.27.1",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz",
|
||||
"integrity": "sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.28.5",
|
||||
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz",
|
||||
"integrity": "sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.29.3",
|
||||
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.3.tgz",
|
||||
"integrity": "sha512-b3ctpQwp+PROvU/cttc4OYl4MzfJUWy6FZg+PMXfzmt/+39iHVF0sDfqay8TQM3JA2EUOyKcFZt75jWriQijsA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.29.0"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.29.0",
|
||||
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
|
||||
"integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.27.1",
|
||||
"@babel/helper-validator-identifier": "^7.28.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@emnapi/core": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
|
||||
@@ -98,9 +148,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.127.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.127.0.tgz",
|
||||
"integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==",
|
||||
"version": "0.128.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.128.0.tgz",
|
||||
"integrity": "sha512-huv1Y/LzBJkBVHt3OlC7u0zHBW9qXf1FdD7sGmc1rXc2P1mTwHssYv7jyGx5KAACSCH+9B3Bhn6Z9luHRvf7pQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"funding": {
|
||||
@@ -108,9 +158,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/binding-darwin-arm64": {
|
||||
"version": "1.0.0-rc.17",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.17.tgz",
|
||||
"integrity": "sha512-4ksWc9n0mhlZpZ9PMZgTGjeOPRu8MB1Z3Tz0Mo02eWfWCHMW1zN82Qz/pL/rC+yQa+8ZnutMF0JjJe7PjwasYw==",
|
||||
"version": "1.0.0-rc.18",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.0-rc.18.tgz",
|
||||
"integrity": "sha512-apJq2ktnGp27nSInMR5Vcj8kY6xJzDAvfdIFlpDcAK/w4cDO58qVoi1YQsES/SKiFNge/6e4CUzgjfHduYqWpQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -125,54 +175,54 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@rolldown/pluginutils": {
|
||||
"version": "1.0.0-rc.17",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.17.tgz",
|
||||
"integrity": "sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==",
|
||||
"version": "1.0.0-rc.18",
|
||||
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.18.tgz",
|
||||
"integrity": "sha512-CUY5Mnhe64xQBGZEEXQ5WyZwsc1JU3vAZLIxtrsBt3LO6UOb+C8GunVKqe9sT8NeWb4lqSaoJtp2xo6GxT1MNw==",
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/@tailwindcss/node": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.2.4.tgz",
|
||||
"integrity": "sha512-Ai7+yQPxz3ddrDQzFfBKdHEVBg0w3Zl83jnjuwxnZOsnH9pGn93QHQtpU0p/8rYWxvbFZHneni6p1BSLK4DkGA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/node/-/node-4.3.0.tgz",
|
||||
"integrity": "sha512-aFb4gUhFOgdh9AXo4IzBEOzBkkAxm9VigwDJnMIYv3lcfXCJVesNfbEaBl4BNgVRyid92AmdviqwBUBRKSeY3g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@jridgewell/remapping": "^2.3.5",
|
||||
"enhanced-resolve": "^5.19.0",
|
||||
"enhanced-resolve": "^5.21.0",
|
||||
"jiti": "^2.6.1",
|
||||
"lightningcss": "1.32.0",
|
||||
"magic-string": "^0.30.21",
|
||||
"source-map-js": "^1.2.1",
|
||||
"tailwindcss": "4.2.4"
|
||||
"tailwindcss": "4.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tailwindcss/oxide": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.2.4.tgz",
|
||||
"integrity": "sha512-9El/iI069DKDSXwTvB9J4BwdO5JhRrOweGaK25taBAvBXyXqJAX+Jqdvs8r8gKpsI/1m0LeJLyQYTf/WLrBT1Q==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide/-/oxide-4.3.0.tgz",
|
||||
"integrity": "sha512-F7HZGBeN9I0/AuuJS5PwcD8xayx5ri5GhjYUDBEVYUkexyA/giwbDNjRVrxSezE3T250OU2K/wp/ltWx3UOefg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@tailwindcss/oxide-android-arm64": "4.2.4",
|
||||
"@tailwindcss/oxide-darwin-arm64": "4.2.4",
|
||||
"@tailwindcss/oxide-darwin-x64": "4.2.4",
|
||||
"@tailwindcss/oxide-freebsd-x64": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-arm64-gnu": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-arm64-musl": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-x64-gnu": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-x64-musl": "4.2.4",
|
||||
"@tailwindcss/oxide-wasm32-wasi": "4.2.4",
|
||||
"@tailwindcss/oxide-win32-arm64-msvc": "4.2.4",
|
||||
"@tailwindcss/oxide-win32-x64-msvc": "4.2.4"
|
||||
"@tailwindcss/oxide-android-arm64": "4.3.0",
|
||||
"@tailwindcss/oxide-darwin-arm64": "4.3.0",
|
||||
"@tailwindcss/oxide-darwin-x64": "4.3.0",
|
||||
"@tailwindcss/oxide-freebsd-x64": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-arm64-gnu": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-arm64-musl": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-x64-gnu": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-x64-musl": "4.3.0",
|
||||
"@tailwindcss/oxide-wasm32-wasi": "4.3.0",
|
||||
"@tailwindcss/oxide-win32-arm64-msvc": "4.3.0",
|
||||
"@tailwindcss/oxide-win32-x64-msvc": "4.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@tailwindcss/oxide-darwin-arm64": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.2.4.tgz",
|
||||
"integrity": "sha512-tSC/Kbqpz/5/o/C2sG7QvOxAKqyd10bq+ypZNf+9Fi2TvbVbv1zNpcEptcsU7DPROaSbVgUXmrzKhurFvo5eDg==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/oxide-darwin-arm64/-/oxide-darwin-arm64-4.3.0.tgz",
|
||||
"integrity": "sha512-oMN/WZRb+SO37BmUElEgeEWuU8E/HXRkiODxJxLe1UTHVXLrdVSgfaJV7pSlhRGMSOiXLuxTIjfsF3wYvz8cgQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@@ -186,29 +236,261 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@tailwindcss/vite": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.2.4.tgz",
|
||||
"integrity": "sha512-pCvohwOCspk3ZFn6eJzrrX3g4n2JY73H6MmYC87XfGPyTty4YsCjYTMArRZm/zOI8dIt3+EcrLHAFPe5A4bgtw==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/@tailwindcss/vite/-/vite-4.3.0.tgz",
|
||||
"integrity": "sha512-t6J3OrB5Fc0ExuhohouH0fWUGMYL6PTLhW+E7zIk/pdbnJARZDCwjBznFnkh5ynRnIRSI4YjtTH0t6USjJISrw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@tailwindcss/node": "4.2.4",
|
||||
"@tailwindcss/oxide": "4.2.4",
|
||||
"tailwindcss": "4.2.4"
|
||||
"@tailwindcss/node": "4.3.0",
|
||||
"@tailwindcss/oxide": "4.3.0",
|
||||
"tailwindcss": "4.3.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "^5.2.0 || ^6 || ^7 || ^8"
|
||||
}
|
||||
},
|
||||
"node_modules/@tybys/wasm-util": {
|
||||
"version": "0.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
|
||||
"integrity": "sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==",
|
||||
"version": "0.10.2",
|
||||
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz",
|
||||
"integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==",
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"tslib": "^2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.34.tgz",
|
||||
"integrity": "sha512-s9cLyK5mLcvZ4Agva5QgRsQyLKvts9WbU9DB6NqiZkkGEdwmcEiylj5Jbwkp680drF/NNCV8OlAJSe+yMLxaJw==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.3",
|
||||
"@vue/shared": "3.5.34",
|
||||
"entities": "^7.0.1",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-dom": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.34.tgz",
|
||||
"integrity": "sha512-EbF/T++k0e2MMZlJsBhzK8Sgwt0HcIPOhzn1CTB/lv6sQcyk+OWf8YeiLxZp3ro7MbbLcAfAJ6sEvjFWuNgUCw==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.5.34",
|
||||
"@vue/shared": "3.5.34"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-sfc": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.34.tgz",
|
||||
"integrity": "sha512-D/ihr6uZeIt6r+pVZf46RWT1fAsLFMbUP7k8G1VkiiWexriED9GrX3echHd4Abbt17zjlfiFJ8z7a3BxZOPNjg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.29.3",
|
||||
"@vue/compiler-core": "3.5.34",
|
||||
"@vue/compiler-dom": "3.5.34",
|
||||
"@vue/compiler-ssr": "3.5.34",
|
||||
"@vue/shared": "3.5.34",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.21",
|
||||
"postcss": "^8.5.14",
|
||||
"source-map-js": "^1.2.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-ssr": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.34.tgz",
|
||||
"integrity": "sha512-cDtTHKibkThKGHH1SP+WdccquNRYQDFH6rRjQCqT9G2ltFAfoR5pUftpab/z+aM5mW9HLLVQW7hfKKQe/1GBeQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.34",
|
||||
"@vue/shared": "3.5.34"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/reactivity": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.34.tgz",
|
||||
"integrity": "sha512-y9XDjCEuBp+98k+UL5dbYkh57AHU4o6cxZedOPXw3bmrZZYLQsVHguGurq7hVrPCSrQtrnz1f9dssyFr+dMXfQ==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.34"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-core": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.34.tgz",
|
||||
"integrity": "sha512-mKeBYvu8tcMSLhypAHBmriUFfWXKTCF/23Z4jiCoYK3UtWepkliViNLuR90V9XOyD62mUxs9p1jsrpK3CCGIzw==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.34",
|
||||
"@vue/shared": "3.5.34"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-dom": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.34.tgz",
|
||||
"integrity": "sha512-e8kZzERmCwUnBRVsgSQlAfrfU2rGoy0FFKPBXSlfEjc/O3KfA7QP0t1/2ZylrbchjmIKB4dPTd07A6WPr0eOrg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.34",
|
||||
"@vue/runtime-core": "3.5.34",
|
||||
"@vue/shared": "3.5.34",
|
||||
"csstype": "^3.2.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/server-renderer": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.34.tgz",
|
||||
"integrity": "sha512-nHxmJoTrKsmrkbILRhkC9gY1G3moZbJTqCzDd7DOOzG5KH9oeJ0Unqrff5f9v0pW//jES05ZkJcNtfE8JjOIew==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-ssr": "3.5.34",
|
||||
"@vue/shared": "3.5.34"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "3.5.34"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.34.tgz",
|
||||
"integrity": "sha512-24uqU4OIiX29ryC3MeWid/Xf2fa2EFRUVLb77nRhk+UrTVrh/XiGtFAFmJBAtBRbjwNdsPRP+jj/OL27Eg1NDA==",
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.1.0",
|
||||
"supports-color": "^7.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/chalk?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/chalk/node_modules/supports-color": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz",
|
||||
"integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/cliui": {
|
||||
"version": "8.0.1",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
|
||||
"integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.1",
|
||||
"wrap-ansi": "^7.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/color-name": {
|
||||
"version": "1.1.4",
|
||||
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
|
||||
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/concurrently": {
|
||||
"version": "9.2.1",
|
||||
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.1.tgz",
|
||||
"integrity": "sha512-fsfrO0MxV64Znoy8/l1vVIjjHa29SZyyqPgQBwhiDcaW8wJc2W3XWVOGx4M3oJBnv/zdUZIIp1gDeS98GzP8Ng==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"chalk": "4.1.2",
|
||||
"rxjs": "7.8.2",
|
||||
"shell-quote": "1.8.3",
|
||||
"supports-color": "8.1.1",
|
||||
"tree-kill": "1.2.2",
|
||||
"yargs": "17.7.2"
|
||||
},
|
||||
"bin": {
|
||||
"conc": "dist/bin/concurrently.js",
|
||||
"concurrently": "dist/bin/concurrently.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/csstype": {
|
||||
"version": "3.2.3",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz",
|
||||
"integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==",
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/detect-libc": {
|
||||
"version": "2.1.2",
|
||||
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
||||
@@ -218,10 +500,17 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/enhanced-resolve": {
|
||||
"version": "5.21.0",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.0.tgz",
|
||||
"integrity": "sha512-otxSQPw4lkOZWkHpB3zaEQs6gWYEsmX4xQF68ElXC/TWvGxGMSGOvoNbaLXm6/cS/fSfHtsEdw90y20PCd+sCA==",
|
||||
"version": "5.21.2",
|
||||
"resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.2.tgz",
|
||||
"integrity": "sha512-xe9vQb5kReirPUxgQrXA3ihgbCqssmTiM7cOZ+Gzu+VeGWgpV98lLZvp0dl4yriyAePcewxGUs9UpKD8PET9KQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.4",
|
||||
@@ -231,6 +520,36 @@
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz",
|
||||
"integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==",
|
||||
"license": "BSD-2-Clause",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/escalade": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
|
||||
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/fdir": {
|
||||
"version": "6.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
||||
@@ -249,16 +568,61 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",
|
||||
"integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",
|
||||
"hasInstallScript": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"os": [
|
||||
"darwin"
|
||||
],
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/has-flag": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",
|
||||
"integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/jiti": {
|
||||
"version": "2.6.1",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.6.1.tgz",
|
||||
"integrity": "sha512-ekilCSN1jwRvIbgeg/57YFh8qQDNbwDb9xT/qu2DAHbFFZUicIl4ygVaAvzveMhMVr3LnpSKTNnwt8PoOfmKhQ==",
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz",
|
||||
"integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==",
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"jiti": "lib/jiti-cli.mjs"
|
||||
@@ -362,9 +726,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.5.13",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.13.tgz",
|
||||
"integrity": "sha512-qif0+jGGZoLWdHey3UFHHWP0H7Gbmsk8T5VEqyYFbWqPr1XqvLGBbk/sl8V5exGmcYJklJOhOQq1pV9IcsiFag==",
|
||||
"version": "8.5.14",
|
||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz",
|
||||
"integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
@@ -390,15 +754,25 @@
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rolldown": {
|
||||
"version": "1.0.0-rc.17",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.17.tgz",
|
||||
"integrity": "sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==",
|
||||
"version": "1.0.0-rc.18",
|
||||
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.18.tgz",
|
||||
"integrity": "sha512-phmyKBpuBdRYDf4hgyynGAYn/rDDe+iZXKVJ7WX5b1zQzpLkP5oJRPGsfJuHdzPMlyyEO/4sPW6yfSx2gf7lVg==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.127.0",
|
||||
"@rolldown/pluginutils": "1.0.0-rc.17"
|
||||
"@oxc-project/types": "=0.128.0",
|
||||
"@rolldown/pluginutils": "1.0.0-rc.18"
|
||||
},
|
||||
"bin": {
|
||||
"rolldown": "bin/cli.mjs"
|
||||
@@ -407,21 +781,44 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-android-arm64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-darwin-arm64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-darwin-x64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-freebsd-x64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-x64-musl": "1.0.0-rc.17",
|
||||
"@rolldown/binding-openharmony-arm64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-wasm32-wasi": "1.0.0-rc.17",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.17",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.0.0-rc.17"
|
||||
"@rolldown/binding-android-arm64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-darwin-arm64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-darwin-x64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-freebsd-x64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-x64-musl": "1.0.0-rc.18",
|
||||
"@rolldown/binding-openharmony-arm64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-wasm32-wasi": "1.0.0-rc.18",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.18",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.0.0-rc.18"
|
||||
}
|
||||
},
|
||||
"node_modules/rxjs": {
|
||||
"version": "7.8.2",
|
||||
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
|
||||
"integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",
|
||||
"dev": true,
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"tslib": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/shell-quote": {
|
||||
"version": "1.8.3",
|
||||
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.3.tgz",
|
||||
"integrity": "sha512-ObmnIF4hXNg1BqhnHmgbDETF8dLPCggZWBjkQfhZpbszZnYur5DUljTcCHii5LC3J5E0yeO/1LIMyH+UvHQgyw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
@@ -433,10 +830,54 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/supports-color": {
|
||||
"version": "8.1.1",
|
||||
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz",
|
||||
"integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"has-flag": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/supports-color?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/tailwindcss": {
|
||||
"version": "4.2.4",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.2.4.tgz",
|
||||
"integrity": "sha512-HhKppgO81FQof5m6TEnuBWCZGgfRAWbaeOaGT00KOy/Pf/j6oUihdvBpA7ltCeAvZpFhW3j0PTclkxsd4IXYDA==",
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-4.3.0.tgz",
|
||||
"integrity": "sha512-y6nxMGB1nMW9R6k96e5gdIFzcfL/gTJRNaqGes1YvkLnPVXzWgbqFF2yLC0T8G774n24cx3Pe8XrKoniCOAH+Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/tapable": {
|
||||
@@ -469,24 +910,34 @@
|
||||
"url": "https://github.com/sponsors/SuperchupuDev"
|
||||
}
|
||||
},
|
||||
"node_modules/tree-kill": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz",
|
||||
"integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"bin": {
|
||||
"tree-kill": "cli.js"
|
||||
}
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.8.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||
"license": "0BSD",
|
||||
"optional": true
|
||||
"devOptional": true,
|
||||
"license": "0BSD"
|
||||
},
|
||||
"node_modules/vite": {
|
||||
"version": "8.0.10",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.10.tgz",
|
||||
"integrity": "sha512-rZuUu9j6J5uotLDs+cAA4O5H4K1SfPliUlQwqa6YEwSrWDZzP4rhm00oJR5snMewjxF5V/K3D4kctsUTsIU9Mw==",
|
||||
"version": "8.0.11",
|
||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.11.tgz",
|
||||
"integrity": "sha512-Jz1mxtUBR5xTT65VOdJZUUeoyLtqljmFkiUXhPTLZka3RDc9vpi/xXkyrnsdRcm2lIi3l3GPMnAidTsEGIj3Ow==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.32.0",
|
||||
"picomatch": "^4.0.4",
|
||||
"postcss": "^8.5.10",
|
||||
"rolldown": "1.0.0-rc.17",
|
||||
"postcss": "^8.5.14",
|
||||
"rolldown": "1.0.0-rc.18",
|
||||
"tinyglobby": "^0.2.16"
|
||||
},
|
||||
"bin": {
|
||||
@@ -503,7 +954,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^20.19.0 || >=22.12.0",
|
||||
"@vitejs/devtools": "^0.1.0",
|
||||
"@vitejs/devtools": "^0.1.18",
|
||||
"esbuild": "^0.27.0 || ^0.28.0",
|
||||
"jiti": ">=1.21.0",
|
||||
"less": "^4.0.0",
|
||||
@@ -553,6 +1004,112 @@
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "3.5.34",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.34.tgz",
|
||||
"integrity": "sha512-WdLBG9gm02OgJIG9axd5Hpx0TFLdzVgfG2evFFu8Rur5O/IoGc5cMjnjh3tPL6GnRGsYvUhBSKVPYVcxRKpMCA==",
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.34",
|
||||
"@vue/compiler-sfc": "3.5.34",
|
||||
"@vue/runtime-dom": "3.5.34",
|
||||
"@vue/server-renderer": "3.5.34",
|
||||
"@vue/shared": "3.5.34"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/vuetify": {
|
||||
"version": "4.0.7",
|
||||
"resolved": "https://registry.npmjs.org/vuetify/-/vuetify-4.0.7.tgz",
|
||||
"integrity": "sha512-SV+YJkBmudY3s9qfZO2ZGUsrD0TDQU8pMBH1ERga9AEyjGvioZuXXh93V9wHxXJphvqRC2NW10Nt2lW9IZQcPw==",
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/johnleider"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": ">=4.7",
|
||||
"vite-plugin-vuetify": ">=2.1.0",
|
||||
"vue": "^3.5.0",
|
||||
"webpack-plugin-vuetify": ">=3.1.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
},
|
||||
"vite-plugin-vuetify": {
|
||||
"optional": true
|
||||
},
|
||||
"webpack-plugin-vuetify": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "7.0.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
|
||||
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
"version": "5.0.8",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
|
||||
"integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "17.7.2",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz",
|
||||
"integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cliui": "^8.0.1",
|
||||
"escalade": "^3.1.1",
|
||||
"get-caller-file": "^2.0.5",
|
||||
"require-directory": "^2.1.1",
|
||||
"string-width": "^4.2.3",
|
||||
"y18n": "^5.0.5",
|
||||
"yargs-parser": "^21.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-parser": {
|
||||
"version": "21.1.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
|
||||
"integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@oxc-project/types",
|
||||
"version": "0.127.0",
|
||||
"version": "0.128.0",
|
||||
"description": "Types for Oxc AST nodes",
|
||||
"keywords": [
|
||||
"AST",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rolldown/binding-darwin-arm64",
|
||||
"version": "1.0.0-rc.17",
|
||||
"version": "1.0.0-rc.18",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
|
||||
BIN
Binary file not shown.
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@rolldown/pluginutils",
|
||||
"version": "1.0.0-rc.17",
|
||||
"version": "1.0.0-rc.18",
|
||||
"homepage": "https://rolldown.rs/",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
+14
-14
File diff suppressed because one or more lines are too long
+14
-14
File diff suppressed because one or more lines are too long
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tailwindcss/node",
|
||||
"version": "4.2.4",
|
||||
"version": "4.3.0",
|
||||
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -34,12 +34,12 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@jridgewell/remapping": "^2.3.5",
|
||||
"enhanced-resolve": "^5.19.0",
|
||||
"enhanced-resolve": "^5.21.0",
|
||||
"jiti": "^2.6.1",
|
||||
"lightningcss": "1.32.0",
|
||||
"magic-string": "^0.30.21",
|
||||
"source-map-js": "^1.2.1",
|
||||
"tailwindcss": "4.2.4"
|
||||
"tailwindcss": "4.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup-node",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tailwindcss/oxide-darwin-arm64",
|
||||
"version": "4.2.4",
|
||||
"version": "4.3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
|
||||
|
||||
BIN
Binary file not shown.
+58
-54
@@ -77,8 +77,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-android-arm64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-android-arm64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -93,8 +93,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-android-arm-eabi')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-android-arm-eabi/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -114,8 +114,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-win32-x64-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -130,8 +130,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-win32-x64-msvc')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-win32-x64-msvc/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -147,8 +147,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-win32-ia32-msvc')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-win32-ia32-msvc/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -163,8 +163,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-win32-arm64-msvc')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-win32-arm64-msvc/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -182,8 +182,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-darwin-universal')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-darwin-universal/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -198,8 +198,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-darwin-x64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-darwin-x64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -214,8 +214,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-darwin-arm64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-darwin-arm64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -234,8 +234,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-freebsd-x64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-x64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -250,8 +250,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-freebsd-arm64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-freebsd-arm64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -271,8 +271,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-x64-musl')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-musl/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -287,8 +287,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-x64-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-x64-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -305,8 +305,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-arm64-musl')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-musl/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -321,8 +321,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-arm64-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm64-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -339,8 +339,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-arm-musleabihf')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-musleabihf/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -355,8 +355,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-arm-gnueabihf')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-arm-gnueabihf/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -373,8 +373,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-loong64-musl')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-musl/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -389,8 +389,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-loong64-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-loong64-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -407,8 +407,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-riscv64-musl')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-musl/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -423,8 +423,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-riscv64-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-riscv64-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -440,8 +440,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-ppc64-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-ppc64-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -456,8 +456,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-linux-s390x-gnu')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-linux-s390x-gnu/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -476,8 +476,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-openharmony-arm64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -492,8 +492,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-openharmony-x64')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-x64/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -508,8 +508,8 @@ function requireNative() {
|
||||
try {
|
||||
const binding = require('@tailwindcss/oxide-openharmony-arm')
|
||||
const bindingPackageVersion = require('@tailwindcss/oxide-openharmony-arm/package.json').version
|
||||
if (bindingPackageVersion !== '4.2.4' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.2.4 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
if (bindingPackageVersion !== '4.3.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
|
||||
throw new Error(`Native binding package version mismatch, expected 4.3.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
|
||||
}
|
||||
return binding
|
||||
} catch (e) {
|
||||
@@ -536,13 +536,17 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
||||
wasiBindingError = err
|
||||
}
|
||||
}
|
||||
if (!nativeBinding) {
|
||||
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
||||
try {
|
||||
wasiBinding = require('@tailwindcss/oxide-wasm32-wasi')
|
||||
nativeBinding = wasiBinding
|
||||
} catch (err) {
|
||||
if (process.env.NAPI_RS_FORCE_WASI) {
|
||||
wasiBindingError.cause = err
|
||||
if (!wasiBindingError) {
|
||||
wasiBindingError = err
|
||||
} else {
|
||||
wasiBindingError.cause = err
|
||||
}
|
||||
loadErrors.push(err)
|
||||
}
|
||||
}
|
||||
|
||||
+16
-16
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tailwindcss/oxide",
|
||||
"version": "4.2.4",
|
||||
"version": "4.3.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",
|
||||
@@ -33,9 +33,9 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@napi-rs/cli": "3.4.1",
|
||||
"@napi-rs/wasm-runtime": "^1.1.1",
|
||||
"emnapi": "1.8.1"
|
||||
"@napi-rs/cli": "3.6.2",
|
||||
"@napi-rs/wasm-runtime": "^1.1.4",
|
||||
"emnapi": "1.10.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 20"
|
||||
@@ -49,18 +49,18 @@
|
||||
"access": "public"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@tailwindcss/oxide-android-arm64": "4.2.4",
|
||||
"@tailwindcss/oxide-darwin-arm64": "4.2.4",
|
||||
"@tailwindcss/oxide-darwin-x64": "4.2.4",
|
||||
"@tailwindcss/oxide-freebsd-x64": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-arm64-gnu": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-arm64-musl": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-x64-musl": "4.2.4",
|
||||
"@tailwindcss/oxide-linux-x64-gnu": "4.2.4",
|
||||
"@tailwindcss/oxide-win32-x64-msvc": "4.2.4",
|
||||
"@tailwindcss/oxide-win32-arm64-msvc": "4.2.4",
|
||||
"@tailwindcss/oxide-wasm32-wasi": "4.2.4"
|
||||
"@tailwindcss/oxide-android-arm64": "4.3.0",
|
||||
"@tailwindcss/oxide-darwin-x64": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-arm64-gnu": "4.3.0",
|
||||
"@tailwindcss/oxide-freebsd-x64": "4.3.0",
|
||||
"@tailwindcss/oxide-darwin-arm64": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-arm64-musl": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-x64-musl": "4.3.0",
|
||||
"@tailwindcss/oxide-linux-x64-gnu": "4.3.0",
|
||||
"@tailwindcss/oxide-wasm32-wasi": "4.3.0",
|
||||
"@tailwindcss/oxide-win32-x64-msvc": "4.3.0",
|
||||
"@tailwindcss/oxide-win32-arm64-msvc": "4.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm run build:platform && pnpm run build:wasm",
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+6
-6
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tailwindcss/vite",
|
||||
"version": "4.2.4",
|
||||
"version": "4.3.0",
|
||||
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -24,13 +24,13 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/node": "4.2.4",
|
||||
"@tailwindcss/oxide": "4.2.4",
|
||||
"tailwindcss": "4.2.4"
|
||||
"@tailwindcss/node": "4.3.0",
|
||||
"tailwindcss": "4.3.0",
|
||||
"@tailwindcss/oxide": "4.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.19.0",
|
||||
"vite": "^8.0.0"
|
||||
"@types/node": "^22.19.17",
|
||||
"vite": "^8.0.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vite": "^5.2.0 || ^6 || ^7 || ^8"
|
||||
|
||||
+164
-2
@@ -306,6 +306,141 @@ function asyncifyLoadSync(asyncify, buffer, imports) {
|
||||
|
||||
const CHAR_DOT = 46; /* . */
|
||||
const CHAR_FORWARD_SLASH = 47; /* / */
|
||||
const CHAR_BACKWARD_SLASH = 92; /* \ */
|
||||
const CHAR_COLON = 58; /* : */
|
||||
const CHAR_UPPERCASE_A = 65; /* A */
|
||||
const CHAR_UPPERCASE_Z = 90; /* Z */
|
||||
const CHAR_LOWERCASE_A = 97; /* a */
|
||||
const CHAR_LOWERCASE_Z = 122; /* z */
|
||||
function isPathSeparatorWin(code) {
|
||||
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
||||
}
|
||||
function isWindowsDeviceRoot(code) {
|
||||
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
|
||||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
|
||||
}
|
||||
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
/**
|
||||
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
|
||||
* semantics enough for the WASI shim's needs (drive-letter absolutes
|
||||
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
|
||||
*
|
||||
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
|
||||
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
|
||||
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
|
||||
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
|
||||
* is "relative", and produces a garbage joined path. Downstream
|
||||
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
|
||||
* sees a permanent failure. This function gives us the correct
|
||||
* Windows-style resolution without taking a Node-only `path` import
|
||||
* (which would break browser bundles of this package).
|
||||
*
|
||||
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
|
||||
* trimmed to what WASI realpath resolution actually exercises.
|
||||
*/
|
||||
function resolveWin32(args) {
|
||||
let resolvedDevice = '';
|
||||
let resolvedTail = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1; i--) {
|
||||
let path;
|
||||
if (i >= 0) {
|
||||
path = args[i];
|
||||
validateString(path, 'path');
|
||||
if (path.length === 0)
|
||||
continue;
|
||||
}
|
||||
else if (resolvedDevice.length === 0) {
|
||||
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
}
|
||||
else {
|
||||
// Look up per-drive cwd via the `=X:` env var convention; fall back
|
||||
// to the global cwd if absent.
|
||||
const envKey = `=${resolvedDevice}`;
|
||||
const env = (typeof process !== 'undefined') ? process.env : undefined;
|
||||
path = (env && typeof env[envKey] === 'string')
|
||||
? env[envKey]
|
||||
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
if (path === undefined ||
|
||||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
|
||||
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
|
||||
path = `${resolvedDevice}\\`;
|
||||
}
|
||||
}
|
||||
const len = path.length;
|
||||
let rootEnd = 0;
|
||||
let device = '';
|
||||
let isAbsolute = false;
|
||||
const code = path.charCodeAt(0);
|
||||
if (len === 1) {
|
||||
if (isPathSeparatorWin(code)) {
|
||||
rootEnd = 1;
|
||||
isAbsolute = true;
|
||||
}
|
||||
}
|
||||
else if (isPathSeparatorWin(code)) {
|
||||
isAbsolute = true;
|
||||
if (isPathSeparatorWin(path.charCodeAt(1))) {
|
||||
// UNC path: `\\server\share\…`
|
||||
let j = 2;
|
||||
let last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
const firstPart = path.slice(last, j);
|
||||
last = j;
|
||||
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j === len || j !== last) {
|
||||
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
||||
rootEnd = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
rootEnd = 1;
|
||||
}
|
||||
}
|
||||
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
|
||||
device = path.slice(0, 2);
|
||||
rootEnd = 2;
|
||||
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
|
||||
isAbsolute = true;
|
||||
rootEnd = 3;
|
||||
}
|
||||
}
|
||||
if (device.length > 0) {
|
||||
if (resolvedDevice.length > 0) {
|
||||
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
resolvedDevice = device;
|
||||
}
|
||||
}
|
||||
if (resolvedAbsolute) {
|
||||
if (resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
|
||||
resolvedAbsolute = isAbsolute;
|
||||
if (isAbsolute && resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
|
||||
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
|
||||
}
|
||||
function isPosixPathSeparator(code) {
|
||||
return code === CHAR_FORWARD_SLASH;
|
||||
}
|
||||
@@ -381,6 +516,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
||||
return res;
|
||||
}
|
||||
function resolve(...args) {
|
||||
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
|
||||
// below treats `D` as a non-`/` character and produces garbage; route
|
||||
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
|
||||
// run the original code path unchanged — `_isWin32` is constant-folded
|
||||
// away on those targets.
|
||||
if (_isWin32)
|
||||
return resolveWin32(args);
|
||||
let resolvedPath = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||||
@@ -1017,6 +1159,26 @@ function wrapExports(exports, needWrap) {
|
||||
});
|
||||
}
|
||||
|
||||
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
|
||||
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
|
||||
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
|
||||
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
|
||||
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
|
||||
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
|
||||
// Windows — and O_TEMPORARY without O_CREAT is invalid.
|
||||
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
function _toWinOpenFlags(f) {
|
||||
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
|
||||
if ((f & 0x40) !== 0)
|
||||
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
|
||||
if ((f & 0x80) !== 0)
|
||||
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
|
||||
if ((f & 0x200) !== 0)
|
||||
r |= 0x200; // O_TRUNC: same value on both
|
||||
if ((f & 0x400) !== 0)
|
||||
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
|
||||
return r;
|
||||
}
|
||||
function copyMemory(targets, src) {
|
||||
if (targets.length === 0 || src.length === 0)
|
||||
return 0;
|
||||
@@ -2273,7 +2435,7 @@ class WASI$1 {
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = fs.openSync(resolved_path, flagsRes, 0o666);
|
||||
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = wasi.fds.getFileTypeByFd(r);
|
||||
if ((filetype !== 3 /* WasiFileType.DIRECTORY */) &&
|
||||
((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 ||
|
||||
@@ -2309,7 +2471,7 @@ class WASI$1 {
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
|
||||
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = await wasi.fds.getFileTypeByFd(r);
|
||||
if ((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 && filetype !== 3 /* WasiFileType.DIRECTORY */) {
|
||||
return 54 /* WasiErrno.ENOTDIR */;
|
||||
|
||||
+164
-2
@@ -306,6 +306,141 @@ function asyncifyLoadSync(asyncify, buffer, imports) {
|
||||
|
||||
const CHAR_DOT = 46; /* . */
|
||||
const CHAR_FORWARD_SLASH = 47; /* / */
|
||||
const CHAR_BACKWARD_SLASH = 92; /* \ */
|
||||
const CHAR_COLON = 58; /* : */
|
||||
const CHAR_UPPERCASE_A = 65; /* A */
|
||||
const CHAR_UPPERCASE_Z = 90; /* Z */
|
||||
const CHAR_LOWERCASE_A = 97; /* a */
|
||||
const CHAR_LOWERCASE_Z = 122; /* z */
|
||||
function isPathSeparatorWin(code) {
|
||||
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
||||
}
|
||||
function isWindowsDeviceRoot(code) {
|
||||
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
|
||||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
|
||||
}
|
||||
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
/**
|
||||
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
|
||||
* semantics enough for the WASI shim's needs (drive-letter absolutes
|
||||
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
|
||||
*
|
||||
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
|
||||
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
|
||||
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
|
||||
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
|
||||
* is "relative", and produces a garbage joined path. Downstream
|
||||
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
|
||||
* sees a permanent failure. This function gives us the correct
|
||||
* Windows-style resolution without taking a Node-only `path` import
|
||||
* (which would break browser bundles of this package).
|
||||
*
|
||||
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
|
||||
* trimmed to what WASI realpath resolution actually exercises.
|
||||
*/
|
||||
function resolveWin32(args) {
|
||||
let resolvedDevice = '';
|
||||
let resolvedTail = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1; i--) {
|
||||
let path;
|
||||
if (i >= 0) {
|
||||
path = args[i];
|
||||
validateString(path, 'path');
|
||||
if (path.length === 0)
|
||||
continue;
|
||||
}
|
||||
else if (resolvedDevice.length === 0) {
|
||||
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
}
|
||||
else {
|
||||
// Look up per-drive cwd via the `=X:` env var convention; fall back
|
||||
// to the global cwd if absent.
|
||||
const envKey = `=${resolvedDevice}`;
|
||||
const env = (typeof process !== 'undefined') ? process.env : undefined;
|
||||
path = (env && typeof env[envKey] === 'string')
|
||||
? env[envKey]
|
||||
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
if (path === undefined ||
|
||||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
|
||||
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
|
||||
path = `${resolvedDevice}\\`;
|
||||
}
|
||||
}
|
||||
const len = path.length;
|
||||
let rootEnd = 0;
|
||||
let device = '';
|
||||
let isAbsolute = false;
|
||||
const code = path.charCodeAt(0);
|
||||
if (len === 1) {
|
||||
if (isPathSeparatorWin(code)) {
|
||||
rootEnd = 1;
|
||||
isAbsolute = true;
|
||||
}
|
||||
}
|
||||
else if (isPathSeparatorWin(code)) {
|
||||
isAbsolute = true;
|
||||
if (isPathSeparatorWin(path.charCodeAt(1))) {
|
||||
// UNC path: `\\server\share\…`
|
||||
let j = 2;
|
||||
let last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
const firstPart = path.slice(last, j);
|
||||
last = j;
|
||||
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j === len || j !== last) {
|
||||
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
||||
rootEnd = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
rootEnd = 1;
|
||||
}
|
||||
}
|
||||
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
|
||||
device = path.slice(0, 2);
|
||||
rootEnd = 2;
|
||||
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
|
||||
isAbsolute = true;
|
||||
rootEnd = 3;
|
||||
}
|
||||
}
|
||||
if (device.length > 0) {
|
||||
if (resolvedDevice.length > 0) {
|
||||
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
resolvedDevice = device;
|
||||
}
|
||||
}
|
||||
if (resolvedAbsolute) {
|
||||
if (resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
|
||||
resolvedAbsolute = isAbsolute;
|
||||
if (isAbsolute && resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
|
||||
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
|
||||
}
|
||||
function isPosixPathSeparator(code) {
|
||||
return code === CHAR_FORWARD_SLASH;
|
||||
}
|
||||
@@ -381,6 +516,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
||||
return res;
|
||||
}
|
||||
function resolve(...args) {
|
||||
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
|
||||
// below treats `D` as a non-`/` character and produces garbage; route
|
||||
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
|
||||
// run the original code path unchanged — `_isWin32` is constant-folded
|
||||
// away on those targets.
|
||||
if (_isWin32)
|
||||
return resolveWin32(args);
|
||||
let resolvedPath = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||||
@@ -1017,6 +1159,26 @@ function wrapExports(exports, needWrap) {
|
||||
});
|
||||
}
|
||||
|
||||
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
|
||||
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
|
||||
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
|
||||
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
|
||||
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
|
||||
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
|
||||
// Windows — and O_TEMPORARY without O_CREAT is invalid.
|
||||
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
function _toWinOpenFlags(f) {
|
||||
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
|
||||
if ((f & 0x40) !== 0)
|
||||
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
|
||||
if ((f & 0x80) !== 0)
|
||||
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
|
||||
if ((f & 0x200) !== 0)
|
||||
r |= 0x200; // O_TRUNC: same value on both
|
||||
if ((f & 0x400) !== 0)
|
||||
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
|
||||
return r;
|
||||
}
|
||||
function copyMemory(targets, src) {
|
||||
if (targets.length === 0 || src.length === 0)
|
||||
return 0;
|
||||
@@ -2273,7 +2435,7 @@ class WASI$1 {
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = fs.openSync(resolved_path, flagsRes, 0o666);
|
||||
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = wasi.fds.getFileTypeByFd(r);
|
||||
if ((filetype !== 3 /* WasiFileType.DIRECTORY */) &&
|
||||
((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 ||
|
||||
@@ -2309,7 +2471,7 @@ class WASI$1 {
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
|
||||
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = await wasi.fds.getFileTypeByFd(r);
|
||||
if ((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 && filetype !== 3 /* WasiFileType.DIRECTORY */) {
|
||||
return 54 /* WasiErrno.ENOTDIR */;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+164
-2
@@ -312,6 +312,141 @@
|
||||
|
||||
const CHAR_DOT = 46; /* . */
|
||||
const CHAR_FORWARD_SLASH = 47; /* / */
|
||||
const CHAR_BACKWARD_SLASH = 92; /* \ */
|
||||
const CHAR_COLON = 58; /* : */
|
||||
const CHAR_UPPERCASE_A = 65; /* A */
|
||||
const CHAR_UPPERCASE_Z = 90; /* Z */
|
||||
const CHAR_LOWERCASE_A = 97; /* a */
|
||||
const CHAR_LOWERCASE_Z = 122; /* z */
|
||||
function isPathSeparatorWin(code) {
|
||||
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
||||
}
|
||||
function isWindowsDeviceRoot(code) {
|
||||
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
|
||||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
|
||||
}
|
||||
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
/**
|
||||
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
|
||||
* semantics enough for the WASI shim's needs (drive-letter absolutes
|
||||
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
|
||||
*
|
||||
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
|
||||
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
|
||||
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
|
||||
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
|
||||
* is "relative", and produces a garbage joined path. Downstream
|
||||
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
|
||||
* sees a permanent failure. This function gives us the correct
|
||||
* Windows-style resolution without taking a Node-only `path` import
|
||||
* (which would break browser bundles of this package).
|
||||
*
|
||||
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
|
||||
* trimmed to what WASI realpath resolution actually exercises.
|
||||
*/
|
||||
function resolveWin32(args) {
|
||||
let resolvedDevice = '';
|
||||
let resolvedTail = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1; i--) {
|
||||
let path;
|
||||
if (i >= 0) {
|
||||
path = args[i];
|
||||
validateString(path, 'path');
|
||||
if (path.length === 0)
|
||||
continue;
|
||||
}
|
||||
else if (resolvedDevice.length === 0) {
|
||||
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
}
|
||||
else {
|
||||
// Look up per-drive cwd via the `=X:` env var convention; fall back
|
||||
// to the global cwd if absent.
|
||||
const envKey = `=${resolvedDevice}`;
|
||||
const env = (typeof process !== 'undefined') ? process.env : undefined;
|
||||
path = (env && typeof env[envKey] === 'string')
|
||||
? env[envKey]
|
||||
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
if (path === undefined ||
|
||||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
|
||||
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
|
||||
path = `${resolvedDevice}\\`;
|
||||
}
|
||||
}
|
||||
const len = path.length;
|
||||
let rootEnd = 0;
|
||||
let device = '';
|
||||
let isAbsolute = false;
|
||||
const code = path.charCodeAt(0);
|
||||
if (len === 1) {
|
||||
if (isPathSeparatorWin(code)) {
|
||||
rootEnd = 1;
|
||||
isAbsolute = true;
|
||||
}
|
||||
}
|
||||
else if (isPathSeparatorWin(code)) {
|
||||
isAbsolute = true;
|
||||
if (isPathSeparatorWin(path.charCodeAt(1))) {
|
||||
// UNC path: `\\server\share\…`
|
||||
let j = 2;
|
||||
let last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
const firstPart = path.slice(last, j);
|
||||
last = j;
|
||||
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j === len || j !== last) {
|
||||
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
||||
rootEnd = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
rootEnd = 1;
|
||||
}
|
||||
}
|
||||
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
|
||||
device = path.slice(0, 2);
|
||||
rootEnd = 2;
|
||||
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
|
||||
isAbsolute = true;
|
||||
rootEnd = 3;
|
||||
}
|
||||
}
|
||||
if (device.length > 0) {
|
||||
if (resolvedDevice.length > 0) {
|
||||
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
resolvedDevice = device;
|
||||
}
|
||||
}
|
||||
if (resolvedAbsolute) {
|
||||
if (resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
|
||||
resolvedAbsolute = isAbsolute;
|
||||
if (isAbsolute && resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
|
||||
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
|
||||
}
|
||||
function isPosixPathSeparator(code) {
|
||||
return code === CHAR_FORWARD_SLASH;
|
||||
}
|
||||
@@ -387,6 +522,13 @@
|
||||
return res;
|
||||
}
|
||||
function resolve(...args) {
|
||||
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
|
||||
// below treats `D` as a non-`/` character and produces garbage; route
|
||||
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
|
||||
// run the original code path unchanged — `_isWin32` is constant-folded
|
||||
// away on those targets.
|
||||
if (_isWin32)
|
||||
return resolveWin32(args);
|
||||
let resolvedPath = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||||
@@ -1023,6 +1165,26 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
|
||||
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
|
||||
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
|
||||
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
|
||||
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
|
||||
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
|
||||
// Windows — and O_TEMPORARY without O_CREAT is invalid.
|
||||
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
function _toWinOpenFlags(f) {
|
||||
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
|
||||
if ((f & 0x40) !== 0)
|
||||
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
|
||||
if ((f & 0x80) !== 0)
|
||||
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
|
||||
if ((f & 0x200) !== 0)
|
||||
r |= 0x200; // O_TRUNC: same value on both
|
||||
if ((f & 0x400) !== 0)
|
||||
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
|
||||
return r;
|
||||
}
|
||||
function copyMemory(targets, src) {
|
||||
if (targets.length === 0 || src.length === 0)
|
||||
return 0;
|
||||
@@ -2279,7 +2441,7 @@
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = fs.openSync(resolved_path, flagsRes, 0o666);
|
||||
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = wasi.fds.getFileTypeByFd(r);
|
||||
if ((filetype !== 3 /* WasiFileType.DIRECTORY */) &&
|
||||
((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 ||
|
||||
@@ -2315,7 +2477,7 @@
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
|
||||
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = await wasi.fds.getFileTypeByFd(r);
|
||||
if ((o_flags & 2 /* WasiFileControlFlag.O_DIRECTORY */) !== 0 && filetype !== 3 /* WasiFileType.DIRECTORY */) {
|
||||
return 54 /* WasiErrno.ENOTDIR */;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
+142
@@ -4,6 +4,141 @@ exports.relative = exports.resolve = void 0;
|
||||
const util_1 = require("./util");
|
||||
const CHAR_DOT = 46; /* . */
|
||||
const CHAR_FORWARD_SLASH = 47; /* / */
|
||||
const CHAR_BACKWARD_SLASH = 92; /* \ */
|
||||
const CHAR_COLON = 58; /* : */
|
||||
const CHAR_UPPERCASE_A = 65; /* A */
|
||||
const CHAR_UPPERCASE_Z = 90; /* Z */
|
||||
const CHAR_LOWERCASE_A = 97; /* a */
|
||||
const CHAR_LOWERCASE_Z = 122; /* z */
|
||||
function isPathSeparatorWin(code) {
|
||||
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
||||
}
|
||||
function isWindowsDeviceRoot(code) {
|
||||
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
|
||||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
|
||||
}
|
||||
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
/**
|
||||
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
|
||||
* semantics enough for the WASI shim's needs (drive-letter absolutes
|
||||
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
|
||||
*
|
||||
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
|
||||
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
|
||||
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
|
||||
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
|
||||
* is "relative", and produces a garbage joined path. Downstream
|
||||
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
|
||||
* sees a permanent failure. This function gives us the correct
|
||||
* Windows-style resolution without taking a Node-only `path` import
|
||||
* (which would break browser bundles of this package).
|
||||
*
|
||||
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
|
||||
* trimmed to what WASI realpath resolution actually exercises.
|
||||
*/
|
||||
function resolveWin32(args) {
|
||||
let resolvedDevice = '';
|
||||
let resolvedTail = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1; i--) {
|
||||
let path;
|
||||
if (i >= 0) {
|
||||
path = args[i];
|
||||
(0, util_1.validateString)(path, 'path');
|
||||
if (path.length === 0)
|
||||
continue;
|
||||
}
|
||||
else if (resolvedDevice.length === 0) {
|
||||
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
}
|
||||
else {
|
||||
// Look up per-drive cwd via the `=X:` env var convention; fall back
|
||||
// to the global cwd if absent.
|
||||
const envKey = `=${resolvedDevice}`;
|
||||
const env = (typeof process !== 'undefined') ? process.env : undefined;
|
||||
path = (env && typeof env[envKey] === 'string')
|
||||
? env[envKey]
|
||||
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
if (path === undefined ||
|
||||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
|
||||
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
|
||||
path = `${resolvedDevice}\\`;
|
||||
}
|
||||
}
|
||||
const len = path.length;
|
||||
let rootEnd = 0;
|
||||
let device = '';
|
||||
let isAbsolute = false;
|
||||
const code = path.charCodeAt(0);
|
||||
if (len === 1) {
|
||||
if (isPathSeparatorWin(code)) {
|
||||
rootEnd = 1;
|
||||
isAbsolute = true;
|
||||
}
|
||||
}
|
||||
else if (isPathSeparatorWin(code)) {
|
||||
isAbsolute = true;
|
||||
if (isPathSeparatorWin(path.charCodeAt(1))) {
|
||||
// UNC path: `\\server\share\…`
|
||||
let j = 2;
|
||||
let last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
const firstPart = path.slice(last, j);
|
||||
last = j;
|
||||
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j === len || j !== last) {
|
||||
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
||||
rootEnd = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
rootEnd = 1;
|
||||
}
|
||||
}
|
||||
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
|
||||
device = path.slice(0, 2);
|
||||
rootEnd = 2;
|
||||
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
|
||||
isAbsolute = true;
|
||||
rootEnd = 3;
|
||||
}
|
||||
}
|
||||
if (device.length > 0) {
|
||||
if (resolvedDevice.length > 0) {
|
||||
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
resolvedDevice = device;
|
||||
}
|
||||
}
|
||||
if (resolvedAbsolute) {
|
||||
if (resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
|
||||
resolvedAbsolute = isAbsolute;
|
||||
if (isAbsolute && resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
|
||||
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
|
||||
}
|
||||
function isPosixPathSeparator(code) {
|
||||
return code === CHAR_FORWARD_SLASH;
|
||||
}
|
||||
@@ -81,6 +216,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
||||
return res;
|
||||
}
|
||||
function resolve(...args) {
|
||||
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
|
||||
// below treats `D` as a non-`/` character and produces garbage; route
|
||||
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
|
||||
// run the original code path unchanged — `_isWin32` is constant-folded
|
||||
// away on those targets.
|
||||
if (_isWin32)
|
||||
return resolveWin32(args);
|
||||
let resolvedPath = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||||
|
||||
+22
-2
@@ -3,6 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WASI = void 0;
|
||||
const webassembly_1 = require("../webassembly");
|
||||
const path_1 = require("./path");
|
||||
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
|
||||
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
|
||||
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
|
||||
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
|
||||
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
|
||||
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
|
||||
// Windows — and O_TEMPORARY without O_CREAT is invalid.
|
||||
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
function _toWinOpenFlags(f) {
|
||||
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
|
||||
if ((f & 0x40) !== 0)
|
||||
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
|
||||
if ((f & 0x80) !== 0)
|
||||
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
|
||||
if ((f & 0x200) !== 0)
|
||||
r |= 0x200; // O_TRUNC: same value on both
|
||||
if ((f & 0x400) !== 0)
|
||||
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
|
||||
return r;
|
||||
}
|
||||
const types_1 = require("./types");
|
||||
const fd_1 = require("./fd");
|
||||
const error_1 = require("./error");
|
||||
@@ -1266,7 +1286,7 @@ class WASI {
|
||||
const pathString = decoder.decode((0, util_1.unsharedSlice)(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = fs.openSync(resolved_path, flagsRes, 0o666);
|
||||
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = wasi.fds.getFileTypeByFd(r);
|
||||
if ((filetype !== types_1.WasiFileType.DIRECTORY) &&
|
||||
((o_flags & types_1.WasiFileControlFlag.O_DIRECTORY) !== 0 ||
|
||||
@@ -1302,7 +1322,7 @@ class WASI {
|
||||
const pathString = decoder.decode((0, util_1.unsharedSlice)(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
|
||||
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = await wasi.fds.getFileTypeByFd(r);
|
||||
if ((o_flags & types_1.WasiFileControlFlag.O_DIRECTORY) !== 0 && filetype !== types_1.WasiFileType.DIRECTORY) {
|
||||
return types_1.WasiErrno.ENOTDIR;
|
||||
|
||||
+142
@@ -1,6 +1,141 @@
|
||||
import { validateString } from "./util.mjs";
|
||||
const CHAR_DOT = 46; /* . */
|
||||
const CHAR_FORWARD_SLASH = 47; /* / */
|
||||
const CHAR_BACKWARD_SLASH = 92; /* \ */
|
||||
const CHAR_COLON = 58; /* : */
|
||||
const CHAR_UPPERCASE_A = 65; /* A */
|
||||
const CHAR_UPPERCASE_Z = 90; /* Z */
|
||||
const CHAR_LOWERCASE_A = 97; /* a */
|
||||
const CHAR_LOWERCASE_Z = 122; /* z */
|
||||
function isPathSeparatorWin(code) {
|
||||
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
||||
}
|
||||
function isWindowsDeviceRoot(code) {
|
||||
return (code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z) ||
|
||||
(code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z);
|
||||
}
|
||||
const _isWin32 = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
/**
|
||||
* Windows variant of `resolve()`. Mirrors Node's `path.win32.resolve`
|
||||
* semantics enough for the WASI shim's needs (drive-letter absolutes
|
||||
* + UNC paths + per-drive cwd lookups via `process.env`/`process.cwd`).
|
||||
*
|
||||
* Why this is needed: on Windows, `FileDescriptor.realPath` is the
|
||||
* host realpath returned by `fs.realpathSync(realPath, 'utf8')` — the
|
||||
* backslash form `D:\…`. The POSIX-only `resolveImpl` below only
|
||||
* treats `/` as a separator, reads `D` as non-`/`, decides realPath
|
||||
* is "relative", and produces a garbage joined path. Downstream
|
||||
* `fs.openSync(garbage)` then returns `EINVAL` and the WASI caller
|
||||
* sees a permanent failure. This function gives us the correct
|
||||
* Windows-style resolution without taking a Node-only `path` import
|
||||
* (which would break browser bundles of this package).
|
||||
*
|
||||
* Cribbed from Node's `lib/path.js` `win32.resolve()` (MIT-licensed),
|
||||
* trimmed to what WASI realpath resolution actually exercises.
|
||||
*/
|
||||
function resolveWin32(args) {
|
||||
let resolvedDevice = '';
|
||||
let resolvedTail = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1; i--) {
|
||||
let path;
|
||||
if (i >= 0) {
|
||||
path = args[i];
|
||||
validateString(path, 'path');
|
||||
if (path.length === 0)
|
||||
continue;
|
||||
}
|
||||
else if (resolvedDevice.length === 0) {
|
||||
path = (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
}
|
||||
else {
|
||||
// Look up per-drive cwd via the `=X:` env var convention; fall back
|
||||
// to the global cwd if absent.
|
||||
const envKey = `=${resolvedDevice}`;
|
||||
const env = (typeof process !== 'undefined') ? process.env : undefined;
|
||||
path = (env && typeof env[envKey] === 'string')
|
||||
? env[envKey]
|
||||
: (typeof process !== 'undefined' && typeof process.cwd === 'function')
|
||||
? process.cwd()
|
||||
: '';
|
||||
if (path === undefined ||
|
||||
(path.slice(0, 2).toLowerCase() !== resolvedDevice.toLowerCase() &&
|
||||
path.charCodeAt(2) === CHAR_BACKWARD_SLASH)) {
|
||||
path = `${resolvedDevice}\\`;
|
||||
}
|
||||
}
|
||||
const len = path.length;
|
||||
let rootEnd = 0;
|
||||
let device = '';
|
||||
let isAbsolute = false;
|
||||
const code = path.charCodeAt(0);
|
||||
if (len === 1) {
|
||||
if (isPathSeparatorWin(code)) {
|
||||
rootEnd = 1;
|
||||
isAbsolute = true;
|
||||
}
|
||||
}
|
||||
else if (isPathSeparatorWin(code)) {
|
||||
isAbsolute = true;
|
||||
if (isPathSeparatorWin(path.charCodeAt(1))) {
|
||||
// UNC path: `\\server\share\…`
|
||||
let j = 2;
|
||||
let last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
const firstPart = path.slice(last, j);
|
||||
last = j;
|
||||
while (j < len && isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j < len && j !== last) {
|
||||
last = j;
|
||||
while (j < len && !isPathSeparatorWin(path.charCodeAt(j)))
|
||||
j++;
|
||||
if (j === len || j !== last) {
|
||||
device = `\\\\${firstPart}\\${path.slice(last, j)}`;
|
||||
rootEnd = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
rootEnd = 1;
|
||||
}
|
||||
}
|
||||
else if (isWindowsDeviceRoot(code) && path.charCodeAt(1) === CHAR_COLON) {
|
||||
device = path.slice(0, 2);
|
||||
rootEnd = 2;
|
||||
if (len > 2 && isPathSeparatorWin(path.charCodeAt(2))) {
|
||||
isAbsolute = true;
|
||||
rootEnd = 3;
|
||||
}
|
||||
}
|
||||
if (device.length > 0) {
|
||||
if (resolvedDevice.length > 0) {
|
||||
if (device.toLowerCase() !== resolvedDevice.toLowerCase())
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
resolvedDevice = device;
|
||||
}
|
||||
}
|
||||
if (resolvedAbsolute) {
|
||||
if (resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
else {
|
||||
resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
|
||||
resolvedAbsolute = isAbsolute;
|
||||
if (isAbsolute && resolvedDevice.length > 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, '\\', isPathSeparatorWin);
|
||||
return resolvedDevice + (resolvedAbsolute ? '\\' : '') + resolvedTail || '.';
|
||||
}
|
||||
function isPosixPathSeparator(code) {
|
||||
return code === CHAR_FORWARD_SLASH;
|
||||
}
|
||||
@@ -78,6 +213,13 @@ function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
|
||||
return res;
|
||||
}
|
||||
export function resolve(...args) {
|
||||
// On Windows, host paths are `D:\…` style. The POSIX-only resolver
|
||||
// below treats `D` as a non-`/` character and produces garbage; route
|
||||
// to the Windows-aware variant. POSIX hosts (Linux/macOS/browser)
|
||||
// run the original code path unchanged — `_isWin32` is constant-folded
|
||||
// away on those targets.
|
||||
if (_isWin32)
|
||||
return resolveWin32(args);
|
||||
let resolvedPath = '';
|
||||
let resolvedAbsolute = false;
|
||||
for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) {
|
||||
|
||||
+22
-2
@@ -1,5 +1,25 @@
|
||||
import { _WebAssembly } from "../webassembly.mjs";
|
||||
import { resolve } from "./path.mjs";
|
||||
// Linux fcntl flag bits ↔ Windows libuv flag bits. `pathOpen()` builds
|
||||
// `flagsRes` using Linux constants (O_CREAT=0x40, O_EXCL=0x80,
|
||||
// O_APPEND=0x400). Windows libuv expects different bits (O_CREAT=0x100,
|
||||
// O_EXCL=0x400, O_APPEND=0x8). Without translation,
|
||||
// `fs.openSync(path, 0x241 /* L:WRONLY|CREAT|TRUNC */)` is rejected
|
||||
// with EINVAL because Linux's 0x40 happens to mean O_TEMPORARY on
|
||||
// Windows — and O_TEMPORARY without O_CREAT is invalid.
|
||||
const _isWin32Flags = typeof process !== 'undefined' && process.platform === 'win32';
|
||||
function _toWinOpenFlags(f) {
|
||||
let r = f & 3; // RDONLY/WRONLY/RDWR — same on both
|
||||
if ((f & 0x40) !== 0)
|
||||
r |= 0x100; // O_CREAT: Linux 0x40 -> Windows 0x100
|
||||
if ((f & 0x80) !== 0)
|
||||
r |= 0x400; // O_EXCL: Linux 0x80 -> Windows 0x400
|
||||
if ((f & 0x200) !== 0)
|
||||
r |= 0x200; // O_TRUNC: same value on both
|
||||
if ((f & 0x400) !== 0)
|
||||
r |= 0x8; // O_APPEND: Linux 0x400 -> Windows 0x8
|
||||
return r;
|
||||
}
|
||||
import { WasiErrno, WasiRights, FileControlFlag, WasiFileControlFlag, WasiFdFlag, WasiFileType, WasiClockid, WasiFstFlag, WasiEventType, WasiSubclockflags } from "./types.mjs";
|
||||
import { concatBuffer, toFileStat, AsyncTable, SyncTable } from "./fd.mjs";
|
||||
import { WasiError } from "./error.mjs";
|
||||
@@ -1263,7 +1283,7 @@ export class WASI {
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = resolvePathSync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = fs.openSync(resolved_path, flagsRes, 0o666);
|
||||
const r = fs.openSync(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = wasi.fds.getFileTypeByFd(r);
|
||||
if ((filetype !== WasiFileType.DIRECTORY) &&
|
||||
((o_flags & WasiFileControlFlag.O_DIRECTORY) !== 0 ||
|
||||
@@ -1299,7 +1319,7 @@ export class WASI {
|
||||
const pathString = decoder.decode(unsharedSlice(HEAPU8, path, path + path_len));
|
||||
const fs = getFs(this);
|
||||
const resolved_path = await resolvePathAsync(fs, fileDescriptor, pathString, dirflags);
|
||||
const r = await fs.promises.open(resolved_path, flagsRes, 0o666);
|
||||
const r = await fs.promises.open(resolved_path, _isWin32Flags ? _toWinOpenFlags(flagsRes) : flagsRes, 0o666);
|
||||
const filetype = await wasi.fds.getFileTypeByFd(r);
|
||||
if ((o_flags & WasiFileControlFlag.O_DIRECTORY) !== 0 && filetype !== WasiFileType.DIRECTORY) {
|
||||
return WasiErrno.ENOTDIR;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tybys/wasm-util",
|
||||
"version": "0.10.1",
|
||||
"version": "0.10.2",
|
||||
"description": "WASI polyfill for browser and some wasm util",
|
||||
"main": "./lib/cjs/index.js",
|
||||
"module": "./dist/wasm-util.esm-bundler.js",
|
||||
|
||||
+6
-11
@@ -55,18 +55,13 @@ module.exports = class AliasFieldPlugin {
|
||||
descriptionFileData,
|
||||
this.field,
|
||||
);
|
||||
if (raw === null || typeof raw !== "object") {
|
||||
this._fieldDataCache.set(descriptionFileData, NO_FIELD_OBJECT);
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(
|
||||
`Field '${this.field}' doesn't contain a valid alias configuration`,
|
||||
);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
fieldData = /** @type {{ [k: string]: JsonPrimitive }} */ (raw);
|
||||
fieldData =
|
||||
raw === null || typeof raw !== "object"
|
||||
? NO_FIELD_OBJECT
|
||||
: /** @type {{ [k: string]: JsonPrimitive }} */ (raw);
|
||||
this._fieldDataCache.set(descriptionFileData, fieldData);
|
||||
} else if (fieldData === NO_FIELD_OBJECT) {
|
||||
}
|
||||
if (fieldData === NO_FIELD_OBJECT) {
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(
|
||||
`Field '${this.field}' doesn't contain a valid alias configuration`,
|
||||
|
||||
+6
-9
@@ -138,18 +138,15 @@ function aliasResolveHandler(
|
||||
// windows request with native backslashes
|
||||
// (e.g. `C:\\abs\\foo\\baz` against `name: "C:\\abs\\foo"`)
|
||||
// otherwise fails `startsWith("C:\\abs\\foo/")` and is
|
||||
// silently skipped. The `!hasRequestString` branch already
|
||||
// uses `absolutePath`; mirroring it here closes the gap
|
||||
// without changing any existing matches.
|
||||
// silently skipped. Mirroring the `absolutePath` check in
|
||||
// both branches closes the gap without changing any
|
||||
// existing matches.
|
||||
const { absolutePath } = item;
|
||||
const matchRequest =
|
||||
innerRequest === item.name ||
|
||||
(!item.onlyModule &&
|
||||
(hasRequestString
|
||||
? innerRequest.startsWith(item.nameWithSlash) ||
|
||||
(item.absolutePath !== null &&
|
||||
innerRequest.startsWith(item.absolutePath))
|
||||
: item.absolutePath !== null &&
|
||||
innerRequest.startsWith(item.absolutePath)));
|
||||
((hasRequestString && innerRequest.startsWith(item.nameWithSlash)) ||
|
||||
(absolutePath !== null && innerRequest.startsWith(absolutePath))));
|
||||
|
||||
const matchWildcard = !item.onlyModule && item.wildcardPrefix !== null;
|
||||
|
||||
|
||||
+3
-6
@@ -11,6 +11,8 @@ const DescriptionFileUtils = require("./DescriptionFileUtils");
|
||||
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
|
||||
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
|
||||
|
||||
const BACKSLASH_G = /\\/g;
|
||||
|
||||
module.exports = class DescriptionFilePlugin {
|
||||
/**
|
||||
* @param {string | ResolveStepHook} source source
|
||||
@@ -66,15 +68,10 @@ module.exports = class DescriptionFilePlugin {
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
// Normalize the relative path to use POSIX separators. On
|
||||
// POSIX most paths never contain a backslash, so skip the
|
||||
// regex replace when possible — `includes` is one pass,
|
||||
// `replace` with a global regex allocates a lastIndex
|
||||
// state machine.
|
||||
const rawRelative = path.slice(result.directory.length);
|
||||
const relativePath = `.${
|
||||
rawRelative.includes("\\")
|
||||
? rawRelative.replace(/\\/g, "/")
|
||||
? rawRelative.replace(BACKSLASH_G, "/")
|
||||
: rawRelative
|
||||
}`;
|
||||
/** @type {ResolveRequest} */
|
||||
|
||||
+112
-102
@@ -83,112 +83,122 @@ function loadDescriptionFile(
|
||||
resolveContext,
|
||||
callback,
|
||||
) {
|
||||
(function findDescriptionFile() {
|
||||
// Hoist the per-filename iterator and the per-level done callback out
|
||||
// of `findDescriptionFile`. They both close over `directory`, which we
|
||||
// reassign as we walk up the tree, so the same closures keep working
|
||||
// across every level — the previous implementation re-allocated both
|
||||
// arrows on every recursion step, which adds up on deep walks (multiple
|
||||
// `DescriptionFilePlugin` taps per resolve, each climbing several
|
||||
// directories looking for `package.json`).
|
||||
/**
|
||||
* @param {string} filename filename
|
||||
* @param {(err?: null | Error, result?: null | Result) => void} iterCallback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
const iterFilename = (filename, iterCallback) => {
|
||||
const descriptionFilePath = resolver.join(directory, filename);
|
||||
|
||||
/**
|
||||
* @param {(null | Error)=} err error
|
||||
* @param {JsonObject=} resolvedContent content
|
||||
* @returns {void}
|
||||
*/
|
||||
function onJson(err, resolvedContent) {
|
||||
if (err) {
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(
|
||||
`${descriptionFilePath} (directory description file): ${err}`,
|
||||
);
|
||||
} else {
|
||||
err.message = `${descriptionFilePath} (directory description file): ${err}`;
|
||||
}
|
||||
return iterCallback(err);
|
||||
}
|
||||
iterCallback(null, {
|
||||
content: /** @type {JsonObject} */ (resolvedContent),
|
||||
directory,
|
||||
path: descriptionFilePath,
|
||||
});
|
||||
}
|
||||
|
||||
if (resolver.fileSystem.readJson) {
|
||||
resolver.fileSystem.readJson(descriptionFilePath, (err, content) => {
|
||||
if (err) {
|
||||
if (
|
||||
typeof (/** @type {NodeJS.ErrnoException} */ (err).code) !==
|
||||
"undefined"
|
||||
) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(descriptionFilePath);
|
||||
}
|
||||
return iterCallback();
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(descriptionFilePath);
|
||||
}
|
||||
return onJson(err);
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(descriptionFilePath);
|
||||
}
|
||||
onJson(null, content);
|
||||
});
|
||||
} else {
|
||||
resolver.fileSystem.readFile(descriptionFilePath, (err, content) => {
|
||||
if (err) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(descriptionFilePath);
|
||||
}
|
||||
return iterCallback();
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(descriptionFilePath);
|
||||
}
|
||||
|
||||
/** @type {JsonObject | undefined} */
|
||||
let json;
|
||||
|
||||
if (content) {
|
||||
try {
|
||||
json = JSON.parse(content.toString());
|
||||
} catch (/** @type {unknown} */ err_) {
|
||||
return onJson(/** @type {Error} */ (err_));
|
||||
}
|
||||
} else {
|
||||
return onJson(new Error("No content in file"));
|
||||
}
|
||||
|
||||
onJson(null, json);
|
||||
});
|
||||
}
|
||||
};
|
||||
// Forward-declared so the helpers below can reference each other
|
||||
// without falling foul of `no-use-before-define`.
|
||||
/** @type {() => void} */
|
||||
let findDescriptionFile;
|
||||
/**
|
||||
* @param {(null | Error)=} err error
|
||||
* @param {(null | Result)=} result result
|
||||
* @returns {void}
|
||||
*/
|
||||
const onLevelDone = (err, result) => {
|
||||
if (err) return callback(err);
|
||||
if (result) return callback(null, result);
|
||||
const dir = cdUp(directory);
|
||||
if (!dir) {
|
||||
return callback();
|
||||
}
|
||||
directory = dir;
|
||||
return findDescriptionFile();
|
||||
};
|
||||
findDescriptionFile = () => {
|
||||
if (oldInfo && oldInfo.directory === directory) {
|
||||
// We already have info for this directory and can reuse it
|
||||
return callback(null, oldInfo);
|
||||
}
|
||||
forEachBail(
|
||||
filenames,
|
||||
/**
|
||||
* @param {string} filename filename
|
||||
* @param {(err?: null | Error, result?: null | Result) => void} callback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
(filename, callback) => {
|
||||
const descriptionFilePath = resolver.join(directory, filename);
|
||||
|
||||
/**
|
||||
* @param {(null | Error)=} err error
|
||||
* @param {JsonObject=} resolvedContent content
|
||||
* @returns {void}
|
||||
*/
|
||||
function onJson(err, resolvedContent) {
|
||||
if (err) {
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(
|
||||
`${descriptionFilePath} (directory description file): ${err}`,
|
||||
);
|
||||
} else {
|
||||
err.message = `${descriptionFilePath} (directory description file): ${err}`;
|
||||
}
|
||||
return callback(err);
|
||||
}
|
||||
callback(null, {
|
||||
content: /** @type {JsonObject} */ (resolvedContent),
|
||||
directory,
|
||||
path: descriptionFilePath,
|
||||
});
|
||||
}
|
||||
|
||||
if (resolver.fileSystem.readJson) {
|
||||
resolver.fileSystem.readJson(descriptionFilePath, (err, content) => {
|
||||
if (err) {
|
||||
if (
|
||||
typeof (/** @type {NodeJS.ErrnoException} */ (err).code) !==
|
||||
"undefined"
|
||||
) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(descriptionFilePath);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(descriptionFilePath);
|
||||
}
|
||||
return onJson(err);
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(descriptionFilePath);
|
||||
}
|
||||
onJson(null, content);
|
||||
});
|
||||
} else {
|
||||
resolver.fileSystem.readFile(descriptionFilePath, (err, content) => {
|
||||
if (err) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(descriptionFilePath);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(descriptionFilePath);
|
||||
}
|
||||
|
||||
/** @type {JsonObject | undefined} */
|
||||
let json;
|
||||
|
||||
if (content) {
|
||||
try {
|
||||
json = JSON.parse(content.toString());
|
||||
} catch (/** @type {unknown} */ err_) {
|
||||
return onJson(/** @type {Error} */ (err_));
|
||||
}
|
||||
} else {
|
||||
return onJson(new Error("No content in file"));
|
||||
}
|
||||
|
||||
onJson(null, json);
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @param {(null | Error)=} err error
|
||||
* @param {(null | Result)=} result result
|
||||
* @returns {void}
|
||||
*/
|
||||
(err, result) => {
|
||||
if (err) return callback(err);
|
||||
if (result) return callback(null, result);
|
||||
const dir = cdUp(directory);
|
||||
if (!dir) {
|
||||
return callback();
|
||||
}
|
||||
directory = dir;
|
||||
return findDescriptionFile();
|
||||
},
|
||||
);
|
||||
})();
|
||||
forEachBail(filenames, iterFilename, onLevelDone);
|
||||
};
|
||||
findDescriptionFile();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+11
-11
@@ -33,21 +33,21 @@ module.exports = class DirectoryExistsPlugin {
|
||||
const directory = request.path;
|
||||
if (!directory) return callback();
|
||||
fs.stat(directory, (err, stat) => {
|
||||
if (err || !stat) {
|
||||
// Combine the two miss branches: a stat failure and a
|
||||
// "not a directory" result share the same handling — record
|
||||
// the path on `missingDependencies`, log the right reason,
|
||||
// then bail. The error-message ternary picks the wording
|
||||
// that matched the failing condition.
|
||||
if (err || !stat || !stat.isDirectory()) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(directory);
|
||||
}
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(`${directory} doesn't exist`);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
if (!stat.isDirectory()) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(directory);
|
||||
}
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(`${directory} is not a directory`);
|
||||
resolveContext.log(
|
||||
err || !stat
|
||||
? `${directory} doesn't exist`
|
||||
: `${directory} is not a directory`,
|
||||
);
|
||||
}
|
||||
return callback();
|
||||
}
|
||||
|
||||
+2
-2
@@ -151,7 +151,7 @@ module.exports = class ExportsFieldPlugin {
|
||||
|
||||
const [relativePath, query, fragment] = parsedIdentifier;
|
||||
|
||||
if (relativePath.length === 0 || !relativePath.startsWith("./")) {
|
||||
if (!relativePath.startsWith("./")) {
|
||||
if (paths.length === i) {
|
||||
return callback(
|
||||
new Error(
|
||||
@@ -165,7 +165,7 @@ module.exports = class ExportsFieldPlugin {
|
||||
|
||||
const withoutDotSlash = relativePath.slice(2);
|
||||
if (
|
||||
invalidSegmentRegEx.exec(withoutDotSlash) !== null &&
|
||||
invalidSegmentRegEx.test(withoutDotSlash) &&
|
||||
deprecatedInvalidSegmentRegEx.test(withoutDotSlash)
|
||||
) {
|
||||
if (paths.length === i) {
|
||||
|
||||
+12
-8
@@ -31,18 +31,22 @@ module.exports = class FileExistsPlugin {
|
||||
const file = request.path;
|
||||
if (!file) return callback();
|
||||
fs.stat(file, (err, stat) => {
|
||||
if (err || !stat) {
|
||||
// Combine the two miss branches: a stat failure and a
|
||||
// "not a file" result share the same handling — record the
|
||||
// path on `missingDependencies`, log the right reason, then
|
||||
// bail. The error-message ternary picks the wording that
|
||||
// matched the failing condition.
|
||||
if (err || !stat || !stat.isFile()) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(file);
|
||||
}
|
||||
if (resolveContext.log) resolveContext.log(`${file} doesn't exist`);
|
||||
return callback();
|
||||
}
|
||||
if (!stat.isFile()) {
|
||||
if (resolveContext.missingDependencies) {
|
||||
resolveContext.missingDependencies.add(file);
|
||||
if (resolveContext.log) {
|
||||
resolveContext.log(
|
||||
err || !stat
|
||||
? `${file} doesn't exist`
|
||||
: `${file} is not a file`,
|
||||
);
|
||||
}
|
||||
if (resolveContext.log) resolveContext.log(`${file} is not a file`);
|
||||
return callback();
|
||||
}
|
||||
if (resolveContext.fileDependencies) {
|
||||
|
||||
+8
-9
@@ -9,10 +9,7 @@ const DescriptionFileUtils = require("./DescriptionFileUtils");
|
||||
const forEachBail = require("./forEachBail");
|
||||
const { processImportsField } = require("./util/entrypoints");
|
||||
const { parseIdentifier } = require("./util/identifier");
|
||||
const {
|
||||
deprecatedInvalidSegmentRegEx,
|
||||
invalidSegmentRegEx,
|
||||
} = require("./util/path");
|
||||
const { invalidSegmentRegEx } = require("./util/path");
|
||||
|
||||
/** @typedef {import("./Resolver")} Resolver */
|
||||
/** @typedef {import("./Resolver").JsonObject} JsonObject */
|
||||
@@ -67,8 +64,13 @@ module.exports = class ImportsFieldPlugin {
|
||||
}
|
||||
|
||||
const { descriptionFileData } = request;
|
||||
// Skip the concat when there's nothing to append — the common
|
||||
// case has empty query/fragment, so this avoids an allocation
|
||||
// per resolve. Mirrors the pattern in ExportsFieldPlugin.
|
||||
const remainingRequest =
|
||||
request.request + request.query + request.fragment;
|
||||
request.query || request.fragment
|
||||
? request.request + request.query + request.fragment
|
||||
: request.request;
|
||||
|
||||
/** @type {string[]} */
|
||||
let paths;
|
||||
@@ -152,10 +154,7 @@ module.exports = class ImportsFieldPlugin {
|
||||
// should be relative
|
||||
case dotCode: {
|
||||
const withoutDotSlash = path_.slice(2);
|
||||
if (
|
||||
invalidSegmentRegEx.exec(withoutDotSlash) !== null &&
|
||||
deprecatedInvalidSegmentRegEx.test(withoutDotSlash) !== null
|
||||
) {
|
||||
if (invalidSegmentRegEx.test(withoutDotSlash)) {
|
||||
if (paths.length === i) {
|
||||
return callback(
|
||||
new Error(
|
||||
|
||||
+64
-17
@@ -89,6 +89,8 @@ const _withResolvers =
|
||||
/** @type {WeakMap<FileSystem, PathCacheFunctions>} */
|
||||
const _pathCacheByFs = new WeakMap();
|
||||
|
||||
const HASH_ESCAPE_RE = /#/g;
|
||||
|
||||
/** @typedef {import("./ResolverFactory").ResolveOptions} ResolveOptions */
|
||||
|
||||
/**
|
||||
@@ -450,6 +452,16 @@ class StackEntry {
|
||||
/**
|
||||
* Walk the linked list looking for an entry with the same request shape.
|
||||
* Set-compatible: callers that used `stack.has(entry)` keep working.
|
||||
*
|
||||
* NOTE: kept monomorphic on purpose. An earlier draft accepted a string
|
||||
* query too (so pre-5.21 plugins keeping their own `Set<string>` of
|
||||
* seen entries could probe the live stack with the formatted form),
|
||||
* but adding the second shape regressed `doResolve`'s heap profile by
|
||||
* ~1 MiB / 200 resolves on stack-churn — V8 keeps a polymorphic
|
||||
* call-site state for `parent.has(stackEntry)` once `has` has two
|
||||
* argument shapes. Plugins that need string membership can reach for
|
||||
* `[...stack].find(e => e.includes(formattedString))` via the
|
||||
* `String`-method proxies on `StackEntry` instead.
|
||||
* @param {StackEntry} query entry to look for
|
||||
* @returns {boolean} whether the stack already contains an equivalent entry
|
||||
*/
|
||||
@@ -493,7 +505,15 @@ class StackEntry {
|
||||
* `Set` that was populated in insertion order would iterate. Pre-seeded
|
||||
* legacy `Set<string>` entries come first so error-message output stays
|
||||
* ordered oldest-to-newest.
|
||||
* @returns {IterableIterator<StackEntry | string>} iterator
|
||||
*
|
||||
* Yields each entry as its formatted `toString()` form. Plugins written
|
||||
* against the pre-5.21 `Set<string>` shape — e.g.
|
||||
* `[...resolveContext.stack].find(a => a.includes("module:"))` — keep
|
||||
* working unchanged because each yielded value is a plain string with
|
||||
* all of `String.prototype` available natively. Resolves that never
|
||||
* iterate the stack pay nothing; iteration costs one `toString()`
|
||||
* allocation per stack frame.
|
||||
* @returns {IterableIterator<string>} iterator
|
||||
*/
|
||||
*[Symbol.iterator]() {
|
||||
if (this.preSeeded !== undefined) {
|
||||
@@ -507,12 +527,14 @@ class StackEntry {
|
||||
entries.push(node);
|
||||
node = node.parent;
|
||||
}
|
||||
for (let i = entries.length - 1; i >= 0; i--) yield entries[i];
|
||||
for (let i = entries.length - 1; i >= 0; i--) yield entries[i].toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Human-readable form used in recursion error messages and logs.
|
||||
* Matches the historical string format so existing log parsers stay valid.
|
||||
* Human-readable form used in recursion error messages, logs, and the
|
||||
* iterator above. Not memoized: caching would require an extra slot on
|
||||
* every `StackEntry`, which costs heap even on resolves that never look
|
||||
* at the formatted form.
|
||||
* @returns {string} formatted entry
|
||||
*/
|
||||
toString() {
|
||||
@@ -887,16 +909,27 @@ class Resolver {
|
||||
* @param {ResolveRequest} result result
|
||||
* @returns {void}
|
||||
*/
|
||||
const finishResolved = (result) =>
|
||||
callback(
|
||||
const finishResolved = (result) => {
|
||||
const resultPath = result.path;
|
||||
if (resultPath === false) return callback(null, false, result);
|
||||
const escapedPath = resultPath.includes("#")
|
||||
? resultPath.replace(HASH_ESCAPE_RE, "\0#")
|
||||
: resultPath;
|
||||
const resultQuery = result.query;
|
||||
let escapedQuery;
|
||||
if (resultQuery) {
|
||||
escapedQuery = resultQuery.includes("#")
|
||||
? resultQuery.replace(HASH_ESCAPE_RE, "\0#")
|
||||
: resultQuery;
|
||||
} else {
|
||||
escapedQuery = "";
|
||||
}
|
||||
return callback(
|
||||
null,
|
||||
result.path === false
|
||||
? false
|
||||
: `${result.path.replace(/#/g, "\0#")}${
|
||||
result.query ? result.query.replace(/#/g, "\0#") : ""
|
||||
}${result.fragment || ""}`,
|
||||
`${escapedPath}${escapedQuery}${result.fragment || ""}`,
|
||||
result,
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string[]} log logs
|
||||
@@ -1051,9 +1084,7 @@ class Resolver {
|
||||
* @type {Error & { recursion?: boolean }}
|
||||
*/
|
||||
const recursionError = new Error(
|
||||
`Recursion in resolving\nStack:\n ${[...stackEntry]
|
||||
.map((entry) => entry.toString())
|
||||
.join("\n ")}`,
|
||||
`Recursion in resolving\nStack:\n ${[...stackEntry].join("\n ")}`,
|
||||
);
|
||||
recursionError.recursion = true;
|
||||
if (resolveContext.log) {
|
||||
@@ -1106,9 +1137,25 @@ class Resolver {
|
||||
[part.request, part.query, part.fragment] = parsedIdentifier;
|
||||
|
||||
if (part.request.length > 0) {
|
||||
part.internal = this.isPrivate(identifier);
|
||||
part.module = this.isModule(part.request);
|
||||
part.directory = this.isDirectory(part.request);
|
||||
// `getType` looks at the prefix of its input and the prefix is
|
||||
// identical between `identifier` and `part.request` in every
|
||||
// non-`\0`-escape case (slicing off `?query` / `#fragment` doesn't
|
||||
// touch the head). `parseIdentifier`'s common fast path returns
|
||||
// the same `identifier` reference as `parsedIdentifier[0]`, so a
|
||||
// pointer-equality check detects the case where we can compute
|
||||
// `getType` once and use it for both `module` and `internal`. The
|
||||
// `\0#…` escape path produces a fresh `part.request` and falls
|
||||
// through to the second `getType(identifier)` call to preserve
|
||||
// the original `internal` flag.
|
||||
const requestType = getType(part.request);
|
||||
part.module = requestType === PathType.Normal;
|
||||
part.internal =
|
||||
identifier === part.request
|
||||
? requestType === PathType.Internal
|
||||
: getType(identifier) === PathType.Internal;
|
||||
// `isDirectory` is just `endsWith("/")` — inline so `parse()`
|
||||
// doesn't pay for the extra method dispatch on every resolve.
|
||||
part.directory = part.request.endsWith("/");
|
||||
if (part.directory) {
|
||||
part.request = part.request.slice(0, -1);
|
||||
}
|
||||
|
||||
+352
-247
@@ -40,6 +40,14 @@ const { PathType: _PathType, isSubPath, normalize } = require("./util/path");
|
||||
|
||||
const DEFAULT_CONFIG_FILE = "tsconfig.json";
|
||||
|
||||
const READ_JSON_OPTIONS = { stripComments: true };
|
||||
|
||||
// Trailing `/*` or `\*` segment of a tsconfig `paths` mapping (e.g.
|
||||
// `./src/*` → `./src`). Hoisted so we don't allocate a fresh regex per
|
||||
// path entry on every tsconfig load — and so the same regex object can be
|
||||
// reused for the matching `test` + `replace` pair below.
|
||||
const WILDCARD_TAIL_RE = /[/\\]\*$/;
|
||||
|
||||
/**
|
||||
* @param {string} pattern Path pattern
|
||||
* @returns {number} Length of the prefix
|
||||
@@ -89,6 +97,8 @@ function mergeTsconfigs(base, config) {
|
||||
* @returns {string} the path with substituted template
|
||||
*/
|
||||
function substituteConfigDir(pathValue, configDir) {
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
if (!pathValue.includes("${configDir}")) return pathValue;
|
||||
return pathValue.replace(/\$\{configDir\}/g, configDir);
|
||||
}
|
||||
|
||||
@@ -123,16 +133,16 @@ function tsconfigPathsToResolveOptions(configDir, paths, resolver, baseUrl) {
|
||||
|
||||
if (absolutePaths.length > 0) {
|
||||
if (pattern === "*") {
|
||||
modules.push(
|
||||
...absolutePaths
|
||||
.map((dir) => {
|
||||
if (/[/\\]\*$/.test(dir)) {
|
||||
return dir.replace(/[/\\]\*$/, "");
|
||||
}
|
||||
return "";
|
||||
})
|
||||
.filter(Boolean),
|
||||
);
|
||||
// Pull `dir/*` entries directly into `modules` with their
|
||||
// trailing wildcard stripped, skipping anything else. The
|
||||
// previous `.map(...).filter(Boolean)` form allocated two
|
||||
// throwaway arrays plus a spread iterator per `*` mapping.
|
||||
for (let j = 0; j < absolutePaths.length; j++) {
|
||||
const dir = absolutePaths[j];
|
||||
if (WILDCARD_TAIL_RE.test(dir)) {
|
||||
modules.push(dir.replace(WILDCARD_TAIL_RE, ""));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
alias.push({ name: pattern, alias: absolutePaths });
|
||||
}
|
||||
@@ -160,6 +170,32 @@ function getAbsoluteBaseUrl(context, resolver, baseUrl) {
|
||||
return !baseUrl ? context : resolver.join(context, baseUrl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {TsconfigPathsData} main main paths data
|
||||
* @param {string} mainContext main context
|
||||
* @param {{ [baseUrl: string]: TsconfigPathsData }} refs references map
|
||||
* @param {Set<string>} fileDependencies file dependencies
|
||||
* @returns {TsconfigPathsMap} the tsconfig paths map
|
||||
*/
|
||||
function buildTsconfigPathsMap(main, mainContext, refs, fileDependencies) {
|
||||
const allContexts = /** @type {{ [context: string]: TsconfigPathsData }} */ ({
|
||||
[mainContext]: main,
|
||||
...refs,
|
||||
});
|
||||
// Precompute the key list once per tsconfig load. `_selectPathsDataForContext`
|
||||
// runs per resolve and otherwise would call `Object.entries(allContexts)`
|
||||
// each time, allocating a fresh [key, value][] array.
|
||||
const contextList = Object.keys(allContexts);
|
||||
return {
|
||||
main,
|
||||
mainContext,
|
||||
refs,
|
||||
allContexts,
|
||||
contextList,
|
||||
fileDependencies,
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = class TsconfigPathsPlugin {
|
||||
/**
|
||||
* @param {true | string | TsconfigOptions} configFileOrOptions tsconfig file path or options object
|
||||
@@ -214,16 +250,13 @@ module.exports = class TsconfigPathsPlugin {
|
||||
|
||||
resolver
|
||||
.getHook("raw-resolve")
|
||||
.tapAsync(
|
||||
"TsconfigPathsPlugin",
|
||||
async (request, resolveContext, callback) => {
|
||||
try {
|
||||
const tsconfigPathsMap = await this._getTsconfigPathsMap(
|
||||
resolver,
|
||||
request,
|
||||
resolveContext,
|
||||
);
|
||||
|
||||
.tapAsync("TsconfigPathsPlugin", (request, resolveContext, callback) => {
|
||||
this._getTsconfigPathsMap(
|
||||
resolver,
|
||||
request,
|
||||
resolveContext,
|
||||
(err, tsconfigPathsMap) => {
|
||||
if (err) return callback(err);
|
||||
if (!tsconfigPathsMap) return callback();
|
||||
|
||||
const selectedData = this._selectPathsDataForContext(
|
||||
@@ -241,24 +274,19 @@ module.exports = class TsconfigPathsPlugin {
|
||||
resolveContext,
|
||||
callback,
|
||||
);
|
||||
} catch (err) {
|
||||
callback(/** @type {Error} */ (err));
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
resolver
|
||||
.getHook("raw-module")
|
||||
.tapAsync(
|
||||
"TsconfigPathsPlugin",
|
||||
async (request, resolveContext, callback) => {
|
||||
try {
|
||||
const tsconfigPathsMap = await this._getTsconfigPathsMap(
|
||||
resolver,
|
||||
request,
|
||||
resolveContext,
|
||||
);
|
||||
|
||||
.tapAsync("TsconfigPathsPlugin", (request, resolveContext, callback) => {
|
||||
this._getTsconfigPathsMap(
|
||||
resolver,
|
||||
request,
|
||||
resolveContext,
|
||||
(err, tsconfigPathsMap) => {
|
||||
if (err) return callback(err);
|
||||
if (!tsconfigPathsMap) return callback();
|
||||
|
||||
const selectedData = this._selectPathsDataForContext(
|
||||
@@ -276,11 +304,9 @@ module.exports = class TsconfigPathsPlugin {
|
||||
resolveContext,
|
||||
callback,
|
||||
);
|
||||
} catch (err) {
|
||||
callback(/** @type {Error} */ (err));
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -288,43 +314,46 @@ module.exports = class TsconfigPathsPlugin {
|
||||
* @param {Resolver} resolver the resolver
|
||||
* @param {ResolveRequest} request the request
|
||||
* @param {ResolveContext} resolveContext the resolve context
|
||||
* @returns {Promise<TsconfigPathsMap | null>} the tsconfig paths map or null
|
||||
* @param {(err: Error | null, result?: TsconfigPathsMap | null) => void} callback the callback
|
||||
* @returns {void}
|
||||
*/
|
||||
async _getTsconfigPathsMap(resolver, request, resolveContext) {
|
||||
if (typeof request.tsconfigPathsMap === "undefined") {
|
||||
try {
|
||||
const absTsconfigPath = resolver.join(
|
||||
request.path || process.cwd(),
|
||||
this.configFile,
|
||||
);
|
||||
const result = await this._loadTsconfigPathsMap(
|
||||
resolver,
|
||||
absTsconfigPath,
|
||||
);
|
||||
_getTsconfigPathsMap(resolver, request, resolveContext, callback) {
|
||||
if (typeof request.tsconfigPathsMap !== "undefined") {
|
||||
const cached = request.tsconfigPathsMap;
|
||||
if (!cached) return callback(null, null);
|
||||
if (resolveContext.fileDependencies) {
|
||||
for (const fileDependency of cached.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(fileDependency);
|
||||
}
|
||||
}
|
||||
return callback(null, cached);
|
||||
}
|
||||
|
||||
request.tsconfigPathsMap = result;
|
||||
} catch (err) {
|
||||
const absTsconfigPath = resolver.join(
|
||||
request.path || process.cwd(),
|
||||
this.configFile,
|
||||
);
|
||||
this._loadTsconfigPathsMap(resolver, absTsconfigPath, (err, result) => {
|
||||
if (err) {
|
||||
request.tsconfigPathsMap = null;
|
||||
if (
|
||||
this.isAutoConfigFile &&
|
||||
/** @type {NodeJS.ErrnoException} */ (err).code === "ENOENT"
|
||||
) {
|
||||
return null;
|
||||
return callback(null, null);
|
||||
}
|
||||
throw err;
|
||||
return callback(err);
|
||||
}
|
||||
}
|
||||
|
||||
if (!request.tsconfigPathsMap) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (const fileDependency of request.tsconfigPathsMap.fileDependencies) {
|
||||
const map = /** @type {TsconfigPathsMap} */ (result);
|
||||
request.tsconfigPathsMap = map;
|
||||
if (resolveContext.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(fileDependency);
|
||||
for (const fileDependency of map.fileDependencies) {
|
||||
resolveContext.fileDependencies.add(fileDependency);
|
||||
}
|
||||
}
|
||||
}
|
||||
return request.tsconfigPathsMap;
|
||||
callback(null, map);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -332,66 +361,67 @@ module.exports = class TsconfigPathsPlugin {
|
||||
* Includes main project paths and all referenced projects
|
||||
* @param {Resolver} resolver the resolver
|
||||
* @param {string} absTsconfigPath absolute path to tsconfig.json
|
||||
* @returns {Promise<TsconfigPathsMap>} the complete tsconfig paths map
|
||||
* @param {(err: Error | null, result?: TsconfigPathsMap) => void} callback the callback
|
||||
* @returns {void}
|
||||
*/
|
||||
async _loadTsconfigPathsMap(resolver, absTsconfigPath) {
|
||||
_loadTsconfigPathsMap(resolver, absTsconfigPath, callback) {
|
||||
/** @type {Set<string>} */
|
||||
const fileDependencies = new Set();
|
||||
const config = await this._loadTsconfig(
|
||||
|
||||
this._loadTsconfig(
|
||||
resolver,
|
||||
absTsconfigPath,
|
||||
fileDependencies,
|
||||
undefined,
|
||||
(err, config) => {
|
||||
if (err) return callback(err);
|
||||
|
||||
const cfg = /** @type {Tsconfig} */ (config);
|
||||
const compilerOptions = cfg.compilerOptions || {};
|
||||
const mainContext = resolver.dirname(absTsconfigPath);
|
||||
|
||||
const baseUrl =
|
||||
this.baseUrl !== undefined ? this.baseUrl : compilerOptions.baseUrl;
|
||||
|
||||
const main = tsconfigPathsToResolveOptions(
|
||||
mainContext,
|
||||
compilerOptions.paths || {},
|
||||
resolver,
|
||||
baseUrl,
|
||||
);
|
||||
/** @type {{ [baseUrl: string]: TsconfigPathsData }} */
|
||||
const refs = {};
|
||||
|
||||
let referencesToUse = null;
|
||||
if (this.references === "auto") {
|
||||
referencesToUse = cfg.references;
|
||||
} else if (Array.isArray(this.references)) {
|
||||
referencesToUse = this.references;
|
||||
}
|
||||
|
||||
if (!Array.isArray(referencesToUse)) {
|
||||
return callback(
|
||||
null,
|
||||
buildTsconfigPathsMap(main, mainContext, refs, fileDependencies),
|
||||
);
|
||||
}
|
||||
|
||||
this._loadTsconfigReferences(
|
||||
resolver,
|
||||
mainContext,
|
||||
referencesToUse,
|
||||
fileDependencies,
|
||||
refs,
|
||||
(refErr) => {
|
||||
if (refErr) return callback(refErr);
|
||||
callback(
|
||||
null,
|
||||
buildTsconfigPathsMap(main, mainContext, refs, fileDependencies),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
const compilerOptions = config.compilerOptions || {};
|
||||
const mainContext = resolver.dirname(absTsconfigPath);
|
||||
|
||||
const baseUrl =
|
||||
this.baseUrl !== undefined ? this.baseUrl : compilerOptions.baseUrl;
|
||||
|
||||
const main = tsconfigPathsToResolveOptions(
|
||||
mainContext,
|
||||
compilerOptions.paths || {},
|
||||
resolver,
|
||||
baseUrl,
|
||||
);
|
||||
/** @type {{ [baseUrl: string]: TsconfigPathsData }} */
|
||||
const refs = {};
|
||||
|
||||
let referencesToUse = null;
|
||||
if (this.references === "auto") {
|
||||
referencesToUse = config.references;
|
||||
} else if (Array.isArray(this.references)) {
|
||||
referencesToUse = this.references;
|
||||
}
|
||||
|
||||
if (Array.isArray(referencesToUse)) {
|
||||
await this._loadTsconfigReferences(
|
||||
resolver,
|
||||
mainContext,
|
||||
referencesToUse,
|
||||
fileDependencies,
|
||||
refs,
|
||||
);
|
||||
}
|
||||
|
||||
const allContexts =
|
||||
/** @type {{ [context: string]: TsconfigPathsData }} */ ({
|
||||
[mainContext]: main,
|
||||
...refs,
|
||||
});
|
||||
// Precompute the key list once per tsconfig load. `_selectPathsDataForContext`
|
||||
// runs per resolve and otherwise would call `Object.entries(allContexts)`
|
||||
// each time, allocating a fresh [key, value][] array.
|
||||
const contextList = Object.keys(allContexts);
|
||||
return {
|
||||
main,
|
||||
mainContext,
|
||||
refs,
|
||||
allContexts,
|
||||
contextList,
|
||||
fileDependencies,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -406,29 +436,34 @@ module.exports = class TsconfigPathsPlugin {
|
||||
if (!requestPath) {
|
||||
return main;
|
||||
}
|
||||
let longestMatch = null;
|
||||
let longestMatchContext = null;
|
||||
let longestMatchLength = 0;
|
||||
// Iterate over the pre-computed key list + indexed access into
|
||||
// `allContexts` — the previous `Object.entries(allContexts)` form
|
||||
// allocated a fresh `[key, value][]` array on every resolve.
|
||||
// Iterate the pre-computed key list (the previous
|
||||
// `Object.entries(allContexts)` form allocated a fresh
|
||||
// `[key, value][]` per resolve). Defer the `allContexts[context]`
|
||||
// lookup to after we know the context actually matches — non-matches
|
||||
// are the common case and don't need the property access.
|
||||
for (let i = 0; i < contextList.length; i++) {
|
||||
const context = contextList[i];
|
||||
const data = allContexts[context];
|
||||
if (context === requestPath) {
|
||||
return data;
|
||||
return allContexts[context];
|
||||
}
|
||||
// Cheap integer-compare gate first: a context can only beat the
|
||||
// current longest match if its own length is strictly greater.
|
||||
// Skipping `isSubPath` (a `startsWith` + char-code probe) when the
|
||||
// length already disqualifies the candidate avoids the per-resolve
|
||||
// scan over every shorter context.
|
||||
if (
|
||||
isSubPath(context, requestPath) &&
|
||||
context.length > longestMatchLength
|
||||
context.length > longestMatchLength &&
|
||||
isSubPath(context, requestPath)
|
||||
) {
|
||||
longestMatch = data;
|
||||
longestMatchContext = context;
|
||||
longestMatchLength = context.length;
|
||||
}
|
||||
}
|
||||
if (longestMatch) {
|
||||
return longestMatch;
|
||||
}
|
||||
return null;
|
||||
return longestMatchContext === null
|
||||
? null
|
||||
: allContexts[longestMatchContext];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -438,14 +473,16 @@ module.exports = class TsconfigPathsPlugin {
|
||||
* @param {string} extendedConfigValue extends value
|
||||
* @param {Set<string>} fileDependencies the file dependencies
|
||||
* @param {Set<string>} visitedConfigPaths config paths being loaded (for circular extends detection)
|
||||
* @returns {Promise<Tsconfig>} the extended tsconfig
|
||||
* @param {(err: Error | null, result?: Tsconfig) => void} callback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
async _loadTsconfigFromExtends(
|
||||
_loadTsconfigFromExtends(
|
||||
resolver,
|
||||
configFilePath,
|
||||
extendedConfigValue,
|
||||
fileDependencies,
|
||||
visitedConfigPaths,
|
||||
callback,
|
||||
) {
|
||||
const { fileSystem } = resolver;
|
||||
const currentDir = resolver.dirname(configFilePath);
|
||||
@@ -463,60 +500,80 @@ module.exports = class TsconfigPathsPlugin {
|
||||
extendedConfigValue += ".json";
|
||||
}
|
||||
|
||||
let extendedConfigPath = resolver.join(currentDir, extendedConfigValue);
|
||||
|
||||
const exists = await new Promise((resolve) => {
|
||||
fileSystem.readFile(extendedConfigPath, (err) => {
|
||||
resolve(!err);
|
||||
});
|
||||
});
|
||||
if (!exists) {
|
||||
// Handle scoped package extends like "@scope/name" (no sub-path):
|
||||
// "@scope/name" should resolve to node_modules/@scope/name/tsconfig.json,
|
||||
// not node_modules/@scope/name.json
|
||||
// See: test/fixtures/tsconfig-paths/extends-pkg-entry/
|
||||
if (
|
||||
typeof originalExtendedConfigValue === "string" &&
|
||||
originalExtendedConfigValue.startsWith("@") &&
|
||||
originalExtendedConfigValue.split("/").length === 2
|
||||
) {
|
||||
extendedConfigPath = resolver.join(
|
||||
currentDir,
|
||||
normalize(
|
||||
`node_modules/${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`,
|
||||
),
|
||||
);
|
||||
} else if (extendedConfigValue.includes("/")) {
|
||||
// Handle package sub-path extends like "react/tsconfig":
|
||||
// "react/tsconfig" resolves to node_modules/react/tsconfig.json
|
||||
// See: test/fixtures/tsconfig-paths/extends-npm/
|
||||
extendedConfigPath = resolver.join(
|
||||
currentDir,
|
||||
normalize(`node_modules/${extendedConfigValue}`),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const config = await this._loadTsconfig(
|
||||
resolver,
|
||||
extendedConfigPath,
|
||||
fileDependencies,
|
||||
visitedConfigPaths,
|
||||
const initialExtendedConfigPath = resolver.join(
|
||||
currentDir,
|
||||
extendedConfigValue,
|
||||
);
|
||||
const compilerOptions = config.compilerOptions || { baseUrl: undefined };
|
||||
|
||||
if (compilerOptions.baseUrl) {
|
||||
const extendedConfigDir = resolver.dirname(extendedConfigPath);
|
||||
compilerOptions.baseUrl = getAbsoluteBaseUrl(
|
||||
extendedConfigDir,
|
||||
fileSystem.stat(initialExtendedConfigPath, (existsErr) => {
|
||||
let extendedConfigPath = initialExtendedConfigPath;
|
||||
if (existsErr) {
|
||||
// Handle scoped package extends like "@scope/name" (no sub-path):
|
||||
// "@scope/name" should resolve to node_modules/@scope/name/tsconfig.json,
|
||||
// not node_modules/@scope/name.json
|
||||
// See: test/fixtures/tsconfig-paths/extends-pkg-entry/
|
||||
if (
|
||||
typeof originalExtendedConfigValue === "string" &&
|
||||
originalExtendedConfigValue.startsWith("@") &&
|
||||
originalExtendedConfigValue.split("/").length === 2
|
||||
) {
|
||||
extendedConfigPath = resolver.join(
|
||||
currentDir,
|
||||
normalize(
|
||||
`node_modules/${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`,
|
||||
),
|
||||
);
|
||||
} else if (extendedConfigValue.includes("/")) {
|
||||
// Handle package sub-path extends like "react/tsconfig":
|
||||
// "react/tsconfig" resolves to node_modules/react/tsconfig.json
|
||||
// See: test/fixtures/tsconfig-paths/extends-npm/
|
||||
extendedConfigPath = resolver.join(
|
||||
currentDir,
|
||||
normalize(`node_modules/${extendedConfigValue}`),
|
||||
);
|
||||
} else if (
|
||||
!originalExtendedConfigValue.startsWith(".") &&
|
||||
!originalExtendedConfigValue.startsWith("/")
|
||||
) {
|
||||
// Handle unscoped package extends like "my-base-config" (no sub-path):
|
||||
// "my-base-config" should resolve to node_modules/my-base-config/tsconfig.json
|
||||
extendedConfigPath = resolver.join(
|
||||
currentDir,
|
||||
normalize(
|
||||
`node_modules/${originalExtendedConfigValue}/${DEFAULT_CONFIG_FILE}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._loadTsconfig(
|
||||
resolver,
|
||||
compilerOptions.baseUrl,
|
||||
extendedConfigPath,
|
||||
fileDependencies,
|
||||
visitedConfigPaths,
|
||||
(err, config) => {
|
||||
if (err) return callback(err);
|
||||
|
||||
const cfg = /** @type {Tsconfig} */ (config);
|
||||
const compilerOptions = cfg.compilerOptions || {
|
||||
baseUrl: undefined,
|
||||
};
|
||||
|
||||
if (compilerOptions.baseUrl) {
|
||||
const extendedConfigDir = resolver.dirname(extendedConfigPath);
|
||||
compilerOptions.baseUrl = getAbsoluteBaseUrl(
|
||||
extendedConfigDir,
|
||||
resolver,
|
||||
compilerOptions.baseUrl,
|
||||
);
|
||||
}
|
||||
|
||||
delete cfg.references;
|
||||
|
||||
callback(null, cfg);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
delete config.references;
|
||||
|
||||
return /** @type {Tsconfig} */ (config);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -528,58 +585,78 @@ module.exports = class TsconfigPathsPlugin {
|
||||
* @param {TsconfigReference[]} references array of references
|
||||
* @param {Set<string>} fileDependencies the file dependencies
|
||||
* @param {{ [baseUrl: string]: TsconfigPathsData }} referenceMatchMap the map to populate
|
||||
* @returns {Promise<void>}
|
||||
* @param {(err: Error | null) => void} callback callback
|
||||
* @param {Set<string>=} visitedRefPaths visited reference config paths (for circular reference detection)
|
||||
* @returns {void}
|
||||
*/
|
||||
async _loadTsconfigReferences(
|
||||
_loadTsconfigReferences(
|
||||
resolver,
|
||||
context,
|
||||
references,
|
||||
fileDependencies,
|
||||
referenceMatchMap,
|
||||
callback,
|
||||
visitedRefPaths,
|
||||
) {
|
||||
await Promise.all(
|
||||
references.map(async (ref) => {
|
||||
const refPath = substituteConfigDir(ref.path, context);
|
||||
const refConfigPath = resolver.join(
|
||||
resolver.join(context, refPath),
|
||||
DEFAULT_CONFIG_FILE,
|
||||
);
|
||||
if (references.length === 0) return callback(null);
|
||||
|
||||
try {
|
||||
const refConfig = await this._loadTsconfig(
|
||||
resolver,
|
||||
refConfigPath,
|
||||
fileDependencies,
|
||||
);
|
||||
const visited = visitedRefPaths || new Set();
|
||||
let pending = references.length;
|
||||
const finishOne = () => {
|
||||
if (--pending === 0) callback(null);
|
||||
};
|
||||
|
||||
if (refConfig.compilerOptions && refConfig.compilerOptions.paths) {
|
||||
for (const ref of references) {
|
||||
const refPath = substituteConfigDir(ref.path, context);
|
||||
const refConfigPath = resolver.join(
|
||||
resolver.join(context, refPath),
|
||||
DEFAULT_CONFIG_FILE,
|
||||
);
|
||||
|
||||
if (visited.has(refConfigPath)) {
|
||||
finishOne();
|
||||
continue;
|
||||
}
|
||||
visited.add(refConfigPath);
|
||||
|
||||
this._loadTsconfig(
|
||||
resolver,
|
||||
refConfigPath,
|
||||
fileDependencies,
|
||||
undefined,
|
||||
(err, refConfig) => {
|
||||
// Failures are swallowed to match tsconfig-paths-webpack-plugin:
|
||||
// a broken reference must not abort the main project's resolution.
|
||||
if (err) return finishOne();
|
||||
|
||||
const cfg = /** @type {Tsconfig} */ (refConfig);
|
||||
if (cfg.compilerOptions && cfg.compilerOptions.paths) {
|
||||
const refContext = resolver.dirname(refConfigPath);
|
||||
|
||||
referenceMatchMap[refContext] = tsconfigPathsToResolveOptions(
|
||||
refContext,
|
||||
refConfig.compilerOptions.paths || {},
|
||||
cfg.compilerOptions.paths || {},
|
||||
resolver,
|
||||
refConfig.compilerOptions.baseUrl,
|
||||
cfg.compilerOptions.baseUrl,
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
this.references === "auto" &&
|
||||
Array.isArray(refConfig.references)
|
||||
) {
|
||||
await this._loadTsconfigReferences(
|
||||
if (this.references === "auto" && Array.isArray(cfg.references)) {
|
||||
this._loadTsconfigReferences(
|
||||
resolver,
|
||||
resolver.dirname(refConfigPath),
|
||||
refConfig.references,
|
||||
cfg.references,
|
||||
fileDependencies,
|
||||
referenceMatchMap,
|
||||
finishOne,
|
||||
visited,
|
||||
);
|
||||
} else {
|
||||
finishOne();
|
||||
}
|
||||
} catch (_err) {
|
||||
// continue
|
||||
}
|
||||
}),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,55 +664,83 @@ module.exports = class TsconfigPathsPlugin {
|
||||
* @param {Resolver} resolver the resolver
|
||||
* @param {string} configFilePath absolute path to tsconfig.json
|
||||
* @param {Set<string>} fileDependencies the file dependencies
|
||||
* @param {Set<string>=} visitedConfigPaths config paths being loaded (for circular extends detection)
|
||||
* @returns {Promise<Tsconfig>} the merged tsconfig
|
||||
* @param {Set<string> | undefined} visitedConfigPaths config paths being loaded (for circular extends detection)
|
||||
* @param {(err: Error | null, result?: Tsconfig) => void} callback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
async _loadTsconfig(
|
||||
_loadTsconfig(
|
||||
resolver,
|
||||
configFilePath,
|
||||
fileDependencies,
|
||||
visitedConfigPaths = new Set(),
|
||||
visitedConfigPaths,
|
||||
callback,
|
||||
) {
|
||||
if (visitedConfigPaths.has(configFilePath)) {
|
||||
return /** @type {Tsconfig} */ ({});
|
||||
const visited = visitedConfigPaths || new Set();
|
||||
|
||||
if (visited.has(configFilePath)) {
|
||||
return callback(null, /** @type {Tsconfig} */ ({}));
|
||||
}
|
||||
visitedConfigPaths.add(configFilePath);
|
||||
const config = await readJson(resolver.fileSystem, configFilePath, {
|
||||
stripComments: true,
|
||||
});
|
||||
fileDependencies.add(configFilePath);
|
||||
visited.add(configFilePath);
|
||||
|
||||
let result = config;
|
||||
readJson(
|
||||
resolver.fileSystem,
|
||||
configFilePath,
|
||||
READ_JSON_OPTIONS,
|
||||
(err, parsed) => {
|
||||
if (err) return callback(/** @type {Error} */ (err));
|
||||
|
||||
const extendedConfig = config.extends;
|
||||
if (extendedConfig) {
|
||||
let base;
|
||||
const config = /** @type {Tsconfig} */ (parsed);
|
||||
fileDependencies.add(configFilePath);
|
||||
|
||||
if (Array.isArray(extendedConfig)) {
|
||||
base = {};
|
||||
for (const extendedConfigElement of extendedConfig) {
|
||||
const extendedTsconfig = await this._loadTsconfigFromExtends(
|
||||
const extendedConfig = config.extends;
|
||||
if (!extendedConfig) return callback(null, config);
|
||||
|
||||
if (!Array.isArray(extendedConfig)) {
|
||||
this._loadTsconfigFromExtends(
|
||||
resolver,
|
||||
configFilePath,
|
||||
extendedConfigElement,
|
||||
extendedConfig,
|
||||
fileDependencies,
|
||||
visitedConfigPaths,
|
||||
visited,
|
||||
(extErr, extendedTsconfig) => {
|
||||
if (extErr) return callback(extErr);
|
||||
callback(
|
||||
null,
|
||||
mergeTsconfigs(
|
||||
/** @type {Tsconfig} */ (extendedTsconfig),
|
||||
config,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
base = mergeTsconfigs(base, extendedTsconfig);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
base = await this._loadTsconfigFromExtends(
|
||||
resolver,
|
||||
configFilePath,
|
||||
extendedConfig,
|
||||
fileDependencies,
|
||||
visitedConfigPaths,
|
||||
);
|
||||
}
|
||||
|
||||
result = /** @type {Tsconfig} */ (mergeTsconfigs(base, config));
|
||||
}
|
||||
|
||||
return result;
|
||||
/** @type {Tsconfig} */
|
||||
let base = {};
|
||||
let i = 0;
|
||||
const next = () => {
|
||||
if (i >= extendedConfig.length) {
|
||||
return callback(null, mergeTsconfigs(base, config));
|
||||
}
|
||||
this._loadTsconfigFromExtends(
|
||||
resolver,
|
||||
configFilePath,
|
||||
extendedConfig[i++],
|
||||
fileDependencies,
|
||||
visited,
|
||||
(extErr, extendedTsconfig) => {
|
||||
if (extErr) return callback(extErr);
|
||||
base = mergeTsconfigs(
|
||||
base,
|
||||
/** @type {Tsconfig} */ (extendedTsconfig),
|
||||
);
|
||||
next();
|
||||
},
|
||||
);
|
||||
};
|
||||
next();
|
||||
},
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
+48
-61
@@ -78,6 +78,7 @@ const slashCode = "/".charCodeAt(0);
|
||||
const dotCode = ".".charCodeAt(0);
|
||||
const hashCode = "#".charCodeAt(0);
|
||||
const patternRegEx = /\*/g;
|
||||
const DOLLAR_ESCAPE_RE = /\$/g;
|
||||
|
||||
/** @typedef {Record<string, MappingValue>} RecordMapping */
|
||||
|
||||
@@ -139,7 +140,12 @@ function getFieldKeyInfos(field) {
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
const key = keys[i];
|
||||
const patternIndex = key.indexOf("*");
|
||||
const lastStar = patternIndex === -1 ? -1 : key.lastIndexOf("*");
|
||||
// `isValidPattern` is true when the key has at most one `*`. Searching
|
||||
// from `patternIndex + 1` stops as soon as a second `*` is found, so
|
||||
// we avoid the full-string scan that `lastIndexOf` would do — and the
|
||||
// single-star common case finishes in one pass.
|
||||
const isValidPattern =
|
||||
patternIndex === -1 || !key.includes("*", patternIndex + 1);
|
||||
const keyLen = key.length;
|
||||
const endsWithSlash =
|
||||
keyLen > 0 && key.charCodeAt(keyLen - 1) === slashCode;
|
||||
@@ -151,7 +157,7 @@ function getFieldKeyInfos(field) {
|
||||
isLegacySubpath: patternIndex === -1 && endsWithSlash,
|
||||
isPattern: patternIndex !== -1,
|
||||
isSubpathMapping: endsWithSlash,
|
||||
isValidPattern: patternIndex === -1 || lastStar === patternIndex,
|
||||
isValidPattern,
|
||||
};
|
||||
}
|
||||
_fieldKeyInfoCache.set(fieldKey, infos);
|
||||
@@ -286,16 +292,17 @@ function computeFindMatch(request, field) {
|
||||
function findMatch(request, field) {
|
||||
const fieldKey = /** @type {RecordMapping} */ (field);
|
||||
let perRequest = _findMatchCache.get(fieldKey);
|
||||
if (perRequest !== undefined) {
|
||||
const cached = perRequest.get(request);
|
||||
if (cached !== undefined) return cached;
|
||||
// `null` is a valid cached value (= "no match"), so a `get(...)`
|
||||
// that returns undefined could either mean "not cached yet" or
|
||||
// "cached null". Do the explicit `has` only in the undefined case.
|
||||
if (perRequest.has(request)) return null;
|
||||
} else {
|
||||
if (perRequest === undefined) {
|
||||
perRequest = new Map();
|
||||
_findMatchCache.set(fieldKey, perRequest);
|
||||
} else {
|
||||
// `computeFindMatch` only ever returns `MatchTuple | null` — never
|
||||
// `undefined` — and `Map.set(k, null)` then `Map.get(k)` returns
|
||||
// `null`, not `undefined`. So `get(...) === undefined` already
|
||||
// unambiguously means "not cached yet"; one Map lookup is enough,
|
||||
// no follow-up `has` needed to disambiguate "cached null".
|
||||
const cached = perRequest.get(request);
|
||||
if (cached !== undefined) return cached;
|
||||
}
|
||||
|
||||
const result = computeFindMatch(request, field);
|
||||
@@ -303,16 +310,6 @@ function findMatch(request, field) {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {ConditionalMapping | DirectMapping | null} mapping mapping
|
||||
* @returns {boolean} is conditional mapping
|
||||
*/
|
||||
function isConditionalMapping(mapping) {
|
||||
return (
|
||||
mapping !== null && typeof mapping === "object" && !Array.isArray(mapping)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sentinel stored in the conditional-mapping cache for inputs whose walk
|
||||
* returns `null` ("no condition matched"). Using a non-null marker lets the
|
||||
@@ -352,35 +349,22 @@ function computeConditionalMapping(conditionalMapping_, conditionNames) {
|
||||
const lookup = [[conditionalMapping_, cachedKeys(conditionalMapping_), 0]];
|
||||
|
||||
loop: while (lookup.length > 0) {
|
||||
const [mapping, conditions, j] = lookup[lookup.length - 1];
|
||||
const top = lookup[lookup.length - 1];
|
||||
const [mapping, conditions, j] = top;
|
||||
|
||||
for (let i = j; i < conditions.length; i++) {
|
||||
const condition = conditions[i];
|
||||
|
||||
if (condition === "default") {
|
||||
if (condition === "default" || conditionNames.has(condition)) {
|
||||
const innerMapping = mapping[condition];
|
||||
// is nested
|
||||
if (isConditionalMapping(innerMapping)) {
|
||||
const conditionalMapping = /** @type {ConditionalMapping} */ (
|
||||
innerMapping
|
||||
);
|
||||
lookup[lookup.length - 1][2] = i + 1;
|
||||
lookup.push([conditionalMapping, cachedKeys(conditionalMapping), 0]);
|
||||
continue loop;
|
||||
}
|
||||
|
||||
return /** @type {DirectMapping} */ (innerMapping);
|
||||
}
|
||||
|
||||
if (conditionNames.has(condition)) {
|
||||
const innerMapping = mapping[condition];
|
||||
// is nested
|
||||
if (isConditionalMapping(innerMapping)) {
|
||||
const conditionalMapping = /** @type {ConditionalMapping} */ (
|
||||
innerMapping
|
||||
);
|
||||
lookup[lookup.length - 1][2] = i + 1;
|
||||
lookup.push([conditionalMapping, cachedKeys(conditionalMapping), 0]);
|
||||
if (
|
||||
innerMapping !== null &&
|
||||
typeof innerMapping === "object" &&
|
||||
!Array.isArray(innerMapping)
|
||||
) {
|
||||
const nested = /** @type {ConditionalMapping} */ (innerMapping);
|
||||
top[2] = i + 1;
|
||||
lookup.push([nested, cachedKeys(nested), 0]);
|
||||
continue loop;
|
||||
}
|
||||
|
||||
@@ -449,10 +433,10 @@ function targetMapping(
|
||||
let result = mappingTarget;
|
||||
|
||||
if (isPattern) {
|
||||
result = result.replace(
|
||||
patternRegEx,
|
||||
remainingRequest.replace(/\$/g, "$$"),
|
||||
);
|
||||
const escapedRemainder = remainingRequest.includes("$")
|
||||
? remainingRequest.replace(DOLLAR_ESCAPE_RE, "$$")
|
||||
: remainingRequest;
|
||||
result = result.replace(patternRegEx, escapedRemainder);
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -492,7 +476,8 @@ function directMapping(
|
||||
/** @type {string[]} */
|
||||
const targets = [];
|
||||
|
||||
for (const exp of mappingTarget) {
|
||||
for (let i = 0, len = mappingTarget.length; i < len; i++) {
|
||||
const exp = mappingTarget[i];
|
||||
if (typeof exp === "string") {
|
||||
targets.push(
|
||||
targetMapping(
|
||||
@@ -516,14 +501,17 @@ function directMapping(
|
||||
conditionNames,
|
||||
assert,
|
||||
);
|
||||
for (const innerExport of innerExports) {
|
||||
targets.push(innerExport);
|
||||
for (let j = 0, innerLen = innerExports.length; j < innerLen; j++) {
|
||||
targets.push(innerExports[j]);
|
||||
}
|
||||
}
|
||||
|
||||
return targets;
|
||||
}
|
||||
|
||||
/** @type {[string[], null]} */
|
||||
const EMPTY_NO_MATCH = /** @type {[string[], null]} */ ([[], null]);
|
||||
|
||||
/**
|
||||
* @param {ExportsField | ImportsField} field root
|
||||
* @param {(s: string) => string} normalizeRequest Normalize request, for `imports` field it adds `#`, for `exports` field it adds `.` or `./`
|
||||
@@ -538,26 +526,25 @@ function createFieldProcessor(
|
||||
assertTarget,
|
||||
) {
|
||||
return function fieldProcessor(request, conditionNames) {
|
||||
request = assertRequest(request);
|
||||
const match = findMatch(normalizeRequest(assertRequest(request)), field);
|
||||
|
||||
const match = findMatch(normalizeRequest(request), field);
|
||||
|
||||
if (match === null) return [[], null];
|
||||
if (match === null) return EMPTY_NO_MATCH;
|
||||
|
||||
const [mapping, remainingRequest, isSubpathMapping, isPattern, usedField] =
|
||||
match;
|
||||
|
||||
/** @type {DirectMapping | null} */
|
||||
let direct = null;
|
||||
|
||||
if (isConditionalMapping(mapping)) {
|
||||
let direct;
|
||||
if (
|
||||
mapping !== null &&
|
||||
typeof mapping === "object" &&
|
||||
!Array.isArray(mapping)
|
||||
) {
|
||||
direct = conditionalMapping(
|
||||
/** @type {ConditionalMapping} */ (mapping),
|
||||
conditionNames,
|
||||
);
|
||||
|
||||
// matching not found
|
||||
if (direct === null) return [[], null];
|
||||
if (direct === null) return EMPTY_NO_MATCH;
|
||||
} else {
|
||||
direct = /** @type {DirectMapping} */ (mapping);
|
||||
}
|
||||
|
||||
+42
-34
@@ -19,49 +19,57 @@ const stripJsonComments = require("./strip-json-comments");
|
||||
const _stripCommentsCache = new WeakMap();
|
||||
|
||||
/**
|
||||
* Read and parse JSON file (supports JSONC with comments)
|
||||
* @template T
|
||||
* Read and parse JSON file (supports JSONC with comments).
|
||||
* Callback-based so a synchronous `fileSystem` stays synchronous all the
|
||||
* way through — Promise wrapping would defer resolution by a Promise tick
|
||||
* and break `resolveSync` when `tsconfig` is used together with
|
||||
* `useSyncFileSystemCalls: true`.
|
||||
* @param {FileSystem} fileSystem the file system
|
||||
* @param {string} jsonFilePath absolute path to JSON file
|
||||
* @param {ReadJsonOptions} options Options
|
||||
* @returns {Promise<T>} parsed JSON content
|
||||
* @param {(err: NodeJS.ErrnoException | Error | null, content?: JsonObject) => void} callback callback
|
||||
* @returns {void}
|
||||
*/
|
||||
async function readJson(fileSystem, jsonFilePath, options = {}) {
|
||||
function readJson(fileSystem, jsonFilePath, options, callback) {
|
||||
const { stripComments = false } = options;
|
||||
const { readJson } = fileSystem;
|
||||
if (readJson && !stripComments) {
|
||||
return new Promise((resolve, reject) => {
|
||||
readJson(jsonFilePath, (err, content) => {
|
||||
if (err) return reject(err);
|
||||
resolve(/** @type {T} */ (content));
|
||||
});
|
||||
const { readJson: fsReadJson } = fileSystem;
|
||||
if (fsReadJson && !stripComments) {
|
||||
fsReadJson(jsonFilePath, (err, content) => {
|
||||
if (err) return callback(err);
|
||||
callback(null, /** @type {JsonObject} */ (content));
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const buf = await new Promise((resolve, reject) => {
|
||||
fileSystem.readFile(jsonFilePath, (err, data) => {
|
||||
if (err) return reject(err);
|
||||
resolve(data);
|
||||
});
|
||||
fileSystem.readFile(jsonFilePath, (err, data) => {
|
||||
if (err) return callback(err);
|
||||
const buf = /** @type {Buffer} */ (data);
|
||||
|
||||
if (stripComments) {
|
||||
const cached = _stripCommentsCache.get(buf);
|
||||
if (cached !== undefined) return callback(null, cached);
|
||||
}
|
||||
|
||||
let result;
|
||||
try {
|
||||
const jsonText = buf.toString();
|
||||
const jsonWithoutComments = stripComments
|
||||
? stripJsonComments(jsonText, {
|
||||
trailingCommas: true,
|
||||
whitespace: true,
|
||||
})
|
||||
: jsonText;
|
||||
result = JSON.parse(jsonWithoutComments);
|
||||
} catch (parseErr) {
|
||||
return callback(/** @type {Error} */ (parseErr));
|
||||
}
|
||||
|
||||
if (stripComments) {
|
||||
_stripCommentsCache.set(buf, result);
|
||||
}
|
||||
|
||||
callback(null, result);
|
||||
});
|
||||
|
||||
if (stripComments) {
|
||||
const cached = _stripCommentsCache.get(buf);
|
||||
if (cached !== undefined) return /** @type {T} */ (cached);
|
||||
}
|
||||
|
||||
const jsonText = /** @type {string} */ (buf.toString());
|
||||
// Strip comments to support JSONC (e.g., tsconfig.json with comments)
|
||||
const jsonWithoutComments = stripComments
|
||||
? stripJsonComments(jsonText, { trailingCommas: true, whitespace: true })
|
||||
: jsonText;
|
||||
const result = JSON.parse(jsonWithoutComments);
|
||||
|
||||
if (stripComments) {
|
||||
_stripCommentsCache.set(buf, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports.readJson = readJson;
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "enhanced-resolve",
|
||||
"version": "5.21.0",
|
||||
"version": "5.21.2",
|
||||
"description": "Offers a async require.resolve function. It's highly configurable.",
|
||||
"homepage": "http://github.com/webpack/enhanced-resolve",
|
||||
"repository": {
|
||||
|
||||
+13
-2
@@ -1691,6 +1691,15 @@ declare abstract class StackEntry {
|
||||
/**
|
||||
* Walk the linked list looking for an entry with the same request shape.
|
||||
* Set-compatible: callers that used `stack.has(entry)` keep working.
|
||||
* NOTE: kept monomorphic on purpose. An earlier draft accepted a string
|
||||
* query too (so pre-5.21 plugins keeping their own `Set<string>` of
|
||||
* seen entries could probe the live stack with the formatted form),
|
||||
* but adding the second shape regressed `doResolve`'s heap profile by
|
||||
* ~1 MiB / 200 resolves on stack-churn — V8 keeps a polymorphic
|
||||
* call-site state for `parent.has(stackEntry)` once `has` has two
|
||||
* argument shapes. Plugins that need string membership can reach for
|
||||
* `[...stack].find(e => e.includes(formattedString))` via the
|
||||
* `String`-method proxies on `StackEntry` instead.
|
||||
*/
|
||||
has(query: StackEntry): boolean;
|
||||
|
||||
@@ -1700,8 +1709,10 @@ declare abstract class StackEntry {
|
||||
get size(): number;
|
||||
|
||||
/**
|
||||
* Human-readable form used in recursion error messages and logs.
|
||||
* Matches the historical string format so existing log parsers stay valid.
|
||||
* Human-readable form used in recursion error messages, logs, and the
|
||||
* iterator above. Not memoized: caching would require an extra slot on
|
||||
* every `StackEntry`, which costs heap even on resolves that never look
|
||||
* at the formatted form.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
+15
@@ -171,6 +171,9 @@ Add inline source map to transformed source for better debugging.
|
||||
|
||||
Jiti combines module exports with the `default` export using an internal Proxy to improve compatibility with mixed CJS/ESM usage. You can check the current implementation [here](https://github.com/unjs/jiti/blob/main/src/utils.ts#L105).
|
||||
|
||||
> [!WARNING]
|
||||
> This option wraps **all imported modules** in a Proxy, which adds ~25-50ns overhead per property access. For performance-critical hot paths where you access module exports very frequently, consider setting `interopDefault: false` or `JITI_INTEROP_DEFAULT=false`.
|
||||
|
||||
### `alias`
|
||||
|
||||
- Type: Object
|
||||
@@ -181,6 +184,18 @@ You can also pass an object to the environment variable for inline config. Examp
|
||||
|
||||
Custom alias map used to resolve IDs.
|
||||
|
||||
### `tsconfigPaths`
|
||||
|
||||
- Type: Boolean | String
|
||||
- Default: `false`
|
||||
- Environment variable: `JITI_TSCONFIG_PATHS`
|
||||
|
||||
Enable TypeScript [`paths`](https://www.typescriptlang.org/tsconfig/#paths) resolution using [`get-tsconfig`](https://github.com/privatenumber/get-tsconfig).
|
||||
|
||||
- `true`: Auto-discover `tsconfig.json` by walking up from the jiti instance's parent path.
|
||||
- `string`: Explicit path to a `tsconfig.json` file.
|
||||
- `false` (default): Disabled.
|
||||
|
||||
### `nativeModules`
|
||||
|
||||
- Type: Array
|
||||
|
||||
+38
-27
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+57
@@ -236,6 +236,27 @@ export interface JitiOptions {
|
||||
*/
|
||||
tryNative?: boolean;
|
||||
|
||||
/**
|
||||
* Always use a temp file (instead of a `data:` URL) for the ESM
|
||||
* evaluation fallback path.
|
||||
*
|
||||
* jiti automatically falls back to a temp file when the `data:` URL
|
||||
* import fails with `ENAMETOOLONG` — which happens on filesystems with
|
||||
* a strict `NAME_MAX` limit (e.g. ecryptfs-encrypted home directories
|
||||
* on Linux, some macOS configurations) once the base64-encoded source
|
||||
* exceeds the limit. Setting this to `true` forces the temp-file path
|
||||
* up front, skipping the `data:` URL attempt.
|
||||
*
|
||||
* The temp file is written to `{TMP_DIR}/jiti-esm/` and cleaned up
|
||||
* after import.
|
||||
*
|
||||
* Can also be enabled using the `JITI_ESM_EVAL_TEMP_FILE=true`
|
||||
* environment variable.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
esmEvalTempFile?: boolean;
|
||||
|
||||
/**
|
||||
* Enable JSX support Enable JSX support using
|
||||
* {@link https://babeljs.io/docs/babel-plugin-transform-react-jsx | `@babel/plugin-transform-react-jsx`}.
|
||||
@@ -245,6 +266,42 @@ export interface JitiOptions {
|
||||
* @default false
|
||||
*/
|
||||
jsx?: boolean | JSXOptions;
|
||||
|
||||
/**
|
||||
* Virtual modules - pre-loaded module objects that bypass filesystem resolution.
|
||||
* Useful for bundled modules in compiled binaries (e.g., Bun).
|
||||
*
|
||||
* When a module ID matches a key in this map, the corresponding value is
|
||||
* returned directly without any filesystem resolution or transformation.
|
||||
*
|
||||
* @example
|
||||
* ```ts
|
||||
* import * as typebox from "@sinclair/typebox";
|
||||
*
|
||||
* const jiti = createJiti(import.meta.url, {
|
||||
* virtualModules: {
|
||||
* "@sinclair/typebox": typebox,
|
||||
* },
|
||||
* });
|
||||
* ```
|
||||
*/
|
||||
virtualModules?: Record<string, unknown>;
|
||||
|
||||
/**
|
||||
* Enable tsconfig paths resolution.
|
||||
*
|
||||
* - `true`: auto-discover `tsconfig.json` by walking up from the
|
||||
* jiti instance's parent path
|
||||
* - `string`: explicit path to a `tsconfig.json` file
|
||||
* - `false` (default): disabled
|
||||
*
|
||||
* When enabled, jiti uses
|
||||
* {@link https://github.com/privatenumber/get-tsconfig | get-tsconfig}
|
||||
* to resolve TypeScript path aliases defined in `compilerOptions.paths`.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
tsconfigPaths?: boolean | string;
|
||||
}
|
||||
|
||||
interface NodeRequire {
|
||||
|
||||
+56
-43
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "jiti",
|
||||
"version": "2.6.1",
|
||||
"version": "2.7.0",
|
||||
"description": "Runtime typescript and ESM support for Node.js",
|
||||
"repository": "unjs/jiti",
|
||||
"license": "MIT",
|
||||
@@ -24,6 +24,10 @@
|
||||
"types": "./lib/jiti.d.mts",
|
||||
"import": "./lib/jiti-native.mjs"
|
||||
},
|
||||
"./static": {
|
||||
"types": "./lib/jiti.d.mts",
|
||||
"import": "./lib/jiti-static.mjs"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "./lib/jiti.cjs",
|
||||
@@ -36,6 +40,9 @@
|
||||
],
|
||||
"native": [
|
||||
"./lib/jiti.d.mts"
|
||||
],
|
||||
"static": [
|
||||
"./lib/jiti.d.mts"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -50,13 +57,14 @@
|
||||
"scripts": {
|
||||
"bench": "node test/bench.mjs && deno -A test/bench.mjs && bun --bun test/bench.mjs",
|
||||
"build": "pnpm clean && pnpm rspack",
|
||||
"build:rolldown": "pnpm clean && pnpm rolldown -c rolldown.config.mjs",
|
||||
"clean": "rm -rf dist",
|
||||
"dev": "pnpm clean && pnpm rspack --watch",
|
||||
"jiti": "JITI_DEBUG=1 JITI_JSX=1 lib/jiti-cli.mjs",
|
||||
"lint": "eslint . && prettier -c src lib test stubs",
|
||||
"lint:fix": "eslint --fix . && prettier -w src lib test stubs",
|
||||
"prepack": "pnpm build",
|
||||
"release": "pnpm build && pnpm test && changelogen --release --push --publish",
|
||||
"release": "pnpm build && pnpm test && changelogen --release --push && npm publish",
|
||||
"test": "pnpm lint && pnpm test:types && vitest run --coverage && pnpm test:node-register && pnpm test:bun && pnpm test:native",
|
||||
"test:bun": "bun --bun test test/bun",
|
||||
"test:native": "pnpm test:native:bun && pnpm test:native:node && pnpm test:native:deno",
|
||||
@@ -64,70 +72,75 @@
|
||||
"test:native:deno": "deno test -A --no-check test/native/deno.test.ts",
|
||||
"test:native:node": "node --test --experimental-strip-types test/native/node.test.ts",
|
||||
"test:node-register": "JITI_JSX=1 node --test test/node-register.test.mjs",
|
||||
"test:types": "tsc --noEmit"
|
||||
"test:types": "tsgo --noEmit"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.28.4",
|
||||
"@babel/helper-module-imports": "^7.27.1",
|
||||
"@babel/helper-module-transforms": "^7.28.3",
|
||||
"@babel/helper-plugin-utils": "^7.27.1",
|
||||
"@babel/core": "^7.29.0",
|
||||
"@babel/helper-module-imports": "^7.28.6",
|
||||
"@babel/helper-module-transforms": "^7.28.6",
|
||||
"@babel/helper-plugin-utils": "^7.28.6",
|
||||
"@babel/helper-simple-access": "^7.27.1",
|
||||
"@babel/plugin-proposal-decorators": "^7.28.0",
|
||||
"@babel/plugin-proposal-decorators": "^7.29.0",
|
||||
"@babel/plugin-syntax-class-properties": "^7.12.13",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.27.1",
|
||||
"@babel/plugin-syntax-jsx": "^7.27.1",
|
||||
"@babel/plugin-syntax-import-assertions": "^7.28.6",
|
||||
"@babel/plugin-syntax-jsx": "^7.28.6",
|
||||
"@babel/plugin-transform-explicit-resource-management": "^7.28.6",
|
||||
"@babel/plugin-transform-export-namespace-from": "^7.27.1",
|
||||
"@babel/plugin-transform-react-jsx": "^7.27.1",
|
||||
"@babel/plugin-transform-typescript": "^7.28.0",
|
||||
"@babel/preset-typescript": "^7.27.1",
|
||||
"@babel/template": "^7.27.2",
|
||||
"@babel/traverse": "^7.28.4",
|
||||
"@babel/types": "^7.28.4",
|
||||
"@rspack/cli": "^1.5.8",
|
||||
"@rspack/core": "^1.5.8",
|
||||
"@babel/plugin-transform-react-jsx": "^7.28.6",
|
||||
"@babel/plugin-transform-typescript": "^7.28.6",
|
||||
"@babel/preset-typescript": "^7.28.5",
|
||||
"@babel/template": "^7.28.6",
|
||||
"@babel/traverse": "^7.29.0",
|
||||
"@babel/types": "^7.29.0",
|
||||
"@rspack/cli": "^2.0.1",
|
||||
"@rspack/core": "^2.0.1",
|
||||
"@types/babel__core": "^7.20.5",
|
||||
"@types/babel__helper-module-imports": "^7.18.3",
|
||||
"@types/babel__helper-plugin-utils": "^7.10.3",
|
||||
"@types/babel__template": "^7.4.4",
|
||||
"@types/babel__traverse": "^7.28.0",
|
||||
"@types/node": "^24.6.1",
|
||||
"@vitest/coverage-v8": "^3.2.4",
|
||||
"acorn": "^8.15.0",
|
||||
"@types/node": "^25.6.0",
|
||||
"@typescript/native-preview": "7.0.0-dev.20260505.1",
|
||||
"@vitest/coverage-v8": "^4.1.5",
|
||||
"acorn": "^8.16.0",
|
||||
"babel-plugin-parameter-decorator": "^1.0.16",
|
||||
"changelogen": "^0.6.2",
|
||||
"config": "^4.1.1",
|
||||
"config": "^4.4.1",
|
||||
"consola": "^3.4.2",
|
||||
"defu": "^6.1.4",
|
||||
"defu": "^6.1.7",
|
||||
"destr": "^2.0.5",
|
||||
"escape-string-regexp": "^5.0.0",
|
||||
"eslint": "^9.36.0",
|
||||
"eslint-config-unjs": "^0.5.0",
|
||||
"eslint": "^10.3.0",
|
||||
"eslint-config-unjs": "^0.6.2",
|
||||
"estree-walker": "^3.0.3",
|
||||
"etag": "^1.8.1",
|
||||
"fast-glob": "^3.3.3",
|
||||
"get-tsconfig": "^4.14.0",
|
||||
"is-installed-globally": "^1.0.0",
|
||||
"mime": "^4.1.0",
|
||||
"mlly": "^1.8.0",
|
||||
"moment-timezone": "^0.6.0",
|
||||
"nano-jsx": "^0.2.0",
|
||||
"mitata": "^1.0.34",
|
||||
"mlly": "^1.8.2",
|
||||
"moment-timezone": "^0.6.2",
|
||||
"nano-jsx": "^0.2.1",
|
||||
"pathe": "^2.0.3",
|
||||
"pkg-types": "^2.3.0",
|
||||
"preact": "^10.27.2",
|
||||
"preact-render-to-string": "^6.6.2",
|
||||
"prettier": "^3.6.2",
|
||||
"react": "^19.1.1",
|
||||
"react-dom": "^19.1.1",
|
||||
"pkg-types": "^2.3.1",
|
||||
"preact": "^10.29.1",
|
||||
"preact-render-to-string": "^6.6.7",
|
||||
"prettier": "^3.8.3",
|
||||
"react": "^19.2.5",
|
||||
"react-dom": "^19.2.5",
|
||||
"reflect-metadata": "^0.2.2",
|
||||
"solid-js": "^1.9.9",
|
||||
"std-env": "^3.9.0",
|
||||
"terser-webpack-plugin": "^5.3.14",
|
||||
"tinyexec": "^1.0.1",
|
||||
"ts-loader": "^9.5.4",
|
||||
"rolldown": "1.0.0-rc.18",
|
||||
"solid-js": "^1.9.12",
|
||||
"std-env": "^4.1.0",
|
||||
"terser-webpack-plugin": "^5.5.0",
|
||||
"tinyexec": "^1.1.2",
|
||||
"ts-loader": "^9.5.7",
|
||||
"typescript": "^5.9.3",
|
||||
"vitest": "^3.2.4",
|
||||
"vue": "^3.5.22",
|
||||
"vitest": "^4.1.5",
|
||||
"vue": "^3.5.33",
|
||||
"yoctocolors": "^2.1.2",
|
||||
"zod": "^4.1.11"
|
||||
"zod": "^4.4.3"
|
||||
},
|
||||
"packageManager": "pnpm@10.17.1"
|
||||
"packageManager": "pnpm@10.30.3"
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ let Root = require('./root')
|
||||
|
||||
class Processor {
|
||||
constructor(plugins = []) {
|
||||
this.version = '8.5.13'
|
||||
this.version = '8.5.14'
|
||||
this.plugins = this.normalize(plugins)
|
||||
}
|
||||
|
||||
|
||||
+7
-28
@@ -85,23 +85,15 @@ class Stringifier {
|
||||
}
|
||||
|
||||
block(node, start) {
|
||||
let raws = node.raws
|
||||
let between =
|
||||
typeof raws.between !== 'undefined'
|
||||
? raws.between
|
||||
: this.raw(node, 'between', 'beforeOpen')
|
||||
let between = this.raw(node, 'between', 'beforeOpen')
|
||||
this.builder(escapeHTMLInCSS(start + between) + '{', node, 'start')
|
||||
|
||||
let after
|
||||
if (node.nodes && node.nodes.length) {
|
||||
this.body(node)
|
||||
after =
|
||||
typeof raws.after !== 'undefined' ? raws.after : this.raw(node, 'after')
|
||||
after = this.raw(node, 'after')
|
||||
} else {
|
||||
after =
|
||||
typeof raws.after !== 'undefined'
|
||||
? raws.after
|
||||
: this.raw(node, 'after', 'emptyBody')
|
||||
after = this.raw(node, 'after', 'emptyBody')
|
||||
}
|
||||
|
||||
if (after) this.builder(escapeHTMLInCSS(after))
|
||||
@@ -120,34 +112,21 @@ class Stringifier {
|
||||
let isDocument = node.type === 'document'
|
||||
for (let i = 0; i < nodes.length; i++) {
|
||||
let child = nodes[i]
|
||||
let before = child.raws.before
|
||||
if (typeof before === 'undefined') {
|
||||
before = this.raw(child, 'before')
|
||||
}
|
||||
let before = this.raw(child, 'before')
|
||||
if (before) this.builder(isDocument ? before : escapeHTMLInCSS(before))
|
||||
this.stringify(child, last !== i || semicolon)
|
||||
}
|
||||
}
|
||||
|
||||
comment(node) {
|
||||
let raws = node.raws
|
||||
let left =
|
||||
typeof raws.left !== 'undefined'
|
||||
? raws.left
|
||||
: this.raw(node, 'left', 'commentLeft')
|
||||
let right =
|
||||
typeof raws.right !== 'undefined'
|
||||
? raws.right
|
||||
: this.raw(node, 'right', 'commentRight')
|
||||
let left = this.raw(node, 'left', 'commentLeft')
|
||||
let right = this.raw(node, 'right', 'commentRight')
|
||||
this.builder(escapeHTMLInCSS('/*' + left + node.text + right + '*/'), node)
|
||||
}
|
||||
|
||||
decl(node, semicolon) {
|
||||
let raws = node.raws
|
||||
let between =
|
||||
typeof raws.between !== 'undefined'
|
||||
? raws.between
|
||||
: this.raw(node, 'between', 'colon')
|
||||
let between = this.raw(node, 'between', 'colon')
|
||||
|
||||
let string = node.prop + between + this.rawValue(node, 'value')
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "postcss",
|
||||
"version": "8.5.13",
|
||||
"version": "8.5.14",
|
||||
"description": "Tool for transforming styles with JS plugins",
|
||||
"keywords": [
|
||||
"css",
|
||||
|
||||
+6
-6
@@ -1,9 +1,9 @@
|
||||
import { n as onExit, t as watch } from "./shared/watch-Bd8v9ewv.mjs";
|
||||
import { C as version, S as description } from "./shared/bindingify-input-options-DbbBhzky.mjs";
|
||||
import { n as onExit, t as watch } from "./shared/watch-CKLVan1f.mjs";
|
||||
import { C as version, S as description } from "./shared/bindingify-input-options-DQ2Xw70P.mjs";
|
||||
import { t as arraify } from "./shared/misc-DJYbNKZX.mjs";
|
||||
import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-DSxL8qiP.mjs";
|
||||
import { t as rolldown } from "./shared/rolldown-D3JZ9rMt.mjs";
|
||||
import { t as loadConfig } from "./shared/load-config-BoVO31Un.mjs";
|
||||
import { a as getInputCliKeys, i as getCliSchemaInfo, l as styleText, o as getOutputCliKeys, r as logger, s as validateCliOptions } from "./shared/rolldown-build-CorVA9v1.mjs";
|
||||
import { t as rolldown } from "./shared/rolldown-BbNcFBgw.mjs";
|
||||
import { t as loadConfig } from "./shared/load-config-bzR4o9nR.mjs";
|
||||
import path from "node:path";
|
||||
import process$1 from "node:process";
|
||||
import { performance } from "node:perf_hooks";
|
||||
@@ -847,7 +847,7 @@ function getClearScreenFunction(options) {
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region \0@oxc-project+runtime@0.127.0/helpers/usingCtx.js
|
||||
//#region \0@oxc-project+runtime@0.128.0/helpers/usingCtx.js
|
||||
function _usingCtx() {
|
||||
var r = "function" == typeof SuppressedError ? SuppressedError : function(r, e) {
|
||||
var n = Error();
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
import { x as VERSION } from "./shared/bindingify-input-options-DbbBhzky.mjs";
|
||||
import { x as VERSION } from "./shared/bindingify-input-options-DQ2Xw70P.mjs";
|
||||
import { t as defineConfig } from "./shared/define-config-DJOr6Iwt.mjs";
|
||||
import { t as loadConfig } from "./shared/load-config-BoVO31Un.mjs";
|
||||
import { t as loadConfig } from "./shared/load-config-bzR4o9nR.mjs";
|
||||
export { VERSION, defineConfig, loadConfig };
|
||||
|
||||
+8
-8
@@ -1,11 +1,11 @@
|
||||
import { n as __toESM, t as require_binding } from "./shared/binding-BeU_1iEk.mjs";
|
||||
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-CbQQ69gT.mjs";
|
||||
import { o as transformToRollupOutput } from "./shared/bindingify-input-options-DbbBhzky.mjs";
|
||||
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-DSxL8qiP.mjs";
|
||||
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-DL-e8-oE.mjs";
|
||||
import { n as parseSync$1, t as parse$1 } from "./shared/parse-B_ZnWxLZ.mjs";
|
||||
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWasmFallbackPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-C2EWPKW3.mjs";
|
||||
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-CfYpGzid.mjs";
|
||||
import { n as __toESM, t as require_binding } from "./shared/binding-Cf9ARhL0.mjs";
|
||||
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-WerlQkgD.mjs";
|
||||
import { o as transformToRollupOutput } from "./shared/bindingify-input-options-DQ2Xw70P.mjs";
|
||||
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-CorVA9v1.mjs";
|
||||
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-D4ASW9r2.mjs";
|
||||
import { n as parseSync$1, t as parse$1 } from "./shared/parse-PDqEYZcA.mjs";
|
||||
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, m as viteWebWorkerPostPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWasmFallbackPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-CqLClvFc.mjs";
|
||||
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-CxJB93yb.mjs";
|
||||
import { pathToFileURL } from "node:url";
|
||||
//#region src/api/dev/dev-engine.ts
|
||||
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
||||
|
||||
+14
-5
@@ -40,21 +40,30 @@ export class DevRuntime {
|
||||
/**
|
||||
* __esmMin
|
||||
*
|
||||
* @type {<T>(fn: any, res: T) => () => T}
|
||||
* When `dedup` is truthy and `id` is already registered on the runtime,
|
||||
* skip the factory: another lazy blob got there first. HMR patches pass
|
||||
* no `dedup` so they always re-run the factory and replace the registered
|
||||
* exports.
|
||||
*
|
||||
* @type {<T>(id: string, fn: any, dedup: any, res: T) => () => T}
|
||||
* @internal
|
||||
*/
|
||||
createEsmInitializer: <T>(fn: any, res: T) => () => T;
|
||||
createEsmInitializer: <T>(id: string, fn: any, dedup: any, res: T) => () => T;
|
||||
/**
|
||||
* __commonJSMin
|
||||
*
|
||||
* @type {<T extends { exports: any }>(cb: any, mod: { exports: any }) => () => T}
|
||||
* Same dedup gate as createEsmInitializer. With `dedup` truthy and `id`
|
||||
* registered, reuse the registered exports object; otherwise run the
|
||||
* factory.
|
||||
*
|
||||
* @type {<T extends { exports: any }>(id: string, cb: any, dedup: any, mod: { exports: any }, registered: any) => () => T}
|
||||
* @internal
|
||||
*/
|
||||
createCjsInitializer: <T extends {
|
||||
exports: any;
|
||||
}>(cb: any, mod: {
|
||||
}>(id: string, cb: any, dedup: any, mod: {
|
||||
exports: any;
|
||||
}) => () => T;
|
||||
}, registered: any) => () => T;
|
||||
/** @internal */
|
||||
__toESM: any;
|
||||
/** @internal */
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
import { n as __toESM, t as require_binding } from "./shared/binding-BeU_1iEk.mjs";
|
||||
import { n as onExit, t as watch } from "./shared/watch-Bd8v9ewv.mjs";
|
||||
import { a as RolldownMagicString, b as RUNTIME_MODULE_ID, x as VERSION } from "./shared/bindingify-input-options-DbbBhzky.mjs";
|
||||
import { t as rolldown } from "./shared/rolldown-D3JZ9rMt.mjs";
|
||||
import { n as __toESM, t as require_binding } from "./shared/binding-Cf9ARhL0.mjs";
|
||||
import { n as onExit, t as watch } from "./shared/watch-CKLVan1f.mjs";
|
||||
import { a as RolldownMagicString, b as RUNTIME_MODULE_ID, x as VERSION } from "./shared/bindingify-input-options-DQ2Xw70P.mjs";
|
||||
import { t as rolldown } from "./shared/rolldown-BbNcFBgw.mjs";
|
||||
import { t as defineConfig } from "./shared/define-config-DJOr6Iwt.mjs";
|
||||
import { isMainThread } from "node:worker_threads";
|
||||
//#region src/setup.ts
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { n as __toESM, t as require_binding } from "./shared/binding-BeU_1iEk.mjs";
|
||||
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-DbbBhzky.mjs";
|
||||
import { n as __toESM, t as require_binding } from "./shared/binding-Cf9ARhL0.mjs";
|
||||
import { n as PluginContextData, r as bindingifyPlugin } from "./shared/bindingify-input-options-DQ2Xw70P.mjs";
|
||||
import { parentPort, workerData } from "node:worker_threads";
|
||||
//#region src/parallel-plugin-worker.ts
|
||||
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { l as locate, n as error, s as logParseError, t as augmentCodeLocation, u as getCodeFrame } from "./shared/logs-D80CXhvg.mjs";
|
||||
import { n as parseSync, t as parse } from "./shared/parse-B_ZnWxLZ.mjs";
|
||||
import { n as parseSync, t as parse } from "./shared/parse-PDqEYZcA.mjs";
|
||||
//#region src/parse-ast-index.ts
|
||||
function wrap(result, filename, sourceText) {
|
||||
if (result.errors.length > 0) return normalizeParseError(filename, sourceText, result.errors);
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-CbQQ69gT.mjs";
|
||||
import { t as esmExternalRequirePlugin } from "./shared/constructors-C2EWPKW3.mjs";
|
||||
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin } from "./shared/normalize-string-or-regex-WerlQkgD.mjs";
|
||||
import { t as esmExternalRequirePlugin } from "./shared/constructors-CqLClvFc.mjs";
|
||||
//#region src/builtin-plugin/replace-plugin.ts
|
||||
/**
|
||||
* Replaces targeted strings in files while bundling.
|
||||
|
||||
-582
@@ -1,582 +0,0 @@
|
||||
import { createRequire } from "node:module";
|
||||
//#region \0rolldown/runtime.js
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
||||
key = keys[i];
|
||||
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
||||
get: ((k) => from[k]).bind(null, key),
|
||||
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
||||
});
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
||||
value: mod,
|
||||
enumerable: true
|
||||
}) : target, mod));
|
||||
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
||||
//#endregion
|
||||
//#region src/webcontainer-fallback.cjs
|
||||
var require_webcontainer_fallback = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const fs = __require("node:fs");
|
||||
const childProcess = __require("node:child_process");
|
||||
const version = JSON.parse(fs.readFileSync(__require.resolve("rolldown/package.json"), "utf-8")).version;
|
||||
const baseDir = `/tmp/rolldown-${version}`;
|
||||
const bindingEntry = `${baseDir}/node_modules/@rolldown/binding-wasm32-wasi/rolldown-binding.wasi.cjs`;
|
||||
if (!fs.existsSync(bindingEntry)) {
|
||||
const bindingPkg = `@rolldown/binding-wasm32-wasi@${version}`;
|
||||
fs.rmSync(baseDir, {
|
||||
recursive: true,
|
||||
force: true
|
||||
});
|
||||
fs.mkdirSync(baseDir, { recursive: true });
|
||||
console.log(`[rolldown] Downloading ${bindingPkg} on WebContainer...`);
|
||||
childProcess.execFileSync("pnpm", ["i", bindingPkg], {
|
||||
cwd: baseDir,
|
||||
stdio: "inherit"
|
||||
});
|
||||
}
|
||||
module.exports = __require(bindingEntry);
|
||||
}));
|
||||
//#endregion
|
||||
//#region src/binding.cjs
|
||||
var require_binding = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const { readFileSync } = __require("node:fs");
|
||||
let nativeBinding = null;
|
||||
const loadErrors = [];
|
||||
const isMusl = () => {
|
||||
let musl = false;
|
||||
if (process.platform === "linux") {
|
||||
musl = isMuslFromFilesystem();
|
||||
if (musl === null) musl = isMuslFromReport();
|
||||
if (musl === null) musl = isMuslFromChildProcess();
|
||||
}
|
||||
return musl;
|
||||
};
|
||||
const isFileMusl = (f) => f.includes("libc.musl-") || f.includes("ld-musl-");
|
||||
const isMuslFromFilesystem = () => {
|
||||
try {
|
||||
return readFileSync("/usr/bin/ldd", "utf-8").includes("musl");
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
const isMuslFromReport = () => {
|
||||
let report = null;
|
||||
if (typeof process.report?.getReport === "function") {
|
||||
process.report.excludeNetwork = true;
|
||||
report = process.report.getReport();
|
||||
}
|
||||
if (!report) return null;
|
||||
if (report.header && report.header.glibcVersionRuntime) return false;
|
||||
if (Array.isArray(report.sharedObjects)) {
|
||||
if (report.sharedObjects.some(isFileMusl)) return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
const isMuslFromChildProcess = () => {
|
||||
try {
|
||||
return __require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
function requireNative() {
|
||||
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) try {
|
||||
return __require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
|
||||
} catch (err) {
|
||||
loadErrors.push(err);
|
||||
}
|
||||
else if (process.platform === "android") if (process.arch === "arm64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.android-arm64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-android-arm64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-android-arm64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "arm") {
|
||||
try {
|
||||
return __require("./rolldown-binding.android-arm-eabi.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-android-arm-eabi");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-android-arm-eabi/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Android ${process.arch}`));
|
||||
else if (process.platform === "win32") if (process.arch === "x64") if (process.config?.variables?.shlib_suffix === "dll.a" || process.config?.variables?.node_target_type === "shared_library") {
|
||||
try {
|
||||
return __require("./rolldown-binding.win32-x64-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-win32-x64-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return __require("./rolldown-binding.win32-x64-msvc.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-win32-x64-msvc");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-win32-x64-msvc/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
}
|
||||
else if (process.arch === "ia32") {
|
||||
try {
|
||||
return __require("./rolldown-binding.win32-ia32-msvc.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-win32-ia32-msvc");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-win32-ia32-msvc/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "arm64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.win32-arm64-msvc.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-win32-arm64-msvc");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-win32-arm64-msvc/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
||||
else if (process.platform === "darwin") {
|
||||
try {
|
||||
return __require("./rolldown-binding.darwin-universal.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-darwin-universal");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-darwin-universal/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
if (process.arch === "x64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.darwin-x64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-darwin-x64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-darwin-x64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "arm64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.darwin-arm64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-darwin-arm64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-darwin-arm64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
||||
} else if (process.platform === "freebsd") if (process.arch === "x64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.freebsd-x64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-freebsd-x64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-freebsd-x64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "arm64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.freebsd-arm64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-freebsd-arm64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-freebsd-arm64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
||||
else if (process.platform === "linux") if (process.arch === "x64") if (isMusl()) {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-x64-musl.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-x64-musl");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-musl/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return __require("../rolldown-binding.linux-x64-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-x64-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-x64-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
}
|
||||
else if (process.arch === "arm64") if (isMusl()) {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-arm64-musl.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-arm64-musl");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-musl/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-arm64-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-arm64-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-arm64-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
}
|
||||
else if (process.arch === "arm") if (isMusl()) {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-arm-musleabihf.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-arm-musleabihf");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-musleabihf/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-arm-gnueabihf.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-arm-gnueabihf");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-arm-gnueabihf/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
}
|
||||
else if (process.arch === "loong64") if (isMusl()) {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-loong64-musl.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-loong64-musl");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-musl/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-loong64-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-loong64-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-loong64-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
}
|
||||
else if (process.arch === "riscv64") if (isMusl()) {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-riscv64-musl.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-riscv64-musl");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-musl/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-riscv64-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-riscv64-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-riscv64-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
}
|
||||
else if (process.arch === "ppc64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-ppc64-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-ppc64-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-ppc64-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "s390x") {
|
||||
try {
|
||||
return __require("./rolldown-binding.linux-s390x-gnu.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-linux-s390x-gnu");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-linux-s390x-gnu/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
||||
else if (process.platform === "openharmony") if (process.arch === "arm64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.openharmony-arm64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-openharmony-arm64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "x64") {
|
||||
try {
|
||||
return __require("./rolldown-binding.openharmony-x64.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-openharmony-x64");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-openharmony-x64/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else if (process.arch === "arm") {
|
||||
try {
|
||||
return __require("./rolldown-binding.openharmony-arm.node");
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
try {
|
||||
const binding = __require("@rolldown/binding-openharmony-arm");
|
||||
const bindingPackageVersion = __require("@rolldown/binding-openharmony-arm/package.json").version;
|
||||
if (bindingPackageVersion !== "1.0.0-rc.17" && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0") throw new Error(`Native binding package version mismatch, expected 1.0.0-rc.17 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`);
|
||||
return binding;
|
||||
} catch (e) {
|
||||
loadErrors.push(e);
|
||||
}
|
||||
} else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
||||
else loadErrors.push(/* @__PURE__ */ new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
||||
}
|
||||
nativeBinding = requireNative();
|
||||
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
||||
let wasiBinding = null;
|
||||
let wasiBindingError = null;
|
||||
try {
|
||||
wasiBinding = __require("../rolldown-binding.wasi.cjs");
|
||||
nativeBinding = wasiBinding;
|
||||
} catch (err) {
|
||||
if (process.env.NAPI_RS_FORCE_WASI) wasiBindingError = err;
|
||||
}
|
||||
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) try {
|
||||
wasiBinding = __require("@rolldown/binding-wasm32-wasi");
|
||||
nativeBinding = wasiBinding;
|
||||
} catch (err) {
|
||||
if (process.env.NAPI_RS_FORCE_WASI) {
|
||||
if (!wasiBindingError) wasiBindingError = err;
|
||||
else wasiBindingError.cause = err;
|
||||
loadErrors.push(err);
|
||||
}
|
||||
}
|
||||
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
||||
const error = /* @__PURE__ */ new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
||||
error.cause = wasiBindingError;
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
if (!nativeBinding && globalThis.process?.versions?.["webcontainer"]) try {
|
||||
nativeBinding = require_webcontainer_fallback();
|
||||
} catch (err) {
|
||||
loadErrors.push(err);
|
||||
}
|
||||
if (!nativeBinding) {
|
||||
if (loadErrors.length > 0) throw new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.", { cause: loadErrors.reduce((err, cur) => {
|
||||
cur.cause = err;
|
||||
return cur;
|
||||
}) });
|
||||
throw new Error(`Failed to load native binding`);
|
||||
}
|
||||
module.exports = nativeBinding;
|
||||
module.exports.minify = nativeBinding.minify;
|
||||
module.exports.minifySync = nativeBinding.minifySync;
|
||||
module.exports.Severity = nativeBinding.Severity;
|
||||
module.exports.ParseResult = nativeBinding.ParseResult;
|
||||
module.exports.ExportExportNameKind = nativeBinding.ExportExportNameKind;
|
||||
module.exports.ExportImportNameKind = nativeBinding.ExportImportNameKind;
|
||||
module.exports.ExportLocalNameKind = nativeBinding.ExportLocalNameKind;
|
||||
module.exports.ImportNameKind = nativeBinding.ImportNameKind;
|
||||
module.exports.parse = nativeBinding.parse;
|
||||
module.exports.parseSync = nativeBinding.parseSync;
|
||||
module.exports.rawTransferSupported = nativeBinding.rawTransferSupported;
|
||||
module.exports.ResolverFactory = nativeBinding.ResolverFactory;
|
||||
module.exports.EnforceExtension = nativeBinding.EnforceExtension;
|
||||
module.exports.ModuleType = nativeBinding.ModuleType;
|
||||
module.exports.sync = nativeBinding.sync;
|
||||
module.exports.HelperMode = nativeBinding.HelperMode;
|
||||
module.exports.isolatedDeclaration = nativeBinding.isolatedDeclaration;
|
||||
module.exports.isolatedDeclarationSync = nativeBinding.isolatedDeclarationSync;
|
||||
module.exports.moduleRunnerTransform = nativeBinding.moduleRunnerTransform;
|
||||
module.exports.moduleRunnerTransformSync = nativeBinding.moduleRunnerTransformSync;
|
||||
module.exports.transform = nativeBinding.transform;
|
||||
module.exports.transformSync = nativeBinding.transformSync;
|
||||
module.exports.BindingBundleEndEventData = nativeBinding.BindingBundleEndEventData;
|
||||
module.exports.BindingBundleErrorEventData = nativeBinding.BindingBundleErrorEventData;
|
||||
module.exports.BindingBundler = nativeBinding.BindingBundler;
|
||||
module.exports.BindingCallableBuiltinPlugin = nativeBinding.BindingCallableBuiltinPlugin;
|
||||
module.exports.BindingChunkingContext = nativeBinding.BindingChunkingContext;
|
||||
module.exports.BindingDecodedMap = nativeBinding.BindingDecodedMap;
|
||||
module.exports.BindingDevEngine = nativeBinding.BindingDevEngine;
|
||||
module.exports.BindingLoadPluginContext = nativeBinding.BindingLoadPluginContext;
|
||||
module.exports.BindingMagicString = nativeBinding.BindingMagicString;
|
||||
module.exports.BindingModuleInfo = nativeBinding.BindingModuleInfo;
|
||||
module.exports.BindingNormalizedOptions = nativeBinding.BindingNormalizedOptions;
|
||||
module.exports.BindingOutputAsset = nativeBinding.BindingOutputAsset;
|
||||
module.exports.BindingOutputChunk = nativeBinding.BindingOutputChunk;
|
||||
module.exports.BindingPluginContext = nativeBinding.BindingPluginContext;
|
||||
module.exports.BindingRenderedChunk = nativeBinding.BindingRenderedChunk;
|
||||
module.exports.BindingRenderedChunkMeta = nativeBinding.BindingRenderedChunkMeta;
|
||||
module.exports.BindingRenderedModule = nativeBinding.BindingRenderedModule;
|
||||
module.exports.BindingSourceMap = nativeBinding.BindingSourceMap;
|
||||
module.exports.BindingTransformPluginContext = nativeBinding.BindingTransformPluginContext;
|
||||
module.exports.BindingWatcher = nativeBinding.BindingWatcher;
|
||||
module.exports.BindingWatcherBundler = nativeBinding.BindingWatcherBundler;
|
||||
module.exports.BindingWatcherChangeData = nativeBinding.BindingWatcherChangeData;
|
||||
module.exports.BindingWatcherEvent = nativeBinding.BindingWatcherEvent;
|
||||
module.exports.ParallelJsPluginRegistry = nativeBinding.ParallelJsPluginRegistry;
|
||||
module.exports.ScheduledBuild = nativeBinding.ScheduledBuild;
|
||||
module.exports.TraceSubscriberGuard = nativeBinding.TraceSubscriberGuard;
|
||||
module.exports.TsconfigCache = nativeBinding.TsconfigCache;
|
||||
module.exports.BindingAttachDebugInfo = nativeBinding.BindingAttachDebugInfo;
|
||||
module.exports.BindingBuiltinPluginName = nativeBinding.BindingBuiltinPluginName;
|
||||
module.exports.BindingChunkModuleOrderBy = nativeBinding.BindingChunkModuleOrderBy;
|
||||
module.exports.BindingLogLevel = nativeBinding.BindingLogLevel;
|
||||
module.exports.BindingPluginOrder = nativeBinding.BindingPluginOrder;
|
||||
module.exports.BindingPropertyReadSideEffects = nativeBinding.BindingPropertyReadSideEffects;
|
||||
module.exports.BindingPropertyWriteSideEffects = nativeBinding.BindingPropertyWriteSideEffects;
|
||||
module.exports.BindingRebuildStrategy = nativeBinding.BindingRebuildStrategy;
|
||||
module.exports.collapseSourcemaps = nativeBinding.collapseSourcemaps;
|
||||
module.exports.enhancedTransform = nativeBinding.enhancedTransform;
|
||||
module.exports.enhancedTransformSync = nativeBinding.enhancedTransformSync;
|
||||
module.exports.FilterTokenKind = nativeBinding.FilterTokenKind;
|
||||
module.exports.initTraceSubscriber = nativeBinding.initTraceSubscriber;
|
||||
module.exports.registerPlugins = nativeBinding.registerPlugins;
|
||||
module.exports.resolveTsconfig = nativeBinding.resolveTsconfig;
|
||||
module.exports.shutdownAsyncRuntime = nativeBinding.shutdownAsyncRuntime;
|
||||
module.exports.startAsyncRuntime = nativeBinding.startAsyncRuntime;
|
||||
}));
|
||||
//#endregion
|
||||
export { __toESM as n, require_binding as t };
|
||||
-2211
File diff suppressed because it is too large
Load Diff
-68
@@ -1,68 +0,0 @@
|
||||
import { a as makeBuiltinPluginCallable, n as BuiltinPlugin, t as normalizedStringOrRegex } from "./normalize-string-or-regex-CbQQ69gT.mjs";
|
||||
//#region src/builtin-plugin/constructors.ts
|
||||
function viteModulePreloadPolyfillPlugin(config) {
|
||||
return new BuiltinPlugin("builtin:vite-module-preload-polyfill", config);
|
||||
}
|
||||
function viteDynamicImportVarsPlugin(config) {
|
||||
if (config) {
|
||||
config.include = normalizedStringOrRegex(config.include);
|
||||
config.exclude = normalizedStringOrRegex(config.exclude);
|
||||
}
|
||||
return new BuiltinPlugin("builtin:vite-dynamic-import-vars", config);
|
||||
}
|
||||
function viteImportGlobPlugin(config) {
|
||||
return new BuiltinPlugin("builtin:vite-import-glob", config);
|
||||
}
|
||||
function viteReporterPlugin(config) {
|
||||
return new BuiltinPlugin("builtin:vite-reporter", config);
|
||||
}
|
||||
function viteWasmFallbackPlugin() {
|
||||
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-wasm-fallback"));
|
||||
}
|
||||
function viteLoadFallbackPlugin() {
|
||||
return new BuiltinPlugin("builtin:vite-load-fallback");
|
||||
}
|
||||
function viteJsonPlugin(config) {
|
||||
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-json", config));
|
||||
}
|
||||
function viteBuildImportAnalysisPlugin(config) {
|
||||
return new BuiltinPlugin("builtin:vite-build-import-analysis", config);
|
||||
}
|
||||
function viteResolvePlugin(config) {
|
||||
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-resolve", {
|
||||
...config,
|
||||
yarnPnp: typeof process === "object" && !!process.versions?.pnp
|
||||
}));
|
||||
}
|
||||
function isolatedDeclarationPlugin(config) {
|
||||
return new BuiltinPlugin("builtin:isolated-declaration", config);
|
||||
}
|
||||
function viteWebWorkerPostPlugin() {
|
||||
return new BuiltinPlugin("builtin:vite-web-worker-post");
|
||||
}
|
||||
/**
|
||||
* A plugin that converts CommonJS require() calls for external dependencies into ESM import statements.
|
||||
*
|
||||
* @see https://rolldown.rs/builtin-plugins/esm-external-require
|
||||
* @category Builtin Plugins
|
||||
*/
|
||||
function esmExternalRequirePlugin(config) {
|
||||
const plugin = new BuiltinPlugin("builtin:esm-external-require", config);
|
||||
plugin.enforce = "pre";
|
||||
return plugin;
|
||||
}
|
||||
/**
|
||||
* This plugin should not be used for Rolldown.
|
||||
*/
|
||||
function oxcRuntimePlugin() {
|
||||
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:oxc-runtime"));
|
||||
}
|
||||
function viteReactRefreshWrapperPlugin(config) {
|
||||
if (config) {
|
||||
config.include = normalizedStringOrRegex(config.include);
|
||||
config.exclude = normalizedStringOrRegex(config.exclude);
|
||||
}
|
||||
return makeBuiltinPluginCallable(new BuiltinPlugin("builtin:vite-react-refresh-wrapper", config));
|
||||
}
|
||||
//#endregion
|
||||
export { viteDynamicImportVarsPlugin as a, viteLoadFallbackPlugin as c, viteReporterPlugin as d, viteResolvePlugin as f, viteBuildImportAnalysisPlugin as i, viteModulePreloadPolyfillPlugin as l, viteWebWorkerPostPlugin as m, isolatedDeclarationPlugin as n, viteImportGlobPlugin as o, viteWasmFallbackPlugin as p, oxcRuntimePlugin as r, viteJsonPlugin as s, esmExternalRequirePlugin as t, viteReactRefreshWrapperPlugin as u };
|
||||
-85
@@ -1,85 +0,0 @@
|
||||
import { t as require_binding } from "./binding-BeU_1iEk.mjs";
|
||||
//#region src/types/sourcemap.ts
|
||||
function bindingifySourcemap(map) {
|
||||
if (map == null) return;
|
||||
return { inner: typeof map === "string" ? map : {
|
||||
file: map.file ?? void 0,
|
||||
mappings: map.mappings,
|
||||
sourceRoot: "sourceRoot" in map ? map.sourceRoot ?? void 0 : void 0,
|
||||
sources: map.sources?.map((s) => s ?? void 0),
|
||||
sourcesContent: map.sourcesContent?.map((s) => s ?? void 0),
|
||||
names: map.names,
|
||||
x_google_ignoreList: map.x_google_ignoreList,
|
||||
debugId: "debugId" in map ? map.debugId : void 0
|
||||
} };
|
||||
}
|
||||
require_binding();
|
||||
function unwrapBindingResult(container) {
|
||||
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) throw aggregateBindingErrorsIntoJsError(container.errors);
|
||||
return container;
|
||||
}
|
||||
function normalizeBindingResult(container) {
|
||||
if (typeof container === "object" && container !== null && "isBindingErrors" in container && container.isBindingErrors) return aggregateBindingErrorsIntoJsError(container.errors);
|
||||
return container;
|
||||
}
|
||||
function normalizeBindingError(e) {
|
||||
return e.type === "JsError" ? e.field0 : Object.assign(/* @__PURE__ */ new Error(), {
|
||||
code: e.field0.kind,
|
||||
kind: e.field0.kind,
|
||||
message: e.field0.message,
|
||||
id: e.field0.id,
|
||||
exporter: e.field0.exporter,
|
||||
loc: e.field0.loc,
|
||||
pos: e.field0.pos,
|
||||
stack: void 0
|
||||
});
|
||||
}
|
||||
function aggregateBindingErrorsIntoJsError(rawErrors) {
|
||||
const errors = rawErrors.map(normalizeBindingError);
|
||||
let summary = `Build failed with ${errors.length} error${errors.length < 2 ? "" : "s"}:\n`;
|
||||
for (let i = 0; i < errors.length; i++) {
|
||||
summary += "\n";
|
||||
if (i >= 5) {
|
||||
summary += "...";
|
||||
break;
|
||||
}
|
||||
summary += getErrorMessage(errors[i]);
|
||||
}
|
||||
const wrapper = new Error(summary);
|
||||
Object.defineProperty(wrapper, "errors", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
get: () => errors,
|
||||
set: (value) => Object.defineProperty(wrapper, "errors", {
|
||||
configurable: true,
|
||||
enumerable: true,
|
||||
value
|
||||
})
|
||||
});
|
||||
return wrapper;
|
||||
}
|
||||
function getErrorMessage(e) {
|
||||
if (Object.hasOwn(e, "kind")) return e.message;
|
||||
let s = "";
|
||||
if (e.plugin) s += `[plugin ${e.plugin}]`;
|
||||
const id = e.id ?? e.loc?.file;
|
||||
if (id) {
|
||||
s += " " + id;
|
||||
if (e.loc) s += `:${e.loc.line}:${e.loc.column}`;
|
||||
}
|
||||
if (s) s += "\n";
|
||||
const message = `${e.name ?? "Error"}: ${e.message}`;
|
||||
s += message;
|
||||
if (e.frame) s = joinNewLine(s, e.frame);
|
||||
if (e.stack) s = joinNewLine(s, e.stack.replace(message, ""));
|
||||
if (e.cause) {
|
||||
s = joinNewLine(s, "Caused by:");
|
||||
s = joinNewLine(s, getErrorMessage(e.cause).split("\n").map((line) => " " + line).join("\n"));
|
||||
}
|
||||
return s;
|
||||
}
|
||||
function joinNewLine(s1, s2) {
|
||||
return s1.replace(/\n+$/, "") + "\n" + s2.replace(/^\n+/, "");
|
||||
}
|
||||
//#endregion
|
||||
export { bindingifySourcemap as a, unwrapBindingResult as i, normalizeBindingError as n, normalizeBindingResult as r, aggregateBindingErrorsIntoJsError as t };
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
import { t as rolldown } from "./rolldown-D3JZ9rMt.mjs";
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { readdir } from "node:fs/promises";
|
||||
import { cwd } from "node:process";
|
||||
import { pathToFileURL } from "node:url";
|
||||
//#region src/utils/load-config.ts
|
||||
async function bundleTsConfig(configFile, isEsm) {
|
||||
const dirnameVarName = "injected_original_dirname";
|
||||
const filenameVarName = "injected_original_filename";
|
||||
const importMetaUrlVarName = "injected_original_import_meta_url";
|
||||
const bundle = await rolldown({
|
||||
input: configFile,
|
||||
platform: "node",
|
||||
resolve: { mainFields: ["main"] },
|
||||
transform: { define: {
|
||||
__dirname: dirnameVarName,
|
||||
__filename: filenameVarName,
|
||||
"import.meta.url": importMetaUrlVarName,
|
||||
"import.meta.dirname": dirnameVarName,
|
||||
"import.meta.filename": filenameVarName
|
||||
} },
|
||||
treeshake: false,
|
||||
external: [/^[\w@][^:]/],
|
||||
plugins: [{
|
||||
name: "inject-file-scope-variables",
|
||||
transform: {
|
||||
filter: { id: /\.[cm]?[jt]s$/ },
|
||||
async handler(code, id) {
|
||||
return {
|
||||
code: `const ${dirnameVarName} = ${JSON.stringify(path.dirname(id))};const ${filenameVarName} = ${JSON.stringify(id)};const ${importMetaUrlVarName} = ${JSON.stringify(pathToFileURL(id).href)};` + code,
|
||||
map: null
|
||||
};
|
||||
}
|
||||
}
|
||||
}]
|
||||
});
|
||||
const outputDir = path.dirname(configFile);
|
||||
const fileName = (await bundle.write({
|
||||
dir: outputDir,
|
||||
format: isEsm ? "esm" : "cjs",
|
||||
sourcemap: "inline",
|
||||
entryFileNames: `rolldown.config.[hash]${path.extname(configFile).replace("ts", "js")}`
|
||||
})).output.find((chunk) => chunk.type === "chunk" && chunk.isEntry).fileName;
|
||||
return path.join(outputDir, fileName);
|
||||
}
|
||||
const SUPPORTED_JS_CONFIG_FORMATS = [
|
||||
".js",
|
||||
".mjs",
|
||||
".cjs"
|
||||
];
|
||||
const SUPPORTED_TS_CONFIG_FORMATS = [
|
||||
".ts",
|
||||
".mts",
|
||||
".cts"
|
||||
];
|
||||
const SUPPORTED_CONFIG_FORMATS = [...SUPPORTED_JS_CONFIG_FORMATS, ...SUPPORTED_TS_CONFIG_FORMATS];
|
||||
const DEFAULT_CONFIG_BASE = "rolldown.config";
|
||||
async function findConfigFileNameInCwd() {
|
||||
const filesInWorkingDirectory = new Set(await readdir(cwd()));
|
||||
for (const extension of SUPPORTED_CONFIG_FORMATS) {
|
||||
const fileName = `${DEFAULT_CONFIG_BASE}${extension}`;
|
||||
if (filesInWorkingDirectory.has(fileName)) return fileName;
|
||||
}
|
||||
throw new Error("No `rolldown.config` configuration file found.");
|
||||
}
|
||||
async function loadTsConfig(configFile) {
|
||||
const file = await bundleTsConfig(configFile, isFilePathESM(configFile));
|
||||
try {
|
||||
return (await import(pathToFileURL(file).href)).default;
|
||||
} finally {
|
||||
fs.unlink(file, () => {});
|
||||
}
|
||||
}
|
||||
function isFilePathESM(filePath) {
|
||||
if (/\.m[jt]s$/.test(filePath)) return true;
|
||||
else if (/\.c[jt]s$/.test(filePath)) return false;
|
||||
else {
|
||||
const pkg = findNearestPackageData(path.dirname(filePath));
|
||||
if (pkg) return pkg.type === "module";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
function findNearestPackageData(basedir) {
|
||||
while (basedir) {
|
||||
const pkgPath = path.join(basedir, "package.json");
|
||||
if (tryStatSync(pkgPath)?.isFile()) try {
|
||||
return JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
||||
} catch {}
|
||||
const nextBasedir = path.dirname(basedir);
|
||||
if (nextBasedir === basedir) break;
|
||||
basedir = nextBasedir;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
function tryStatSync(file) {
|
||||
try {
|
||||
return fs.statSync(file, { throwIfNoEntry: false });
|
||||
} catch {}
|
||||
}
|
||||
/**
|
||||
* Load config from a file in a way that Rolldown does.
|
||||
*
|
||||
* @param configPath The path to the config file. If empty, it will look for `rolldown.config` with supported extensions in the current working directory.
|
||||
* @returns The loaded config export
|
||||
*
|
||||
* @category Config
|
||||
*/
|
||||
async function loadConfig(configPath) {
|
||||
const ext = path.extname(configPath = configPath || await findConfigFileNameInCwd());
|
||||
try {
|
||||
if (SUPPORTED_JS_CONFIG_FORMATS.includes(ext) || process.env.NODE_OPTIONS?.includes("--import=tsx") && SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return (await import(pathToFileURL(configPath).href)).default;
|
||||
else if (SUPPORTED_TS_CONFIG_FORMATS.includes(ext)) return await loadTsConfig(path.resolve(configPath));
|
||||
else throw new Error(`Unsupported config format. Expected: \`${SUPPORTED_CONFIG_FORMATS.join(",")}\` but got \`${ext}\``);
|
||||
} catch (err) {
|
||||
throw new Error("Error happened while loading config.", { cause: err });
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
export { loadConfig as t };
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
import { n as __toESM, t as require_binding } from "./binding-BeU_1iEk.mjs";
|
||||
import { c as logPluginError, n as error } from "./logs-D80CXhvg.mjs";
|
||||
//#region src/builtin-plugin/utils.ts
|
||||
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
||||
var BuiltinPlugin = class {
|
||||
/** Vite-specific option to control plugin ordering */
|
||||
enforce;
|
||||
constructor(name, _options) {
|
||||
this.name = name;
|
||||
this._options = _options;
|
||||
}
|
||||
};
|
||||
function makeBuiltinPluginCallable(plugin) {
|
||||
let callablePlugin = new import_binding.BindingCallableBuiltinPlugin(bindingifyBuiltInPlugin(plugin));
|
||||
const wrappedPlugin = plugin;
|
||||
for (const key in callablePlugin) {
|
||||
const wrappedHook = async function(...args) {
|
||||
try {
|
||||
return await callablePlugin[key](...args);
|
||||
} catch (e) {
|
||||
if (e instanceof Error && !e.stack?.includes("at ")) Error.captureStackTrace(e, wrappedPlugin[key]);
|
||||
return error(logPluginError(e, plugin.name, {
|
||||
hook: key,
|
||||
id: key === "transform" ? args[2] : void 0
|
||||
}));
|
||||
}
|
||||
};
|
||||
const order = callablePlugin.getOrder(key);
|
||||
if (order == void 0) wrappedPlugin[key] = wrappedHook;
|
||||
else wrappedPlugin[key] = {
|
||||
handler: wrappedHook,
|
||||
order
|
||||
};
|
||||
}
|
||||
return wrappedPlugin;
|
||||
}
|
||||
function bindingifyBuiltInPlugin(plugin) {
|
||||
return {
|
||||
__name: plugin.name,
|
||||
options: plugin._options
|
||||
};
|
||||
}
|
||||
function bindingifyManifestPlugin(plugin, pluginContextData) {
|
||||
const { isOutputOptionsForLegacyChunks, ...options } = plugin._options;
|
||||
return {
|
||||
__name: plugin.name,
|
||||
options: {
|
||||
...options,
|
||||
isLegacy: isOutputOptionsForLegacyChunks ? (opts) => {
|
||||
return isOutputOptionsForLegacyChunks(pluginContextData.getOutputOptions(opts));
|
||||
} : void 0
|
||||
}
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region src/utils/normalize-string-or-regex.ts
|
||||
function normalizedStringOrRegex(pattern) {
|
||||
if (!pattern) return;
|
||||
if (!isReadonlyArray(pattern)) return [pattern];
|
||||
return pattern;
|
||||
}
|
||||
function isReadonlyArray(input) {
|
||||
return Array.isArray(input);
|
||||
}
|
||||
//#endregion
|
||||
export { makeBuiltinPluginCallable as a, bindingifyManifestPlugin as i, BuiltinPlugin as n, bindingifyBuiltInPlugin as r, normalizedStringOrRegex as t };
|
||||
-74
@@ -1,74 +0,0 @@
|
||||
import { n as __toESM, t as require_binding } from "./binding-BeU_1iEk.mjs";
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.127.0/node_modules/oxc-parser/src-js/wrap.js
|
||||
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
||||
function wrap(result) {
|
||||
let program, module, comments, errors;
|
||||
return {
|
||||
get program() {
|
||||
if (!program) program = jsonParseAst(result.program);
|
||||
return program;
|
||||
},
|
||||
get module() {
|
||||
if (!module) module = result.module;
|
||||
return module;
|
||||
},
|
||||
get comments() {
|
||||
if (!comments) comments = result.comments;
|
||||
return comments;
|
||||
},
|
||||
get errors() {
|
||||
if (!errors) errors = result.errors;
|
||||
return errors;
|
||||
}
|
||||
};
|
||||
}
|
||||
function jsonParseAst(programJson) {
|
||||
const { node: program, fixes } = JSON.parse(programJson);
|
||||
for (const fixPath of fixes) applyFix(program, fixPath);
|
||||
return program;
|
||||
}
|
||||
function applyFix(program, fixPath) {
|
||||
let node = program;
|
||||
for (const key of fixPath) node = node[key];
|
||||
if (node.bigint) node.value = BigInt(node.bigint);
|
||||
else try {
|
||||
node.value = RegExp(node.regex.pattern, node.regex.flags);
|
||||
} catch {}
|
||||
}
|
||||
//#endregion
|
||||
//#region src/utils/parse.ts
|
||||
/**
|
||||
* Parse JS/TS source asynchronously on a separate thread.
|
||||
*
|
||||
* Note that not all of the workload can happen on a separate thread.
|
||||
* Parsing on Rust side does happen in a separate thread, but deserialization of the AST to JS objects
|
||||
* has to happen on current thread. This synchronous deserialization work typically outweighs
|
||||
* the asynchronous parsing by a factor of between 3 and 20.
|
||||
*
|
||||
* i.e. the majority of the workload cannot be parallelized by using this method.
|
||||
*
|
||||
* Generally {@linkcode parseSync} is preferable to use as it does not have the overhead of spawning a thread.
|
||||
* If you need to parallelize parsing multiple files, it is recommended to use worker threads.
|
||||
*
|
||||
* @category Utilities
|
||||
*/
|
||||
async function parse(filename, sourceText, options) {
|
||||
return wrap(await (0, import_binding.parse)(filename, sourceText, options));
|
||||
}
|
||||
/**
|
||||
* Parse JS/TS source synchronously on current thread.
|
||||
*
|
||||
* This is generally preferable over {@linkcode parse} (async) as it does not have the overhead
|
||||
* of spawning a thread, and the majority of the workload cannot be parallelized anyway
|
||||
* (see {@linkcode parse} documentation for details).
|
||||
*
|
||||
* If you need to parallelize parsing multiple files, it is recommended to use worker threads
|
||||
* with {@linkcode parseSync} rather than using {@linkcode parse}.
|
||||
*
|
||||
* @category Utilities
|
||||
*/
|
||||
function parseSync(filename, sourceText, options) {
|
||||
return wrap((0, import_binding.parseSync)(filename, sourceText, options));
|
||||
}
|
||||
//#endregion
|
||||
export { parseSync as n, parse as t };
|
||||
-113
@@ -1,113 +0,0 @@
|
||||
import { n as __toESM, t as require_binding } from "./binding-BeU_1iEk.mjs";
|
||||
import { a as bindingifySourcemap, n as normalizeBindingError } from "./error-DL-e8-oE.mjs";
|
||||
//#region src/utils/minify.ts
|
||||
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
||||
/**
|
||||
* Minify asynchronously.
|
||||
*
|
||||
* Note: This function can be slower than {@linkcode minifySync} due to the overhead of spawning a thread.
|
||||
*
|
||||
* @category Utilities
|
||||
* @experimental
|
||||
*/
|
||||
async function minify(filename, sourceText, options) {
|
||||
const inputMap = bindingifySourcemap(options?.inputMap);
|
||||
const result = await (0, import_binding.minify)(filename, sourceText, options);
|
||||
if (result.map && inputMap) result.map = {
|
||||
version: 3,
|
||||
...(0, import_binding.collapseSourcemaps)([inputMap, bindingifySourcemap(result.map)])
|
||||
};
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* Minify synchronously.
|
||||
*
|
||||
* @category Utilities
|
||||
* @experimental
|
||||
*/
|
||||
function minifySync(filename, sourceText, options) {
|
||||
const inputMap = bindingifySourcemap(options?.inputMap);
|
||||
const result = (0, import_binding.minifySync)(filename, sourceText, options);
|
||||
if (result.map && inputMap) result.map = {
|
||||
version: 3,
|
||||
...(0, import_binding.collapseSourcemaps)([inputMap, bindingifySourcemap(result.map)])
|
||||
};
|
||||
return result;
|
||||
}
|
||||
//#endregion
|
||||
//#region src/utils/transform.ts
|
||||
const yarnPnp$1 = typeof process === "object" && !!process.versions?.pnp;
|
||||
/**
|
||||
* Transpile a JavaScript or TypeScript into a target ECMAScript version, asynchronously.
|
||||
*
|
||||
* Note: This function can be slower than `transformSync` due to the overhead of spawning a thread.
|
||||
*
|
||||
* @param filename The name of the file being transformed. If this is a
|
||||
* relative path, consider setting the {@linkcode TransformOptions#cwd} option.
|
||||
* @param sourceText The source code to transform.
|
||||
* @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
|
||||
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
||||
* Only used when `options.tsconfig` is `true`.
|
||||
*
|
||||
* @returns a promise that resolves to an object containing the transformed code,
|
||||
* source maps, and any errors that occurred during parsing or transformation.
|
||||
*
|
||||
* @category Utilities
|
||||
* @experimental
|
||||
*/
|
||||
async function transform(filename, sourceText, options, cache) {
|
||||
const result = await (0, import_binding.enhancedTransform)(filename, sourceText, options, cache, yarnPnp$1);
|
||||
return {
|
||||
...result,
|
||||
errors: result.errors.map(normalizeBindingError),
|
||||
warnings: result.warnings.map((w) => w.field0)
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Transpile a JavaScript or TypeScript into a target ECMAScript version.
|
||||
*
|
||||
* @param filename The name of the file being transformed. If this is a
|
||||
* relative path, consider setting the {@linkcode TransformOptions#cwd} option.
|
||||
* @param sourceText The source code to transform.
|
||||
* @param options The transform options including tsconfig and inputMap. See {@linkcode TransformOptions} for more information.
|
||||
* @param cache Optional tsconfig cache for reusing resolved tsconfig across multiple transforms.
|
||||
* Only used when `options.tsconfig` is `true`.
|
||||
*
|
||||
* @returns an object containing the transformed code, source maps, and any errors
|
||||
* that occurred during parsing or transformation.
|
||||
*
|
||||
* @category Utilities
|
||||
* @experimental
|
||||
*/
|
||||
function transformSync(filename, sourceText, options, cache) {
|
||||
const result = (0, import_binding.enhancedTransformSync)(filename, sourceText, options, cache, yarnPnp$1);
|
||||
return {
|
||||
...result,
|
||||
errors: result.errors.map(normalizeBindingError),
|
||||
warnings: result.warnings.map((w) => w.field0)
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region src/utils/resolve-tsconfig.ts
|
||||
const yarnPnp = typeof process === "object" && !!process.versions?.pnp;
|
||||
/**
|
||||
* Cache for tsconfig resolution to avoid redundant file system operations.
|
||||
*
|
||||
* The cache stores resolved tsconfig configurations keyed by their file paths.
|
||||
* When transforming multiple files in the same project, tsconfig lookups are
|
||||
* deduplicated, improving performance.
|
||||
*
|
||||
* @category Utilities
|
||||
* @experimental
|
||||
*/
|
||||
var TsconfigCache = class extends import_binding.TsconfigCache {
|
||||
constructor() {
|
||||
super(yarnPnp);
|
||||
}
|
||||
};
|
||||
/** @hidden This is only expected to be used by Vite */
|
||||
function resolveTsconfig(filename, cache) {
|
||||
return (0, import_binding.resolveTsconfig)(filename, cache, yarnPnp);
|
||||
}
|
||||
//#endregion
|
||||
export { minify as a, transformSync as i, resolveTsconfig as n, minifySync as o, transform as r, TsconfigCache as t };
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
import { c as validateOption, t as RolldownBuild, u as PluginDriver } from "./rolldown-build-DSxL8qiP.mjs";
|
||||
//#region src/api/rolldown/index.ts
|
||||
/**
|
||||
* The API compatible with Rollup's `rollup` function.
|
||||
*
|
||||
* Unlike Rollup, the module graph is not built until the methods of the bundle object are called.
|
||||
*
|
||||
* @param input The input options object.
|
||||
* @returns A Promise that resolves to a bundle object.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { rolldown } from 'rolldown';
|
||||
*
|
||||
* let bundle, failed = false;
|
||||
* try {
|
||||
* bundle = await rolldown({
|
||||
* input: 'src/main.js',
|
||||
* });
|
||||
* await bundle.write({
|
||||
* format: 'esm',
|
||||
* });
|
||||
* } catch (e) {
|
||||
* console.error(e);
|
||||
* failed = true;
|
||||
* }
|
||||
* if (bundle) {
|
||||
* await bundle.close();
|
||||
* }
|
||||
* process.exitCode = failed ? 1 : 0;
|
||||
* ```
|
||||
*
|
||||
* @category Programmatic APIs
|
||||
*/
|
||||
const rolldown = async (input) => {
|
||||
validateOption("input", input);
|
||||
return new RolldownBuild(await PluginDriver.callOptionsHook(input));
|
||||
};
|
||||
//#endregion
|
||||
export { rolldown as t };
|
||||
-3325
File diff suppressed because one or more lines are too long
-374
@@ -1,374 +0,0 @@
|
||||
import { n as __toESM, t as require_binding } from "./binding-BeU_1iEk.mjs";
|
||||
import { o as logMultipleWatcherOption } from "./logs-D80CXhvg.mjs";
|
||||
import { v as LOG_LEVEL_WARN } from "./bindingify-input-options-DbbBhzky.mjs";
|
||||
import { t as arraify } from "./misc-DJYbNKZX.mjs";
|
||||
import { n as createBundlerOptions, u as PluginDriver } from "./rolldown-build-DSxL8qiP.mjs";
|
||||
import { t as aggregateBindingErrorsIntoJsError } from "./error-DL-e8-oE.mjs";
|
||||
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/signals.js
|
||||
/**
|
||||
* This is not the set of all possible signals.
|
||||
*
|
||||
* It IS, however, the set of all signals that trigger
|
||||
* an exit on either Linux or BSD systems. Linux is a
|
||||
* superset of the signal names supported on BSD, and
|
||||
* the unknown signals just fail to register, so we can
|
||||
* catch that easily enough.
|
||||
*
|
||||
* Windows signals are a different set, since there are
|
||||
* signals that terminate Windows processes, but don't
|
||||
* terminate (or don't even exist) on Posix systems.
|
||||
*
|
||||
* Don't bother with SIGKILL. It's uncatchable, which
|
||||
* means that we can't fire any callbacks anyway.
|
||||
*
|
||||
* If a user does happen to register a handler on a non-
|
||||
* fatal signal like SIGWINCH or something, and then
|
||||
* exit, it'll end up firing `process.emit('exit')`, so
|
||||
* the handler will be fired anyway.
|
||||
*
|
||||
* SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
|
||||
* artificially, inherently leave the process in a
|
||||
* state from which it is not safe to try and enter JS
|
||||
* listeners.
|
||||
*/
|
||||
const signals = [];
|
||||
signals.push("SIGHUP", "SIGINT", "SIGTERM");
|
||||
if (process.platform !== "win32") signals.push("SIGALRM", "SIGABRT", "SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
|
||||
if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT");
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/signal-exit@4.1.0/node_modules/signal-exit/dist/mjs/index.js
|
||||
const processOk = (process) => !!process && typeof process === "object" && typeof process.removeListener === "function" && typeof process.emit === "function" && typeof process.reallyExit === "function" && typeof process.listeners === "function" && typeof process.kill === "function" && typeof process.pid === "number" && typeof process.on === "function";
|
||||
const kExitEmitter = Symbol.for("signal-exit emitter");
|
||||
const global = globalThis;
|
||||
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
||||
var Emitter = class {
|
||||
emitted = {
|
||||
afterExit: false,
|
||||
exit: false
|
||||
};
|
||||
listeners = {
|
||||
afterExit: [],
|
||||
exit: []
|
||||
};
|
||||
count = 0;
|
||||
id = Math.random();
|
||||
constructor() {
|
||||
if (global[kExitEmitter]) return global[kExitEmitter];
|
||||
ObjectDefineProperty(global, kExitEmitter, {
|
||||
value: this,
|
||||
writable: false,
|
||||
enumerable: false,
|
||||
configurable: false
|
||||
});
|
||||
}
|
||||
on(ev, fn) {
|
||||
this.listeners[ev].push(fn);
|
||||
}
|
||||
removeListener(ev, fn) {
|
||||
const list = this.listeners[ev];
|
||||
const i = list.indexOf(fn);
|
||||
/* c8 ignore start */
|
||||
if (i === -1) return;
|
||||
/* c8 ignore stop */
|
||||
if (i === 0 && list.length === 1) list.length = 0;
|
||||
else list.splice(i, 1);
|
||||
}
|
||||
emit(ev, code, signal) {
|
||||
if (this.emitted[ev]) return false;
|
||||
this.emitted[ev] = true;
|
||||
let ret = false;
|
||||
for (const fn of this.listeners[ev]) ret = fn(code, signal) === true || ret;
|
||||
if (ev === "exit") ret = this.emit("afterExit", code, signal) || ret;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
var SignalExitBase = class {};
|
||||
const signalExitWrap = (handler) => {
|
||||
return {
|
||||
onExit(cb, opts) {
|
||||
return handler.onExit(cb, opts);
|
||||
},
|
||||
load() {
|
||||
return handler.load();
|
||||
},
|
||||
unload() {
|
||||
return handler.unload();
|
||||
}
|
||||
};
|
||||
};
|
||||
var SignalExitFallback = class extends SignalExitBase {
|
||||
onExit() {
|
||||
return () => {};
|
||||
}
|
||||
load() {}
|
||||
unload() {}
|
||||
};
|
||||
var SignalExit = class extends SignalExitBase {
|
||||
/* c8 ignore start */
|
||||
#hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
|
||||
/* c8 ignore stop */
|
||||
#emitter = new Emitter();
|
||||
#process;
|
||||
#originalProcessEmit;
|
||||
#originalProcessReallyExit;
|
||||
#sigListeners = {};
|
||||
#loaded = false;
|
||||
constructor(process) {
|
||||
super();
|
||||
this.#process = process;
|
||||
this.#sigListeners = {};
|
||||
for (const sig of signals) this.#sigListeners[sig] = () => {
|
||||
const listeners = this.#process.listeners(sig);
|
||||
let { count } = this.#emitter;
|
||||
/* c8 ignore start */
|
||||
const p = process;
|
||||
if (typeof p.__signal_exit_emitter__ === "object" && typeof p.__signal_exit_emitter__.count === "number") count += p.__signal_exit_emitter__.count;
|
||||
/* c8 ignore stop */
|
||||
if (listeners.length === count) {
|
||||
this.unload();
|
||||
const ret = this.#emitter.emit("exit", null, sig);
|
||||
/* c8 ignore start */
|
||||
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
||||
if (!ret) process.kill(process.pid, s);
|
||||
}
|
||||
};
|
||||
this.#originalProcessReallyExit = process.reallyExit;
|
||||
this.#originalProcessEmit = process.emit;
|
||||
}
|
||||
onExit(cb, opts) {
|
||||
/* c8 ignore start */
|
||||
if (!processOk(this.#process)) return () => {};
|
||||
/* c8 ignore stop */
|
||||
if (this.#loaded === false) this.load();
|
||||
const ev = opts?.alwaysLast ? "afterExit" : "exit";
|
||||
this.#emitter.on(ev, cb);
|
||||
return () => {
|
||||
this.#emitter.removeListener(ev, cb);
|
||||
if (this.#emitter.listeners["exit"].length === 0 && this.#emitter.listeners["afterExit"].length === 0) this.unload();
|
||||
};
|
||||
}
|
||||
load() {
|
||||
if (this.#loaded) return;
|
||||
this.#loaded = true;
|
||||
this.#emitter.count += 1;
|
||||
for (const sig of signals) try {
|
||||
const fn = this.#sigListeners[sig];
|
||||
if (fn) this.#process.on(sig, fn);
|
||||
} catch (_) {}
|
||||
this.#process.emit = (ev, ...a) => {
|
||||
return this.#processEmit(ev, ...a);
|
||||
};
|
||||
this.#process.reallyExit = (code) => {
|
||||
return this.#processReallyExit(code);
|
||||
};
|
||||
}
|
||||
unload() {
|
||||
if (!this.#loaded) return;
|
||||
this.#loaded = false;
|
||||
signals.forEach((sig) => {
|
||||
const listener = this.#sigListeners[sig];
|
||||
/* c8 ignore start */
|
||||
if (!listener) throw new Error("Listener not defined for signal: " + sig);
|
||||
/* c8 ignore stop */
|
||||
try {
|
||||
this.#process.removeListener(sig, listener);
|
||||
} catch (_) {}
|
||||
/* c8 ignore stop */
|
||||
});
|
||||
this.#process.emit = this.#originalProcessEmit;
|
||||
this.#process.reallyExit = this.#originalProcessReallyExit;
|
||||
this.#emitter.count -= 1;
|
||||
}
|
||||
#processReallyExit(code) {
|
||||
/* c8 ignore start */
|
||||
if (!processOk(this.#process)) return 0;
|
||||
this.#process.exitCode = code || 0;
|
||||
/* c8 ignore stop */
|
||||
this.#emitter.emit("exit", this.#process.exitCode, null);
|
||||
return this.#originalProcessReallyExit.call(this.#process, this.#process.exitCode);
|
||||
}
|
||||
#processEmit(ev, ...args) {
|
||||
const og = this.#originalProcessEmit;
|
||||
if (ev === "exit" && processOk(this.#process)) {
|
||||
if (typeof args[0] === "number") this.#process.exitCode = args[0];
|
||||
/* c8 ignore start */
|
||||
const ret = og.call(this.#process, ev, ...args);
|
||||
/* c8 ignore start */
|
||||
this.#emitter.emit("exit", this.#process.exitCode, null);
|
||||
/* c8 ignore stop */
|
||||
return ret;
|
||||
} else return og.call(this.#process, ev, ...args);
|
||||
}
|
||||
};
|
||||
const process$1 = globalThis.process;
|
||||
const { onExit: onExit$1, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
||||
//#endregion
|
||||
//#region src/utils/signal-exit.ts
|
||||
function onExit(...args) {
|
||||
if (typeof process === "object" && process.versions.webcontainer) {
|
||||
process.on("exit", (code) => {
|
||||
args[0](code, null);
|
||||
});
|
||||
return;
|
||||
}
|
||||
onExit$1(...args);
|
||||
}
|
||||
//#endregion
|
||||
//#region src/api/watch/watch-emitter.ts
|
||||
var WatcherEmitter = class {
|
||||
listeners = /* @__PURE__ */ new Map();
|
||||
on(event, listener) {
|
||||
const listeners = this.listeners.get(event);
|
||||
if (listeners) listeners.push(listener);
|
||||
else this.listeners.set(event, [listener]);
|
||||
return this;
|
||||
}
|
||||
off(event, listener) {
|
||||
const listeners = this.listeners.get(event);
|
||||
if (listeners) {
|
||||
const index = listeners.indexOf(listener);
|
||||
if (index !== -1) listeners.splice(index, 1);
|
||||
}
|
||||
return this;
|
||||
}
|
||||
clear(event) {
|
||||
this.listeners.delete(event);
|
||||
}
|
||||
/** Async emit — sequential dispatch so side effects from earlier handlers
|
||||
* (e.g. `event.result.close()` triggering `closeBundle`) are visible to later handlers. */
|
||||
async emit(event, ...args) {
|
||||
const handlers = this.listeners.get(event);
|
||||
if (handlers?.length) for (const h of handlers) await h(...args);
|
||||
}
|
||||
async close() {}
|
||||
};
|
||||
//#endregion
|
||||
//#region src/api/watch/watcher.ts
|
||||
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
|
||||
function createEventCallback(emitter) {
|
||||
return async (event) => {
|
||||
switch (event.eventKind()) {
|
||||
case "event": {
|
||||
const code = event.bundleEventKind();
|
||||
if (code === "BUNDLE_END") {
|
||||
const { duration, output, result } = event.bundleEndData();
|
||||
await emitter.emit("event", {
|
||||
code: "BUNDLE_END",
|
||||
duration,
|
||||
output: [output],
|
||||
result
|
||||
});
|
||||
} else if (code === "ERROR") {
|
||||
const data = event.bundleErrorData();
|
||||
await emitter.emit("event", {
|
||||
code: "ERROR",
|
||||
error: aggregateBindingErrorsIntoJsError(data.error),
|
||||
result: data.result
|
||||
});
|
||||
} else await emitter.emit("event", { code });
|
||||
break;
|
||||
}
|
||||
case "change": {
|
||||
const { path, kind } = event.watchChangeData();
|
||||
await emitter.emit("change", path, { event: kind });
|
||||
break;
|
||||
}
|
||||
case "restart":
|
||||
await emitter.emit("restart");
|
||||
break;
|
||||
case "close":
|
||||
await emitter.emit("close");
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
var Watcher = class {
|
||||
closed;
|
||||
inner;
|
||||
emitter;
|
||||
stopWorkers;
|
||||
constructor(emitter, inner, stopWorkers) {
|
||||
this.closed = false;
|
||||
this.inner = inner;
|
||||
this.emitter = emitter;
|
||||
const originClose = emitter.close.bind(emitter);
|
||||
emitter.close = async () => {
|
||||
await this.close();
|
||||
originClose();
|
||||
};
|
||||
this.stopWorkers = stopWorkers;
|
||||
process.nextTick(() => this.run());
|
||||
}
|
||||
async close() {
|
||||
if (this.closed) return;
|
||||
this.closed = true;
|
||||
for (const stop of this.stopWorkers) await stop?.();
|
||||
await this.inner.close();
|
||||
(0, import_binding.shutdownAsyncRuntime)();
|
||||
}
|
||||
async run() {
|
||||
await this.inner.run();
|
||||
this.inner.waitForClose();
|
||||
}
|
||||
};
|
||||
async function createWatcher(emitter, input) {
|
||||
const options = arraify(input);
|
||||
const bundlerOptions = await Promise.all(options.map((option) => arraify(option.output || {}).map(async (output) => {
|
||||
return createBundlerOptions(await PluginDriver.callOptionsHook(option, true), output, true);
|
||||
})).flat());
|
||||
warnMultiplePollingOptions(bundlerOptions);
|
||||
const callback = createEventCallback(emitter);
|
||||
new Watcher(emitter, new import_binding.BindingWatcher(bundlerOptions.map((option) => option.bundlerOptions), callback), bundlerOptions.map((option) => option.stopWorkers));
|
||||
}
|
||||
function warnMultiplePollingOptions(bundlerOptions) {
|
||||
let found = false;
|
||||
for (const option of bundlerOptions) {
|
||||
const watch = option.inputOptions.watch;
|
||||
const watcher = watch && typeof watch === "object" ? watch.watcher ?? watch.notify : void 0;
|
||||
if (watcher && (watcher.usePolling != null || watcher.pollInterval != null)) {
|
||||
if (found) {
|
||||
option.onLog(LOG_LEVEL_WARN, logMultipleWatcherOption());
|
||||
return;
|
||||
}
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
//#region src/api/watch/index.ts
|
||||
/**
|
||||
* The API compatible with Rollup's `watch` function.
|
||||
*
|
||||
* This function will rebuild the bundle when it detects that the individual modules have changed on disk.
|
||||
*
|
||||
* Note that when using this function, it is your responsibility to call `event.result.close()` in response to the `BUNDLE_END` event to avoid resource leaks.
|
||||
*
|
||||
* @param input The watch options object or the list of them.
|
||||
* @returns A watcher object.
|
||||
*
|
||||
* @example
|
||||
* ```js
|
||||
* import { watch } from 'rolldown';
|
||||
*
|
||||
* const watcher = watch({ /* ... *\/ });
|
||||
* watcher.on('event', (event) => {
|
||||
* if (event.code === 'BUNDLE_END') {
|
||||
* console.log(event.duration);
|
||||
* event.result.close();
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // Stop watching
|
||||
* watcher.close();
|
||||
* ```
|
||||
*
|
||||
* @experimental
|
||||
* @category Programmatic APIs
|
||||
*/
|
||||
function watch(input) {
|
||||
const emitter = new WatcherEmitter();
|
||||
createWatcher(emitter, input);
|
||||
return emitter;
|
||||
}
|
||||
//#endregion
|
||||
export { onExit as n, watch as t };
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { a as MinifyOptions, c as minifySync, d as parse, f as parseSync, i as t
|
||||
import * as ESTree from "@oxc-project/types";
|
||||
import { Program } from "@oxc-project/types";
|
||||
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.127.0/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.128.0/node_modules/oxc-parser/src-js/generated/visit/visitor.d.ts
|
||||
interface VisitorObject$1 {
|
||||
DebuggerStatement?: (node: ESTree.DebuggerStatement) => void;
|
||||
"DebuggerStatement:exit"?: (node: ESTree.DebuggerStatement) => void;
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
import { n as parseSync, t as parse } from "./shared/parse-B_ZnWxLZ.mjs";
|
||||
import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-CfYpGzid.mjs";
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.127.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
|
||||
import { n as parseSync, t as parse } from "./shared/parse-PDqEYZcA.mjs";
|
||||
import { a as minify, i as transformSync, o as minifySync, r as transform, t as TsconfigCache } from "./shared/resolve-tsconfig-CxJB93yb.mjs";
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.128.0/node_modules/oxc-parser/src-js/generated/visit/walk.js
|
||||
function walkNode(node, visitors) {
|
||||
if (node == null) return;
|
||||
if (Array.isArray(node)) {
|
||||
@@ -2010,7 +2010,7 @@ function walkTSUnionType(node, visitors) {
|
||||
exit !== null && exit(node);
|
||||
}
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.127.0/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.128.0/node_modules/oxc-parser/src-js/generated/visit/type_ids.js
|
||||
/** Mapping from node type name to node type ID */
|
||||
const NODE_TYPE_IDS_MAP = new Map([
|
||||
["DebuggerStatement", 0],
|
||||
@@ -2180,7 +2180,7 @@ const NODE_TYPE_IDS_MAP = new Map([
|
||||
["TSUnionType", 164]
|
||||
]);
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.127.0/node_modules/oxc-parser/src-js/visit/visitor.js
|
||||
//#region ../../node_modules/.pnpm/oxc-parser@0.128.0/node_modules/oxc-parser/src-js/visit/visitor.js
|
||||
let compiledVisitor;
|
||||
function createCompiledVisitor() {
|
||||
compiledVisitor = [];
|
||||
|
||||
+20
-20
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "rolldown",
|
||||
"version": "1.0.0-rc.17",
|
||||
"version": "1.0.0-rc.18",
|
||||
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
||||
"keywords": [
|
||||
"bundler",
|
||||
@@ -53,8 +53,8 @@
|
||||
"registry": "https://registry.npmjs.org/"
|
||||
},
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "=0.127.0",
|
||||
"@rolldown/pluginutils": "1.0.0-rc.17"
|
||||
"@oxc-project/types": "=0.128.0",
|
||||
"@rolldown/pluginutils": "1.0.0-rc.18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@napi-rs/cli": "^3.6.1",
|
||||
@@ -66,7 +66,7 @@
|
||||
"consola": "^3.4.2",
|
||||
"execa": "^9.2.0",
|
||||
"glob": "^13.0.0",
|
||||
"oxc-parser": "=0.127.0",
|
||||
"oxc-parser": "=0.128.0",
|
||||
"pathe": "^2.0.3",
|
||||
"remeda": "^2.10.0",
|
||||
"rolldown-plugin-dts": "^0.23.0",
|
||||
@@ -75,7 +75,7 @@
|
||||
"source-map": "0.7.6",
|
||||
"typescript": "^6.0.0",
|
||||
"valibot": "1.3.1",
|
||||
"rolldown": "1.0.0-rc.17"
|
||||
"rolldown": "1.0.0-rc.18"
|
||||
},
|
||||
"napi": {
|
||||
"binaryName": "rolldown-binding",
|
||||
@@ -111,21 +111,21 @@
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@rolldown/binding-darwin-x64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-x64-musl": "1.0.0-rc.17",
|
||||
"@rolldown/binding-freebsd-x64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-darwin-arm64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.0.0-rc.17",
|
||||
"@rolldown/binding-openharmony-arm64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.17",
|
||||
"@rolldown/binding-android-arm64": "1.0.0-rc.17",
|
||||
"@rolldown/binding-wasm32-wasi": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.17",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.17"
|
||||
"@rolldown/binding-darwin-x64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-win32-x64-msvc": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-x64-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-x64-musl": "1.0.0-rc.18",
|
||||
"@rolldown/binding-freebsd-x64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-darwin-arm64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-arm64-musl": "1.0.0-rc.18",
|
||||
"@rolldown/binding-openharmony-arm64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.18",
|
||||
"@rolldown/binding-android-arm64": "1.0.0-rc.18",
|
||||
"@rolldown/binding-wasm32-wasi": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.18",
|
||||
"@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.18"
|
||||
},
|
||||
"scripts": {
|
||||
"# Scrips for binding #": "_",
|
||||
|
||||
-38
File diff suppressed because one or more lines are too long
+1
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import"./chunk-3IR7ZFJX.mjs";import"./chunk-TDNFF6A4.mjs";import"./chunk-X4GG3EDV.mjs";function i(r){let n={};for(let[e,t]of Object.entries(r??{}))if(e!=="__CSS_VALUES__")if(typeof t=="object"&&t!==null)for(let[o,f]of Object.entries(i(t)))n[`${e}${o==="DEFAULT"?"":`-${o}`}`]=f;else n[e]=t;if("__CSS_VALUES__"in r)for(let[e,t]of Object.entries(r.__CSS_VALUES__))(Number(t)&4)===0&&(n[e]=r[e]);return n}export{i as default};
|
||||
import"./chunk-4VTQOGRC.mjs";function i(r){let n={};for(let[e,t]of Object.entries(r??{}))if(e!=="__CSS_VALUES__")if(typeof t=="object"&&t!==null)for(let[o,f]of Object.entries(i(t)))n[`${e}${o==="DEFAULT"?"":`-${o}`}`]=f;else n[e]=t;if("__CSS_VALUES__"in r)for(let[e,t]of Object.entries(r.__CSS_VALUES__))(Number(t)&4)===0&&(n[e]=r[e]);return n}export{i as default};
|
||||
|
||||
+6
-5
@@ -26,7 +26,7 @@ declare class Theme {
|
||||
get(themeKeys: ThemeKey[]): string | null;
|
||||
hasDefault(key: string): boolean;
|
||||
getOptions(key: string): ThemeOptions;
|
||||
entries(): IterableIterator<[string, {
|
||||
entries(): MapIterator<[string, {
|
||||
value: string;
|
||||
options: ThemeOptions;
|
||||
src: Declaration["src"];
|
||||
@@ -99,13 +99,13 @@ declare class Variants {
|
||||
compoundsWith: Compounds;
|
||||
compounds: Compounds;
|
||||
} | undefined;
|
||||
kind(name: string): "static" | "arbitrary" | "functional" | "compound";
|
||||
kind(name: string): "arbitrary" | "static" | "functional" | "compound";
|
||||
compoundsWith(parent: string, child: string | Variant): boolean;
|
||||
suggest(name: string, suggestions: () => string[]): void;
|
||||
getCompletions(name: string): string[];
|
||||
compare(a: Variant | null, z: Variant | null): number;
|
||||
keys(): IterableIterator<string>;
|
||||
entries(): IterableIterator<[string, {
|
||||
keys(): MapIterator<string>;
|
||||
entries(): MapIterator<[string, {
|
||||
kind: Variant["kind"];
|
||||
order: number;
|
||||
applyFn: VariantFn<any>;
|
||||
@@ -314,7 +314,8 @@ interface DecodedMapping {
|
||||
name: string | null;
|
||||
}
|
||||
|
||||
type Config = UserConfig;
|
||||
interface Config extends UserConfig {
|
||||
}
|
||||
declare const enum Polyfills {
|
||||
None = 0,
|
||||
AtProperty = 1,
|
||||
|
||||
+15
-15
File diff suppressed because one or more lines are too long
+38
-1
File diff suppressed because one or more lines are too long
+1
-1
@@ -8,4 +8,4 @@ declare namespace createPlugin {
|
||||
var withOptions: <T>(pluginFunction: (options?: T) => PluginFn, configFunction?: (options?: T) => Partial<Config>) => PluginWithOptions<T>;
|
||||
}
|
||||
|
||||
export { Config, PluginFn as PluginCreator, createPlugin as default };
|
||||
export { Config, PluginFn as PluginCreator, PluginWithConfig, createPlugin as default };
|
||||
|
||||
+4
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "tailwindcss",
|
||||
"version": "4.2.4",
|
||||
"version": "4.3.0",
|
||||
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
@@ -73,12 +73,12 @@
|
||||
],
|
||||
"devDependencies": {
|
||||
"@jridgewell/remapping": "^2.3.5",
|
||||
"@types/node": "^20.19.0",
|
||||
"dedent": "1.7.1",
|
||||
"@types/node": "^22.19.17",
|
||||
"dedent": "1.7.2",
|
||||
"lightningcss": "1.32.0",
|
||||
"magic-string": "^0.30.21",
|
||||
"source-map-js": "^1.2.1",
|
||||
"@tailwindcss/oxide": "^4.2.4"
|
||||
"@tailwindcss/oxide": "^4.3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "tsc --noEmit",
|
||||
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
import "@vite/env";
|
||||
//#region ../../node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/non-secure/index.js
|
||||
//#region ../../node_modules/.pnpm/nanoid@5.1.11/node_modules/nanoid/non-secure/index.js
|
||||
let urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
||||
let nanoid = (size = 21) => {
|
||||
let id = "";
|
||||
@@ -8,7 +8,7 @@ let nanoid = (size = 21) => {
|
||||
return id;
|
||||
};
|
||||
//#endregion
|
||||
//#region \0@oxc-project+runtime@0.127.0/helpers/typeof.js
|
||||
//#region \0@oxc-project+runtime@0.128.0/helpers/typeof.js
|
||||
function _typeof(o) {
|
||||
"@babel/helpers - typeof";
|
||||
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
||||
@@ -18,7 +18,7 @@ function _typeof(o) {
|
||||
}, _typeof(o);
|
||||
}
|
||||
//#endregion
|
||||
//#region \0@oxc-project+runtime@0.127.0/helpers/toPrimitive.js
|
||||
//#region \0@oxc-project+runtime@0.128.0/helpers/toPrimitive.js
|
||||
function toPrimitive(t, r) {
|
||||
if ("object" != _typeof(t) || !t) return t;
|
||||
var e = t[Symbol.toPrimitive];
|
||||
@@ -30,13 +30,13 @@ function toPrimitive(t, r) {
|
||||
return ("string" === r ? String : Number)(t);
|
||||
}
|
||||
//#endregion
|
||||
//#region \0@oxc-project+runtime@0.127.0/helpers/toPropertyKey.js
|
||||
//#region \0@oxc-project+runtime@0.128.0/helpers/toPropertyKey.js
|
||||
function toPropertyKey(t) {
|
||||
var i = toPrimitive(t, "string");
|
||||
return "symbol" == _typeof(i) ? i : i + "";
|
||||
}
|
||||
//#endregion
|
||||
//#region \0@oxc-project+runtime@0.127.0/helpers/defineProperty.js
|
||||
//#region \0@oxc-project+runtime@0.128.0/helpers/defineProperty.js
|
||||
function _defineProperty(e, r, t) {
|
||||
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
||||
value: t,
|
||||
@@ -398,7 +398,7 @@ const createWebSocketModuleRunnerTransport = (options) => {
|
||||
return {
|
||||
async connect({ onMessage, onDisconnection }) {
|
||||
const socket = options.createConnection();
|
||||
socket.addEventListener("message", async ({ data }) => {
|
||||
socket.addEventListener("message", ({ data }) => {
|
||||
onMessage(JSON.parse(data));
|
||||
});
|
||||
let isOpened = socket.readyState === socket.OPEN;
|
||||
@@ -407,7 +407,7 @@ const createWebSocketModuleRunnerTransport = (options) => {
|
||||
isOpened = true;
|
||||
resolve();
|
||||
}, { once: true });
|
||||
socket.addEventListener("close", async () => {
|
||||
socket.addEventListener("close", () => {
|
||||
if (!isOpened) {
|
||||
reject(/* @__PURE__ */ new Error("WebSocket closed without opened."));
|
||||
return;
|
||||
|
||||
+19
-19
@@ -1,6 +1,6 @@
|
||||
import { i as __require, t as __commonJSMin } from "./chunk.js";
|
||||
import { t as require_lib } from "./lib.js";
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/fs.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/fs.js
|
||||
var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getFileSystem = getFileSystem;
|
||||
@@ -22,7 +22,7 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/unquote.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/unquote.js
|
||||
var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = unquote;
|
||||
@@ -35,7 +35,7 @@ var require_unquote = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.10/node_modules/icss-utils/src/replaceValueSymbols.js
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.14/node_modules/icss-utils/src/replaceValueSymbols.js
|
||||
var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const matchValueName = /[$]?[\w-]+/g;
|
||||
const replaceValueSymbols = (value, replacements) => {
|
||||
@@ -52,7 +52,7 @@ var require_replaceValueSymbols = /* @__PURE__ */ __commonJSMin(((exports, modul
|
||||
module.exports = replaceValueSymbols;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.10/node_modules/icss-utils/src/replaceSymbols.js
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.14/node_modules/icss-utils/src/replaceSymbols.js
|
||||
var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const replaceValueSymbols = require_replaceValueSymbols();
|
||||
const replaceSymbols = (css, replacements) => {
|
||||
@@ -65,7 +65,7 @@ var require_replaceSymbols = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
||||
module.exports = replaceSymbols;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.10/node_modules/icss-utils/src/extractICSS.js
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.14/node_modules/icss-utils/src/extractICSS.js
|
||||
var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const importPattern = /^:import\(("[^"]*"|'[^']*'|[^"']+)\)$/;
|
||||
const balancedQuotes = /^("[^"]*"|'[^']*'|[^"']+)$/;
|
||||
@@ -119,7 +119,7 @@ var require_extractICSS = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = extractICSS;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.10/node_modules/icss-utils/src/createICSSRules.js
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.14/node_modules/icss-utils/src/createICSSRules.js
|
||||
var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const createImports = (imports, postcss, mode = "rule") => {
|
||||
return Object.keys(imports).map((path) => {
|
||||
@@ -163,7 +163,7 @@ var require_createICSSRules = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
||||
module.exports = createICSSRules;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.10/node_modules/icss-utils/src/index.js
|
||||
//#region ../../node_modules/.pnpm/icss-utils@5.1.0_postcss@8.5.14/node_modules/icss-utils/src/index.js
|
||||
var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = {
|
||||
replaceValueSymbols: require_replaceValueSymbols(),
|
||||
@@ -173,7 +173,7 @@ var require_src$4 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/Parser.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/Parser.js
|
||||
var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = void 0;
|
||||
@@ -241,7 +241,7 @@ var require_Parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
exports.default = Parser;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/saveJSON.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/saveJSON.js
|
||||
var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = saveJSON;
|
||||
@@ -893,7 +893,7 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
|
||||
module.exports = camelCase;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/localsConvention.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/localsConvention.js
|
||||
var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.makeLocalsConventionReducer = makeLocalsConventionReducer;
|
||||
@@ -933,7 +933,7 @@ var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/FileSystemLoader.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/FileSystemLoader.js
|
||||
var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = void 0;
|
||||
@@ -1018,7 +1018,7 @@ var require_FileSystemLoader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
exports.default = FileSystemLoader;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.10/node_modules/postcss-modules-extract-imports/src/topologicalSort.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.14/node_modules/postcss-modules-extract-imports/src/topologicalSort.js
|
||||
var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const PERMANENT_MARKER = 2;
|
||||
const TEMPORARY_MARKER = 1;
|
||||
@@ -1057,7 +1057,7 @@ var require_topologicalSort = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
||||
module.exports = topologicalSort;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.10/node_modules/postcss-modules-extract-imports/src/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-extract-imports@3.1.0_postcss@8.5.14/node_modules/postcss-modules-extract-imports/src/index.js
|
||||
var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const topologicalSort = require_topologicalSort();
|
||||
const matchImports = /^(.+?)\s+from\s+(?:"([^"]+)"|'([^']+)'|(global))$/;
|
||||
@@ -4563,7 +4563,7 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = exports.default;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.10/node_modules/postcss-modules-local-by-default/src/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-local-by-default@4.2.0_postcss@8.5.14/node_modules/postcss-modules-local-by-default/src/index.js
|
||||
var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const selectorParser = require_dist();
|
||||
const valueParser = require_lib();
|
||||
@@ -4961,7 +4961,7 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports.postcss = true;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.10/node_modules/postcss-modules-scope/src/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-scope@3.2.1_postcss@8.5.14/node_modules/postcss-modules-scope/src/index.js
|
||||
var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const selectorParser = require_dist();
|
||||
const hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
@@ -5141,7 +5141,7 @@ var require_string_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = hash;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.10/node_modules/postcss-modules-values/src/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules-values@4.0.0_postcss@8.5.14/node_modules/postcss-modules-values/src/index.js
|
||||
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const ICSSUtils = require_src$4();
|
||||
const matchImports = /^(.+?|\([\s\S]+?\))\s+from\s+("[^"]*"|'[^']*'|[\w-]+)$/;
|
||||
@@ -5228,7 +5228,7 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports.postcss = true;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/scoping.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/scoping.js
|
||||
var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.behaviours = void 0;
|
||||
@@ -5290,7 +5290,7 @@ var require_scoping = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/pluginFactory.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/pluginFactory.js
|
||||
var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.makePlugin = makePlugin;
|
||||
@@ -5364,7 +5364,7 @@ var require_pluginFactory = /* @__PURE__ */ __commonJSMin(((exports) => {
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.10/node_modules/postcss-modules/build/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-modules@6.0.1_postcss@8.5.14/node_modules/postcss-modules/build/index.js
|
||||
var require_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
var _fs = __require("fs");
|
||||
var _fs2 = require_fs();
|
||||
|
||||
+66
-53
@@ -757,8 +757,6 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
||||
if (skipable && skipSourceless(line, index)) return;
|
||||
return insert(line, index, [genColumn]);
|
||||
}
|
||||
assert$2(sourceLine);
|
||||
assert$2(sourceColumn);
|
||||
const sourcesIndex = put(sources, source);
|
||||
const namesIndex = name ? put(names, name) : NO_NAME;
|
||||
if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
|
||||
@@ -776,7 +774,6 @@ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLin
|
||||
sourceColumn
|
||||
]);
|
||||
}
|
||||
function assert$2(_val) {}
|
||||
function getIndex(arr, index) {
|
||||
for (let i = arr.length; i <= index; i++) arr[i] = [];
|
||||
return arr[index];
|
||||
@@ -1088,11 +1085,11 @@ function getDate() {
|
||||
function init$1(debug) {
|
||||
debug.inspectOpts = Object.assign({}, inspectOpts);
|
||||
}
|
||||
var require$1, colors$37, inspectOpts, humanize$1, createDebug, node_default;
|
||||
var require$1, colors$38, inspectOpts, humanize$1, createDebug, node_default;
|
||||
var init_node = __esmMin((() => {
|
||||
init_core();
|
||||
require$1 = createRequire(import.meta.url);
|
||||
colors$37 = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
|
||||
colors$38 = process.stderr.getColorDepth && process.stderr.getColorDepth() > 2 ? [
|
||||
20,
|
||||
21,
|
||||
26,
|
||||
@@ -1194,7 +1191,7 @@ var init_node = __esmMin((() => {
|
||||
} catch (_unused) {
|
||||
humanize$1 = humanize;
|
||||
}
|
||||
createDebug = setup(useColors(), colors$37, log, load, save, formatArgs, init$1);
|
||||
createDebug = setup(useColors(), colors$38, log, load, save, formatArgs, init$1);
|
||||
createDebug.inspectOpts = inspectOpts;
|
||||
createDebug.formatters.o = function(v) {
|
||||
this.inspectOpts.colors = this.useColors;
|
||||
@@ -2799,7 +2796,7 @@ function getTSConfigResolutionCache(config) {
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
async function reloadOnTsconfigChange(server, changedFile) {
|
||||
function reloadOnTsconfigChange(server, changedFile) {
|
||||
if (changedFile.endsWith(".json")) {
|
||||
const cache = getTSConfigResolutionCache(server.config);
|
||||
if (changedFile.endsWith("/tsconfig.json")) {
|
||||
@@ -4510,7 +4507,7 @@ function throwFileNotFoundInOptimizedDep(id) {
|
||||
throw err;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/ufo@1.6.3/node_modules/ufo/dist/index.mjs
|
||||
//#region ../../node_modules/.pnpm/ufo@1.6.4/node_modules/ufo/dist/index.mjs
|
||||
const HASH_RE = /#/g;
|
||||
const AMPERSAND_RE = /&/g;
|
||||
const SLASH_RE = /\//g;
|
||||
@@ -10854,7 +10851,7 @@ var SSRCompatModuleRunner = class extends ModuleRunner {
|
||||
}
|
||||
};
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/periscopic@4.0.2/node_modules/periscopic/src/index.js
|
||||
//#region ../../node_modules/.pnpm/periscopic@4.0.3/node_modules/periscopic/src/index.js
|
||||
/**
|
||||
* @param {import('estree').Node} param
|
||||
* @returns {string[]}
|
||||
@@ -11092,7 +11089,7 @@ async function ssrTransform(code, inMap, url, originalCode, options) {
|
||||
if (options?.json?.stringify && isJSONRequest(url)) return ssrTransformJSON(code, inMap);
|
||||
return ssrTransformScript(code, inMap, url, originalCode);
|
||||
}
|
||||
async function ssrTransformJSON(code, inMap) {
|
||||
function ssrTransformJSON(code, inMap) {
|
||||
return {
|
||||
code: code.replace("export default", `${ssrModuleExportsKey}.default =`),
|
||||
map: inMap,
|
||||
@@ -19553,7 +19550,7 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.10_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/req.js
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/req.js
|
||||
var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const { createRequire: createRequire$1 } = __require("node:module");
|
||||
const { fileURLToPath: fileURLToPath$1, pathToFileURL: pathToFileURL$1 } = __require("node:url");
|
||||
@@ -19595,7 +19592,7 @@ var require_req = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = req;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.10_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/options.js
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/options.js
|
||||
var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const req = require_req();
|
||||
/**
|
||||
@@ -19629,7 +19626,7 @@ var require_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = options;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.10_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/plugins.js
|
||||
var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const req = require_req();
|
||||
/**
|
||||
@@ -19683,7 +19680,7 @@ var require_plugins = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = plugins;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.10_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-load-config@6.0.1_jiti@2.6.1_postcss@8.5.14_tsx@4.21.0_yaml@2.8.2/node_modules/postcss-load-config/src/index.js
|
||||
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const { resolve: resolve$3 } = __require("node:path");
|
||||
const config = require_src$1();
|
||||
@@ -20432,7 +20429,7 @@ function cssPlugin(config) {
|
||||
},
|
||||
load: {
|
||||
filter: { id: CSS_LANGS_RE },
|
||||
async handler(id) {
|
||||
handler(id) {
|
||||
if (urlRE$1.test(id)) {
|
||||
if (isModuleCSSRequest(id)) throw new Error(`?url is not supported with CSS modules. (tried to import ${JSON.stringify(id)})`);
|
||||
if (isBuild) {
|
||||
@@ -20816,7 +20813,7 @@ function cssAnalysisPlugin(config) {
|
||||
include: CSS_LANGS_RE,
|
||||
exclude: [commonjsProxyRE, SPECIAL_QUERY_RE]
|
||||
} },
|
||||
async handler(_, id) {
|
||||
handler(_, id) {
|
||||
const { moduleGraph } = this.environment;
|
||||
const thisModule = moduleGraph.getModuleById(id);
|
||||
if (thisModule) {
|
||||
@@ -21145,7 +21142,7 @@ function combineSourcemapsIfExists(filename, map1, map2) {
|
||||
const viteHashUpdateMarker = "/*$vite$:1*/";
|
||||
const viteHashUpdateMarkerRE = /\/\*\$vite\$:\d+\*\//;
|
||||
async function finalizeCss(css, config) {
|
||||
if (css.includes("@import") || css.includes("@charset")) css = await hoistAtRules(css);
|
||||
if (css.includes("@import") || css.includes("@charset")) css = hoistAtRules(css);
|
||||
if (config.build.cssMinify) css = await minifyCSS(css, config, false);
|
||||
css += viteHashUpdateMarker;
|
||||
return css;
|
||||
@@ -21353,7 +21350,7 @@ function resolveMinifyCssEsbuildOptions(options) {
|
||||
}
|
||||
const atImportRE = /@import(?:\s*(?:url\([^)]*\)|"(?:[^"]|(?<=\\)")*"|'(?:[^']|(?<=\\)')*').*?|[^;]*);/g;
|
||||
const atCharsetRE = /@charset(?:\s*(?:"(?:[^"]|(?<=\\)")*"|'(?:[^']|(?<=\\)')*').*?|[^;]*);/g;
|
||||
async function hoistAtRules(css) {
|
||||
function hoistAtRules(css) {
|
||||
const s = new MagicString(css);
|
||||
const cleanCss = emptyCssComments(css);
|
||||
let match;
|
||||
@@ -22920,18 +22917,18 @@ function definePlugin(config) {
|
||||
};
|
||||
return {
|
||||
name: "vite:define",
|
||||
transform: { async handler(code, id) {
|
||||
transform: { handler(code, id) {
|
||||
if (this.environment.config.consumer === "client") return;
|
||||
if (isHTMLRequest(id) || isCSSRequest(id) || isNonJsRequest(id) || config.assetsInclude(id)) return;
|
||||
const [define, pattern] = getPattern(this.environment);
|
||||
if (!pattern) return;
|
||||
pattern.lastIndex = 0;
|
||||
if (!pattern.test(code)) return;
|
||||
return await replaceDefine(this.environment, code, id, define);
|
||||
return replaceDefine(this.environment, code, id, define);
|
||||
} }
|
||||
};
|
||||
}
|
||||
async function replaceDefine(environment, code, id, define) {
|
||||
function replaceDefine(environment, code, id, define) {
|
||||
const result = transformSync(id, code, {
|
||||
lang: "js",
|
||||
sourceType: "module",
|
||||
@@ -22988,13 +22985,13 @@ function clientInjectionsPlugin(config) {
|
||||
async buildStart() {
|
||||
injectConfigValues = await createClientConfigValueReplacer(config);
|
||||
},
|
||||
async transform(code, id) {
|
||||
transform(code, id) {
|
||||
const ssr = this.environment.config.consumer === "server";
|
||||
const cleanId = cleanUrl(id);
|
||||
if (cleanId === normalizedClientEntry$1 || cleanId === normalizedEnvEntry$1) return getDefineReplacer(this)(injectConfigValues(code));
|
||||
else if (!ssr && code.includes("process.env.NODE_ENV")) {
|
||||
const nodeEnv = this.environment.config.define?.["process.env.NODE_ENV"] || JSON.stringify(process.env.NODE_ENV || config.mode);
|
||||
return await replaceDefine(this.environment, code, id, {
|
||||
return replaceDefine(this.environment, code, id, {
|
||||
"process.env.NODE_ENV": nodeEnv,
|
||||
"global.process.env.NODE_ENV": nodeEnv,
|
||||
"globalThis.process.env.NODE_ENV": nodeEnv
|
||||
@@ -23369,7 +23366,7 @@ function createDepsOptimizer(environment) {
|
||||
path: "*"
|
||||
});
|
||||
}
|
||||
async function rerun() {
|
||||
function rerun() {
|
||||
const depsString = depsLogString(Object.keys(metadata.discovered));
|
||||
debug$9?.(import_picocolors.default.green(`new dependencies found: ${depsString}`));
|
||||
runOptimizer();
|
||||
@@ -24738,7 +24735,7 @@ var DevEnvironment = class extends BaseEnvironment {
|
||||
});
|
||||
}
|
||||
});
|
||||
this.hot.on("vite:invalidate", async ({ path, message, firstInvalidatedBy }, client) => {
|
||||
this.hot.on("vite:invalidate", ({ path, message, firstInvalidatedBy }, client) => {
|
||||
this.invalidateModule({
|
||||
path,
|
||||
message,
|
||||
@@ -24869,7 +24866,7 @@ function setupOnCrawlEnd() {
|
||||
if (timeoutHandle) clearTimeout(timeoutHandle);
|
||||
timeoutHandle = setTimeout(callOnCrawlEndWhenIdle, callCrawlEndIfIdleAfterMs);
|
||||
}
|
||||
async function callOnCrawlEndWhenIdle() {
|
||||
function callOnCrawlEndWhenIdle() {
|
||||
if (cancelled || registeredIds.size > 0) return;
|
||||
onCrawlEndPromiseWithResolvers.resolve();
|
||||
}
|
||||
@@ -27360,7 +27357,7 @@ function webWorkerPlugin(config) {
|
||||
},
|
||||
transform: {
|
||||
filter: { id: workerFileRE },
|
||||
async handler(raw, id) {
|
||||
handler(raw, id) {
|
||||
const workerFileMatch = workerFileRE.exec(id);
|
||||
if (workerFileMatch) {
|
||||
const workerType = workerFileMatch[1];
|
||||
@@ -27995,7 +27992,7 @@ export default ${wasmHelperCode}
|
||||
},
|
||||
renderChunk: env.config.consumer === "server" ? {
|
||||
filter: { code: wasmInitUrlRE },
|
||||
async handler(code, chunk, opts, meta) {
|
||||
handler(code, chunk, opts, meta) {
|
||||
const toRelativeRuntime = createToImportMetaURLBasedRelativeRuntime(opts.format, this.environment.config.isWorker);
|
||||
let match;
|
||||
let s;
|
||||
@@ -28778,15 +28775,22 @@ function importGlobPlugin(config) {
|
||||
async handler(code, id) {
|
||||
const result = await transformGlobImport(code, id, config.root, (im, _, options) => this.resolve(im, id, options).then((i) => i?.id || im), config.experimental.importGlobRestoreExtension, config.logger);
|
||||
if (result) {
|
||||
const allGlobs = result.matches.map((i) => i.globsResolved);
|
||||
if (!importGlobMaps.has(this.environment)) importGlobMaps.set(this.environment, /* @__PURE__ */ new Map());
|
||||
const globMatchers = allGlobs.map((globs) => {
|
||||
const globMatchers = result.matches.map((i) => {
|
||||
const affirmed = [];
|
||||
const negated = [];
|
||||
for (const glob of globs) if (glob[0] === "!") negated.push(glob.slice(1));
|
||||
for (const glob of i.globsResolved) if (glob[0] === "!") negated.push(glob.slice(1));
|
||||
else affirmed.push(glob);
|
||||
const affirmedMatcher = picomatch(affirmed);
|
||||
const negatedMatcher = picomatch(negated);
|
||||
const affirmedMatcher = picomatch(affirmed, {
|
||||
noextglob: true,
|
||||
dot: !!i.options.exhaustive,
|
||||
ignore: i.options.exhaustive ? [] : ["**/node_modules/**"]
|
||||
});
|
||||
const negatedMatcher = picomatch(negated, {
|
||||
noextglob: true,
|
||||
dot: !!i.options.exhaustive,
|
||||
ignore: i.options.exhaustive ? [] : ["**/node_modules/**"]
|
||||
});
|
||||
return (file) => {
|
||||
return (affirmed.length === 0 || affirmedMatcher(file)) && !(negated.length > 0 && negatedMatcher(file));
|
||||
};
|
||||
@@ -29172,7 +29176,7 @@ function createFilterForTransform(idFilter, codeFilter, moduleTypeFilter, cwd) {
|
||||
};
|
||||
}
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.4/node_modules/@vitest/utils/dist/helpers.js
|
||||
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/helpers.js
|
||||
function notNullish(v) {
|
||||
return v != null;
|
||||
}
|
||||
@@ -29180,7 +29184,7 @@ function isPrimitive(value) {
|
||||
return value === null || typeof value !== "function" && typeof value !== "object";
|
||||
}
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.4/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
|
||||
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js
|
||||
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
||||
function normalizeWindowsPath(input = "") {
|
||||
if (!input) return input;
|
||||
@@ -29259,7 +29263,7 @@ const isAbsolute$2 = function(p) {
|
||||
return _IS_ABSOLUTE_RE.test(p);
|
||||
};
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.4/node_modules/@vitest/utils/dist/source-map.js
|
||||
//#region ../../node_modules/.pnpm/@vitest+utils@4.1.5/node_modules/@vitest/utils/dist/source-map.js
|
||||
var comma = ",".charCodeAt(0);
|
||||
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
var intToChar = new Uint8Array(64);
|
||||
@@ -29546,7 +29550,7 @@ function parseSingleV8Stack(raw) {
|
||||
function parseStacktrace(stack, options = {}) {
|
||||
const { ignoreStackEntries = stackIgnorePatterns } = options;
|
||||
let stacks = !CHROME_IE_STACK_REGEXP.test(stack) ? parseFFOrSafariStackTrace(stack) : parseV8Stacktrace(stack);
|
||||
const helperIndex = stacks.findLastIndex((s) => s.method === "__VITEST_HELPER__" || s.method === "async*__VITEST_HELPER__" || s.method === "async __VITEST_HELPER__");
|
||||
const helperIndex = stacks.findLastIndex((s) => s.method.includes("__VITEST_HELPER__"));
|
||||
if (helperIndex >= 0) stacks = stacks.slice(helperIndex + 1);
|
||||
return stacks.map((stack) => {
|
||||
if (options.getUrlId) stack.file = options.getUrlId(stack.file);
|
||||
@@ -29732,10 +29736,11 @@ async function resolvePlugins(config, prePlugins, normalPlugins, postPlugins) {
|
||||
const isBuild = config.command === "build";
|
||||
const isBundled = config.isBundled;
|
||||
const isWorker = config.isWorker;
|
||||
const buildPlugins = isBundled ? await (await Promise.resolve().then(() => build_exports)).resolveBuildPlugins(config) : {
|
||||
const buildPlugins = isBundled ? (await Promise.resolve().then(() => build_exports)).resolveBuildPlugins(config) : {
|
||||
pre: [],
|
||||
post: []
|
||||
};
|
||||
const devtoolsIntegrationPlugin = config.devtools.enabled && !isWorker ? await loadDevToolsIntegrationPlugin(config) : null;
|
||||
const { modulePreload } = config.build;
|
||||
return [
|
||||
!isBundled ? optimizedDepsPlugin() : null,
|
||||
@@ -29791,6 +29796,7 @@ async function resolvePlugins(config, prePlugins, normalPlugins, postPlugins) {
|
||||
importGlobPlugin(config),
|
||||
...postPlugins,
|
||||
...buildPlugins.post,
|
||||
devtoolsIntegrationPlugin,
|
||||
...isBundled ? [] : [
|
||||
clientInjectionsPlugin(config),
|
||||
cssAnalysisPlugin(config),
|
||||
@@ -29798,6 +29804,15 @@ async function resolvePlugins(config, prePlugins, normalPlugins, postPlugins) {
|
||||
]
|
||||
].filter(Boolean);
|
||||
}
|
||||
async function loadDevToolsIntegrationPlugin(config) {
|
||||
try {
|
||||
const { DevToolsIntegration } = await import("@vitejs/devtools/integration");
|
||||
return DevToolsIntegration({ config });
|
||||
} catch (error) {
|
||||
config.logger.error(import_picocolors.default.red(`Failed to load Vite DevTools integration: ${error?.message || error?.stack}`), { error });
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function createPluginHookUtils(plugins) {
|
||||
const sortedPluginsCache = /* @__PURE__ */ new Map();
|
||||
function getSortedPlugins(hookName) {
|
||||
@@ -31218,7 +31233,7 @@ function rolldownDepPlugin(environment, qualified, external) {
|
||||
},
|
||||
transform: {
|
||||
filter: { code: assetImportMetaUrlRE },
|
||||
async handler(code, id) {
|
||||
handler(code, id) {
|
||||
let s;
|
||||
const re = new RegExp(assetImportMetaUrlRE);
|
||||
const cleanString = stripLiteral(code);
|
||||
@@ -32650,7 +32665,7 @@ const licenseFiles = [
|
||||
function licensePlugin() {
|
||||
return {
|
||||
name: "vite:license",
|
||||
async generateBundle(_, bundle) {
|
||||
generateBundle(_, bundle) {
|
||||
const licenseOption = this.environment.config.build.license;
|
||||
if (licenseOption === false) return;
|
||||
const packageCache = /* @__PURE__ */ new Map();
|
||||
@@ -32852,7 +32867,7 @@ function resolveBuildEnvironmentOptions(raw, logger, consumer, isBundledDev, isS
|
||||
}
|
||||
};
|
||||
}
|
||||
async function resolveBuildPlugins(config) {
|
||||
function resolveBuildPlugins(config) {
|
||||
const isBuild = config.command === "build";
|
||||
return {
|
||||
pre: [
|
||||
@@ -33442,12 +33457,11 @@ async function createBuilder(inlineConfig = {}, useLegacyBuilder = false) {
|
||||
return output;
|
||||
},
|
||||
async runDevTools() {
|
||||
const devtoolsConfig = config.devtools;
|
||||
if (devtoolsConfig.enabled) try {
|
||||
const { start } = await import(`@vitejs/devtools/cli-commands`);
|
||||
await start(devtoolsConfig.config);
|
||||
if (config.devtools.enabled) try {
|
||||
const { runDevTools } = await import("@vitejs/devtools/integration");
|
||||
await runDevTools(builder);
|
||||
} catch (e) {
|
||||
config.logger.error(import_picocolors.default.red(`Failed to run Vite DevTools: ${e.message || e.stack}`), { error: e });
|
||||
config.logger.error(import_picocolors.default.red(`Failed to run Vite DevTools: ${e?.message || e?.stack}`), { error: e });
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -34096,14 +34110,14 @@ function getDefaultEnvironmentOptions(config) {
|
||||
* Check and warn if `path` includes characters that don't work well in Vite,
|
||||
* such as `#` and `?` and `*`.
|
||||
*/
|
||||
function checkBadCharactersInPath(name, path, logger) {
|
||||
function checkBadCharactersInPath(name, type, path, logger) {
|
||||
const badChars = [];
|
||||
if (path.includes("#")) badChars.push("#");
|
||||
if (path.includes("?")) badChars.push("?");
|
||||
if (path.includes("*")) badChars.push("*");
|
||||
if (badChars.length > 0) {
|
||||
const charString = badChars.map((c) => `"${c}"`).join(" and ");
|
||||
logger.warn(import_picocolors.default.yellow(`${name} contains the ${charString} ${badChars.length > 1 ? "characters" : "character"} (${import_picocolors.default.cyan(path)}), which may not work when running Vite. Consider renaming the directory / file to remove the characters.`));
|
||||
logger.warn(import_picocolors.default.yellow(`${name} contains the ${charString} ${badChars.length > 1 ? "characters" : "character"} (${import_picocolors.default.cyan(path)}), which may not work when running Vite. Consider renaming the ${type} without the characters.`));
|
||||
}
|
||||
}
|
||||
const clientAlias = [{
|
||||
@@ -34262,7 +34276,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
||||
const tsconfigPathsPlugin = userPlugins.find((p) => p.name === "vite-tsconfig-paths" || p.name === "vite-plugin-tsconfig-paths");
|
||||
if (tsconfigPathsPlugin) logger.warnOnce(import_picocolors.default.yellow(`The plugin ${JSON.stringify(tsconfigPathsPlugin.name)} is detected. Vite now supports tsconfig paths resolution natively via the ${import_picocolors.default.bold("resolve.tsconfigPaths")} option. You can remove the plugin and set ${import_picocolors.default.bold("resolve.tsconfigPaths: true")} in your Vite config instead.`));
|
||||
const resolvedRoot = normalizePath(config.root ? path.resolve(config.root) : process.cwd());
|
||||
checkBadCharactersInPath("The project root", resolvedRoot, logger);
|
||||
checkBadCharactersInPath("The project root", "directory", resolvedRoot, logger);
|
||||
const configEnvironmentsClient = config.environments.client;
|
||||
configEnvironmentsClient.dev ??= {};
|
||||
const deprecatedSsrOptimizeDepsConfig = config.ssr?.optimizeDeps ?? {};
|
||||
@@ -34308,7 +34322,7 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
||||
createEnvironment: void 0
|
||||
}
|
||||
};
|
||||
for (const name of Object.keys(config.environments)) config.environments[name] = mergeConfig(name === "client" ? defaultClientEnvironmentOptions : defaultNonClientEnvironmentOptions, config.environments[name]);
|
||||
for (const name of Object.keys(config.environments)) config.environments[name] = mergeConfig(name === "client" ? defaultClientEnvironmentOptions : deepClone(defaultNonClientEnvironmentOptions), config.environments[name]);
|
||||
await runConfigEnvironmentHook(config.environments, userPlugins, logger, configEnv, config.ssr?.target === "webworker");
|
||||
const isBundledDev = command === "serve" && !!config.experimental?.bundledDev;
|
||||
config.resolve ??= {};
|
||||
@@ -34509,7 +34523,6 @@ async function resolveConfig(inlineConfig, command, defaultMode = "development",
|
||||
optimizeDepsDisabledBackwardCompatibility(resolved, resolved.optimizeDeps);
|
||||
optimizeDepsDisabledBackwardCompatibility(resolved, resolved.ssr.optimizeDeps, "ssr.");
|
||||
if (!resolved.builder?.sharedConfigBuild && resolved.environments.ssr) resolved.environments.ssr.build.emitAssets = resolved.build.ssrEmitAssets || resolved.build.emitAssets;
|
||||
if (resolved.devtools.enabled) resolved.build.rolldownOptions.devtools ??= {};
|
||||
applyDepOptimizationOptionCompat(resolved);
|
||||
await setOptimizeDepsPluginNames(resolved);
|
||||
debug?.(`using resolved config: %O`, {
|
||||
@@ -34607,7 +34620,7 @@ async function loadConfigFromFile(configEnv, configFile, configRoot = process.cw
|
||||
};
|
||||
} catch (e) {
|
||||
const logger = createLogger(logLevel, { customLogger });
|
||||
checkBadCharactersInPath("The config path", resolvedPath, logger);
|
||||
checkBadCharactersInPath("The config path", "file", resolvedPath, logger);
|
||||
logger.error(import_picocolors.default.red(`failed to load config from ${resolvedPath}`), { error: e });
|
||||
throw e;
|
||||
}
|
||||
@@ -34660,7 +34673,7 @@ async function bundleConfigFile(fileName, isESM) {
|
||||
name: "externalize-deps",
|
||||
resolveId: {
|
||||
filter: { id: /^[^.#].*/ },
|
||||
async handler(id, importer, { kind }) {
|
||||
handler(id, importer, { kind }) {
|
||||
if (!importer || path.isAbsolute(id) || isNodeBuiltin(id)) return;
|
||||
if (isNodeLikeBuiltin(id) || id.startsWith("npm:")) return {
|
||||
id,
|
||||
|
||||
+10
-10
@@ -1,6 +1,6 @@
|
||||
import { i as __require, t as __commonJSMin } from "./chunk.js";
|
||||
import { t as require_lib } from "./lib.js";
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/format-import-prelude.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/format-import-prelude.js
|
||||
var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = function formatImportPrelude(layer, media, supports) {
|
||||
const parts = [];
|
||||
@@ -15,7 +15,7 @@ var require_format_import_prelude = /* @__PURE__ */ __commonJSMin(((exports, mod
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/base64-encoded-import.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/base64-encoded-import.js
|
||||
var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const formatImportPrelude = require_format_import_prelude();
|
||||
module.exports = function base64EncodedConditionalImport(prelude, conditions) {
|
||||
@@ -28,7 +28,7 @@ var require_base64_encoded_import = /* @__PURE__ */ __commonJSMin(((exports, mod
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/apply-conditions.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/apply-conditions.js
|
||||
var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const base64EncodedConditionalImport = require_base64_encoded_import();
|
||||
module.exports = function applyConditions(bundle, atRule) {
|
||||
@@ -103,7 +103,7 @@ var require_apply_conditions = /* @__PURE__ */ __commonJSMin(((exports, module)
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/apply-raws.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/apply-raws.js
|
||||
var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = function applyRaws(bundle) {
|
||||
bundle.forEach((stmt, index) => {
|
||||
@@ -117,7 +117,7 @@ var require_apply_raws = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/apply-styles.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/apply-styles.js
|
||||
var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = function applyStyles(bundle, styles) {
|
||||
styles.nodes = [];
|
||||
@@ -137,7 +137,7 @@ var require_apply_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/data-url.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/data-url.js
|
||||
var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const anyDataURLRegexp = /^data:text\/css(?:;(base64|plain))?,/i;
|
||||
const base64DataURLRegexp = /^data:text\/css;base64,/i;
|
||||
@@ -156,7 +156,7 @@ var require_data_url = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
};
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/parse-statements.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/parse-statements.js
|
||||
var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const valueParser = require_lib();
|
||||
const { stringify } = valueParser;
|
||||
@@ -281,7 +281,7 @@ var require_parse_statements = /* @__PURE__ */ __commonJSMin(((exports, module)
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/process-content.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/process-content.js
|
||||
var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const path$2 = __require("path");
|
||||
let sugarss;
|
||||
@@ -315,7 +315,7 @@ var require_process_content = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
||||
}
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/lib/parse-styles.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/lib/parse-styles.js
|
||||
var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const path$1 = __require("path");
|
||||
const dataURL = require_data_url();
|
||||
@@ -418,7 +418,7 @@ var require_parse_styles = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
module.exports = parseStyles;
|
||||
}));
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.10/node_modules/postcss-import/index.js
|
||||
//#region ../../node_modules/.pnpm/postcss-import@16.1.1_postcss@8.5.14/node_modules/postcss-import/index.js
|
||||
var require_postcss_import = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
||||
const path = __require("path");
|
||||
const applyConditions = require_apply_conditions();
|
||||
|
||||
+6
-2
@@ -31,7 +31,7 @@ import { GeneralImportGlobOptions, ImportGlobFunction, ImportGlobOptions, KnownA
|
||||
|
||||
//#region \0rolldown/runtime.js
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.14_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
|
||||
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.19_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/cli-commands.d.ts
|
||||
//#region src/node/cli-commands.d.ts
|
||||
interface StartOptions {
|
||||
root?: string;
|
||||
@@ -41,10 +41,14 @@ interface StartOptions {
|
||||
open?: boolean;
|
||||
}
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.14_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
|
||||
//#region ../../node_modules/.pnpm/@vitejs+devtools@0.1.19_typescript@6.0.2_vite@packages+vite/node_modules/@vitejs/devtools/dist/config.d.ts
|
||||
//#region src/node/config.d.ts
|
||||
interface DevToolsConfig extends Partial<StartOptions> {
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Vite environments to enable DevTools for. Defaults to all environments.
|
||||
*/
|
||||
environments?: string[];
|
||||
/**
|
||||
* Disable client authentication.
|
||||
*
|
||||
|
||||
+3
-3
@@ -526,7 +526,7 @@ const {${missingBindings.join(", ")}} = pkg;
|
||||
}
|
||||
}
|
||||
//#endregion
|
||||
//#region ../../node_modules/.pnpm/nanoid@5.1.9/node_modules/nanoid/non-secure/index.js
|
||||
//#region ../../node_modules/.pnpm/nanoid@5.1.11/node_modules/nanoid/non-secure/index.js
|
||||
let nanoid = (size = 21) => {
|
||||
let id = "", i = size | 0;
|
||||
for (; i--;) id += "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[Math.random() * 64 | 0];
|
||||
@@ -652,14 +652,14 @@ const createInvokeableTransport = (transport) => {
|
||||
return {
|
||||
async connect({ onMessage, onDisconnection }) {
|
||||
let socket = options.createConnection();
|
||||
socket.addEventListener("message", async ({ data }) => {
|
||||
socket.addEventListener("message", ({ data }) => {
|
||||
onMessage(JSON.parse(data));
|
||||
});
|
||||
let isOpened = socket.readyState === socket.OPEN;
|
||||
isOpened || await new Promise((resolve, reject) => {
|
||||
socket.addEventListener("open", () => {
|
||||
isOpened = !0, resolve();
|
||||
}, { once: !0 }), socket.addEventListener("close", async () => {
|
||||
}, { once: !0 }), socket.addEventListener("close", () => {
|
||||
if (!isOpened) {
|
||||
reject(/* @__PURE__ */ Error("WebSocket closed without opened."));
|
||||
return;
|
||||
|
||||
+13
-13
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vite",
|
||||
"version": "8.0.10",
|
||||
"version": "8.0.11",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Evan You",
|
||||
@@ -62,15 +62,15 @@
|
||||
"dependencies": {
|
||||
"lightningcss": "^1.32.0",
|
||||
"picomatch": "^4.0.4",
|
||||
"postcss": "^8.5.10",
|
||||
"rolldown": "1.0.0-rc.17",
|
||||
"postcss": "^8.5.14",
|
||||
"rolldown": "1.0.0-rc.18",
|
||||
"tinyglobby": "^0.2.16"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "~2.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/parser": "^7.29.2",
|
||||
"@babel/parser": "^7.29.3",
|
||||
"@jridgewell/remapping": "^2.3.5",
|
||||
"@jridgewell/trace-mapping": "^0.3.31",
|
||||
"@polka/compression": "^1.0.0-next.25",
|
||||
@@ -80,10 +80,10 @@
|
||||
"@vercel/detect-agent": "^1.2.3",
|
||||
"@types/escape-html": "^1.0.4",
|
||||
"@types/pnpapi": "^0.0.5",
|
||||
"@vitest/utils": "4.1.4",
|
||||
"@vitejs/devtools": "^0.1.14",
|
||||
"@vitest/utils": "4.1.5",
|
||||
"@vitejs/devtools": "^0.1.19",
|
||||
"artichokie": "^0.4.3",
|
||||
"baseline-browser-mapping": "^2.10.20",
|
||||
"baseline-browser-mapping": "^2.10.27",
|
||||
"cac": "^7.0.0",
|
||||
"chokidar": "^3.6.0",
|
||||
"connect": "^3.7.0",
|
||||
@@ -102,32 +102,32 @@
|
||||
"magic-string": "^0.30.21",
|
||||
"mlly": "^1.8.2",
|
||||
"mrmime": "^2.0.1",
|
||||
"nanoid": "^5.1.9",
|
||||
"nanoid": "^5.1.11",
|
||||
"obug": "^1.0.2",
|
||||
"open": "^10.2.0",
|
||||
"parse5": "^8.0.1",
|
||||
"pathe": "^2.0.3",
|
||||
"periscopic": "^4.0.2",
|
||||
"periscopic": "^4.0.3",
|
||||
"picocolors": "^1.1.1",
|
||||
"postcss-import": "^16.1.1",
|
||||
"postcss-load-config": "^6.0.1",
|
||||
"postcss-modules": "^6.0.1",
|
||||
"premove": "^4.0.0",
|
||||
"resolve.exports": "^2.0.3",
|
||||
"rolldown-plugin-dts": "^0.23.2",
|
||||
"rolldown-plugin-dts": "^0.24.1",
|
||||
"rollup": "^4.59.0",
|
||||
"rollup-plugin-license": "^3.7.1",
|
||||
"sass": "^1.99.0",
|
||||
"sass-embedded": "^1.99.0",
|
||||
"sirv": "^3.0.2",
|
||||
"strip-literal": "^3.1.0",
|
||||
"terser": "^5.46.1",
|
||||
"ufo": "^1.6.3",
|
||||
"terser": "^5.46.2",
|
||||
"ufo": "^1.6.4",
|
||||
"ws": "^8.20.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/node": "^20.19.0 || >=22.12.0",
|
||||
"@vitejs/devtools": "^0.1.0",
|
||||
"@vitejs/devtools": "^0.1.18",
|
||||
"esbuild": "^0.27.0 || ^0.28.0",
|
||||
"jiti": ">=1.21.0",
|
||||
"less": "^4.0.0",
|
||||
|
||||
Reference in New Issue
Block a user