diff --git a/package.json b/package.json index 6419ddbdc..ea7f6ca8e 100644 --- a/package.json +++ b/package.json @@ -71,12 +71,12 @@ "tsconfig-paths": "3.12.0", "tsup": "7.1.0", "typescript": "5.0.2", - "vitest": "0.28.4", + "vitest": "2.0.3", "wait-for-expect": "3.0.2" }, "peerDependencies": { - "@swc/core": "^1", "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", "postcss": "^8.4.12", "typescript": ">=4.5.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e769ff574..942e017a1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -128,39 +128,48 @@ devDependencies: specifier: 5.0.2 version: 5.0.2 vitest: - specifier: 0.28.4 - version: 0.28.4(sass@1.62.1)(terser@5.16.0) + specifier: 2.0.3 + version: 2.0.3(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0) wait-for-expect: specifier: 3.0.2 version: 3.0.2 packages: - /@babel/code-frame@7.22.13: - resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + /@ampproject/remapping@2.3.0: + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + dev: true + + /@babel/code-frame@7.24.7: + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} requiresBuild: true dependencies: - '@babel/highlight': 7.22.20 - chalk: 2.4.2 + '@babel/highlight': 7.24.7 + picocolors: 1.0.1 dev: true optional: true - /@babel/helper-validator-identifier@7.22.20: - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + /@babel/helper-validator-identifier@7.24.7: + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} requiresBuild: true dev: true optional: true - /@babel/highlight@7.22.20: - resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + /@babel/highlight@7.24.7: + resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} requiresBuild: true dependencies: - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.24.7 chalk: 2.4.2 js-tokens: 4.0.0 + picocolors: 1.0.1 dev: true optional: true @@ -170,7 +179,6 @@ packages: cpu: [ppc64] os: [aix] requiresBuild: true - dev: false optional: true /@esbuild/android-arm64@0.18.2: @@ -188,7 +196,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: false optional: true /@esbuild/android-arm@0.18.2: @@ -206,7 +213,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: false optional: true /@esbuild/android-x64@0.18.2: @@ -224,7 +230,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: false optional: true /@esbuild/darwin-arm64@0.18.2: @@ -242,7 +247,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: false optional: true /@esbuild/darwin-x64@0.18.2: @@ -260,7 +264,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: false optional: true /@esbuild/freebsd-arm64@0.18.2: @@ -278,7 +281,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: false optional: true /@esbuild/freebsd-x64@0.18.2: @@ -296,7 +298,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: false optional: true /@esbuild/linux-arm64@0.18.2: @@ -314,7 +315,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-arm@0.18.2: @@ -332,7 +332,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-ia32@0.18.2: @@ -350,7 +349,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-loong64@0.18.2: @@ -368,7 +366,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-mips64el@0.18.2: @@ -386,7 +383,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-ppc64@0.18.2: @@ -404,7 +400,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-riscv64@0.18.2: @@ -422,7 +417,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-s390x@0.18.2: @@ -440,7 +434,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/linux-x64@0.18.2: @@ -458,7 +451,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: false optional: true /@esbuild/netbsd-x64@0.18.2: @@ -476,7 +468,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: false optional: true /@esbuild/openbsd-x64@0.18.2: @@ -494,7 +485,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: false optional: true /@esbuild/sunos-x64@0.18.2: @@ -512,7 +502,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: false optional: true /@esbuild/win32-arm64@0.18.2: @@ -530,7 +519,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: false optional: true /@esbuild/win32-ia32@0.18.2: @@ -548,7 +536,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: false optional: true /@esbuild/win32-x64@0.18.2: @@ -566,7 +553,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: false optional: true /@jridgewell/gen-mapping@0.3.2: @@ -578,16 +564,35 @@ packages: '@jridgewell/trace-mapping': 0.3.17 dev: true + /@jridgewell/gen-mapping@0.3.5: + resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + dev: true + /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} dev: true + /@jridgewell/resolve-uri@3.1.2: + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + dev: true + /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} dev: true + /@jridgewell/set-array@1.2.1: + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + dev: true + /@jridgewell/source-map@0.3.2: resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==} dependencies: @@ -603,6 +608,10 @@ packages: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true + /@jridgewell/sourcemap-codec@1.5.0: + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + dev: true + /@jridgewell/trace-mapping@0.3.17: resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} dependencies: @@ -610,6 +619,13 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@jridgewell/trace-mapping@0.3.25: + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + dev: true + /@microsoft/api-extractor-model@7.28.2(@types/node@14.18.12): resolution: {integrity: sha512-vkojrM2fo3q4n4oPh4uUZdjJ2DxQ2+RnDQL/xhTWSRUNPF6P4QyrvY357HBxbnltKcYu+nNNolVqc6TIGQ73Ig==} dependencies: @@ -706,6 +722,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-android-arm-eabi@4.18.1: + resolution: {integrity: sha512-lncuC4aHicncmbORnx+dUaAgzee9cm/PbIqgWz1PpXuwc+sa1Ct83tnqUDy/GFKleLiN7ZIeytM6KJ4cAn1SxA==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-android-arm64@4.0.2: resolution: {integrity: sha512-lqCglytY3E6raze27DD9VQJWohbwCxzqs9aSHcj5X/8hJpzZfNdbsr4Ja9Hqp6iPyF53+5PtPx0pKRlkSvlHZg==} cpu: [arm64] @@ -713,6 +737,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-android-arm64@4.18.1: + resolution: {integrity: sha512-F/tkdw0WSs4ojqz5Ovrw5r9odqzFjb5LIgHdHZG65dFI1lWTWRVy32KDJLKRISHgJvqUeUhdIvy43fX41znyDg==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-darwin-arm64@4.0.2: resolution: {integrity: sha512-nkBKItS6E6CCzvRwgiKad+j+1ibmL7SIInj7oqMWmdkCjiSX6VeVZw2mLlRKIUL+JjsBgpATTfo7BiAXc1v0jA==} cpu: [arm64] @@ -720,6 +752,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-darwin-arm64@4.18.1: + resolution: {integrity: sha512-vk+ma8iC1ebje/ahpxpnrfVQJibTMyHdWpOGZ3JpQ7Mgn/3QNHmPq7YwjZbIE7km73dH5M1e6MRRsnEBW7v5CQ==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-darwin-x64@4.0.2: resolution: {integrity: sha512-vX2C8xvWPIbpEgQht95+dY6BReKAvtDgPDGi0XN0kWJKkm4WdNmq5dnwscv/zxvi+n6jUTBhs6GtpkkWT4q8Gg==} cpu: [x64] @@ -727,6 +767,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-darwin-x64@4.18.1: + resolution: {integrity: sha512-IgpzXKauRe1Tafcej9STjSSuG0Ghu/xGYH+qG6JwsAUxXrnkvNHcq/NL6nz1+jzvWAnQkuAJ4uIwGB48K9OCGA==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-arm-gnueabihf@4.0.2: resolution: {integrity: sha512-DVFIfcHOjgmeHOAqji4xNz2wczt1Bmzy9MwBZKBa83SjBVO/i38VHDR+9ixo8QpBOiEagmNw12DucG+v55tCrg==} cpu: [arm] @@ -734,6 +782,22 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-arm-gnueabihf@4.18.1: + resolution: {integrity: sha512-P9bSiAUnSSM7EmyRK+e5wgpqai86QOSv8BwvkGjLwYuOpaeomiZWifEos517CwbG+aZl1T4clSE1YqqH2JRs+g==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-musleabihf@4.18.1: + resolution: {integrity: sha512-5RnjpACoxtS+aWOI1dURKno11d7krfpGDEn19jI8BuWmSBbUC4ytIADfROM1FZrFhQPSoP+KEa3NlEScznBTyQ==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-arm64-gnu@4.0.2: resolution: {integrity: sha512-GCK/a9ItUxPI0V5hQEJjH4JtOJO90GF2Hja7TO+EZ8rmkGvEi8/ZDMhXmcuDpQT7/PWrTT9RvnG8snMd5SrhBQ==} cpu: [arm64] @@ -741,6 +805,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-arm64-gnu@4.18.1: + resolution: {integrity: sha512-8mwmGD668m8WaGbthrEYZ9CBmPug2QPGWxhJxh/vCgBjro5o96gL04WLlg5BA233OCWLqERy4YUzX3bJGXaJgQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-arm64-musl@4.0.2: resolution: {integrity: sha512-cLuBp7rOjIB1R2j/VazjCmHC7liWUur2e9mFflLJBAWCkrZ+X0+QwHLvOQakIwDymungzAKv6W9kHZnTp/Mqrg==} cpu: [arm64] @@ -748,6 +820,38 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-arm64-musl@4.18.1: + resolution: {integrity: sha512-dJX9u4r4bqInMGOAQoGYdwDP8lQiisWb9et+T84l2WXk41yEej8v2iGKodmdKimT8cTAYt0jFb+UEBxnPkbXEQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-powerpc64le-gnu@4.18.1: + resolution: {integrity: sha512-V72cXdTl4EI0x6FNmho4D502sy7ed+LuVW6Ym8aI6DRQ9hQZdp5sj0a2usYOlqvFBNKQnLQGwmYnujo2HvjCxQ==} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-riscv64-gnu@4.18.1: + resolution: {integrity: sha512-f+pJih7sxoKmbjghrM2RkWo2WHUW8UbfxIQiWo5yeCaCM0TveMEuAzKJte4QskBp1TIinpnRcxkquY+4WuY/tg==} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-s390x-gnu@4.18.1: + resolution: {integrity: sha512-qb1hMMT3Fr/Qz1OKovCuUM11MUNLUuHeBC2DPPAWUYYUAOFWaxInaTwTQmc7Fl5La7DShTEpmYwgdt2hG+4TEg==} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-x64-gnu@4.0.2: resolution: {integrity: sha512-Zqw4iVnJr2naoyQus0yLy7sLtisCQcpdMKUCeXPBjkJtpiflRime/TMojbnl8O3oxUAj92mxr+t7im/RbgA20w==} cpu: [x64] @@ -755,6 +859,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-x64-gnu@4.18.1: + resolution: {integrity: sha512-7O5u/p6oKUFYjRbZkL2FLbwsyoJAjyeXHCU3O4ndvzg2OFO2GinFPSJFGbiwFDaCFc+k7gs9CF243PwdPQFh5g==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-linux-x64-musl@4.0.2: resolution: {integrity: sha512-jJRU9TyUD/iMqjf8aLAp7XiN3pIj5v6Qcu+cdzBfVTKDD0Fvua4oUoK8eVJ9ZuKBEQKt3WdlcwJXFkpmMLk6kg==} cpu: [x64] @@ -762,6 +874,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-linux-x64-musl@4.18.1: + resolution: {integrity: sha512-pDLkYITdYrH/9Cv/Vlj8HppDuLMDUBmgsM0+N+xLtFd18aXgM9Nyqupb/Uw+HeidhfYg2lD6CXvz6CjoVOaKjQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-win32-arm64-msvc@4.0.2: resolution: {integrity: sha512-ZkS2NixCxHKC4zbOnw64ztEGGDVIYP6nKkGBfOAxEPW71Sji9v8z3yaHNuae/JHPwXA+14oDefnOuVfxl59SmQ==} cpu: [arm64] @@ -769,6 +889,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-win32-arm64-msvc@4.18.1: + resolution: {integrity: sha512-W2ZNI323O/8pJdBGil1oCauuCzmVd9lDmWBBqxYZcOqWD6aWqJtVBQ1dFrF4dYpZPks6F+xCZHfzG5hYlSHZ6g==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-win32-ia32-msvc@4.0.2: resolution: {integrity: sha512-3SKjj+tvnZ0oZq2BKB+fI+DqYI83VrRzk7eed8tJkxeZ4zxJZcLSE8YDQLYGq1tZAnAX+H076RHHB4gTZXsQzw==} cpu: [ia32] @@ -776,6 +904,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-win32-ia32-msvc@4.18.1: + resolution: {integrity: sha512-ELfEX1/+eGZYMaCIbK4jqLxO1gyTSOIlZr6pbC4SRYFaSIDVKOnZNMdoZ+ON0mrFDp4+H5MhwNC1H/AhE3zQLg==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rollup/rollup-win32-x64-msvc@4.0.2: resolution: {integrity: sha512-MBdJIOxRauKkry7t2q+rTHa3aWjVez2eioWg+etRVS3dE4tChhmt5oqZYr48R6bPmcwEhxQr96gVRfeQrLbqng==} cpu: [x64] @@ -783,6 +919,14 @@ packages: requiresBuild: true optional: true + /@rollup/rollup-win32-x64-msvc@4.18.1: + resolution: {integrity: sha512-yjk2MAkQmoaPYCSu35RLJ62+dz358nE83VfTePJRp8CG7aMg25mEJYpXFiD+NcevhX8LxD5OP5tktPXnXN7GDw==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rushstack/node-core-library@3.61.0(@types/node@14.18.12): resolution: {integrity: sha512-tdOjdErme+/YOu4gPed3sFS72GhtWCgNV9oDsHDnoLY5oDfwjKUc9Z+JOZZ37uAxcm/OCahDHfuu2ugqrfWAVQ==} peerDependencies: @@ -963,16 +1107,6 @@ packages: resolution: {integrity: sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==} dev: true - /@types/chai-subset@1.3.3: - resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} - dependencies: - '@types/chai': 4.3.4 - dev: true - - /@types/chai@4.3.4: - resolution: {integrity: sha512-KnRanxnpfpjUTqTCXslZSEdLfXExwgNxYPdiO2WGUj8+HDjFi8R3k5RVKPeSCzLjCcshCAtVO2QBbVuAV4kTnw==} - dev: true - /@types/debug@4.1.7: resolution: {integrity: sha512-9AonUzyTjXXhEOa0DnqpzZi6VHlqKMswga9EXjpXnnqxwLtdvPPtlO8evrI5D9S6asFRCQ6v+wpiUKbw+vKqyg==} dependencies: @@ -983,6 +1117,10 @@ packages: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true + /@types/estree@1.0.5: + resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} + dev: true + /@types/flat@5.0.2: resolution: {integrity: sha512-3zsplnP2djeps5P9OyarTxwRpMLoe5Ash8aL9iprw0JxB+FAHjY+ifn4yZUuW4/9hqtnmor6uvjSRzJhiVbrEQ==} dev: true @@ -1013,51 +1151,53 @@ packages: resolution: {integrity: sha512-Ku5+GPFa12S3W26Uwtw+xyrtIpaZsGYHH6zxNbZlstmlvMYSZRzOwzwsXbxlVUbHyUucctSyuFtu6bNxwYomIw==} dev: true - /@vitest/expect@0.28.4: - resolution: {integrity: sha512-JqK0NZ4brjvOSL8hXAnIsfi+jxDF7rH/ZWCGCt0FAqRnVFc1hXsfwXksQvEnKqD84avRt3gmeXoK4tNbmkoVsQ==} + /@vitest/expect@2.0.3: + resolution: {integrity: sha512-X6AepoOYePM0lDNUPsGXTxgXZAl3EXd0GYe/MZyVE4HzkUqyUVC6S3PrY5mClDJ6/7/7vALLMV3+xD/Ko60Hqg==} dependencies: - '@vitest/spy': 0.28.4 - '@vitest/utils': 0.28.4 - chai: 4.3.7 + '@vitest/spy': 2.0.3 + '@vitest/utils': 2.0.3 + chai: 5.1.1 + tinyrainbow: 1.2.0 dev: true - /@vitest/runner@0.28.4: - resolution: {integrity: sha512-Q8UV6GjDvBSTfUoq0QXVCNpNOUrWu4P2qvRq7ssJWzn0+S0ojbVOxEjMt+8a32X6SdkhF8ak+2nkppsqV0JyNQ==} + /@vitest/pretty-format@2.0.3: + resolution: {integrity: sha512-URM4GLsB2xD37nnTyvf6kfObFafxmycCL8un3OC9gaCs5cti2u+5rJdIflZ2fUJUen4NbvF6jCufwViAFLvz1g==} dependencies: - '@vitest/utils': 0.28.4 - p-limit: 4.0.0 - pathe: 1.1.0 + tinyrainbow: 1.2.0 dev: true - /@vitest/spy@0.28.4: - resolution: {integrity: sha512-8WuhfXLlvCXpNXEGJW6Gc+IKWI32435fQJLh43u70HnZ1otJOa2Cmg2Wy2Aym47ZnNCP4NolF+8cUPwd0MigKQ==} + /@vitest/runner@2.0.3: + resolution: {integrity: sha512-EmSP4mcjYhAcuBWwqgpjR3FYVeiA4ROzRunqKltWjBfLNs1tnMLtF+qtgd5ClTwkDP6/DGlKJTNa6WxNK0bNYQ==} dependencies: - tinyspy: 1.1.0 + '@vitest/utils': 2.0.3 + pathe: 1.1.2 dev: true - /@vitest/utils@0.28.4: - resolution: {integrity: sha512-l2QztOLdc2LkR+w/lP52RGh8hW+Ul4KESmCAgVE8q737I7e7bQoAfkARKpkPJ4JQtGpwW4deqlj1732VZD7TFw==} + /@vitest/snapshot@2.0.3: + resolution: {integrity: sha512-6OyA6v65Oe3tTzoSuRPcU6kh9m+mPL1vQ2jDlPdn9IQoUxl8rXhBnfICNOC+vwxWY684Vt5UPgtcA2aPFBb6wg==} dependencies: - cli-truncate: 3.1.0 - diff: 5.1.0 - loupe: 2.3.6 - picocolors: 1.0.0 - pretty-format: 27.5.1 + '@vitest/pretty-format': 2.0.3 + magic-string: 0.30.10 + pathe: 1.1.2 dev: true - /acorn-walk@8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} - engines: {node: '>=0.4.0'} + /@vitest/spy@2.0.3: + resolution: {integrity: sha512-sfqyAw/ypOXlaj4S+w8689qKM1OyPOqnonqOc9T91DsoHbfN5mU7FdifWWv3MtQFf0lEUstEwR9L/q/M390C+A==} + dependencies: + tinyspy: 3.0.0 dev: true - /acorn@8.8.1: - resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} - engines: {node: '>=0.4.0'} - hasBin: true + /@vitest/utils@2.0.3: + resolution: {integrity: sha512-c/UdELMuHitQbbc/EVctlBaxoYAwQPQdSNwv7z/vHyBKy2edYZaFgptE27BRueZB7eW8po+cllotMNTDpL3HWg==} + dependencies: + '@vitest/pretty-format': 2.0.3 + estree-walker: 3.0.3 + loupe: 3.1.1 + tinyrainbow: 1.2.0 dev: true - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn@8.8.1: + resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -1071,16 +1211,6 @@ packages: uri-js: 4.4.1 dev: true - /ansi-regex@5.0.1: - resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} - engines: {node: '>=8'} - dev: true - - /ansi-regex@6.0.1: - resolution: {integrity: sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==} - engines: {node: '>=12'} - dev: true - /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} @@ -1090,16 +1220,6 @@ packages: dev: true optional: true - /ansi-styles@5.2.0: - resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} - engines: {node: '>=10'} - dev: true - - /ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} - engines: {node: '>=12'} - dev: true - /any-promise@1.3.0: resolution: {integrity: sha1-q8av7tzqUugJzcA3au0845Y10X8=} @@ -1120,8 +1240,9 @@ packages: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - /assertion-error@1.1.0: - resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + /assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} dev: true /balanced-match@1.0.2: @@ -1181,17 +1302,15 @@ packages: engines: {node: '>=8'} dev: true - /chai@4.3.7: - resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} - engines: {node: '>=4'} + /chai@5.1.1: + resolution: {integrity: sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==} + engines: {node: '>=12'} dependencies: - assertion-error: 1.1.0 - check-error: 1.0.2 - deep-eql: 4.1.3 - get-func-name: 2.0.0 - loupe: 2.3.1 - pathval: 1.1.1 - type-detect: 4.0.8 + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.1.1 + pathval: 2.0.0 dev: true /chalk@2.4.2: @@ -1205,8 +1324,9 @@ packages: dev: true optional: true - /check-error@1.0.2: - resolution: {integrity: sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==} + /check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} dev: true /chokidar@3.5.2: @@ -1221,15 +1341,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 - - /cli-truncate@3.1.0: - resolution: {integrity: sha512-wfOBkjXteqSnI59oPcJkcPl/ZmwvMMOj340qUIY1SKZCv0B9Cf4D4fAucRkIKQmsIuYK3x1rrgU7MeGRruiuiA==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dependencies: - slice-ansi: 5.0.0 - string-width: 5.1.2 - dev: true + fsevents: 2.3.3 /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -1308,11 +1420,21 @@ packages: ms: 2.1.2 dev: true - /deep-eql@4.1.3: - resolution: {integrity: sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==} - engines: {node: '>=6'} + /debug@4.3.5: + resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true dependencies: - type-detect: 4.0.8 + ms: 2.1.2 + dev: true + + /deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} dev: true /detect-indent@6.1.0: @@ -1320,237 +1442,16 @@ packages: engines: {node: '>=8'} dev: true - /diff@5.1.0: - resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==} - engines: {node: '>=0.3.1'} - dev: true - /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} dependencies: path-type: 4.0.0 - /eastasianwidth@0.2.0: - resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: true - - /emoji-regex@9.2.2: - resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - dev: true - /es6-promise@3.3.1: resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} dev: true - /esbuild-android-64@0.14.50: - resolution: {integrity: sha512-H7iUEm7gUJHzidsBlFPGF6FTExazcgXL/46xxLo6i6bMtPim6ZmXyTccS8yOMpy6HAC6dPZ/JCQqrkkin69n6Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-android-arm64@0.14.50: - resolution: {integrity: sha512-NFaoqEwa+OYfoYVpQWDMdKII7wZZkAjtJFo1WdnBeCYlYikvUhTnf2aPwPu5qEAw/ie1NYK0yn3cafwP+kP+OQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-64@0.14.50: - resolution: {integrity: sha512-gDQsCvGnZiJv9cfdO48QqxkRV8oKAXgR2CGp7TdIpccwFdJMHf8hyIJhMW/05b/HJjET/26Us27Jx91BFfEVSA==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-arm64@0.14.50: - resolution: {integrity: sha512-36nNs5OjKIb/Q50Sgp8+rYW/PqirRiFN0NFc9hEvgPzNJxeJedktXwzfJSln4EcRFRh5Vz4IlqFRScp+aiBBzA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-64@0.14.50: - resolution: {integrity: sha512-/1pHHCUem8e/R86/uR+4v5diI2CtBdiWKiqGuPa9b/0x3Nwdh5AOH7lj+8823C6uX1e0ufwkSLkS+aFZiBCWxA==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-arm64@0.14.50: - resolution: {integrity: sha512-iKwUVMQztnPZe5pUYHdMkRc9aSpvoV1mkuHlCoPtxZA3V+Kg/ptpzkcSY+fKd0kuom+l6Rc93k0UPVkP7xoqrw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-32@0.14.50: - resolution: {integrity: sha512-sWUwvf3uz7dFOpLzYuih+WQ7dRycrBWHCdoXJ4I4XdMxEHCECd8b7a9N9u7FzT6XR2gHPk9EzvchQUtiEMRwqw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-64@0.14.50: - resolution: {integrity: sha512-u0PQxPhaeI629t4Y3EEcQ0wmWG+tC/LpP2K7yDFvwuPq0jSQ8SIN+ARNYfRjGW15O2we3XJvklbGV0wRuUCPig==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm64@0.14.50: - resolution: {integrity: sha512-ZyfoNgsTftD7Rp5S7La5auomKdNeB3Ck+kSKXC4pp96VnHyYGjHHXWIlcbH8i+efRn9brszo1/Thl1qn8RqmhQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm@0.14.50: - resolution: {integrity: sha512-VALZq13bhmFJYFE/mLEb+9A0w5vo8z+YDVOWeaf9vOTrSC31RohRIwtxXBnVJ7YKLYfEMzcgFYf+OFln3Y0cWg==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-mips64le@0.14.50: - resolution: {integrity: sha512-ygo31Vxn/WrmjKCHkBoutOlFG5yM9J2UhzHb0oWD9O61dGg+Hzjz9hjf5cmM7FBhAzdpOdEWHIrVOg2YAi6rTw==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-ppc64le@0.14.50: - resolution: {integrity: sha512-xWCKU5UaiTUT6Wz/O7GKP9KWdfbsb7vhfgQzRfX4ahh5NZV4ozZ4+SdzYG8WxetsLy84UzLX3Pi++xpVn1OkFQ==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-riscv64@0.14.50: - resolution: {integrity: sha512-0+dsneSEihZTopoO9B6Z6K4j3uI7EdxBP7YSF5rTwUgCID+wHD3vM1gGT0m+pjCW+NOacU9kH/WE9N686FHAJg==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-s390x@0.14.50: - resolution: {integrity: sha512-tVjqcu8o0P9H4StwbIhL1sQYm5mWATlodKB6dpEZFkcyTI8kfIGWiWcrGmkNGH2i1kBUOsdlBafPxR3nzp3TDA==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-netbsd-64@0.14.50: - resolution: {integrity: sha512-0R/glfqAQ2q6MHDf7YJw/TulibugjizBxyPvZIcorH0Mb7vSimdHy0XF5uCba5CKt+r4wjax1mvO9lZ4jiAhEg==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-openbsd-64@0.14.50: - resolution: {integrity: sha512-7PAtmrR5mDOFubXIkuxYQ4bdNS6XCK8AIIHUiZxq1kL8cFIH5731jPcXQ4JNy/wbj1C9sZ8rzD8BIM80Tqk29w==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-sunos-64@0.14.50: - resolution: {integrity: sha512-gBxNY/wyptvD7PkHIYcq7se6SQEXcSC8Y7mE0FJB+CGgssEWf6vBPfTTZ2b6BWKnmaP6P6qb7s/KRIV5T2PxsQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-32@0.14.50: - resolution: {integrity: sha512-MOOe6J9cqe/iW1qbIVYSAqzJFh0p2LBLhVUIWdMVnNUNjvg2/4QNX4oT4IzgDeldU+Bym9/Tn6+DxvUHJXL5Zw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-64@0.14.50: - resolution: {integrity: sha512-r/qE5Ex3w1jjGv/JlpPoWB365ldkppUlnizhMxJgojp907ZF1PgLTuW207kgzZcSCXyquL9qJkMsY+MRtaZ5yQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-arm64@0.14.50: - resolution: {integrity: sha512-EMS4lQnsIe12ZyAinOINx7eq2mjpDdhGZZWDwPZE/yUTN9cnc2Ze/xUTYIAyaJqrqQda3LnDpADKpvLvol6ENQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild@0.14.50: - resolution: {integrity: sha512-SbC3k35Ih2IC6trhbMYW7hYeGdjPKf9atTKwBUHqMCYFZZ9z8zhuvfnZihsnJypl74FjiAKjBRqFkBkAd0rS/w==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - esbuild-android-64: 0.14.50 - esbuild-android-arm64: 0.14.50 - esbuild-darwin-64: 0.14.50 - esbuild-darwin-arm64: 0.14.50 - esbuild-freebsd-64: 0.14.50 - esbuild-freebsd-arm64: 0.14.50 - esbuild-linux-32: 0.14.50 - esbuild-linux-64: 0.14.50 - esbuild-linux-arm: 0.14.50 - esbuild-linux-arm64: 0.14.50 - esbuild-linux-mips64le: 0.14.50 - esbuild-linux-ppc64le: 0.14.50 - esbuild-linux-riscv64: 0.14.50 - esbuild-linux-s390x: 0.14.50 - esbuild-netbsd-64: 0.14.50 - esbuild-openbsd-64: 0.14.50 - esbuild-sunos-64: 0.14.50 - esbuild-windows-32: 0.14.50 - esbuild-windows-64: 0.14.50 - esbuild-windows-arm64: 0.14.50 - dev: true - /esbuild@0.18.2: resolution: {integrity: sha512-1P4sK9gXVcjvrrUjE94Hbo9goU+T6U1sdzLf+JJ+3uI6GEb4e4n3Wrqto9hZHUWabblpT2ifmC61LhZnLyTNFw==} engines: {node: '>=12'} @@ -1610,7 +1511,6 @@ packages: '@esbuild/win32-arm64': 0.21.4 '@esbuild/win32-ia32': 0.21.4 '@esbuild/win32-x64': 0.21.4 - dev: false /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} @@ -1623,6 +1523,12 @@ packages: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: true + /estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + dependencies: + '@types/estree': 1.0.5 + dev: true + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -1637,6 +1543,21 @@ packages: signal-exit: 3.0.6 strip-final-newline: 2.0.0 + /execa@8.0.1: + resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} + engines: {node: '>=16.17'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + dev: true + /fast-deep-equal@3.1.3: resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} dev: true @@ -1692,8 +1613,8 @@ packages: /fs.realpath@1.0.0: resolution: {integrity: sha1-FQStJSMVjKpA20onh8sBQRmU6k8=} - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -1703,14 +1624,19 @@ packages: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true - /get-func-name@2.0.0: - resolution: {integrity: sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==} + /get-func-name@2.0.2: + resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} dev: true /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} + /get-stream@8.0.1: + resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} + engines: {node: '>=16'} + dev: true + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} @@ -1760,6 +1686,11 @@ packages: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} + /human-signals@5.0.0: + resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} + engines: {node: '>=16.17.0'} + dev: true + /ignore@5.1.9: resolution: {integrity: sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==} engines: {node: '>= 4'} @@ -1804,11 +1735,6 @@ packages: resolution: {integrity: sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=} engines: {node: '>=0.10.0'} - /is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - dev: true - /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} @@ -1823,6 +1749,11 @@ packages: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} + /is-stream@3.0.0: + resolution: {integrity: sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + /isexe@2.0.0: resolution: {integrity: sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=} @@ -1851,10 +1782,6 @@ packages: minimist: 1.2.5 dev: true - /jsonc-parser@3.2.0: - resolution: {integrity: sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w==} - dev: true - /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -1880,11 +1807,6 @@ packages: resolution: {integrity: sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - /local-pkg@0.4.2: - resolution: {integrity: sha512-mlERgSPrbxU3BP4qBqAvvwlgW4MTg78iwJdGGnv7kibKjWcJksrG3t6LB5lXI93wXRDvG4NpUgJFmTG4T6rdrg==} - engines: {node: '>=14'} - dev: true - /lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} dev: true @@ -1900,16 +1822,10 @@ packages: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /loupe@2.3.1: - resolution: {integrity: sha512-EN1D3jyVmaX4tnajVlfbREU4axL647hLec1h/PXAb8CPDMJiYitcWF2UeLVNttRqaIqQs4x+mRvXf+d+TlDrCA==} + /loupe@3.1.1: + resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==} dependencies: - get-func-name: 2.0.0 - dev: true - - /loupe@2.3.6: - resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} - dependencies: - get-func-name: 2.0.0 + get-func-name: 2.0.2 dev: true /lru-cache@6.0.0: @@ -1926,6 +1842,12 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /magic-string@0.30.10: + resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==} + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + dev: true + /magic-string@0.30.4: resolution: {integrity: sha512-Q/TKtsC5BPm0kGqgBIF9oXAs/xEf2vRKiIB4wCRQTJOQIByZ1d+NnUOotvJOvNpi5RNIgVOMC3pOuaP1ZTDlVg==} engines: {node: '>=12'} @@ -1951,6 +1873,11 @@ packages: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} + /mimic-fn@4.0.0: + resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} + engines: {node: '>=12'} + dev: true + /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -1976,15 +1903,6 @@ packages: minimist: 1.2.8 dev: true - /mlly@1.1.0: - resolution: {integrity: sha512-cwzBrBfwGC1gYJyfcy8TcZU1f+dbH/T+TuOhtYP2wLv/Fb51/uV7HJQfBPtEupZ2ORLRU1EKFS/QfS3eo9+kBQ==} - dependencies: - acorn: 8.8.2 - pathe: 1.1.0 - pkg-types: 1.0.1 - ufo: 1.0.1 - dev: true - /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} @@ -2000,8 +1918,8 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true - /nanoid@3.3.4: - resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + /nanoid@3.3.7: + resolution: {integrity: sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true dev: true @@ -2020,6 +1938,13 @@ packages: dependencies: path-key: 3.1.1 + /npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + path-key: 4.0.0 + dev: true + /object-assign@4.1.1: resolution: {integrity: sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=} engines: {node: '>=0.10.0'} @@ -2035,11 +1960,11 @@ packages: dependencies: mimic-fn: 2.1.0 - /p-limit@4.0.0: - resolution: {integrity: sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /onetime@6.0.0: + resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} + engines: {node: '>=12'} dependencies: - yocto-queue: 1.0.0 + mimic-fn: 4.0.0 dev: true /path-is-absolute@1.0.1: @@ -2050,6 +1975,11 @@ packages: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} + /path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + dev: true + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true @@ -2058,17 +1988,22 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - /pathe@1.1.0: - resolution: {integrity: sha512-ODbEPR0KKHqECXW1GoxdDb+AZvULmXjVPy4rt+pGo2+TnjJTIPJQSVS6N63n8T2Ip+syHhbn52OewKicV0373w==} + /pathe@1.1.2: + resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} dev: true - /pathval@1.1.1: - resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + /pathval@2.0.0: + resolution: {integrity: sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==} + engines: {node: '>= 14.16'} dev: true /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + /picocolors@1.0.1: + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + dev: true + /picomatch@2.3.0: resolution: {integrity: sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==} engines: {node: '>=8.6'} @@ -2084,14 +2019,6 @@ packages: dependencies: node-modules-regexp: 1.0.0 - /pkg-types@1.0.1: - resolution: {integrity: sha512-jHv9HB+Ho7dj6ItwppRDDl0iZRYBD0jsakHXtFgoLr+cHSF6xC+QL54sJmWxyGxOLYSHm0afhXhXcQDQqH9z8g==} - dependencies: - jsonc-parser: 3.2.0 - mlly: 1.1.0 - pathe: 1.1.0 - dev: true - /postcss-load-config@4.0.1(postcss@8.4.12): resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} @@ -2125,13 +2052,13 @@ packages: picocolors: 1.0.0 source-map-js: 1.0.2 - /postcss@8.4.14: - resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} + /postcss@8.4.39: + resolution: {integrity: sha512-0vzE+lAiG7hZl1/9I8yzKLx3aR9Xbof3fBHKunvMfOCYAtMhrsnccJY2iTURb9EZd5+pLuiNV9/c/GZJOHsgIw==} engines: {node: ^10 || ^12 || >=14} dependencies: - nanoid: 3.3.4 - picocolors: 1.0.0 - source-map-js: 1.0.2 + nanoid: 3.3.7 + picocolors: 1.0.1 + source-map-js: 1.2.0 dev: true /prettier@3.3.3: @@ -2140,15 +2067,6 @@ packages: hasBin: true dev: true - /pretty-format@27.5.1: - resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} - engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} - dependencies: - ansi-regex: 5.0.1 - ansi-styles: 5.2.0 - react-is: 17.0.2 - dev: true - /punycode@2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} @@ -2156,10 +2074,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - /react-is@17.0.2: - resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} - dev: true - /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} @@ -2215,15 +2129,7 @@ packages: rollup: 4.0.2 typescript: 5.0.2 optionalDependencies: - '@babel/code-frame': 7.22.13 - dev: true - - /rollup@2.77.0: - resolution: {integrity: sha512-vL8xjY4yOQEw79DvyXLijhnhh+R/O9zpF/LEgkCebZFtb6ELeN9H3/2T0r8+mp+fFTBHZ5qGpOpW2ela2zRt3g==} - engines: {node: '>=10.0.0'} - hasBin: true - optionalDependencies: - fsevents: 2.3.2 + '@babel/code-frame': 7.24.7 dev: true /rollup@3.25.0: @@ -2231,7 +2137,7 @@ packages: engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /rollup@4.0.2: @@ -2251,7 +2157,33 @@ packages: '@rollup/rollup-win32-arm64-msvc': 4.0.2 '@rollup/rollup-win32-ia32-msvc': 4.0.2 '@rollup/rollup-win32-x64-msvc': 4.0.2 - fsevents: 2.3.2 + fsevents: 2.3.3 + + /rollup@4.18.1: + resolution: {integrity: sha512-Elx2UT8lzxxOXMpy5HWQGZqkrQOtrVDDa/bm9l10+U4rQnVzbL/LgZ4NOM1MPIDyHk69W4InuYDF5dzRh4Kw1A==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + dependencies: + '@types/estree': 1.0.5 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.18.1 + '@rollup/rollup-android-arm64': 4.18.1 + '@rollup/rollup-darwin-arm64': 4.18.1 + '@rollup/rollup-darwin-x64': 4.18.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.1 + '@rollup/rollup-linux-arm-musleabihf': 4.18.1 + '@rollup/rollup-linux-arm64-gnu': 4.18.1 + '@rollup/rollup-linux-arm64-musl': 4.18.1 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.1 + '@rollup/rollup-linux-riscv64-gnu': 4.18.1 + '@rollup/rollup-linux-s390x-gnu': 4.18.1 + '@rollup/rollup-linux-x64-gnu': 4.18.1 + '@rollup/rollup-linux-x64-musl': 4.18.1 + '@rollup/rollup-win32-arm64-msvc': 4.18.1 + '@rollup/rollup-win32-ia32-msvc': 4.18.1 + '@rollup/rollup-win32-x64-msvc': 4.18.1 + fsevents: 2.3.3 + dev: true /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} @@ -2302,18 +2234,15 @@ packages: /signal-exit@3.0.6: resolution: {integrity: sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==} + /signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + dev: true + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - /slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - dev: true - /sorcery@0.11.0: resolution: {integrity: sha512-J69LQ22xrQB1cIFJhPfgtLuI6BpWRiWu1Y3vSsIwK/eAScqJxd/+CJlUuHQRdX2C9NGFamq+KqNywGgaThwfHw==} hasBin: true @@ -2328,6 +2257,11 @@ packages: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} + /source-map-js@1.2.0: + resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} + engines: {node: '>=0.10.0'} + dev: true + /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: @@ -2354,8 +2288,8 @@ packages: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true - /std-env@3.3.2: - resolution: {integrity: sha512-uUZI65yrV2Qva5gqE0+A7uVAvO40iPo6jGhs7s8keRfHCmtg+uB2X6EiLGCI9IgL1J17xGhvoOqSz79lzICPTA==} + /std-env@3.7.0: + resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} dev: true /string-argv@0.3.2: @@ -2363,22 +2297,6 @@ packages: engines: {node: '>=0.6.19'} dev: true - /string-width@5.1.2: - resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} - engines: {node: '>=12'} - dependencies: - eastasianwidth: 0.2.0 - emoji-regex: 9.2.2 - strip-ansi: 7.0.1 - dev: true - - /strip-ansi@7.0.1: - resolution: {integrity: sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==} - engines: {node: '>=12'} - dependencies: - ansi-regex: 6.0.1 - dev: true - /strip-bom@3.0.0: resolution: {integrity: sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=} engines: {node: '>=4'} @@ -2388,6 +2306,11 @@ packages: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} + /strip-final-newline@3.0.0: + resolution: {integrity: sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==} + engines: {node: '>=12'} + dev: true + /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} @@ -2405,12 +2328,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /strip-literal@1.0.1: - resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} - dependencies: - acorn: 8.8.2 - dev: true - /sucrase@3.20.3: resolution: {integrity: sha512-azqwq0/Bs6RzLAdb4dXxsCgMtAaD2hzmUr4UhSfsxO46JFPAwMnnb441B/qsudZiS6Ylea3JXZe3Q497lsgXzQ==} engines: {node: '>=8'} @@ -2514,17 +2431,22 @@ packages: dependencies: any-promise: 1.3.0 - /tinybench@2.3.1: - resolution: {integrity: sha512-hGYWYBMPr7p4g5IarQE7XhlyWveh1EKhy4wUBS1LrHXCKYgvz+4/jCqgmJqZxxldesn05vccrtME2RLLZNW7iA==} + /tinybench@2.8.0: + resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} + dev: true + + /tinypool@1.0.0: + resolution: {integrity: sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==} + engines: {node: ^18.0.0 || >=20.0.0} dev: true - /tinypool@0.3.1: - resolution: {integrity: sha512-zLA1ZXlstbU2rlpA4CIeVaqvWq41MTWqLY3FfsAXgC8+f7Pk7zroaJQxDgxn1xNudKW6Kmj4808rPFShUlIRmQ==} + /tinyrainbow@1.2.0: + resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} dev: true - /tinyspy@1.1.0: - resolution: {integrity: sha512-xdHzOlnGb1hxNdgO/45hp9ngVKhyN9fD1LH/3059kmHyUT/qZ+ee2y8F/BuaIQpK2r6l/kLLXwezfMpedc5Ycw==} + /tinyspy@3.0.0: + resolution: {integrity: sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==} engines: {node: '>=14.0.0'} dev: true @@ -2601,11 +2523,6 @@ packages: - ts-node dev: true - /type-detect@4.0.8: - resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} - engines: {node: '>=4'} - dev: true - /typescript@5.0.2: resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} engines: {node: '>=12.20'} @@ -2618,10 +2535,6 @@ packages: hasBin: true dev: true - /ufo@1.0.1: - resolution: {integrity: sha512-boAm74ubXHY7KJQZLlXrtMz52qFvpsbOxDcZOnw/Wf+LS4Mmyu7JxmzD4tDLtUQtmZECypJ0FrCz4QIe6dvKRA==} - dev: true - /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -2643,69 +2556,81 @@ packages: engines: {node: '>= 0.10'} dev: true - /vite-node@0.28.4(sass@1.62.1)(terser@5.16.0): - resolution: {integrity: sha512-KM0Q0uSG/xHHKOJvVHc5xDBabgt0l70y7/lWTR7Q0pR5/MrYxadT+y32cJOE65FfjGmJgxpVEEY+69btJgcXOQ==} - engines: {node: '>=v14.16.0'} + /vite-node@2.0.3(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0): + resolution: {integrity: sha512-14jzwMx7XTcMB+9BhGQyoEAmSl0eOr3nrnn+Z12WNERtOvLN+d2scbRUvyni05rT3997Bg+rZb47NyP4IQPKXg==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4 - mlly: 1.1.0 - pathe: 1.1.0 - picocolors: 1.0.0 - source-map: 0.6.1 - source-map-support: 0.5.21 - vite: 3.0.3(sass@1.62.1)(terser@5.16.0) + debug: 4.3.5 + pathe: 1.1.2 + tinyrainbow: 1.2.0 + vite: 5.3.4(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0) transitivePeerDependencies: + - '@types/node' - less + - lightningcss - sass - stylus + - sugarss - supports-color - terser dev: true - /vite@3.0.3(sass@1.62.1)(terser@5.16.0): - resolution: {integrity: sha512-sDIpIcl3mv1NUaSzZwiXGEy1ZoWwwC2vkxUHY6yiDacR6zf//ZFuBJrozO62gedpE43pmxnLATNR5IYUdAEkMQ==} - engines: {node: ^14.18.0 || >=16.0.0} + /vite@5.3.4(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0): + resolution: {integrity: sha512-Cw+7zL3ZG9/NZBB8C+8QbQZmR54GwqIz+WMI4b3JgdYJvX+ny9AjJXqkGQlDXSXRP9rP0B4tbciRMOVEKulVOA==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: + '@types/node': ^18.0.0 || >=20.0.0 less: '*' + lightningcss: ^1.21.0 sass: '*' stylus: '*' + sugarss: '*' terser: ^5.4.0 peerDependenciesMeta: + '@types/node': + optional: true less: optional: true + lightningcss: + optional: true sass: optional: true stylus: optional: true + sugarss: + optional: true terser: optional: true dependencies: - esbuild: 0.14.50 - postcss: 8.4.14 - resolve: 1.22.1 - rollup: 2.77.0 + '@types/node': 14.18.12 + esbuild: 0.21.4 + postcss: 8.4.39 + rollup: 4.18.1 sass: 1.62.1 terser: 5.16.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /vitest@0.28.4(sass@1.62.1)(terser@5.16.0): - resolution: {integrity: sha512-sfWIy0AdlbyGRhunm+TLQEJrFH9XuRPdApfubsyLcDbCRrUX717BRQKInTgzEfyl2Ipi1HWoHB84Nqtcwxogcg==} - engines: {node: '>=v14.16.0'} + /vitest@2.0.3(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0): + resolution: {integrity: sha512-o3HRvU93q6qZK4rI2JrhKyZMMuxg/JRt30E6qeQs6ueaiz5hr1cPj+Sk2kATgQzMMqsa2DiNI0TIK++1ULx8Jw==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 2.0.3 + '@vitest/ui': 2.0.3 happy-dom: '*' jsdom: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@types/node': + optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -2715,34 +2640,32 @@ packages: jsdom: optional: true dependencies: - '@types/chai': 4.3.4 - '@types/chai-subset': 1.3.3 + '@ampproject/remapping': 2.3.0 '@types/node': 14.18.12 - '@vitest/expect': 0.28.4 - '@vitest/runner': 0.28.4 - '@vitest/spy': 0.28.4 - '@vitest/utils': 0.28.4 - acorn: 8.8.1 - acorn-walk: 8.2.0 - cac: 6.7.14 - chai: 4.3.7 - debug: 4.3.4 - local-pkg: 0.4.2 - pathe: 1.1.0 - picocolors: 1.0.0 - source-map: 0.6.1 - std-env: 3.3.2 - strip-literal: 1.0.1 - tinybench: 2.3.1 - tinypool: 0.3.1 - tinyspy: 1.1.0 - vite: 3.0.3(sass@1.62.1)(terser@5.16.0) - vite-node: 0.28.4(sass@1.62.1)(terser@5.16.0) - why-is-node-running: 2.2.2 + '@vitest/expect': 2.0.3 + '@vitest/pretty-format': 2.0.3 + '@vitest/runner': 2.0.3 + '@vitest/snapshot': 2.0.3 + '@vitest/spy': 2.0.3 + '@vitest/utils': 2.0.3 + chai: 5.1.1 + debug: 4.3.5 + execa: 8.0.1 + magic-string: 0.30.10 + pathe: 1.1.2 + std-env: 3.7.0 + tinybench: 2.8.0 + tinypool: 1.0.0 + tinyrainbow: 1.2.0 + vite: 5.3.4(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0) + vite-node: 2.0.3(@types/node@14.18.12)(sass@1.62.1)(terser@5.16.0) + why-is-node-running: 2.3.0 transitivePeerDependencies: - less + - lightningcss - sass - stylus + - sugarss - supports-color - terser dev: true @@ -2768,8 +2691,8 @@ packages: dependencies: isexe: 2.0.0 - /why-is-node-running@2.2.2: - resolution: {integrity: sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==} + /why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} engines: {node: '>=8'} hasBin: true dependencies: @@ -2788,11 +2711,6 @@ packages: resolution: {integrity: sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==} engines: {node: '>= 14'} - /yocto-queue@1.0.0: - resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} - engines: {node: '>=12.20'} - dev: true - /z-schema@5.0.5: resolution: {integrity: sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==} engines: {node: '>=8.0.0'} diff --git a/test/__snapshots__/css.test.ts.snap b/test/__snapshots__/css.test.ts.snap new file mode 100644 index 000000000..98d077ebd --- /dev/null +++ b/test/__snapshots__/css.test.ts.snap @@ -0,0 +1,16 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`import css 1`] = ` +""use strict"; +" +`; + +exports[`import css in --dts 1`] = ` +""use strict"; +" +`; + +exports[`support tailwindcss postcss plugin 1`] = ` +""use strict"; +" +`; diff --git a/test/__snapshots__/dts.test.ts.snap b/test/__snapshots__/dts.test.ts.snap new file mode 100644 index 000000000..c1be5fe47 --- /dev/null +++ b/test/__snapshots__/dts.test.ts.snap @@ -0,0 +1,272 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`declaration files with multiple entrypoints #316 1`] = ` +"declare const foo = 1; + +export { foo }; +" +`; + +exports[`declaration files with multiple entrypoints #316 2`] = ` +"declare const bar = "bar"; + +export { bar }; +" +`; + +exports[`enable --dts-resolve for specific module 1`] = ` +"export * from 'vue'; + +type MarkRequired = Exclude & Required> + +export type { MarkRequired }; +" +`; + +exports[`not bundle \`package/subpath\` in dts (resolve) 1`] = ` +"import * as foo_bar from 'foo/bar'; + +declare const stuff: foo_bar.Foobar; + +export { stuff }; +" +`; + +exports[`should emit declaration files with experimentalDts 1`] = ` +" +////////////////////////////////////////////////////////////////////// +// dist/_tsup-dts-rollup.d.mts +////////////////////////////////////////////////////////////////////// + +import { renderToNodeStream } from 'react-dom/server'; +import { renderToStaticMarkup } from 'react-dom/server'; +import { renderToStaticNodeStream } from 'react-dom/server'; +import { renderToString } from 'react-dom/server'; +import * as ServerThirdPartyNamespace from 'react-dom'; +import { version } from 'react-dom/server'; + +declare interface ClientRenderOptions { + document: boolean; +} +export { ClientRenderOptions } +export { ClientRenderOptions as ClientRenderOptions_alias_1 } + +export declare function default_alias(options: ServerRenderOptions): void; + +declare function render(options: ClientRenderOptions): string; +export { render } +export { render as render_alias_1 } + +/** + * Comment for server render function + */ +export declare function render_alias_2(options: ServerRenderOptions): string; + +export { renderToNodeStream } + +export { renderToStaticMarkup } + +export { renderToStaticNodeStream } + +export { renderToString } + +export declare class ServerClass { +} + +declare const serverConstant = 1; +export { serverConstant } +export { serverConstant as serverConstantAlias } + +export declare interface ServerRenderOptions { + /** + * Comment for ServerRenderOptions.stream + * + * @public + * + * @my_custom_tag + */ + stream: boolean; +} + +export { ServerThirdPartyNamespace } + +declare function sharedFunction(value: T): T | null; +export { sharedFunction } +export { sharedFunction as sharedFunction_alias_1 } +export { sharedFunction as sharedFunction_alias_2 } +export { sharedFunction as sharedFunction_alias_3 } + +declare type sharedType = { + shared: boolean; +}; +export { sharedType } +export { sharedType as sharedType_alias_1 } +export { sharedType as sharedType_alias_2 } +export { sharedType as sharedType_alias_3 } + +export declare const VERSION: "0.0.0"; + +export { version } + +export { } + + +////////////////////////////////////////////////////////////////////// +// dist/_tsup-dts-rollup.d.ts +////////////////////////////////////////////////////////////////////// + +import { renderToNodeStream } from 'react-dom/server'; +import { renderToStaticMarkup } from 'react-dom/server'; +import { renderToStaticNodeStream } from 'react-dom/server'; +import { renderToString } from 'react-dom/server'; +import * as ServerThirdPartyNamespace from 'react-dom'; +import { version } from 'react-dom/server'; + +declare interface ClientRenderOptions { + document: boolean; +} +export { ClientRenderOptions } +export { ClientRenderOptions as ClientRenderOptions_alias_1 } + +export declare function default_alias(options: ServerRenderOptions): void; + +declare function render(options: ClientRenderOptions): string; +export { render } +export { render as render_alias_1 } + +/** + * Comment for server render function + */ +export declare function render_alias_2(options: ServerRenderOptions): string; + +export { renderToNodeStream } + +export { renderToStaticMarkup } + +export { renderToStaticNodeStream } + +export { renderToString } + +export declare class ServerClass { +} + +declare const serverConstant = 1; +export { serverConstant } +export { serverConstant as serverConstantAlias } + +export declare interface ServerRenderOptions { + /** + * Comment for ServerRenderOptions.stream + * + * @public + * + * @my_custom_tag + */ + stream: boolean; +} + +export { ServerThirdPartyNamespace } + +declare function sharedFunction(value: T): T | null; +export { sharedFunction } +export { sharedFunction as sharedFunction_alias_1 } +export { sharedFunction as sharedFunction_alias_2 } +export { sharedFunction as sharedFunction_alias_3 } + +declare type sharedType = { + shared: boolean; +}; +export { sharedType } +export { sharedType as sharedType_alias_1 } +export { sharedType as sharedType_alias_2 } +export { sharedType as sharedType_alias_3 } + +export declare const VERSION: "0.0.0"; + +export { version } + +export { } + + +////////////////////////////////////////////////////////////////////// +// dist/index.d.mts +////////////////////////////////////////////////////////////////////// + +export { VERSION } from './_tsup-dts-rollup'; +export { render_alias_1 as render } from './_tsup-dts-rollup'; +export { ClientRenderOptions_alias_1 as ClientRenderOptions } from './_tsup-dts-rollup'; +export { sharedFunction_alias_1 as sharedFunction } from './_tsup-dts-rollup'; +export { sharedType_alias_1 as sharedType } from './_tsup-dts-rollup'; + + +////////////////////////////////////////////////////////////////////// +// dist/index.d.ts +////////////////////////////////////////////////////////////////////// + +export { VERSION } from './_tsup-dts-rollup'; +export { render_alias_1 as render } from './_tsup-dts-rollup'; +export { ClientRenderOptions_alias_1 as ClientRenderOptions } from './_tsup-dts-rollup'; +export { sharedFunction_alias_1 as sharedFunction } from './_tsup-dts-rollup'; +export { sharedType_alias_1 as sharedType } from './_tsup-dts-rollup'; + + +////////////////////////////////////////////////////////////////////// +// dist/my-lib-client.d.mts +////////////////////////////////////////////////////////////////////// + +export { render } from './_tsup-dts-rollup'; +export { ClientRenderOptions } from './_tsup-dts-rollup'; +export { sharedFunction } from './_tsup-dts-rollup'; +export { sharedType } from './_tsup-dts-rollup'; + + +////////////////////////////////////////////////////////////////////// +// dist/my-lib-client.d.ts +////////////////////////////////////////////////////////////////////// + +export { render } from './_tsup-dts-rollup'; +export { ClientRenderOptions } from './_tsup-dts-rollup'; +export { sharedFunction } from './_tsup-dts-rollup'; +export { sharedType } from './_tsup-dts-rollup'; + + +////////////////////////////////////////////////////////////////////// +// dist/server/index.d.mts +////////////////////////////////////////////////////////////////////// + +export { render_alias_2 as render } from '../_tsup-dts-rollup'; +export { default_alias as default } from '../_tsup-dts-rollup'; +export { ServerRenderOptions } from '../_tsup-dts-rollup'; +export { serverConstant } from '../_tsup-dts-rollup'; +export { serverConstantAlias } from '../_tsup-dts-rollup'; +export { ServerClass } from '../_tsup-dts-rollup'; +export { ServerThirdPartyNamespace } from '../_tsup-dts-rollup'; +export { sharedFunction_alias_2 as sharedFunction } from '../_tsup-dts-rollup'; +export { sharedType_alias_2 as sharedType } from '../_tsup-dts-rollup'; +export { renderToString } from '../_tsup-dts-rollup'; +export { renderToNodeStream } from '../_tsup-dts-rollup'; +export { renderToStaticMarkup } from '../_tsup-dts-rollup'; +export { renderToStaticNodeStream } from '../_tsup-dts-rollup'; +export { version } from '../_tsup-dts-rollup'; + + +////////////////////////////////////////////////////////////////////// +// dist/server/index.d.ts +////////////////////////////////////////////////////////////////////// + +export { render_alias_2 as render } from '../_tsup-dts-rollup'; +export { default_alias as default } from '../_tsup-dts-rollup'; +export { ServerRenderOptions } from '../_tsup-dts-rollup'; +export { serverConstant } from '../_tsup-dts-rollup'; +export { serverConstantAlias } from '../_tsup-dts-rollup'; +export { ServerClass } from '../_tsup-dts-rollup'; +export { ServerThirdPartyNamespace } from '../_tsup-dts-rollup'; +export { sharedFunction_alias_2 as sharedFunction } from '../_tsup-dts-rollup'; +export { sharedType_alias_2 as sharedType } from '../_tsup-dts-rollup'; +export { renderToString } from '../_tsup-dts-rollup'; +export { renderToNodeStream } from '../_tsup-dts-rollup'; +export { renderToStaticMarkup } from '../_tsup-dts-rollup'; +export { renderToStaticNodeStream } from '../_tsup-dts-rollup'; +export { version } from '../_tsup-dts-rollup'; +" +`; diff --git a/test/__snapshots__/index.test.ts.snap b/test/__snapshots__/index.test.ts.snap index 80c49058e..5109c78ec 100644 --- a/test/__snapshots__/index.test.ts.snap +++ b/test/__snapshots__/index.test.ts.snap @@ -1,8 +1,8 @@ -// Vitest Snapshot v1 +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html exports[`code splitting in cjs format 1`] = ` -"\\"use strict\\";Object.defineProperty(exports, \\"__esModule\\", {value: true});// input.ts -var foo = () => Promise.resolve().then(() => require(\\"./foo-D62QZYUQ.js\\")); +""use strict";Object.defineProperty(exports, "__esModule", {value: true});// input.ts +var foo = () => Promise.resolve().then(() => require("./foo-D62QZYUQ.js")); exports.foo = foo; @@ -10,8 +10,8 @@ exports.foo = foo; `; exports[`code splitting in cjs format 2`] = ` -"\\"use strict\\";Object.defineProperty(exports, \\"__esModule\\", {value: true});// another-input.ts -var foo = () => Promise.resolve().then(() => require(\\"./foo-D62QZYUQ.js\\")); +""use strict";Object.defineProperty(exports, "__esModule", {value: true});// another-input.ts +var foo = () => Promise.resolve().then(() => require("./foo-D62QZYUQ.js")); exports.foo = foo; @@ -26,31 +26,22 @@ export { foo }; `; exports[`declaration files with multiple entrypoints #316 2`] = ` -"declare const bar = \\"bar\\"; +"declare const bar = "bar"; export { bar }; " `; exports[`disable code splitting to get proper module.exports = 1`] = ` -"\\"use strict\\"; +""use strict"; // input.ts module.exports = 123; " `; -exports[`enable --dts-resolve for specific module 1`] = ` -"export * from 'vue'; - -type MarkRequired = Exclude & Required> - -export type { MarkRequired }; -" -`; - exports[`external 1`] = ` -"\\"use strict\\"; +""use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; @@ -60,14 +51,14 @@ var __export = (target, all) => { __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { - if (from && typeof from === \\"object\\" || typeof from === \\"function\\") { + if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; -var __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // input.ts var input_exports = {}; @@ -78,14 +69,14 @@ __export(input_exports, { qux: () => import_qux.qux }); module.exports = __toCommonJS(input_exports); -var import_foo = require(\\"foo\\"); -var import_bar = require(\\"bar\\"); +var import_foo = require("foo"); +var import_bar = require("bar"); // node_modules/baz/index.ts -var baz = \\"baz\\"; +var baz = "baz"; // input.ts -var import_qux = require(\\"qux\\"); +var import_qux = require("qux"); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { bar, @@ -96,18 +87,8 @@ var import_qux = require(\\"qux\\"); " `; -exports[`import css 1`] = ` -"\\"use strict\\"; -" -`; - -exports[`import css in --dts 1`] = ` -"\\"use strict\\"; -" -`; - exports[`multiple targets 1`] = ` -"\\"use strict\\"; +""use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; @@ -117,14 +98,14 @@ var __export = (target, all) => { __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { - if (from && typeof from === \\"object\\" || typeof from === \\"function\\") { + if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; -var __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // input.ts var input_exports = {}; @@ -141,7 +122,7 @@ var answer = 42; `; exports[`node protocol 1`] = ` -"\\"use strict\\"; +""use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; @@ -149,7 +130,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __copyProps = (to, from, except, desc) => { - if (from && typeof from === \\"object\\" || typeof from === \\"function\\") { + if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); @@ -159,268 +140,20 @@ var __copyProps = (to, from, except, desc) => { var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. \\"__esModule\\" has not been set), then set - // \\"default\\" to the CommonJS \\"module.exports\\" for node compatibility. - isNodeMode || !mod || !mod.__esModule ? __defProp(target, \\"default\\", { value: mod, enumerable: true }) : target, + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // input.ts -var import_node_fs = __toESM(require(\\"fs\\")); +var import_node_fs = __toESM(require("fs")); console.log(import_node_fs.default); " `; -exports[`not bundle \`package/subpath\` in dts (resolve) 1`] = ` -"import * as foo_bar from 'foo/bar'; - -declare const stuff: foo_bar.Foobar; - -export { stuff }; -" -`; - -exports[`should emit declaration files with experimentalDts 1`] = ` -" -////////////////////////////////////////////////////////////////////// -// dist/_tsup-dts-rollup.d.mts -////////////////////////////////////////////////////////////////////// - -import { renderToNodeStream } from 'react-dom/server'; -import { renderToStaticMarkup } from 'react-dom/server'; -import { renderToStaticNodeStream } from 'react-dom/server'; -import { renderToString } from 'react-dom/server'; -import * as ServerThirdPartyNamespace from 'react-dom'; -import { version } from 'react-dom/server'; - -declare interface ClientRenderOptions { - document: boolean; -} -export { ClientRenderOptions } -export { ClientRenderOptions as ClientRenderOptions_alias_1 } - -export declare function default_alias(options: ServerRenderOptions): void; - -declare function render(options: ClientRenderOptions): string; -export { render } -export { render as render_alias_1 } - -/** - * Comment for server render function - */ -export declare function render_alias_2(options: ServerRenderOptions): string; - -export { renderToNodeStream } - -export { renderToStaticMarkup } - -export { renderToStaticNodeStream } - -export { renderToString } - -export declare class ServerClass { -} - -declare const serverConstant = 1; -export { serverConstant } -export { serverConstant as serverConstantAlias } - -export declare interface ServerRenderOptions { - /** - * Comment for ServerRenderOptions.stream - * - * @public - * - * @my_custom_tag - */ - stream: boolean; -} - -export { ServerThirdPartyNamespace } - -declare function sharedFunction(value: T): T | null; -export { sharedFunction } -export { sharedFunction as sharedFunction_alias_1 } -export { sharedFunction as sharedFunction_alias_2 } -export { sharedFunction as sharedFunction_alias_3 } - -declare type sharedType = { - shared: boolean; -}; -export { sharedType } -export { sharedType as sharedType_alias_1 } -export { sharedType as sharedType_alias_2 } -export { sharedType as sharedType_alias_3 } - -export declare const VERSION: \\"0.0.0\\"; - -export { version } - -export { } - - -////////////////////////////////////////////////////////////////////// -// dist/_tsup-dts-rollup.d.ts -////////////////////////////////////////////////////////////////////// - -import { renderToNodeStream } from 'react-dom/server'; -import { renderToStaticMarkup } from 'react-dom/server'; -import { renderToStaticNodeStream } from 'react-dom/server'; -import { renderToString } from 'react-dom/server'; -import * as ServerThirdPartyNamespace from 'react-dom'; -import { version } from 'react-dom/server'; - -declare interface ClientRenderOptions { - document: boolean; -} -export { ClientRenderOptions } -export { ClientRenderOptions as ClientRenderOptions_alias_1 } - -export declare function default_alias(options: ServerRenderOptions): void; - -declare function render(options: ClientRenderOptions): string; -export { render } -export { render as render_alias_1 } - -/** - * Comment for server render function - */ -export declare function render_alias_2(options: ServerRenderOptions): string; - -export { renderToNodeStream } - -export { renderToStaticMarkup } - -export { renderToStaticNodeStream } - -export { renderToString } - -export declare class ServerClass { -} - -declare const serverConstant = 1; -export { serverConstant } -export { serverConstant as serverConstantAlias } - -export declare interface ServerRenderOptions { - /** - * Comment for ServerRenderOptions.stream - * - * @public - * - * @my_custom_tag - */ - stream: boolean; -} - -export { ServerThirdPartyNamespace } - -declare function sharedFunction(value: T): T | null; -export { sharedFunction } -export { sharedFunction as sharedFunction_alias_1 } -export { sharedFunction as sharedFunction_alias_2 } -export { sharedFunction as sharedFunction_alias_3 } - -declare type sharedType = { - shared: boolean; -}; -export { sharedType } -export { sharedType as sharedType_alias_1 } -export { sharedType as sharedType_alias_2 } -export { sharedType as sharedType_alias_3 } - -export declare const VERSION: \\"0.0.0\\"; - -export { version } - -export { } - - -////////////////////////////////////////////////////////////////////// -// dist/index.d.mts -////////////////////////////////////////////////////////////////////// - -export { VERSION } from './_tsup-dts-rollup'; -export { render_alias_1 as render } from './_tsup-dts-rollup'; -export { ClientRenderOptions_alias_1 as ClientRenderOptions } from './_tsup-dts-rollup'; -export { sharedFunction_alias_1 as sharedFunction } from './_tsup-dts-rollup'; -export { sharedType_alias_1 as sharedType } from './_tsup-dts-rollup'; - - -////////////////////////////////////////////////////////////////////// -// dist/index.d.ts -////////////////////////////////////////////////////////////////////// - -export { VERSION } from './_tsup-dts-rollup'; -export { render_alias_1 as render } from './_tsup-dts-rollup'; -export { ClientRenderOptions_alias_1 as ClientRenderOptions } from './_tsup-dts-rollup'; -export { sharedFunction_alias_1 as sharedFunction } from './_tsup-dts-rollup'; -export { sharedType_alias_1 as sharedType } from './_tsup-dts-rollup'; - - -////////////////////////////////////////////////////////////////////// -// dist/my-lib-client.d.mts -////////////////////////////////////////////////////////////////////// - -export { render } from './_tsup-dts-rollup'; -export { ClientRenderOptions } from './_tsup-dts-rollup'; -export { sharedFunction } from './_tsup-dts-rollup'; -export { sharedType } from './_tsup-dts-rollup'; - - -////////////////////////////////////////////////////////////////////// -// dist/my-lib-client.d.ts -////////////////////////////////////////////////////////////////////// - -export { render } from './_tsup-dts-rollup'; -export { ClientRenderOptions } from './_tsup-dts-rollup'; -export { sharedFunction } from './_tsup-dts-rollup'; -export { sharedType } from './_tsup-dts-rollup'; - - -////////////////////////////////////////////////////////////////////// -// dist/server/index.d.mts -////////////////////////////////////////////////////////////////////// - -export { render_alias_2 as render } from '../_tsup-dts-rollup'; -export { default_alias as default } from '../_tsup-dts-rollup'; -export { ServerRenderOptions } from '../_tsup-dts-rollup'; -export { serverConstant } from '../_tsup-dts-rollup'; -export { serverConstantAlias } from '../_tsup-dts-rollup'; -export { ServerClass } from '../_tsup-dts-rollup'; -export { ServerThirdPartyNamespace } from '../_tsup-dts-rollup'; -export { sharedFunction_alias_2 as sharedFunction } from '../_tsup-dts-rollup'; -export { sharedType_alias_2 as sharedType } from '../_tsup-dts-rollup'; -export { renderToString } from '../_tsup-dts-rollup'; -export { renderToNodeStream } from '../_tsup-dts-rollup'; -export { renderToStaticMarkup } from '../_tsup-dts-rollup'; -export { renderToStaticNodeStream } from '../_tsup-dts-rollup'; -export { version } from '../_tsup-dts-rollup'; - - -////////////////////////////////////////////////////////////////////// -// dist/server/index.d.ts -////////////////////////////////////////////////////////////////////// - -export { render_alias_2 as render } from '../_tsup-dts-rollup'; -export { default_alias as default } from '../_tsup-dts-rollup'; -export { ServerRenderOptions } from '../_tsup-dts-rollup'; -export { serverConstant } from '../_tsup-dts-rollup'; -export { serverConstantAlias } from '../_tsup-dts-rollup'; -export { ServerClass } from '../_tsup-dts-rollup'; -export { ServerThirdPartyNamespace } from '../_tsup-dts-rollup'; -export { sharedFunction_alias_2 as sharedFunction } from '../_tsup-dts-rollup'; -export { sharedType_alias_2 as sharedType } from '../_tsup-dts-rollup'; -export { renderToString } from '../_tsup-dts-rollup'; -export { renderToNodeStream } from '../_tsup-dts-rollup'; -export { renderToStaticMarkup } from '../_tsup-dts-rollup'; -export { renderToStaticNodeStream } from '../_tsup-dts-rollup'; -export { version } from '../_tsup-dts-rollup'; -" -`; - exports[`simple 1`] = ` -"\\"use strict\\"; +""use strict"; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; @@ -430,14 +163,14 @@ var __export = (target, all) => { __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { - if (from && typeof from === \\"object\\" || typeof from === \\"function\\") { + if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; -var __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); // input.ts var input_exports = {}; @@ -447,63 +180,9 @@ __export(input_exports, { module.exports = __toCommonJS(input_exports); // foo.ts -var foo_default = \\"foo\\"; +var foo_default = "foo"; // input.ts var input_default = foo_default; " `; - -exports[`support baseUrl and paths in tsconfig.json 1`] = ` -"var __defProp = Object.defineProperty; -var __getOwnPropDesc = Object.getOwnPropertyDescriptor; -var __getOwnPropNames = Object.getOwnPropertyNames; -var __hasOwnProp = Object.prototype.hasOwnProperty; -var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); -}; -var __copyProps = (to, from, except, desc) => { - if (from && typeof from === \\"object\\" || typeof from === \\"function\\") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; -}; -var __toCommonJS = (mod) => __copyProps(__defProp({}, \\"__esModule\\", { value: true }), mod); - -// input.ts -var input_exports = {}; -__export(input_exports, { - foo: () => foo -}); -module.exports = __toCommonJS(input_exports); - -// foo.ts -var foo = \\"foo\\"; -// Annotate the CommonJS export names for ESM import in node: -0 && (module.exports = { - foo -}); -" -`; - -exports[`support baseUrl and paths in tsconfig.json in --dts build 1`] = ` -"declare const foo = \\"foo\\"; - -export { foo }; -" -`; - -exports[`support baseUrl and paths in tsconfig.json in --dts-resolve build 1`] = ` -"declare const foo = \\"foo\\"; - -export { foo }; -" -`; - -exports[`support tailwindcss postcss plugin 1`] = ` -"\\"use strict\\"; -" -`; diff --git a/test/__snapshots__/tsconfig.test.ts.snap b/test/__snapshots__/tsconfig.test.ts.snap new file mode 100644 index 000000000..b152b9df1 --- /dev/null +++ b/test/__snapshots__/tsconfig.test.ts.snap @@ -0,0 +1,50 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`support baseUrl and paths in tsconfig.json 1`] = ` +"var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// input.ts +var input_exports = {}; +__export(input_exports, { + foo: () => foo +}); +module.exports = __toCommonJS(input_exports); + +// foo.ts +var foo = "foo"; +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + foo +}); +" +`; + +exports[`support baseUrl and paths in tsconfig.json in --dts build 1`] = ` +"declare const foo = "foo"; + +export { foo }; +" +`; + +exports[`support baseUrl and paths in tsconfig.json in --dts-resolve build 1`] = ` +"declare const foo = "foo"; + +export { foo }; +" +`; diff --git a/test/css.test.ts b/test/css.test.ts new file mode 100644 index 000000000..af65f278c --- /dev/null +++ b/test/css.test.ts @@ -0,0 +1,68 @@ +import { test, expect } from 'vitest' +import { getTestName, run } from './utils' + +test('import css', async () => { + const { output, outFiles } = await run(getTestName(), { + 'input.ts': ` + import './foo.css' + `, + 'postcss.config.js': ` + module.exports = { + plugins: [require('postcss-simple-vars')()] + } + `, + 'foo.css': ` + $color: blue; + + .foo { + color: $color; + } + `, + }) + + expect(output, `""`).toMatchSnapshot() + expect(outFiles).toEqual(['input.css', 'input.js']) +}) + +test('support tailwindcss postcss plugin', async () => { + const { output, outFiles } = await run(getTestName(), { + 'input.ts': ` + import './foo.css' + `, + 'postcss.config.js': ` + module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + } + } + `, + 'foo.css': ` + @tailwind base; + @tailwind components; + @tailwind utilities; + `, + }) + expect(output).toMatchSnapshot() + expect(outFiles).toEqual(['input.css', 'input.js']) +}) + +test('import css in --dts', async () => { + const { output, outFiles } = await run( + getTestName(), + { + 'input.ts': ` + import './foo.css' + `, + 'foo.css': ` + .foo { + color: blue + } + `, + }, + { flags: ['--dts'] }, + ) + + expect(output).toMatchSnapshot() + expect(outFiles).toEqual(['input.css', 'input.d.ts', 'input.js']) +}) diff --git a/test/dts.test.ts b/test/dts.test.ts new file mode 100644 index 000000000..51aa5a0b2 --- /dev/null +++ b/test/dts.test.ts @@ -0,0 +1,475 @@ +import { test, expect } from 'vitest' +import path from 'path' +import { slash } from '../src/utils' +import { getTestName, run } from './utils' + +test('not bundle `package/subpath` in dts (resolve)', async () => { + const { getFileContent } = await run( + getTestName(), + { + 'package.json': `{ "dependencies": { "foo": "*" } }`, + 'input.ts': `export const stuff: import('foo/bar').Foobar = { foo: 'foo', bar: 'bar' };`, + 'node_modules/foo/bar.d.ts': `export type Foobar = { foo: 'foo', bar: 'bar' }`, + 'node_modules/foo/package.json': `{ "name": "foo", "version": "0.0.0" }`, + }, + { + flags: ['--dts', '--dts-resolve'], + }, + ) + const content = await getFileContent('dist/input.d.ts') + expect(content).toMatchSnapshot() +}) + +test('enable --dts-resolve for specific module', async () => { + const { getFileContent } = await run(getTestName(), { + 'input.ts': `export * from 'vue' + export type {MarkRequired} from 'foo' + `, + 'node_modules/foo/index.d.ts': ` + export type MarkRequired = Exclude & Required> + `, + 'node_modules/foo/package.json': `{ "name": "foo", "version": "0.0.0" }`, + 'tsup.config.ts': ` + export default { + dts: { + resolve: ['foo'] + }, + } + `, + }) + const content = await getFileContent('dist/input.d.ts') + expect(content).toMatchSnapshot() +}) + +test(`custom tsconfig should pass to dts plugin`, async () => { + const { outFiles } = await run(getTestName(), { + 'input.ts': `export const foo = { name: 'foo'}`, + 'tsconfig.json': `{ + "compilerOptions": { + "baseUrl":".", + "target": "esnext", + "incremental": true + } + }`, + 'tsconfig.build.json': `{ + "compilerOptions": { + "baseUrl":".", + "target": "esnext" + } + }`, + 'tsup.config.ts': ` + export default { + entry: ['src/input.ts'], + format: 'esm', + tsconfig: './tsconfig.build.json', + dts: { + only: true + } + } + `, + }) + expect(outFiles).toEqual(['input.d.mts']) +}) + +test('should emit a declaration file per format', async () => { + const { outFiles } = await run(getTestName(), { + 'input.ts': `export default 'foo'`, + 'tsup.config.ts': ` + export default { + entry: ['src/input.ts'], + format: ['esm', 'cjs'], + dts: true + }`, + }) + expect(outFiles).toEqual([ + 'input.d.mts', + 'input.d.ts', + 'input.js', + 'input.mjs', + ]) +}) + +test('should emit a declaration file per format (type: module)', async () => { + const { outFiles } = await run(getTestName(), { + 'input.ts': `export default 'foo'`, + 'package.json': `{ + "type": "module" + }`, + 'tsup.config.ts': ` + export default { + entry: ['src/input.ts'], + format: ['esm', 'cjs'], + dts: true + }`, + }) + expect(outFiles).toEqual([ + 'input.cjs', + 'input.d.cts', + 'input.d.ts', + 'input.js', + ]) +}) + +test('should emit dts chunks per format', async () => { + const { outFiles } = await run( + getTestName(), + { + 'src/input1.ts': ` + import type { InternalType } from './shared.js' + + export function getValue(value: InternalType) { + return value; + } + `, + 'src/input2.ts': ` + import type { InternalType } from './shared.js' + + export function getValue(value: InternalType) { + return value; + } + `, + 'src/shared.ts': `export type InternalType = 'foo'`, + 'tsup.config.ts': ` + export default { + entry: ['./src/input1.ts', './src/input2.ts'], + format: ['esm', 'cjs'], + dts: true + }`, + }, + { entry: [] }, + ) + expect(outFiles).toEqual([ + 'input1.d.mts', + 'input1.d.ts', + 'input1.js', + 'input1.mjs', + 'input2.d.mts', + 'input2.d.ts', + 'input2.js', + 'input2.mjs', + 'shared-qBqaX8Tr.d.mts', + 'shared-qBqaX8Tr.d.ts', + ]) +}) + +test('should emit dts chunks per format (type: module)', async () => { + const { outFiles } = await run( + getTestName(), + { + 'src/input1.ts': ` + import type { InternalType } from './shared.js' + + export function getValue(value: InternalType) { + return value; + } + `, + 'src/input2.ts': ` + import type { InternalType } from './shared.js' + + export function getValue(value: InternalType) { + return value; + } + `, + 'src/shared.ts': `export type InternalType = 'foo'`, + 'tsup.config.ts': ` + export default { + entry: ['./src/input1.ts', './src/input2.ts'], + format: ['esm', 'cjs'], + dts: true + }`, + 'package.json': `{ + "type": "module" + }`, + }, + { entry: [] }, + ) + expect(outFiles).toEqual([ + 'input1.cjs', + 'input1.d.cts', + 'input1.d.ts', + 'input1.js', + 'input2.cjs', + 'input2.d.cts', + 'input2.d.ts', + 'input2.js', + 'shared-qBqaX8Tr.d.cts', + 'shared-qBqaX8Tr.d.ts', + ]) +}) + +test('should emit declaration files with experimentalDts', async () => { + const files = { + 'package.json': ` + { + "name": "tsup-playground", + "private": true, + "version": "0.0.0", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "default": "./dist/index.js" + }, + "./client": { + "types": "./dist/my-lib-client.d.ts", + "require": "./dist/my-lib-client.js", + "import": "./dist/my-lib-client.mjs", + "default": "./dist/my-lib-client.js" + }, + "./server": { + "types": "./dist/server/index.d.ts", + "require": "./dist/server/index.js", + "import": "./dist/server/index.mjs", + "default": "./dist/server/index.js" + } + } + } + `, + 'tsconfig.json': ` + { + "compilerOptions": { + "target": "ES2020", + "skipLibCheck": true, + "noEmit": true + }, + "include": ["./src"] + } + `, + 'tsup.config.ts': ` + export default { + name: 'tsup', + target: 'es2022', + format: [ + 'esm', + 'cjs' + ], + entry: { + index: './src/index.ts', + 'my-lib-client': './src/client.ts', + 'server/index': './src/server.ts', + }, + } + `, + 'src/shared.ts': ` + export function sharedFunction(value: T): T | null { + return value || null + } + + type sharedType = { + shared: boolean + } + + export type { sharedType } + `, + 'src/server.ts': ` + export * from './shared' + + /** + * Comment for server render function + */ + export function render(options: ServerRenderOptions): string { + return JSON.stringify(options) + } + + export interface ServerRenderOptions { + /** + * Comment for ServerRenderOptions.stream + * + * @public + * + * @my_custom_tag + */ + stream: boolean + } + + export const serverConstant = 1 + + export { serverConstant as serverConstantAlias } + + export class ServerClass {}; + + export default function serverDefaultExport(options: ServerRenderOptions): void {}; + + // Export a third party module as a namespace + import * as ServerThirdPartyNamespace from 'react-dom'; + export { ServerThirdPartyNamespace } + + // Export a third party module + export * from 'react-dom/server'; + + `, + 'src/client.ts': ` + export * from './shared' + + export function render(options: ClientRenderOptions): string { + return JSON.stringify(options) + } + + export interface ClientRenderOptions { + document: boolean + } + `, + 'src/index.ts': ` + export * from './client' + export * from './shared' + + export const VERSION = '0.0.0' as const + `, + } + const { outFiles, getFileContent } = await run(getTestName(), files, { + entry: [], + flags: ['--experimental-dts'], + }) + const snapshots: string[] = [] + await Promise.all( + outFiles + .filter((outFile) => outFile.includes('.d.')) + .map(async (outFile) => { + const filePath = path.join('dist', outFile) + const content = await getFileContent(filePath) + snapshots.push( + [ + '', + '/'.repeat(70), + `// ${path.posix.normalize(slash(filePath))}`, + '/'.repeat(70), + '', + content, + ].join('\n'), + ) + }), + ) + expect(snapshots.sort().join('\n')).toMatchSnapshot() +}) + +test('should only include exported declarations with experimentalDts', async () => { + const files = { + 'package.json': `{ "name": "tsup-playground", "private": true }`, + 'tsconfig.json': `{ "compilerOptions": { "skipLibCheck": true } }`, + 'tsup.config.ts': ` + export default { + entry: ['./src/entry1.ts', './src/entry2.ts'] + } + `, + 'src/shared.ts': ` + export const declare1 = 'declare1' + export const declare2 = 'declare2' + `, + 'src/entry1.ts': ` + export { declare1 } from './shared' + `, + 'src/entry2.ts': ` + export { declare2 } from './shared' + `, + } + const { getFileContent } = await run(getTestName(), files, { + entry: [], + flags: ['--experimental-dts'], + }) + + let entry1dts = await getFileContent('dist/entry1.d.ts') + let entry2dts = await getFileContent('dist/entry2.d.ts') + + expect(entry1dts).toContain('declare1') + expect(entry1dts).not.toContain('declare2') + + expect(entry2dts).toContain('declare2') + expect(entry2dts).not.toContain('declare1') +}) + +test('.d.ts files should be cleaned when --clean and --experimental-dts are provided', async () => { + const filesFoo = { + 'package.json': `{ "name": "tsup-playground", "private": true }`, + 'foo.ts': `export const foo = 1`, + } + + const filesFooBar = { + ...filesFoo, + 'bar.ts': `export const bar = 2`, + } + + // First run with both foo and bar + const result1 = await run(getTestName(), filesFooBar, { + entry: ['foo.ts', 'bar.ts'], + flags: ['--experimental-dts'], + }) + + expect(result1.outFiles).toContain('foo.d.ts') + expect(result1.outFiles).toContain('foo.js') + expect(result1.outFiles).toContain('bar.d.ts') + expect(result1.outFiles).toContain('bar.js') + + // Second run with only foo + const result2 = await run(getTestName(), filesFoo, { + entry: ['foo.ts'], + flags: ['--experimental-dts'], + }) + + // When --clean is not provided, the previous bar.* files should still exist + expect(result2.outFiles).toContain('foo.d.ts') + expect(result2.outFiles).toContain('foo.js') + expect(result2.outFiles).toContain('bar.d.ts') + expect(result2.outFiles).toContain('bar.js') + + // Third run with only foo and --clean + const result3 = await run(getTestName(), filesFoo, { + entry: ['foo.ts'], + flags: ['--experimental-dts', '--clean'], + }) + + // When --clean is provided, the previous bar.* files should be deleted + expect(result3.outFiles).toContain('foo.d.ts') + expect(result3.outFiles).toContain('foo.js') + expect(result3.outFiles).not.toContain('bar.d.ts') + expect(result3.outFiles).not.toContain('bar.js') +}) + +test('dts only: ignore files', async () => { + const { outFiles } = await run( + getTestName(), + { + 'input.ts': ` + import './style.scss' + + export const a = 1 + `, + 'style.scss': ` + @keyframes gallery-loading-spinner { + 0% {} + } + `, + }, + { + entry: ['input.ts'], + flags: ['--dts-only'], + }, + ) + expect(outFiles).toMatchInlineSnapshot(` + [ + "input.d.ts", + ] + `) +}) + +test('declaration files with multiple entrypoints #316', async () => { + const { getFileContent } = await run( + getTestName(), + { + 'src/index.ts': `export const foo = 1`, + 'src/bar/index.ts': `export const bar = 'bar'`, + }, + { flags: ['--dts'], entry: ['src/index.ts', 'src/bar/index.ts'] }, + ) + expect( + await getFileContent('dist/index.d.ts'), + 'dist/index.d.ts', + ).toMatchSnapshot() + expect( + await getFileContent('dist/bar/index.d.ts'), + 'dist/bar/index.d.ts', + ).toMatchSnapshot() +}) diff --git a/test/example.test.ts b/test/example.test.ts new file mode 100644 index 000000000..f47720e19 --- /dev/null +++ b/test/example.test.ts @@ -0,0 +1,33 @@ +import { test } from 'vitest' +import { getTestName, run } from './utils' + +test('bundle vue and ts-essentials with --dts --dts-resolve flag', async () => { + await run( + getTestName(), + { + 'input.ts': `export * from 'vue' + export type { MarkRequired } from 'ts-essentials' + `, + }, + { + flags: ['--dts', '--dts-resolve'], + }, + ) +}) + +test('bundle @egoist/path-parser with --dts --dts-resolve flag', async () => { + await run( + getTestName(), + { + 'input.ts': `import { PathParser } from '@egoist/path-parser' + export type Opts = { + parser: PathParser + route: string + } + `, + }, + { + flags: ['--dts', '--dts-resolve'], + }, + ) +}) diff --git a/test/graphql.test.ts b/test/graphql.test.ts new file mode 100644 index 000000000..0a0e5f1e5 --- /dev/null +++ b/test/graphql.test.ts @@ -0,0 +1,54 @@ +import { test, expect } from 'vitest' +import { getTestName, run } from './utils' + +test('bundle graphql-tools with --dts flag', async () => { + await run( + getTestName(), + { + 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, + }, + { + flags: ['--dts'], + }, + ) +}) + +test('bundle graphql-tools with --dts-resolve flag', async () => { + await run( + getTestName(), + { + 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, + }, + { + flags: ['--dts-resolve'], + }, + ) +}) + +test('bundle graphql-tools with --sourcemap flag', async () => { + const { outFiles } = await run( + getTestName(), + { + 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, + }, + { + flags: ['--sourcemap'], + }, + ) + expect(outFiles).toEqual(['input.js', 'input.js.map']) +}) + +test('bundle graphql-tools with --sourcemap inline flag', async () => { + const { output, outFiles } = await run( + getTestName(), + { + 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, + }, + { + flags: ['--sourcemap', 'inline'], + }, + ) + + expect(output).toContain('//# sourceMappingURL=data:application/json;base64') + expect(outFiles).toEqual(['input.js']) +}) diff --git a/test/index.test.ts b/test/index.test.ts index 8156f39da..7933137bd 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,92 +1,9 @@ -import { test, expect, beforeAll } from 'vitest' +import { test, expect } from 'vitest' import path from 'path' -import execa from 'execa' import fs from 'fs-extra' -import glob from 'globby' import waitForExpect from 'wait-for-expect' -import { fileURLToPath } from 'url' -import { debouncePromise, slash } from '../src/utils' - -const __dirname = path.dirname(fileURLToPath(import.meta.url)) - -const cacheDir = path.resolve(__dirname, '.cache') -const bin = path.resolve(__dirname, '../dist/cli-default.js') - -const getTestName = () => { - const name = expect - .getState() - .currentTestName?.replace(/^[a-z]+/g, '_') - .replace(/-/g, '_') - - if (!name) { - throw new Error('No test name') - } - - return name -} - -beforeAll(async () => { - await fs.remove(cacheDir) - console.log(`Installing dependencies in ./test folder`) - await execa('pnpm', ['i'], { cwd: __dirname }) - console.log(`Done... start testing..`) -}) - -function filenamify(input: string) { - return input.replace(/[^a-zA-Z0-9]/g, '-') -} - -async function run( - title: string, - files: { [name: string]: string }, - options: { - entry?: string[] - flags?: string[] - env?: Record - } = {}, -) { - const testDir = path.resolve(cacheDir, filenamify(title)) - - // Write entry files on disk - await Promise.all( - Object.keys(files).map((name) => { - return fs.outputFile(path.resolve(testDir, name), files[name], 'utf8') - }), - ) - - const entry = options.entry || ['input.ts'] - - // Run tsup cli - const { exitCode, stdout, stderr } = await execa( - bin, - [...entry, ...(options.flags || [])], - { - cwd: testDir, - env: { ...process.env, ...options.env }, - }, - ) - const logs = stdout + stderr - if (exitCode !== 0) { - throw new Error(logs) - } - - // Get output - const outFiles = await glob('**/*', { - cwd: path.resolve(testDir, 'dist'), - }).then((res) => res.sort()) - - return { - get output() { - return fs.readFileSync(path.resolve(testDir, 'dist/input.js'), 'utf8') - }, - outFiles, - logs, - outDir: path.resolve(testDir, 'dist'), - getFileContent(filename: string) { - return fs.readFile(path.resolve(testDir, filename), 'utf8') - }, - } -} +import { debouncePromise } from '../src/utils' +import { getTestName, run } from './utils' test('simple', async () => { const { output, outFiles } = await run(getTestName(), { @@ -105,129 +22,8 @@ test('should not filter unknown directives during bundle', async () => { expect(outFiles).toEqual(['input.js']) }) -test('bundle graphql-tools with --dts flag', async () => { - await run( - getTestName(), - { - 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, - }, - { - flags: ['--dts'], - }, - ) -}) - -test('bundle graphql-tools with --dts-resolve flag', async () => { - await run( - getTestName(), - { - 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, - }, - { - flags: ['--dts-resolve'], - }, - ) -}) - -test('bundle vue and ts-essentials with --dts --dts-resolve flag', async () => { - await run( - getTestName(), - { - 'input.ts': `export * from 'vue' - export type { MarkRequired } from 'ts-essentials' - `, - }, - { - flags: ['--dts', '--dts-resolve'], - }, - ) -}) - -test('bundle @egoist/path-parser with --dts --dts-resolve flag', async () => { - await run( - getTestName(), - { - 'input.ts': `import { PathParser } from '@egoist/path-parser' - export type Opts = { - parser: PathParser - route: string - } - `, - }, - { - flags: ['--dts', '--dts-resolve'], - }, - ) -}) - -test('not bundle `package/subpath` in dts (resolve)', async () => { - const { getFileContent } = await run( - getTestName(), - { - 'package.json': `{ "dependencies": { "foo": "*" } }`, - 'input.ts': `export const stuff: import('foo/bar').Foobar = { foo: 'foo', bar: 'bar' };`, - 'node_modules/foo/bar.d.ts': `export type Foobar = { foo: 'foo', bar: 'bar' }`, - 'node_modules/foo/package.json': `{ "name": "foo", "version": "0.0.0" }`, - }, - { - flags: ['--dts', '--dts-resolve'], - }, - ) - const content = await getFileContent('dist/input.d.ts') - expect(content).toMatchSnapshot() -}) - -test('enable --dts-resolve for specific module', async () => { - const { getFileContent } = await run(getTestName(), { - 'input.ts': `export * from 'vue' - export type {MarkRequired} from 'foo' - `, - 'node_modules/foo/index.d.ts': ` - export type MarkRequired = Exclude & Required> - `, - 'node_modules/foo/package.json': `{ "name": "foo", "version": "0.0.0" }`, - 'tsup.config.ts': ` - export default { - dts: { - resolve: ['foo'] - }, - } - `, - }) - const content = await getFileContent('dist/input.d.ts') - expect(content).toMatchSnapshot() -}) - -test('bundle graphql-tools with --sourcemap flag', async () => { - const { outFiles } = await run( - getTestName(), - { - 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, - }, - { - flags: ['--sourcemap'], - }, - ) - expect(outFiles).toEqual(['input.js', 'input.js.map']) -}) - -test('bundle graphql-tools with --sourcemap inline flag', async () => { - const { output, outFiles } = await run( - getTestName(), - { - 'input.ts': `export { makeExecutableSchema } from 'graphql-tools'`, - }, - { - flags: ['--sourcemap', 'inline'], - }, - ) - - expect(output).toContain('//# sourceMappingURL=data:application/json;base64') - expect(outFiles).toEqual(['input.js']) -}) - test('multiple formats', async () => { - const { output, outFiles } = await run( + const { outFiles } = await run( getTestName(), { 'input.ts': ` @@ -243,7 +39,7 @@ test('multiple formats', async () => { }) test('multiple formats and pkg.type is module', async () => { - const { output, outFiles } = await run( + const { outFiles } = await run( getTestName(), { 'input.ts': ` @@ -314,72 +110,6 @@ test('env flag', async () => { expect(outFiles).toEqual(['input.js']) }) -test('import css', async () => { - const { output, outFiles } = await run(getTestName(), { - 'input.ts': ` - import './foo.css' - `, - 'postcss.config.js': ` - module.exports = { - plugins: [require('postcss-simple-vars')()] - } - `, - 'foo.css': ` - $color: blue; - - .foo { - color: $color; - } - `, - }) - - expect(output, `""`).toMatchSnapshot() - expect(outFiles).toEqual(['input.css', 'input.js']) -}) - -test('support tailwindcss postcss plugin', async () => { - const { output, outFiles } = await run(getTestName(), { - 'input.ts': ` - import './foo.css' - `, - 'postcss.config.js': ` - module.exports = { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - } - } - `, - 'foo.css': ` - @tailwind base; - @tailwind components; - @tailwind utilities; - `, - }) - expect(output).toMatchSnapshot() - expect(outFiles).toEqual(['input.css', 'input.js']) -}) - -test('import css in --dts', async () => { - const { output, outFiles } = await run( - getTestName(), - { - 'input.ts': ` - import './foo.css' - `, - 'foo.css': ` - .foo { - color: blue - } - `, - }, - { flags: ['--dts'] }, - ) - - expect(output).toMatchSnapshot() - expect(outFiles).toEqual(['input.css', 'input.d.ts', 'input.js']) -}) - test('node protocol', async () => { const { output } = await run(getTestName(), { 'input.ts': `import fs from 'node:fs'; console.log(fs)`, @@ -449,97 +179,6 @@ test('disable code splitting to get proper module.exports =', async () => { expect(output).toMatchSnapshot() }) -test('bundle svelte', async () => { - const { output, getFileContent } = await run( - getTestName(), - { - 'input.ts': `import App from './App.svelte' - export { App } - `, - 'App.svelte': ` - - - {msg} - - - `, - }, - { - // To make the snapshot leaner - flags: ['--external', 'svelte/internal'], - }, - ) - expect(output).not.toContain(' - - {msg} - `, - }) - - expect(outFiles).toEqual(['input.js']) -}) - -test('svelte: typescript support', async () => { - const { outFiles, output } = await run(getTestName(), { - 'input.ts': `import App from './App.svelte' - export { App } - `, - 'App.svelte': ` - - - {say} - `, - 'Component.svelte': ` - - - {name} - `, - }) - - expect(outFiles).toEqual(['input.js']) - expect(output).toContain('// Component.svelte') -}) - -test('svelte: sass support', async () => { - const { outFiles, output, getFileContent } = await run(getTestName(), { - 'input.ts': `import App from './App.svelte' - export { App } - `, - 'App.svelte': ` -
Hello
- - `, - }) - - expect(outFiles).toEqual(['input.css', 'input.js']) - const outputCss = await getFileContent('dist/input.css') - expect(outputCss).toMatch(/\.svelte-\w+:hover/) -}) - test('onSuccess', async () => { const { logs } = await run( getTestName(), @@ -576,71 +215,6 @@ test('onSuccess: use a function from config file', async () => { expect(logs.includes('world')).toEqual(true) }) -test('custom tsconfig', async () => { - await run( - getTestName(), - { - 'input.ts': `export const foo = 'foo'`, - 'tsconfig.build.json': `{ - "compilerOptions": { - "baseUrl":"." - } - }`, - }, - { flags: ['--tsconfig', 'tsconfig.build.json'] }, - ) -}) - -test('support baseUrl and paths in tsconfig.json', async () => { - const { getFileContent } = await run(getTestName(), { - 'input.ts': `export * from '@/foo'`, - 'foo.ts': `export const foo = 'foo'`, - 'tsconfig.json': `{ - "compilerOptions": { - "baseUrl":".", - "paths":{"@/*": ["./*"]} - } - }`, - }) - expect(await getFileContent('dist/input.js')).toMatchSnapshot() -}) - -test('support baseUrl and paths in tsconfig.json in --dts build', async () => { - const { getFileContent } = await run( - getTestName(), - { - 'input.ts': `export * from '@/foo'`, - 'src/foo.ts': `export const foo = 'foo'`, - 'tsconfig.json': `{ - "compilerOptions": { - "baseUrl":".", - "paths":{"@/*": ["./src/*"]} - } - }`, - }, - { flags: ['--dts'] }, - ) - expect(await getFileContent('dist/input.d.ts')).toMatchSnapshot() -}) - -test('support baseUrl and paths in tsconfig.json in --dts-resolve build', async () => { - const { getFileContent } = await run( - getTestName(), - { - 'input.ts': `export * from '@/foo'`, - 'src/foo.ts': `export const foo = 'foo'`, - 'tsconfig.json': `{ - "compilerOptions": { - "baseUrl":".", - "paths":{"@/*": ["./src/*"]} - } - }`, - }, - { flags: ['--dts-resolve'] }, - ) - expect(await getFileContent('dist/input.d.ts')).toMatchSnapshot() -}) - test(`transform import.meta.url in cjs format`, async () => { const { getFileContent } = await run( getTestName(), @@ -745,25 +319,6 @@ test('code splitting in cjs format', async () => { expect(await getFileContent('dist/another-input.js')).toMatchSnapshot() }) -test('declaration files with multiple entrypoints #316', async () => { - const { getFileContent } = await run( - getTestName(), - { - 'src/index.ts': `export const foo = 1`, - 'src/bar/index.ts': `export const bar = 'bar'`, - }, - { flags: ['--dts'], entry: ['src/index.ts', 'src/bar/index.ts'] }, - ) - expect( - await getFileContent('dist/index.d.ts'), - 'dist/index.d.ts', - ).toMatchSnapshot() - expect( - await getFileContent('dist/bar/index.d.ts'), - 'dist/bar/index.d.ts', - ).toMatchSnapshot() -}) - test('esbuild metafile', async () => { const { outFiles } = await run( getTestName(), @@ -966,33 +521,6 @@ test('multiple targets', async () => { expect(outFiles).toEqual(['input.js']) }) -test('dts only: ignore files', async () => { - const { outFiles } = await run( - getTestName(), - { - 'input.ts': ` - import './style.scss' - - export const a = 1 - `, - 'style.scss': ` - @keyframes gallery-loading-spinner { - 0% {} - } - `, - }, - { - entry: ['input.ts'], - flags: ['--dts-only'], - }, - ) - expect(outFiles).toMatchInlineSnapshot(` - [ - "input.d.ts", - ] - `) -}) - test('native-node-module plugin should handle *.node(.js) import properly', async () => { await run( getTestName(), @@ -1244,36 +772,6 @@ test('override target in tsconfig.json', async () => { ) }) -test(`custom tsconfig should pass to dts plugin`, async () => { - const { outFiles } = await run(getTestName(), { - 'input.ts': `export const foo = { name: 'foo'}`, - 'tsconfig.json': `{ - "compilerOptions": { - "baseUrl":".", - "target": "esnext", - "incremental": true - } - }`, - 'tsconfig.build.json': `{ - "compilerOptions": { - "baseUrl":".", - "target": "esnext" - } - }`, - 'tsup.config.ts': ` - export default { - entry: ['src/input.ts'], - format: 'esm', - tsconfig: './tsconfig.build.json', - dts: { - only: true - } - } - `, - }) - expect(outFiles).toEqual(['input.d.mts']) -}) - test(`should generate export {} when there are no exports in source file`, async () => { const { outFiles, getFileContent } = await run(getTestName(), { 'input.ts': `const a = 'a'`, @@ -1358,360 +856,3 @@ test('should load postcss esm config', async () => { expect(outFiles).toEqual(['input.cjs', 'input.css']) expect(await getFileContent('dist/input.css')).toContain('color: blue;') }) - -test('should emit a declaration file per format', async () => { - const { outFiles } = await run(getTestName(), { - 'input.ts': `export default 'foo'`, - 'tsup.config.ts': ` - export default { - entry: ['src/input.ts'], - format: ['esm', 'cjs'], - dts: true - }`, - }) - expect(outFiles).toEqual([ - 'input.d.mts', - 'input.d.ts', - 'input.js', - 'input.mjs', - ]) -}) - -test('should emit a declaration file per format (type: module)', async () => { - const { outFiles } = await run(getTestName(), { - 'input.ts': `export default 'foo'`, - 'package.json': `{ - "type": "module" - }`, - 'tsup.config.ts': ` - export default { - entry: ['src/input.ts'], - format: ['esm', 'cjs'], - dts: true - }`, - }) - expect(outFiles).toEqual([ - 'input.cjs', - 'input.d.cts', - 'input.d.ts', - 'input.js', - ]) -}) - -test('should emit dts chunks per format', async () => { - const { outFiles } = await run( - getTestName(), - { - 'src/input1.ts': ` - import type { InternalType } from './shared.js' - - export function getValue(value: InternalType) { - return value; - } - `, - 'src/input2.ts': ` - import type { InternalType } from './shared.js' - - export function getValue(value: InternalType) { - return value; - } - `, - 'src/shared.ts': `export type InternalType = 'foo'`, - 'tsup.config.ts': ` - export default { - entry: ['./src/input1.ts', './src/input2.ts'], - format: ['esm', 'cjs'], - dts: true - }`, - }, - { entry: [] }, - ) - expect(outFiles).toEqual([ - 'input1.d.mts', - 'input1.d.ts', - 'input1.js', - 'input1.mjs', - 'input2.d.mts', - 'input2.d.ts', - 'input2.js', - 'input2.mjs', - 'shared-qBqaX8Tr.d.mts', - 'shared-qBqaX8Tr.d.ts', - ]) -}) - -test('should emit dts chunks per format (type: module)', async () => { - const { outFiles } = await run( - getTestName(), - { - 'src/input1.ts': ` - import type { InternalType } from './shared.js' - - export function getValue(value: InternalType) { - return value; - } - `, - 'src/input2.ts': ` - import type { InternalType } from './shared.js' - - export function getValue(value: InternalType) { - return value; - } - `, - 'src/shared.ts': `export type InternalType = 'foo'`, - 'tsup.config.ts': ` - export default { - entry: ['./src/input1.ts', './src/input2.ts'], - format: ['esm', 'cjs'], - dts: true - }`, - 'package.json': `{ - "type": "module" - }`, - }, - { entry: [] }, - ) - expect(outFiles).toEqual([ - 'input1.cjs', - 'input1.d.cts', - 'input1.d.ts', - 'input1.js', - 'input2.cjs', - 'input2.d.cts', - 'input2.d.ts', - 'input2.js', - 'shared-qBqaX8Tr.d.cts', - 'shared-qBqaX8Tr.d.ts', - ]) -}) - -test('should emit declaration files with experimentalDts', async () => { - const files = { - 'package.json': ` - { - "name": "tsup-playground", - "private": true, - "version": "0.0.0", - "main": "dist/index.js", - "module": "dist/index.mjs", - "types": "dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "require": "./dist/index.js", - "import": "./dist/index.mjs", - "default": "./dist/index.js" - }, - "./client": { - "types": "./dist/my-lib-client.d.ts", - "require": "./dist/my-lib-client.js", - "import": "./dist/my-lib-client.mjs", - "default": "./dist/my-lib-client.js" - }, - "./server": { - "types": "./dist/server/index.d.ts", - "require": "./dist/server/index.js", - "import": "./dist/server/index.mjs", - "default": "./dist/server/index.js" - } - } - } - `, - 'tsconfig.json': ` - { - "compilerOptions": { - "target": "ES2020", - "skipLibCheck": true, - "noEmit": true - }, - "include": ["./src"] - } - `, - 'tsup.config.ts': ` - export default { - name: 'tsup', - target: 'es2022', - format: [ - 'esm', - 'cjs' - ], - entry: { - index: './src/index.ts', - 'my-lib-client': './src/client.ts', - 'server/index': './src/server.ts', - }, - } - `, - 'src/shared.ts': ` - export function sharedFunction(value: T): T | null { - return value || null - } - - type sharedType = { - shared: boolean - } - - export type { sharedType } - `, - 'src/server.ts': ` - export * from './shared' - - /** - * Comment for server render function - */ - export function render(options: ServerRenderOptions): string { - return JSON.stringify(options) - } - - export interface ServerRenderOptions { - /** - * Comment for ServerRenderOptions.stream - * - * @public - * - * @my_custom_tag - */ - stream: boolean - } - - export const serverConstant = 1 - - export { serverConstant as serverConstantAlias } - - export class ServerClass {}; - - export default function serverDefaultExport(options: ServerRenderOptions): void {}; - - // Export a third party module as a namespace - import * as ServerThirdPartyNamespace from 'react-dom'; - export { ServerThirdPartyNamespace } - - // Export a third party module - export * from 'react-dom/server'; - - `, - 'src/client.ts': ` - export * from './shared' - - export function render(options: ClientRenderOptions): string { - return JSON.stringify(options) - } - - export interface ClientRenderOptions { - document: boolean - } - `, - 'src/index.ts': ` - export * from './client' - export * from './shared' - - export const VERSION = '0.0.0' as const - `, - } - const { outFiles, getFileContent } = await run(getTestName(), files, { - entry: [], - flags: ['--experimental-dts'], - }) - const snapshots: string[] = [] - await Promise.all( - outFiles - .filter((outFile) => outFile.includes('.d.')) - .map(async (outFile) => { - const filePath = path.join('dist', outFile) - const content = await getFileContent(filePath) - snapshots.push( - [ - '', - '/'.repeat(70), - `// ${path.posix.normalize(slash(filePath))}`, - '/'.repeat(70), - '', - content, - ].join('\n'), - ) - }), - ) - expect(snapshots.sort().join('\n')).toMatchSnapshot() -}) - -test('should only include exported declarations with experimentalDts', async () => { - const files = { - 'package.json': `{ "name": "tsup-playground", "private": true }`, - 'tsconfig.json': `{ "compilerOptions": { "skipLibCheck": true } }`, - 'tsup.config.ts': ` - export default { - entry: ['./src/entry1.ts', './src/entry2.ts'] - } - `, - 'src/shared.ts': ` - export const declare1 = 'declare1' - export const declare2 = 'declare2' - `, - 'src/entry1.ts': ` - export { declare1 } from './shared' - `, - 'src/entry2.ts': ` - export { declare2 } from './shared' - `, - } - const { getFileContent } = await run(getTestName(), files, { - entry: [], - flags: ['--experimental-dts'], - }) - - let entry1dts = await getFileContent('dist/entry1.d.ts') - let entry2dts = await getFileContent('dist/entry2.d.ts') - - expect(entry1dts).toContain('declare1') - expect(entry1dts).not.toContain('declare2') - - expect(entry2dts).toContain('declare2') - expect(entry2dts).not.toContain('declare1') -}) - -test('.d.ts files should be cleaned when --clean and --experimental-dts are provided', async () => { - const filesFoo = { - 'package.json': `{ "name": "tsup-playground", "private": true }`, - 'foo.ts': `export const foo = 1`, - } - - const filesFooBar = { - ...filesFoo, - 'bar.ts': `export const bar = 2`, - } - - // First run with both foo and bar - const result1 = await run(getTestName(), filesFooBar, { - entry: ['foo.ts', 'bar.ts'], - flags: ['--experimental-dts'], - }) - - expect(result1.outFiles).toContain('foo.d.ts') - expect(result1.outFiles).toContain('foo.js') - expect(result1.outFiles).toContain('bar.d.ts') - expect(result1.outFiles).toContain('bar.js') - - // Second run with only foo - const result2 = await run(getTestName(), filesFoo, { - entry: ['foo.ts'], - flags: ['--experimental-dts'], - }) - - // When --clean is not provided, the previous bar.* files should still exist - expect(result2.outFiles).toContain('foo.d.ts') - expect(result2.outFiles).toContain('foo.js') - expect(result2.outFiles).toContain('bar.d.ts') - expect(result2.outFiles).toContain('bar.js') - - // Third run with only foo and --clean - const result3 = await run(getTestName(), filesFoo, { - entry: ['foo.ts'], - flags: ['--experimental-dts', '--clean'], - }) - - // When --clean is provided, the previous bar.* files should be deleted - expect(result3.outFiles).toContain('foo.d.ts') - expect(result3.outFiles).toContain('foo.js') - expect(result3.outFiles).not.toContain('bar.d.ts') - expect(result3.outFiles).not.toContain('bar.js') -}) diff --git a/test/svelte.test.ts b/test/svelte.test.ts new file mode 100644 index 000000000..d7fa0a618 --- /dev/null +++ b/test/svelte.test.ts @@ -0,0 +1,93 @@ +import { expect, test } from 'vitest' +import { getTestName, run } from './utils' + +test('bundle svelte', async () => { + const { output, getFileContent } = await run( + getTestName(), + { + 'input.ts': `import App from './App.svelte' + export { App } + `, + 'App.svelte': ` + + + {msg} + + + `, + }, + { + // To make the snapshot leaner + flags: ['--external', 'svelte/internal'], + }, + ) + expect(output).not.toContain(' + + {msg} + `, + }) + + expect(outFiles).toEqual(['input.js']) +}) + +test('svelte: typescript support', async () => { + const { outFiles, output } = await run(getTestName(), { + 'input.ts': `import App from './App.svelte' + export { App } + `, + 'App.svelte': ` + + + {say} + `, + 'Component.svelte': ` + + + {name} + `, + }) + + expect(outFiles).toEqual(['input.js']) + expect(output).toContain('// Component.svelte') +}) + +test('svelte: sass support', async () => { + const { outFiles, output, getFileContent } = await run(getTestName(), { + 'input.ts': `import App from './App.svelte' + export { App } + `, + 'App.svelte': ` +
Hello
+ + `, + }) + + expect(outFiles).toEqual(['input.css', 'input.js']) + const outputCss = await getFileContent('dist/input.css') + expect(outputCss).toMatch(/\.svelte-\w+:hover/) +}) diff --git a/test/tsconfig.test.ts b/test/tsconfig.test.ts new file mode 100644 index 000000000..5bbff1ab6 --- /dev/null +++ b/test/tsconfig.test.ts @@ -0,0 +1,67 @@ +import { test, expect } from 'vitest' +import { getTestName, run } from './utils' + +test('custom tsconfig', async () => { + await run( + getTestName(), + { + 'input.ts': `export const foo = 'foo'`, + 'tsconfig.build.json': `{ + "compilerOptions": { + "baseUrl":"." + } + }`, + }, + { flags: ['--tsconfig', 'tsconfig.build.json'] }, + ) +}) + +test('support baseUrl and paths in tsconfig.json', async () => { + const { getFileContent } = await run(getTestName(), { + 'input.ts': `export * from '@/foo'`, + 'foo.ts': `export const foo = 'foo'`, + 'tsconfig.json': `{ + "compilerOptions": { + "baseUrl":".", + "paths":{"@/*": ["./*"]} + } + }`, + }) + expect(await getFileContent('dist/input.js')).toMatchSnapshot() +}) + +test('support baseUrl and paths in tsconfig.json in --dts build', async () => { + const { getFileContent } = await run( + getTestName(), + { + 'input.ts': `export * from '@/foo'`, + 'src/foo.ts': `export const foo = 'foo'`, + 'tsconfig.json': `{ + "compilerOptions": { + "baseUrl":".", + "paths":{"@/*": ["./src/*"]} + } + }`, + }, + { flags: ['--dts'] }, + ) + expect(await getFileContent('dist/input.d.ts')).toMatchSnapshot() +}) + +test('support baseUrl and paths in tsconfig.json in --dts-resolve build', async () => { + const { getFileContent } = await run( + getTestName(), + { + 'input.ts': `export * from '@/foo'`, + 'src/foo.ts': `export const foo = 'foo'`, + 'tsconfig.json': `{ + "compilerOptions": { + "baseUrl":".", + "paths":{"@/*": ["./src/*"]} + } + }`, + }, + { flags: ['--dts-resolve'] }, + ) + expect(await getFileContent('dist/input.d.ts')).toMatchSnapshot() +}) diff --git a/test/utils.ts b/test/utils.ts new file mode 100644 index 000000000..7129d9317 --- /dev/null +++ b/test/utils.ts @@ -0,0 +1,79 @@ +import { expect } from 'vitest' +import path from 'path' +import execa from 'execa' +import fs from 'fs-extra' +import glob from 'globby' +import { fileURLToPath } from 'url' + +const __dirname = path.dirname(fileURLToPath(import.meta.url)) +const cacheDir = path.resolve(__dirname, '.cache') +const bin = path.resolve(__dirname, '../dist/cli-default.js') + +export function getTestName() { + const name = expect + .getState() + .currentTestName?.replace(/^[a-z]+/g, '_') + .replace(/-/g, '_') + + if (!name) { + throw new Error('No test name') + } + + return name +} + +export async function run( + title: string, + files: { [name: string]: string }, + options: { + entry?: string[] + flags?: string[] + env?: Record + } = {}, +) { + const testDir = path.resolve(cacheDir, filenamify(title)) + + // Write entry files on disk + await Promise.all( + Object.keys(files).map((name) => { + return fs.outputFile(path.resolve(testDir, name), files[name], 'utf8') + }), + ) + + const entry = options.entry || ['input.ts'] + + // Run tsup cli + const { exitCode, stdout, stderr } = await execa( + bin, + [...entry, ...(options.flags || [])], + { + cwd: testDir, + env: { ...process.env, ...options.env }, + }, + ) + const logs = stdout + stderr + if (exitCode !== 0) { + throw new Error(logs) + } + + // Get output + const outFiles = await glob('**/*', { + cwd: path.resolve(testDir, 'dist'), + }).then((res) => res.sort()) + + return { + get output() { + return fs.readFileSync(path.resolve(testDir, 'dist/input.js'), 'utf8') + }, + outFiles, + logs, + outDir: path.resolve(testDir, 'dist'), + getFileContent(filename: string) { + return fs.readFile(path.resolve(testDir, filename), 'utf8') + }, + } +} + +function filenamify(input: string) { + return input.replace(/[^a-zA-Z0-9]/g, '-') +} diff --git a/vitest-global.ts b/vitest-global.ts new file mode 100644 index 000000000..8f2090312 --- /dev/null +++ b/vitest-global.ts @@ -0,0 +1,11 @@ +import execa from 'execa' +import path from 'path' +import fs from 'fs-extra' + +export default async function setup() { + const cacheDir = path.resolve(__dirname, 'test/.cache') + await fs.remove(cacheDir) + console.log(`Installing dependencies in ./test folder`) + await execa('pnpm', ['i'], { cwd: __dirname }) + console.log(`Done... start testing..`) +} diff --git a/vitest.config.ts b/vitest.config.mts similarity index 76% rename from vitest.config.ts rename to vitest.config.mts index ed7271dac..c650e84a9 100644 --- a/vitest.config.ts +++ b/vitest.config.mts @@ -3,5 +3,6 @@ import { defineConfig } from 'vitest/config' export default defineConfig({ test: { testTimeout: 50000, + globalSetup: 'vitest-global.ts', }, })