Refactor to fs-fixture (#622)

This commit is contained in:
Bjorn Lu
2026-05-18 10:03:43 +00:00
committed by GitHub
parent 87481d361e
commit f1222b6286
12 changed files with 76 additions and 260 deletions
@@ -1,4 +0,0 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json",
"ignore": ["changesets-dev-ignored-package-pkg-a"]
}
@@ -1,8 +0,0 @@
{
"name": "ignored-package",
"version": "1.0.0",
"private": true,
"workspaces": [
"packages/*"
]
}
@@ -1,7 +0,0 @@
{
"name": "changesets-dev-ignored-package-pkg-a",
"version": "1.0.0",
"dependencies": {
"changesets-dev-ignored-package-pkg-b": "1.0.0"
}
}
@@ -1,4 +0,0 @@
{
"name": "changesets-dev-ignored-package-pkg-b",
"version": "1.0.0"
}
@@ -1,3 +0,0 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.3.0/schema.json"
}
-8
View File
@@ -1,8 +0,0 @@
{
"name": "simple-project",
"version": "1.0.0",
"private": true,
"workspaces": [
"packages/*"
]
}
@@ -1,7 +0,0 @@
{
"name": "changesets-dev-simple-project-pkg-a",
"version": "1.0.0",
"dependencies": {
"changesets-dev-simple-project-pkg-b": "1.0.0"
}
}
@@ -1,4 +0,0 @@
{
"name": "changesets-dev-simple-project-pkg-b",
"version": "1.0.0"
}
+1 -1
View File
@@ -40,7 +40,7 @@
"@changesets/write": "^0.4.0",
"@types/node": "^24.12.2",
"@types/semver": "^7.5.0",
"fixturez": "^1.1.0",
"fs-fixture": "^2.13.0",
"oxfmt": "^0.48.0",
"rolldown": "^1.0.1",
"typescript": "^5.8.3",
+7 -172
View File
@@ -77,9 +77,9 @@ importers:
'@types/semver':
specifier: ^7.5.0
version: 7.7.1
fixturez:
specifier: ^1.1.0
version: 1.1.0
fs-fixture:
specifier: ^2.13.0
version: 2.13.0
oxfmt:
specifier: ^0.48.0
version: 0.48.0
@@ -574,18 +574,10 @@ packages:
argparse@2.0.1:
resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}
array-union@1.0.2:
resolution: {integrity: sha512-Dxr6QJj/RdU/hCaBjOfxW+q6lyuVE6JFWIrAUpuOOhoJJoQ99cUn3igRaHVB5P9WrgFVN0FfArM3x0cueOU8ng==}
engines: {node: '>=0.10.0'}
array-union@2.1.0:
resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
engines: {node: '>=8'}
array-uniq@1.0.3:
resolution: {integrity: sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==}
engines: {node: '>=0.10.0'}
assertion-error@2.0.1:
resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==}
engines: {node: '>=12'}
@@ -600,9 +592,6 @@ packages:
bail@1.0.5:
resolution: {integrity: sha512-xFbRxM1tahm08yHBP16MMjVUAvDaBMD38zsM9EMAUN61omwLmKlOpB/Zku5QkjZ8TZ4vn53pj+t518cH0S03RQ==}
balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
base64-js@1.5.1:
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
@@ -616,9 +605,6 @@ packages:
bottleneck@2.19.5:
resolution: {integrity: sha512-VHiNCbI1lKdl44tGrhNfU3lup0Tj/ZBMJB5/2ZbNXRCPuRCO7ed2mgcK4r17y+KB2EfuYuRaVlwNbAeaWGSpbw==}
brace-expansion@1.1.14:
resolution: {integrity: sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==}
braces@3.0.3:
resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}
engines: {node: '>=8'}
@@ -666,9 +652,6 @@ packages:
collapse-white-space@1.0.6:
resolution: {integrity: sha512-jEovNnrhMuqyCcjfEJA56v0Xq8SkIoPKDyaHahwo3POf4qcSXqMYuwNcOTzp74vTsR9Tn08z4MxWqAhcekogkQ==}
concat-map@0.0.1:
resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==}
convert-source-map@2.0.0:
resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==}
@@ -681,10 +664,6 @@ packages:
resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}
engines: {node: '>= 8'}
crypto-random-string@1.0.0:
resolution: {integrity: sha512-GsVpkFPlycH7/fRR7Dhcmnoii54gV1nz7y4CWyeFS14N+JVBBhY+r8amRHE4BwSYal7BPTDp8isvAlCxyFt3Hg==}
engines: {node: '>=4'}
dataloader@1.4.0:
resolution: {integrity: sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==}
@@ -703,10 +682,6 @@ packages:
diff3@0.0.3:
resolution: {integrity: sha512-iSq8ngPOt0K53A6eVr4d5Kn6GNrM2nQZtC740pzIriHtn4pOQ2lyzEXQMBeVcWERN0ye7fhBsk9PbLLQOnUx/g==}
dir-glob@2.2.2:
resolution: {integrity: sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw==}
engines: {node: '>=4'}
dir-glob@3.0.1:
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
engines: {node: '>=8'}
@@ -791,16 +766,10 @@ packages:
resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==}
engines: {node: '>=8'}
fixturez@1.1.0:
resolution: {integrity: sha512-c4q9eZsAmCzj9gkrEO/YwIRlrHWt/TXQiX9jR9WeLFOqeeV6EyzdiiV28CpSzF6Ip+gyYrSv5UeOHqyzfcNTVA==}
for-each@0.3.5:
resolution: {integrity: sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg==}
engines: {node: '>= 0.4'}
fs-extra@5.0.0:
resolution: {integrity: sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==}
fs-extra@7.0.1:
resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==}
engines: {node: '>=6 <7 || >=8'}
@@ -809,8 +778,9 @@ packages:
resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==}
engines: {node: '>=6 <7 || >=8'}
fs.realpath@1.0.0:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
fs-fixture@2.13.0:
resolution: {integrity: sha512-bqL4EVFNgoA38OnztLfeHn4NZJ32zWnSNA3ALtessYO0WjpL//QuYl1YkYd7j+TY0cLO6cqgoHxPJpfSwKQAPA==}
engines: {node: '>=18.0.0'}
fsevents@2.3.3:
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
@@ -832,18 +802,10 @@ packages:
resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}
engines: {node: '>= 6'}
glob@7.2.3:
resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==}
deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me
globby@11.1.0:
resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==}
engines: {node: '>=10'}
globby@7.1.1:
resolution: {integrity: sha512-yANWAN2DUcBtuus5Cpd+SKROzXHs2iVXFZt/Ykrfz6SAXqacLX25NZpltE+39ceMexYF4TtEadjuSTw8+3wX4g==}
engines: {node: '>=4'}
gopd@1.2.0:
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
engines: {node: '>= 0.4'}
@@ -877,17 +839,10 @@ packages:
ieee754@1.2.1:
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
ignore@3.3.10:
resolution: {integrity: sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug==}
ignore@5.3.2:
resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==}
engines: {node: '>= 4'}
inflight@1.0.6:
resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==}
deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
inherits@2.0.4:
resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
@@ -1015,9 +970,6 @@ packages:
resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==}
engines: {node: '>=10'}
minimatch@3.1.5:
resolution: {integrity: sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==}
minimist@1.2.8:
resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==}
@@ -1084,18 +1036,10 @@ packages:
resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==}
engines: {node: '>=8'}
path-is-absolute@1.0.1:
resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==}
engines: {node: '>=0.10.0'}
path-key@3.1.1:
resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==}
engines: {node: '>=8'}
path-type@3.0.0:
resolution: {integrity: sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==}
engines: {node: '>=4'}
path-type@4.0.0:
resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==}
engines: {node: '>=8'}
@@ -1114,10 +1058,6 @@ packages:
resolution: {integrity: sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==}
engines: {node: '>=12'}
pify@3.0.0:
resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==}
engines: {node: '>=4'}
pify@4.0.1:
resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==}
engines: {node: '>=6'}
@@ -1206,9 +1146,6 @@ packages:
siginfo@2.0.0:
resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==}
signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
signal-exit@4.1.0:
resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==}
engines: {node: '>=14'}
@@ -1219,10 +1156,6 @@ packages:
simple-get@4.0.1:
resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==}
slash@1.0.0:
resolution: {integrity: sha512-3TYDR7xWt4dIqV2JauJr+EJeW356RXijHeUlO+8djJ+uBXPn8/2dpzBc8yQhh583sVvc9CvFAeQVgijsH+PNNg==}
engines: {node: '>=0.10.0'}
slash@3.0.0:
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
engines: {node: '>=8'}
@@ -1256,14 +1189,6 @@ packages:
resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
engines: {node: '>=4'}
temp-dir@1.0.0:
resolution: {integrity: sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ==}
engines: {node: '>=4'}
tempy@0.2.1:
resolution: {integrity: sha512-LB83o9bfZGrntdqPuRdanIVCPReam9SOZKW0fOy5I9X3A854GGWi0tjCqoXEk84XIEYBc/x9Hq3EFop/H5wJaw==}
engines: {node: '>=4'}
term-size@2.2.1:
resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==}
engines: {node: '>=8'}
@@ -1337,10 +1262,6 @@ packages:
unified@8.4.2:
resolution: {integrity: sha512-JCrmN13jI4+h9UAyKEoGcDZV+i1E7BLFuG7OsaDvTXI5P0qhHX+vZO/kOhz9jn8HGENDKbwSeB0nVOg4gVStGA==}
unique-string@1.0.0:
resolution: {integrity: sha512-ODgiYu03y5g76A1I9Gt0/chLCzQjvzDy7DsZGsLOE/1MrF6wriEskSncj1+/C58Xk/kPZDppSctDybCwOSaGAg==}
engines: {node: '>=4'}
unist-util-is@3.0.0:
resolution: {integrity: sha512-sVZZX3+kspVNmLWBPAB6r+7D9ZgAFPNWm66f7YNb420RlQSbn+n8rG8dGZSkrER7ZIXGQYNm5pqC3v3HopH24A==}
@@ -1993,14 +1914,8 @@ snapshots:
argparse@2.0.1: {}
array-union@1.0.2:
dependencies:
array-uniq: 1.0.3
array-union@2.1.0: {}
array-uniq@1.0.3: {}
assertion-error@2.0.1: {}
async-lock@1.4.1: {}
@@ -2011,8 +1926,6 @@ snapshots:
bail@1.0.5: {}
balanced-match@1.0.2: {}
base64-js@1.5.1: {}
before-after-hook@4.0.0: {}
@@ -2023,11 +1936,6 @@ snapshots:
bottleneck@2.19.5: {}
brace-expansion@1.1.14:
dependencies:
balanced-match: 1.0.2
concat-map: 0.0.1
braces@3.0.3:
dependencies:
fill-range: 7.1.1
@@ -2072,8 +1980,6 @@ snapshots:
collapse-white-space@1.0.6: {}
concat-map@0.0.1: {}
convert-source-map@2.0.0: {}
crc-32@1.2.2: {}
@@ -2084,8 +1990,6 @@ snapshots:
shebang-command: 2.0.0
which: 2.0.2
crypto-random-string@1.0.0: {}
dataloader@1.4.0: {}
decompress-response@6.0.0:
@@ -2102,10 +2006,6 @@ snapshots:
diff3@0.0.3: {}
dir-glob@2.2.2:
dependencies:
path-type: 3.0.0
dir-glob@3.0.1:
dependencies:
path-type: 4.0.0
@@ -2176,23 +2076,10 @@ snapshots:
locate-path: 5.0.0
path-exists: 4.0.0
fixturez@1.1.0:
dependencies:
fs-extra: 5.0.0
globby: 7.1.1
signal-exit: 3.0.7
tempy: 0.2.1
for-each@0.3.5:
dependencies:
is-callable: 1.2.7
fs-extra@5.0.0:
dependencies:
graceful-fs: 4.2.11
jsonfile: 4.0.0
universalify: 0.1.2
fs-extra@7.0.1:
dependencies:
graceful-fs: 4.2.11
@@ -2205,7 +2092,7 @@ snapshots:
jsonfile: 4.0.0
universalify: 0.1.2
fs.realpath@1.0.0: {}
fs-fixture@2.13.0: {}
fsevents@2.3.3:
optional: true
@@ -2234,15 +2121,6 @@ snapshots:
dependencies:
is-glob: 4.0.3
glob@7.2.3:
dependencies:
fs.realpath: 1.0.0
inflight: 1.0.6
inherits: 2.0.4
minimatch: 3.1.5
once: 1.4.0
path-is-absolute: 1.0.1
globby@11.1.0:
dependencies:
array-union: 2.1.0
@@ -2252,15 +2130,6 @@ snapshots:
merge2: 1.4.1
slash: 3.0.0
globby@7.1.1:
dependencies:
array-union: 1.0.2
dir-glob: 2.2.2
glob: 7.2.3
ignore: 3.3.10
pify: 3.0.0
slash: 1.0.0
gopd@1.2.0: {}
graceful-fs@4.2.11: {}
@@ -2287,15 +2156,8 @@ snapshots:
ieee754@1.2.1: {}
ignore@3.3.10: {}
ignore@5.3.2: {}
inflight@1.0.6:
dependencies:
once: 1.4.0
wrappy: 1.0.2
inherits@2.0.4: {}
is-alphabetical@1.0.4: {}
@@ -2405,10 +2267,6 @@ snapshots:
mimic-response@3.1.0: {}
minimatch@3.1.5:
dependencies:
brace-expansion: 1.1.14
minimist@1.2.8: {}
minimisted@2.0.1:
@@ -2486,14 +2344,8 @@ snapshots:
path-exists@4.0.0: {}
path-is-absolute@1.0.1: {}
path-key@3.1.1: {}
path-type@3.0.0:
dependencies:
pify: 3.0.0
path-type@4.0.0: {}
pathe@2.0.3: {}
@@ -2504,8 +2356,6 @@ snapshots:
picomatch@4.0.4: {}
pify@3.0.0: {}
pify@4.0.1: {}
possible-typed-array-names@1.1.0: {}
@@ -2628,8 +2478,6 @@ snapshots:
siginfo@2.0.0: {}
signal-exit@3.0.7: {}
signal-exit@4.1.0: {}
simple-concat@1.0.1: {}
@@ -2640,8 +2488,6 @@ snapshots:
once: 1.4.0
simple-concat: 1.0.1
slash@1.0.0: {}
slash@3.0.0: {}
spawndamnit@3.0.1:
@@ -2675,13 +2521,6 @@ snapshots:
strip-bom@3.0.0: {}
temp-dir@1.0.0: {}
tempy@0.2.1:
dependencies:
temp-dir: 1.0.0
unique-string: 1.0.0
term-size@2.2.1: {}
tinybench@2.9.0: {}
@@ -2746,10 +2585,6 @@ snapshots:
trough: 1.0.5
vfile: 4.2.1
unique-string@1.0.0:
dependencies:
crypto-random-string: 1.0.0
unist-util-is@3.0.0: {}
unist-util-remove-position@1.1.4:
+68 -25
View File
@@ -1,8 +1,7 @@
import fs from "node:fs/promises";
import path from "node:path";
import type { Changeset } from "@changesets/types";
import writeChangeset from "@changesets/write";
import fixturez from "fixturez";
import { createFixture } from "fs-fixture";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { Git } from "./git.ts";
import { setupOctokit } from "./octokit.ts";
@@ -36,14 +35,58 @@ let mockedGithubMethods = {
};
let mockedGraphql = vi.fn();
let f = fixturez(import.meta.dirname);
const nodeModulesDir = path.join(import.meta.dirname, "..", "node_modules");
function createSimpleProjectFixture() {
return createFixture({
node_modules: (api) => api.symlink(nodeModulesDir),
".changeset/config.json": JSON.stringify({}),
"packages/pkg-a/package.json": JSON.stringify({
name: "changesets-dev-simple-project-pkg-a",
version: "1.0.0",
dependencies: {
"changesets-dev-simple-project-pkg-b": "1.0.0",
},
}),
"packages/pkg-b/package.json": JSON.stringify({
name: "changesets-dev-simple-project-pkg-b",
version: "1.0.0",
}),
"package.json": JSON.stringify({
name: "simple-project",
version: "1.0.0",
private: true,
workspaces: ["packages/*"],
}),
});
}
function createIgnoredPackageFixture() {
return createFixture({
node_modules: (api) => api.symlink(nodeModulesDir),
".changeset/config.json": JSON.stringify({
ignore: ["changesets-dev-ignored-package-pkg-a"],
}),
"packages/pkg-a/package.json": JSON.stringify({
name: "changesets-dev-ignored-package-pkg-a",
version: "1.0.0",
dependencies: {
"changesets-dev-ignored-package-pkg-b": "1.0.0",
},
}),
"packages/pkg-b/package.json": JSON.stringify({
name: "changesets-dev-ignored-package-pkg-b",
version: "1.0.0",
}),
"package.json": JSON.stringify({
name: "ignored-package",
version: "1.0.0",
private: true,
workspaces: ["packages/*"],
}),
});
}
const linkNodeModules = async (cwd: string) => {
await fs.symlink(
path.join(import.meta.dirname, "..", "node_modules"),
path.join(cwd, "node_modules"),
);
};
const writeChangesets = (changesets: Changeset[], cwd: string) => {
return Promise.all(changesets.map((commit) => writeChangeset(commit, cwd)));
};
@@ -54,8 +97,8 @@ beforeEach(() => {
describe("version", () => {
it("creates simple PR", async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -93,8 +136,8 @@ describe("version", () => {
});
it('creates a draft PR when prDraft is "create"', async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -129,8 +172,8 @@ describe("version", () => {
});
it("only includes bumped packages in the PR body", async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -164,8 +207,8 @@ describe("version", () => {
});
it("doesn't include ignored package that got a dependency update in the PR body", async () => {
let cwd = f.copy("ignored-package");
await linkNodeModules(cwd);
await using fixture = await createIgnoredPackageFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -199,8 +242,8 @@ describe("version", () => {
});
it("does not include changelog entries if full message exceeds size limit", async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -258,8 +301,8 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
});
it("does not include any release information if a message with simplified release info exceeds size limit", async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({ data: [] }));
@@ -317,8 +360,8 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
});
it('updates an existing PR via GraphQL without converting it to draft when prDraft is "create"', async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({
data: [{ number: 123, node_id: "PR_kwDOA" }],
@@ -351,8 +394,8 @@ fluminis divesque vulnere aquis parce lapsis rabie si visa fulmineis.
});
it('updates an existing PR via GraphQL and converts it to draft when prDraft is "always"', async () => {
let cwd = f.copy("simple-project");
await linkNodeModules(cwd);
await using fixture = await createSimpleProjectFixture();
const cwd = fixture.path;
mockedGithubMethods.pulls.list.mockImplementationOnce(() => ({
data: [{ number: 123, node_id: "PR_kwDOA" }],
-17
View File
@@ -1,17 +0,0 @@
type Opts = {
glob?: string | Array<string>;
root?: string;
cleanup?: boolean;
};
declare module "fixturez" {
export default function (
cwd: string,
opts?: Opts,
): {
find: (a: string) => string;
temp: () => string;
copy: (a: string) => string;
cleanup: () => any;
};
}