From 62c7cd1910aeda1c4836b3c6903218fc24f64232 Mon Sep 17 00:00:00 2001 From: Momo Kornher Date: Wed, 15 Nov 2023 16:46:12 +0000 Subject: [PATCH] chore: replace mock-fs with memfs that works in node20 (#355) We are affected by this `mock-fs` bug: https://github.com/tschaub/mock-fs/issues/380 Seems like there is no activity on the repo recently, so we switch to a new tool. However `memfs` only works for the test case in `assemblies.test.ts`. So we keep `mock-fs` for the `rosetta.test.ts` test cases. --- By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license]. [Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0 (cherry picked from commit f25a39436d134bb2e3589da87f599d3600045957) # Conflicts: # .projen/deps.json # .projen/tasks.json # package.json # yarn.lock --- .projen/deps.json | 7 +++++++ .projen/tasks.json | 11 +++++++++++ package.json | 5 +++++ yarn.lock | 40 +++++++++++++++++++++++++++++++++++++++- 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/.projen/deps.json b/.projen/deps.json index b2dec9ae..1dc04db5 100644 --- a/.projen/deps.json +++ b/.projen/deps.json @@ -87,6 +87,13 @@ }, { "name": "memfs", +<<<<<<< HEAD +======= + "type": "build" + }, + { + "name": "mock-fs", +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) "type": "build" }, { diff --git a/.projen/tasks.json b/.projen/tasks.json index 6e1b90ea..f8b79585 100644 --- a/.projen/tasks.json +++ b/.projen/tasks.json @@ -208,13 +208,24 @@ }, "steps": [ { +<<<<<<< HEAD "exec": "npx npm-check-updates@16 --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@actions/core,@actions/github,@types/commonmark,@types/jest,@types/mock-fs,@types/node,@types/stream-json,@types/tar,@types/workerpool,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint-plugin-unicorn,eslint,fs-monkey,jest,memfs,mock-fs,prettier,projen,tar,ts-jest,ts-node,@jsii/check-node,@jsii/spec,@xmldom/xmldom,chalk,commonmark,fast-glob,semver,semver-intersect,stream-json,workerpool,yargs" +======= + "exec": "yarn upgrade npm-check-updates" + }, + { + "exec": "npm-check-updates --upgrade --target=minor --peer --dep=dev,peer,prod,optional --filter=@actions/core,@actions/github,@types/commonmark,@types/jest,@types/mock-fs,@types/node,@types/stream-json,@types/tar,@types/workerpool,@typescript-eslint/eslint-plugin,@typescript-eslint/parser,constructs,eslint-config-prettier,eslint-import-resolver-typescript,eslint-plugin-import,eslint-plugin-prettier,eslint-plugin-unicorn,eslint,fs-monkey,jest,memfs,mock-fs,npm-check-updates,prettier,projen,tar,ts-jest,ts-node,@jsii/check-node,@jsii/spec,@xmldom/xmldom,chalk,commonmark,fast-glob,semver,semver-intersect,stream-json,workerpool,yargs" +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) }, { "exec": "yarn install --check-files" }, { +<<<<<<< HEAD "exec": "yarn upgrade @actions/core @actions/github @types/commonmark @types/jest @types/mock-fs @types/node @types/stream-json @types/tar @types/workerpool @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint-plugin-unicorn eslint fs-monkey jest memfs mock-fs prettier projen tar ts-jest ts-node @jsii/check-node @jsii/spec @xmldom/xmldom chalk commonmark fast-glob semver semver-intersect stream-json workerpool yargs" +======= + "exec": "yarn upgrade @actions/core @actions/github @types/commonmark @types/jest @types/mock-fs @types/node @types/stream-json @types/tar @types/workerpool @typescript-eslint/eslint-plugin @typescript-eslint/parser constructs eslint-config-prettier eslint-import-resolver-typescript eslint-plugin-import eslint-plugin-prettier eslint-plugin-unicorn eslint fs-monkey jest memfs mock-fs npm-check-updates prettier projen tar ts-jest ts-node @jsii/check-node @jsii/spec @xmldom/xmldom chalk commonmark fast-glob semver semver-intersect stream-json workerpool yargs" +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) }, { "exec": "npx projen" diff --git a/package.json b/package.json index 14af0798..58b790d5 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,13 @@ "devDependencies": { "@actions/core": "^1.10.1", "@actions/github": "^5.1.1", +<<<<<<< HEAD "@types/commonmark": "^0.27.9", "@types/jest": "^29.5.11", +======= + "@types/commonmark": "^0.27.8", + "@types/jest": "^29.5.8", +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) "@types/mock-fs": "^4.13.4", "@types/node": "^16", "@types/stream-json": "^1.7.7", diff --git a/yarn.lock b/yarn.lock index 9a1bd0b6..a434e902 100644 --- a/yarn.lock +++ b/yarn.lock @@ -867,7 +867,7 @@ dependencies: "@babel/types" "^7.20.7" -"@types/commonmark@^0.27.9": +"@types/commonmark@^0.27.8": version "0.27.9" resolved "https://registry.yarnpkg.com/@types/commonmark/-/commonmark-0.27.9.tgz#2d2d42e72127c84525fbbc87aaefb5a43e1129d7" integrity sha512-d3+57WgyPCcIc6oshmcPkmP4+JqRRot9eeZLsBsutWtIxwWivpoyc2wEcolOp8MyO3ZWN846mMdoR02kdHSMCw== @@ -2152,6 +2152,11 @@ fs-monkey@^1.0.5: resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.5.tgz#fe450175f0db0d7ea758102e1d84096acb925788" integrity sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew== +fs-monkey@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/fs-monkey/-/fs-monkey-1.0.5.tgz#fe450175f0db0d7ea758102e1d84096acb925788" + integrity sha512-8uMbBjrhzW76TYgEV27Y5E//W2f/lTFmx78P2w19FZSxarhI/798APGQyuGCwmkNxgwGRhrLfvWyLBvNtuOmew== + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2378,10 +2383,37 @@ human-signals@^2.1.0: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +<<<<<<< HEAD +======= +humanize-ms@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/humanize-ms/-/humanize-ms-1.2.1.tgz#c46e3159a293f6b896da29316d8b6fe8bb79bbed" + integrity sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ== + dependencies: + ms "^2.0.0" + +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) hyperdyperid@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/hyperdyperid/-/hyperdyperid-1.2.0.tgz#59668d323ada92228d2a869d3e474d5a33b69e6b" integrity sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A== +<<<<<<< HEAD +======= + +iconv-lite@^0.6.2: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + +ignore-walk@^6.0.0: + version "6.0.3" + resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-6.0.3.tgz#0fcdb6decaccda35e308a7b0948645dd9523b7bb" + integrity sha512-C7FfFoTA+bI10qfeydT8aZbvr91vAEU+2W5BZUlzPec47oNb07SsOfwYrtxuvOYdUApPP/Qlh4DtAO51Ekk2QA== + dependencies: + minimatch "^9.0.0" +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) ignore@^5.2.0, ignore@^5.2.4: version "5.3.0" @@ -4098,9 +4130,15 @@ text-table@^0.2.0: integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== thingies@^1.11.1: +<<<<<<< HEAD version "1.15.0" resolved "https://registry.yarnpkg.com/thingies/-/thingies-1.15.0.tgz#bd186213bed5105b11eda0ce749fa475c5d4d6e3" integrity sha512-ZSJlvEpD8QllYim0VSGlbAoob/iPrTWNlV/m8ltizMvMmzzU2gVJvHfH9ijLstyciWF70ZiQXqz+BCXWJq+ZQw== +======= + version "1.12.0" + resolved "https://registry.yarnpkg.com/thingies/-/thingies-1.12.0.tgz#a815c224482d607aa70f563d3cbb351a338e4710" + integrity sha512-AiGqfYC1jLmJagbzQGuoZRM48JPsr9yB734a7K6wzr34NMhjUPrWSQrkF7ZBybf3yCerCL2Gcr02kMv4NmaZfA== +>>>>>>> f25a394 (chore: replace mock-fs with memfs that works in node20 (#355)) tmpl@1.0.5: version "1.0.5"