From 4ae80866386bc9d51d3d260a7a1981385dbca087 Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:42:21 +0200 Subject: [PATCH 01/18] update tsup to 8.2.0 (no change to dist) --- package.json | 2 +- yarn.lock | 523 ++++++++++++++------------------------------------- 2 files changed, 144 insertions(+), 381 deletions(-) diff --git a/package.json b/package.json index 2ac12d065..7d8f0ca1e 100644 --- a/package.json +++ b/package.json @@ -148,7 +148,7 @@ "eslint-config-prettier": "^8.5.0", "eslint-plugin-jsdoc": "^48.5.0", "prettier": "^3.2.5", - "tsup": "^8.1.0", + "tsup": "^8.2.0", "typescript": "^5.4.5", "vitest": "^1.5.2" }, diff --git a/yarn.lock b/yarn.lock index 9133f1843..67b9a9ea8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2080,13 +2080,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/aix-ppc64@npm:0.21.4" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/aix-ppc64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/aix-ppc64@npm:0.23.0" @@ -2101,13 +2094,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/android-arm64@npm:0.21.4" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/android-arm64@npm:0.23.0" @@ -2122,13 +2108,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/android-arm@npm:0.21.4" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@esbuild/android-arm@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/android-arm@npm:0.23.0" @@ -2143,13 +2122,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/android-x64@npm:0.21.4" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - "@esbuild/android-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/android-x64@npm:0.23.0" @@ -2164,13 +2136,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/darwin-arm64@npm:0.21.4" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/darwin-arm64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/darwin-arm64@npm:0.23.0" @@ -2185,13 +2150,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/darwin-x64@npm:0.21.4" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@esbuild/darwin-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/darwin-x64@npm:0.23.0" @@ -2206,13 +2164,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/freebsd-arm64@npm:0.21.4" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/freebsd-arm64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/freebsd-arm64@npm:0.23.0" @@ -2227,13 +2178,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/freebsd-x64@npm:0.21.4" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/freebsd-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/freebsd-x64@npm:0.23.0" @@ -2248,13 +2192,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-arm64@npm:0.21.4" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/linux-arm64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-arm64@npm:0.23.0" @@ -2269,13 +2206,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-arm@npm:0.21.4" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@esbuild/linux-arm@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-arm@npm:0.23.0" @@ -2290,13 +2220,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-ia32@npm:0.21.4" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/linux-ia32@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-ia32@npm:0.23.0" @@ -2311,13 +2234,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-loong64@npm:0.21.4" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - "@esbuild/linux-loong64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-loong64@npm:0.23.0" @@ -2332,13 +2248,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-mips64el@npm:0.21.4" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - "@esbuild/linux-mips64el@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-mips64el@npm:0.23.0" @@ -2353,13 +2262,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-ppc64@npm:0.21.4" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/linux-ppc64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-ppc64@npm:0.23.0" @@ -2374,13 +2276,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-riscv64@npm:0.21.4" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - "@esbuild/linux-riscv64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-riscv64@npm:0.23.0" @@ -2395,13 +2290,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-s390x@npm:0.21.4" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - "@esbuild/linux-s390x@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-s390x@npm:0.23.0" @@ -2416,13 +2304,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-x64@npm:0.21.4" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - "@esbuild/linux-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/linux-x64@npm:0.23.0" @@ -2437,13 +2318,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/netbsd-x64@npm:0.21.4" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/netbsd-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/netbsd-x64@npm:0.23.0" @@ -2465,13 +2339,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/openbsd-x64@npm:0.21.4" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/openbsd-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/openbsd-x64@npm:0.23.0" @@ -2486,13 +2353,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/sunos-x64@npm:0.21.4" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - "@esbuild/sunos-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/sunos-x64@npm:0.23.0" @@ -2507,13 +2367,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/win32-arm64@npm:0.21.4" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/win32-arm64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/win32-arm64@npm:0.23.0" @@ -2528,13 +2381,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/win32-ia32@npm:0.21.4" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/win32-ia32@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/win32-ia32@npm:0.23.0" @@ -2549,13 +2395,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/win32-x64@npm:0.21.4" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@esbuild/win32-x64@npm:0.23.0": version: 0.23.0 resolution: "@esbuild/win32-x64@npm:0.23.0" @@ -2798,9 +2637,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.18.0" +"@rollup/rollup-android-arm-eabi@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.18.1" conditions: os=android & cpu=arm languageName: node linkType: hard @@ -2812,9 +2651,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-android-arm64@npm:4.18.0" +"@rollup/rollup-android-arm64@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-android-arm64@npm:4.18.1" conditions: os=android & cpu=arm64 languageName: node linkType: hard @@ -2826,9 +2665,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-darwin-arm64@npm:4.18.0" +"@rollup/rollup-darwin-arm64@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-darwin-arm64@npm:4.18.1" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard @@ -2840,9 +2679,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-darwin-x64@npm:4.18.0" +"@rollup/rollup-darwin-x64@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-darwin-x64@npm:4.18.1" conditions: os=darwin & cpu=x64 languageName: node linkType: hard @@ -2854,9 +2693,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.0" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.1" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard @@ -2868,9 +2707,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.18.0" +"@rollup/rollup-linux-arm-musleabihf@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.18.1" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard @@ -2882,9 +2721,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.18.0" +"@rollup/rollup-linux-arm64-gnu@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.18.1" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard @@ -2896,9 +2735,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.18.0" +"@rollup/rollup-linux-arm64-musl@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.18.1" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard @@ -2910,9 +2749,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.0" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.1" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard @@ -2924,9 +2763,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.18.0" +"@rollup/rollup-linux-riscv64-gnu@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.18.1" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard @@ -2938,9 +2777,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.18.0" +"@rollup/rollup-linux-s390x-gnu@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.18.1" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard @@ -2952,9 +2791,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.18.0" +"@rollup/rollup-linux-x64-gnu@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.18.1" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard @@ -2966,9 +2805,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.18.0" +"@rollup/rollup-linux-x64-musl@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.18.1" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard @@ -2980,9 +2819,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.18.0" +"@rollup/rollup-win32-arm64-msvc@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.18.1" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard @@ -2994,9 +2833,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.18.0" +"@rollup/rollup-win32-ia32-msvc@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.18.1" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard @@ -3008,9 +2847,9 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.18.0": - version: 4.18.0 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.18.0" +"@rollup/rollup-win32-x64-msvc@npm:4.18.1": + version: 4.18.1 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.18.1" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -4246,18 +4085,18 @@ __metadata: languageName: node linkType: hard -"bundle-require@npm:^4.0.0": - version: 4.2.1 - resolution: "bundle-require@npm:4.2.1" +"bundle-require@npm:^5.0.0": + version: 5.0.0 + resolution: "bundle-require@npm:5.0.0" dependencies: load-tsconfig: "npm:^0.2.3" peerDependencies: - esbuild: ">=0.17" - checksum: 10c0/f458ce39f8dd23f900f1877f475f36aa502ecf888cc97cfa2b8d1e9178d091a0d4c09f07afff001aae8b805ba6a94ca71bbbd9efe08b0e03c870bd61e8c00cb3 + esbuild: ">=0.18" + checksum: 10c0/92c46df02586e0ebd66ee4831c9b5775adb3c32a43fe2b2aaf7bc675135c141f751de6a9a26b146d64c607c5b40f9eef5f10dce3c364f602d4bed268444c32c6 languageName: node linkType: hard -"cac@npm:^6.7.12, cac@npm:^6.7.14": +"cac@npm:^6.7.14": version: 6.7.14 resolution: "cac@npm:6.7.14" checksum: 10c0/4ee06aaa7bab8981f0d54e5f5f9d4adcd64058e9697563ce336d8a3878ed018ee18ebe5359b2430eceae87e0758e62ea2019c3f52ae6e211b1bd2e133856cd10 @@ -4471,7 +4310,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.5.1": +"chokidar@npm:^3.6.0": version: 3.6.0 resolution: "chokidar@npm:3.6.0" dependencies: @@ -4655,6 +4494,13 @@ __metadata: languageName: node linkType: hard +"consola@npm:^3.2.3": + version: 3.2.3 + resolution: "consola@npm:3.2.3" + checksum: 10c0/c606220524ec88a05bb1baf557e9e0e04a0c08a9c35d7a08652d99de195c4ddcb6572040a7df57a18ff38bbc13ce9880ad032d56630cef27bef72768ef0ac078 + languageName: node + linkType: hard + "convert-source-map@npm:^2.0.0": version: 2.0.0 resolution: "convert-source-map@npm:2.0.0" @@ -5227,13 +5073,13 @@ __metadata: eslint-config-prettier: "npm:^8.5.0" eslint-plugin-jsdoc: "npm:^48.5.0" prettier: "npm:^3.2.5" - tsup: "npm:^8.1.0" + tsup: "npm:^8.2.0" typescript: "npm:^5.4.5" vitest: "npm:^1.5.2" languageName: unknown linkType: soft -"esbuild@npm:0.23.0": +"esbuild@npm:0.23.0, esbuild@npm:^0.23.0": version: 0.23.0 resolution: "esbuild@npm:0.23.0" dependencies: @@ -5396,86 +5242,6 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.21.4": - version: 0.21.4 - resolution: "esbuild@npm:0.21.4" - dependencies: - "@esbuild/aix-ppc64": "npm:0.21.4" - "@esbuild/android-arm": "npm:0.21.4" - "@esbuild/android-arm64": "npm:0.21.4" - "@esbuild/android-x64": "npm:0.21.4" - "@esbuild/darwin-arm64": "npm:0.21.4" - "@esbuild/darwin-x64": "npm:0.21.4" - "@esbuild/freebsd-arm64": "npm:0.21.4" - "@esbuild/freebsd-x64": "npm:0.21.4" - "@esbuild/linux-arm": "npm:0.21.4" - "@esbuild/linux-arm64": "npm:0.21.4" - "@esbuild/linux-ia32": "npm:0.21.4" - "@esbuild/linux-loong64": "npm:0.21.4" - "@esbuild/linux-mips64el": "npm:0.21.4" - "@esbuild/linux-ppc64": "npm:0.21.4" - "@esbuild/linux-riscv64": "npm:0.21.4" - "@esbuild/linux-s390x": "npm:0.21.4" - "@esbuild/linux-x64": "npm:0.21.4" - "@esbuild/netbsd-x64": "npm:0.21.4" - "@esbuild/openbsd-x64": "npm:0.21.4" - "@esbuild/sunos-x64": "npm:0.21.4" - "@esbuild/win32-arm64": "npm:0.21.4" - "@esbuild/win32-ia32": "npm:0.21.4" - "@esbuild/win32-x64": "npm:0.21.4" - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: 10c0/83276c7b82bc3415199da91a84a01cf287d4912f2c02fead9c0542d6bda463d6d152cb7fb86f680dae72dc701c864a8963069ddb9e2b344948595cc87f81c4f1 - languageName: node - linkType: hard - "escalade@npm:^3.1.1": version: 3.1.2 resolution: "escalade@npm:3.1.2" @@ -5662,7 +5428,7 @@ __metadata: languageName: node linkType: hard -"execa@npm:^5.0.0": +"execa@npm:^5.1.1": version: 5.1.1 resolution: "execa@npm:5.1.1" dependencies: @@ -6166,7 +5932,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.0, globby@npm:^11.0.3, globby@npm:^11.1.0": +"globby@npm:^11.0.0, globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -6870,7 +6636,7 @@ __metadata: languageName: node linkType: hard -"joycon@npm:^3.0.1": +"joycon@npm:^3.1.1": version: 3.1.1 resolution: "joycon@npm:3.1.1" checksum: 10c0/131fb1e98c9065d067fd49b6e685487ac4ad4d254191d7aa2c9e3b90f4e9ca70430c43cad001602bdbdabcf58717d3b5c5b7461c1bd8e39478c8de706b3fe6ae @@ -7061,10 +6827,10 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^3.0.0": - version: 3.1.1 - resolution: "lilconfig@npm:3.1.1" - checksum: 10c0/311b559794546894e3fe176663427326026c1c644145be9e8041c58e268aa9328799b8dfe7e4dd8c6a4ae305feae95a1c9e007db3569f35b42b6e1bc8274754c +"lilconfig@npm:^3.1.1": + version: 3.1.2 + resolution: "lilconfig@npm:3.1.2" + checksum: 10c0/f059630b1a9bddaeba83059db00c672b64dc14074e9f232adce32b38ca1b5686ab737eb665c5ba3c32f147f0002b4bee7311ad0386a9b98547b5623e87071fbe languageName: node linkType: hard @@ -8133,21 +7899,26 @@ __metadata: languageName: node linkType: hard -"postcss-load-config@npm:^4.0.1": - version: 4.0.2 - resolution: "postcss-load-config@npm:4.0.2" +"postcss-load-config@npm:^6.0.1": + version: 6.0.1 + resolution: "postcss-load-config@npm:6.0.1" dependencies: - lilconfig: "npm:^3.0.0" - yaml: "npm:^2.3.4" + lilconfig: "npm:^3.1.1" peerDependencies: + jiti: ">=1.21.0" postcss: ">=8.0.9" - ts-node: ">=9.0.0" + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: + jiti: + optional: true postcss: optional: true - ts-node: + tsx: + optional: true + yaml: optional: true - checksum: 10c0/3d7939acb3570b0e4b4740e483d6e555a3e2de815219cb8a3c8fc03f575a6bde667443aa93369c0be390af845cb84471bf623e24af833260de3a105b78d42519 + checksum: 10c0/74173a58816dac84e44853f7afbd283f4ef13ca0b6baeba27701214beec33f9e309b128f8102e2b173e8d45ecba45d279a9be94b46bf48d219626aa9b5730848 languageName: node linkType: hard @@ -8590,26 +8361,26 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.0.2": - version: 4.18.0 - resolution: "rollup@npm:4.18.0" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.18.0" - "@rollup/rollup-android-arm64": "npm:4.18.0" - "@rollup/rollup-darwin-arm64": "npm:4.18.0" - "@rollup/rollup-darwin-x64": "npm:4.18.0" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.18.0" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.18.0" - "@rollup/rollup-linux-arm64-gnu": "npm:4.18.0" - "@rollup/rollup-linux-arm64-musl": "npm:4.18.0" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.18.0" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.18.0" - "@rollup/rollup-linux-s390x-gnu": "npm:4.18.0" - "@rollup/rollup-linux-x64-gnu": "npm:4.18.0" - "@rollup/rollup-linux-x64-musl": "npm:4.18.0" - "@rollup/rollup-win32-arm64-msvc": "npm:4.18.0" - "@rollup/rollup-win32-ia32-msvc": "npm:4.18.0" - "@rollup/rollup-win32-x64-msvc": "npm:4.18.0" +"rollup@npm:^4.13.0": + version: 4.16.4 + resolution: "rollup@npm:4.16.4" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.16.4" + "@rollup/rollup-android-arm64": "npm:4.16.4" + "@rollup/rollup-darwin-arm64": "npm:4.16.4" + "@rollup/rollup-darwin-x64": "npm:4.16.4" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.16.4" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.16.4" + "@rollup/rollup-linux-arm64-gnu": "npm:4.16.4" + "@rollup/rollup-linux-arm64-musl": "npm:4.16.4" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.16.4" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.16.4" + "@rollup/rollup-linux-s390x-gnu": "npm:4.16.4" + "@rollup/rollup-linux-x64-gnu": "npm:4.16.4" + "@rollup/rollup-linux-x64-musl": "npm:4.16.4" + "@rollup/rollup-win32-arm64-msvc": "npm:4.16.4" + "@rollup/rollup-win32-ia32-msvc": "npm:4.16.4" + "@rollup/rollup-win32-x64-msvc": "npm:4.16.4" "@types/estree": "npm:1.0.5" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -8649,30 +8420,30 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/7d0239f029c48d977e0d0b942433bed9ca187d2328b962fc815fc775d0fdf1966ffcd701fef265477e999a1fb01bddcc984fc675d1b9d9864bf8e1f1f487e23e + checksum: 10c0/f88017e8a599b055c555fe9b9dc2eee3def3067701600492a2dc2ed3ba78c3f0b1d7927f9ed934afef936167a73447121e8f7fbc4804b73f6c181e2d7f52e853 languageName: node linkType: hard -"rollup@npm:^4.13.0": - version: 4.16.4 - resolution: "rollup@npm:4.16.4" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.16.4" - "@rollup/rollup-android-arm64": "npm:4.16.4" - "@rollup/rollup-darwin-arm64": "npm:4.16.4" - "@rollup/rollup-darwin-x64": "npm:4.16.4" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.16.4" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.16.4" - "@rollup/rollup-linux-arm64-gnu": "npm:4.16.4" - "@rollup/rollup-linux-arm64-musl": "npm:4.16.4" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.16.4" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.16.4" - "@rollup/rollup-linux-s390x-gnu": "npm:4.16.4" - "@rollup/rollup-linux-x64-gnu": "npm:4.16.4" - "@rollup/rollup-linux-x64-musl": "npm:4.16.4" - "@rollup/rollup-win32-arm64-msvc": "npm:4.16.4" - "@rollup/rollup-win32-ia32-msvc": "npm:4.16.4" - "@rollup/rollup-win32-x64-msvc": "npm:4.16.4" +"rollup@npm:^4.18.1": + version: 4.18.1 + resolution: "rollup@npm:4.18.1" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.18.1" + "@rollup/rollup-android-arm64": "npm:4.18.1" + "@rollup/rollup-darwin-arm64": "npm:4.18.1" + "@rollup/rollup-darwin-x64": "npm:4.18.1" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.18.1" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.18.1" + "@rollup/rollup-linux-arm64-gnu": "npm:4.18.1" + "@rollup/rollup-linux-arm64-musl": "npm:4.18.1" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.18.1" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.18.1" + "@rollup/rollup-linux-s390x-gnu": "npm:4.18.1" + "@rollup/rollup-linux-x64-gnu": "npm:4.18.1" + "@rollup/rollup-linux-x64-musl": "npm:4.18.1" + "@rollup/rollup-win32-arm64-msvc": "npm:4.18.1" + "@rollup/rollup-win32-ia32-msvc": "npm:4.18.1" + "@rollup/rollup-win32-x64-msvc": "npm:4.18.1" "@types/estree": "npm:1.0.5" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -8712,7 +8483,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/f88017e8a599b055c555fe9b9dc2eee3def3067701600492a2dc2ed3ba78c3f0b1d7927f9ed934afef936167a73447121e8f7fbc4804b73f6c181e2d7f52e853 + checksum: 10c0/c3c73252fd9f1d39eaeb44aa860141d9daf10d6eada73791a0ef453d38fe8f2c2dfef103ac1f387ed192dd5a2994534f91c026eed9ba1cfb50f5781f48c1f44f languageName: node linkType: hard @@ -9316,7 +9087,7 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.20.3": +"sucrase@npm:^3.35.0": version: 3.35.0 resolution: "sucrase@npm:3.35.0" dependencies: @@ -9618,23 +9389,24 @@ __metadata: languageName: node linkType: hard -"tsup@npm:^8.1.0": - version: 8.1.0 - resolution: "tsup@npm:8.1.0" +"tsup@npm:^8.2.0": + version: 8.2.0 + resolution: "tsup@npm:8.2.0" dependencies: - bundle-require: "npm:^4.0.0" - cac: "npm:^6.7.12" - chokidar: "npm:^3.5.1" - debug: "npm:^4.3.1" - esbuild: "npm:^0.21.4" - execa: "npm:^5.0.0" - globby: "npm:^11.0.3" - joycon: "npm:^3.0.1" - postcss-load-config: "npm:^4.0.1" + bundle-require: "npm:^5.0.0" + cac: "npm:^6.7.14" + chokidar: "npm:^3.6.0" + consola: "npm:^3.2.3" + debug: "npm:^4.3.5" + esbuild: "npm:^0.23.0" + execa: "npm:^5.1.1" + globby: "npm:^11.1.0" + joycon: "npm:^3.1.1" + postcss-load-config: "npm:^6.0.1" resolve-from: "npm:^5.0.0" - rollup: "npm:^4.0.2" + rollup: "npm:^4.18.1" source-map: "npm:0.8.0-beta.0" - sucrase: "npm:^3.20.3" + sucrase: "npm:^3.35.0" tree-kill: "npm:^1.2.2" peerDependencies: "@microsoft/api-extractor": ^7.36.0 @@ -9653,7 +9425,7 @@ __metadata: bin: tsup: dist/cli-default.js tsup-node: dist/cli-node.js - checksum: 10c0/93f36680f56cb5e3645fa298e49c0736d1596de4b77d21bda304491e4f157d2ce5cf7195b30e76f2cf9de7e5709f66a251ec92c75268e6dcd9e1d523e4d3004a + checksum: 10c0/79e46604e64118c223a8898a37ed96a11a9d8f89f5eb527b10addf734000fa3b7cea6ff50cb256fc7057a689ce2d6cb9ccd5b2063ee80643673f20bf532c70d5 languageName: node linkType: hard @@ -10492,15 +10264,6 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.3.4": - version: 2.4.3 - resolution: "yaml@npm:2.4.3" - bin: - yaml: bin.mjs - checksum: 10c0/b4a9dea34265f000402c909144ac310be42c4526dfd16dff1aee2b04a0d94051713651c0cd2b0a3d8109266997422120f16a7934629d12f22dc215839ebbeccf - languageName: node - linkType: hard - "yamlparser@npm:0.0.x": version: 0.0.2 resolution: "yamlparser@npm:0.0.2" From 7d4bdf7f0bf8bc297c2e8ab3cbdccd7ed6d5743b Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Fri, 19 Jul 2024 23:10:57 +0200 Subject: [PATCH 02/18] add rollup config to generate dist --- .npmignore | 3 +- package.json | 5 + rollup.config.mjs | 187 +++++++++++++++++++++++++++++ yarn.lock | 292 +++++++++++++++++++--------------------------- 4 files changed, 315 insertions(+), 172 deletions(-) create mode 100644 rollup.config.mjs diff --git a/.npmignore b/.npmignore index 56976b9a7..cae9888bd 100644 --- a/.npmignore +++ b/.npmignore @@ -1 +1,2 @@ -.nvmrc \ No newline at end of file +.nvmrc +dist/**/_internal/*.d.ts diff --git a/package.json b/package.json index 7d8f0ca1e..b6738e174 100644 --- a/package.json +++ b/package.json @@ -136,6 +136,7 @@ "@babel/preset-typescript": "^7.24.1", "@changesets/changelog-github": "^0.5.0", "@changesets/cli": "^2.27.1", + "@rollup/plugin-typescript": "^11.1.6", "@types/babel__core": "^7", "@types/babel__preset-env": "^7", "@types/broken-link-checker": "^0", @@ -147,7 +148,11 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jsdoc": "^48.5.0", + "glob": "^11.0.0", "prettier": "^3.2.5", + "rollup": "^4.18.1", + "rollup-plugin-dts": "^6.1.1", + "tslib": "^2.6.3", "tsup": "^8.2.0", "typescript": "^5.4.5", "vitest": "^1.5.2" diff --git a/rollup.config.mjs b/rollup.config.mjs new file mode 100644 index 000000000..3ed0a580c --- /dev/null +++ b/rollup.config.mjs @@ -0,0 +1,187 @@ +// @ts-check + +import fs from 'node:fs'; +import { createRequire } from 'node:module'; +import path from 'node:path'; +import { globSync } from 'glob'; +import tsPlugin from '@rollup/plugin-typescript'; +import dtsPlugin from 'rollup-plugin-dts'; + +const testPatterns = ['**/*.bench.ts', '**/*.spec.ts', '**/*.test.ts']; + +export default () => { + clearDir('dist'); + clearDir('umd'); + + const files = findLibFiles(); + + return [ + libBuildOptions({ + format: 'esm', + extension: 'mjs', + inputFiles: files.allFiles, + outDir: 'dist', + }), + libBuildOptions({ + format: 'cjs', + extension: 'js', + // For CJS, only treat the package.json#exports paths as entrypoints, + // resulting in one bundle per category (array, object, etc.), + // plus one index requiring those bundles. + inputFiles: files.entrypoints, + outDir: 'dist', + }), + declarationOptions({ + inputFiles: files.entrypoints, + outDir: 'dist', + }), + umdBuildConfig({ + input: './src/browser.ts', + outFile: 'browser.global.js', + outDir: 'umd', + }), + ]; +}; + +function findLibFiles() { + /** @type {{ exports: Record}} */ + const packageJson = createRequire(import.meta.url)('./package.json'); + const entrypoints = Object.values(packageJson.exports).filter(f => /^(\.\/)?src\//.test(f) && f.endsWith('.ts')); + + const allFiles = globSync('./src/**/*.ts', { + cwd: import.meta.dirname, + ignore: [...testPatterns], + }); + + return { + entrypoints, + allFiles, + }; +} + +/** + * @type {(options: { + * format: 'esm' | 'cjs'; + * extension: 'js' | 'cjs' | 'mjs'; + * inputFiles: string[]; + * outDir: string; + * }) => import('rollup').RollupOptions} + */ +function libBuildOptions({ extension, format, inputFiles, outDir }) { + const isESM = format === 'esm'; + + return { + input: mapInputs(inputFiles), + plugins: [ + tsPlugin({ + exclude: [...testPatterns], + compilerOptions: { + sourceMap: true, + inlineSources: true, + declaration: false, + }, + }), + ], + output: { + format, + dir: outDir, + ...fileNames(extension), + // Using preserveModules virtually disables extracting common chunks, + // leading to a result that is a mirror of the TypeScript source. + preserveModules: isESM, + manualChunks: isESM ? undefined : manualChunks, + sourcemap: true, + generatedCode: 'es2015', + // Hoisting transitive imports adds bare imports in modules, + // which can make imports by JS runtimes slightly faster, + // but makes the generated code harder to follow. + hoistTransitiveImports: false, + }, + }; +} + +/** + * @type {(options: {input: string; outFile: string; outDir: string}) => import('rollup').RollupOptions} + */ +function umdBuildConfig({ input, outFile, outDir }) { + return { + input, + plugins: [ + tsPlugin({ + exclude: [...testPatterns], + compilerOptions: { + sourceMap: false, + declaration: false, + }, + }), + ], + output: { + format: 'umd', + dir: outDir, + file: outFile, + generatedCode: 'es2015', + }, + }; +} + +/** + * @type {(options: {inputFiles: string[]; outDir: string}) => import('rollup').RollupOptions} + */ +function declarationOptions({ inputFiles, outDir }) { + return { + plugins: [dtsPlugin()], + input: mapInputs(inputFiles), + output: [ + { + format: 'esm', + dir: outDir, + generatedCode: 'es2015', + ...fileNames('d.mts'), + preserveModules: true, + preserveModulesRoot: 'src', + }, + { + format: 'cjs', + dir: outDir, + generatedCode: 'es2015', + ...fileNames('d.ts'), + preserveModules: true, + preserveModulesRoot: 'src', + }, + ], + }; +} + +/** @type {(srcFiles: string[]) => Record} */ +function mapInputs(srcFiles) { + return Object.fromEntries( + srcFiles.map(file => [ + file.replace(/^(\.\/)?src\//, '').replace(/\.[cm]?(js|ts)$/, ''), + path.join(import.meta.dirname, file), + ]) + ); +} + +function fileNames(extension = 'js') { + return { + entryFileNames: `[name].${extension}`, + chunkFileNames: `_chunk/[name]-[hash:6].${extension}`, + }; +} + +/** @type {import('rollup').GetManualChunk} */ +function manualChunks(id) { + const category = id.match(/\/src\/([\w-_]+)\//)?.[1]; + if (category) { + return category; + } +} + +/** @type {(dir: string) => void} */ +function clearDir(dir) { + const dirPath = path.join(import.meta.dirname, dir); + if (dir && fs.existsSync(dirPath)) { + fs.rmSync(dirPath, { recursive: true, force: true }); + console.log(`cleared: ${dir}`); + } +} diff --git a/yarn.lock b/yarn.lock index 67b9a9ea8..1807ce04e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2630,10 +2630,38 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.16.4" - conditions: os=android & cpu=arm +"@rollup/plugin-typescript@npm:^11.1.6": + version: 11.1.6 + resolution: "@rollup/plugin-typescript@npm:11.1.6" + dependencies: + "@rollup/pluginutils": "npm:^5.1.0" + resolve: "npm:^1.22.1" + peerDependencies: + rollup: ^2.14.0||^3.0.0||^4.0.0 + tslib: "*" + typescript: ">=3.7.0" + peerDependenciesMeta: + rollup: + optional: true + tslib: + optional: true + checksum: 10c0/5347cd73ac28d4cf2401a3e689864a1a0df8f3ae029abd9c38525cbc84bcfa16c3a32a0ac5698dac65ec531ba7cf8332e14f5fc7f8fa501193da23320a134c5c + languageName: node + linkType: hard + +"@rollup/pluginutils@npm:^5.1.0": + version: 5.1.0 + resolution: "@rollup/pluginutils@npm:5.1.0" + dependencies: + "@types/estree": "npm:^1.0.0" + estree-walker: "npm:^2.0.2" + picomatch: "npm:^2.3.1" + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/c7bed15711f942d6fdd3470fef4105b73991f99a478605e13d41888963330a6f9e32be37e6ddb13f012bc7673ff5e54f06f59fd47109436c1c513986a8a7612d languageName: node linkType: hard @@ -2644,13 +2672,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-android-arm64@npm:4.16.4" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-android-arm64@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-android-arm64@npm:4.18.1" @@ -2658,13 +2679,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-darwin-arm64@npm:4.16.4" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-arm64@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-darwin-arm64@npm:4.18.1" @@ -2672,13 +2686,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-darwin-x64@npm:4.16.4" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-darwin-x64@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-darwin-x64@npm:4.18.1" @@ -2686,13 +2693,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.16.4" - conditions: os=linux & cpu=arm & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.1" @@ -2700,13 +2700,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.16.4" - conditions: os=linux & cpu=arm & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm-musleabihf@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.18.1" @@ -2714,13 +2707,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.16.4" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-gnu@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.18.1" @@ -2728,13 +2714,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.16.4" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-arm64-musl@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-arm64-musl@npm:4.18.1" @@ -2742,13 +2721,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.16.4" - conditions: os=linux & cpu=ppc64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.1" @@ -2756,13 +2728,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.16.4" - conditions: os=linux & cpu=riscv64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-riscv64-gnu@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.18.1" @@ -2770,13 +2735,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.16.4" - conditions: os=linux & cpu=s390x & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-s390x-gnu@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.18.1" @@ -2784,13 +2742,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.16.4" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-gnu@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-x64-gnu@npm:4.18.1" @@ -2798,13 +2749,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.16.4" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@rollup/rollup-linux-x64-musl@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-linux-x64-musl@npm:4.18.1" @@ -2812,13 +2756,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.16.4" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@rollup/rollup-win32-arm64-msvc@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.18.1" @@ -2826,13 +2763,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.16.4" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@rollup/rollup-win32-ia32-msvc@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.18.1" @@ -2840,13 +2770,6 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.16.4": - version: 4.16.4 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.16.4" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@rollup/rollup-win32-x64-msvc@npm:4.18.1": version: 4.18.1 resolution: "@rollup/rollup-win32-x64-msvc@npm:4.18.1" @@ -5061,6 +4984,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@changesets/changelog-github": "npm:^0.5.0" "@changesets/cli": "npm:^2.27.1" + "@rollup/plugin-typescript": "npm:^11.1.6" "@types/babel__core": "npm:^7" "@types/babel__preset-env": "npm:^7" "@types/broken-link-checker": "npm:^0" @@ -5072,7 +4996,11 @@ __metadata: eslint: "npm:^8.56.0" eslint-config-prettier: "npm:^8.5.0" eslint-plugin-jsdoc: "npm:^48.5.0" + glob: "npm:^11.0.0" prettier: "npm:^3.2.5" + rollup: "npm:^4.18.1" + rollup-plugin-dts: "npm:^6.1.1" + tslib: "npm:^2.6.3" tsup: "npm:^8.2.0" typescript: "npm:^5.4.5" vitest: "npm:^1.5.2" @@ -5892,6 +5820,22 @@ __metadata: languageName: node linkType: hard +"glob@npm:^11.0.0": + version: 11.0.0 + resolution: "glob@npm:11.0.0" + dependencies: + foreground-child: "npm:^3.1.0" + jackspeak: "npm:^4.0.1" + minimatch: "npm:^10.0.0" + minipass: "npm:^7.1.2" + package-json-from-dist: "npm:^1.0.0" + path-scurry: "npm:^2.0.0" + bin: + glob: dist/esm/bin.mjs + checksum: 10c0/419866015d8795258a8ac51de5b9d1a99c72634fc3ead93338e4da388e89773ab21681e494eac0fbc4250b003451ca3110bb4f1c9393d15d14466270094fdb4e + languageName: node + linkType: hard + "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -6636,6 +6580,19 @@ __metadata: languageName: node linkType: hard +"jackspeak@npm:^4.0.1": + version: 4.0.1 + resolution: "jackspeak@npm:4.0.1" + dependencies: + "@isaacs/cliui": "npm:^8.0.2" + "@pkgjs/parseargs": "npm:^0.11.0" + dependenciesMeta: + "@pkgjs/parseargs": + optional: true + checksum: 10c0/c87997d9c9c5b7366259b1f2a444ef148692f8eedad5307caca939babbb60af2b47d306e5c63bf9d5fefbab2ab48d4da275188c3de525d0e716cc21b784bbccb + languageName: node + linkType: hard + "joycon@npm:^3.1.1": version: 3.1.1 resolution: "joycon@npm:3.1.1" @@ -6989,6 +6946,13 @@ __metadata: languageName: node linkType: hard +"lru-cache@npm:^11.0.0": + version: 11.0.0 + resolution: "lru-cache@npm:11.0.0" + checksum: 10c0/827ff0e0739f9b0f30f92f5a5fc97c6a2bd3ae32c0452bc58cb7411d6c589d49536073027293f2d1f02d0c2e72b63b162f238df7e9ff6f4cc0345f92afec4d1d + languageName: node + linkType: hard + "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -7182,6 +7146,15 @@ __metadata: languageName: node linkType: hard +"minimatch@npm:^10.0.0": + version: 10.0.1 + resolution: "minimatch@npm:10.0.1" + dependencies: + brace-expansion: "npm:^2.0.1" + checksum: 10c0/e6c29a81fe83e1877ad51348306be2e8aeca18c88fdee7a99df44322314279e15799e41d7cb274e4e8bb0b451a3bc622d6182e157dfa1717d6cda75e9cd8cd5d + languageName: node + linkType: hard + "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -7292,6 +7265,13 @@ __metadata: languageName: node linkType: hard +"minipass@npm:^7.1.2": + version: 7.1.2 + resolution: "minipass@npm:7.1.2" + checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 + languageName: node + linkType: hard + "minisearch@npm:^6.3.0": version: 6.3.0 resolution: "minisearch@npm:6.3.0" @@ -7710,6 +7690,13 @@ __metadata: languageName: node linkType: hard +"package-json-from-dist@npm:^1.0.0": + version: 1.0.0 + resolution: "package-json-from-dist@npm:1.0.0" + checksum: 10c0/e3ffaf6ac1040ab6082a658230c041ad14e72fabe99076a2081bb1d5d41210f11872403fc09082daf4387fc0baa6577f96c9c0e94c90c394fd57794b66aa4033 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -7802,6 +7789,16 @@ __metadata: languageName: node linkType: hard +"path-scurry@npm:^2.0.0": + version: 2.0.0 + resolution: "path-scurry@npm:2.0.0" + dependencies: + lru-cache: "npm:^11.0.0" + minipass: "npm:^7.1.2" + checksum: 10c0/3da4adedaa8e7ef8d6dc4f35a0ff8f05a9b4d8365f2b28047752b62d4c1ad73eec21e37b1579ef2d075920157856a3b52ae8309c480a6f1a8bbe06ff8e52b33c + languageName: node + linkType: hard + "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" @@ -8274,7 +8271,7 @@ __metadata: languageName: node linkType: hard -"resolve@npm:^1.10.0, resolve@npm:^1.14.2": +"resolve@npm:^1.10.0, resolve@npm:^1.14.2, resolve@npm:^1.22.1": version: 1.22.8 resolution: "resolve@npm:1.22.8" dependencies: @@ -8287,7 +8284,7 @@ __metadata: languageName: node linkType: hard -"resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin": +"resolve@patch:resolve@npm%3A^1.10.0#optional!builtin, resolve@patch:resolve@npm%3A^1.14.2#optional!builtin, resolve@patch:resolve@npm%3A^1.22.1#optional!builtin": version: 1.22.8 resolution: "resolve@patch:resolve@npm%3A1.22.8#optional!builtin::version=1.22.8&hash=c3c19d" dependencies: @@ -8361,70 +8358,23 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.13.0": - version: 4.16.4 - resolution: "rollup@npm:4.16.4" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.16.4" - "@rollup/rollup-android-arm64": "npm:4.16.4" - "@rollup/rollup-darwin-arm64": "npm:4.16.4" - "@rollup/rollup-darwin-x64": "npm:4.16.4" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.16.4" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.16.4" - "@rollup/rollup-linux-arm64-gnu": "npm:4.16.4" - "@rollup/rollup-linux-arm64-musl": "npm:4.16.4" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.16.4" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.16.4" - "@rollup/rollup-linux-s390x-gnu": "npm:4.16.4" - "@rollup/rollup-linux-x64-gnu": "npm:4.16.4" - "@rollup/rollup-linux-x64-musl": "npm:4.16.4" - "@rollup/rollup-win32-arm64-msvc": "npm:4.16.4" - "@rollup/rollup-win32-ia32-msvc": "npm:4.16.4" - "@rollup/rollup-win32-x64-msvc": "npm:4.16.4" - "@types/estree": "npm:1.0.5" - fsevents: "npm:~2.3.2" +"rollup-plugin-dts@npm:^6.1.1": + version: 6.1.1 + resolution: "rollup-plugin-dts@npm:6.1.1" + dependencies: + "@babel/code-frame": "npm:^7.24.2" + magic-string: "npm:^0.30.10" + peerDependencies: + rollup: ^3.29.4 || ^4 + typescript: ^4.5 || ^5.0 dependenciesMeta: - "@rollup/rollup-android-arm-eabi": - optional: true - "@rollup/rollup-android-arm64": - optional: true - "@rollup/rollup-darwin-arm64": - optional: true - "@rollup/rollup-darwin-x64": - optional: true - "@rollup/rollup-linux-arm-gnueabihf": - optional: true - "@rollup/rollup-linux-arm-musleabihf": + "@babel/code-frame": optional: true - "@rollup/rollup-linux-arm64-gnu": - optional: true - "@rollup/rollup-linux-arm64-musl": - optional: true - "@rollup/rollup-linux-powerpc64le-gnu": - optional: true - "@rollup/rollup-linux-riscv64-gnu": - optional: true - "@rollup/rollup-linux-s390x-gnu": - optional: true - "@rollup/rollup-linux-x64-gnu": - optional: true - "@rollup/rollup-linux-x64-musl": - optional: true - "@rollup/rollup-win32-arm64-msvc": - optional: true - "@rollup/rollup-win32-ia32-msvc": - optional: true - "@rollup/rollup-win32-x64-msvc": - optional: true - fsevents: - optional: true - bin: - rollup: dist/bin/rollup - checksum: 10c0/f88017e8a599b055c555fe9b9dc2eee3def3067701600492a2dc2ed3ba78c3f0b1d7927f9ed934afef936167a73447121e8f7fbc4804b73f6c181e2d7f52e853 + checksum: 10c0/2b042198ff00fb10c9c70087bbac9013f748dc34be0dbfcca82c6353884ead1467b4a8a37bafe9a8b9356479d43715c7cbc591eeb8e4112c583452431c1cb0a0 languageName: node linkType: hard -"rollup@npm:^4.18.1": +"rollup@npm:^4.13.0, rollup@npm:^4.18.1": version: 4.18.1 resolution: "rollup@npm:4.18.1" dependencies: @@ -9382,7 +9332,7 @@ __metadata: languageName: node linkType: hard -"tslib@npm:^2.6.2": +"tslib@npm:^2.6.2, tslib@npm:^2.6.3": version: 2.6.3 resolution: "tslib@npm:2.6.3" checksum: 10c0/2598aef53d9dbe711af75522464b2104724d6467b26a60f2bdac8297d2b5f1f6b86a71f61717384aa8fd897240467aaa7bcc36a0700a0faf751293d1331db39a From 24f9bc11d2b933a091dfaca9d3708ba576bfa8fe Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:19:05 +0200 Subject: [PATCH 03/18] fix browser build config --- package.json | 1 + rollup.config.mjs | 19 +++++---- yarn.lock | 101 +++++++++++++++++++++++++++++++++++++++++++++- 3 files changed, 112 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index b6738e174..cf502fc54 100644 --- a/package.json +++ b/package.json @@ -136,6 +136,7 @@ "@babel/preset-typescript": "^7.24.1", "@changesets/changelog-github": "^0.5.0", "@changesets/cli": "^2.27.1", + "@rollup/plugin-terser": "^0.4.4", "@rollup/plugin-typescript": "^11.1.6", "@types/babel__core": "^7", "@types/babel__preset-env": "^7", diff --git a/rollup.config.mjs b/rollup.config.mjs index 3ed0a580c..01906d0cb 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -4,6 +4,7 @@ import fs from 'node:fs'; import { createRequire } from 'node:module'; import path from 'node:path'; import { globSync } from 'glob'; +import terserPlugin from '@rollup/plugin-terser'; import tsPlugin from '@rollup/plugin-typescript'; import dtsPlugin from 'rollup-plugin-dts'; @@ -36,9 +37,8 @@ export default () => { outDir: 'dist', }), umdBuildConfig({ - input: './src/browser.ts', - outFile: 'browser.global.js', - outDir: 'umd', + inputFile: './src/browser.ts', + outFile: 'umd/browser.global.js', }), ]; }; @@ -101,24 +101,27 @@ function libBuildOptions({ extension, format, inputFiles, outDir }) { } /** - * @type {(options: {input: string; outFile: string; outDir: string}) => import('rollup').RollupOptions} + * @type {(options: {inputFile: string; outFile: string}) => import('rollup').RollupOptions} */ -function umdBuildConfig({ input, outFile, outDir }) { +function umdBuildConfig({ inputFile, outFile }) { return { - input, + input: inputFile, plugins: [ tsPlugin({ exclude: [...testPatterns], compilerOptions: { - sourceMap: false, + sourceMap: true, + inlineSources: true, + removeComments: true, declaration: false, }, }), ], output: { + plugins: [terserPlugin()], format: 'umd', - dir: outDir, file: outFile, + sourcemap: true, generatedCode: 'es2015', }, }; diff --git a/yarn.lock b/yarn.lock index 1807ce04e..6216d8453 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2524,6 +2524,16 @@ __metadata: languageName: node linkType: hard +"@jridgewell/source-map@npm:^0.3.3": + version: 0.3.6 + resolution: "@jridgewell/source-map@npm:0.3.6" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.5" + "@jridgewell/trace-mapping": "npm:^0.3.25" + checksum: 10c0/6a4ecc713ed246ff8e5bdcc1ef7c49aaa93f7463d948ba5054dda18b02dcc6a055e2828c577bcceee058f302ce1fc95595713d44f5c45e43d459f88d267f2f04 + languageName: node + linkType: hard + "@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.4.15": version: 1.4.15 resolution: "@jridgewell/sourcemap-codec@npm:1.4.15" @@ -2630,6 +2640,22 @@ __metadata: languageName: node linkType: hard +"@rollup/plugin-terser@npm:^0.4.4": + version: 0.4.4 + resolution: "@rollup/plugin-terser@npm:0.4.4" + dependencies: + serialize-javascript: "npm:^6.0.1" + smob: "npm:^1.0.0" + terser: "npm:^5.17.4" + peerDependencies: + rollup: ^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + checksum: 10c0/b9cb6c8f02ac1c1344019e9fb854321b74f880efebc41b6bdd84f18331fce0f4a2aadcdb481042245cd3f409b429ac363af71f9efec4a2024731d67d32af36ee + languageName: node + linkType: hard + "@rollup/plugin-typescript@npm:^11.1.6": version: 11.1.6 resolution: "@rollup/plugin-typescript@npm:11.1.6" @@ -3510,6 +3536,15 @@ __metadata: languageName: node linkType: hard +"acorn@npm:^8.8.2": + version: 8.12.1 + resolution: "acorn@npm:8.12.1" + bin: + acorn: bin/acorn + checksum: 10c0/51fb26cd678f914e13287e886da2d7021f8c2bc0ccc95e03d3e0447ee278dd3b40b9c57dc222acd5881adcf26f3edc40901a4953403232129e3876793cd17386 + languageName: node + linkType: hard + "agent-base@npm:^7.0.2, agent-base@npm:^7.1.0, agent-base@npm:^7.1.1": version: 7.1.1 resolution: "agent-base@npm:7.1.1" @@ -4370,6 +4405,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^2.20.0": + version: 2.20.3 + resolution: "commander@npm:2.20.3" + checksum: 10c0/74c781a5248c2402a0a3e966a0a2bba3c054aad144f5c023364be83265e796b20565aa9feff624132ff629aa64e16999fa40a743c10c12f7c61e96a794b99288 + languageName: node + linkType: hard + "commander@npm:^4.0.0": version: 4.1.1 resolution: "commander@npm:4.1.1" @@ -4984,6 +5026,7 @@ __metadata: "@babel/preset-typescript": "npm:^7.24.1" "@changesets/changelog-github": "npm:^0.5.0" "@changesets/cli": "npm:^2.27.1" + "@rollup/plugin-terser": "npm:^0.4.4" "@rollup/plugin-typescript": "npm:^11.1.6" "@types/babel__core": "npm:^7" "@types/babel__preset-env": "npm:^7" @@ -8058,6 +8101,15 @@ __metadata: languageName: node linkType: hard +"randombytes@npm:^2.1.0": + version: 2.1.0 + resolution: "randombytes@npm:2.1.0" + dependencies: + safe-buffer: "npm:^5.1.0" + checksum: 10c0/50395efda7a8c94f5dffab564f9ff89736064d32addf0cc7e8bf5e4166f09f8ded7a0849ca6c2d2a59478f7d90f78f20d8048bca3cdf8be09d8e8a10790388f3 + languageName: node + linkType: hard + "react-is@npm:^18.0.0": version: 18.2.0 resolution: "react-is@npm:18.2.0" @@ -8458,7 +8510,7 @@ __metadata: languageName: node linkType: hard -"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.2": +"safe-buffer@npm:^5.0.1, safe-buffer@npm:^5.1.0, safe-buffer@npm:^5.1.2": version: 5.2.1 resolution: "safe-buffer@npm:5.2.1" checksum: 10c0/6501914237c0a86e9675d4e51d89ca3c21ffd6a31642efeba25ad65720bce6921c9e7e974e5be91a786b25aa058b5303285d3c15dbabf983a919f5f630d349f3 @@ -8537,6 +8589,15 @@ __metadata: languageName: node linkType: hard +"serialize-javascript@npm:^6.0.1": + version: 6.0.2 + resolution: "serialize-javascript@npm:6.0.2" + dependencies: + randombytes: "npm:^2.1.0" + checksum: 10c0/2dd09ef4b65a1289ba24a788b1423a035581bef60817bea1f01eda8e3bda623f86357665fe7ac1b50f6d4f583f97db9615b3f07b2a2e8cbcb75033965f771dd2 + languageName: node + linkType: hard + "set-blocking@npm:^2.0.0": version: 2.0.0 resolution: "set-blocking@npm:2.0.0" @@ -8681,6 +8742,13 @@ __metadata: languageName: node linkType: hard +"smob@npm:^1.0.0": + version: 1.5.0 + resolution: "smob@npm:1.5.0" + checksum: 10c0/a1067f23265812de8357ed27312101af49b89129eb973e3f26ab5856ea774f88cace13342e66e32470f933ccfa916e0e9d0f7ca8bbd4f92dfab2af45c15956c2 + languageName: node + linkType: hard + "socks-proxy-agent@npm:^8.0.3": version: 8.0.3 resolution: "socks-proxy-agent@npm:8.0.3" @@ -8709,6 +8777,16 @@ __metadata: languageName: node linkType: hard +"source-map-support@npm:~0.5.20": + version: 0.5.21 + resolution: "source-map-support@npm:0.5.21" + dependencies: + buffer-from: "npm:^1.0.0" + source-map: "npm:^0.6.0" + checksum: 10c0/9ee09942f415e0f721d6daad3917ec1516af746a8120bba7bb56278707a37f1eb8642bde456e98454b8a885023af81a16e646869975f06afc1a711fb90484e7d + languageName: node + linkType: hard + "source-map@npm:0.8.0-beta.0": version: 0.8.0-beta.0 resolution: "source-map@npm:0.8.0-beta.0" @@ -8718,6 +8796,13 @@ __metadata: languageName: node linkType: hard +"source-map@npm:^0.6.0": + version: 0.6.1 + resolution: "source-map@npm:0.6.1" + checksum: 10c0/ab55398007c5e5532957cb0beee2368529618ac0ab372d789806f5718123cc4367d57de3904b4e6a4170eb5a0b0f41373066d02ca0735a0c4d75c7d328d3e011 + languageName: node + linkType: hard + "spawndamnit@npm:^2.0.0": version: 2.0.0 resolution: "spawndamnit@npm:2.0.0" @@ -9134,6 +9219,20 @@ __metadata: languageName: node linkType: hard +"terser@npm:^5.17.4": + version: 5.31.3 + resolution: "terser@npm:5.31.3" + dependencies: + "@jridgewell/source-map": "npm:^0.3.3" + acorn: "npm:^8.8.2" + commander: "npm:^2.20.0" + source-map-support: "npm:~0.5.20" + bin: + terser: bin/terser + checksum: 10c0/eb2b525dada9febd3db74e94bd295f9cd7abd809e4f9c6bbc795a3048ad50fd327c15eab99db383fa820239680eef6d2dbd7dc05361769c204ddee5cf684d41e + languageName: node + linkType: hard + "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" From 1d992c8bc50fee72b73812636f4617aecb8ed00d Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:19:45 +0200 Subject: [PATCH 04/18] browser umd bundle sourcemap should be published --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index cf502fc54..5ef0d2d04 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ }, "files": [ "dist", + "umd", "*.d.ts" ], "publishConfig": { From 192dde01948fac4b3dc6ad035e89a1b278614c8b Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:29:28 +0200 Subject: [PATCH 05/18] browser bundle is iife, not umd, despite folder name --- rollup.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 01906d0cb..8d07ead18 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -119,7 +119,7 @@ function umdBuildConfig({ inputFile, outFile }) { ], output: { plugins: [terserPlugin()], - format: 'umd', + format: 'iife', file: outFile, sourcemap: true, generatedCode: 'es2015', From 62a5dcb5719aa49fa569e0a7e0799d07c7432d64 Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:41:52 +0200 Subject: [PATCH 06/18] rollup: don't use manualChunks to keep the config a tad simpler --- rollup.config.mjs | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 8d07ead18..efc39d4a6 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -86,10 +86,11 @@ function libBuildOptions({ extension, format, inputFiles, outDir }) { format, dir: outDir, ...fileNames(extension), - // Using preserveModules virtually disables extracting common chunks, - // leading to a result that is a mirror of the TypeScript source. + // Using preserveModules disables bundling and the creation of chunks, + // leading to a result that is a mirror of the input modules. + // Warning: with this option, all modules that might get imported + // need to be present in the input, otherwise imports will be broken! preserveModules: isESM, - manualChunks: isESM ? undefined : manualChunks, sourcemap: true, generatedCode: 'es2015', // Hoisting transitive imports adds bare imports in modules, @@ -172,14 +173,6 @@ function fileNames(extension = 'js') { }; } -/** @type {import('rollup').GetManualChunk} */ -function manualChunks(id) { - const category = id.match(/\/src\/([\w-_]+)\//)?.[1]; - if (category) { - return category; - } -} - /** @type {(dir: string) => void} */ function clearDir(dir) { const dirPath = path.join(import.meta.dirname, dir); From a767272f1d3f9f175ca5189345952a0e0b83c421 Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Mon, 22 Jul 2024 18:48:32 +0200 Subject: [PATCH 07/18] prepack: use rollup instead of tsup --- package.json | 5 +- tsup.config.ts | 20 -- yarn.lock | 589 +++++++------------------------------------------ 3 files changed, 84 insertions(+), 530 deletions(-) delete mode 100644 tsup.config.ts diff --git a/package.json b/package.json index 5ef0d2d04..53175878b 100644 --- a/package.json +++ b/package.json @@ -152,17 +152,16 @@ "eslint-plugin-jsdoc": "^48.5.0", "glob": "^11.0.0", "prettier": "^3.2.5", - "rollup": "^4.18.1", + "rollup": "^4.19.0", "rollup-plugin-dts": "^6.1.1", "tslib": "^2.6.3", - "tsup": "^8.2.0", "typescript": "^5.4.5", "vitest": "^1.5.2" }, "sideEffects": false, "scripts": { "prepack": "yarn build", - "build": "tsup && ./.scripts/postbuild.sh", + "build": "rollup -c rollup.config.mjs && ./.scripts/postbuild.sh", "test": "vitest run --coverage --typecheck", "bench": "vitest bench", "lint": "eslint ./src --ext .ts", diff --git a/tsup.config.ts b/tsup.config.ts deleted file mode 100644 index 68247437b..000000000 --- a/tsup.config.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { defineConfig } from 'tsup'; - -export default [ - defineConfig({ - format: ['cjs', 'esm'], - entry: ['src/*.ts', 'src/*/*.ts', '!**/*.{spec,test,test-d}.*'], - sourcemap: true, - dts: true, - clean: true, - }), - defineConfig({ - format: ['iife'], - outDir: 'umd', - entry: ['src/browser.ts'], - sourcemap: true, - dts: false, - clean: true, - minify: true, - }), -]; diff --git a/yarn.lock b/yarn.lock index 6216d8453..dd2da893e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -226,7 +226,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.24.1, @babel/code-frame@npm:^7.24.2": +"@babel/code-frame@npm:^7.23.5, @babel/code-frame@npm:^7.24.2": version: 7.24.2 resolution: "@babel/code-frame@npm:7.24.2" dependencies: @@ -243,30 +243,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:^7.23.9": - version: 7.24.4 - resolution: "@babel/core@npm:7.24.4" - dependencies: - "@ampproject/remapping": "npm:^2.2.0" - "@babel/code-frame": "npm:^7.24.2" - "@babel/generator": "npm:^7.24.4" - "@babel/helper-compilation-targets": "npm:^7.23.6" - "@babel/helper-module-transforms": "npm:^7.23.3" - "@babel/helpers": "npm:^7.24.4" - "@babel/parser": "npm:^7.24.4" - "@babel/template": "npm:^7.24.0" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - convert-source-map: "npm:^2.0.0" - debug: "npm:^4.1.0" - gensync: "npm:^1.0.0-beta.2" - json5: "npm:^2.2.3" - semver: "npm:^6.3.1" - checksum: 10c0/fc136966583e64d6f84f4a676368de6ab4583aa87f867186068655b30ef67f21f8e65a88c6d446a7efd219ad7ffb9185c82e8a90183ee033f6f47b5026641e16 - languageName: node - linkType: hard - -"@babel/core@npm:^7.24.5": +"@babel/core@npm:^7.23.9, @babel/core@npm:^7.24.5": version: 7.24.5 resolution: "@babel/core@npm:7.24.5" dependencies: @@ -289,18 +266,6 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.24.1, @babel/generator@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/generator@npm:7.24.4" - dependencies: - "@babel/types": "npm:^7.24.0" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^2.5.1" - checksum: 10c0/67a1b2f7cc985aaaa11b01e8ddd4fffa4f285837bc7a209738eb8203aa34bdafeb8507ed75fd883ddbabd641a036ca0a8d984e760f28ad4a9d60bff29d0a60bb - languageName: node - linkType: hard - "@babel/generator@npm:^7.24.5": version: 7.24.5 resolution: "@babel/generator@npm:7.24.5" @@ -598,17 +563,6 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.24.4": - version: 7.24.4 - resolution: "@babel/helpers@npm:7.24.4" - dependencies: - "@babel/template": "npm:^7.24.0" - "@babel/traverse": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - checksum: 10c0/747ef62b7fe87de31a2f3c19ff337a86cbb79be2f6c18af63133b614ab5a8f6da5b06ae4b06fb0e71271cb6a27efec6f8b6c9f44c60b8a18777832dc7929e6c5 - languageName: node - linkType: hard - "@babel/helpers@npm:^7.24.5": version: 7.24.5 resolution: "@babel/helpers@npm:7.24.5" @@ -653,7 +607,7 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.1, @babel/parser@npm:^7.24.4": +"@babel/parser@npm:^7.23.9, @babel/parser@npm:^7.24.0, @babel/parser@npm:^7.24.4": version: 7.24.4 resolution: "@babel/parser@npm:7.24.4" bin: @@ -1688,24 +1642,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.24.1": - version: 7.24.1 - resolution: "@babel/traverse@npm:7.24.1" - dependencies: - "@babel/code-frame": "npm:^7.24.1" - "@babel/generator": "npm:^7.24.1" - "@babel/helper-environment-visitor": "npm:^7.22.20" - "@babel/helper-function-name": "npm:^7.23.0" - "@babel/helper-hoist-variables": "npm:^7.22.5" - "@babel/helper-split-export-declaration": "npm:^7.22.6" - "@babel/parser": "npm:^7.24.1" - "@babel/types": "npm:^7.24.0" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10c0/c087b918f6823776537ba246136c70e7ce0719fc05361ebcbfd16f4e6f2f6f1f8f4f9167f1d9b675f27d12074839605189cc9d689de20b89a85e7c140f23daab - languageName: node - linkType: hard - "@babel/traverse@npm:^7.24.5": version: 7.24.5 resolution: "@babel/traverse@npm:7.24.5" @@ -2499,7 +2435,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.2, @jridgewell/gen-mapping@npm:^0.3.5": +"@jridgewell/gen-mapping@npm:^0.3.5": version: 0.3.5 resolution: "@jridgewell/gen-mapping@npm:0.3.5" dependencies: @@ -2691,114 +2627,114 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.18.1" +"@rollup/rollup-android-arm-eabi@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.19.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-android-arm64@npm:4.18.1" +"@rollup/rollup-android-arm64@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-android-arm64@npm:4.19.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-darwin-arm64@npm:4.18.1" +"@rollup/rollup-darwin-arm64@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.19.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-darwin-x64@npm:4.18.1" +"@rollup/rollup-darwin-x64@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.19.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.18.1" +"@rollup/rollup-linux-arm-gnueabihf@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.19.0" conditions: os=linux & cpu=arm & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm-musleabihf@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.18.1" +"@rollup/rollup-linux-arm-musleabihf@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.19.0" conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.18.1" +"@rollup/rollup-linux-arm64-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.19.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.18.1" +"@rollup/rollup-linux-arm64-musl@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.19.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.18.1" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.19.0" conditions: os=linux & cpu=ppc64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.18.1" +"@rollup/rollup-linux-riscv64-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.19.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-s390x-gnu@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.18.1" +"@rollup/rollup-linux-s390x-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.19.0" conditions: os=linux & cpu=s390x & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.18.1" +"@rollup/rollup-linux-x64-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.19.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.18.1" +"@rollup/rollup-linux-x64-musl@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.19.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.18.1" +"@rollup/rollup-win32-arm64-msvc@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.19.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.18.1" +"@rollup/rollup-win32-ia32-msvc@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.19.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.18.1": - version: 4.18.1 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.18.1" +"@rollup/rollup-win32-x64-msvc@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.19.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -3680,23 +3616,6 @@ __metadata: languageName: node linkType: hard -"any-promise@npm:^1.0.0": - version: 1.3.0 - resolution: "any-promise@npm:1.3.0" - checksum: 10c0/60f0298ed34c74fef50daab88e8dab786036ed5a7fad02e012ab57e376e0a0b4b29e83b95ea9b5e7d89df762f5f25119b83e00706ecaccb22cfbacee98d74889 - languageName: node - linkType: hard - -"anymatch@npm:~3.1.2": - version: 3.1.3 - resolution: "anymatch@npm:3.1.3" - dependencies: - normalize-path: "npm:^3.0.0" - picomatch: "npm:^2.0.4" - checksum: 10c0/57b06ae984bc32a0d22592c87384cd88fe4511b1dd7581497831c56d41939c8a001b28e7b853e1450f2bf61992dfcaa8ae2d0d161a0a90c4fb631ef07098fbac - languageName: node - linkType: hard - "are-docs-informative@npm:^0.0.2": version: 0.0.2 resolution: "are-docs-informative@npm:0.0.2" @@ -3929,13 +3848,6 @@ __metadata: languageName: node linkType: hard -"binary-extensions@npm:^2.0.0": - version: 2.3.0 - resolution: "binary-extensions@npm:2.3.0" - checksum: 10c0/75a59cafc10fb12a11d510e77110c6c7ae3f4ca22463d52487709ca7f18f69d886aa387557cc9864fbdb10153d0bdb4caacabf11541f55e89ed6e18d12ece2b5 - languageName: node - linkType: hard - "bluebird@npm:^2.3.5, bluebird@npm:^2.6.2, bluebird@npm:^2.8.1, bluebird@npm:^2.8.2": version: 2.11.0 resolution: "bluebird@npm:2.11.0" @@ -3971,7 +3883,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.3, braces@npm:~3.0.2": +"braces@npm:^3.0.3": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -4043,17 +3955,6 @@ __metadata: languageName: node linkType: hard -"bundle-require@npm:^5.0.0": - version: 5.0.0 - resolution: "bundle-require@npm:5.0.0" - dependencies: - load-tsconfig: "npm:^0.2.3" - peerDependencies: - esbuild: ">=0.18" - checksum: 10c0/92c46df02586e0ebd66ee4831c9b5775adb3c32a43fe2b2aaf7bc675135c141f751de6a9a26b146d64c607c5b40f9eef5f10dce3c364f602d4bed268444c32c6 - languageName: node - linkType: hard - "cac@npm:^6.7.14": version: 6.7.14 resolution: "cac@npm:6.7.14" @@ -4268,25 +4169,6 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.6.0": - version: 3.6.0 - resolution: "chokidar@npm:3.6.0" - dependencies: - anymatch: "npm:~3.1.2" - braces: "npm:~3.0.2" - fsevents: "npm:~2.3.2" - glob-parent: "npm:~5.1.2" - is-binary-path: "npm:~2.1.0" - is-glob: "npm:~4.0.1" - normalize-path: "npm:~3.0.0" - readdirp: "npm:~3.6.0" - dependenciesMeta: - fsevents: - optional: true - checksum: 10c0/8361dcd013f2ddbe260eacb1f3cb2f2c6f2b0ad118708a343a5ed8158941a39cb8fb1d272e0f389712e74ee90ce8ba864eece9e0e62b9705cb468a2f6d917462 - languageName: node - linkType: hard - "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -4412,13 +4294,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^4.0.0": - version: 4.1.1 - resolution: "commander@npm:4.1.1" - checksum: 10c0/84a76c08fe6cc08c9c93f62ac573d2907d8e79138999312c92d4155bc2325d487d64d13f669b2000c9f8caf70493c1be2dac74fec3c51d5a04f8bc3ae1830bab - languageName: node - linkType: hard - "comment-parser@npm:1.4.1": version: 1.4.1 resolution: "comment-parser@npm:1.4.1" @@ -4459,13 +4334,6 @@ __metadata: languageName: node linkType: hard -"consola@npm:^3.2.3": - version: 3.2.3 - resolution: "consola@npm:3.2.3" - checksum: 10c0/c606220524ec88a05bb1baf557e9e0e04a0c08a9c35d7a08652d99de195c4ddcb6572040a7df57a18ff38bbc13ce9880ad032d56630cef27bef72768ef0ac078 - languageName: node - linkType: hard - "convert-source-map@npm:^2.0.0": version: 2.0.0 resolution: "convert-source-map@npm:2.0.0" @@ -5041,16 +4909,15 @@ __metadata: eslint-plugin-jsdoc: "npm:^48.5.0" glob: "npm:^11.0.0" prettier: "npm:^3.2.5" - rollup: "npm:^4.18.1" + rollup: "npm:^4.19.0" rollup-plugin-dts: "npm:^6.1.1" tslib: "npm:^2.6.3" - tsup: "npm:^8.2.0" typescript: "npm:^5.4.5" vitest: "npm:^1.5.2" languageName: unknown linkType: soft -"esbuild@npm:0.23.0, esbuild@npm:^0.23.0": +"esbuild@npm:0.23.0": version: 0.23.0 resolution: "esbuild@npm:0.23.0" dependencies: @@ -5399,23 +5266,6 @@ __metadata: languageName: node linkType: hard -"execa@npm:^5.1.1": - version: 5.1.1 - resolution: "execa@npm:5.1.1" - dependencies: - cross-spawn: "npm:^7.0.3" - get-stream: "npm:^6.0.0" - human-signals: "npm:^2.1.0" - is-stream: "npm:^2.0.0" - merge-stream: "npm:^2.0.0" - npm-run-path: "npm:^4.0.1" - onetime: "npm:^5.1.2" - signal-exit: "npm:^3.0.3" - strip-final-newline: "npm:^2.0.0" - checksum: 10c0/c8e615235e8de4c5addf2fa4c3da3e3aa59ce975a3e83533b4f6a71750fb816a2e79610dc5f1799b6e28976c9ae86747a36a606655bf8cb414a74d8d507b304f - languageName: node - linkType: hard - "execa@npm:^8.0.1": version: 8.0.1 resolution: "execa@npm:8.0.1" @@ -5796,13 +5646,6 @@ __metadata: languageName: node linkType: hard -"get-stream@npm:^6.0.0": - version: 6.0.1 - resolution: "get-stream@npm:6.0.1" - checksum: 10c0/49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 - languageName: node - linkType: hard - "get-stream@npm:^8.0.1": version: 8.0.1 resolution: "get-stream@npm:8.0.1" @@ -5830,7 +5673,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": +"glob-parent@npm:^5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -6142,13 +5985,6 @@ __metadata: languageName: node linkType: hard -"human-signals@npm:^2.1.0": - version: 2.1.0 - resolution: "human-signals@npm:2.1.0" - checksum: 10c0/695edb3edfcfe9c8b52a76926cd31b36978782062c0ed9b1192b36bebc75c4c87c82e178dfcb0ed0fc27ca59d434198aac0bd0be18f5781ded775604db22304a - languageName: node - linkType: hard - "human-signals@npm:^5.0.0": version: 5.0.0 resolution: "human-signals@npm:5.0.0" @@ -6276,15 +6112,6 @@ __metadata: languageName: node linkType: hard -"is-binary-path@npm:~2.1.0": - version: 2.1.0 - resolution: "is-binary-path@npm:2.1.0" - dependencies: - binary-extensions: "npm:^2.0.0" - checksum: 10c0/a16eaee59ae2b315ba36fad5c5dcaf8e49c3e27318f8ab8fa3cdb8772bf559c8d1ba750a589c2ccb096113bb64497084361a25960899cb6172a6925ab6123d38 - languageName: node - linkType: hard - "is-boolean-object@npm:^1.1.0": version: 1.1.2 resolution: "is-boolean-object@npm:1.1.2" @@ -6350,7 +6177,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -6436,13 +6263,6 @@ __metadata: languageName: node linkType: hard -"is-stream@npm:^2.0.0": - version: 2.0.1 - resolution: "is-stream@npm:2.0.1" - checksum: 10c0/7c284241313fc6efc329b8d7f08e16c0efeb6baab1b4cd0ba579eb78e5af1aa5da11e68559896a2067cd6c526bd29241dda4eb1225e627d5aa1a89a76d4635a5 - languageName: node - linkType: hard - "is-stream@npm:^3.0.0": version: 3.0.0 resolution: "is-stream@npm:3.0.0" @@ -6636,13 +6456,6 @@ __metadata: languageName: node linkType: hard -"joycon@npm:^3.1.1": - version: 3.1.1 - resolution: "joycon@npm:3.1.1" - checksum: 10c0/131fb1e98c9065d067fd49b6e685487ac4ad4d254191d7aa2c9e3b90f4e9ca70430c43cad001602bdbdabcf58717d3b5c5b7461c1bd8e39478c8de706b3fe6ae - languageName: node - linkType: hard - "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -6827,13 +6640,6 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^3.1.1": - version: 3.1.2 - resolution: "lilconfig@npm:3.1.2" - checksum: 10c0/f059630b1a9bddaeba83059db00c672b64dc14074e9f232adce32b38ca1b5686ab737eb665c5ba3c32f147f0002b4bee7311ad0386a9b98547b5623e87071fbe - languageName: node - linkType: hard - "limited-request-queue@npm:^2.0.0": version: 2.0.0 resolution: "limited-request-queue@npm:2.0.0" @@ -6858,13 +6664,6 @@ __metadata: languageName: node linkType: hard -"load-tsconfig@npm:^0.2.3": - version: 0.2.5 - resolution: "load-tsconfig@npm:0.2.5" - checksum: 10c0/bf2823dd26389d3497b6567f07435c5a7a58d9df82e879b0b3892f87d8db26900f84c85bc329ef41c0540c0d6a448d1c23ddc64a80f3ff6838b940f3915a3fcb - languageName: node - linkType: hard - "load-yaml-file@npm:^0.2.0": version: 0.2.0 resolution: "load-yaml-file@npm:0.2.0" @@ -6933,13 +6732,6 @@ __metadata: languageName: node linkType: hard -"lodash.sortby@npm:^4.7.0": - version: 4.7.0 - resolution: "lodash.sortby@npm:4.7.0" - checksum: 10c0/fc48fb54ff7669f33bb32997cab9460757ee99fafaf72400b261c3e10fde21538e47d8cfcbe6a25a31bcb5b7b727c27d52626386fc2de24eb059a6d64a89cdf5 - languageName: node - linkType: hard - "lodash.startcase@npm:^4.4.0": version: 4.4.0 resolution: "lodash.startcase@npm:4.4.0" @@ -7168,13 +6960,6 @@ __metadata: languageName: node linkType: hard -"mimic-fn@npm:^2.1.0": - version: 2.1.0 - resolution: "mimic-fn@npm:2.1.0" - checksum: 10c0/b26f5479d7ec6cc2bce275a08f146cf78f5e7b661b18114e2506dd91ec7ec47e7a25bf4360e5438094db0560bcc868079fb3b1fb3892b833c1ecbf63f80c95a4 - languageName: node - linkType: hard - "mimic-fn@npm:^4.0.0": version: 4.0.0 resolution: "mimic-fn@npm:4.0.0" @@ -7381,17 +7166,6 @@ __metadata: languageName: node linkType: hard -"mz@npm:^2.7.0": - version: 2.7.0 - resolution: "mz@npm:2.7.0" - dependencies: - any-promise: "npm:^1.0.0" - object-assign: "npm:^4.0.1" - thenify-all: "npm:^1.0.0" - checksum: 10c0/103114e93f87362f0b56ab5b2e7245051ad0276b646e3902c98397d18bb8f4a77f2ea4a2c9d3ad516034ea3a56553b60d3f5f78220001ca4c404bd711bd0af39 - languageName: node - linkType: hard - "nanoid@npm:^3.3.7": version: 3.3.7 resolution: "nanoid@npm:3.3.7" @@ -7506,22 +7280,6 @@ __metadata: languageName: node linkType: hard -"normalize-path@npm:^3.0.0, normalize-path@npm:~3.0.0": - version: 3.0.0 - resolution: "normalize-path@npm:3.0.0" - checksum: 10c0/e008c8142bcc335b5e38cf0d63cfd39d6cf2d97480af9abdbe9a439221fd4d749763bab492a8ee708ce7a194bb00c9da6d0a115018672310850489137b3da046 - languageName: node - linkType: hard - -"npm-run-path@npm:^4.0.1": - version: 4.0.1 - resolution: "npm-run-path@npm:4.0.1" - dependencies: - path-key: "npm:^3.0.0" - checksum: 10c0/6f9353a95288f8455cf64cbeb707b28826a7f29690244c1e4bb61ec573256e021b6ad6651b394eb1ccfd00d6ec50147253aba2c5fe58a57ceb111fad62c519ac - languageName: node - linkType: hard - "npm-run-path@npm:^5.1.0": version: 5.3.0 resolution: "npm-run-path@npm:5.3.0" @@ -7545,7 +7303,7 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.0.1, object-assign@npm:^4.1.1": +"object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: 10c0/1f4df9945120325d041ccf7b86f31e8bcc14e73d29171e37a7903050e96b81323784ec59f93f102ec635bcf6fa8034ba3ea0a8c7e69fa202b87ae3b6cec5a414 @@ -7587,15 +7345,6 @@ __metadata: languageName: node linkType: hard -"onetime@npm:^5.1.2": - version: 5.1.2 - resolution: "onetime@npm:5.1.2" - dependencies: - mimic-fn: "npm:^2.1.0" - checksum: 10c0/ffcef6fbb2692c3c40749f31ea2e22677a876daea92959b8a80b521d95cca7a668c884d8b2045d1d8ee7d56796aa405c405462af112a1477594cc63531baeb8f - languageName: node - linkType: hard - "onetime@npm:^6.0.0": version: 6.0.0 resolution: "onetime@npm:6.0.0" @@ -7801,7 +7550,7 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^3.0.0, path-key@npm:^3.1.0": +"path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" checksum: 10c0/748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c @@ -7891,7 +7640,7 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": +"picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be @@ -7905,13 +7654,6 @@ __metadata: languageName: node linkType: hard -"pirates@npm:^4.0.1": - version: 4.0.6 - resolution: "pirates@npm:4.0.6" - checksum: 10c0/00d5fa51f8dded94d7429700fb91a0c1ead00ae2c7fd27089f0c5b63e6eca36197fe46384631872690a66f390c5e27198e99006ab77ae472692ab9c2ca903f36 - languageName: node - linkType: hard - "pkg-dir@npm:^4.2.0": version: 4.2.0 resolution: "pkg-dir@npm:4.2.0" @@ -7939,29 +7681,6 @@ __metadata: languageName: node linkType: hard -"postcss-load-config@npm:^6.0.1": - version: 6.0.1 - resolution: "postcss-load-config@npm:6.0.1" - dependencies: - lilconfig: "npm:^3.1.1" - peerDependencies: - jiti: ">=1.21.0" - postcss: ">=8.0.9" - tsx: ^4.8.1 - yaml: ^2.4.2 - peerDependenciesMeta: - jiti: - optional: true - postcss: - optional: true - tsx: - optional: true - yaml: - optional: true - checksum: 10c0/74173a58816dac84e44853f7afbd283f4ef13ca0b6baeba27701214beec33f9e309b128f8102e2b173e8d45ecba45d279a9be94b46bf48d219626aa9b5730848 - languageName: node - linkType: hard - "postcss@npm:^8.4.38": version: 8.4.38 resolution: "postcss@npm:8.4.38" @@ -8179,15 +7898,6 @@ __metadata: languageName: node linkType: hard -"readdirp@npm:~3.6.0": - version: 3.6.0 - resolution: "readdirp@npm:3.6.0" - dependencies: - picomatch: "npm:^2.2.1" - checksum: 10c0/6fa848cf63d1b82ab4e985f4cf72bd55b7dcfd8e0a376905804e48c3634b7e749170940ba77b32804d5fe93b3cc521aa95a8d7e7d725f830da6d93f3669ce66b - languageName: node - linkType: hard - "redent@npm:^3.0.0": version: 3.0.0 resolution: "redent@npm:3.0.0" @@ -8426,26 +8136,26 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.13.0, rollup@npm:^4.18.1": - version: 4.18.1 - resolution: "rollup@npm:4.18.1" - dependencies: - "@rollup/rollup-android-arm-eabi": "npm:4.18.1" - "@rollup/rollup-android-arm64": "npm:4.18.1" - "@rollup/rollup-darwin-arm64": "npm:4.18.1" - "@rollup/rollup-darwin-x64": "npm:4.18.1" - "@rollup/rollup-linux-arm-gnueabihf": "npm:4.18.1" - "@rollup/rollup-linux-arm-musleabihf": "npm:4.18.1" - "@rollup/rollup-linux-arm64-gnu": "npm:4.18.1" - "@rollup/rollup-linux-arm64-musl": "npm:4.18.1" - "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.18.1" - "@rollup/rollup-linux-riscv64-gnu": "npm:4.18.1" - "@rollup/rollup-linux-s390x-gnu": "npm:4.18.1" - "@rollup/rollup-linux-x64-gnu": "npm:4.18.1" - "@rollup/rollup-linux-x64-musl": "npm:4.18.1" - "@rollup/rollup-win32-arm64-msvc": "npm:4.18.1" - "@rollup/rollup-win32-ia32-msvc": "npm:4.18.1" - "@rollup/rollup-win32-x64-msvc": "npm:4.18.1" +"rollup@npm:^4.13.0, rollup@npm:^4.19.0": + version: 4.19.0 + resolution: "rollup@npm:4.19.0" + dependencies: + "@rollup/rollup-android-arm-eabi": "npm:4.19.0" + "@rollup/rollup-android-arm64": "npm:4.19.0" + "@rollup/rollup-darwin-arm64": "npm:4.19.0" + "@rollup/rollup-darwin-x64": "npm:4.19.0" + "@rollup/rollup-linux-arm-gnueabihf": "npm:4.19.0" + "@rollup/rollup-linux-arm-musleabihf": "npm:4.19.0" + "@rollup/rollup-linux-arm64-gnu": "npm:4.19.0" + "@rollup/rollup-linux-arm64-musl": "npm:4.19.0" + "@rollup/rollup-linux-powerpc64le-gnu": "npm:4.19.0" + "@rollup/rollup-linux-riscv64-gnu": "npm:4.19.0" + "@rollup/rollup-linux-s390x-gnu": "npm:4.19.0" + "@rollup/rollup-linux-x64-gnu": "npm:4.19.0" + "@rollup/rollup-linux-x64-musl": "npm:4.19.0" + "@rollup/rollup-win32-arm64-msvc": "npm:4.19.0" + "@rollup/rollup-win32-ia32-msvc": "npm:4.19.0" + "@rollup/rollup-win32-x64-msvc": "npm:4.19.0" "@types/estree": "npm:1.0.5" fsevents: "npm:~2.3.2" dependenciesMeta: @@ -8485,7 +8195,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: 10c0/c3c73252fd9f1d39eaeb44aa860141d9daf10d6eada73791a0ef453d38fe8f2c2dfef103ac1f387ed192dd5a2994534f91c026eed9ba1cfb50f5781f48c1f44f + checksum: 10c0/1c656853895f6c7d55492db4661c79d37a3046cff465f4924ac5f053b0f80a079e36f901b154dbe819d9e94dcd83e90e51c7f95e7158bef1a07ceb60df736285 languageName: node linkType: hard @@ -8691,7 +8401,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3": +"signal-exit@npm:^3.0.2": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 @@ -8787,15 +8497,6 @@ __metadata: languageName: node linkType: hard -"source-map@npm:0.8.0-beta.0": - version: 0.8.0-beta.0 - resolution: "source-map@npm:0.8.0-beta.0" - dependencies: - whatwg-url: "npm:^7.0.0" - checksum: 10c0/fb4d9bde9a9fdb2c29b10e5eae6c71d10e09ef467e1afb75fdec2eb7e11fa5b343a2af553f74f18b695dbc0b81f9da2e9fa3d7a317d5985e9939499ec6087835 - languageName: node - linkType: hard - "source-map@npm:^0.6.0": version: 0.6.1 resolution: "source-map@npm:0.6.1" @@ -9083,13 +8784,6 @@ __metadata: languageName: node linkType: hard -"strip-final-newline@npm:^2.0.0": - version: 2.0.0 - resolution: "strip-final-newline@npm:2.0.0" - checksum: 10c0/bddf8ccd47acd85c0e09ad7375409d81653f645fda13227a9d459642277c253d877b68f2e5e4d819fe75733b0e626bac7e954c04f3236f6d196f79c94fa4a96f - languageName: node - linkType: hard - "strip-final-newline@npm:^3.0.0": version: 3.0.0 resolution: "strip-final-newline@npm:3.0.0" @@ -9122,24 +8816,6 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.35.0": - version: 3.35.0 - resolution: "sucrase@npm:3.35.0" - dependencies: - "@jridgewell/gen-mapping": "npm:^0.3.2" - commander: "npm:^4.0.0" - glob: "npm:^10.3.10" - lines-and-columns: "npm:^1.1.6" - mz: "npm:^2.7.0" - pirates: "npm:^4.0.1" - ts-interface-checker: "npm:^0.1.9" - bin: - sucrase: bin/sucrase - sucrase-node: bin/sucrase-node - checksum: 10c0/ac85f3359d2c2ecbf5febca6a24ae9bf96c931f05fde533c22a94f59c6a74895e5d5f0e871878dfd59c2697a75ebb04e4b2224ef0bfc24ca1210735c2ec191ef - languageName: node - linkType: hard - "supports-color@npm:^0.2.0": version: 0.2.0 resolution: "supports-color@npm:0.2.0" @@ -9251,24 +8927,6 @@ __metadata: languageName: node linkType: hard -"thenify-all@npm:^1.0.0": - version: 1.6.0 - resolution: "thenify-all@npm:1.6.0" - dependencies: - thenify: "npm:>= 3.1.0 < 4" - checksum: 10c0/9b896a22735e8122754fe70f1d65f7ee691c1d70b1f116fda04fea103d0f9b356e3676cb789506e3909ae0486a79a476e4914b0f92472c2e093d206aed4b7d6b - languageName: node - linkType: hard - -"thenify@npm:>= 3.1.0 < 4": - version: 3.3.1 - resolution: "thenify@npm:3.3.1" - dependencies: - any-promise: "npm:^1.0.0" - checksum: 10c0/f375aeb2b05c100a456a30bc3ed07ef03a39cbdefe02e0403fb714b8c7e57eeaad1a2f5c4ecfb9ce554ce3db9c2b024eba144843cd9e344566d9fcee73b04767 - languageName: node - linkType: hard - "through2-sink@npm:^1.0.0": version: 1.0.0 resolution: "through2-sink@npm:1.0.0" @@ -9383,15 +9041,6 @@ __metadata: languageName: node linkType: hard -"tr46@npm:^1.0.1": - version: 1.0.1 - resolution: "tr46@npm:1.0.1" - dependencies: - punycode: "npm:^2.1.0" - checksum: 10c0/41525c2ccce86e3ef30af6fa5e1464e6d8bb4286a58ea8db09228f598889581ef62347153f6636cd41553dc41685bdfad0a9d032ef58df9fbb0792b3447d0f04 - languageName: node - linkType: hard - "tr46@npm:~0.0.3": version: 0.0.3 resolution: "tr46@npm:0.0.3" @@ -9399,15 +9048,6 @@ __metadata: languageName: node linkType: hard -"tree-kill@npm:^1.2.2": - version: 1.2.2 - resolution: "tree-kill@npm:1.2.2" - bin: - tree-kill: cli.js - checksum: 10c0/7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2 - languageName: node - linkType: hard - "trim-newlines@npm:^3.0.0": version: 3.0.1 resolution: "trim-newlines@npm:3.0.1" @@ -9424,13 +9064,6 @@ __metadata: languageName: node linkType: hard -"ts-interface-checker@npm:^0.1.9": - version: 0.1.13 - resolution: "ts-interface-checker@npm:0.1.13" - checksum: 10c0/232509f1b84192d07b81d1e9b9677088e590ac1303436da1e92b296e9be8e31ea042e3e1fd3d29b1742ad2c959e95afe30f63117b8f1bc3a3850070a5142fea7 - languageName: node - linkType: hard - "tslib@npm:^2.6.2, tslib@npm:^2.6.3": version: 2.6.3 resolution: "tslib@npm:2.6.3" @@ -9438,46 +9071,6 @@ __metadata: languageName: node linkType: hard -"tsup@npm:^8.2.0": - version: 8.2.0 - resolution: "tsup@npm:8.2.0" - dependencies: - bundle-require: "npm:^5.0.0" - cac: "npm:^6.7.14" - chokidar: "npm:^3.6.0" - consola: "npm:^3.2.3" - debug: "npm:^4.3.5" - esbuild: "npm:^0.23.0" - execa: "npm:^5.1.1" - globby: "npm:^11.1.0" - joycon: "npm:^3.1.1" - postcss-load-config: "npm:^6.0.1" - resolve-from: "npm:^5.0.0" - rollup: "npm:^4.18.1" - source-map: "npm:0.8.0-beta.0" - sucrase: "npm:^3.35.0" - tree-kill: "npm:^1.2.2" - peerDependencies: - "@microsoft/api-extractor": ^7.36.0 - "@swc/core": ^1 - postcss: ^8.4.12 - typescript: ">=4.5.0" - peerDependenciesMeta: - "@microsoft/api-extractor": - optional: true - "@swc/core": - optional: true - postcss: - optional: true - typescript: - optional: true - bin: - tsup: dist/cli-default.js - tsup-node: dist/cli-node.js - checksum: 10c0/79e46604e64118c223a8898a37ed96a11a9d8f89f5eb527b10addf734000fa3b7cea6ff50cb256fc7057a689ce2d6cb9ccd5b2063ee80643673f20bf532c70d5 - languageName: node - linkType: hard - "tty-table@npm:^4.1.5": version: 4.2.3 resolution: "tty-table@npm:4.2.3" @@ -10106,13 +9699,6 @@ __metadata: languageName: node linkType: hard -"webidl-conversions@npm:^4.0.2": - version: 4.0.2 - resolution: "webidl-conversions@npm:4.0.2" - checksum: 10c0/def5c5ac3479286dffcb604547628b2e6b46c5c5b8a8cfaa8c71dc3bafc85859bde5fbe89467ff861f571ab38987cf6ab3d6e7c80b39b999e50e803c12f3164f - languageName: node - linkType: hard - "whatwg-url@npm:^5.0.0": version: 5.0.0 resolution: "whatwg-url@npm:5.0.0" @@ -10123,17 +9709,6 @@ __metadata: languageName: node linkType: hard -"whatwg-url@npm:^7.0.0": - version: 7.1.0 - resolution: "whatwg-url@npm:7.1.0" - dependencies: - lodash.sortby: "npm:^4.7.0" - tr46: "npm:^1.0.1" - webidl-conversions: "npm:^4.0.2" - checksum: 10c0/2785fe4647690e5a0225a79509ba5e21fdf4a71f9de3eabdba1192483fe006fc79961198e0b99f82751557309f17fc5a07d4d83c251aa5b2f85ba71e674cbee9 - languageName: node - linkType: hard - "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2" From 6cebc31b3ff4b1e32afc4d54ea920515073fae99 Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:21:05 +0200 Subject: [PATCH 08/18] remove browser entrypoint from dist --- rollup.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index efc39d4a6..55c71cc59 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -50,7 +50,7 @@ function findLibFiles() { const allFiles = globSync('./src/**/*.ts', { cwd: import.meta.dirname, - ignore: [...testPatterns], + ignore: [...testPatterns, '**/src/browser.ts'], }); return { From 529ad55239d3fc641fde223970272d3eaeec0b6d Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Tue, 23 Jul 2024 10:37:44 +0200 Subject: [PATCH 09/18] remove comments in .js and .mjs outputs --- rollup.config.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/rollup.config.mjs b/rollup.config.mjs index 55c71cc59..9cdf3f9e1 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -79,6 +79,7 @@ function libBuildOptions({ extension, format, inputFiles, outDir }) { sourceMap: true, inlineSources: true, declaration: false, + removeComments: true, }, }), ], From 9e7ecfbb9889cfde62626a5c2913748272db093b Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:14:35 +0200 Subject: [PATCH 10/18] remove src/browser.ts, use equivalent Rollup config --- rollup.config.mjs | 22 +++++++++++++++------- src/browser.ts | 8 -------- vitest.config.mts | 1 - 3 files changed, 15 insertions(+), 16 deletions(-) delete mode 100644 src/browser.ts diff --git a/rollup.config.mjs b/rollup.config.mjs index 9cdf3f9e1..3a7c99788 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -8,6 +8,14 @@ import terserPlugin from '@rollup/plugin-terser'; import tsPlugin from '@rollup/plugin-typescript'; import dtsPlugin from 'rollup-plugin-dts'; +/** + * @type {{ + * exports: Record; + * publishConfig: { browser: string }; + * }} + */ +const packageJson = createRequire(import.meta.url)('./package.json'); + const testPatterns = ['**/*.bench.ts', '**/*.spec.ts', '**/*.test.ts']; export default () => { @@ -37,20 +45,19 @@ export default () => { outDir: 'dist', }), umdBuildConfig({ - inputFile: './src/browser.ts', - outFile: 'umd/browser.global.js', + inputFile: './src/compat/index.ts', + outFile: packageJson.publishConfig.browser, + name: '_', }), ]; }; function findLibFiles() { - /** @type {{ exports: Record}} */ - const packageJson = createRequire(import.meta.url)('./package.json'); const entrypoints = Object.values(packageJson.exports).filter(f => /^(\.\/)?src\//.test(f) && f.endsWith('.ts')); const allFiles = globSync('./src/**/*.ts', { cwd: import.meta.dirname, - ignore: [...testPatterns, '**/src/browser.ts'], + ignore: [...testPatterns], }); return { @@ -103,9 +110,9 @@ function libBuildOptions({ extension, format, inputFiles, outDir }) { } /** - * @type {(options: {inputFile: string; outFile: string}) => import('rollup').RollupOptions} + * @type {(options: {inputFile: string; outFile: string; name: string}) => import('rollup').RollupOptions} */ -function umdBuildConfig({ inputFile, outFile }) { +function umdBuildConfig({ inputFile, outFile, name }) { return { input: inputFile, plugins: [ @@ -122,6 +129,7 @@ function umdBuildConfig({ inputFile, outFile }) { output: { plugins: [terserPlugin()], format: 'iife', + name, file: outFile, sourcemap: true, generatedCode: 'es2015', diff --git a/src/browser.ts b/src/browser.ts deleted file mode 100644 index bbe8a9114..000000000 --- a/src/browser.ts +++ /dev/null @@ -1,8 +0,0 @@ -import * as toolkit from './compat/index.ts'; - -interface Window { - _: typeof toolkit; -} - -declare let window: Window; -window._ = toolkit; diff --git a/vitest.config.mts b/vitest.config.mts index 4972917e5..fbf3b4f15 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -8,7 +8,6 @@ export default defineConfig({ coverage: { provider: 'istanbul', include: ['src/**/*'], - exclude: ['src/browser.ts'], }, }, }); From 3fea9d3ac2c58fc1bb8e8e67f7d9b835daeb8a4f Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:18:20 +0200 Subject: [PATCH 11/18] Restore original .npmignore --- .npmignore | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.npmignore b/.npmignore index cae9888bd..56976b9a7 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1 @@ -.nvmrc -dist/**/_internal/*.d.ts +.nvmrc \ No newline at end of file From 2e36b069b8251b06ca58a05ba8bc3a31313c02d8 Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Tue, 23 Jul 2024 12:23:29 +0200 Subject: [PATCH 12/18] rollup config: rename umdBuildConfig to browserBuildConfig --- rollup.config.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 3a7c99788..1addef5ae 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -44,7 +44,7 @@ export default () => { inputFiles: files.entrypoints, outDir: 'dist', }), - umdBuildConfig({ + browserBuildConfig({ inputFile: './src/compat/index.ts', outFile: packageJson.publishConfig.browser, name: '_', @@ -112,7 +112,7 @@ function libBuildOptions({ extension, format, inputFiles, outDir }) { /** * @type {(options: {inputFile: string; outFile: string; name: string}) => import('rollup').RollupOptions} */ -function umdBuildConfig({ inputFile, outFile, name }) { +function browserBuildConfig({ inputFile, outFile, name }) { return { input: inputFile, plugins: [ From 62ea66fd5b32b475a38c39350bd1ee370dcde163 Mon Sep 17 00:00:00 2001 From: Florens Verschelde <243601+fvsch@users.noreply.github.com> Date: Tue, 23 Jul 2024 14:19:33 +0200 Subject: [PATCH 13/18] rollup: use package.json#exports for esm entrypoints --- package.json | 1 - rollup.config.mjs | 42 ++++++++-------------------- yarn.lock | 70 ----------------------------------------------- 3 files changed, 11 insertions(+), 102 deletions(-) diff --git a/package.json b/package.json index 53175878b..1f6e7de5b 100644 --- a/package.json +++ b/package.json @@ -150,7 +150,6 @@ "eslint": "^8.56.0", "eslint-config-prettier": "^8.5.0", "eslint-plugin-jsdoc": "^48.5.0", - "glob": "^11.0.0", "prettier": "^3.2.5", "rollup": "^4.19.0", "rollup-plugin-dts": "^6.1.1", diff --git a/rollup.config.mjs b/rollup.config.mjs index 1addef5ae..4f6e05e1d 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -3,7 +3,6 @@ import fs from 'node:fs'; import { createRequire } from 'node:module'; import path from 'node:path'; -import { globSync } from 'glob'; import terserPlugin from '@rollup/plugin-terser'; import tsPlugin from '@rollup/plugin-typescript'; import dtsPlugin from 'rollup-plugin-dts'; @@ -22,26 +21,23 @@ export default () => { clearDir('dist'); clearDir('umd'); - const files = findLibFiles(); + const entrypoints = Object.values(packageJson.exports).filter(f => /^(\.\/)?src\//.test(f) && f.endsWith('.ts')); return [ libBuildOptions({ format: 'esm', extension: 'mjs', - inputFiles: files.allFiles, + entrypoints, outDir: 'dist', }), libBuildOptions({ format: 'cjs', extension: 'js', - // For CJS, only treat the package.json#exports paths as entrypoints, - // resulting in one bundle per category (array, object, etc.), - // plus one index requiring those bundles. - inputFiles: files.entrypoints, + entrypoints, outDir: 'dist', }), declarationOptions({ - inputFiles: files.entrypoints, + entrypoints, outDir: 'dist', }), browserBuildConfig({ @@ -52,33 +48,19 @@ export default () => { ]; }; -function findLibFiles() { - const entrypoints = Object.values(packageJson.exports).filter(f => /^(\.\/)?src\//.test(f) && f.endsWith('.ts')); - - const allFiles = globSync('./src/**/*.ts', { - cwd: import.meta.dirname, - ignore: [...testPatterns], - }); - - return { - entrypoints, - allFiles, - }; -} - /** * @type {(options: { + * entrypoints: string[]; * format: 'esm' | 'cjs'; * extension: 'js' | 'cjs' | 'mjs'; - * inputFiles: string[]; * outDir: string; * }) => import('rollup').RollupOptions} */ -function libBuildOptions({ extension, format, inputFiles, outDir }) { +function libBuildOptions({ entrypoints, extension, format, outDir }) { const isESM = format === 'esm'; return { - input: mapInputs(inputFiles), + input: mapInputs(entrypoints), plugins: [ tsPlugin({ exclude: [...testPatterns], @@ -95,9 +77,7 @@ function libBuildOptions({ extension, format, inputFiles, outDir }) { dir: outDir, ...fileNames(extension), // Using preserveModules disables bundling and the creation of chunks, - // leading to a result that is a mirror of the input modules. - // Warning: with this option, all modules that might get imported - // need to be present in the input, otherwise imports will be broken! + // leading to a result that is a mirror of the input module graph. preserveModules: isESM, sourcemap: true, generatedCode: 'es2015', @@ -138,12 +118,12 @@ function browserBuildConfig({ inputFile, outFile, name }) { } /** - * @type {(options: {inputFiles: string[]; outDir: string}) => import('rollup').RollupOptions} + * @type {(options: {entrypoints: string[]; outDir: string}) => import('rollup').RollupOptions} */ -function declarationOptions({ inputFiles, outDir }) { +function declarationOptions({ entrypoints, outDir }) { return { plugins: [dtsPlugin()], - input: mapInputs(inputFiles), + input: mapInputs(entrypoints), output: [ { format: 'esm', diff --git a/yarn.lock b/yarn.lock index dd2da893e..e27715551 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4907,7 +4907,6 @@ __metadata: eslint: "npm:^8.56.0" eslint-config-prettier: "npm:^8.5.0" eslint-plugin-jsdoc: "npm:^48.5.0" - glob: "npm:^11.0.0" prettier: "npm:^3.2.5" rollup: "npm:^4.19.0" rollup-plugin-dts: "npm:^6.1.1" @@ -5706,22 +5705,6 @@ __metadata: languageName: node linkType: hard -"glob@npm:^11.0.0": - version: 11.0.0 - resolution: "glob@npm:11.0.0" - dependencies: - foreground-child: "npm:^3.1.0" - jackspeak: "npm:^4.0.1" - minimatch: "npm:^10.0.0" - minipass: "npm:^7.1.2" - package-json-from-dist: "npm:^1.0.0" - path-scurry: "npm:^2.0.0" - bin: - glob: dist/esm/bin.mjs - checksum: 10c0/419866015d8795258a8ac51de5b9d1a99c72634fc3ead93338e4da388e89773ab21681e494eac0fbc4250b003451ca3110bb4f1c9393d15d14466270094fdb4e - languageName: node - linkType: hard - "glob@npm:^7.1.3, glob@npm:^7.1.4": version: 7.2.3 resolution: "glob@npm:7.2.3" @@ -6443,19 +6426,6 @@ __metadata: languageName: node linkType: hard -"jackspeak@npm:^4.0.1": - version: 4.0.1 - resolution: "jackspeak@npm:4.0.1" - dependencies: - "@isaacs/cliui": "npm:^8.0.2" - "@pkgjs/parseargs": "npm:^0.11.0" - dependenciesMeta: - "@pkgjs/parseargs": - optional: true - checksum: 10c0/c87997d9c9c5b7366259b1f2a444ef148692f8eedad5307caca939babbb60af2b47d306e5c63bf9d5fefbab2ab48d4da275188c3de525d0e716cc21b784bbccb - languageName: node - linkType: hard - "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -6781,13 +6751,6 @@ __metadata: languageName: node linkType: hard -"lru-cache@npm:^11.0.0": - version: 11.0.0 - resolution: "lru-cache@npm:11.0.0" - checksum: 10c0/827ff0e0739f9b0f30f92f5a5fc97c6a2bd3ae32c0452bc58cb7411d6c589d49536073027293f2d1f02d0c2e72b63b162f238df7e9ff6f4cc0345f92afec4d1d - languageName: node - linkType: hard - "lru-cache@npm:^5.1.1": version: 5.1.1 resolution: "lru-cache@npm:5.1.1" @@ -6974,15 +6937,6 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^10.0.0": - version: 10.0.1 - resolution: "minimatch@npm:10.0.1" - dependencies: - brace-expansion: "npm:^2.0.1" - checksum: 10c0/e6c29a81fe83e1877ad51348306be2e8aeca18c88fdee7a99df44322314279e15799e41d7cb274e4e8bb0b451a3bc622d6182e157dfa1717d6cda75e9cd8cd5d - languageName: node - linkType: hard - "minimatch@npm:^3.0.4, minimatch@npm:^3.0.5, minimatch@npm:^3.1.1, minimatch@npm:^3.1.2": version: 3.1.2 resolution: "minimatch@npm:3.1.2" @@ -7093,13 +7047,6 @@ __metadata: languageName: node linkType: hard -"minipass@npm:^7.1.2": - version: 7.1.2 - resolution: "minipass@npm:7.1.2" - checksum: 10c0/b0fd20bb9fb56e5fa9a8bfac539e8915ae07430a619e4b86ff71f5fc757ef3924b23b2c4230393af1eda647ed3d75739e4e0acb250a6b1eb277cf7f8fe449557 - languageName: node - linkType: hard - "minisearch@npm:^6.3.0": version: 6.3.0 resolution: "minisearch@npm:6.3.0" @@ -7482,13 +7429,6 @@ __metadata: languageName: node linkType: hard -"package-json-from-dist@npm:^1.0.0": - version: 1.0.0 - resolution: "package-json-from-dist@npm:1.0.0" - checksum: 10c0/e3ffaf6ac1040ab6082a658230c041ad14e72fabe99076a2081bb1d5d41210f11872403fc09082daf4387fc0baa6577f96c9c0e94c90c394fd57794b66aa4033 - languageName: node - linkType: hard - "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -7581,16 +7521,6 @@ __metadata: languageName: node linkType: hard -"path-scurry@npm:^2.0.0": - version: 2.0.0 - resolution: "path-scurry@npm:2.0.0" - dependencies: - lru-cache: "npm:^11.0.0" - minipass: "npm:^7.1.2" - checksum: 10c0/3da4adedaa8e7ef8d6dc4f35a0ff8f05a9b4d8365f2b28047752b62d4c1ad73eec21e37b1579ef2d075920157856a3b52ae8309c480a6f1a8bbe06ff8e52b33c - languageName: node - linkType: hard - "path-type@npm:^4.0.0": version: 4.0.0 resolution: "path-type@npm:4.0.0" From a07a3efee30fcb3ad7e98c9b1c632e12016ee5ba Mon Sep 17 00:00:00 2001 From: raon0211 Date: Thu, 25 Jul 2024 00:20:56 +0900 Subject: [PATCH 14/18] chore: package.json --- package.json | 2 +- yarn.lock | 370 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 362 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 637feb273..f9b312efb 100644 --- a/package.json +++ b/package.json @@ -156,8 +156,8 @@ "prettier": "^3.2.5", "rollup": "^4.19.0", "rollup-plugin-dts": "^6.1.1", - "tslib": "^2.6.3", "tar": "^6", + "tslib": "^2.6.3", "tsup": "^8.1.0", "typescript": "^5.4.5", "vitest": "^1.5.2" diff --git a/yarn.lock b/yarn.lock index 8c58925b6..66c19e886 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2382,7 +2382,7 @@ __metadata: languageName: node linkType: hard -"@jridgewell/gen-mapping@npm:^0.3.5": +"@jridgewell/gen-mapping@npm:^0.3.2, @jridgewell/gen-mapping@npm:^0.3.5": version: 0.3.5 resolution: "@jridgewell/gen-mapping@npm:0.3.5" dependencies: @@ -3608,6 +3608,23 @@ __metadata: languageName: node linkType: hard +"any-promise@npm:^1.0.0": + version: 1.3.0 + resolution: "any-promise@npm:1.3.0" + checksum: 10c0/60f0298ed34c74fef50daab88e8dab786036ed5a7fad02e012ab57e376e0a0b4b29e83b95ea9b5e7d89df762f5f25119b83e00706ecaccb22cfbacee98d74889 + languageName: node + linkType: hard + +"anymatch@npm:~3.1.2": + version: 3.1.3 + resolution: "anymatch@npm:3.1.3" + dependencies: + normalize-path: "npm:^3.0.0" + picomatch: "npm:^2.0.4" + checksum: 10c0/57b06ae984bc32a0d22592c87384cd88fe4511b1dd7581497831c56d41939c8a001b28e7b853e1450f2bf61992dfcaa8ae2d0d161a0a90c4fb631ef07098fbac + languageName: node + linkType: hard + "are-docs-informative@npm:^0.0.2": version: 0.0.2 resolution: "are-docs-informative@npm:0.0.2" @@ -3840,6 +3857,13 @@ __metadata: languageName: node linkType: hard +"binary-extensions@npm:^2.0.0": + version: 2.3.0 + resolution: "binary-extensions@npm:2.3.0" + checksum: 10c0/75a59cafc10fb12a11d510e77110c6c7ae3f4ca22463d52487709ca7f18f69d886aa387557cc9864fbdb10153d0bdb4caacabf11541f55e89ed6e18d12ece2b5 + languageName: node + linkType: hard + "bluebird@npm:^2.3.5, bluebird@npm:^2.6.2, bluebird@npm:^2.8.1, bluebird@npm:^2.8.2": version: 2.11.0 resolution: "bluebird@npm:2.11.0" @@ -3866,7 +3890,7 @@ __metadata: languageName: node linkType: hard -"braces@npm:^3.0.3": +"braces@npm:^3.0.3, braces@npm:~3.0.2": version: 3.0.3 resolution: "braces@npm:3.0.3" dependencies: @@ -3938,6 +3962,17 @@ __metadata: languageName: node linkType: hard +"bundle-require@npm:^5.0.0": + version: 5.0.0 + resolution: "bundle-require@npm:5.0.0" + dependencies: + load-tsconfig: "npm:^0.2.3" + peerDependencies: + esbuild: ">=0.18" + checksum: 10c0/92c46df02586e0ebd66ee4831c9b5775adb3c32a43fe2b2aaf7bc675135c141f751de6a9a26b146d64c607c5b40f9eef5f10dce3c364f602d4bed268444c32c6 + languageName: node + linkType: hard + "cac@npm:^6.7.14": version: 6.7.14 resolution: "cac@npm:6.7.14" @@ -4178,6 +4213,25 @@ __metadata: languageName: node linkType: hard +"chokidar@npm:^3.6.0": + version: 3.6.0 + resolution: "chokidar@npm:3.6.0" + dependencies: + anymatch: "npm:~3.1.2" + braces: "npm:~3.0.2" + fsevents: "npm:~2.3.2" + glob-parent: "npm:~5.1.2" + is-binary-path: "npm:~2.1.0" + is-glob: "npm:~4.0.1" + normalize-path: "npm:~3.0.0" + readdirp: "npm:~3.6.0" + dependenciesMeta: + fsevents: + optional: true + checksum: 10c0/8361dcd013f2ddbe260eacb1f3cb2f2c6f2b0ad118708a343a5ed8158941a39cb8fb1d272e0f389712e74ee90ce8ba864eece9e0e62b9705cb468a2f6d917462 + languageName: node + linkType: hard + "chownr@npm:^2.0.0": version: 2.0.0 resolution: "chownr@npm:2.0.0" @@ -4323,6 +4377,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:^4.0.0": + version: 4.1.1 + resolution: "commander@npm:4.1.1" + checksum: 10c0/84a76c08fe6cc08c9c93f62ac573d2907d8e79138999312c92d4155bc2325d487d64d13f669b2000c9f8caf70493c1be2dac74fec3c51d5a04f8bc3ae1830bab + languageName: node + linkType: hard + "comment-parser@npm:1.4.1": version: 1.4.1 resolution: "comment-parser@npm:1.4.1" @@ -4363,6 +4424,13 @@ __metadata: languageName: node linkType: hard +"consola@npm:^3.2.3": + version: 3.2.3 + resolution: "consola@npm:3.2.3" + checksum: 10c0/c606220524ec88a05bb1baf557e9e0e04a0c08a9c35d7a08652d99de195c4ddcb6572040a7df57a18ff38bbc13ce9880ad032d56630cef27bef72768ef0ac078 + languageName: node + linkType: hard + "convert-source-map@npm:^2.0.0": version: 2.0.0 resolution: "convert-source-map@npm:2.0.0" @@ -4957,7 +5025,7 @@ __metadata: languageName: unknown linkType: soft -"esbuild@npm:0.23.0": +"esbuild@npm:0.23.0, esbuild@npm:^0.23.0": version: 0.23.0 resolution: "esbuild@npm:0.23.0" dependencies: @@ -5306,6 +5374,23 @@ __metadata: languageName: node linkType: hard +"execa@npm:^5.1.1": + version: 5.1.1 + resolution: "execa@npm:5.1.1" + dependencies: + cross-spawn: "npm:^7.0.3" + get-stream: "npm:^6.0.0" + human-signals: "npm:^2.1.0" + is-stream: "npm:^2.0.0" + merge-stream: "npm:^2.0.0" + npm-run-path: "npm:^4.0.1" + onetime: "npm:^5.1.2" + signal-exit: "npm:^3.0.3" + strip-final-newline: "npm:^2.0.0" + checksum: 10c0/c8e615235e8de4c5addf2fa4c3da3e3aa59ce975a3e83533b4f6a71750fb816a2e79610dc5f1799b6e28976c9ae86747a36a606655bf8cb414a74d8d507b304f + languageName: node + linkType: hard + "execa@npm:^8.0.1": version: 8.0.1 resolution: "execa@npm:8.0.1" @@ -5713,6 +5798,13 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^6.0.0": + version: 6.0.1 + resolution: "get-stream@npm:6.0.1" + checksum: 10c0/49825d57d3fd6964228e6200a58169464b8e8970489b3acdc24906c782fb7f01f9f56f8e6653c4a50713771d6658f7cfe051e5eb8c12e334138c9c918b296341 + languageName: node + linkType: hard + "get-stream@npm:^8.0.1": version: 8.0.1 resolution: "get-stream@npm:8.0.1" @@ -5750,7 +5842,7 @@ __metadata: languageName: node linkType: hard -"glob-parent@npm:^5.1.2": +"glob-parent@npm:^5.1.2, glob-parent@npm:~5.1.2": version: 5.1.2 resolution: "glob-parent@npm:5.1.2" dependencies: @@ -6046,6 +6138,13 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^2.1.0": + version: 2.1.0 + resolution: "human-signals@npm:2.1.0" + checksum: 10c0/695edb3edfcfe9c8b52a76926cd31b36978782062c0ed9b1192b36bebc75c4c87c82e178dfcb0ed0fc27ca59d434198aac0bd0be18f5781ded775604db22304a + languageName: node + linkType: hard + "human-signals@npm:^5.0.0": version: 5.0.0 resolution: "human-signals@npm:5.0.0" @@ -6180,6 +6279,15 @@ __metadata: languageName: node linkType: hard +"is-binary-path@npm:~2.1.0": + version: 2.1.0 + resolution: "is-binary-path@npm:2.1.0" + dependencies: + binary-extensions: "npm:^2.0.0" + checksum: 10c0/a16eaee59ae2b315ba36fad5c5dcaf8e49c3e27318f8ab8fa3cdb8772bf559c8d1ba750a589c2ccb096113bb64497084361a25960899cb6172a6925ab6123d38 + languageName: node + linkType: hard + "is-boolean-object@npm:^1.1.0": version: 1.1.2 resolution: "is-boolean-object@npm:1.1.2" @@ -6245,7 +6353,7 @@ __metadata: languageName: node linkType: hard -"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3": +"is-glob@npm:^4.0.0, is-glob@npm:^4.0.1, is-glob@npm:^4.0.3, is-glob@npm:~4.0.1": version: 4.0.3 resolution: "is-glob@npm:4.0.3" dependencies: @@ -6338,6 +6446,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^2.0.0": + version: 2.0.1 + resolution: "is-stream@npm:2.0.1" + checksum: 10c0/7c284241313fc6efc329b8d7f08e16c0efeb6baab1b4cd0ba579eb78e5af1aa5da11e68559896a2067cd6c526bd29241dda4eb1225e627d5aa1a89a76d4635a5 + languageName: node + linkType: hard + "is-stream@npm:^3.0.0": version: 3.0.0 resolution: "is-stream@npm:3.0.0" @@ -6532,6 +6647,13 @@ __metadata: languageName: node linkType: hard +"joycon@npm:^3.1.1": + version: 3.1.1 + resolution: "joycon@npm:3.1.1" + checksum: 10c0/131fb1e98c9065d067fd49b6e685487ac4ad4d254191d7aa2c9e3b90f4e9ca70430c43cad001602bdbdabcf58717d3b5c5b7461c1bd8e39478c8de706b3fe6ae + languageName: node + linkType: hard + "js-tokens@npm:^4.0.0": version: 4.0.0 resolution: "js-tokens@npm:4.0.0" @@ -6716,6 +6838,13 @@ __metadata: languageName: node linkType: hard +"lilconfig@npm:^3.1.1": + version: 3.1.2 + resolution: "lilconfig@npm:3.1.2" + checksum: 10c0/f059630b1a9bddaeba83059db00c672b64dc14074e9f232adce32b38ca1b5686ab737eb665c5ba3c32f147f0002b4bee7311ad0386a9b98547b5623e87071fbe + languageName: node + linkType: hard + "limited-request-queue@npm:^2.0.0": version: 2.0.0 resolution: "limited-request-queue@npm:2.0.0" @@ -6740,6 +6869,13 @@ __metadata: languageName: node linkType: hard +"load-tsconfig@npm:^0.2.3": + version: 0.2.5 + resolution: "load-tsconfig@npm:0.2.5" + checksum: 10c0/bf2823dd26389d3497b6567f07435c5a7a58d9df82e879b0b3892f87d8db26900f84c85bc329ef41c0540c0d6a448d1c23ddc64a80f3ff6838b940f3915a3fcb + languageName: node + linkType: hard + "load-yaml-file@npm:^0.2.0": version: 0.2.0 resolution: "load-yaml-file@npm:0.2.0" @@ -6808,6 +6944,13 @@ __metadata: languageName: node linkType: hard +"lodash.sortby@npm:^4.7.0": + version: 4.7.0 + resolution: "lodash.sortby@npm:4.7.0" + checksum: 10c0/fc48fb54ff7669f33bb32997cab9460757ee99fafaf72400b261c3e10fde21538e47d8cfcbe6a25a31bcb5b7b727c27d52626386fc2de24eb059a6d64a89cdf5 + languageName: node + linkType: hard + "lodash.startcase@npm:^4.4.0": version: 4.4.0 resolution: "lodash.startcase@npm:4.4.0" @@ -7044,6 +7187,13 @@ __metadata: languageName: node linkType: hard +"mimic-fn@npm:^2.1.0": + version: 2.1.0 + resolution: "mimic-fn@npm:2.1.0" + checksum: 10c0/b26f5479d7ec6cc2bce275a08f146cf78f5e7b661b18114e2506dd91ec7ec47e7a25bf4360e5438094db0560bcc868079fb3b1fb3892b833c1ecbf63f80c95a4 + languageName: node + linkType: hard + "mimic-fn@npm:^4.0.0": version: 4.0.0 resolution: "mimic-fn@npm:4.0.0" @@ -7241,6 +7391,17 @@ __metadata: languageName: node linkType: hard +"mz@npm:^2.7.0": + version: 2.7.0 + resolution: "mz@npm:2.7.0" + dependencies: + any-promise: "npm:^1.0.0" + object-assign: "npm:^4.0.1" + thenify-all: "npm:^1.0.0" + checksum: 10c0/103114e93f87362f0b56ab5b2e7245051ad0276b646e3902c98397d18bb8f4a77f2ea4a2c9d3ad516034ea3a56553b60d3f5f78220001ca4c404bd711bd0af39 + languageName: node + linkType: hard + "nanoid@npm:^3.3.7": version: 3.3.7 resolution: "nanoid@npm:3.3.7" @@ -7406,7 +7567,7 @@ __metadata: languageName: node linkType: hard -"object-assign@npm:^4.1.1": +"object-assign@npm:^4.0.1, object-assign@npm:^4.1.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" checksum: 10c0/1f4df9945120325d041ccf7b86f31e8bcc14e73d29171e37a7903050e96b81323784ec59f93f102ec635bcf6fa8034ba3ea0a8c7e69fa202b87ae3b6cec5a414 @@ -7448,6 +7609,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^5.1.2": + version: 5.1.2 + resolution: "onetime@npm:5.1.2" + dependencies: + mimic-fn: "npm:^2.1.0" + checksum: 10c0/ffcef6fbb2692c3c40749f31ea2e22677a876daea92959b8a80b521d95cca7a668c884d8b2045d1d8ee7d56796aa405c405462af112a1477594cc63531baeb8f + languageName: node + linkType: hard + "onetime@npm:^6.0.0": version: 6.0.0 resolution: "onetime@npm:6.0.0" @@ -7653,7 +7823,7 @@ __metadata: languageName: node linkType: hard -"path-key@npm:^3.1.0": +"path-key@npm:^3.0.0, path-key@npm:^3.1.0": version: 3.1.1 resolution: "path-key@npm:3.1.1" checksum: 10c0/748c43efd5a569c039d7a00a03b58eecd1d75f3999f5a28303d75f521288df4823bc057d8784eb72358b2895a05f29a070bc9f1f17d28226cc4e62494cc58c4c @@ -7733,7 +7903,14 @@ __metadata: languageName: node linkType: hard -"picomatch@npm:^2.3.1": +"picocolors@npm:^1.0.1": + version: 1.0.1 + resolution: "picocolors@npm:1.0.1" + checksum: 10c0/c63cdad2bf812ef0d66c8db29583802355d4ca67b9285d846f390cc15c2f6ccb94e8cb7eb6a6e97fc5990a6d3ad4ae42d86c84d3146e667c739a4234ed50d400 + languageName: node + linkType: hard + +"picomatch@npm:^2.0.4, picomatch@npm:^2.2.1, picomatch@npm:^2.3.1": version: 2.3.1 resolution: "picomatch@npm:2.3.1" checksum: 10c0/26c02b8d06f03206fc2ab8d16f19960f2ff9e81a658f831ecb656d8f17d9edc799e8364b1f4a7873e89d9702dff96204be0fa26fe4181f6843f040f819dac4be @@ -7747,6 +7924,13 @@ __metadata: languageName: node linkType: hard +"pirates@npm:^4.0.1": + version: 4.0.6 + resolution: "pirates@npm:4.0.6" + checksum: 10c0/00d5fa51f8dded94d7429700fb91a0c1ead00ae2c7fd27089f0c5b63e6eca36197fe46384631872690a66f390c5e27198e99006ab77ae472692ab9c2ca903f36 + languageName: node + linkType: hard + "pkg-dir@npm:^4.2.0": version: 4.2.0 resolution: "pkg-dir@npm:4.2.0" @@ -7774,6 +7958,29 @@ __metadata: languageName: node linkType: hard +"postcss-load-config@npm:^6.0.1": + version: 6.0.1 + resolution: "postcss-load-config@npm:6.0.1" + dependencies: + lilconfig: "npm:^3.1.1" + peerDependencies: + jiti: ">=1.21.0" + postcss: ">=8.0.9" + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + jiti: + optional: true + postcss: + optional: true + tsx: + optional: true + yaml: + optional: true + checksum: 10c0/74173a58816dac84e44853f7afbd283f4ef13ca0b6baeba27701214beec33f9e309b128f8102e2b173e8d45ecba45d279a9be94b46bf48d219626aa9b5730848 + languageName: node + linkType: hard + "postcss@npm:^8.4.38": version: 8.4.38 resolution: "postcss@npm:8.4.38" @@ -8000,6 +8207,15 @@ __metadata: languageName: node linkType: hard +"readdirp@npm:~3.6.0": + version: 3.6.0 + resolution: "readdirp@npm:3.6.0" + dependencies: + picomatch: "npm:^2.2.1" + checksum: 10c0/6fa848cf63d1b82ab4e985f4cf72bd55b7dcfd8e0a376905804e48c3634b7e749170940ba77b32804d5fe93b3cc521aa95a8d7e7d725f830da6d93f3669ce66b + languageName: node + linkType: hard + "redent@npm:^3.0.0": version: 3.0.0 resolution: "redent@npm:3.0.0" @@ -8512,7 +8728,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^3.0.2": +"signal-exit@npm:^3.0.2, signal-exit@npm:^3.0.3": version: 3.0.7 resolution: "signal-exit@npm:3.0.7" checksum: 10c0/25d272fa73e146048565e08f3309d5b942c1979a6f4a58a8c59d5fa299728e9c2fcd1a759ec870863b1fd38653670240cd420dad2ad9330c71f36608a6a1c912 @@ -8617,6 +8833,15 @@ __metadata: languageName: node linkType: hard +"source-map@npm:0.8.0-beta.0": + version: 0.8.0-beta.0 + resolution: "source-map@npm:0.8.0-beta.0" + dependencies: + whatwg-url: "npm:^7.0.0" + checksum: 10c0/fb4d9bde9a9fdb2c29b10e5eae6c71d10e09ef467e1afb75fdec2eb7e11fa5b343a2af553f74f18b695dbc0b81f9da2e9fa3d7a317d5985e9939499ec6087835 + languageName: node + linkType: hard + "source-map@npm:^0.6.0": version: 0.6.1 resolution: "source-map@npm:0.6.1" @@ -8904,6 +9129,13 @@ __metadata: languageName: node linkType: hard +"strip-final-newline@npm:^2.0.0": + version: 2.0.0 + resolution: "strip-final-newline@npm:2.0.0" + checksum: 10c0/bddf8ccd47acd85c0e09ad7375409d81653f645fda13227a9d459642277c253d877b68f2e5e4d819fe75733b0e626bac7e954c04f3236f6d196f79c94fa4a96f + languageName: node + linkType: hard + "strip-final-newline@npm:^3.0.0": version: 3.0.0 resolution: "strip-final-newline@npm:3.0.0" @@ -8943,6 +9175,24 @@ __metadata: languageName: node linkType: hard +"sucrase@npm:^3.35.0": + version: 3.35.0 + resolution: "sucrase@npm:3.35.0" + dependencies: + "@jridgewell/gen-mapping": "npm:^0.3.2" + commander: "npm:^4.0.0" + glob: "npm:^10.3.10" + lines-and-columns: "npm:^1.1.6" + mz: "npm:^2.7.0" + pirates: "npm:^4.0.1" + ts-interface-checker: "npm:^0.1.9" + bin: + sucrase: bin/sucrase + sucrase-node: bin/sucrase-node + checksum: 10c0/ac85f3359d2c2ecbf5febca6a24ae9bf96c931f05fde533c22a94f59c6a74895e5d5f0e871878dfd59c2697a75ebb04e4b2224ef0bfc24ca1210735c2ec191ef + languageName: node + linkType: hard + "supports-color@npm:^0.2.0": version: 0.2.0 resolution: "supports-color@npm:0.2.0" @@ -9064,6 +9314,24 @@ __metadata: languageName: node linkType: hard +"thenify-all@npm:^1.0.0": + version: 1.6.0 + resolution: "thenify-all@npm:1.6.0" + dependencies: + thenify: "npm:>= 3.1.0 < 4" + checksum: 10c0/9b896a22735e8122754fe70f1d65f7ee691c1d70b1f116fda04fea103d0f9b356e3676cb789506e3909ae0486a79a476e4914b0f92472c2e093d206aed4b7d6b + languageName: node + linkType: hard + +"thenify@npm:>= 3.1.0 < 4": + version: 3.3.1 + resolution: "thenify@npm:3.3.1" + dependencies: + any-promise: "npm:^1.0.0" + checksum: 10c0/f375aeb2b05c100a456a30bc3ed07ef03a39cbdefe02e0403fb714b8c7e57eeaad1a2f5c4ecfb9ce554ce3db9c2b024eba144843cd9e344566d9fcee73b04767 + languageName: node + linkType: hard + "through2-sink@npm:^1.0.0": version: 1.0.0 resolution: "through2-sink@npm:1.0.0" @@ -9178,6 +9446,15 @@ __metadata: languageName: node linkType: hard +"tr46@npm:^1.0.1": + version: 1.0.1 + resolution: "tr46@npm:1.0.1" + dependencies: + punycode: "npm:^2.1.0" + checksum: 10c0/41525c2ccce86e3ef30af6fa5e1464e6d8bb4286a58ea8db09228f598889581ef62347153f6636cd41553dc41685bdfad0a9d032ef58df9fbb0792b3447d0f04 + languageName: node + linkType: hard + "tr46@npm:~0.0.3": version: 0.0.3 resolution: "tr46@npm:0.0.3" @@ -9185,6 +9462,15 @@ __metadata: languageName: node linkType: hard +"tree-kill@npm:^1.2.2": + version: 1.2.2 + resolution: "tree-kill@npm:1.2.2" + bin: + tree-kill: cli.js + checksum: 10c0/7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2 + languageName: node + linkType: hard + "trim-newlines@npm:^3.0.0": version: 3.0.1 resolution: "trim-newlines@npm:3.0.1" @@ -9208,6 +9494,13 @@ __metadata: languageName: node linkType: hard +"ts-interface-checker@npm:^0.1.9": + version: 0.1.13 + resolution: "ts-interface-checker@npm:0.1.13" + checksum: 10c0/232509f1b84192d07b81d1e9b9677088e590ac1303436da1e92b296e9be8e31ea042e3e1fd3d29b1742ad2c959e95afe30f63117b8f1bc3a3850070a5142fea7 + languageName: node + linkType: hard + "tslib@npm:^2.6.2, tslib@npm:^2.6.3": version: 2.6.3 resolution: "tslib@npm:2.6.3" @@ -9215,6 +9508,47 @@ __metadata: languageName: node linkType: hard +"tsup@npm:^8.1.0": + version: 8.2.2 + resolution: "tsup@npm:8.2.2" + dependencies: + bundle-require: "npm:^5.0.0" + cac: "npm:^6.7.14" + chokidar: "npm:^3.6.0" + consola: "npm:^3.2.3" + debug: "npm:^4.3.5" + esbuild: "npm:^0.23.0" + execa: "npm:^5.1.1" + globby: "npm:^11.1.0" + joycon: "npm:^3.1.1" + picocolors: "npm:^1.0.1" + postcss-load-config: "npm:^6.0.1" + resolve-from: "npm:^5.0.0" + rollup: "npm:^4.19.0" + source-map: "npm:0.8.0-beta.0" + sucrase: "npm:^3.35.0" + tree-kill: "npm:^1.2.2" + peerDependencies: + "@microsoft/api-extractor": ^7.36.0 + "@swc/core": ^1 + postcss: ^8.4.12 + typescript: ">=4.5.0" + peerDependenciesMeta: + "@microsoft/api-extractor": + optional: true + "@swc/core": + optional: true + postcss: + optional: true + typescript: + optional: true + bin: + tsup: dist/cli-default.js + tsup-node: dist/cli-node.js + checksum: 10c0/d13461553517701affc75f6ae2f4988b4493da630d99504f20db4f9a822bfebf07d0dfc4f2057d0428711607aacdc541adcb641af395443e463a3a35c277d9a4 + languageName: node + linkType: hard + "tty-table@npm:^4.1.5": version: 4.2.3 resolution: "tty-table@npm:4.2.3" @@ -9877,6 +10211,13 @@ __metadata: languageName: node linkType: hard +"webidl-conversions@npm:^4.0.2": + version: 4.0.2 + resolution: "webidl-conversions@npm:4.0.2" + checksum: 10c0/def5c5ac3479286dffcb604547628b2e6b46c5c5b8a8cfaa8c71dc3bafc85859bde5fbe89467ff861f571ab38987cf6ab3d6e7c80b39b999e50e803c12f3164f + languageName: node + linkType: hard + "whatwg-url@npm:^5.0.0": version: 5.0.0 resolution: "whatwg-url@npm:5.0.0" @@ -9887,6 +10228,17 @@ __metadata: languageName: node linkType: hard +"whatwg-url@npm:^7.0.0": + version: 7.1.0 + resolution: "whatwg-url@npm:7.1.0" + dependencies: + lodash.sortby: "npm:^4.7.0" + tr46: "npm:^1.0.1" + webidl-conversions: "npm:^4.0.2" + checksum: 10c0/2785fe4647690e5a0225a79509ba5e21fdf4a71f9de3eabdba1192483fe006fc79961198e0b99f82751557309f17fc5a07d4d83c251aa5b2f85ba71e674cbee9 + languageName: node + linkType: hard + "which-boxed-primitive@npm:^1.0.2": version: 1.0.2 resolution: "which-boxed-primitive@npm:1.0.2" From 76aae2ec2c9b3383a75cf58ce3c55cd3c8d104c5 Mon Sep 17 00:00:00 2001 From: raon0211 Date: Thu, 25 Jul 2024 00:25:12 +0900 Subject: [PATCH 15/18] rollup config --- rollup.config.mjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 4f6e05e1d..df92e08b1 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -3,9 +3,13 @@ import fs from 'node:fs'; import { createRequire } from 'node:module'; import path from 'node:path'; +import { dirname } from 'node:path'; import terserPlugin from '@rollup/plugin-terser'; import tsPlugin from '@rollup/plugin-typescript'; import dtsPlugin from 'rollup-plugin-dts'; +import { fileURLToPath } from 'node:url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); /** * @type {{ @@ -150,7 +154,7 @@ function mapInputs(srcFiles) { return Object.fromEntries( srcFiles.map(file => [ file.replace(/^(\.\/)?src\//, '').replace(/\.[cm]?(js|ts)$/, ''), - path.join(import.meta.dirname, file), + path.join(__dirname, file), ]) ); } @@ -164,7 +168,7 @@ function fileNames(extension = 'js') { /** @type {(dir: string) => void} */ function clearDir(dir) { - const dirPath = path.join(import.meta.dirname, dir); + const dirPath = path.join(__dirname, dir); if (dir && fs.existsSync(dirPath)) { fs.rmSync(dirPath, { recursive: true, force: true }); console.log(`cleared: ${dir}`); From 459b6e785be75e3ebd54a2f5a0fd704435d45b5c Mon Sep 17 00:00:00 2001 From: raon0211 Date: Thu, 25 Jul 2024 00:26:53 +0900 Subject: [PATCH 16/18] sort --- tests/check-dist.spec.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/check-dist.spec.ts b/tests/check-dist.spec.ts index 569a0c094..2130f9783 100644 --- a/tests/check-dist.spec.ts +++ b/tests/check-dist.spec.ts @@ -62,7 +62,9 @@ describe(`es-toolkit's package tarball`, () => { const cjsScript = ` const toolkit = require("${path.join("es-toolkit", entrypoint)}"); -const exported = Object.entries(toolkit).map(([k, v]) => [k, typeof v]); +const exported = Object.entries(toolkit) + .map(([k, v]) => [k, typeof v]) + .sort((x, y) => x[0].localeCompare(y[0])); console.log(exported); `.trim(); @@ -71,7 +73,9 @@ console.log(exported); const esmScript = ` const toolkit = await import("${path.join("es-toolkit", entrypoint)}"); -const exported = Object.entries(toolkit).map(([k, v]) => [k, typeof v]); +const exported = Object.entries(toolkit) + .map(([k, v]) => [k, typeof v]) + .sort((x, y) => x[0].localeCompare(y[0])); console.log(exported); `.trim(); From 0142e9d759c1c7f076b1899c29a310bffd343242 Mon Sep 17 00:00:00 2001 From: raon0211 Date: Thu, 25 Jul 2024 00:31:16 +0900 Subject: [PATCH 17/18] lint --- rollup.config.mjs | 1 + tests/check-dist.spec.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/rollup.config.mjs b/rollup.config.mjs index df92e08b1..4ceb8d654 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -9,6 +9,7 @@ import tsPlugin from '@rollup/plugin-typescript'; import dtsPlugin from 'rollup-plugin-dts'; import { fileURLToPath } from 'node:url'; +// eslint-disable-next-line @typescript-eslint/naming-convention const __dirname = dirname(fileURLToPath(import.meta.url)); /** diff --git a/tests/check-dist.spec.ts b/tests/check-dist.spec.ts index 2130f9783..0ad80ec2a 100644 --- a/tests/check-dist.spec.ts +++ b/tests/check-dist.spec.ts @@ -66,6 +66,7 @@ const exported = Object.entries(toolkit) .map(([k, v]) => [k, typeof v]) .sort((x, y) => x[0].localeCompare(y[0])); +console.log("${path.join("es-toolkit", entrypoint)}"); console.log(exported); `.trim(); const cjsScriptPath = path.join(tmpdir, 'script.cjs'); @@ -77,6 +78,7 @@ const exported = Object.entries(toolkit) .map(([k, v]) => [k, typeof v]) .sort((x, y) => x[0].localeCompare(y[0])); +console.log("${path.join("es-toolkit", entrypoint)}"); console.log(exported); `.trim(); const esmScriptPath = path.join(tmpdir, 'script.mjs'); From fd84a9822036a2426d8dcfa0d9b2f005b36f3baf Mon Sep 17 00:00:00 2001 From: raon0211 Date: Thu, 25 Jul 2024 00:35:04 +0900 Subject: [PATCH 18/18] prettier --- rollup.config.mjs | 5 +-- tests/check-dist.spec.ts | 88 +++++++++++++++++++++------------------- 2 files changed, 47 insertions(+), 46 deletions(-) diff --git a/rollup.config.mjs b/rollup.config.mjs index 4ceb8d654..c1f025f15 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -153,10 +153,7 @@ function declarationOptions({ entrypoints, outDir }) { /** @type {(srcFiles: string[]) => Record} */ function mapInputs(srcFiles) { return Object.fromEntries( - srcFiles.map(file => [ - file.replace(/^(\.\/)?src\//, '').replace(/\.[cm]?(js|ts)$/, ''), - path.join(__dirname, file), - ]) + srcFiles.map(file => [file.replace(/^(\.\/)?src\//, '').replace(/\.[cm]?(js|ts)$/, ''), path.join(__dirname, file)]) ); } diff --git a/tests/check-dist.spec.ts b/tests/check-dist.spec.ts index 0ad80ec2a..937f6a0fa 100644 --- a/tests/check-dist.spec.ts +++ b/tests/check-dist.spec.ts @@ -32,65 +32,69 @@ const ENTRYPOINTS = [ './promise', './string', './compat', -] +]; describe(`es-toolkit's package tarball`, () => { - it('configures all entrypoints correctly', async () => { - const packageJson = await getPackageJsonOfTarball(); - const entrypoints = Object.keys(packageJson.exports); - - expect(entrypoints).toEqual([ - ...ENTRYPOINTS, - './package.json' - ]); - }, { timeout: 30_000 }); - - it('exports identical functions in CJS and ESM', async () => { - const tarball = await createPackageTarball(); - const tmpdir = await createTmpDir(); - - const packageJson = { - "dependencies": { - "es-toolkit": tarball.path, - } - } - - await fs.promises.writeFile(path.join(tmpdir, 'package.json'), JSON.stringify(packageJson, null, 2)); - await execa('npm', ['install'], { cwd: tmpdir }); - - for (const entrypoint of ENTRYPOINTS) { - const cjsScript = ` -const toolkit = require("${path.join("es-toolkit", entrypoint)}"); + it( + 'configures all entrypoints correctly', + async () => { + const packageJson = await getPackageJsonOfTarball(); + const entrypoints = Object.keys(packageJson.exports); + + expect(entrypoints).toEqual([...ENTRYPOINTS, './package.json']); + }, + { timeout: 30_000 } + ); + + it( + 'exports identical functions in CJS and ESM', + async () => { + const tarball = await createPackageTarball(); + const tmpdir = await createTmpDir(); + + const packageJson = { + dependencies: { + 'es-toolkit': tarball.path, + }, + }; + + await fs.promises.writeFile(path.join(tmpdir, 'package.json'), JSON.stringify(packageJson, null, 2)); + await execa('npm', ['install'], { cwd: tmpdir }); + + for (const entrypoint of ENTRYPOINTS) { + const cjsScript = ` +const toolkit = require("${path.join('es-toolkit', entrypoint)}"); const exported = Object.entries(toolkit) .map(([k, v]) => [k, typeof v]) .sort((x, y) => x[0].localeCompare(y[0])); -console.log("${path.join("es-toolkit", entrypoint)}"); +console.log("${path.join('es-toolkit', entrypoint)}"); console.log(exported); `.trim(); - const cjsScriptPath = path.join(tmpdir, 'script.cjs'); + const cjsScriptPath = path.join(tmpdir, 'script.cjs'); - const esmScript = ` -const toolkit = await import("${path.join("es-toolkit", entrypoint)}"); + const esmScript = ` +const toolkit = await import("${path.join('es-toolkit', entrypoint)}"); const exported = Object.entries(toolkit) .map(([k, v]) => [k, typeof v]) .sort((x, y) => x[0].localeCompare(y[0])); -console.log("${path.join("es-toolkit", entrypoint)}"); +console.log("${path.join('es-toolkit', entrypoint)}"); console.log(exported); `.trim(); - const esmScriptPath = path.join(tmpdir, 'script.mjs'); + const esmScriptPath = path.join(tmpdir, 'script.mjs'); - await fs.promises.writeFile(cjsScriptPath, cjsScript); - await fs.promises.writeFile(esmScriptPath, esmScript); + await fs.promises.writeFile(cjsScriptPath, cjsScript); + await fs.promises.writeFile(esmScriptPath, esmScript); - const cjsResult = await execa('node', [cjsScriptPath]) - const esmResult = await execa('node', [esmScriptPath]) + const cjsResult = await execa('node', [cjsScriptPath]); + const esmResult = await execa('node', [esmScriptPath]); - expect(cjsResult.stdout).toEqual(esmResult.stdout); - } - - }, { timeout: 60_000 }); -}) + expect(cjsResult.stdout).toEqual(esmResult.stdout); + } + }, + { timeout: 60_000 } + ); +});