From 1b252264869c6565da04f0e3cb523f3faa47d56a Mon Sep 17 00:00:00 2001 From: Francis Nimick Date: Tue, 6 Aug 2024 03:28:33 -0400 Subject: [PATCH] fix: Better support for `.vue`. and `.svelte` files using `jscodeshift-adapters` (#71) --- package.json | 1 + pnpm-lock.yaml | 965 ++++++++++-------- src/index.js | 2 +- .../addMigrationComments/transform.cjs | 153 ++- src/transformers/configureScope/transform.cjs | 249 +++-- src/transformers/convertEnums/transform.cjs | 102 +- src/transformers/hub/transform.cjs | 154 ++- src/transformers/integrations/transform.cjs | 422 ++++---- .../nextjsWrapperMethods/transform.cjs | 22 +- src/transformers/nodeExports/transform.cjs | 272 ++--- .../nodeInstrumentFile/transform.cjs | 161 +-- src/transformers/replayConfig/transform.cjs | 276 ++--- .../rewriteHubImports/transform.cjs | 142 +-- .../rewriteIntegrationsImports/transform.cjs | 32 +- .../rewriteReplayImports/transform.cjs | 32 +- .../rewriteSvelteConfig/transform.cjs | 10 +- .../rewriteTracingImports/transform.cjs | 30 +- src/transformers/tracingConfig/transform.cjs | 54 +- src/transformers/utilExports/transform.cjs | 116 +-- src/utils/dom.cjs | 66 -- 20 files changed, 1652 insertions(+), 1609 deletions(-) delete mode 100644 src/utils/dom.cjs diff --git a/package.json b/package.json index ee240b9..3db5875 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "chalk": "^5.3.0", "globby": "^14.0.1", "jscodeshift": "^0.15.2", + "jscodeshift-adapters": "1.0.2", "node-html-parser": "^6.1.13", "semver": "^7.6.0", "yargs": "^17.7.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f09072..ad77490 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,6 +23,9 @@ importers: jscodeshift: specifier: ^0.15.2 version: 0.15.2 + jscodeshift-adapters: + specifier: 1.0.2 + version: 1.0.2(jscodeshift@0.15.2) node-html-parser: specifier: ^6.1.13 version: 6.1.13 @@ -77,138 +80,121 @@ packages: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} - '@babel/code-frame@7.22.13': - resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + '@babel/code-frame@7.24.7': + resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} - '@babel/code-frame@7.24.2': - resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} + '@babel/compat-data@7.24.9': + resolution: {integrity: sha512-e701mcfApCJqMMueQI0Fb68Amflj83+dvAvHawoBpAz+GDjCIyGHzNwnefjsWJ3xiYAqqiQFoWbspGYBdb2/ng==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.24.4': - resolution: {integrity: sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==} + '@babel/core@7.24.9': + resolution: {integrity: sha512-5e3FI4Q3M3Pbr21+5xJwCv6ZT6KmGkI0vw3Tozy5ODAQFTIWe37iT8Cr7Ice2Ntb+M3iSKCEWMB1MBgKrW3whg==} engines: {node: '>=6.9.0'} - '@babel/core@7.24.4': - resolution: {integrity: sha512-MBVlMXP+kkl5394RBLSxxk/iLTeVGuXTV3cIDXavPpMMqnSnt6apKgan/U8O3USWZCWZT/TbgfEpKa4uMgN4Dg==} + '@babel/generator@7.24.10': + resolution: {integrity: sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg==} engines: {node: '>=6.9.0'} - '@babel/generator@7.24.4': - resolution: {integrity: sha512-Xd6+v6SnjWVx/nus+y0l1sxMOTOMBkyL4+BIdbALyatQnAe/SRVjANeDPSCYaX+i1iJmuGSKf3Z+E+V/va1Hvw==} + '@babel/helper-annotate-as-pure@7.24.7': + resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.22.5': - resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} + '@babel/helper-compilation-targets@7.24.8': + resolution: {integrity: sha512-oU+UoqCHdp+nWVDkpldqIQL/i/bvAv53tRqLG/s+cOXxe66zOYLU7ar/Xs3LdmBihrUMEUhwu6dMZwbNOYDwvw==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.23.6': - resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} - engines: {node: '>=6.9.0'} - - '@babel/helper-create-class-features-plugin@7.24.4': - resolution: {integrity: sha512-lG75yeuUSVu0pIcbhiYMXBXANHrpUPaOfu7ryAzskCgKUHuAxRQI5ssrtmF0X9UXldPlvT0XM/A4F44OXRt6iQ==} + '@babel/helper-create-class-features-plugin@7.24.8': + resolution: {integrity: sha512-4f6Oqnmyp2PP3olgUMmOwC3akxSm5aBYraQ6YDdKy7NcAMkDECHWG0DEnV6M2UAkERgIBhYt8S27rURPg7SxWA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-environment-visitor@7.22.20': - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + '@babel/helper-environment-visitor@7.24.7': + resolution: {integrity: sha512-DoiN84+4Gnd0ncbBOM9AZENV4a5ZiL39HYMyZJGZ/AZEykHYdJw0wW3kdcsh9/Kn+BRXHLkkklZ51ecPKmI1CQ==} engines: {node: '>=6.9.0'} - '@babel/helper-function-name@7.23.0': - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} + '@babel/helper-function-name@7.24.7': + resolution: {integrity: sha512-FyoJTsj/PEUWu1/TYRiXTIHc8lbw+TDYkZuoE43opPS5TrI7MyONBE1oNvfguEXAD9yhQRrVBnXdXzSLQl9XnA==} engines: {node: '>=6.9.0'} - '@babel/helper-hoist-variables@7.22.5': - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} + '@babel/helper-hoist-variables@7.24.7': + resolution: {integrity: sha512-MJJwhkoGy5c4ehfoRyrJ/owKeMl19U54h27YYftT0o2teQ3FJ3nQUf/I3LlJsX4l3qlw7WRXUmiyajvHXoTubQ==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.23.0': - resolution: {integrity: sha512-6gfrPwh7OuT6gZyJZvd6WbTfrqAo7vm4xCzAXOusKqq/vWdKXphTpj5klHKNmRUU6/QRGlBsyU9mAIPaWHlqJA==} + '@babel/helper-member-expression-to-functions@7.24.8': + resolution: {integrity: sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.24.3': - resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} + '@babel/helper-module-imports@7.24.7': + resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.23.3': - resolution: {integrity: sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==} + '@babel/helper-module-transforms@7.24.9': + resolution: {integrity: sha512-oYbh+rtFKj/HwBQkFlUzvcybzklmVdVV3UU+mN7n2t/q3yGHbuVdNxyFvSBO1tfvjyArpHNcWMAzsSPdyI46hw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.22.5': - resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} + '@babel/helper-optimise-call-expression@7.24.7': + resolution: {integrity: sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.24.0': - resolution: {integrity: sha512-9cUznXMG0+FxRuJfvL82QlTqIzhVW9sL0KjMPHhAOOvpQGL8QtdxnBKILjBqxlHyliz0yCa1G903ZXI/FuHy2w==} + '@babel/helper-plugin-utils@7.24.8': + resolution: {integrity: sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==} engines: {node: '>=6.9.0'} - '@babel/helper-replace-supers@7.24.1': - resolution: {integrity: sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==} + '@babel/helper-replace-supers@7.24.7': + resolution: {integrity: sha512-qTAxxBM81VEyoAY0TtLrx1oAEJc09ZK67Q9ljQToqCnA+55eNwCORaxlKyu+rNfX86o8OXRUSNUnrtsAZXM9sg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.22.5': - resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} - engines: {node: '>=6.9.0'} - - '@babel/helper-skip-transparent-expression-wrappers@7.22.5': - resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} + '@babel/helper-simple-access@7.24.7': + resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} engines: {node: '>=6.9.0'} - '@babel/helper-split-export-declaration@7.22.6': - resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} + '@babel/helper-skip-transparent-expression-wrappers@7.24.7': + resolution: {integrity: sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.22.5': - resolution: {integrity: sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==} + '@babel/helper-split-export-declaration@7.24.7': + resolution: {integrity: sha512-oy5V7pD+UvfkEATUKvIjvIAH/xCzfsFVw7ygW2SI6NClZzquT+mwdTfgfdbUiceh6iQO0CHtCPsyze/MZ2YbAA==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.24.1': - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} + '@babel/helper-string-parser@7.24.8': + resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.22.20': - resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} + '@babel/helper-validator-identifier@7.24.7': + resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.23.5': - resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} + '@babel/helper-validator-option@7.24.8': + resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.24.4': - resolution: {integrity: sha512-FewdlZbSiwaVGlgT1DPANDuCHaDMiOo+D/IDYRFYjHOuv66xMSJ7fQwwODwRNAPkADIO/z1EoF/l2BCWlWABDw==} + '@babel/helpers@7.24.8': + resolution: {integrity: sha512-gV2265Nkcz7weJJfvDoAEVzC1e2OTDpkGbEsebse8koXUJUXPsCMi7sRo/+SPMuMZ9MtUPnGwITTnQnU5YjyaQ==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.22.20': - resolution: {integrity: sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==} + '@babel/highlight@7.24.7': + resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.2': - resolution: {integrity: sha512-Yac1ao4flkTxTteCDZLEvdxg2fZfz1v8M4QpaGypq/WPDqg3ijHYbDfs+LG5hvzSoqaSZ9/Z9lKSP3CjZjv+pA==} - engines: {node: '>=6.9.0'} - - '@babel/parser@7.23.0': - resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} - engines: {node: '>=6.0.0'} - hasBin: true - - '@babel/parser@7.24.4': - resolution: {integrity: sha512-zTvEBcghmeBma9QIGunWevvBAp4/Qu9Bdq+2k0Ot4fVMD6v3dsC9WOcRSKk7tRRyBM/53yKMJko9xOatGQAwSg==} + '@babel/parser@7.24.8': + resolution: {integrity: sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/plugin-syntax-flow@7.24.1': - resolution: {integrity: sha512-sxi2kLTI5DeW5vDtMUsk4mTPwvlUDbjOnoWayhynCwrw4QXRld4QEYwqzY8JmQXaJUtgUuCIurtSRH5sn4c7mA==} + '@babel/plugin-syntax-flow@7.24.7': + resolution: {integrity: sha512-9G8GYT/dxn/D1IIKOUBmGX0mnmj46mGH9NnZyJLwtCpgh5f7D2VbuKodb+2s9m1Yavh1s7ASQN8lf0eqrb1LTw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.24.1': - resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} + '@babel/plugin-syntax-jsx@7.24.7': + resolution: {integrity: sha512-6ddciUPe/mpMnOKv/U+RSd2vvVy+Yw/JfBB0ZHYjEZt9NLHmCUylNYlsbqCCS1Bffjlb0fCwC9Vqz+sBz6PsiQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -223,90 +209,82 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.24.1': - resolution: {integrity: sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==} + '@babel/plugin-syntax-typescript@7.24.7': + resolution: {integrity: sha512-c/+fVeJBB0FeKsFvwytYiUD+LBvhHjGSI0g446PRGdSVGZLRNArBUno2PETbAly3tpiNAQR5XaZ+JslxkotsbA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-class-properties@7.24.1': - resolution: {integrity: sha512-OMLCXi0NqvJfORTaPQBwqLXHhb93wkBKZ4aNwMl6WtehO7ar+cmp+89iPEQPqxAnxsOKTaMcs3POz3rKayJ72g==} + '@babel/plugin-transform-class-properties@7.24.7': + resolution: {integrity: sha512-vKbfawVYayKcSeSR5YYzzyXvsDFWU2mD8U5TFeXtbCPLFUqe7GyCgvO6XDHzje862ODrOwy6WCPmKeWHbCFJ4w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-flow-strip-types@7.24.1': - resolution: {integrity: sha512-iIYPIWt3dUmUKKE10s3W+jsQ3icFkw0JyRVyY1B7G4yK/nngAOHLVx8xlhA6b/Jzl/Y0nis8gjqhqKtRDQqHWQ==} + '@babel/plugin-transform-flow-strip-types@7.24.7': + resolution: {integrity: sha512-cjRKJ7FobOH2eakx7Ja+KpJRj8+y+/SiB3ooYm/n2UJfxu0oEaOoxOinitkJcPqv9KxS0kxTGPUaR7L2XcXDXA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@7.24.1': - resolution: {integrity: sha512-szog8fFTUxBfw0b98gEWPaEqF42ZUD/T3bkynW/wtgx2p/XCP55WEsb+VosKceRSd6njipdZvNogqdtI4Q0chw==} + '@babel/plugin-transform-modules-commonjs@7.24.8': + resolution: {integrity: sha512-WHsk9H8XxRs3JXKWFiqtQebdh9b/pTk4EgueygFzYlTKAg0Ud985mSevdNjdXdFBATSKVJGQXP1tv6aGbssLKA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-nullish-coalescing-operator@7.24.1': - resolution: {integrity: sha512-iQ+caew8wRrhCikO5DrUYx0mrmdhkaELgFa+7baMcVuhxIkN7oxt06CZ51D65ugIb1UWRQ8oQe+HXAVM6qHFjw==} + '@babel/plugin-transform-nullish-coalescing-operator@7.24.7': + resolution: {integrity: sha512-Ts7xQVk1OEocqzm8rHMXHlxvsfZ0cEF2yomUqpKENHWMF4zKk175Y4q8H5knJes6PgYad50uuRmt3UJuhBw8pQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-optional-chaining@7.24.1': - resolution: {integrity: sha512-n03wmDt+987qXwAgcBlnUUivrZBPZ8z1plL0YvgQalLm+ZE5BMhGm94jhxXtA1wzv1Cu2aaOv1BM9vbVttrzSg==} + '@babel/plugin-transform-optional-chaining@7.24.8': + resolution: {integrity: sha512-5cTOLSMs9eypEy8JUVvIKOu6NgvbJMnpG62VpIHrTmROdQ+L5mDAaI40g25k5vXti55JWNX5jCkq3HZxXBQANw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-private-methods@7.24.1': - resolution: {integrity: sha512-tGvisebwBO5em4PaYNqt4fkw56K2VALsAbAakY0FjTYqJp7gfdrgr7YX76Or8/cpik0W6+tj3rZ0uHU9Oil4tw==} + '@babel/plugin-transform-private-methods@7.24.7': + resolution: {integrity: sha512-COTCOkG2hn4JKGEKBADkA8WNb35TGkkRbI5iT845dB+NyqgO8Hn+ajPbSnIQznneJTa3d30scb6iz/DhH8GsJQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.24.4': - resolution: {integrity: sha512-79t3CQ8+oBGk/80SQ8MN3Bs3obf83zJ0YZjDmDaEZN8MqhMI760apl5z6a20kFeMXBwJX99VpKT8CKxEBp5H1g==} + '@babel/plugin-transform-typescript@7.24.8': + resolution: {integrity: sha512-CgFgtN61BbdOGCP4fLaAMOPkzWUh6yQZNMr5YSt8uz2cZSSiQONCQFWqsE4NeVfOIhqDOlS9CR3WD91FzMeB2Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/preset-flow@7.24.1': - resolution: {integrity: sha512-sWCV2G9pcqZf+JHyv/RyqEIpFypxdCSxWIxQjpdaQxenNog7cN1pr76hg8u0Fz8Qgg0H4ETkGcJnXL8d4j0PPA==} + '@babel/preset-flow@7.24.7': + resolution: {integrity: sha512-NL3Lo0NorCU607zU3NwRyJbpaB6E3t0xtd3LfAQKDfkeX4/ggcDXvkmkW42QWT5owUeW/jAe4hn+2qvkV1IbfQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/preset-typescript@7.24.1': - resolution: {integrity: sha512-1DBaMmRDpuYQBPWD8Pf/WEwCrtgRHxsZnP4mIy9G/X+hFfbI47Q2G4t1Paakld84+qsk2fSsUPMKg71jkoOOaQ==} + '@babel/preset-typescript@7.24.7': + resolution: {integrity: sha512-SyXRe3OdWwIwalxDg5UtJnJQO+YPcTfwiIY2B0Xlddh9o7jpWLvv8X1RthIeDOxQ+O1ML5BLPCONToObyVQVuQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/register@7.23.7': - resolution: {integrity: sha512-EjJeB6+kvpk+Y5DAkEAmbOBEFkh9OASx0huoEkqYTFxAZHzOAX2Oh5uwAUuL2rUddqfM0SA+KPXV2TbzoZ2kvQ==} + '@babel/register@7.24.6': + resolution: {integrity: sha512-WSuFCc2wCqMeXkz/i3yfAAsxwWflEgbVkZzivgAmXl/MxrXeoYFZOOPllbC8R8WTF7u61wSRQtDVZ1879cdu6w==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/template@7.22.15': - resolution: {integrity: sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==} - engines: {node: '>=6.9.0'} - - '@babel/template@7.24.0': - resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} + '@babel/template@7.24.7': + resolution: {integrity: sha512-jYqfPrU9JTF0PmPy1tLYHW4Mp4KlgxJD9l2nP9fD6yT/ICi554DmrWBAEYpIelzjHf1msDP3PxJIRt/nFNfBig==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.24.1': - resolution: {integrity: sha512-xuU6o9m68KeqZbQuDt2TcKSxUw/mrsvavlEqQ1leZ/B+C9tk6E4sRWy97WaXgvq5E+nU3cXMxv3WKOCanVMCmQ==} + '@babel/traverse@7.24.8': + resolution: {integrity: sha512-t0P1xxAPzEDcEPmjprAQq19NWum4K0EQPjMwZQZbHt+GiZqvjCHjj755Weq1YRPVzBI+3zSfvScfpnuIecVFJQ==} engines: {node: '>=6.9.0'} - '@babel/types@7.23.0': - resolution: {integrity: sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==} - engines: {node: '>=6.9.0'} - - '@babel/types@7.24.0': - resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} + '@babel/types@7.24.9': + resolution: {integrity: sha512-xm8XrMKz0IlUdocVbYJe0Z9xEgidU7msskG8BbhnTPK/HZ2z/7FP7ykqPgrUH+C+r414mNfNWam1f2vqOjqjYQ==} engines: {node: '>=6.9.0'} '@clack/core@0.3.3': @@ -488,10 +466,6 @@ packages: resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - '@jridgewell/gen-mapping@0.3.3': - resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} - engines: {node: '>=6.0.0'} - '@jridgewell/gen-mapping@0.3.5': resolution: {integrity: sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg==} engines: {node: '>=6.0.0'} @@ -500,10 +474,6 @@ packages: resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} - '@jridgewell/set-array@1.1.2': - resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} - engines: {node: '>=6.0.0'} - '@jridgewell/set-array@1.2.1': resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} engines: {node: '>=6.0.0'} @@ -511,9 +481,6 @@ packages: '@jridgewell/sourcemap-codec@1.4.15': resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} - '@jridgewell/trace-mapping@0.3.19': - resolution: {integrity: sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==} - '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} @@ -768,6 +735,21 @@ packages: '@vitest/utils@1.6.0': resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} + '@vue/compiler-core@3.4.34': + resolution: {integrity: sha512-Z0izUf32+wAnQewjHu+pQf1yw00EGOmevl1kE+ljjjMe7oEfpQ+BI3/JNK7yMB4IrUsqLDmPecUrpj3mCP+yJQ==} + + '@vue/compiler-dom@3.4.34': + resolution: {integrity: sha512-3PUOTS1h5cskdOJMExCu2TInXuM0j60DRPpSCJDqOCupCfUZCJoyQmKtRmA8EgDNZ5kcEE7vketamRZfrEuVDw==} + + '@vue/compiler-sfc@3.4.34': + resolution: {integrity: sha512-x6lm0UrM03jjDXTPZgD9Ad8bIVD1ifWNit2EaWQIZB5CULr46+FbLQ5RpK7AXtDHGjx9rmvC7QRCTjsiGkAwRw==} + + '@vue/compiler-ssr@3.4.34': + resolution: {integrity: sha512-8TDBcLaTrFm5rnF+Qm4BlliaopJgqJ28Nsrc80qazynm5aJO+Emu7y0RWw34L8dNnTRdcVBpWzJxhGYzsoVu4g==} + + '@vue/shared@3.4.34': + resolution: {integrity: sha512-x5LmiRLpRsd9KTjAB8MPKf0CDPMcuItjP0gbNqFCIgL1I8iYp4zglhj9w9FPCdIbHG2M91RVeIbArFfFTz9I3A==} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -817,6 +799,9 @@ packages: argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} + aria-query@5.3.0: + resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} @@ -852,9 +837,6 @@ packages: resolution: {integrity: sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==} engines: {node: '>= 0.4'} - assert@2.0.0: - resolution: {integrity: sha512-se5Cd+js9dXJnu6Ag2JFc00t+HmHOen+8Q+L7O9zI0PqQXr20uk2J0XQqMxZEeo5U50o8Nvmmx7dZrl+Ufr35A==} - assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} @@ -870,6 +852,10 @@ packages: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} + axobject-query@4.1.0: + resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} + engines: {node: '>= 0.4'} + babel-core@7.0.0-bridge.0: resolution: {integrity: sha512-poPX9mZH/5CSanm50Q+1toVci6pv5KSRv/5TWCwtzQS5XEwn40BcCrgIeMFWP9CKKIniKXNxoIOnOq4VVlGXhg==} peerDependencies: @@ -888,8 +874,12 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} - browserslist@4.23.0: - resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.23.2: + resolution: {integrity: sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -907,8 +897,8 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - caniuse-lite@1.0.30001612: - resolution: {integrity: sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==} + caniuse-lite@1.0.30001643: + resolution: {integrity: sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==} chai@4.4.1: resolution: {integrity: sha512-13sOfMv2+DWduEU+/xbun3LScLoqN17nBeTLUsmDfKdoiC1fr0n9PU4guu4AhRcOVFk/sW8LyZWHuhWtQZiF+g==} @@ -944,6 +934,9 @@ packages: resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} engines: {node: '>=6'} + code-red@1.0.4: + resolution: {integrity: sha512-7qJWqItLA8/VPVlKJlFXU+NBlo/qyfs39aJcuMT/2ere32ZqvF5OSxgdM5xOfJJ7O429gg2HM47y8v9P+9wrNw==} + color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} @@ -980,6 +973,10 @@ packages: css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} + css-tree@2.3.1: + resolution: {integrity: sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==} + engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0} + css-what@6.1.0: resolution: {integrity: sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==} engines: {node: '>= 6'} @@ -1012,6 +1009,10 @@ packages: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} + dequal@2.0.3: + resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} + engines: {node: '>=6'} + diff-sequences@29.6.3: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -1052,8 +1053,8 @@ packages: resolution: {integrity: sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - electron-to-chromium@1.4.748: - resolution: {integrity: sha512-VWqjOlPZn70UZ8FTKUOkUvBLeTQ0xpty66qV0yJcAGY2/CthI4xyW9aEozRVtuwv3Kpf5xTesmJUcPwuJmgP4A==} + electron-to-chromium@1.5.1: + resolution: {integrity: sha512-FKbOCOQ5QRB3VlIbl1LZQefWIYwszlBloaXcY2rbfpu9ioJnNh3TK03YtIDKDo3WKBi8u+YV4+Fn2CkEozgf4w==} emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} @@ -1080,9 +1081,6 @@ packages: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} - es6-object-assign@1.1.0: - resolution: {integrity: sha512-MEl9uirslVwqQU369iHNWZXsI8yaZYGg/D65aOgZkeyFJwHYSxilf7rQzXKI7DdDuBPrBXbfk3sl9hJhmd5AUw==} - esbuild@0.20.2: resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==} engines: {node: '>=12'} @@ -1092,6 +1090,10 @@ packages: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} + escalade@3.1.2: + resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} + engines: {node: '>=6'} + escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} @@ -1216,6 +1218,9 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} @@ -1263,6 +1268,10 @@ packages: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + find-cache-dir@2.1.0: resolution: {integrity: sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==} engines: {node: '>=6'} @@ -1459,10 +1468,6 @@ packages: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} - is-arguments@1.1.1: - resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} - engines: {node: '>= 0.4'} - is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} @@ -1492,18 +1497,10 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-generator-function@1.0.10: - resolution: {integrity: sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==} - engines: {node: '>= 0.4'} - is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-nan@1.3.2: - resolution: {integrity: sha512-E+zBKpQ2t6MEo1VsonYmluk9NxGrbzpeeLC2xIViuO2EjU2xsXsBPwTr3Ykv9l08UYEVEdWeRZNouaZqF6RN0w==} - engines: {node: '>= 0.4'} - is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -1528,6 +1525,9 @@ packages: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} + is-reference@3.0.2: + resolution: {integrity: sha512-v3rht/LgVcsdZa3O2Nqs+NMowLOxeOm7Ay9+/ARQ2F+qEoANRcqrjAZKGN0v8ymUetZGgkp26LTnGT7H0Qo9Pg==} + is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -1578,6 +1578,11 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true + jscodeshift-adapters@1.0.2: + resolution: {integrity: sha512-2UXzcL7MAfGaQoUhyRNE6dXW+OAwLVyHYLyEfXmFemfs2IIR9GUXnPDEpWzh3stSv1M9IeQMRd1Xtdx06jXT3A==} + peerDependencies: + jscodeshift: ^0.15.0 || ^0.16.0 + jscodeshift@0.15.2: resolution: {integrity: sha512-FquR7Okgmc4Sd0aEDwqho3rEiKR3BdvuG9jfdHjLJ6JQoWSMpavug3AoIfnfWhxFlf+5pzQh8qjqz0DWFrNQzA==} hasBin: true @@ -1630,6 +1635,9 @@ packages: localforage@1.10.0: resolution: {integrity: sha512-14/H1aX7hzBBmmh7sGPd+AOMkkIrHM3Z1PAyGgZigA1H1p5O5ANnMyWzvpAETtG68/dC4pC0ncy3+PPGzXZHPg==} + locate-character@3.0.0: + resolution: {integrity: sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==} + locate-path@3.0.0: resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} engines: {node: '>=6'} @@ -1664,6 +1672,9 @@ packages: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} engines: {node: '>=6'} + mdn-data@2.0.30: + resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -1675,6 +1686,10 @@ packages: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} + micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} + engines: {node: '>=8.6'} + mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -1744,10 +1759,6 @@ packages: object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} - object-is@1.1.5: - resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} - engines: {node: '>= 0.4'} - object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -1875,9 +1886,15 @@ packages: pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + periscopic@3.1.0: + resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} + picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + picocolors@1.0.1: + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -1917,6 +1934,10 @@ packages: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} + postcss@8.4.40: + resolution: {integrity: sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==} + engines: {node: ^10 || ^12 || >=14} + prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} engines: {node: '>= 0.8.0'} @@ -1940,6 +1961,9 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + rambda@9.2.1: + resolution: {integrity: sha512-6Dp+QQVQuAuhwBlbIvL2FjJVHCKF29W+n9ca/BMTVDqpj+Q7KKqUh7UAINEna8aaB2/oRvPuL5hViCTQARa70Q==} + react-is@18.3.1: resolution: {integrity: sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==} @@ -1947,8 +1971,8 @@ packages: resolution: {integrity: sha512-E5qICoPoNL4yU0H0NoBDntNB0Q5oMSNh9usFctYniLBluTthi3RsQVBXIJNbApOlvSwW/RGxIuokPcAc59J5fQ==} engines: {node: '>= 4'} - recast@0.23.4: - resolution: {integrity: sha512-qtEDqIZGVcSZCHniWwZWbRy79Dc6Wp3kT/UmDA2RJKBPg7+7k51aQBZirHmUGn5uvHf2rg8DkjizrN26k61ATw==} + recast@0.23.9: + resolution: {integrity: sha512-Hx/BGIbwj+Des3+xy5uAtAbdCyqK9y9wbBcDFDYanLS9JnMqf7OeF87HQwUimE87OEc72mr6tkKUKMBBL+hF9Q==} engines: {node: '>= 4'} regexp.prototype.flags@1.5.0: @@ -1981,6 +2005,7 @@ packages: rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rimraf@3.0.2: @@ -2134,6 +2159,10 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + svelte@4.2.18: + resolution: {integrity: sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==} + engines: {node: '>=16'} + temp@0.8.4: resolution: {integrity: sha512-s0ZZzd0BzYv5tLSptZooSjK8oj6C+c19p7Vqta9+6NPOf7r+fxq0cJe6/oN4LTC79sy5NY8ucOJNgwsKCSbfqg==} engines: {node: '>=6.0.0'} @@ -2144,6 +2173,9 @@ packages: throwback@4.1.0: resolution: {integrity: sha512-dLFe8bU8SeH0xeqeKL7BNo8XoPC/o91nz9/ooeplZPiso+DZukhoyZcSz9TFnUNScm+cA9qjU1m1853M6sPOng==} + tiny-invariant@1.3.3: + resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} + tinybench@2.8.0: resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} @@ -2228,8 +2260,8 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - update-browserslist-db@1.0.13: - resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} + update-browserslist-db@1.1.0: + resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -2241,9 +2273,6 @@ packages: resolution: {integrity: sha512-KMWqdlOcjCYdtIJpicDSFBQ8nFwS2i9sslAd6f4+CBGcU4gist2REnr2fxj2YocvJFxSF3ZOHLYLVZnUxv4BZQ==} engines: {node: '>=0.10.0'} - util@0.12.5: - resolution: {integrity: sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==} - uuid@8.3.2: resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} hasBin: true @@ -2373,33 +2402,28 @@ snapshots: '@ampproject/remapping@2.2.1': dependencies: - '@jridgewell/gen-mapping': 0.3.3 - '@jridgewell/trace-mapping': 0.3.19 - - '@babel/code-frame@7.22.13': - dependencies: - '@babel/highlight': 7.22.20 - chalk: 2.4.2 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 - '@babel/code-frame@7.24.2': + '@babel/code-frame@7.24.7': dependencies: - '@babel/highlight': 7.24.2 - picocolors: 1.0.0 + '@babel/highlight': 7.24.7 + picocolors: 1.0.1 - '@babel/compat-data@7.24.4': {} + '@babel/compat-data@7.24.9': {} - '@babel/core@7.24.4': + '@babel/core@7.24.9': dependencies: '@ampproject/remapping': 2.2.1 - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.4 - '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helpers': 7.24.4 - '@babel/parser': 7.24.4 - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1 - '@babel/types': 7.24.0 + '@babel/code-frame': 7.24.7 + '@babel/generator': 7.24.10 + '@babel/helper-compilation-targets': 7.24.8 + '@babel/helper-module-transforms': 7.24.9(@babel/core@7.24.9) + '@babel/helpers': 7.24.8 + '@babel/parser': 7.24.8 + '@babel/template': 7.24.7 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -2408,261 +2432,266 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/generator@7.24.4': + '@babel/generator@7.24.10': dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.9 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 - '@babel/helper-annotate-as-pure@7.22.5': + '@babel/helper-annotate-as-pure@7.24.7': dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.24.9 - '@babel/helper-compilation-targets@7.23.6': + '@babel/helper-compilation-targets@7.24.8': dependencies: - '@babel/compat-data': 7.24.4 - '@babel/helper-validator-option': 7.23.5 - browserslist: 4.23.0 + '@babel/compat-data': 7.24.9 + '@babel/helper-validator-option': 7.24.8 + browserslist: 4.23.2 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.24.4(@babel/core@7.24.4)': - dependencies: - '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-member-expression-to-functions': 7.23.0 - '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.4) - '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 + '@babel/helper-create-class-features-plugin@7.24.8(@babel/core@7.24.9)': + dependencies: + '@babel/core': 7.24.9 + '@babel/helper-annotate-as-pure': 7.24.7 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-member-expression-to-functions': 7.24.8 + '@babel/helper-optimise-call-expression': 7.24.7 + '@babel/helper-replace-supers': 7.24.7(@babel/core@7.24.9) + '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 semver: 6.3.1 + transitivePeerDependencies: + - supports-color - '@babel/helper-environment-visitor@7.22.20': {} + '@babel/helper-environment-visitor@7.24.7': + dependencies: + '@babel/types': 7.24.9 - '@babel/helper-function-name@7.23.0': + '@babel/helper-function-name@7.24.7': dependencies: - '@babel/template': 7.22.15 - '@babel/types': 7.23.0 + '@babel/template': 7.24.7 + '@babel/types': 7.24.9 - '@babel/helper-hoist-variables@7.22.5': + '@babel/helper-hoist-variables@7.24.7': dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.9 - '@babel/helper-member-expression-to-functions@7.23.0': + '@babel/helper-member-expression-to-functions@7.24.8': dependencies: - '@babel/types': 7.23.0 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 + transitivePeerDependencies: + - supports-color - '@babel/helper-module-imports@7.24.3': + '@babel/helper-module-imports@7.24.7': dependencies: - '@babel/types': 7.24.0 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 + transitivePeerDependencies: + - supports-color - '@babel/helper-module-transforms@7.23.3(@babel/core@7.24.4)': + '@babel/helper-module-transforms@7.24.9(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.3 - '@babel/helper-simple-access': 7.22.5 - '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/core': 7.24.9 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-module-imports': 7.24.7 + '@babel/helper-simple-access': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 + '@babel/helper-validator-identifier': 7.24.7 + transitivePeerDependencies: + - supports-color - '@babel/helper-optimise-call-expression@7.22.5': + '@babel/helper-optimise-call-expression@7.24.7': dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.24.9 - '@babel/helper-plugin-utils@7.24.0': {} + '@babel/helper-plugin-utils@7.24.8': {} - '@babel/helper-replace-supers@7.24.1(@babel/core@7.24.4)': + '@babel/helper-replace-supers@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-member-expression-to-functions': 7.23.0 - '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/core': 7.24.9 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-member-expression-to-functions': 7.24.8 + '@babel/helper-optimise-call-expression': 7.24.7 + transitivePeerDependencies: + - supports-color - '@babel/helper-simple-access@7.22.5': + '@babel/helper-simple-access@7.24.7': dependencies: - '@babel/types': 7.23.0 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 + transitivePeerDependencies: + - supports-color - '@babel/helper-skip-transparent-expression-wrappers@7.22.5': + '@babel/helper-skip-transparent-expression-wrappers@7.24.7': dependencies: - '@babel/types': 7.23.0 + '@babel/traverse': 7.24.8 + '@babel/types': 7.24.9 + transitivePeerDependencies: + - supports-color - '@babel/helper-split-export-declaration@7.22.6': + '@babel/helper-split-export-declaration@7.24.7': dependencies: - '@babel/types': 7.23.0 + '@babel/types': 7.24.9 - '@babel/helper-string-parser@7.22.5': {} + '@babel/helper-string-parser@7.24.8': {} - '@babel/helper-string-parser@7.24.1': {} + '@babel/helper-validator-identifier@7.24.7': {} - '@babel/helper-validator-identifier@7.22.20': {} + '@babel/helper-validator-option@7.24.8': {} - '@babel/helper-validator-option@7.23.5': {} - - '@babel/helpers@7.24.4': + '@babel/helpers@7.24.8': dependencies: - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.1 - '@babel/types': 7.24.0 - transitivePeerDependencies: - - supports-color - - '@babel/highlight@7.22.20': - dependencies: - '@babel/helper-validator-identifier': 7.22.20 - chalk: 2.4.2 - js-tokens: 4.0.0 + '@babel/template': 7.24.7 + '@babel/types': 7.24.9 - '@babel/highlight@7.24.2': + '@babel/highlight@7.24.7': dependencies: - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-validator-identifier': 7.24.7 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.0 - - '@babel/parser@7.23.0': - dependencies: - '@babel/types': 7.23.0 + picocolors: 1.0.1 - '@babel/parser@7.24.4': + '@babel/parser@7.24.8': dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.24.9 - '@babel/plugin-syntax-flow@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-syntax-flow@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.4)': + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.4)': + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-syntax-typescript@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 - '@babel/plugin-transform-class-properties@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-class-properties@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-create-class-features-plugin': 7.24.8(@babel/core@7.24.9) + '@babel/helper-plugin-utils': 7.24.8 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-flow-strip-types@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-flow-strip-types@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-flow': 7.24.1(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 + '@babel/plugin-syntax-flow': 7.24.7(@babel/core@7.24.9) - '@babel/plugin-transform-modules-commonjs@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-modules-commonjs@7.24.8(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-module-transforms': 7.23.3(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-simple-access': 7.22.5 + '@babel/core': 7.24.9 + '@babel/helper-module-transforms': 7.24.9(@babel/core@7.24.9) + '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-simple-access': 7.24.7 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-nullish-coalescing-operator@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-nullish-coalescing-operator@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.9) - '@babel/plugin-transform-optional-chaining@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-optional-chaining@7.24.8(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.9) + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-private-methods@7.24.1(@babel/core@7.24.4)': + '@babel/plugin-transform-private-methods@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 + '@babel/core': 7.24.9 + '@babel/helper-create-class-features-plugin': 7.24.8(@babel/core@7.24.9) + '@babel/helper-plugin-utils': 7.24.8 + transitivePeerDependencies: + - supports-color - '@babel/plugin-transform-typescript@7.24.4(@babel/core@7.24.4)': + '@babel/plugin-transform-typescript@7.24.8(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.4(@babel/core@7.24.4) - '@babel/helper-plugin-utils': 7.24.0 - '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/helper-annotate-as-pure': 7.24.7 + '@babel/helper-create-class-features-plugin': 7.24.8(@babel/core@7.24.9) + '@babel/helper-plugin-utils': 7.24.8 + '@babel/plugin-syntax-typescript': 7.24.7(@babel/core@7.24.9) + transitivePeerDependencies: + - supports-color - '@babel/preset-flow@7.24.1(@babel/core@7.24.4)': + '@babel/preset-flow@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-transform-flow-strip-types': 7.24.1(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-validator-option': 7.24.8 + '@babel/plugin-transform-flow-strip-types': 7.24.7(@babel/core@7.24.9) - '@babel/preset-typescript@7.24.1(@babel/core@7.24.4)': + '@babel/preset-typescript@7.24.7(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 - '@babel/helper-plugin-utils': 7.24.0 - '@babel/helper-validator-option': 7.23.5 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-typescript': 7.24.4(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/helper-plugin-utils': 7.24.8 + '@babel/helper-validator-option': 7.24.8 + '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.24.9) + '@babel/plugin-transform-typescript': 7.24.8(@babel/core@7.24.9) + transitivePeerDependencies: + - supports-color - '@babel/register@7.23.7(@babel/core@7.24.4)': + '@babel/register@7.24.6(@babel/core@7.24.9)': dependencies: - '@babel/core': 7.24.4 + '@babel/core': 7.24.9 clone-deep: 4.0.1 find-cache-dir: 2.1.0 make-dir: 2.1.0 pirates: 4.0.6 source-map-support: 0.5.21 - '@babel/template@7.22.15': - dependencies: - '@babel/code-frame': 7.22.13 - '@babel/parser': 7.23.0 - '@babel/types': 7.23.0 - - '@babel/template@7.24.0': + '@babel/template@7.24.7': dependencies: - '@babel/code-frame': 7.24.2 - '@babel/parser': 7.24.4 - '@babel/types': 7.24.0 + '@babel/code-frame': 7.24.7 + '@babel/parser': 7.24.8 + '@babel/types': 7.24.9 - '@babel/traverse@7.24.1': + '@babel/traverse@7.24.8': dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.4 - '@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.4 - '@babel/types': 7.24.0 + '@babel/code-frame': 7.24.7 + '@babel/generator': 7.24.10 + '@babel/helper-environment-visitor': 7.24.7 + '@babel/helper-function-name': 7.24.7 + '@babel/helper-hoist-variables': 7.24.7 + '@babel/helper-split-export-declaration': 7.24.7 + '@babel/parser': 7.24.8 + '@babel/types': 7.24.9 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.23.0': + '@babel/types@7.24.9': dependencies: - '@babel/helper-string-parser': 7.22.5 - '@babel/helper-validator-identifier': 7.22.20 - to-fast-properties: 2.0.0 - - '@babel/types@7.24.0': - dependencies: - '@babel/helper-string-parser': 7.24.1 - '@babel/helper-validator-identifier': 7.22.20 + '@babel/helper-string-parser': 7.24.8 + '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 '@clack/core@0.3.3': @@ -2784,12 +2813,6 @@ snapshots: dependencies: '@sinclair/typebox': 0.27.8 - '@jridgewell/gen-mapping@0.3.3': - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping': 0.3.19 - '@jridgewell/gen-mapping@0.3.5': dependencies: '@jridgewell/set-array': 1.2.1 @@ -2798,17 +2821,10 @@ snapshots: '@jridgewell/resolve-uri@3.1.1': {} - '@jridgewell/set-array@1.1.2': {} - '@jridgewell/set-array@1.2.1': {} '@jridgewell/sourcemap-codec@1.4.15': {} - '@jridgewell/trace-mapping@0.3.19': - dependencies: - '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 - '@jridgewell/trace-mapping@0.3.25': dependencies: '@jridgewell/resolve-uri': 3.1.1 @@ -2878,13 +2894,13 @@ snapshots: dependencies: '@sentry-internal/eslint-plugin-sdk': 7.64.0 '@sentry-internal/typescript': 7.64.0(typescript@4.9.5) - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@4.9.5) + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5) '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@4.9.5) eslint: 8.47.0 eslint-config-prettier: 6.15.0(eslint@8.47.0) eslint-plugin-deprecation: 1.5.0(eslint@8.47.0)(typescript@4.9.5) - eslint-plugin-import: 2.28.1(@typescript-eslint/parser@5.62.0)(eslint@8.47.0) - eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.47.0)(typescript@4.9.5) + eslint-plugin-import: 2.28.1(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0) + eslint-plugin-jest: 27.2.3(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5) eslint-plugin-jsdoc: 30.7.13(eslint@8.47.0) eslint-plugin-simple-import-sort: 5.0.3(eslint@8.47.0) transitivePeerDependencies: @@ -2969,7 +2985,7 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.0 - '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@4.9.5)': + '@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5)': dependencies: '@eslint-community/regexpp': 4.6.2 '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@4.9.5) @@ -2983,6 +2999,7 @@ snapshots: natural-compare-lite: 1.4.0 semver: 7.6.0 tsutils: 3.21.0(typescript@4.9.5) + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -2994,6 +3011,7 @@ snapshots: '@typescript-eslint/typescript-estree': 5.62.0(typescript@4.9.5) debug: 4.3.4 eslint: 8.47.0 + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3010,6 +3028,7 @@ snapshots: debug: 4.3.4 eslint: 8.47.0 tsutils: 3.21.0(typescript@4.9.5) + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3025,6 +3044,7 @@ snapshots: is-glob: 4.0.3 semver: 7.6.0 tsutils: 3.21.0(typescript@4.9.5) + optionalDependencies: typescript: 4.9.5 transitivePeerDependencies: - supports-color @@ -3078,6 +3098,38 @@ snapshots: loupe: 2.3.7 pretty-format: 29.7.0 + '@vue/compiler-core@3.4.34': + dependencies: + '@babel/parser': 7.24.8 + '@vue/shared': 3.4.34 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.0 + + '@vue/compiler-dom@3.4.34': + dependencies: + '@vue/compiler-core': 3.4.34 + '@vue/shared': 3.4.34 + + '@vue/compiler-sfc@3.4.34': + dependencies: + '@babel/parser': 7.24.8 + '@vue/compiler-core': 3.4.34 + '@vue/compiler-dom': 3.4.34 + '@vue/compiler-ssr': 3.4.34 + '@vue/shared': 3.4.34 + estree-walker: 2.0.2 + magic-string: 0.30.10 + postcss: 8.4.40 + source-map-js: 1.2.0 + + '@vue/compiler-ssr@3.4.34': + dependencies: + '@vue/compiler-dom': 3.4.34 + '@vue/shared': 3.4.34 + + '@vue/shared@3.4.34': {} + acorn-jsx@5.3.2(acorn@8.10.0): dependencies: acorn: 8.10.0 @@ -3116,6 +3168,10 @@ snapshots: argparse@2.0.1: {} + aria-query@5.3.0: + dependencies: + dequal: 2.0.3 + array-buffer-byte-length@1.0.0: dependencies: call-bind: 1.0.2 @@ -3168,13 +3224,6 @@ snapshots: is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 - assert@2.0.0: - dependencies: - es6-object-assign: 1.1.0 - is-nan: 1.3.2 - object-is: 1.1.5 - util: 0.12.5 - assertion-error@1.1.0: {} ast-types@0.14.2: @@ -3187,9 +3236,11 @@ snapshots: available-typed-arrays@1.0.5: {} - babel-core@7.0.0-bridge.0(@babel/core@7.24.4): + axobject-query@4.1.0: {} + + babel-core@7.0.0-bridge.0(@babel/core@7.24.9): dependencies: - '@babel/core': 7.24.4 + '@babel/core': 7.24.9 balanced-match@1.0.2: {} @@ -3204,12 +3255,16 @@ snapshots: dependencies: fill-range: 7.0.1 - browserslist@4.23.0: + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.23.2: dependencies: - caniuse-lite: 1.0.30001612 - electron-to-chromium: 1.4.748 + caniuse-lite: 1.0.30001643 + electron-to-chromium: 1.5.1 node-releases: 2.0.14 - update-browserslist-db: 1.0.13(browserslist@4.23.0) + update-browserslist-db: 1.1.0(browserslist@4.23.2) buffer-from@1.1.2: {} @@ -3222,7 +3277,7 @@ snapshots: callsites@3.1.0: {} - caniuse-lite@1.0.30001612: {} + caniuse-lite@1.0.30001643: {} chai@4.4.1: dependencies: @@ -3279,6 +3334,14 @@ snapshots: kind-of: 6.0.3 shallow-clone: 3.0.1 + code-red@1.0.4: + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + '@types/estree': 1.0.5 + acorn: 8.11.3 + estree-walker: 3.0.3 + periscopic: 3.1.0 + color-convert@1.9.3: dependencies: color-name: 1.1.3 @@ -3315,6 +3378,11 @@ snapshots: domutils: 3.1.0 nth-check: 2.1.1 + css-tree@2.3.1: + dependencies: + mdn-data: 2.0.30 + source-map-js: 1.2.0 + css-what@6.1.0: {} debug@3.2.7: @@ -3336,6 +3404,8 @@ snapshots: has-property-descriptors: 1.0.0 object-keys: 1.1.1 + dequal@2.0.3: {} + diff-sequences@29.6.3: {} dir-glob@2.2.2: @@ -3378,7 +3448,7 @@ snapshots: dependencies: type-fest: 2.19.0 - electron-to-chromium@1.4.748: {} + electron-to-chromium@1.5.1: {} emoji-regex@8.0.0: {} @@ -3446,8 +3516,6 @@ snapshots: is-date-object: 1.0.5 is-symbol: 1.0.4 - es6-object-assign@1.1.0: {} - esbuild@0.20.2: optionalDependencies: '@esbuild/aix-ppc64': 0.20.2 @@ -3476,6 +3544,8 @@ snapshots: escalade@3.1.1: {} + escalade@3.1.2: {} + escape-string-regexp@1.0.5: {} escape-string-regexp@4.0.0: {} @@ -3495,10 +3565,11 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.47.0): + eslint-module-utils@2.8.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint@8.47.0): dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@4.9.5) debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@4.9.5) eslint: 8.47.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: @@ -3514,9 +3585,8 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.28.1(@typescript-eslint/parser@5.62.0)(eslint@8.47.0): + eslint-plugin-import@2.28.1(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0): dependencies: - '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@4.9.5) array-includes: 3.1.6 array.prototype.findlastindex: 1.2.2 array.prototype.flat: 1.3.1 @@ -3525,7 +3595,7 @@ snapshots: doctrine: 2.1.0 eslint: 8.47.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0)(eslint-import-resolver-node@0.3.9)(eslint@8.47.0) + eslint-module-utils: 2.8.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint-import-resolver-node@0.3.9)(eslint@8.47.0) has: 1.0.3 is-core-module: 2.13.0 is-glob: 4.0.3 @@ -3535,16 +3605,19 @@ snapshots: object.values: 1.1.6 semver: 6.3.1 tsconfig-paths: 3.14.2 + optionalDependencies: + '@typescript-eslint/parser': 5.62.0(eslint@8.47.0)(typescript@4.9.5) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@5.62.0)(eslint@8.47.0)(typescript@4.9.5): + eslint-plugin-jest@27.2.3(@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5): dependencies: - '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.47.0)(typescript@4.9.5) '@typescript-eslint/utils': 5.62.0(eslint@8.47.0)(typescript@4.9.5) eslint: 8.47.0 + optionalDependencies: + '@typescript-eslint/eslint-plugin': 5.62.0(@typescript-eslint/parser@5.62.0(eslint@8.47.0)(typescript@4.9.5))(eslint@8.47.0)(typescript@4.9.5) transitivePeerDependencies: - supports-color - typescript @@ -3640,6 +3713,8 @@ snapshots: estraverse@5.3.0: {} + estree-walker@2.0.2: {} + estree-walker@3.0.3: dependencies: '@types/estree': 1.0.5 @@ -3716,6 +3791,10 @@ snapshots: dependencies: to-regex-range: 5.0.1 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + find-cache-dir@2.1.0: dependencies: commondir: 1.0.1 @@ -3906,11 +3985,6 @@ snapshots: has: 1.0.3 side-channel: 1.0.4 - is-arguments@1.1.1: - dependencies: - call-bind: 1.0.2 - has-tostringtag: 1.0.0 - is-array-buffer@3.0.2: dependencies: call-bind: 1.0.2 @@ -3940,19 +4014,10 @@ snapshots: is-fullwidth-code-point@3.0.0: {} - is-generator-function@1.0.10: - dependencies: - has-tostringtag: 1.0.0 - is-glob@4.0.3: dependencies: is-extglob: 2.1.1 - is-nan@1.3.2: - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - is-negative-zero@2.0.2: {} is-number-object@1.0.7: @@ -3969,6 +4034,10 @@ snapshots: dependencies: isobject: 3.0.1 + is-reference@3.0.2: + dependencies: + '@types/estree': 1.0.5 + is-regex@1.1.4: dependencies: call-bind: 1.0.2 @@ -4012,26 +4081,34 @@ snapshots: dependencies: argparse: 2.0.1 + jscodeshift-adapters@1.0.2(jscodeshift@0.15.2): + dependencies: + '@vue/compiler-sfc': 3.4.34 + jscodeshift: 0.15.2 + node-html-parser: 6.1.13 + rambda: 9.2.1 + svelte: 4.2.18 + jscodeshift@0.15.2: dependencies: - '@babel/core': 7.24.4 - '@babel/parser': 7.23.0 - '@babel/plugin-transform-class-properties': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-modules-commonjs': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-nullish-coalescing-operator': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-optional-chaining': 7.24.1(@babel/core@7.24.4) - '@babel/plugin-transform-private-methods': 7.24.1(@babel/core@7.24.4) - '@babel/preset-flow': 7.24.1(@babel/core@7.24.4) - '@babel/preset-typescript': 7.24.1(@babel/core@7.24.4) - '@babel/register': 7.23.7(@babel/core@7.24.4) - babel-core: 7.0.0-bridge.0(@babel/core@7.24.4) + '@babel/core': 7.24.9 + '@babel/parser': 7.24.8 + '@babel/plugin-transform-class-properties': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-modules-commonjs': 7.24.8(@babel/core@7.24.9) + '@babel/plugin-transform-nullish-coalescing-operator': 7.24.7(@babel/core@7.24.9) + '@babel/plugin-transform-optional-chaining': 7.24.8(@babel/core@7.24.9) + '@babel/plugin-transform-private-methods': 7.24.7(@babel/core@7.24.9) + '@babel/preset-flow': 7.24.7(@babel/core@7.24.9) + '@babel/preset-typescript': 7.24.7(@babel/core@7.24.9) + '@babel/register': 7.24.6(@babel/core@7.24.9) + babel-core: 7.0.0-bridge.0(@babel/core@7.24.9) chalk: 4.1.2 flow-parser: 0.214.0 graceful-fs: 4.2.11 - micromatch: 4.0.5 + micromatch: 4.0.7 neo-async: 2.6.2 node-dir: 0.1.17 - recast: 0.23.4 + recast: 0.23.9 temp: 0.8.4 write-file-atomic: 2.4.3 transitivePeerDependencies: @@ -4071,6 +4148,8 @@ snapshots: dependencies: lie: 3.1.1 + locate-character@3.0.0: {} + locate-path@3.0.0: dependencies: p-locate: 3.0.0 @@ -4107,6 +4186,8 @@ snapshots: pify: 4.0.1 semver: 5.7.2 + mdn-data@2.0.30: {} + merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -4116,6 +4197,11 @@ snapshots: braces: 3.0.2 picomatch: 2.3.1 + micromatch@4.0.7: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mimic-fn@2.1.0: {} mimic-fn@4.0.0: {} @@ -4180,11 +4266,6 @@ snapshots: object-inspect@1.12.3: {} - object-is@1.1.5: - dependencies: - call-bind: 1.0.2 - define-properties: 1.2.0 - object-keys@1.1.1: {} object.assign@4.1.4: @@ -4300,8 +4381,16 @@ snapshots: pathval@1.1.1: {} + periscopic@3.1.0: + dependencies: + '@types/estree': 1.0.5 + estree-walker: 3.0.3 + is-reference: 3.0.2 + picocolors@1.0.0: {} + picocolors@1.0.1: {} + picomatch@2.3.1: {} pify@2.3.0: {} @@ -4334,6 +4423,12 @@ snapshots: picocolors: 1.0.0 source-map-js: 1.2.0 + postcss@8.4.40: + dependencies: + nanoid: 3.3.7 + picocolors: 1.0.1 + source-map-js: 1.2.0 + prelude-ls@1.2.1: {} prettier@3.0.2: {} @@ -4353,6 +4448,8 @@ snapshots: queue-microtask@1.2.3: {} + rambda@9.2.1: {} + react-is@18.3.1: {} recast@0.20.5: @@ -4362,12 +4459,12 @@ snapshots: source-map: 0.6.1 tslib: 2.6.2 - recast@0.23.4: + recast@0.23.9: dependencies: - assert: 2.0.0 ast-types: 0.16.1 esprima: 4.0.1 source-map: 0.6.1 + tiny-invariant: 1.3.3 tslib: 2.6.2 regexp.prototype.flags@1.5.0: @@ -4553,6 +4650,23 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} + svelte@4.2.18: + dependencies: + '@ampproject/remapping': 2.2.1 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.25 + '@types/estree': 1.0.5 + acorn: 8.11.3 + aria-query: 5.3.0 + axobject-query: 4.1.0 + code-red: 1.0.4 + css-tree: 2.3.1 + estree-walker: 3.0.3 + is-reference: 3.0.2 + locate-character: 3.0.0 + magic-string: 0.30.10 + periscopic: 3.1.0 + temp@0.8.4: dependencies: rimraf: 2.6.3 @@ -4561,6 +4675,8 @@ snapshots: throwback@4.1.0: {} + tiny-invariant@1.3.3: {} + tinybench@2.8.0: {} tinypool@0.8.4: {} @@ -4650,11 +4766,11 @@ snapshots: unicorn-magic@0.1.0: {} - update-browserslist-db@1.0.13(browserslist@4.23.0): + update-browserslist-db@1.1.0(browserslist@4.23.2): dependencies: - browserslist: 4.23.0 - escalade: 3.1.1 - picocolors: 1.0.0 + browserslist: 4.23.2 + escalade: 3.1.2 + picocolors: 1.0.1 uri-js@4.4.1: dependencies: @@ -4664,14 +4780,6 @@ snapshots: dependencies: os-homedir: 1.0.2 - util@0.12.5: - dependencies: - inherits: 2.0.4 - is-arguments: 1.1.1 - is-generator-function: 1.0.10 - is-typed-array: 1.1.12 - which-typed-array: 1.1.11 - uuid@8.3.2: {} vite-node@1.6.0(@types/node@18.17.6): @@ -4693,16 +4801,15 @@ snapshots: vite@5.2.11(@types/node@18.17.6): dependencies: - '@types/node': 18.17.6 esbuild: 0.20.2 postcss: 8.4.38 rollup: 4.17.2 optionalDependencies: + '@types/node': 18.17.6 fsevents: 2.3.3 vitest@1.6.0(@types/node@18.17.6): dependencies: - '@types/node': 18.17.6 '@vitest/expect': 1.6.0 '@vitest/runner': 1.6.0 '@vitest/snapshot': 1.6.0 @@ -4723,6 +4830,8 @@ snapshots: vite: 5.2.11(@types/node@18.17.6) vite-node: 1.6.0(@types/node@18.17.6) why-is-node-running: 2.2.2 + optionalDependencies: + '@types/node': 18.17.6 transitivePeerDependencies: - less - lightningcss diff --git a/src/index.js b/src/index.js index 82bea6a..9788344 100755 --- a/src/index.js +++ b/src/index.js @@ -28,7 +28,7 @@ async function _run() { .option('ignoreFilePatterns', { alias: 'if', describe: 'Glob pattern which files should be ignored', - default: ['node_modules', '**/*.svelte'], + default: ['node_modules'], type: 'string', array: true, }) diff --git a/src/transformers/addMigrationComments/transform.cjs b/src/transformers/addMigrationComments/transform.cjs index 0f40e74..89dfb6a 100644 --- a/src/transformers/addMigrationComments/transform.cjs +++ b/src/transformers/addMigrationComments/transform.cjs @@ -1,6 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); const Sentry = require('@sentry/node'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const { addTodoComment } = require('../../utils/jscodeshift.cjs'); /** @@ -9,94 +9,93 @@ const { addTodoComment } = require('../../utils/jscodeshift.cjs'); * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function addMigrationComments(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); - let hasChanges = false; + let hasChanges = false; - const methodCommentMap = new Map([ - [ - 'startTransaction', - 'Use `startInactiveSpan()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-new-performance-apis.md', - ], - [ - 'startChild', - 'Use `startInactiveSpan()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-new-performance-apis.md', - ], - [ - 'makeMain', - 'Use `setCurrentClient()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-initializing.md', - ], - [ - 'getActiveTransaction', - 'Use `getActiveSpan()` instead. If you use this only to start a child, use `startInactiveSpan({ onlyIfParent: true })` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-new-performance-apis.md', - ], - ]); + const methodCommentMap = new Map([ + [ + 'startTransaction', + 'Use `startInactiveSpan()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-new-performance-apis.md', + ], + [ + 'startChild', + 'Use `startInactiveSpan()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-new-performance-apis.md', + ], + [ + 'makeMain', + 'Use `setCurrentClient()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-initializing.md', + ], + [ + 'getActiveTransaction', + 'Use `getActiveSpan()` instead. If you use this only to start a child, use `startInactiveSpan({ onlyIfParent: true })` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-new-performance-apis.md', + ], + ]); - // Find `xxx()` calls - tree - .find(j.CallExpression, { - callee: { - type: 'Identifier', - }, - }) - .forEach(path => { - if (path.value.callee.type === 'Identifier') { - const comment = methodCommentMap.get(path.value.callee.name); - if (comment) { - hasChanges = true; - addTodoComment(j, path, comment); - } + // Find `xxx()` calls + tree + .find(j.CallExpression, { + callee: { + type: 'Identifier', + }, + }) + .forEach(path => { + if (path.value.callee.type === 'Identifier') { + const comment = methodCommentMap.get(path.value.callee.name); + if (comment) { + hasChanges = true; + addTodoComment(j, path, comment); } - }); + } + }); - // Find `Sentry.xxx()` calls - tree - .find(j.CallExpression, { - callee: { - type: 'MemberExpression', - property: { - type: 'Identifier', - }, + // Find `Sentry.xxx()` calls + tree + .find(j.CallExpression, { + callee: { + type: 'MemberExpression', + property: { + type: 'Identifier', }, - }) - .forEach(path => { - if (path.value.callee.type === 'MemberExpression' && path.value.callee.property.type === 'Identifier') { - const comment = methodCommentMap.get(path.value.callee.property.name); - if (comment) { - hasChanges = true; - addTodoComment(j, path, comment); - } + }, + }) + .forEach(path => { + if (path.value.callee.type === 'MemberExpression' && path.value.callee.property.type === 'Identifier') { + const comment = methodCommentMap.get(path.value.callee.property.name); + if (comment) { + hasChanges = true; + addTodoComment(j, path, comment); } - }); - - // Find `new Hub()` & `new Sentry.Hub()` - tree.find(j.NewExpression).forEach(path => { - if ( - (path.value.callee.type === 'Identifier' && path.value.callee.name === 'Hub') || - (path.value.callee.type === 'MemberExpression' && - path.value.callee.property.type === 'Identifier' && - path.value.callee.property.name === 'Hub') - ) { - hasChanges = true; - addTodoComment( - j, - path, - 'Use `new Scope()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-initializing.md' - ); } }); - if (hasChanges) { - Sentry.setTag('added-todo-comments', true); - Sentry.metrics.increment('added-todo-comments', 1); + // Find `new Hub()` & `new Sentry.Hub()` + tree.find(j.NewExpression).forEach(path => { + if ( + (path.value.callee.type === 'Identifier' && path.value.callee.name === 'Hub') || + (path.value.callee.type === 'MemberExpression' && + path.value.callee.property.type === 'Identifier' && + path.value.callee.property.name === 'Hub') + ) { + hasChanges = true; + addTodoComment( + j, + path, + 'Use `new Scope()` instead - see https://github.com/getsentry/sentry-javascript/blob/develop/docs/v8-initializing.md' + ); } - - return hasChanges ? tree.toSource() : undefined; }); -}; + + if (hasChanges) { + Sentry.setTag('added-todo-comments', true); + Sentry.metrics.increment('added-todo-comments', 1); + } + + return hasChanges ? tree.toSource() : undefined; +} + +module.exports = adapt(addMigrationComments); diff --git a/src/transformers/configureScope/transform.cjs b/src/transformers/configureScope/transform.cjs index 1ca6c07..2ff1076 100644 --- a/src/transformers/configureScope/transform.cjs +++ b/src/transformers/configureScope/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { hasSentryImportOrRequire, replaceImported } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); /** * This transform converts usages of `configureScope((scope) => {})` to use `getCurrentScope()` instead. @@ -24,149 +25,143 @@ const { wrapJscodeshift } = require('../../utils/dom.cjs'); * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function (fileInfo, api, options) { +function configureScope(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); + + // If no sentry import, skip it + if (!hasSentryImportOrRequire(source)) { + return undefined; + } + + if (!source.includes('configureScope')) { + return undefined; + } - // If no sentry import, skip it - if (!hasSentryImportOrRequire(source)) { - return undefined; + // Replace `configureScope()` + tree.find(j.CallExpression).forEach(path => { + if (path.value.callee.type !== 'Identifier' || path.value.callee.name !== 'configureScope') { + return; } - if (!source.includes('configureScope')) { - return undefined; + const callbackFn = path.value.arguments[0]; + if (!callbackFn || (callbackFn.type !== 'ArrowFunctionExpression' && callbackFn.type !== 'FunctionExpression')) { + return; } - // Replace `configureScope()` - tree.find(j.CallExpression).forEach(path => { - if (path.value.callee.type !== 'Identifier' || path.value.callee.name !== 'configureScope') { - return; - } - - const callbackFn = path.value.arguments[0]; - if (!callbackFn || (callbackFn.type !== 'ArrowFunctionExpression' && callbackFn.type !== 'FunctionExpression')) { - return; - } - - // The var name of the scope callback, e.g. (scope) => {} would be "scope" - const scopeVarName = callbackFn.params[0]?.type === 'Identifier' ? callbackFn.params[0].name : undefined; - - if (!scopeVarName) { - return; - } - - const callbackBody = callbackFn.body; - const getScopeMethodName = 'getCurrentScope'; - - // If we only have a single statement inside, we can avoid the block - // This handles both directly having a call expression: configureScope(scope => scope.setTag('foo', 'bar')) - // As well as having a block with only a single call expression inside: configureScope(scope => { scope.setTag('foo', 'bar'); }) - const singleExpression = getExpression(callbackBody, scopeVarName); - - if (singleExpression && singleExpression.callee.type === 'MemberExpression') { - path.replace( - j.callExpression( - j.memberExpression( - j.callExpression(j.identifier(getScopeMethodName), []), - singleExpression.callee.property - ), - singleExpression.arguments - ) - ); - return; - } - - if (callbackBody.type !== 'BlockStatement') { - return; - } + // The var name of the scope callback, e.g. (scope) => {} would be "scope" + const scopeVarName = callbackFn.params[0]?.type === 'Identifier' ? callbackFn.params[0].name : undefined; + + if (!scopeVarName) { + return; + } + + const callbackBody = callbackFn.body; + const getScopeMethodName = 'getCurrentScope'; + + // If we only have a single statement inside, we can avoid the block + // This handles both directly having a call expression: configureScope(scope => scope.setTag('foo', 'bar')) + // As well as having a block with only a single call expression inside: configureScope(scope => { scope.setTag('foo', 'bar'); }) + const singleExpression = getExpression(callbackBody, scopeVarName); + if (singleExpression && singleExpression.callee.type === 'MemberExpression') { path.replace( - j.blockStatement([ - j.variableDeclaration('const', [ - j.variableDeclarator(j.identifier(scopeVarName), j.callExpression(j.identifier(getScopeMethodName), [])), - ]), - ...callbackBody.body, - ]) + j.callExpression( + j.memberExpression(j.callExpression(j.identifier(getScopeMethodName), []), singleExpression.callee.property), + singleExpression.arguments + ) ); - }); - - // Replace e.g. `SentryUtuils.configureScope()` - tree.find(j.CallExpression).forEach(path => { - if ( - path.value.callee.type !== 'MemberExpression' || - path.value.callee.property.type !== 'Identifier' || - path.value.callee.property.name !== 'configureScope' - ) { - return; - } - - const calleeObj = path.value.callee.object; - - const callbackFn = path.value.arguments[0]; - if (!callbackFn || (callbackFn.type !== 'ArrowFunctionExpression' && callbackFn.type !== 'FunctionExpression')) { - return; - } - - // The var name of the scope callback, e.g. (scope) => {} would be "scope" - const scopeVarName = callbackFn.params[0]?.type === 'Identifier' ? callbackFn.params[0].name : undefined; - - if (!scopeVarName) { - return; - } - - const callbackBody = callbackFn.body; - - // Very hacky, but we check if the callee (e.g. hub.configureScope() or getCurrentHub().configureScope()) - // contains "hub", and if so, we use `getScope()` instead of `getCurrentScope()` - let getScopeMethodName = /hub/i.test(j(calleeObj).toSource()) ? 'getScope' : 'getCurrentScope'; - - // If we only have a single statement inside, we can avoid the block - // This handles both directly having a call expression: configureScope(scope => scope.setTag('foo', 'bar')) - // As well as having a block with only a single call expression inside: configureScope(scope => { scope.setTag('foo', 'bar'); }) - const singleExpression = getExpression(callbackBody, scopeVarName); - - if (singleExpression && singleExpression.callee.type === 'MemberExpression') { - path.replace( - j.callExpression( - j.memberExpression( - j.memberExpression(calleeObj, j.callExpression(j.identifier(getScopeMethodName), [])), - singleExpression.callee.property - ), - singleExpression.arguments - ) - ); - return; - } - - if (callbackBody.type !== 'BlockStatement') { - return; - } + return; + } + + if (callbackBody.type !== 'BlockStatement') { + return; + } + + path.replace( + j.blockStatement([ + j.variableDeclaration('const', [ + j.variableDeclarator(j.identifier(scopeVarName), j.callExpression(j.identifier(getScopeMethodName), [])), + ]), + ...callbackBody.body, + ]) + ); + }); + // Replace e.g. `SentryUtuils.configureScope()` + tree.find(j.CallExpression).forEach(path => { + if ( + path.value.callee.type !== 'MemberExpression' || + path.value.callee.property.type !== 'Identifier' || + path.value.callee.property.name !== 'configureScope' + ) { + return; + } + + const calleeObj = path.value.callee.object; + + const callbackFn = path.value.arguments[0]; + if (!callbackFn || (callbackFn.type !== 'ArrowFunctionExpression' && callbackFn.type !== 'FunctionExpression')) { + return; + } + + // The var name of the scope callback, e.g. (scope) => {} would be "scope" + const scopeVarName = callbackFn.params[0]?.type === 'Identifier' ? callbackFn.params[0].name : undefined; + + if (!scopeVarName) { + return; + } + + const callbackBody = callbackFn.body; + + // Very hacky, but we check if the callee (e.g. hub.configureScope() or getCurrentHub().configureScope()) + // contains "hub", and if so, we use `getScope()` instead of `getCurrentScope()` + let getScopeMethodName = /hub/i.test(j(calleeObj).toSource()) ? 'getScope' : 'getCurrentScope'; + + // If we only have a single statement inside, we can avoid the block + // This handles both directly having a call expression: configureScope(scope => scope.setTag('foo', 'bar')) + // As well as having a block with only a single call expression inside: configureScope(scope => { scope.setTag('foo', 'bar'); }) + const singleExpression = getExpression(callbackBody, scopeVarName); + + if (singleExpression && singleExpression.callee.type === 'MemberExpression') { path.replace( - j.blockStatement([ - j.variableDeclaration('const', [ - j.variableDeclarator( - j.identifier(scopeVarName), - j.memberExpression(calleeObj, j.callExpression(j.identifier(getScopeMethodName), [])) - ), - ]), - ...callbackBody.body, - ]) + j.callExpression( + j.memberExpression( + j.memberExpression(calleeObj, j.callExpression(j.identifier(getScopeMethodName), [])), + singleExpression.callee.property + ), + singleExpression.arguments + ) ); - }); + return; + } - const sdk = options.sentry?.sdk; - if (sdk) { - replaceImported(j, tree, source, sdk, new Map([['configureScope', 'getCurrentScope']])); + if (callbackBody.type !== 'BlockStatement') { + return; } - return tree.toSource(); + path.replace( + j.blockStatement([ + j.variableDeclaration('const', [ + j.variableDeclarator( + j.identifier(scopeVarName), + j.memberExpression(calleeObj, j.callExpression(j.identifier(getScopeMethodName), [])) + ), + ]), + ...callbackBody.body, + ]) + ); }); -}; + + const sdk = options.sentry?.sdk; + if (sdk) { + replaceImported(j, tree, source, sdk, new Map([['configureScope', 'getCurrentScope']])); + } + + return tree.toSource(); +} /** * This methods detects if the body of a function is only a single expression, and if so returns that. @@ -215,3 +210,5 @@ function getExpression(callbackBody, scopeVarName) { return undefined; } + +module.exports = adapt(configureScope); diff --git a/src/transformers/convertEnums/transform.cjs b/src/transformers/convertEnums/transform.cjs index fb7b141..30f4b21 100644 --- a/src/transformers/convertEnums/transform.cjs +++ b/src/transformers/convertEnums/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { hasSentryImportOrRequire } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const SpanStatusMap = new Map([ ['Ok', 'ok'], @@ -45,76 +46,73 @@ const enumMap = new Map([ * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function convertEnums(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; // Bail out if file has no sentry import - nothing to do then! if (!hasSentryImportOrRequire(source)) { return undefined; } - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); - - /** @type {Record} */ - const remove = { - Severity: 'unused', - SpanStatus: 'unused', - }; + const tree = j(source); - tree.find(j.MemberExpression, { property: { type: 'Identifier' } }).forEach(path => { - if (path.value.property.type !== 'Identifier') { - return; - } + /** @type {Record} */ + const remove = { + Severity: 'unused', + SpanStatus: 'unused', + }; - let enumKey = undefined; + tree.find(j.MemberExpression, { property: { type: 'Identifier' } }).forEach(path => { + if (path.value.property.type !== 'Identifier') { + return; + } - if (path.value.object.type === 'Identifier') { - enumKey = path.value.object.name; - } else if ( - path.value.object.type === 'MemberExpression' && - path.value.object.object.type === 'Identifier' && - path.value.object.object.name === 'Sentry' && - path.value.object.property.type === 'Identifier' - ) { - enumKey = path.value.object.property.name; - } + let enumKey = undefined; + + if (path.value.object.type === 'Identifier') { + enumKey = path.value.object.name; + } else if ( + path.value.object.type === 'MemberExpression' && + path.value.object.object.type === 'Identifier' && + path.value.object.object.name === 'Sentry' && + path.value.object.property.type === 'Identifier' + ) { + enumKey = path.value.object.property.name; + } - if (!enumKey) { - return; - } + if (!enumKey) { + return; + } - const map = enumMap.get(enumKey); + const map = enumMap.get(enumKey); - if (!map) { - return; - } + if (!map) { + return; + } - const value = path.value.property.name; - const newValue = map.get(value); + const value = path.value.property.name; + const newValue = map.get(value); - if (newValue) { - path.replace(j.stringLiteral(newValue)); - if (remove[enumKey] !== 'no') { - remove[enumKey] = 'yes'; - } - } else { - // Unknown value, do not remove it - remove[enumKey] = 'no'; + if (newValue) { + path.replace(j.stringLiteral(newValue)); + if (remove[enumKey] !== 'no') { + remove[enumKey] = 'yes'; } - }); + } else { + // Unknown value, do not remove it + remove[enumKey] = 'no'; + } + }); - const toRemove = Object.keys(remove).filter(key => remove[key] === 'yes'); + const toRemove = Object.keys(remove).filter(key => remove[key] === 'yes'); - if (toRemove.length > 0) { - removeImportedIdentifiers(j, tree, toRemove); - } + if (toRemove.length > 0) { + removeImportedIdentifiers(j, tree, toRemove); + } - return tree.toSource(); - }); -}; + return tree.toSource(); +} /** * Deduplicate imported identifiers. @@ -198,3 +196,5 @@ function removeImportedIdentifiers(j, tree, identifiers) { } }); } + +module.exports = adapt(convertEnums); diff --git a/src/transformers/hub/transform.cjs b/src/transformers/hub/transform.cjs index e43acf0..ef93148 100644 --- a/src/transformers/hub/transform.cjs +++ b/src/transformers/hub/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { addTodoComment, modifyImports, dedupeImportStatements } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); /** * This transform converts usages of hub APIs to use global APIs instead. @@ -13,10 +14,9 @@ const { wrapJscodeshift } = require('../../utils/dom.cjs'); * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function (fileInfo, api, options) { +function hub(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; const hubMethodMap = new Map([ ['withScope', 'withScope'], @@ -37,92 +37,90 @@ module.exports = function (fileInfo, api, options) { ['endSession', 'endSession'], ]); - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); + + const methodsUsed = new Set(); + + let hasChanges = false; + + // Replace getCurrentHub().xxx() and hub.xxx() + tree.find(j.CallExpression, { callee: { type: 'MemberExpression' } }).forEach(path => { + if (path.value.callee.type !== 'MemberExpression' || path.value.callee.property.type !== 'Identifier') { + return; + } - const methodsUsed = new Set(); + const method = path.value.callee.property.name; + const caller = path.value.callee.object; + const mapTo = hubMethodMap.get(method); - let hasChanges = false; + const callerIsHubVar = caller.type === 'Identifier' && caller.name.toLocaleLowerCase().includes('hub'); + const callerIsGetCurrentHub = + caller.type === 'CallExpression' && caller.callee.type === 'Identifier' && caller.callee.name === 'getCurrentHub'; + if (callerIsHubVar || callerIsGetCurrentHub) { + hasChanges = true; + if (mapTo) { + methodsUsed.add(mapTo); + path.replace(j.callExpression(j.identifier(mapTo), path.value.arguments)); + } else { + addTodoComment( + j, + path, + 'Could not automatically migrate - see https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub' + ); + } + } + }); - // Replace getCurrentHub().xxx() and hub.xxx() - tree.find(j.CallExpression, { callee: { type: 'MemberExpression' } }).forEach(path => { - if (path.value.callee.type !== 'MemberExpression' || path.value.callee.property.type !== 'Identifier') { + // Replace Sentry.getCurrentHub().xxx() + tree + .find(j.CallExpression, { + callee: { + type: 'MemberExpression', + object: { + type: 'CallExpression', + callee: { type: 'MemberExpression', property: { type: 'Identifier', name: 'getCurrentHub' } }, + }, + }, + }) + .forEach(path => { + if ( + path.value.callee.type !== 'MemberExpression' || + path.value.callee.property.type !== 'Identifier' || + path.value.callee.object.type !== 'CallExpression' || + path.value.callee.object.callee.type !== 'MemberExpression' || + path.value.callee.object.callee.object.type !== 'Identifier' + ) { return; } const method = path.value.callee.property.name; - const caller = path.value.callee.object; const mapTo = hubMethodMap.get(method); - const callerIsHubVar = caller.type === 'Identifier' && caller.name.toLocaleLowerCase().includes('hub'); - const callerIsGetCurrentHub = - caller.type === 'CallExpression' && - caller.callee.type === 'Identifier' && - caller.callee.name === 'getCurrentHub'; - if (callerIsHubVar || callerIsGetCurrentHub) { - hasChanges = true; - if (mapTo) { - methodsUsed.add(mapTo); - path.replace(j.callExpression(j.identifier(mapTo), path.value.arguments)); - } else { - addTodoComment( - j, - path, - 'Could not automatically migrate - see https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub' - ); - } + const sentryVar = path.value.callee.object.callee.object; + + hasChanges = true; + if (mapTo) { + path.replace(j.callExpression(j.memberExpression(sentryVar, j.identifier(mapTo)), path.value.arguments)); + } else { + addTodoComment( + j, + path, + 'Could not automatically migrate - see https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub' + ); } }); - // Replace Sentry.getCurrentHub().xxx() - tree - .find(j.CallExpression, { - callee: { - type: 'MemberExpression', - object: { - type: 'CallExpression', - callee: { type: 'MemberExpression', property: { type: 'Identifier', name: 'getCurrentHub' } }, - }, - }, - }) - .forEach(path => { - if ( - path.value.callee.type !== 'MemberExpression' || - path.value.callee.property.type !== 'Identifier' || - path.value.callee.object.type !== 'CallExpression' || - path.value.callee.object.callee.type !== 'MemberExpression' || - path.value.callee.object.callee.object.type !== 'Identifier' - ) { - return; - } - - const method = path.value.callee.property.name; - const mapTo = hubMethodMap.get(method); - - const sentryVar = path.value.callee.object.callee.object; - - hasChanges = true; - if (mapTo) { - path.replace(j.callExpression(j.memberExpression(sentryVar, j.identifier(mapTo)), path.value.arguments)); - } else { - addTodoComment( - j, - path, - 'Could not automatically migrate - see https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub' - ); - } - }); - - if (!hasChanges) { - return undefined; - } + if (!hasChanges) { + return undefined; + } - const sdk = options.sentry?.sdk; - if (sdk) { - modifyImports(j, tree, source, sdk, Array.from(methodsUsed), ['getCurrentHub']); - dedupeImportStatements(sdk, tree, j); - } + const sdk = options.sentry?.sdk; + if (sdk) { + modifyImports(j, tree, source, sdk, Array.from(methodsUsed), ['getCurrentHub']); + dedupeImportStatements(sdk, tree, j); + } - return tree.toSource(); - }); -}; + return tree.toSource(); +} + +module.exports = adapt(hub); diff --git a/src/transformers/integrations/transform.cjs b/src/transformers/integrations/transform.cjs index 3dc756b..8d66007 100644 --- a/src/transformers/integrations/transform.cjs +++ b/src/transformers/integrations/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { hasSentryImportOrRequire, replaceImported, dedupeImportStatements } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const INTEGRATIONS_PACKAGE = '@sentry/integrations'; const INTEGRATIONS_HASH_KEY = 'Integrations'; @@ -60,263 +61,262 @@ const integrationFunctions = Object.values(integrationMap); * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function (fileInfo, api, options) { +function integrations(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); + + // If no sentry import, skip it + if (!hasSentryImportOrRequire(source)) { + return undefined; + } + + const sdk = options.sentry?.sdk; + + // Replace `new Sentry.Integrations.xxx` with `Sentry.xxx` + tree + .find(j.NewExpression, { + callee: { + type: 'MemberExpression', + object: { type: 'MemberExpression', object: { type: 'Identifier' }, property: { type: 'Identifier' } }, + property: { type: 'Identifier' }, + }, + }) + .forEach(path => { + if ( + path.value.callee.type !== 'MemberExpression' || + path.value.callee.object.type !== 'MemberExpression' || + path.value.callee.object.object.type !== 'Identifier' || + path.value.callee.object.property.type !== 'Identifier' || + path.value.callee.property.type !== 'Identifier' + ) { + return; + } - // If no sentry import, skip it - if (!hasSentryImportOrRequire(source)) { - return undefined; - } + const objName = path.value.callee.object.object.name; + const maybeIntegrations = path.value.callee.object.property.name; + const className = path.value.callee.property.name; + const args = path.value.arguments; + const fnName = integrationMap[className]; - const sdk = options.sentry?.sdk; + if (maybeIntegrations !== INTEGRATIONS_HASH_KEY) { + return; + } - // Replace `new Sentry.Integrations.xxx` with `Sentry.xxx` - tree - .find(j.NewExpression, { - callee: { - type: 'MemberExpression', - object: { type: 'MemberExpression', object: { type: 'Identifier' }, property: { type: 'Identifier' } }, - property: { type: 'Identifier' }, - }, - }) - .forEach(path => { - if ( - path.value.callee.type !== 'MemberExpression' || - path.value.callee.object.type !== 'MemberExpression' || - path.value.callee.object.object.type !== 'Identifier' || - path.value.callee.object.property.type !== 'Identifier' || - path.value.callee.property.type !== 'Identifier' - ) { - return; - } + if (fnName) { + path.replace(j.callExpression(j.memberExpression(j.identifier(objName), j.identifier(fnName)), args)); + return; + } + }); - const objName = path.value.callee.object.object.name; - const maybeIntegrations = path.value.callee.object.property.name; - const className = path.value.callee.property.name; - const args = path.value.arguments; - const fnName = integrationMap[className]; + // Replace `new BrowserTracing()` + tree.find(j.NewExpression, { callee: { type: 'Identifier' } }).forEach(path => { + if (path.value.callee.type !== 'Identifier') { + return; + } - if (maybeIntegrations !== INTEGRATIONS_HASH_KEY) { - return; - } + const className = path.value.callee.name; + const args = path.value.arguments; + const fnName = integrationMap[className]; - if (fnName) { - path.replace(j.callExpression(j.memberExpression(j.identifier(objName), j.identifier(fnName)), args)); - return; - } - }); + if (fnName) { + path.replace(j.callExpression(j.identifier(fnName), args)); + return; + } + }); - // Replace `new BrowserTracing()` - tree.find(j.NewExpression, { callee: { type: 'Identifier' } }).forEach(path => { - if (path.value.callee.type !== 'Identifier') { + // Replace `new Sentry.BrowserTracing()` + tree + .find(j.NewExpression, { + callee: { type: 'MemberExpression', object: { type: 'Identifier' }, property: { type: 'Identifier' } }, + }) + .forEach(path => { + if ( + path.value.callee.type !== 'MemberExpression' || + path.value.callee.object.type !== 'Identifier' || + path.value.callee.property.type !== 'Identifier' + ) { return; } - const className = path.value.callee.name; + const objName = path.value.callee.object.name; + const className = path.value.callee.property.name; const args = path.value.arguments; const fnName = integrationMap[className]; if (fnName) { - path.replace(j.callExpression(j.identifier(fnName), args)); + path.replace(j.callExpression(j.memberExpression(j.identifier(objName), j.identifier(fnName)), args)); return; } }); - // Replace `new Sentry.BrowserTracing()` - tree - .find(j.NewExpression, { - callee: { type: 'MemberExpression', object: { type: 'Identifier' }, property: { type: 'Identifier' } }, - }) - .forEach(path => { - if ( - path.value.callee.type !== 'MemberExpression' || - path.value.callee.object.type !== 'Identifier' || - path.value.callee.property.type !== 'Identifier' - ) { - return; - } - - const objName = path.value.callee.object.name; - const className = path.value.callee.property.name; - const args = path.value.arguments; - const fnName = integrationMap[className]; - - if (fnName) { - path.replace(j.callExpression(j.memberExpression(j.identifier(objName), j.identifier(fnName)), args)); - return; - } - }); - - if (sdk) { - // Replace imports of classes with functions - replaceImported(j, tree, source, sdk, new Map(Object.entries(integrationMap))); - replaceImported(j, tree, source, INTEGRATIONS_PACKAGE, new Map(Object.entries(integrationMap))); + if (sdk) { + // Replace imports of classes with functions + replaceImported(j, tree, source, sdk, new Map(Object.entries(integrationMap))); + replaceImported(j, tree, source, INTEGRATIONS_PACKAGE, new Map(Object.entries(integrationMap))); - // Replace `Integrations.browserTracingIntegration()` - // First we check that we actually have a `Integrations` import from our package - let integrationsVarName = undefined; - const integrationsUsed = new Set(); + // Replace `Integrations.browserTracingIntegration()` + // First we check that we actually have a `Integrations` import from our package + let integrationsVarName = undefined; + const integrationsUsed = new Set(); - const integrationsImport = tree - .find(j.ImportDeclaration, { - source: { type: 'StringLiteral', value: sdk }, - }) - .filter(path => { - const specifiers = path.value.specifiers || []; - - return specifiers.some( - specifier => - specifier.type === 'ImportSpecifier' && - specifier.local?.type === 'Identifier' && - specifier.imported?.name === INTEGRATIONS_HASH_KEY - ); - }); - - integrationsImport.forEach(path => { - // We cache the used import name so we can use it later + const integrationsImport = tree + .find(j.ImportDeclaration, { + source: { type: 'StringLiteral', value: sdk }, + }) + .filter(path => { const specifiers = path.value.specifiers || []; - const name = specifiers.find( + return specifiers.some( specifier => specifier.type === 'ImportSpecifier' && specifier.local?.type === 'Identifier' && specifier.imported?.name === INTEGRATIONS_HASH_KEY - )?.local?.name; - - if (name) { - integrationsVarName = name; - } + ); }); - const integrationsRequire = tree.find(j.VariableDeclaration).filter(path => { - return path.value.declarations.some(declaration => { - return ( - declaration.type === 'VariableDeclarator' && - declaration.init?.type === 'CallExpression' && - declaration.init.callee.type === 'Identifier' && - declaration.init.callee.name === 'require' && - declaration.init.arguments.length === 1 && - declaration.init.arguments[0]?.type === 'StringLiteral' && - declaration.init.arguments[0].value === sdk - ); - }); - }); + integrationsImport.forEach(path => { + // We cache the used import name so we can use it later + const specifiers = path.value.specifiers || []; - integrationsRequire.forEach(path => { - path.value.declarations.forEach(declaration => { - if (declaration.type === 'VariableDeclarator' && declaration.id.type === 'ObjectPattern') { - const properties = declaration.id.properties || []; - - properties.forEach(property => { - if ( - property.type === 'ObjectProperty' && - property.key.type === 'Identifier' && - property.key.name === INTEGRATIONS_HASH_KEY && - property.value.type === 'Identifier' - ) { - const name = property.value.name; - if (name) { - integrationsVarName = name; - } - } - }); - } - }); + const name = specifiers.find( + specifier => + specifier.type === 'ImportSpecifier' && + specifier.local?.type === 'Identifier' && + specifier.imported?.name === INTEGRATIONS_HASH_KEY + )?.local?.name; + + if (name) { + integrationsVarName = name; + } + }); + + const integrationsRequire = tree.find(j.VariableDeclaration).filter(path => { + return path.value.declarations.some(declaration => { + return ( + declaration.type === 'VariableDeclarator' && + declaration.init?.type === 'CallExpression' && + declaration.init.callee.type === 'Identifier' && + declaration.init.callee.name === 'require' && + declaration.init.arguments.length === 1 && + declaration.init.arguments[0]?.type === 'StringLiteral' && + declaration.init.arguments[0].value === sdk + ); }); + }); + + integrationsRequire.forEach(path => { + path.value.declarations.forEach(declaration => { + if (declaration.type === 'VariableDeclarator' && declaration.id.type === 'ObjectPattern') { + const properties = declaration.id.properties || []; - // This replaces usages of `Integrations.xxx()` with `xxx()` - if (integrationsVarName) { - tree - .find(j.CallExpression, { - callee: { - type: 'MemberExpression', - object: { type: 'Identifier', name: integrationsVarName }, - property: { type: 'Identifier' }, - }, - }) - .forEach(path => { + properties.forEach(property => { if ( - path.value.callee.type !== 'MemberExpression' || - path.value.callee.object.type !== 'Identifier' || - path.value.callee.property.type !== 'Identifier' + property.type === 'ObjectProperty' && + property.key.type === 'Identifier' && + property.key.name === INTEGRATIONS_HASH_KEY && + property.value.type === 'Identifier' ) { - return; + const name = property.value.name; + if (name) { + integrationsVarName = name; + } } + }); + } + }); + }); - const fnName = path.value.callee.property.name; + // This replaces usages of `Integrations.xxx()` with `xxx()` + if (integrationsVarName) { + tree + .find(j.CallExpression, { + callee: { + type: 'MemberExpression', + object: { type: 'Identifier', name: integrationsVarName }, + property: { type: 'Identifier' }, + }, + }) + .forEach(path => { + if ( + path.value.callee.type !== 'MemberExpression' || + path.value.callee.object.type !== 'Identifier' || + path.value.callee.property.type !== 'Identifier' + ) { + return; + } - // Only handle known integration functions - if (!integrationFunctions.includes(fnName)) { - return; - } + const fnName = path.value.callee.property.name; - integrationsUsed.add(fnName); + // Only handle known integration functions + if (!integrationFunctions.includes(fnName)) { + return; + } - path.replace(j.callExpression(j.identifier(fnName), path.value.arguments)); - }); - } + integrationsUsed.add(fnName); - // Fix imports of `Integrations` - integrationsImport.forEach(path => { - let specifiers = path.value.specifiers || []; + path.replace(j.callExpression(j.identifier(fnName), path.value.arguments)); + }); + } - // Remove the `Integrations` import itself - specifiers = specifiers.filter( - specifier => specifier.type === 'ImportSpecifier' && specifier.imported?.name !== INTEGRATIONS_HASH_KEY - ); + // Fix imports of `Integrations` + integrationsImport.forEach(path => { + let specifiers = path.value.specifiers || []; - // Add the new imports (if they don't yet exist) - integrationsUsed.forEach(fnName => { - if (!specifiers.some(specifier => specifier.type === 'ImportSpecifier' && specifier.local?.name === fnName)) { - specifiers.push(j.importSpecifier(j.identifier(fnName))); - } - }); + // Remove the `Integrations` import itself + specifiers = specifiers.filter( + specifier => specifier.type === 'ImportSpecifier' && specifier.imported?.name !== INTEGRATIONS_HASH_KEY + ); - // Update import statement - path.value.specifiers = specifiers; + // Add the new imports (if they don't yet exist) + integrationsUsed.forEach(fnName => { + if (!specifiers.some(specifier => specifier.type === 'ImportSpecifier' && specifier.local?.name === fnName)) { + specifiers.push(j.importSpecifier(j.identifier(fnName))); + } }); - dedupeImportStatements(sdk, tree, j); - - // Fix requires of `Integrations` - integrationsRequire.forEach(path => { - path.value.declarations.forEach(declaration => { - if (declaration.type === 'VariableDeclarator' && declaration.id.type === 'ObjectPattern') { - let properties = declaration.id.properties || []; - - // Remove the `Integrations` require itself - properties = properties.filter( - prop => - prop.type === 'ObjectProperty' && - prop.key.type === 'Identifier' && - prop.key.name !== INTEGRATIONS_HASH_KEY - ); - - // Add the new requires (if they don't yet exist) - integrationsUsed.forEach(fnName => { - if ( - !properties.some( - prop => prop.type === 'ObjectProperty' && prop.key.type === 'Identifier' && prop.key.name === fnName - ) - ) { - const prop = j.objectProperty(j.identifier(fnName), j.identifier(fnName)); - prop.shorthand = true; - properties.push(prop); - } - }); + // Update import statement + path.value.specifiers = specifiers; + }); - // Update require statement - declaration.id.properties = properties; - } - }); + dedupeImportStatements(sdk, tree, j); + + // Fix requires of `Integrations` + integrationsRequire.forEach(path => { + path.value.declarations.forEach(declaration => { + if (declaration.type === 'VariableDeclarator' && declaration.id.type === 'ObjectPattern') { + let properties = declaration.id.properties || []; + + // Remove the `Integrations` require itself + properties = properties.filter( + prop => + prop.type === 'ObjectProperty' && + prop.key.type === 'Identifier' && + prop.key.name !== INTEGRATIONS_HASH_KEY + ); + + // Add the new requires (if they don't yet exist) + integrationsUsed.forEach(fnName => { + if ( + !properties.some( + prop => prop.type === 'ObjectProperty' && prop.key.type === 'Identifier' && prop.key.name === fnName + ) + ) { + const prop = j.objectProperty(j.identifier(fnName), j.identifier(fnName)); + prop.shorthand = true; + properties.push(prop); + } + }); + + // Update require statement + declaration.id.properties = properties; + } }); - } + }); + } - return tree.toSource(); - }); -}; + return tree.toSource(); +} + +module.exports = adapt(integrations); diff --git a/src/transformers/nextjsWrapperMethods/transform.cjs b/src/transformers/nextjsWrapperMethods/transform.cjs index cd892f5..ebd7c67 100644 --- a/src/transformers/nextjsWrapperMethods/transform.cjs +++ b/src/transformers/nextjsWrapperMethods/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { replaceFunctionCalls } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const FunctionMap = new Map([ ['withSentryAPI', 'wrapApiHandlerWithSentry'], @@ -29,18 +30,17 @@ const FunctionMap = new Map([ * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function nextJsWrapperMethods(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); + + if (!replaceFunctionCalls(j, tree, source, '@sentry/nextjs', FunctionMap)) { + return undefined; + } - if (!replaceFunctionCalls(j, tree, source, '@sentry/nextjs', FunctionMap)) { - return undefined; - } + return tree.toSource(); +} - return tree.toSource(); - }); -}; +module.exports = adapt(nextJsWrapperMethods); diff --git a/src/transformers/nodeExports/transform.cjs b/src/transformers/nodeExports/transform.cjs index 8c119ff..5880d98 100644 --- a/src/transformers/nodeExports/transform.cjs +++ b/src/transformers/nodeExports/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { hasSentryImportOrRequire } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); /** * This transform converts old Node `Handler.xxx` utilities to their new format. @@ -12,42 +13,23 @@ const { wrapJscodeshift } = require('../../utils/dom.cjs'); * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function nodeExports(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; // If the file has no @sentry/node import, nothing to do if (!hasSentryImportOrRequire(source, '@sentry/node')) { return undefined; } - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); - - // Replace Sentry.Handlers.xxx with Sentry.xxx - tree - .find(j.MemberExpression, { - object: { type: 'MemberExpression', object: { name: 'Sentry' }, property: { name: 'Handlers' } }, - }) - .forEach(path => { - if (path.value.property.type !== 'Identifier') { - return; - } - - const orig = path.value.property.name; - - if (orig === 'extractRequestData') { - path.value.object = j.identifier('Sentry'); - } - }); - - let shouldRemoveHandlersImport = true; - /** @type {Set} */ - let importsToAdd = new Set(); + const tree = j(source); - // Replace Handlers.xxx with xxx - tree.find(j.MemberExpression, { object: { name: 'Handlers' } }).forEach(path => { + // Replace Sentry.Handlers.xxx with Sentry.xxx + tree + .find(j.MemberExpression, { + object: { type: 'MemberExpression', object: { name: 'Sentry' }, property: { name: 'Handlers' } }, + }) + .forEach(path => { if (path.value.property.type !== 'Identifier') { return; } @@ -55,126 +37,144 @@ module.exports = function (fileInfo, api) { const orig = path.value.property.name; if (orig === 'extractRequestData') { - j(path).replaceWith(j.identifier('extractRequestData')); - importsToAdd.add('extractRequestData'); - } else { - // This means there is something else used from `Handlers`, so we can't remove the import - shouldRemoveHandlersImport = false; + path.value.object = j.identifier('Sentry'); } }); - // Find old types: Sentry.Handlers.ExpressRequest - tree - .find(j.TSTypeReference, { - typeName: { - type: 'TSQualifiedName', - right: { type: 'Identifier', name: 'ExpressRequest' }, - }, - }) - .forEach(path => { - if (path.value.typeName.type !== 'TSQualifiedName') { - return; - } + let shouldRemoveHandlersImport = true; + /** @type {Set} */ + let importsToAdd = new Set(); + + // Replace Handlers.xxx with xxx + tree.find(j.MemberExpression, { object: { name: 'Handlers' } }).forEach(path => { + if (path.value.property.type !== 'Identifier') { + return; + } + + const orig = path.value.property.name; + + if (orig === 'extractRequestData') { + j(path).replaceWith(j.identifier('extractRequestData')); + importsToAdd.add('extractRequestData'); + } else { + // This means there is something else used from `Handlers`, so we can't remove the import + shouldRemoveHandlersImport = false; + } + }); - const left = path.value.typeName.left; - const right = path.value.typeName.right; + // Find old types: Sentry.Handlers.ExpressRequest + tree + .find(j.TSTypeReference, { + typeName: { + type: 'TSQualifiedName', + right: { type: 'Identifier', name: 'ExpressRequest' }, + }, + }) + .forEach(path => { + if (path.value.typeName.type !== 'TSQualifiedName') { + return; + } - if (right.type !== 'Identifier' || right.name !== 'ExpressRequest') { - return; - } + const left = path.value.typeName.left; + const right = path.value.typeName.right; - if (left.type === 'Identifier' && left.name === 'Handlers') { - // Handle `Handlers.ExpressRequest` --> `PolymorophicRequest` - j(path).replaceWith(j.tsTypeReference(j.identifier('PolymorphicRequest'))); - importsToAdd.add('PolymorphicRequest'); - return; - } + if (right.type !== 'Identifier' || right.name !== 'ExpressRequest') { + return; + } - if ( - left.type === 'TSQualifiedName' && - left.left.type === 'Identifier' && - left.left.name === 'Sentry' && - left.right.type === 'Identifier' && - left.right.name === 'Handlers' - ) { - // Handle `Sentry.Handlers.ExpressRequest` --> `Sentrt.PolymorophicRequest` - j(path).replaceWith(j.tsQualifiedName(j.identifier('Sentry'), j.identifier('PolymorphicRequest'))); - } - }); - - // Replace import { Handlers } from '@sentry/node' with import { extractRequestData } from '@sentry/node' - tree - .find(j.ImportDeclaration, { - source: { type: 'StringLiteral', value: '@sentry/node' }, - specifiers: [{ type: 'ImportSpecifier', imported: { name: 'Handlers' }, local: { name: 'Handlers' } }], - }) - .forEach(path => { - const specifiers = path.value.specifiers || []; - const handlersSpecifier = specifiers.find( - specifier => specifier.type === 'ImportSpecifier' && specifier.imported.name === 'Handlers' - ); - - // Remove `Handlers` import if we don't need it anymore - if (handlersSpecifier && shouldRemoveHandlersImport) { - specifiers.splice(specifiers.indexOf(handlersSpecifier), 1); - } + if (left.type === 'Identifier' && left.name === 'Handlers') { + // Handle `Handlers.ExpressRequest` --> `PolymorophicRequest` + j(path).replaceWith(j.tsTypeReference(j.identifier('PolymorphicRequest'))); + importsToAdd.add('PolymorphicRequest'); + return; + } - // Add new imports - for (const importToAdd of importsToAdd) { - specifiers.push(j.importSpecifier(j.identifier(importToAdd))); - } - }); - - // Replace requires of { Handlers } - tree - .find(j.VariableDeclaration, { - declarations: [ - { - type: 'VariableDeclarator', - init: { - type: 'CallExpression', - callee: { type: 'Identifier', name: 'require' }, - arguments: [{ value: '@sentry/node' }], - }, - }, - ], - }) - .forEach(path => { - if ( - path.value.declarations[0]?.type === 'VariableDeclarator' && - path.value.declarations[0]?.id.type === 'ObjectPattern' - ) { - const requireVars = path.value.declarations[0].id; - - const indexToDelete = shouldRemoveHandlersImport - ? requireVars.properties.findIndex(property => { - if (property.type !== 'ObjectProperty') { - return false; - } - - // This is what is imported, e.g. const {x} = Sentry; - if (property.key.type === 'Identifier' && property.key.name === 'Handlers') { - return true; - } + if ( + left.type === 'TSQualifiedName' && + left.left.type === 'Identifier' && + left.left.name === 'Sentry' && + left.right.type === 'Identifier' && + left.right.name === 'Handlers' + ) { + // Handle `Sentry.Handlers.ExpressRequest` --> `Sentrt.PolymorophicRequest` + j(path).replaceWith(j.tsQualifiedName(j.identifier('Sentry'), j.identifier('PolymorphicRequest'))); + } + }); + + // Replace import { Handlers } from '@sentry/node' with import { extractRequestData } from '@sentry/node' + tree + .find(j.ImportDeclaration, { + source: { type: 'StringLiteral', value: '@sentry/node' }, + specifiers: [{ type: 'ImportSpecifier', imported: { name: 'Handlers' }, local: { name: 'Handlers' } }], + }) + .forEach(path => { + const specifiers = path.value.specifiers || []; + const handlersSpecifier = specifiers.find( + specifier => specifier.type === 'ImportSpecifier' && specifier.imported.name === 'Handlers' + ); + + // Remove `Handlers` import if we don't need it anymore + if (handlersSpecifier && shouldRemoveHandlersImport) { + specifiers.splice(specifiers.indexOf(handlersSpecifier), 1); + } + // Add new imports + for (const importToAdd of importsToAdd) { + specifiers.push(j.importSpecifier(j.identifier(importToAdd))); + } + }); + + // Replace requires of { Handlers } + tree + .find(j.VariableDeclaration, { + declarations: [ + { + type: 'VariableDeclarator', + init: { + type: 'CallExpression', + callee: { type: 'Identifier', name: 'require' }, + arguments: [{ value: '@sentry/node' }], + }, + }, + ], + }) + .forEach(path => { + if ( + path.value.declarations[0]?.type === 'VariableDeclarator' && + path.value.declarations[0]?.id.type === 'ObjectPattern' + ) { + const requireVars = path.value.declarations[0].id; + + const indexToDelete = shouldRemoveHandlersImport + ? requireVars.properties.findIndex(property => { + if (property.type !== 'ObjectProperty') { return false; - }) - : -1; + } - if (indexToDelete > -1) { - requireVars.properties.splice(indexToDelete, 1); - } + // This is what is imported, e.g. const {x} = Sentry; + if (property.key.type === 'Identifier' && property.key.name === 'Handlers') { + return true; + } - // Add new requires - for (const importToAdd of importsToAdd) { - const prop = j.objectProperty(j.identifier(importToAdd), j.identifier(importToAdd)); - prop.shorthand = true; + return false; + }) + : -1; - requireVars.properties.push(prop); - } + if (indexToDelete > -1) { + requireVars.properties.splice(indexToDelete, 1); } - }); - return tree.toSource(); - }); -}; + // Add new requires + for (const importToAdd of importsToAdd) { + const prop = j.objectProperty(j.identifier(importToAdd), j.identifier(importToAdd)); + prop.shorthand = true; + + requireVars.properties.push(prop); + } + } + }); + + return tree.toSource(); +} + +module.exports = adapt(nodeExports); diff --git a/src/transformers/nodeInstrumentFile/transform.cjs b/src/transformers/nodeInstrumentFile/transform.cjs index 588974c..925f6a2 100644 --- a/src/transformers/nodeInstrumentFile/transform.cjs +++ b/src/transformers/nodeInstrumentFile/transform.cjs @@ -1,7 +1,8 @@ const path = require('node:path'); const fs = require('node:fs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); +const { adapt } = require('jscodeshift-adapters'); + const { hasSentryImportOrRequire, getSentryInitExpression } = require('../../utils/jscodeshift.cjs'); /** @@ -11,110 +12,108 @@ const { hasSentryImportOrRequire, getSentryInitExpression } = require('../../uti * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function (fileInfo, api, options) { +function nodeInstrumentFile(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); - const sdk = options.sentry?.sdk; + const sdk = options.sentry?.sdk; - // This transform only applies to `@sentry/node` - for others, we do not want to do anything - if (sdk !== '@sentry/node' || !hasSentryImportOrRequire(source, sdk)) { - return undefined; - } + // This transform only applies to `@sentry/node` - for others, we do not want to do anything + if (sdk !== '@sentry/node' || !hasSentryImportOrRequire(source, sdk)) { + return undefined; + } - // If the file is already an instrument.js or similar file, we skip - // This is a simple heuristic, but implies that probably the Sentry code is already split out. - if (/(instrument)|(tracing)|(sentry)|(trace)(\w|)*\.(\w+)$/i.test(fileName)) { - return undefined; - } + // If the file is already an instrument.js or similar file, we skip + // This is a simple heuristic, but implies that probably the Sentry code is already split out. + if (/(instrument)|(tracing)|(sentry)|(trace)(\w|)*\.(\w+)$/i.test(fileName)) { + return undefined; + } - const sentryInit = getSentryInitExpression(j, tree, source); + const sentryInit = getSentryInitExpression(j, tree, source); - if (!sentryInit) { - return; - } + if (!sentryInit) { + return; + } - const sentryInitNode = sentryInit.paths()[0]; + const sentryInitNode = sentryInit.paths()[0]; - if (!sentryInitNode) { - return; - } + if (!sentryInitNode) { + return; + } - const folder = path.dirname(fileName); - const extension = path.extname(fileName); + const folder = path.dirname(fileName); + const extension = path.extname(fileName); - // Create new file - const instrumentFileName = `instrument${extension}`; - const instrumentFilePath = path.join(folder, instrumentFileName); + // Create new file + const instrumentFileName = `instrument${extension}`; + const instrumentFilePath = path.join(folder, instrumentFileName); - // If file already exists, we skip - if (fs.existsSync(instrumentFilePath)) { - return undefined; - } + // If file already exists, we skip + if (fs.existsSync(instrumentFilePath)) { + return undefined; + } - const sentryImport = tree.find(j.ImportDeclaration, { source: { type: 'StringLiteral', value: sdk } }); + const sentryImport = tree.find(j.ImportDeclaration, { source: { type: 'StringLiteral', value: sdk } }); - const instrumentFile = j(j(j.expressionStatement(sentryInitNode.value)).toSource()); + const instrumentFile = j(j(j.expressionStatement(sentryInitNode.value)).toSource()); - // Add all imports to the top of the instrument file - we later remove unused imports again - tree - .find(j.ImportDeclaration) - .paths() - .reverse() - .forEach(path => { - instrumentFile.get().node.program.body.unshift(j(path).toSource()); - }); + // Add all imports to the top of the instrument file - we later remove unused imports again + tree + .find(j.ImportDeclaration) + .paths() + .reverse() + .forEach(path => { + instrumentFile.get().node.program.body.unshift(j(path).toSource()); + }); - // Add all requires to the top of the instrument file - we later remove unused requires again - tree - .find(j.VariableDeclaration, { - declarations: [ - { - type: 'VariableDeclarator', - init: { - type: 'CallExpression', - callee: { type: 'Identifier', name: 'require' }, - }, + // Add all requires to the top of the instrument file - we later remove unused requires again + tree + .find(j.VariableDeclaration, { + declarations: [ + { + type: 'VariableDeclarator', + init: { + type: 'CallExpression', + callee: { type: 'Identifier', name: 'require' }, }, - ], - }) - .paths() - .reverse() - .forEach(path => { - instrumentFile.get().node.program.body.unshift(j(path).toSource()); - }); + }, + ], + }) + .paths() + .reverse() + .forEach(path => { + instrumentFile.get().node.program.body.unshift(j(path).toSource()); + }); - const instrumentFile2 = j(instrumentFile.toSource()); - removeUnusedImports(j, instrumentFile2); - removeUnusedRequires(j, instrumentFile2); + const instrumentFile2 = j(instrumentFile.toSource()); + removeUnusedImports(j, instrumentFile2); + removeUnusedRequires(j, instrumentFile2); - fs.writeFileSync(instrumentFilePath, instrumentFile2.toSource()); + fs.writeFileSync(instrumentFilePath, instrumentFile2.toSource()); - // Add import as first thing - // Note: We import/require without file extension, this is the most common way - // Potential improvement: - // We could check if the file has any relative imports / require and see if that uses file extension - if (sentryImport.length > 0) { - tree.get().node.program.body.unshift(j.importDeclaration([], j.literal('./instrument'))); - } else { - // Else we add a require - const requireStatement = j.callExpression(j.identifier('require'), [j.literal('./instrument')]); - tree.get().node.program.body.unshift(j.expressionStatement(requireStatement)); - } + // Add import as first thing + // Note: We import/require without file extension, this is the most common way + // Potential improvement: + // We could check if the file has any relative imports / require and see if that uses file extension + if (sentryImport.length > 0) { + tree.get().node.program.body.unshift(j.importDeclaration([], j.literal('./instrument'))); + } else { + // Else we add a require + const requireStatement = j.callExpression(j.identifier('require'), [j.literal('./instrument')]); + tree.get().node.program.body.unshift(j.expressionStatement(requireStatement)); + } - // Remove from original file - j(sentryInitNode).remove(); + // Remove from original file + j(sentryInitNode).remove(); - removeUnusedImports(j, tree); - removeUnusedRequires(j, tree); + removeUnusedImports(j, tree); + removeUnusedRequires(j, tree); - return tree.toSource(); - }); -}; + return tree.toSource(); +} /** * Remove any unused imports from the file. @@ -239,3 +238,5 @@ function identifierIsUsed(j, tree, name, parentType) { return usages.length > 0; } + +module.exports = adapt(nodeInstrumentFile); diff --git a/src/transformers/replayConfig/transform.cjs b/src/transformers/replayConfig/transform.cjs index 27a337f..7ee29d6 100644 --- a/src/transformers/replayConfig/transform.cjs +++ b/src/transformers/replayConfig/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { getSentryInitExpression } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); /** * This transform converts old replay privacy options to their new format. @@ -15,82 +16,80 @@ const { wrapJscodeshift } = require('../../utils/dom.cjs'); * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function replayConfig(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); - let block = j.arrayExpression([]); - let ignore = j.arrayExpression([]); - let mask = j.arrayExpression([]); + let block = j.arrayExpression([]); + let ignore = j.arrayExpression([]); + let mask = j.arrayExpression([]); - /** @type {number | undefined} */ - let replaysSessionSampleRate = undefined; - /** @type {number | undefined} */ - let replaysOnErrorSampleRate = undefined; + /** @type {number | undefined} */ + let replaysSessionSampleRate = undefined; + /** @type {number | undefined} */ + let replaysOnErrorSampleRate = undefined; - // First find new XX.Replay() - const newReplayExpression = getReplayNewExpression(j, tree); + // First find new XX.Replay() + const newReplayExpression = getReplayNewExpression(j, tree); - // If no new Replay() found, nothing to do - if (!newReplayExpression) { - return undefined; - } + // If no new Replay() found, nothing to do + if (!newReplayExpression) { + return undefined; + } - // If we have an old sample rate, check for Sentry.init() as well - const hasOldSampleRate = /(sessionSampleRate)|(errorSampleRate)/gim.test(source); - const sentryInitExpression = hasOldSampleRate ? getSentryInitExpression(j, tree, source) : undefined; + // If we have an old sample rate, check for Sentry.init() as well + const hasOldSampleRate = /(sessionSampleRate)|(errorSampleRate)/gim.test(source); + const sentryInitExpression = hasOldSampleRate ? getSentryInitExpression(j, tree, source) : undefined; - // Short circuit: If none of the "old" options are used, we just bail (=nothing to do) - if ( - !hasOldSampleRate && - !/(blockSelector)|(blockClass)|(ignoreClass)|(maskTextClass)|(maskTextSelector)/gim.test(source) - ) { + // Short circuit: If none of the "old" options are used, we just bail (=nothing to do) + if ( + !hasOldSampleRate && + !/(blockSelector)|(blockClass)|(ignoreClass)|(maskTextClass)|(maskTextSelector)/gim.test(source) + ) { + return; + } + + // Now find properties inside of new Replay() + newReplayExpression.find(j.ObjectProperty).forEach(path => { + if (path.value.key.type !== 'Identifier') { return; } - // Now find properties inside of new Replay() - newReplayExpression.find(j.ObjectProperty).forEach(path => { - if (path.value.key.type !== 'Identifier') { - return; - } + const keyName = path.value.key.name; - const keyName = path.value.key.name; - - // Find arrays for existing properties (e.g. block: ['aa', 'bb']) - if (path.value.value.type === 'ArrayExpression') { - /* + // Find arrays for existing properties (e.g. block: ['aa', 'bb']) + if (path.value.value.type === 'ArrayExpression') { + /* We want to handle these: block: ['aa', 'bb'], ignore: ['aa', 'bb'], mask: ['aa', 'bb'] */ - if (keyName === 'block') { - block = mergeArrayExpressions(j, block, path.value.value); - j(path).remove(); - return; - } - - if (keyName === 'ignore') { - ignore = mergeArrayExpressions(j, ignore, path.value.value); - j(path).remove(); - return; - } - - if (keyName === 'mask') { - mask = mergeArrayExpressions(j, mask, path.value.value); - j(path).remove(); - return; - } + if (keyName === 'block') { + block = mergeArrayExpressions(j, block, path.value.value); + j(path).remove(); + return; + } + + if (keyName === 'ignore') { + ignore = mergeArrayExpressions(j, ignore, path.value.value); + j(path).remove(); + return; } - // Find string literals values - if (path.value.value.type === 'StringLiteral') { - /* + if (keyName === 'mask') { + mask = mergeArrayExpressions(j, mask, path.value.value); + j(path).remove(); + return; + } + } + + // Find string literals values + if (path.value.value.type === 'StringLiteral') { + /* We want to handle these: blockSelector: '.my-blocks-selector,[my-block-attr]', blockClass: 'my-block-class', @@ -99,107 +98,106 @@ module.exports = function (fileInfo, api) { maskTextSelector: '.my-mask-text-selector,[my-mask-text-attr]', */ - const value = path.value.value.value; - - if (keyName === 'blockSelector') { - block.elements.push(...convertSelector(value).map(v => j.literal(v))); - j(path).remove(); - return; - } - if (keyName === 'blockClass') { - block.elements.push(...convertClassName(value).map(v => j.literal(v))); - j(path).remove(); - return; - } - if (keyName === 'ignoreClass') { - ignore.elements.push(...convertClassName(value).map(v => j.literal(v))); - j(path).remove(); - return; - } - if (keyName === 'maskTextClass') { - mask.elements.push(...convertClassName(value).map(v => j.literal(v))); - j(path).remove(); - return; - } - if (keyName === 'maskTextSelector') { - mask.elements.push(...convertSelector(value).map(v => j.literal(v))); - j(path).remove(); - return; - } + const value = path.value.value.value; + + if (keyName === 'blockSelector') { + block.elements.push(...convertSelector(value).map(v => j.literal(v))); + j(path).remove(); + return; + } + if (keyName === 'blockClass') { + block.elements.push(...convertClassName(value).map(v => j.literal(v))); + j(path).remove(); + return; + } + if (keyName === 'ignoreClass') { + ignore.elements.push(...convertClassName(value).map(v => j.literal(v))); + j(path).remove(); + return; + } + if (keyName === 'maskTextClass') { + mask.elements.push(...convertClassName(value).map(v => j.literal(v))); + j(path).remove(); + return; + } + if (keyName === 'maskTextSelector') { + mask.elements.push(...convertSelector(value).map(v => j.literal(v))); + j(path).remove(); + return; } + } - // Find numeric literal values for sample rates - // only do that if we have a Sentry.init() in the same file, otherwise there is no place to put it - // and we lose the sample rate - if (sentryInitExpression && path.value.value.type === 'NumericLiteral') { - /* + // Find numeric literal values for sample rates + // only do that if we have a Sentry.init() in the same file, otherwise there is no place to put it + // and we lose the sample rate + if (sentryInitExpression && path.value.value.type === 'NumericLiteral') { + /* We want to handle these: sessionSampleRate: 0.1, errorSampleRate: 0.75, */ - const value = path.value.value.value; - if (keyName === 'sessionSampleRate') { - replaysSessionSampleRate = value; - j(path).remove(); - return; - } - if (keyName === 'errorSampleRate') { - replaysOnErrorSampleRate = value; - j(path).remove(); - return; - } + const value = path.value.value.value; + if (keyName === 'sessionSampleRate') { + replaysSessionSampleRate = value; + j(path).remove(); + return; } - }); + if (keyName === 'errorSampleRate') { + replaysOnErrorSampleRate = value; + j(path).remove(); + return; + } + } + }); + + // Finally, actually update the options object + newReplayExpression.forEach(path => { + const arg = path.value.arguments[0]; + + if (!arg || arg.type !== 'ObjectExpression') { + return; + } - // Finally, actually update the options object - newReplayExpression.forEach(path => { + if (block.elements.length > 0) { + arg.properties.push(j.property('init', j.identifier('block'), block)); + } + if (ignore.elements.length > 0) { + arg.properties.push(j.property('init', j.identifier('ignore'), ignore)); + } + if (mask.elements.length > 0) { + arg.properties.push(j.property('init', j.identifier('mask'), mask)); + } + }); + + // Also maybe update the Sentry.init options + if ( + sentryInitExpression && + (typeof replaysSessionSampleRate === 'number' || typeof replaysOnErrorSampleRate === 'number') + ) { + sentryInitExpression.forEach(path => { const arg = path.value.arguments[0]; if (!arg || arg.type !== 'ObjectExpression') { return; } - if (block.elements.length > 0) { - arg.properties.push(j.property('init', j.identifier('block'), block)); - } - if (ignore.elements.length > 0) { - arg.properties.push(j.property('init', j.identifier('ignore'), ignore)); + if (typeof replaysSessionSampleRate === 'number') { + arg.properties.push( + j.property('init', j.identifier('replaysSessionSampleRate'), j.literal(replaysSessionSampleRate)) + ); } - if (mask.elements.length > 0) { - arg.properties.push(j.property('init', j.identifier('mask'), mask)); + + if (typeof replaysOnErrorSampleRate === 'number') { + arg.properties.push( + j.property('init', j.identifier('replaysOnErrorSampleRate'), j.literal(replaysOnErrorSampleRate)) + ); } }); + } - // Also maybe update the Sentry.init options - if ( - sentryInitExpression && - (typeof replaysSessionSampleRate === 'number' || typeof replaysOnErrorSampleRate === 'number') - ) { - sentryInitExpression.forEach(path => { - const arg = path.value.arguments[0]; - - if (!arg || arg.type !== 'ObjectExpression') { - return; - } - - if (typeof replaysSessionSampleRate === 'number') { - arg.properties.push( - j.property('init', j.identifier('replaysSessionSampleRate'), j.literal(replaysSessionSampleRate)) - ); - } - - if (typeof replaysOnErrorSampleRate === 'number') { - arg.properties.push( - j.property('init', j.identifier('replaysOnErrorSampleRate'), j.literal(replaysOnErrorSampleRate)) - ); - } - }); - } - - return tree.toSource(); - }); -}; + return tree.toSource(); +} /** * @param {string} selector @@ -256,3 +254,5 @@ function mergeArrayExpressions(j, existing, added) { // Else, make sure to add the added elements to the exsiting one return j.arrayExpression([...existing.elements, ...added.elements]); } + +module.exports = adapt(replayConfig); diff --git a/src/transformers/rewriteHubImports/transform.cjs b/src/transformers/rewriteHubImports/transform.cjs index 6fead53..bc7c22f 100644 --- a/src/transformers/rewriteHubImports/transform.cjs +++ b/src/transformers/rewriteHubImports/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { dedupeImportStatements, hasSentryImportOrRequire, rewriteCjsRequires } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const SENTRY_HUB_PACKAGE = '@sentry/hub'; const SENTRY_CORE_PACKAGE = '@sentry/core'; @@ -22,89 +23,86 @@ const APIS_ONLY_IN_CORE = [ * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function transform(fileInfo, api, options) { +function rewriteHubImports(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; if (!hasSentryImportOrRequire(source, SENTRY_HUB_PACKAGE)) { return undefined; } - return wrapJscodeshift(j, source, fileName, (j, source) => { - const root = j(source, options); - - /** @type {import('jscodeshift').ASTPath[]} */ - const sdkImportsToDedupe = []; - /** @type {import('jscodeshift').ASTPath[]} */ - const coreImportsToDedupe = []; - - let shouldInstallCore = false; - - // Pass 1: Replace mixed named hub imports with imports from the SDK package and @sentry/core - // e.g. import { makeSession, Hub } from '@sentry/hub' -> import { makeSession } from '@sentry/core'; import { Hub } from '@sentry/browser' - findHubImports(root, j).forEach(importPath => { - if (!importPath.node.specifiers) { - return; - } - if (importPath.node.specifiers.find(specifier => specifier.type !== 'ImportSpecifier')) { - // wo don't handle namespace imports here - // plus, we ignore default imports because our SDKs have no default exports - return; - } - - const coreSpecifiers = importPath.node.specifiers?.filter(spec => - APIS_ONLY_IN_CORE.includes(spec?.id?.name || spec?.local?.name || '') - ); - const sdkSpecifiers = importPath.node.specifiers?.filter( - spec => !APIS_ONLY_IN_CORE.includes(spec?.id?.name || spec?.local?.name || '') - ); - - if (coreSpecifiers.length) { - shouldInstallCore = true; - const coreImportDecl = j.importDeclaration(coreSpecifiers, j.literal(SENTRY_CORE_PACKAGE)); - importPath.insertBefore(coreImportDecl); - coreImportsToDedupe.push(j(coreImportDecl).get(0)); - } - if (sdkSpecifiers.length) { - const sdkImportDecl = j.importDeclaration(sdkSpecifiers, j.literal(options.sentry.sdk)); - importPath.insertBefore(sdkImportDecl); - sdkImportsToDedupe.push(j(sdkImportDecl).get(0)); - } - - importPath.replace(undefined); - }); - - // Pass 2: Replace namespace imports from @sentry/hub with imports from @sentry/core - findHubImports(root, j).forEach(importPath => { - if ( - importPath.node.specifiers?.length !== 1 || - importPath.node.specifiers[0]?.type !== 'ImportNamespaceSpecifier' - ) { - return; - } - // This is cheap but it's not easy to determine what properties are actually used from the namespace import - // so let's just default to import from Core for now. - importPath.node.source.value = SENTRY_CORE_PACKAGE; - shouldInstallCore = true; - }); + const root = j(source, options); - dedupeImportStatements(options.sentry.sdk, root, j); - dedupeImportStatements(SENTRY_CORE_PACKAGE, root, j); + /** @type {import('jscodeshift').ASTPath[]} */ + const sdkImportsToDedupe = []; + /** @type {import('jscodeshift').ASTPath[]} */ + const coreImportsToDedupe = []; - // Pass 3 (or 1 for CJS): Replace require('@sentry/hub') with require('@sentry/core') - // The same thing as in pass 2 applies here basically. It's easier to just rewrite to @sentry/core - // than figuring out which of the declarators use APIs that could have been exported from the SDK package - shouldInstallCore = shouldInstallCore || rewriteCjsRequires(SENTRY_HUB_PACKAGE, SENTRY_CORE_PACKAGE, root, j); + let shouldInstallCore = false; - if (shouldInstallCore) { - // @ts-ignore - it's ugly but it'll work... - options.sentry._needsCore = true; + // Pass 1: Replace mixed named hub imports with imports from the SDK package and @sentry/core + // e.g. import { makeSession, Hub } from '@sentry/hub' -> import { makeSession } from '@sentry/core'; import { Hub } from '@sentry/browser' + findHubImports(root, j).forEach(importPath => { + if (!importPath.node.specifiers) { + return; + } + if (importPath.node.specifiers.find(specifier => specifier.type !== 'ImportSpecifier')) { + // wo don't handle namespace imports here + // plus, we ignore default imports because our SDKs have no default exports + return; } - return root.toSource(); + const coreSpecifiers = importPath.node.specifiers?.filter(spec => + APIS_ONLY_IN_CORE.includes(spec?.id?.name || spec?.local?.name || '') + ); + const sdkSpecifiers = importPath.node.specifiers?.filter( + spec => !APIS_ONLY_IN_CORE.includes(spec?.id?.name || spec?.local?.name || '') + ); + + if (coreSpecifiers.length) { + shouldInstallCore = true; + const coreImportDecl = j.importDeclaration(coreSpecifiers, j.literal(SENTRY_CORE_PACKAGE)); + importPath.insertBefore(coreImportDecl); + coreImportsToDedupe.push(j(coreImportDecl).get(0)); + } + if (sdkSpecifiers.length) { + const sdkImportDecl = j.importDeclaration(sdkSpecifiers, j.literal(options.sentry.sdk)); + importPath.insertBefore(sdkImportDecl); + sdkImportsToDedupe.push(j(sdkImportDecl).get(0)); + } + + importPath.replace(undefined); + }); + + // Pass 2: Replace namespace imports from @sentry/hub with imports from @sentry/core + findHubImports(root, j).forEach(importPath => { + if ( + importPath.node.specifiers?.length !== 1 || + importPath.node.specifiers[0]?.type !== 'ImportNamespaceSpecifier' + ) { + return; + } + // This is cheap but it's not easy to determine what properties are actually used from the namespace import + // so let's just default to import from Core for now. + importPath.node.source.value = SENTRY_CORE_PACKAGE; + shouldInstallCore = true; }); -}; + + dedupeImportStatements(options.sentry.sdk, root, j); + dedupeImportStatements(SENTRY_CORE_PACKAGE, root, j); + + // Pass 3 (or 1 for CJS): Replace require('@sentry/hub') with require('@sentry/core') + // The same thing as in pass 2 applies here basically. It's easier to just rewrite to @sentry/core + // than figuring out which of the declarators use APIs that could have been exported from the SDK package + shouldInstallCore = shouldInstallCore || rewriteCjsRequires(SENTRY_HUB_PACKAGE, SENTRY_CORE_PACKAGE, root, j); + + if (shouldInstallCore) { + // @ts-ignore - it's ugly but it'll work... + options.sentry._needsCore = true; + } + + return root.toSource(); +} /** * Finds imports from `@sentry/hub` @@ -114,3 +112,5 @@ module.exports = function transform(fileInfo, api, options) { function findHubImports(root, j) { return root.find(j.ImportDeclaration, { source: { value: SENTRY_HUB_PACKAGE } }); } + +module.exports = adapt(rewriteHubImports); diff --git a/src/transformers/rewriteIntegrationsImports/transform.cjs b/src/transformers/rewriteIntegrationsImports/transform.cjs index 3c2c26e..ee78850 100644 --- a/src/transformers/rewriteIntegrationsImports/transform.cjs +++ b/src/transformers/rewriteIntegrationsImports/transform.cjs @@ -1,10 +1,11 @@ +const { adapt } = require('jscodeshift-adapters'); + const { dedupeImportStatements, hasSentryImportOrRequire, rewriteCjsRequires, rewriteEsmImports, } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const SENTRY_INTEGRATIONS_PACKAGE = '@sentry/integrations'; @@ -15,30 +16,29 @@ const SENTRY_INTEGRATIONS_PACKAGE = '@sentry/integrations'; * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function transform(fileInfo, api, options) { +function rewriteIntegrationsImports(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; const sdk = options.sentry.sdk; if (!hasSentryImportOrRequire(fileInfo.source, SENTRY_INTEGRATIONS_PACKAGE) || !sdk) { return undefined; } - return wrapJscodeshift(j, source, fileName, (j, source) => { - const root = j(source, options); + const root = j(source, options); + + // 1. Replace import with SDK import + const importPaths = rewriteEsmImports(SENTRY_INTEGRATIONS_PACKAGE, sdk, root, j); - // 1. Replace import with SDK import - const importPaths = rewriteEsmImports(SENTRY_INTEGRATIONS_PACKAGE, sdk, root, j); + // 2. Dedupe imports + if (importPaths.length > 0) { + dedupeImportStatements(sdk, root, j); + } - // 2. Dedupe imports - if (importPaths.length > 0) { - dedupeImportStatements(sdk, root, j); - } + // 3. Replace requires + rewriteCjsRequires(SENTRY_INTEGRATIONS_PACKAGE, sdk, root, j); - // 3. Replace requires - rewriteCjsRequires(SENTRY_INTEGRATIONS_PACKAGE, sdk, root, j); + return root.toSource(); +} - return root.toSource(); - }); -}; +module.exports = adapt(rewriteIntegrationsImports); diff --git a/src/transformers/rewriteReplayImports/transform.cjs b/src/transformers/rewriteReplayImports/transform.cjs index a56ec5f..effe338 100644 --- a/src/transformers/rewriteReplayImports/transform.cjs +++ b/src/transformers/rewriteReplayImports/transform.cjs @@ -1,10 +1,11 @@ +const { adapt } = require('jscodeshift-adapters'); + const { rewriteEsmImports, dedupeImportStatements, hasSentryImportOrRequire, rewriteCjsRequires, } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const SENTRY_REPLAY_PACKAGE = '@sentry/replay'; @@ -20,30 +21,29 @@ const SENTRY_REPLAY_PACKAGE = '@sentry/replay'; * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function transform(fileInfo, api, options) { +function rewriteReplayImports(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; const sdk = options.sentry.sdk; if (!hasSentryImportOrRequire(fileInfo.source, SENTRY_REPLAY_PACKAGE) || !sdk) { return undefined; } - return wrapJscodeshift(j, source, fileName, (j, source) => { - const root = j(source, options); + const root = j(source, options); + + // 1. Replace import with SDK import + const importPaths = rewriteEsmImports(SENTRY_REPLAY_PACKAGE, sdk, root, j); - // 1. Replace import with SDK import - const importPaths = rewriteEsmImports(SENTRY_REPLAY_PACKAGE, sdk, root, j); + // 2. Dedupe imports + if (importPaths.length > 0) { + dedupeImportStatements(sdk, root, j); + } - // 2. Dedupe imports - if (importPaths.length > 0) { - dedupeImportStatements(sdk, root, j); - } + // 3. Replace requires + rewriteCjsRequires(SENTRY_REPLAY_PACKAGE, sdk, root, j); - // 3. Replace requires - rewriteCjsRequires(SENTRY_REPLAY_PACKAGE, sdk, root, j); + return root.toSource(); +} - return root.toSource(); - }); -}; +module.exports = adapt(rewriteReplayImports); diff --git a/src/transformers/rewriteSvelteConfig/transform.cjs b/src/transformers/rewriteSvelteConfig/transform.cjs index 26d9b04..bd1b757 100644 --- a/src/transformers/rewriteSvelteConfig/transform.cjs +++ b/src/transformers/rewriteSvelteConfig/transform.cjs @@ -1,3 +1,5 @@ +const { adapt } = require('jscodeshift-adapters'); + const { hasSentryImportOrRequire } = require('../../utils/jscodeshift.cjs'); /** @@ -10,7 +12,7 @@ const { hasSentryImportOrRequire } = require('../../utils/jscodeshift.cjs'); * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function transform(fileInfo, api, options) { +function rewriteSvelteConfig(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; @@ -30,7 +32,7 @@ module.exports = function transform(fileInfo, api, options) { /** { @type import('jscodeshift').ASTPath | undefined */ const sentryNamespaceImport = sentryNamespaceImports.length ? sentryNamespaceImports.get() : undefined; - const sentryNameSpace = sentryNamespaceImport?.node.specifiers?.[0].local?.name; + const sentryNameSpace = sentryNamespaceImport?.node.specifiers?.[0]?.local?.name; // 1. remove `sentryComponentTrackingPreprocessor()` @@ -89,4 +91,6 @@ module.exports = function transform(fileInfo, api, options) { }); } return root.toSource(); -}; +} + +module.exports = adapt(rewriteSvelteConfig); diff --git a/src/transformers/rewriteTracingImports/transform.cjs b/src/transformers/rewriteTracingImports/transform.cjs index 58518fb..ae855c6 100644 --- a/src/transformers/rewriteTracingImports/transform.cjs +++ b/src/transformers/rewriteTracingImports/transform.cjs @@ -1,10 +1,11 @@ +const { adapt } = require('jscodeshift-adapters'); + const { rewriteEsmImports, rewriteCjsRequires, dedupeImportStatements, hasSentryImportOrRequire, } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const SENTRY_TRACING_PACKAGE = '@sentry/tracing'; @@ -14,28 +15,27 @@ const SENTRY_TRACING_PACKAGE = '@sentry/tracing'; * @param {import('jscodeshift').API} api * @param {import('jscodeshift').Options & { sentry: import('types').RunOptions & {sdk: string} }} options */ -module.exports = function transform(fileInfo, api, options) { +function rewriteTracingImports(fileInfo, api, options) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; if (!hasSentryImportOrRequire(source, '@sentry/tracing')) { return undefined; } - return wrapJscodeshift(j, source, fileName, (j, source) => { - const root = j(source, options); + const root = j(source, options); + + // 1. Replace tracing import with SDK import + rewriteEsmImports(SENTRY_TRACING_PACKAGE, options.sentry.sdk, root, j); + dedupeImportStatements(options.sentry.sdk, root, j); - // 1. Replace tracing import with SDK import - rewriteEsmImports(SENTRY_TRACING_PACKAGE, options.sentry.sdk, root, j); - dedupeImportStatements(options.sentry.sdk, root, j); + // 2. Replace tracing require with SDK require + rewriteCjsRequires(SENTRY_TRACING_PACKAGE, options.sentry.sdk, root, j); - // 2. Replace tracing require with SDK require - rewriteCjsRequires(SENTRY_TRACING_PACKAGE, options.sentry.sdk, root, j); + // TODO: dedupe requires. We can do it but for now I'm gonna skip it. + // ending up with duplicated requires/imports is not the end of the world. - // TODO: dedupe requires. We can do it but for now I'm gonna skip it. - // ending up with duplicated requires/imports is not the end of the world. + return root.toSource(); +} - return root.toSource(); - }); -}; +module.exports = adapt(rewriteTracingImports); diff --git a/src/transformers/tracingConfig/transform.cjs b/src/transformers/tracingConfig/transform.cjs index f4b519c..241932f 100644 --- a/src/transformers/tracingConfig/transform.cjs +++ b/src/transformers/tracingConfig/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { getSentryInitExpression } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); /** * This transform converts old tracing options to their new format. @@ -11,41 +12,38 @@ const { wrapJscodeshift } = require('../../utils/dom.cjs'); * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function tracingConfig(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); + const tree = j(source); - // First we look for `tracePropagationTargets` as integration config, moving it to root + // First we look for `tracePropagationTargets` as integration config, moving it to root - const sentryInit = getSentryInitExpression(j, tree, source); + const sentryInit = getSentryInitExpression(j, tree, source); - // Nothing to do if we can't find the init expression - if (!sentryInit) { - return; - } + // Nothing to do if we can't find the init expression + if (!sentryInit) { + return; + } - // Find & update options on `new BrowserTracing()` - const newBrowserTracing = getIntegrationNewExpression(j, tree, 'BrowserTracing'); - const newHttp = getIntegrationNewExpression(j, tree, 'Http'); - const newUndici = getIntegrationNewExpression(j, tree, 'Undici'); + // Find & update options on `new BrowserTracing()` + const newBrowserTracing = getIntegrationNewExpression(j, tree, 'BrowserTracing'); + const newHttp = getIntegrationNewExpression(j, tree, 'Http'); + const newUndici = getIntegrationNewExpression(j, tree, 'Undici'); - if (newBrowserTracing) { - fixTracePropagationTargets(j, sentryInit, newBrowserTracing); - } - if (newHttp) { - fixTracePropagationTargets(j, sentryInit, newHttp); - } - if (newUndici) { - fixTracePropagationTargets(j, sentryInit, newUndici); - } + if (newBrowserTracing) { + fixTracePropagationTargets(j, sentryInit, newBrowserTracing); + } + if (newHttp) { + fixTracePropagationTargets(j, sentryInit, newHttp); + } + if (newUndici) { + fixTracePropagationTargets(j, sentryInit, newUndici); + } - return tree.toSource(); - }); -}; + return tree.toSource(); +} /** * @@ -114,3 +112,5 @@ function fixTracePropagationTargets(j, sentryInit, newExpression) { }); }); } + +module.exports = adapt(tracingConfig); diff --git a/src/transformers/utilExports/transform.cjs b/src/transformers/utilExports/transform.cjs index daca901..a07043e 100644 --- a/src/transformers/utilExports/transform.cjs +++ b/src/transformers/utilExports/transform.cjs @@ -1,5 +1,6 @@ +const { adapt } = require('jscodeshift-adapters'); + const { replaceFunctionCalls, replaceImported } = require('../../utils/jscodeshift.cjs'); -const { wrapJscodeshift } = require('../../utils/dom.cjs'); const FunctionMap = new Map([['severityFromString', 'severityLevelFromString']]); @@ -13,68 +14,67 @@ const FunctionMap = new Map([['severityFromString', 'severityLevelFromString']]) * * @type {import('jscodeshift').Transform} */ -module.exports = function (fileInfo, api) { +function utilExports(fileInfo, api) { const j = api.jscodeshift; const source = fileInfo.source; - const fileName = fileInfo.path; - - return wrapJscodeshift(j, source, fileName, (j, source) => { - const tree = j(source); - - // Replace function calls - const hasChangedFunctionCalls = replaceFunctionCalls(j, tree, source, '@sentry/utils', FunctionMap); - - /** @type {Map} */ - const importsToReplace = new Map(); - - // Replace getGlobalObject() with GLOBAL_OBJ - tree.find(j.CallExpression).forEach(path => { - if (path.value.callee.type !== 'Identifier') { - return; - } - - const orig = path.value.callee.name; - - if (orig === 'getGlobalObject') { - path.replace(j.identifier('GLOBAL_OBJ')); - importsToReplace.set('getGlobalObject', 'GLOBAL_OBJ'); - return; - } - }); - - // Replace `SentryUtils.getGlobalObject()` with `SentryUtils.GLOBAL_OBJ` - tree.find(j.CallExpression, { callee: { type: 'MemberExpression' } }).forEach(path => { - if (path.value.callee.type !== 'MemberExpression' || path.value.callee.property.type !== 'Identifier') { - return; - } - - const orig = path.value.callee.property.name; - - if (orig === 'getGlobalObject') { - path.replace(j.identifier('GLOBAL_OBJ')); - importsToReplace.set('getGlobalObject', 'GLOBAL_OBJ'); - } - }); - - // Replace timestampWithMs with timestampInSeconds - tree.find(j.Identifier, { name: 'timestampWithMs' }).forEach(path => { - const orig = path.value.name; - - if (orig === 'timestampWithMs') { - path.replace(j.identifier('timestampInSeconds')); - importsToReplace.set('timestampWithMs', 'timestampInSeconds'); - return; - } - }); - - if (importsToReplace.size > 0) { - replaceImported(j, tree, source, '@sentry/utils', importsToReplace); + + const tree = j(source); + + // Replace function calls + const hasChangedFunctionCalls = replaceFunctionCalls(j, tree, source, '@sentry/utils', FunctionMap); + + /** @type {Map} */ + const importsToReplace = new Map(); + + // Replace getGlobalObject() with GLOBAL_OBJ + tree.find(j.CallExpression).forEach(path => { + if (path.value.callee.type !== 'Identifier') { + return; } - if (!hasChangedFunctionCalls && importsToReplace.size === 0) { + const orig = path.value.callee.name; + + if (orig === 'getGlobalObject') { + path.replace(j.identifier('GLOBAL_OBJ')); + importsToReplace.set('getGlobalObject', 'GLOBAL_OBJ'); + return; + } + }); + + // Replace `SentryUtils.getGlobalObject()` with `SentryUtils.GLOBAL_OBJ` + tree.find(j.CallExpression, { callee: { type: 'MemberExpression' } }).forEach(path => { + if (path.value.callee.type !== 'MemberExpression' || path.value.callee.property.type !== 'Identifier') { return; } - return tree.toSource(); + const orig = path.value.callee.property.name; + + if (orig === 'getGlobalObject') { + path.replace(j.identifier('GLOBAL_OBJ')); + importsToReplace.set('getGlobalObject', 'GLOBAL_OBJ'); + } }); -}; + + // Replace timestampWithMs with timestampInSeconds + tree.find(j.Identifier, { name: 'timestampWithMs' }).forEach(path => { + const orig = path.value.name; + + if (orig === 'timestampWithMs') { + path.replace(j.identifier('timestampInSeconds')); + importsToReplace.set('timestampWithMs', 'timestampInSeconds'); + return; + } + }); + + if (importsToReplace.size > 0) { + replaceImported(j, tree, source, '@sentry/utils', importsToReplace); + } + + if (!hasChangedFunctionCalls && importsToReplace.size === 0) { + return; + } + + return tree.toSource(); +} + +module.exports = adapt(utilExports); diff --git a/src/utils/dom.cjs b/src/utils/dom.cjs deleted file mode 100644 index f7802c7..0000000 --- a/src/utils/dom.cjs +++ /dev/null @@ -1,66 +0,0 @@ -const { parse } = require('node-html-parser'); - -/** - * Parse the contents of