diff --git a/.changeset/gold-mugs-remember.md b/.changeset/gold-mugs-remember.md new file mode 100644 index 00000000000..147bc71163a --- /dev/null +++ b/.changeset/gold-mugs-remember.md @@ -0,0 +1,5 @@ +--- +'@modern-js/module-tools': minor +--- + +Bump esbuild to 0.24.0 diff --git a/packages/solutions/module-tools/package.json b/packages/solutions/module-tools/package.json index 62e22917f4c..fb23ff6bcb3 100644 --- a/packages/solutions/module-tools/package.json +++ b/packages/solutions/module-tools/package.json @@ -77,7 +77,7 @@ "@swc/helpers": "0.5.13", "convert-source-map": "1.8.0", "enhanced-resolve": "5.12.0", - "esbuild": "0.19.2", + "esbuild": "0.24.0", "magic-string": "0.30.12", "postcss": "^8.4.35", "postcss-modules": "4.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 11ea3c893d1..59971a8b110 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2585,7 +2585,7 @@ importers: version: 5.5.11 debug: specifier: 4.3.7 - version: 4.3.7(supports-color@9.3.1) + version: 4.3.7(supports-color@5.5.0) garfish: specifier: ^1.8.1 version: 1.8.1 @@ -3781,7 +3781,7 @@ importers: version: 7.23.6 '@babel/traverse': specifier: ^7.23.2 - version: 7.23.6 + version: 7.23.6(supports-color@5.5.0) '@babel/types': specifier: ^7.26.0 version: 7.26.0 @@ -3940,8 +3940,8 @@ importers: specifier: 5.12.0 version: 5.12.0 esbuild: - specifier: 0.19.2 - version: 0.19.2 + specifier: 0.24.0 + version: 0.24.0 magic-string: specifier: 0.30.12 version: 0.30.12 @@ -4697,7 +4697,7 @@ importers: version: 10.0.1 debug: specifier: 4.3.7 - version: 4.3.7(supports-color@9.3.1) + version: 4.3.7(supports-color@5.5.0) dotenv: specifier: 10.0.0 version: 10.0.0 @@ -4944,13 +4944,13 @@ importers: version: 29.5.0 jest-puppeteer: specifier: ^8.0.0 - version: 8.0.6(puppeteer@19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10))(typescript@5.3.3) + version: 8.0.6(puppeteer@19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10))(typescript@5.3.3) kill-port: specifier: ^2.0.0 version: 2.0.1 puppeteer: specifier: ^19.11.1 - version: 19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10) + version: 19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10) rimraf: specifier: ^6.0.1 version: 6.0.1 @@ -6439,6 +6439,8 @@ importers: tests/integration/module/fixtures/build/decorator: {} + tests/integration/module/fixtures/build/decoratorStage3: {} + tests/integration/module/fixtures/build/define/js: {} tests/integration/module/fixtures/build/define/ts: {} @@ -7858,7 +7860,7 @@ importers: version: 18.3.1(react@18.3.1) twin.macro: specifier: ^2 - version: 2.8.2(ts-node@10.9.2(@types/node@18.19.55)(typescript@5.6.3)) + version: 2.8.2(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.6.3)) tests/integration/tailwindcss/fixtures/twin.macro-v3: dependencies: @@ -9501,6 +9503,12 @@ packages: resolution: {integrity: sha512-Qwfvj/qoPbClxCRNuac1Du01r9gvNOT+pMYtJDapfB1eoGN1YlJ1BixLyL9WVENRx5RXgNLdfYdx/CuswlGhMw==} deprecated: 'Merged into tsx: https://tsx.is' + '@esbuild/aix-ppc64@0.24.0': + resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + '@esbuild/android-arm64@0.17.19': resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} engines: {node: '>=12'} @@ -9519,6 +9527,12 @@ packages: cpu: [arm64] os: [android] + '@esbuild/android-arm64@0.24.0': + resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + '@esbuild/android-arm@0.17.19': resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} engines: {node: '>=12'} @@ -9537,6 +9551,12 @@ packages: cpu: [arm] os: [android] + '@esbuild/android-arm@0.24.0': + resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + '@esbuild/android-x64@0.17.19': resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} engines: {node: '>=12'} @@ -9555,6 +9575,12 @@ packages: cpu: [x64] os: [android] + '@esbuild/android-x64@0.24.0': + resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + '@esbuild/darwin-arm64@0.17.19': resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} engines: {node: '>=12'} @@ -9573,6 +9599,12 @@ packages: cpu: [arm64] os: [darwin] + '@esbuild/darwin-arm64@0.24.0': + resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + '@esbuild/darwin-x64@0.17.19': resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} engines: {node: '>=12'} @@ -9591,6 +9623,12 @@ packages: cpu: [x64] os: [darwin] + '@esbuild/darwin-x64@0.24.0': + resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + '@esbuild/freebsd-arm64@0.17.19': resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} engines: {node: '>=12'} @@ -9609,6 +9647,12 @@ packages: cpu: [arm64] os: [freebsd] + '@esbuild/freebsd-arm64@0.24.0': + resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + '@esbuild/freebsd-x64@0.17.19': resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} engines: {node: '>=12'} @@ -9627,6 +9671,12 @@ packages: cpu: [x64] os: [freebsd] + '@esbuild/freebsd-x64@0.24.0': + resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + '@esbuild/linux-arm64@0.17.19': resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} engines: {node: '>=12'} @@ -9645,6 +9695,12 @@ packages: cpu: [arm64] os: [linux] + '@esbuild/linux-arm64@0.24.0': + resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + '@esbuild/linux-arm@0.17.19': resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} engines: {node: '>=12'} @@ -9663,6 +9719,12 @@ packages: cpu: [arm] os: [linux] + '@esbuild/linux-arm@0.24.0': + resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + '@esbuild/linux-ia32@0.17.19': resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} engines: {node: '>=12'} @@ -9681,6 +9743,12 @@ packages: cpu: [ia32] os: [linux] + '@esbuild/linux-ia32@0.24.0': + resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + '@esbuild/linux-loong64@0.14.54': resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==} engines: {node: '>=12'} @@ -9705,6 +9773,12 @@ packages: cpu: [loong64] os: [linux] + '@esbuild/linux-loong64@0.24.0': + resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + '@esbuild/linux-mips64el@0.17.19': resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} engines: {node: '>=12'} @@ -9723,6 +9797,12 @@ packages: cpu: [mips64el] os: [linux] + '@esbuild/linux-mips64el@0.24.0': + resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + '@esbuild/linux-ppc64@0.17.19': resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} engines: {node: '>=12'} @@ -9741,6 +9821,12 @@ packages: cpu: [ppc64] os: [linux] + '@esbuild/linux-ppc64@0.24.0': + resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + '@esbuild/linux-riscv64@0.17.19': resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} engines: {node: '>=12'} @@ -9759,6 +9845,12 @@ packages: cpu: [riscv64] os: [linux] + '@esbuild/linux-riscv64@0.24.0': + resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + '@esbuild/linux-s390x@0.17.19': resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} engines: {node: '>=12'} @@ -9777,6 +9869,12 @@ packages: cpu: [s390x] os: [linux] + '@esbuild/linux-s390x@0.24.0': + resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + '@esbuild/linux-x64@0.17.19': resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} engines: {node: '>=12'} @@ -9795,6 +9893,12 @@ packages: cpu: [x64] os: [linux] + '@esbuild/linux-x64@0.24.0': + resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + '@esbuild/netbsd-x64@0.17.19': resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} engines: {node: '>=12'} @@ -9813,6 +9917,18 @@ packages: cpu: [x64] os: [netbsd] + '@esbuild/netbsd-x64@0.24.0': + resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.24.0': + resolution: {integrity: sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + '@esbuild/openbsd-x64@0.17.19': resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} engines: {node: '>=12'} @@ -9831,6 +9947,12 @@ packages: cpu: [x64] os: [openbsd] + '@esbuild/openbsd-x64@0.24.0': + resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + '@esbuild/sunos-x64@0.17.19': resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} engines: {node: '>=12'} @@ -9849,6 +9971,12 @@ packages: cpu: [x64] os: [sunos] + '@esbuild/sunos-x64@0.24.0': + resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + '@esbuild/win32-arm64@0.17.19': resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} engines: {node: '>=12'} @@ -9867,6 +9995,12 @@ packages: cpu: [arm64] os: [win32] + '@esbuild/win32-arm64@0.24.0': + resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + '@esbuild/win32-ia32@0.17.19': resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} engines: {node: '>=12'} @@ -9885,6 +10019,12 @@ packages: cpu: [ia32] os: [win32] + '@esbuild/win32-ia32@0.24.0': + resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + '@esbuild/win32-x64@0.17.19': resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} engines: {node: '>=12'} @@ -9903,6 +10043,12 @@ packages: cpu: [x64] os: [win32] + '@esbuild/win32-x64@0.24.0': + resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + '@fal-works/esbuild-plugin-global-externals@2.1.2': resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} @@ -10657,8 +10803,8 @@ packages: peerDependencies: '@types/react': ^18.3.11 '@types/react-dom': ^18.3.1 - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: '*' + react-dom: '*' peerDependenciesMeta: '@types/react': optional: true @@ -10670,8 +10816,8 @@ packages: peerDependencies: '@types/react': ^18.3.11 '@types/react-dom': ^18.3.1 - react: ^16.8 || ^17.0 || ^18.0 - react-dom: ^16.8 || ^17.0 || ^18.0 + react: '*' + react-dom: '*' peerDependenciesMeta: '@types/react': optional: true @@ -15099,6 +15245,11 @@ packages: engines: {node: '>=12'} hasBin: true + esbuild@0.24.0: + resolution: {integrity: sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==} + engines: {node: '>=18'} + hasBin: true + escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -22093,7 +22244,7 @@ snapshots: '@babel/traverse': 7.25.7 '@babel/types': 7.26.0 convert-source-map: 1.8.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 lodash: 4.17.21 @@ -22116,7 +22267,7 @@ snapshots: '@babel/traverse': 7.25.9 '@babel/types': 7.26.0 convert-source-map: 2.0.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -22246,7 +22397,7 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.7 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) lodash.debounce: 4.0.8 resolve: 1.22.8 semver: 6.3.1 @@ -22258,7 +22409,7 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-compilation-targets': 7.25.7 '@babel/helper-plugin-utils': 7.25.9 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -22269,7 +22420,7 @@ snapshots: '@babel/core': 7.26.0 '@babel/helper-compilation-targets': 7.25.9 '@babel/helper-plugin-utils': 7.25.9 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) lodash.debounce: 4.0.8 resolve: 1.22.8 transitivePeerDependencies: @@ -23358,21 +23509,6 @@ snapshots: '@babel/parser': 7.26.1 '@babel/types': 7.26.0 - '@babel/traverse@7.23.6': - dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.24.5 - '@babel/types': 7.26.0 - debug: 4.3.7(supports-color@9.3.1) - globals: 11.12.0 - transitivePeerDependencies: - - supports-color - '@babel/traverse@7.23.6(supports-color@5.5.0)': dependencies: '@babel/code-frame': 7.24.2 @@ -23395,7 +23531,7 @@ snapshots: '@babel/parser': 7.25.8 '@babel/template': 7.25.7 '@babel/types': 7.26.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -23407,7 +23543,7 @@ snapshots: '@babel/parser': 7.26.1 '@babel/template': 7.25.9 '@babel/types': 7.26.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -23905,6 +24041,9 @@ snapshots: '@esbuild-kit/core-utils': 3.1.0 get-tsconfig: 4.5.0 + '@esbuild/aix-ppc64@0.24.0': + optional: true + '@esbuild/android-arm64@0.17.19': optional: true @@ -23914,6 +24053,9 @@ snapshots: '@esbuild/android-arm64@0.19.2': optional: true + '@esbuild/android-arm64@0.24.0': + optional: true + '@esbuild/android-arm@0.17.19': optional: true @@ -23923,6 +24065,9 @@ snapshots: '@esbuild/android-arm@0.19.2': optional: true + '@esbuild/android-arm@0.24.0': + optional: true + '@esbuild/android-x64@0.17.19': optional: true @@ -23932,6 +24077,9 @@ snapshots: '@esbuild/android-x64@0.19.2': optional: true + '@esbuild/android-x64@0.24.0': + optional: true + '@esbuild/darwin-arm64@0.17.19': optional: true @@ -23941,6 +24089,9 @@ snapshots: '@esbuild/darwin-arm64@0.19.2': optional: true + '@esbuild/darwin-arm64@0.24.0': + optional: true + '@esbuild/darwin-x64@0.17.19': optional: true @@ -23950,6 +24101,9 @@ snapshots: '@esbuild/darwin-x64@0.19.2': optional: true + '@esbuild/darwin-x64@0.24.0': + optional: true + '@esbuild/freebsd-arm64@0.17.19': optional: true @@ -23959,6 +24113,9 @@ snapshots: '@esbuild/freebsd-arm64@0.19.2': optional: true + '@esbuild/freebsd-arm64@0.24.0': + optional: true + '@esbuild/freebsd-x64@0.17.19': optional: true @@ -23968,6 +24125,9 @@ snapshots: '@esbuild/freebsd-x64@0.19.2': optional: true + '@esbuild/freebsd-x64@0.24.0': + optional: true + '@esbuild/linux-arm64@0.17.19': optional: true @@ -23977,6 +24137,9 @@ snapshots: '@esbuild/linux-arm64@0.19.2': optional: true + '@esbuild/linux-arm64@0.24.0': + optional: true + '@esbuild/linux-arm@0.17.19': optional: true @@ -23986,6 +24149,9 @@ snapshots: '@esbuild/linux-arm@0.19.2': optional: true + '@esbuild/linux-arm@0.24.0': + optional: true + '@esbuild/linux-ia32@0.17.19': optional: true @@ -23995,6 +24161,9 @@ snapshots: '@esbuild/linux-ia32@0.19.2': optional: true + '@esbuild/linux-ia32@0.24.0': + optional: true + '@esbuild/linux-loong64@0.14.54': optional: true @@ -24007,6 +24176,9 @@ snapshots: '@esbuild/linux-loong64@0.19.2': optional: true + '@esbuild/linux-loong64@0.24.0': + optional: true + '@esbuild/linux-mips64el@0.17.19': optional: true @@ -24016,6 +24188,9 @@ snapshots: '@esbuild/linux-mips64el@0.19.2': optional: true + '@esbuild/linux-mips64el@0.24.0': + optional: true + '@esbuild/linux-ppc64@0.17.19': optional: true @@ -24025,6 +24200,9 @@ snapshots: '@esbuild/linux-ppc64@0.19.2': optional: true + '@esbuild/linux-ppc64@0.24.0': + optional: true + '@esbuild/linux-riscv64@0.17.19': optional: true @@ -24034,6 +24212,9 @@ snapshots: '@esbuild/linux-riscv64@0.19.2': optional: true + '@esbuild/linux-riscv64@0.24.0': + optional: true + '@esbuild/linux-s390x@0.17.19': optional: true @@ -24043,6 +24224,9 @@ snapshots: '@esbuild/linux-s390x@0.19.2': optional: true + '@esbuild/linux-s390x@0.24.0': + optional: true + '@esbuild/linux-x64@0.17.19': optional: true @@ -24052,6 +24236,9 @@ snapshots: '@esbuild/linux-x64@0.19.2': optional: true + '@esbuild/linux-x64@0.24.0': + optional: true + '@esbuild/netbsd-x64@0.17.19': optional: true @@ -24061,6 +24248,12 @@ snapshots: '@esbuild/netbsd-x64@0.19.2': optional: true + '@esbuild/netbsd-x64@0.24.0': + optional: true + + '@esbuild/openbsd-arm64@0.24.0': + optional: true + '@esbuild/openbsd-x64@0.17.19': optional: true @@ -24070,6 +24263,9 @@ snapshots: '@esbuild/openbsd-x64@0.19.2': optional: true + '@esbuild/openbsd-x64@0.24.0': + optional: true + '@esbuild/sunos-x64@0.17.19': optional: true @@ -24079,6 +24275,9 @@ snapshots: '@esbuild/sunos-x64@0.19.2': optional: true + '@esbuild/sunos-x64@0.24.0': + optional: true + '@esbuild/win32-arm64@0.17.19': optional: true @@ -24088,6 +24287,9 @@ snapshots: '@esbuild/win32-arm64@0.19.2': optional: true + '@esbuild/win32-arm64@0.24.0': + optional: true + '@esbuild/win32-ia32@0.17.19': optional: true @@ -24097,6 +24299,9 @@ snapshots: '@esbuild/win32-ia32@0.19.2': optional: true + '@esbuild/win32-ia32@0.24.0': + optional: true + '@esbuild/win32-x64@0.17.19': optional: true @@ -24106,6 +24311,9 @@ snapshots: '@esbuild/win32-x64@0.19.2': optional: true + '@esbuild/win32-x64@0.24.0': + optional: true + '@fal-works/esbuild-plugin-global-externals@2.1.2': {} '@financial-times/polyfill-useragent-normaliser@1.10.2': @@ -24274,7 +24482,7 @@ snapshots: '@garfish/utils@1.8.1': dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -25048,7 +25256,7 @@ snapshots: '@modern-js/codesmith-utils': 2.6.5 '@swc/helpers': 0.5.1 axios: 1.7.7(debug@4.3.7) - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) tar: 6.2.1 transitivePeerDependencies: - supports-color @@ -26966,7 +27174,7 @@ snapshots: '@mdx-js/loader': 2.3.0(webpack@5.95.0(@swc/core@1.3.42)(esbuild@0.17.19)) '@mdx-js/mdx': 2.3.0 '@mdx-js/react': 2.3.0(react@18.3.1) - '@modern-js/utils': 2.60.5 + '@modern-js/utils': link:packages/toolkit/utils '@rsbuild/core': 1.0.19 '@rsbuild/plugin-less': 1.0.3(@rsbuild/core@1.0.19) '@rsbuild/plugin-react': 1.0.6(@rsbuild/core@1.0.19) @@ -27021,7 +27229,7 @@ snapshots: '@mdx-js/loader': 2.3.0(webpack@5.95.0(esbuild@0.17.19)) '@mdx-js/mdx': 2.3.0 '@mdx-js/react': 2.3.0(react@18.3.1) - '@modern-js/utils': 2.60.5 + '@modern-js/utils': link:packages/toolkit/utils '@rsbuild/core': 1.0.19 '@rsbuild/plugin-less': 1.0.3(@rsbuild/core@1.0.19) '@rsbuild/plugin-react': 1.0.6(@rsbuild/core@1.0.19) @@ -27659,7 +27867,7 @@ snapshots: '@storybook/react-docgen-typescript-plugin@1.0.6--canary.9.0c3f3b7.0(typescript@5.3.3)(webpack@5.95.0(esbuild@0.18.20))': dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) endent: 2.1.0 find-cache-dir: 3.3.2 flat-cache: 3.0.4 @@ -28592,7 +28800,7 @@ snapshots: '@babel/helper-module-imports': 7.22.15 '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.26.0) '@babel/template': 7.22.15 - '@babel/traverse': 7.23.6 + '@babel/traverse': 7.23.6(supports-color@5.5.0) '@babel/types': 7.26.0 '@vue/babel-helper-vue-transform-on': 1.1.5 camelcase: 6.3.0 @@ -28890,7 +29098,7 @@ snapshots: agent-base@6.0.2: dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -30522,7 +30730,7 @@ snapshots: declaration-update@0.0.2: dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -30640,7 +30848,7 @@ snapshots: detect-port@1.6.1: dependencies: address: 1.2.2 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -30889,7 +31097,7 @@ snapshots: base64id: 2.0.0 cookie: 0.4.2 cors: 2.8.5 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) engine.io-parser: 5.2.1 ws: 8.11.0(bufferutil@4.0.8)(utf-8-validate@5.0.10) transitivePeerDependencies: @@ -31084,14 +31292,14 @@ snapshots: esbuild-register@3.5.0(esbuild@0.17.19): dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) esbuild: 0.17.19 transitivePeerDependencies: - supports-color esbuild-register@3.6.0(esbuild@0.18.20): dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) esbuild: 0.18.20 transitivePeerDependencies: - supports-color @@ -31207,6 +31415,33 @@ snapshots: '@esbuild/win32-ia32': 0.19.2 '@esbuild/win32-x64': 0.19.2 + esbuild@0.24.0: + optionalDependencies: + '@esbuild/aix-ppc64': 0.24.0 + '@esbuild/android-arm': 0.24.0 + '@esbuild/android-arm64': 0.24.0 + '@esbuild/android-x64': 0.24.0 + '@esbuild/darwin-arm64': 0.24.0 + '@esbuild/darwin-x64': 0.24.0 + '@esbuild/freebsd-arm64': 0.24.0 + '@esbuild/freebsd-x64': 0.24.0 + '@esbuild/linux-arm': 0.24.0 + '@esbuild/linux-arm64': 0.24.0 + '@esbuild/linux-ia32': 0.24.0 + '@esbuild/linux-loong64': 0.24.0 + '@esbuild/linux-mips64el': 0.24.0 + '@esbuild/linux-ppc64': 0.24.0 + '@esbuild/linux-riscv64': 0.24.0 + '@esbuild/linux-s390x': 0.24.0 + '@esbuild/linux-x64': 0.24.0 + '@esbuild/netbsd-x64': 0.24.0 + '@esbuild/openbsd-arm64': 0.24.0 + '@esbuild/openbsd-x64': 0.24.0 + '@esbuild/sunos-x64': 0.24.0 + '@esbuild/win32-arm64': 0.24.0 + '@esbuild/win32-ia32': 0.24.0 + '@esbuild/win32-x64': 0.24.0 + escalade@3.1.1: {} escalade@3.2.0: {} @@ -31503,7 +31738,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -31717,7 +31952,7 @@ snapshots: dependencies: chalk: 4.1.2 commander: 5.1.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -31780,7 +32015,7 @@ snapshots: follow-redirects@1.15.9(debug@4.3.7): optionalDependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) for-each@0.3.3: dependencies: @@ -32555,7 +32790,7 @@ snapshots: dependencies: '@tootallnate/once': 2.0.0 agent-base: 6.0.2 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -32589,14 +32824,14 @@ snapshots: https-proxy-agent@4.0.0: dependencies: agent-base: 5.1.1 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -33019,7 +33254,7 @@ snapshots: istanbul-lib-source-maps@4.0.1: dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) istanbul-lib-coverage: 3.2.0 source-map: 0.6.1 transitivePeerDependencies: @@ -33724,11 +33959,11 @@ snapshots: optionalDependencies: jest-resolve: 29.5.0 - jest-puppeteer@8.0.6(puppeteer@19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10))(typescript@5.3.3): + jest-puppeteer@8.0.6(puppeteer@19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10))(typescript@5.3.3): dependencies: expect-puppeteer: 8.0.5 jest-environment-puppeteer: 8.0.6(typescript@5.3.3) - puppeteer: 19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10) + puppeteer: 19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10) transitivePeerDependencies: - debug - supports-color @@ -34149,7 +34384,7 @@ snapshots: koa-router@10.1.1: dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) http-errors: 1.8.1 koa-compose: 4.1.0 methods: 1.1.2 @@ -34164,7 +34399,7 @@ snapshots: content-disposition: 0.5.4 content-type: 1.0.4 cookies: 0.8.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) delegates: 1.0.0 depd: 2.0.0 destroy: 1.2.0 @@ -34920,7 +35155,7 @@ snapshots: micromark@3.1.0: dependencies: '@types/debug': 4.1.12 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) decode-named-character-reference: 1.0.2 micromark-core-commonmark: 1.0.6 micromark-factory-space: 1.0.0 @@ -35144,7 +35379,7 @@ snapshots: nock@13.2.7: dependencies: - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) json-stringify-safe: 5.0.1 lodash: 4.17.21 propagate: 2.0.1 @@ -35814,7 +36049,7 @@ snapshots: postcss: 8.4.47 ts-node: 10.9.2(@swc/core@1.3.42)(@types/node@20.8.8)(typescript@5.6.3) - postcss-load-config@3.1.4(postcss@8.4.47)(ts-node@10.9.2(@types/node@18.19.55)(typescript@5.6.3)): + postcss-load-config@3.1.4(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.6.3)): dependencies: lilconfig: 2.1.0 yaml: 1.10.2 @@ -36216,7 +36451,7 @@ snapshots: punycode@2.3.1: {} - puppeteer-core@19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10): + puppeteer-core@19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10): dependencies: '@puppeteer/browsers': 0.5.0(typescript@5.3.3) chromium-bidi: 0.4.7(devtools-protocol@0.0.1107588) @@ -36240,7 +36475,7 @@ snapshots: puppeteer-core@2.1.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): dependencies: '@types/mime-types': 2.1.4 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) extract-zip: 1.7.0 https-proxy-agent: 4.0.0 mime: 2.6.0 @@ -36254,14 +36489,14 @@ snapshots: - supports-color - utf-8-validate - puppeteer@19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10): + puppeteer@19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10): dependencies: '@puppeteer/browsers': 0.5.0(typescript@5.3.3) cosmiconfig: 8.1.3 https-proxy-agent: 5.0.1 progress: 2.0.3 proxy-from-env: 1.1.0 - puppeteer-core: 19.11.1(bufferutil@4.0.8)(encoding@0.1.13)(typescript@5.3.3)(utf-8-validate@5.0.10) + puppeteer-core: 19.11.1(bufferutil@4.0.8)(typescript@5.3.3)(utf-8-validate@5.0.10) transitivePeerDependencies: - bufferutil - encoding @@ -38195,7 +38430,7 @@ snapshots: socket.io-parser@4.2.4: dependencies: '@socket.io/component-emitter': 3.1.0 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -38204,7 +38439,7 @@ snapshots: accepts: 1.3.8 base64id: 2.0.0 cors: 2.8.5 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) engine.io: 6.5.4(bufferutil@4.0.8)(utf-8-validate@5.0.10) socket.io-adapter: 2.5.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) socket.io-parser: 4.2.4 @@ -38544,7 +38779,7 @@ snapshots: dependencies: component-emitter: 1.3.0 cookiejar: 2.1.3 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) fast-safe-stringify: 2.1.1 form-data: 4.0.0 formidable: 2.0.1 @@ -38649,7 +38884,7 @@ snapshots: transitivePeerDependencies: - ts-node - tailwindcss@2.2.19(autoprefixer@10.4.20(postcss@8.4.47))(postcss@8.4.47)(ts-node@10.9.2(@types/node@18.19.55)(typescript@5.6.3)): + tailwindcss@2.2.19(autoprefixer@10.4.20(postcss@8.4.47))(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.6.3)): dependencies: arg: 5.0.2 autoprefixer: 10.4.20(postcss@8.4.47) @@ -38675,7 +38910,7 @@ snapshots: object-hash: 2.2.0 postcss: 8.4.47 postcss-js: 3.0.3 - postcss-load-config: 3.1.4(postcss@8.4.47)(ts-node@10.9.2(@types/node@18.19.55)(typescript@5.6.3)) + postcss-load-config: 3.1.4(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.6.3)) postcss-nested: 5.0.6(postcss@8.4.47) postcss-selector-parser: 6.0.13 postcss-value-parser: 4.2.0 @@ -39206,7 +39441,7 @@ snapshots: wcwidth: 1.0.1 yargs: 17.7.1 - twin.macro@2.8.2(ts-node@10.9.2(@types/node@18.19.55)(typescript@5.6.3)): + twin.macro@2.8.2(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.6.3)): dependencies: '@babel/parser': 7.25.8 '@babel/template': 7.25.7 @@ -39221,7 +39456,7 @@ snapshots: lodash.merge: 4.6.2 postcss: 8.4.47 string-similarity: 4.0.4 - tailwindcss: 2.2.19(autoprefixer@10.4.20(postcss@8.4.47))(postcss@8.4.47)(ts-node@10.9.2(@types/node@18.19.55)(typescript@5.6.3)) + tailwindcss: 2.2.19(autoprefixer@10.4.20(postcss@8.4.47))(postcss@8.4.47)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.6.3)) timsort: 0.3.0 transitivePeerDependencies: - ts-node @@ -39661,7 +39896,7 @@ snapshots: vite-node@0.33.0(@types/node@18.19.55)(less@4.1.3)(sass@1.54.4)(terser@5.36.0): dependencies: cac: 6.7.14 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) mlly: 1.7.2 pathe: 1.1.1 picocolors: 1.0.0 @@ -39702,7 +39937,7 @@ snapshots: acorn-walk: 8.3.1 cac: 6.7.14 chai: 4.3.7 - debug: 4.3.7(supports-color@9.3.1) + debug: 4.3.7(supports-color@5.5.0) local-pkg: 0.4.3 magic-string: 0.30.12 pathe: 1.1.1 diff --git a/tests/integration/module/fixtures/build/decoratorStage3/__snapshots__/decorator.test.ts.snap b/tests/integration/module/fixtures/build/decoratorStage3/__snapshots__/decorator.test.ts.snap new file mode 100644 index 00000000000..3afe7aab5a5 --- /dev/null +++ b/tests/integration/module/fixtures/build/decoratorStage3/__snapshots__/decorator.test.ts.snap @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`decorator emitStage3Decorator 1`] = ` +""use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); +var __typeError = (msg) => { + throw TypeError(msg); +}; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var __decoratorStart = (base) => { + var _a; + return [, , , __create((_a = base == null ? void 0 : base[__knownSymbol("metadata")]) != null ? _a : null)]; +}; +var __decoratorStrings = ["class", "method", "getter", "setter", "accessor", "field", "value", "get", "set"]; +var __expectFn = (fn) => fn !== void 0 && typeof fn !== "function" ? __typeError("Function expected") : fn; +var __decoratorContext = (kind, name, done, metadata, fns) => ({ kind: __decoratorStrings[kind], name, metadata, addInitializer: (fn) => done._ ? __typeError("Already initialized") : fns.push(__expectFn(fn || null)) }); +var __decoratorMetadata = (array, target) => __defNormalProp(target, __knownSymbol("metadata"), array[3]); +var __runInitializers = (array, flags, self, value) => { + for (var i = 0, fns = array[flags >> 1], n = fns && fns.length; i < n; i++) flags & 1 ? fns[i].call(self) : value = fns[i].call(self, value); + return value; +}; +var __decorateElement = (array, flags, name, decorators, target, extra) => { + var fn, it, done, ctx, access, k = flags & 7, s = !!(flags & 8), p = !!(flags & 16); + var j = k > 3 ? array.length + 1 : k ? s ? 1 : 2 : 0, key = __decoratorStrings[k + 5]; + var initializers = k > 3 && (array[j - 1] = []), extraInitializers = array[j] || (array[j] = []); + var desc = k && (!p && !s && (target = target.prototype), k < 5 && (k > 3 || !p) && __getOwnPropDesc(k < 4 ? target : { get [name]() { + return __privateGet(this, extra); + }, set [name](x) { + return __privateSet(this, extra, x); + } }, name)); + k ? p && k < 4 && __name(extra, (k > 2 ? "set " : k > 1 ? "get " : "") + name) : __name(target, name); + for (var i = decorators.length - 1; i >= 0; i--) { + ctx = __decoratorContext(k, name, done = {}, array[3], extraInitializers); + if (k) { + ctx.static = s, ctx.private = p, access = ctx.access = { has: p ? (x) => __privateIn(target, x) : (x) => name in x }; + if (k ^ 3) access.get = p ? (x) => (k ^ 1 ? __privateGet : __privateMethod)(x, target, k ^ 4 ? extra : desc.get) : (x) => x[name]; + if (k > 2) access.set = p ? (x, y) => __privateSet(x, target, y, k ^ 4 ? extra : desc.set) : (x, y) => x[name] = y; + } + it = (0, decorators[i])(k ? k < 4 ? p ? extra : desc[key] : k > 4 ? void 0 : { get: desc.get, set: desc.set } : target, ctx), done._ = 1; + if (k ^ 4 || it === void 0) __expectFn(it) && (k > 4 ? initializers.unshift(it) : k ? p ? extra = it : desc[key] = it : target = it); + else if (typeof it !== "object" || it === null) __typeError("Object expected"); + else __expectFn(fn = it.get) && (desc.get = fn), __expectFn(fn = it.set) && (desc.set = fn), __expectFn(fn = it.init) && initializers.unshift(fn); + } + return k || __decoratorMetadata(array, target), desc && __defProp(target, name, desc), p ? k ^ 4 ? extra : desc : target; +}; +var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg); +var __privateIn = (member, obj) => Object(obj) !== obj ? __typeError('Cannot use the "in" operator on this value') : member.has(obj); +var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj)); +var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); +var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + Person: () => Person +}); +module.exports = __toCommonJS(src_exports); +function decoratedMethod(target, context) { + const methodName = String(context.name); + function replacementMethod(...args) { + const result = target.call(this, ...args); + return \`modern.js user \${result} is calling \${methodName}!\`; + } + return replacementMethod; +} +var _describe_dec, _init; +_describe_dec = [decoratedMethod]; +var Person = class { + constructor(name) { + __runInitializers(_init, 5, this); + this.name = void 0; + this.name = name; + } + describe() { + return this.name; + } +}; +_init = __decoratorStart(null); +__decorateElement(_init, 1, "describe", _describe_dec, Person); +__decoratorMetadata(_init, Person); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + Person +}); +" +`; diff --git a/tests/integration/module/fixtures/build/decoratorStage3/decorator.test.ts b/tests/integration/module/fixtures/build/decoratorStage3/decorator.test.ts new file mode 100644 index 00000000000..6d7b506c527 --- /dev/null +++ b/tests/integration/module/fixtures/build/decoratorStage3/decorator.test.ts @@ -0,0 +1,25 @@ +import path from 'path'; +import { fs } from '@modern-js/utils'; +import { initBeforeTest, runCli } from '../../utils'; + +initBeforeTest(); + +describe('decorator', () => { + const fixtureDir = __dirname; + it('emitStage3Decorator', async () => { + const configFile = path.join(fixtureDir, './modern.config.ts'); + const { success, error } = await runCli({ + argv: ['build'], + configFile, + appDirectory: fixtureDir, + }); + console.log(error); + expect(success).toBeTruthy(); + const distFilePath = path.join(fixtureDir, 'dist/main.js'); + const content = await fs.readFile(distFilePath, 'utf-8'); + expect(content).toMatchSnapshot(); + const { Person } = await import(distFilePath); + const p = new Person('David'); + expect(p.describe()).toBe('modern.js user David is calling describe!'); + }); +}); diff --git a/tests/integration/module/fixtures/build/decoratorStage3/modern.config.ts b/tests/integration/module/fixtures/build/decoratorStage3/modern.config.ts new file mode 100644 index 00000000000..ba2f3abdba8 --- /dev/null +++ b/tests/integration/module/fixtures/build/decoratorStage3/modern.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from '@modern-js/module-tools/defineConfig'; + +export default defineConfig({ + buildConfig: { + buildType: 'bundle', + input: { + main: './src/index.ts', + }, + tsconfig: './tsconfig.json', + }, +}); diff --git a/tests/integration/module/fixtures/build/decoratorStage3/package.json b/tests/integration/module/fixtures/build/decoratorStage3/package.json new file mode 100644 index 00000000000..817594ff937 --- /dev/null +++ b/tests/integration/module/fixtures/build/decoratorStage3/package.json @@ -0,0 +1,5 @@ +{ + "name": "decorator-stage-3-test", + "version": "1.0.0", + "private": true +} diff --git a/tests/integration/module/fixtures/build/decoratorStage3/src/index.ts b/tests/integration/module/fixtures/build/decoratorStage3/src/index.ts new file mode 100644 index 00000000000..a7f8ba1b075 --- /dev/null +++ b/tests/integration/module/fixtures/build/decoratorStage3/src/index.ts @@ -0,0 +1,28 @@ +function decoratedMethod( + target: (this: This, ...args: Args) => string, + context: ClassMethodDecoratorContext< + This, + (this: This, ...args: Args) => string + >, +) { + const methodName = String(context.name); + + function replacementMethod(this: This, ...args: Args): string { + const result = target.call(this, ...args); + return `modern.js user ${result} is calling ${methodName}!`; + } + + return replacementMethod; +} + +export class Person { + name: string; + constructor(name: string) { + this.name = name; + } + + @decoratedMethod + describe() { + return this.name; + } +} diff --git a/tests/integration/module/fixtures/build/decoratorStage3/tsconfig.json b/tests/integration/module/fixtures/build/decoratorStage3/tsconfig.json new file mode 100644 index 00000000000..d01296c6dce --- /dev/null +++ b/tests/integration/module/fixtures/build/decoratorStage3/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "@modern-js/tsconfig/base", + "compilerOptions": { + "baseUrl": "./", + "experimentalDecorators": false + }, + "include": ["src"] +}