From 233de8e6d8a51e64f44d257edfbade67afef16bd Mon Sep 17 00:00:00 2001 From: Andrew Vassilyev Date: Thu, 21 Nov 2024 02:59:37 +0500 Subject: [PATCH] 88: react-support --- README.md | 3 + docs/react.md | 8 + package.json | 14 +- pnpm-lock.yaml | 258 ++++++++++-------- .../__compiled__/cjs/js.js | 6 + .../__compiled__/cjs/js.js.map | 1 + .../__compiled__/cjs/jsx.js | 6 + .../__compiled__/cjs/jsx.js.map | 1 + .../__compiled__/cjs/tsx.js | 6 + .../__compiled__/cjs/tsx.js.map | 1 + .../__compiled__/esm/js.mjs | 6 + .../__compiled__/esm/js.mjs.map | 1 + .../__compiled__/esm/jsx.mjs | 6 + .../__compiled__/esm/jsx.mjs.map | 1 + .../__compiled__/esm/tsx.mjs | 6 + .../__compiled__/esm/tsx.mjs.map | 1 + .../js/index.d.ts | 1 + .../js/index.js | 1 + .../js/index.mjs | 1 + .../jsx/index.d.ts | 1 + .../jsx/index.js | 1 + .../jsx/index.mjs | 1 + .../package.json | 40 +++ .../tsx/index.d.ts | 1 + .../tsx/index.js | 1 + .../tsx/index.mjs | 1 + .../__compiled__/cjs/js.js | 6 + .../__compiled__/cjs/js.js.map | 1 + .../__compiled__/cjs/jsx.js | 6 + .../__compiled__/cjs/jsx.js.map | 1 + .../__compiled__/cjs/tsx.js | 6 + .../__compiled__/cjs/tsx.js.map | 1 + .../__compiled__/esm/js.mjs | 6 + .../__compiled__/esm/js.mjs.map | 1 + .../__compiled__/esm/jsx.mjs | 6 + .../__compiled__/esm/jsx.mjs.map | 1 + .../__compiled__/esm/tsx.mjs | 6 + .../__compiled__/esm/tsx.mjs.map | 1 + .../js/index.d.ts | 1 + .../js/index.js | 1 + .../js/index.mjs | 1 + .../jsx/index.d.ts | 1 + .../jsx/index.js | 1 + .../jsx/index.mjs | 1 + .../package.json | 40 +++ .../tsx/index.d.ts | 1 + .../tsx/index.js | 1 + .../tsx/index.mjs | 1 + src/build.test.ts | 41 +++ src/buildVite.ts | 32 ++- src/createViteConfig.ts | 4 +- src/fixtures/react-jsx-error/legacy-js.js | 3 + src/fixtures/react-jsx-error/legacy-jsx.jsx | 3 + src/fixtures/react-jsx-error/package.json | 10 + src/fixtures/react-legacy-transform/js.js | 3 + src/fixtures/react-legacy-transform/jsx.jsx | 3 + .../react-legacy-transform/package.json | 15 + .../react-legacy-transform/tsconfig.json | 12 + src/fixtures/react-legacy-transform/tsx.tsx | 3 + src/fixtures/react-modern-transform/js.js | 1 + src/fixtures/react-modern-transform/jsx.jsx | 1 + .../react-modern-transform/package.json | 15 + .../react-modern-transform/tsconfig.json | 12 + src/fixtures/react-modern-transform/tsx.tsx | 1 + src/index.ts | 12 +- src/plugins/react/index.ts | 67 +++++ src/run.ts | 8 +- 67 files changed, 571 insertions(+), 140 deletions(-) create mode 100644 docs/react.md create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js.map create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js.map create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js.map create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs.map create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs.map create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs.map create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.d.ts create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.js create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.mjs create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.d.ts create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.js create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.mjs create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/package.json create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.d.ts create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.js create mode 100644 src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.mjs create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js.map create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js.map create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js.map create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs.map create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs.map create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs.map create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.d.ts create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.js create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.mjs create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.d.ts create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.js create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.mjs create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/package.json create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.d.ts create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.js create mode 100644 src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.mjs create mode 100644 src/fixtures/react-jsx-error/legacy-js.js create mode 100644 src/fixtures/react-jsx-error/legacy-jsx.jsx create mode 100644 src/fixtures/react-jsx-error/package.json create mode 100644 src/fixtures/react-legacy-transform/js.js create mode 100644 src/fixtures/react-legacy-transform/jsx.jsx create mode 100644 src/fixtures/react-legacy-transform/package.json create mode 100644 src/fixtures/react-legacy-transform/tsconfig.json create mode 100644 src/fixtures/react-legacy-transform/tsx.tsx create mode 100644 src/fixtures/react-modern-transform/js.js create mode 100644 src/fixtures/react-modern-transform/jsx.jsx create mode 100644 src/fixtures/react-modern-transform/package.json create mode 100644 src/fixtures/react-modern-transform/tsconfig.json create mode 100644 src/fixtures/react-modern-transform/tsx.tsx create mode 100644 src/plugins/react/index.ts diff --git a/README.md b/README.md index e8ae556..0846fe6 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,9 @@ Just install `typescript@^5.0.0` as a dev dependency and start creating ts files ### Babel Just install `@babel/core@^7.0.0` as a dev dependency and create a Babel configuration file in the project root. +### React +Just install `react`. More information on React integration can be found [here](./docs/react.md). + ## `package.json` limitations To reduce potential errors and ensure smooth package generation, we follow a stricter configuration for `package.json`. diff --git a/docs/react.md b/docs/react.md new file mode 100644 index 0000000..3df23ce --- /dev/null +++ b/docs/react.md @@ -0,0 +1,8 @@ +# React Integration + +## Installation +Simply install `react` in your project, and you're all set to use it. + +## Optimizations +- For `react@<17.0.0`, SmartBundle compiles JSX files into `React.createElement` calls. +- For `react@>=17.0.0`, SmartBundle compiles JSX files into `jsx/runtime` [calls](https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html). diff --git a/package.json b/package.json index 788993f..246e763 100644 --- a/package.json +++ b/package.json @@ -35,22 +35,24 @@ "license": "MIT", "devDependencies": { "@types/babel__core": "^7.20.5", - "@types/node": "^20.14.11", + "@types/node": "^20.17.6", + "@types/semver": "^7.5.8", "@types/yargs": "^17.0.33", "prettier": "^3.3.3", "typescript": "^5.6.3", - "vitest": "^2.1.3", + "vitest": "^2.1.5", "vitest-directory-snapshot": "^0.2.2", - "zx": "^8.1.9" + "zx": "^8.2.2" }, "dependencies": { - "vite": "^5.4.9", + "semver": "^7.6.3", + "vite": "^5.4.11", "yargs": "^17.7.2", "zod": "^3.23.8" }, "optionalDependencies": { - "typescript": "^5.0.0", - "@babel/core": "^7.0.0" + "@babel/core": "^7.26.0", + "typescript": "^5.6.3" }, "exports": "./src/index.ts" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 00e8a4b..b7bf960 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,12 @@ importers: .: dependencies: + semver: + specifier: ^7.6.3 + version: 7.6.3 vite: - specifier: ^5.4.9 - version: 5.4.9(@types/node@20.14.11)(terser@5.31.3) + specifier: ^5.4.11 + version: 5.4.11(@types/node@20.17.6)(terser@5.31.3) yargs: specifier: ^17.7.2 version: 17.7.2 @@ -19,18 +22,21 @@ importers: version: 3.23.8 optionalDependencies: '@babel/core': - specifier: ^7.0.0 + specifier: ^7.26.0 version: 7.26.0 typescript: - specifier: ^5.0.0 + specifier: ^5.6.3 version: 5.6.3 devDependencies: '@types/babel__core': specifier: ^7.20.5 version: 7.20.5 '@types/node': - specifier: ^20.14.11 - version: 20.14.11 + specifier: ^20.17.6 + version: 20.17.6 + '@types/semver': + specifier: ^7.5.8 + version: 7.5.8 '@types/yargs': specifier: ^17.0.33 version: 17.0.33 @@ -38,14 +44,14 @@ importers: specifier: ^3.3.3 version: 3.3.3 vitest: - specifier: ^2.1.3 - version: 2.1.3(@types/node@20.14.11)(terser@5.31.3) + specifier: ^2.1.5 + version: 2.1.5(@types/node@20.17.6)(terser@5.31.3) vitest-directory-snapshot: specifier: ^0.2.2 - version: 0.2.2(vitest@2.1.3(@types/node@20.14.11)(terser@5.31.3)) + version: 0.2.2(vitest@2.1.5(@types/node@20.17.6)(terser@5.31.3)) zx: - specifier: ^8.1.9 - version: 8.1.9 + specifier: ^8.2.2 + version: 8.2.2 packages: @@ -376,8 +382,11 @@ packages: '@types/jsonfile@6.1.4': resolution: {integrity: sha512-D5qGUYwjvnNNextdU59/+fI+spnwtTFmyQP0h+PfIOSkNfpU6AOICUOkm4i0OnSk+NyjdPJrxCDro0sJsWlRpQ==} - '@types/node@20.14.11': - resolution: {integrity: sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==} + '@types/node@20.17.6': + resolution: {integrity: sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==} + + '@types/semver@7.5.8': + resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} @@ -385,14 +394,13 @@ packages: '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - '@vitest/expect@2.1.3': - resolution: {integrity: sha512-SNBoPubeCJhZ48agjXruCI57DvxcsivVDdWz+SSsmjTT4QN/DfHk3zB/xKsJqMs26bLZ/pNRLnCf0j679i0uWQ==} + '@vitest/expect@2.1.5': + resolution: {integrity: sha512-nZSBTW1XIdpZvEJyoP/Sy8fUg0b8od7ZpGDkTUcfJ7wz/VoZAFzFfLyxVxGFhUjJzhYqSbIpfMtl/+k/dpWa3Q==} - '@vitest/mocker@2.1.3': - resolution: {integrity: sha512-eSpdY/eJDuOvuTA3ASzCjdithHa+GIF1L4PqtEELl6Qa3XafdMLBpBlZCIUCX2J+Q6sNmjmxtosAG62fK4BlqQ==} + '@vitest/mocker@2.1.5': + resolution: {integrity: sha512-XYW6l3UuBmitWqSUXTNXcVBUCRytDogBsWuNXQijc00dtnU/9OqpXWp4OJroVrad/gLIomAq9aW8yWDBtMthhQ==} peerDependencies: - '@vitest/spy': 2.1.3 - msw: ^2.3.5 + msw: ^2.4.9 vite: ^5.0.0 peerDependenciesMeta: msw: @@ -400,23 +408,23 @@ packages: vite: optional: true - '@vitest/pretty-format@2.1.3': - resolution: {integrity: sha512-XH1XdtoLZCpqV59KRbPrIhFCOO0hErxrQCMcvnQete3Vibb9UeIOX02uFPfVn3Z9ZXsq78etlfyhnkmIZSzIwQ==} + '@vitest/pretty-format@2.1.5': + resolution: {integrity: sha512-4ZOwtk2bqG5Y6xRGHcveZVr+6txkH7M2e+nPFd6guSoN638v/1XQ0K06eOpi0ptVU/2tW/pIU4IoPotY/GZ9fw==} - '@vitest/runner@2.1.3': - resolution: {integrity: sha512-JGzpWqmFJ4fq5ZKHtVO3Xuy1iF2rHGV4d/pdzgkYHm1+gOzNZtqjvyiaDGJytRyMU54qkxpNzCx+PErzJ1/JqQ==} + '@vitest/runner@2.1.5': + resolution: {integrity: sha512-pKHKy3uaUdh7X6p1pxOkgkVAFW7r2I818vHDthYLvUyjRfkKOU6P45PztOch4DZarWQne+VOaIMwA/erSSpB9g==} - '@vitest/snapshot@2.1.3': - resolution: {integrity: sha512-qWC2mWc7VAXmjAkEKxrScWHWFyCQx/cmiZtuGqMi+WwqQJ2iURsVY4ZfAK6dVo6K2smKRU6l3BPwqEBvhnpQGg==} + '@vitest/snapshot@2.1.5': + resolution: {integrity: sha512-zmYw47mhfdfnYbuhkQvkkzYroXUumrwWDGlMjpdUr4jBd3HZiV2w7CQHj+z7AAS4VOtWxI4Zt4bWt4/sKcoIjg==} - '@vitest/spy@2.1.3': - resolution: {integrity: sha512-Nb2UzbcUswzeSP7JksMDaqsI43Sj5+Kry6ry6jQJT4b5gAK+NS9NED6mDb8FlMRCX8m5guaHCDZmqYMMWRy5nQ==} + '@vitest/spy@2.1.5': + resolution: {integrity: sha512-aWZF3P0r3w6DiYTVskOYuhBc7EMc3jvn1TkBg8ttylFFRqNN2XGD7V5a4aQdk6QiUzZQ4klNBSpCLJgWNdIiNw==} - '@vitest/utils@2.1.3': - resolution: {integrity: sha512-xpiVfDSg1RrYT0tX6czgerkpcKFmFOF/gCr30+Mve5V2kewCy4Prn1/NDMSRwaSmT7PRaOF83wu+bEtsY1wrvA==} + '@vitest/utils@2.1.5': + resolution: {integrity: sha512-yfj6Yrp0Vesw2cwJbP+cl04OC+IHFsuQsrsJBL9pyGeQXE56v1UAOQco+SR55Vf1nQzfV0QJg1Qum7AaWUwwYg==} - acorn@8.12.1: - resolution: {integrity: sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==} + acorn@8.14.0: + resolution: {integrity: sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==} engines: {node: '>=0.4.0'} hasBin: true @@ -447,8 +455,8 @@ packages: caniuse-lite@1.0.30001680: resolution: {integrity: sha512-rPQy70G6AGUMnbwS1z6Xg+RkHYPAi18ihs47GH0jcxIG7wArmPgY3XbS2sRdBbxJljp3thdT8BIqv9ccCypiPA==} - chai@5.1.1: - resolution: {integrity: sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==} + chai@5.1.2: + resolution: {integrity: sha512-aGtmf24DW6MLHHG5gCx4zaI3uBq3KRtxeVs0DjFH6Z0rDNbsvTxFASFvdj79pxjxZ8/5u3PIiN3IwEIQkiiuPw==} engines: {node: '>=12'} check-error@2.1.1: @@ -491,15 +499,14 @@ packages: emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + es-module-lexer@1.5.4: + resolution: {integrity: sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==} + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} hasBin: true - escalade@3.1.2: - resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} - engines: {node: '>=6'} - escalade@3.2.0: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} @@ -507,6 +514,10 @@ packages: estree-walker@3.0.3: resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + expect-type@1.1.0: + resolution: {integrity: sha512-bFi65yM+xZgk+u/KRIpekdSYkTB5W1pEf0Lt8Q8Msh7b+eQ7LXVtIB1Bkm4fvclDEL1b2CZkMhv2mOeF8tMdkA==} + engines: {node: '>=12.0.0'} + fsevents@2.3.3: resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} @@ -520,9 +531,6 @@ packages: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - get-func-name@2.0.2: - resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} - globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -544,8 +552,8 @@ packages: engines: {node: '>=6'} hasBin: true - loupe@3.1.1: - resolution: {integrity: sha512-edNu/8D5MKVfGVFRhFf8aAxiTM6Wumfz5XsaatSxlD3w4R1d/WEKUTydCdPGbl9K7QG/Ca3GnDV2sIKIpXRQcw==} + loupe@3.1.2: + resolution: {integrity: sha512-23I4pFZHmAemUnz8WZXbYRSKYj801VDaNv9ETuMh7IrMc7VuVVSo+Z9iLE3ni30+U48iDWfi30d3twAXBYmnCg==} lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} @@ -596,6 +604,11 @@ packages: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} hasBin: true + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + siginfo@2.0.0: resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} @@ -613,8 +626,8 @@ packages: stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} - std-env@3.7.0: - resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} + std-env@3.8.0: + resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -635,16 +648,16 @@ packages: tinyexec@0.3.1: resolution: {integrity: sha512-WiCJLEECkO18gwqIp6+hJg0//p23HXp4S+gGtAKu3mI2F2/sXC4FvHvXvB0zJVVaTPhx1/tOwdbRsa1sOBIKqQ==} - tinypool@1.0.0: - resolution: {integrity: sha512-KIKExllK7jp3uvrNtvRBYBWBOAXSX8ZvoaD8T+7KB/QHIuoJW3Pmr60zucywjAlMb5TeXUkcs/MWeWLu0qvuAQ==} + tinypool@1.0.2: + resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==} engines: {node: ^18.0.0 || >=20.0.0} tinyrainbow@1.2.0: resolution: {integrity: sha512-weEDEq7Z5eTHPDh4xjX789+fHfF+P8boiFB+0vbWzpbnbsEr/GRaohi/uMKxg8RZMXnl1ItAi/IUHWMsjDV7kQ==} engines: {node: '>=14.0.0'} - tinyspy@3.0.0: - resolution: {integrity: sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==} + tinyspy@3.0.2: + resolution: {integrity: sha512-n1cw8k1k0x4pgA2+9XrOkFydTerNcJ1zWCO5Nn9scWHTD+5tp8dghT2x1uduQePZTZgd3Tupf+x9BxJjeJi77Q==} engines: {node: '>=14.0.0'} typescript@5.6.3: @@ -652,8 +665,8 @@ packages: engines: {node: '>=14.17'} hasBin: true - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@6.19.8: + resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} update-browserslist-db@1.1.1: resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} @@ -661,13 +674,13 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - vite-node@2.1.3: - resolution: {integrity: sha512-I1JadzO+xYX887S39Do+paRePCKoiDrWRRjp9kkG5he0t7RXNvPAJPCQSJqbGN4uCrFFeS3Kj3sLqY8NMYBEdA==} + vite-node@2.1.5: + resolution: {integrity: sha512-rd0QIgx74q4S1Rd56XIiL2cYEdyWn13cunYBIuqh9mpmQr7gGS0IxXoP8R6OaZtNQQLyXSWbd4rXKYUbhFpK5w==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true - vite@5.4.9: - resolution: {integrity: sha512-20OVpJHh0PAM0oSOELa5GaZNWeDjcAvQjGXy2Uyr+Tp+/D2/Hdz6NLgpJLsarPTA2QJ6v8mX2P1ZfbsSKvdMkg==} + vite@5.4.11: + resolution: {integrity: sha512-c7jFQRklXua0mTzneGW9QVyxFjUgwcihC4bXEtujIo2ouWCe1Ajt/amn2PCxYnhYfd5k09JX3SB7OYWFKYqj8Q==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -702,15 +715,15 @@ packages: peerDependencies: vitest: ^2.0.0 - vitest@2.1.3: - resolution: {integrity: sha512-Zrxbg/WiIvUP2uEzelDNTXmEMJXuzJ1kCpbDvaKByFA9MNeO95V+7r/3ti0qzJzrxdyuUw5VduN7k+D3VmVOSA==} + vitest@2.1.5: + resolution: {integrity: sha512-P4ljsdpuzRTPI/kbND2sDZ4VmieerR2c9szEZpjc+98Z9ebvnXmM5+0tHEKqYZumXqlvnmfWsjeFOjXVriDG7A==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' '@types/node': ^18.0.0 || >=20.0.0 - '@vitest/browser': 2.1.3 - '@vitest/ui': 2.1.3 + '@vitest/browser': 2.1.5 + '@vitest/ui': 2.1.5 happy-dom: '*' jsdom: '*' peerDependenciesMeta: @@ -754,8 +767,8 @@ packages: zod@3.23.8: resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} - zx@8.1.9: - resolution: {integrity: sha512-UHuLHphHmsBYKkAchkSrEN4nzDyagafqC9HUxtc1J7eopaScW6H9dsLJ1lmkAntnLtDTGoM8fa+jrJrXiIfKFA==} + zx@8.2.2: + resolution: {integrity: sha512-HSIdpU5P2ONI0nssnhsUZNCH9Sd/Z8LIFk9n8QTbu6JufzJx7qR7ajrMN21s06JqWSApcN012377iWsv8Vs5bg==} engines: {node: '>= 12.17.0'} hasBin: true @@ -1046,17 +1059,19 @@ snapshots: '@types/fs-extra@11.0.4': dependencies: '@types/jsonfile': 6.1.4 - '@types/node': 20.14.11 + '@types/node': 20.17.6 optional: true '@types/jsonfile@6.1.4': dependencies: - '@types/node': 20.14.11 + '@types/node': 20.17.6 optional: true - '@types/node@20.14.11': + '@types/node@20.17.6': dependencies: - undici-types: 5.26.5 + undici-types: 6.19.8 + + '@types/semver@7.5.8': {} '@types/yargs-parser@21.0.3': {} @@ -1064,47 +1079,47 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@vitest/expect@2.1.3': + '@vitest/expect@2.1.5': dependencies: - '@vitest/spy': 2.1.3 - '@vitest/utils': 2.1.3 - chai: 5.1.1 + '@vitest/spy': 2.1.5 + '@vitest/utils': 2.1.5 + chai: 5.1.2 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.3(@vitest/spy@2.1.3)(vite@5.4.9(@types/node@20.14.11)(terser@5.31.3))': + '@vitest/mocker@2.1.5(vite@5.4.11(@types/node@20.17.6)(terser@5.31.3))': dependencies: - '@vitest/spy': 2.1.3 + '@vitest/spy': 2.1.5 estree-walker: 3.0.3 magic-string: 0.30.12 optionalDependencies: - vite: 5.4.9(@types/node@20.14.11)(terser@5.31.3) + vite: 5.4.11(@types/node@20.17.6)(terser@5.31.3) - '@vitest/pretty-format@2.1.3': + '@vitest/pretty-format@2.1.5': dependencies: tinyrainbow: 1.2.0 - '@vitest/runner@2.1.3': + '@vitest/runner@2.1.5': dependencies: - '@vitest/utils': 2.1.3 + '@vitest/utils': 2.1.5 pathe: 1.1.2 - '@vitest/snapshot@2.1.3': + '@vitest/snapshot@2.1.5': dependencies: - '@vitest/pretty-format': 2.1.3 + '@vitest/pretty-format': 2.1.5 magic-string: 0.30.12 pathe: 1.1.2 - '@vitest/spy@2.1.3': + '@vitest/spy@2.1.5': dependencies: - tinyspy: 3.0.0 + tinyspy: 3.0.2 - '@vitest/utils@2.1.3': + '@vitest/utils@2.1.5': dependencies: - '@vitest/pretty-format': 2.1.3 - loupe: 3.1.1 + '@vitest/pretty-format': 2.1.5 + loupe: 3.1.2 tinyrainbow: 1.2.0 - acorn@8.12.1: + acorn@8.14.0: optional: true ansi-regex@5.0.1: {} @@ -1131,12 +1146,12 @@ snapshots: caniuse-lite@1.0.30001680: optional: true - chai@5.1.1: + chai@5.1.2: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.1 + loupe: 3.1.2 pathval: 2.0.0 check-error@2.1.1: {} @@ -1170,6 +1185,8 @@ snapshots: emoji-regex@8.0.0: {} + es-module-lexer@1.5.4: {} + esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -1196,15 +1213,14 @@ snapshots: '@esbuild/win32-ia32': 0.21.5 '@esbuild/win32-x64': 0.21.5 - escalade@3.1.2: {} - - escalade@3.2.0: - optional: true + escalade@3.2.0: {} estree-walker@3.0.3: dependencies: '@types/estree': 1.0.5 + expect-type@1.1.0: {} + fsevents@2.3.3: optional: true @@ -1213,8 +1229,6 @@ snapshots: get-caller-file@2.0.5: {} - get-func-name@2.0.2: {} - globals@11.12.0: optional: true @@ -1229,9 +1243,7 @@ snapshots: json5@2.2.3: optional: true - loupe@3.1.1: - dependencies: - get-func-name: 2.0.2 + loupe@3.1.2: {} lru-cache@5.1.1: dependencies: @@ -1290,6 +1302,8 @@ snapshots: semver@6.3.1: optional: true + semver@7.6.3: {} + siginfo@2.0.0: {} source-map-js@1.2.1: {} @@ -1305,7 +1319,7 @@ snapshots: stackback@0.0.2: {} - std-env@3.7.0: {} + std-env@3.8.0: {} string-width@4.2.3: dependencies: @@ -1320,7 +1334,7 @@ snapshots: terser@5.31.3: dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.12.1 + acorn: 8.14.0 commander: 2.20.3 source-map-support: 0.5.21 optional: true @@ -1329,16 +1343,16 @@ snapshots: tinyexec@0.3.1: {} - tinypool@1.0.0: {} + tinypool@1.0.2: {} tinyrainbow@1.2.0: {} - tinyspy@3.0.0: {} + tinyspy@3.0.2: {} typescript@5.6.3: optional: true - undici-types@5.26.5: {} + undici-types@6.19.8: {} update-browserslist-db@1.1.1(browserslist@4.24.2): dependencies: @@ -1347,12 +1361,13 @@ snapshots: picocolors: 1.1.1 optional: true - vite-node@2.1.3(@types/node@20.14.11)(terser@5.31.3): + vite-node@2.1.5(@types/node@20.17.6)(terser@5.31.3): dependencies: cac: 6.7.14 debug: 4.3.7 + es-module-lexer: 1.5.4 pathe: 1.1.2 - vite: 5.4.9(@types/node@20.14.11)(terser@5.31.3) + vite: 5.4.11(@types/node@20.17.6)(terser@5.31.3) transitivePeerDependencies: - '@types/node' - less @@ -1364,43 +1379,44 @@ snapshots: - supports-color - terser - vite@5.4.9(@types/node@20.14.11)(terser@5.31.3): + vite@5.4.11(@types/node@20.17.6)(terser@5.31.3): dependencies: esbuild: 0.21.5 postcss: 8.4.47 rollup: 4.20.0 optionalDependencies: - '@types/node': 20.14.11 + '@types/node': 20.17.6 fsevents: 2.3.3 terser: 5.31.3 - vitest-directory-snapshot@0.2.2(vitest@2.1.3(@types/node@20.14.11)(terser@5.31.3)): + vitest-directory-snapshot@0.2.2(vitest@2.1.5(@types/node@20.17.6)(terser@5.31.3)): dependencies: - vitest: 2.1.3(@types/node@20.14.11)(terser@5.31.3) + vitest: 2.1.5(@types/node@20.17.6)(terser@5.31.3) - vitest@2.1.3(@types/node@20.14.11)(terser@5.31.3): + vitest@2.1.5(@types/node@20.17.6)(terser@5.31.3): dependencies: - '@vitest/expect': 2.1.3 - '@vitest/mocker': 2.1.3(@vitest/spy@2.1.3)(vite@5.4.9(@types/node@20.14.11)(terser@5.31.3)) - '@vitest/pretty-format': 2.1.3 - '@vitest/runner': 2.1.3 - '@vitest/snapshot': 2.1.3 - '@vitest/spy': 2.1.3 - '@vitest/utils': 2.1.3 - chai: 5.1.1 + '@vitest/expect': 2.1.5 + '@vitest/mocker': 2.1.5(vite@5.4.11(@types/node@20.17.6)(terser@5.31.3)) + '@vitest/pretty-format': 2.1.5 + '@vitest/runner': 2.1.5 + '@vitest/snapshot': 2.1.5 + '@vitest/spy': 2.1.5 + '@vitest/utils': 2.1.5 + chai: 5.1.2 debug: 4.3.7 + expect-type: 1.1.0 magic-string: 0.30.12 pathe: 1.1.2 - std-env: 3.7.0 + std-env: 3.8.0 tinybench: 2.9.0 tinyexec: 0.3.1 - tinypool: 1.0.0 + tinypool: 1.0.2 tinyrainbow: 1.2.0 - vite: 5.4.9(@types/node@20.14.11)(terser@5.31.3) - vite-node: 2.1.3(@types/node@20.14.11)(terser@5.31.3) + vite: 5.4.11(@types/node@20.17.6)(terser@5.31.3) + vite-node: 2.1.5(@types/node@20.17.6)(terser@5.31.3) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 20.14.11 + '@types/node': 20.17.6 transitivePeerDependencies: - less - lightningcss @@ -1433,7 +1449,7 @@ snapshots: yargs@17.7.2: dependencies: cliui: 8.0.1 - escalade: 3.1.2 + escalade: 3.2.0 get-caller-file: 2.0.5 require-directory: 2.1.1 string-width: 4.2.3 @@ -1442,7 +1458,7 @@ snapshots: zod@3.23.8: {} - zx@8.1.9: + zx@8.2.2: optionalDependencies: '@types/fs-extra': 11.0.4 - '@types/node': 20.14.11 + '@types/node': 20.17.6 diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js new file mode 100644 index 0000000..287d040 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const React = require("react"); +const Component = (props) => /* @__PURE__ */ React.createElement("div", null, "js"); +exports.Component = Component; +//# sourceMappingURL=js.js.map diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js.map b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js.map new file mode 100644 index 0000000..9f1483c --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/js.js.map @@ -0,0 +1 @@ +{"version":3,"file":"js.js","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-legacy-transform/js.js"],"sourcesContent":["import React from \"react\";\n\nexport const Component = (props) =>
js
;\n"],"names":[],"mappings":";;;AAEO,MAAM,YAAY,CAAC,UAAU,sBAAA,cAAC,aAAI,IAAE;;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js new file mode 100644 index 0000000..686e47e --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const React = require("react"); +const Component = (props) => /* @__PURE__ */ React.createElement("div", null, "jsx"); +exports.Component = Component; +//# sourceMappingURL=jsx.js.map diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js.map b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js.map new file mode 100644 index 0000000..cff7f60 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/jsx.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jsx.js","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-legacy-transform/jsx.jsx"],"sourcesContent":["import React from \"react\";\n\nexport const Component = (props) =>
jsx
;\n"],"names":[],"mappings":";;;AAEO,MAAM,YAAY,CAAC,gCAAU,cAAC,aAAI,KAAG;;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js new file mode 100644 index 0000000..12a30ed --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const React = require("react"); +const Component = () => /* @__PURE__ */ React.createElement("div", null, "jsx"); +exports.Component = Component; +//# sourceMappingURL=tsx.js.map diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js.map b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js.map new file mode 100644 index 0000000..fc74686 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/cjs/tsx.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tsx.js","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-legacy-transform/tsx.tsx"],"sourcesContent":["import React from \"react\";\n\nexport const Component = () =>
jsx
;\n"],"names":[],"mappings":";;;AAEO,MAAM,YAAY,MAAO,sBAAA,cAAA,OAAA,MAAI,KAAG;;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs new file mode 100644 index 0000000..12d703b --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs @@ -0,0 +1,6 @@ +import React from "react"; +const Component = (props) => /* @__PURE__ */ React.createElement("div", null, "js"); +export { + Component +}; +//# sourceMappingURL=js.mjs.map diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs.map b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs.map new file mode 100644 index 0000000..0ac1fb3 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/js.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"js.mjs","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-legacy-transform/js.js"],"sourcesContent":["import React from \"react\";\n\nexport const Component = (props) =>
js
;\n"],"names":[],"mappings":";AAEO,MAAM,YAAY,CAAC,UAAU,sBAAA,cAAC,aAAI,IAAE;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs new file mode 100644 index 0000000..002aaa9 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs @@ -0,0 +1,6 @@ +import React from "react"; +const Component = (props) => /* @__PURE__ */ React.createElement("div", null, "jsx"); +export { + Component +}; +//# sourceMappingURL=jsx.mjs.map diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs.map b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs.map new file mode 100644 index 0000000..6dc555f --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/jsx.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"jsx.mjs","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-legacy-transform/jsx.jsx"],"sourcesContent":["import React from \"react\";\n\nexport const Component = (props) =>
jsx
;\n"],"names":[],"mappings":";AAEO,MAAM,YAAY,CAAC,gCAAU,cAAC,aAAI,KAAG;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs new file mode 100644 index 0000000..b84b6a6 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs @@ -0,0 +1,6 @@ +import React from "react"; +const Component = () => /* @__PURE__ */ React.createElement("div", null, "jsx"); +export { + Component +}; +//# sourceMappingURL=tsx.mjs.map diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs.map b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs.map new file mode 100644 index 0000000..ca87d88 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/__compiled__/esm/tsx.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"tsx.mjs","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-legacy-transform/tsx.tsx"],"sourcesContent":["import React from \"react\";\n\nexport const Component = () =>
jsx
;\n"],"names":[],"mappings":";AAEO,MAAM,YAAY,MAAO,sBAAA,cAAA,OAAA,MAAI,KAAG;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.d.ts b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.d.ts new file mode 100644 index 0000000..845526a --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.d.ts @@ -0,0 +1 @@ +export * from "./../__compiled__/cjs/js.js"; diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.js b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.js new file mode 100644 index 0000000..ce3a095 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.js @@ -0,0 +1 @@ +module.exports = require("./../__compiled__/cjs/js.js"); diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.mjs b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.mjs new file mode 100644 index 0000000..149544e --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/js/index.mjs @@ -0,0 +1 @@ +export * from "./../__compiled__/esm/js.mjs"; diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.d.ts b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.d.ts new file mode 100644 index 0000000..69b92f0 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.d.ts @@ -0,0 +1 @@ +export * from "./../__compiled__/cjs/jsx.js"; diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.js b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.js new file mode 100644 index 0000000..051b34b --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.js @@ -0,0 +1 @@ +module.exports = require("./../__compiled__/cjs/jsx.js"); diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.mjs b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.mjs new file mode 100644 index 0000000..b3c7603 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/jsx/index.mjs @@ -0,0 +1 @@ +export * from "./../__compiled__/esm/jsx.mjs"; diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/package.json b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/package.json new file mode 100644 index 0000000..4f39823 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/package.json @@ -0,0 +1,40 @@ +{ + "name": "react-legacy-transform", + "type": "commonjs", + "version": "0.0.0", + "description": "", + "exports": { + "./js": { + "import": { + "default": "./__compiled__/esm/js.mjs" + }, + "require": { + "default": "./__compiled__/cjs/js.js" + }, + "default": "./__compiled__/cjs/js.js" + }, + "./jsx": { + "import": { + "default": "./__compiled__/esm/jsx.mjs" + }, + "require": { + "default": "./__compiled__/cjs/jsx.js" + }, + "default": "./__compiled__/cjs/jsx.js" + }, + "./tsx": { + "import": { + "default": "./__compiled__/esm/tsx.mjs" + }, + "require": { + "default": "./__compiled__/cjs/tsx.js" + }, + "default": "./__compiled__/cjs/tsx.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "react": "^16.8.0", + "@types/react": "^16.8.0" + } +} \ No newline at end of file diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.d.ts b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.d.ts new file mode 100644 index 0000000..15ccf41 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.d.ts @@ -0,0 +1 @@ +export * from "./../__compiled__/cjs/tsx.js"; diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.js b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.js new file mode 100644 index 0000000..430f0d8 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.js @@ -0,0 +1 @@ +module.exports = require("./../__compiled__/cjs/tsx.js"); diff --git a/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.mjs b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.mjs new file mode 100644 index 0000000..87381f8 --- /dev/null +++ b/src/__dir_snapshots__/ef8cfd6801346b6266847214af8423c668c322a95aef8607309bcd5388bd3506/tsx/index.mjs @@ -0,0 +1 @@ +export * from "./../__compiled__/esm/tsx.mjs"; diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js new file mode 100644 index 0000000..7601c57 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const jsxRuntime = require("react/jsx-runtime"); +const Component = (props) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: "js" }); +exports.Component = Component; +//# sourceMappingURL=js.js.map diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js.map b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js.map new file mode 100644 index 0000000..a364c35 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/js.js.map @@ -0,0 +1 @@ +{"version":3,"file":"js.js","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-modern-transform/js.js"],"sourcesContent":["export const Component = (props) =>
js
;\n"],"names":["jsx"],"mappings":";;;AAAO,MAAM,YAAY,CAAC,UAAUA,2BAAAA,IAAC,SAAI,UAAE,KAAA,CAAA;;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js new file mode 100644 index 0000000..09cfd03 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const jsxRuntime = require("react/jsx-runtime"); +const Component = (props) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: "jsx" }); +exports.Component = Component; +//# sourceMappingURL=jsx.js.map diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js.map b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js.map new file mode 100644 index 0000000..534696e --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/jsx.js.map @@ -0,0 +1 @@ +{"version":3,"file":"jsx.js","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-modern-transform/jsx.jsx"],"sourcesContent":["export const Component = (props) =>
jsx
;\n"],"names":["jsx"],"mappings":";;;AAAa,MAAA,YAAY,CAAC,UAAUA,2BAAAA,IAAC,SAAI,UAAG,MAAA,CAAA;;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js new file mode 100644 index 0000000..0314aac --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" }); +const jsxRuntime = require("react/jsx-runtime"); +const Component = () => /* @__PURE__ */ jsxRuntime.jsx("div", { children: "jsx" }); +exports.Component = Component; +//# sourceMappingURL=tsx.js.map diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js.map b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js.map new file mode 100644 index 0000000..e1b7a70 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/cjs/tsx.js.map @@ -0,0 +1 @@ +{"version":3,"file":"tsx.js","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-modern-transform/tsx.tsx"],"sourcesContent":["export const Component = () =>
jsx
;\n"],"names":["jsx"],"mappings":";;;AAAO,MAAM,YAAY,MAAOA,2BAAA,IAAA,OAAA,EAAI,UAAG,MAAA,CAAA;;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs new file mode 100644 index 0000000..082cde5 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs @@ -0,0 +1,6 @@ +import { jsx } from "react/jsx-runtime"; +const Component = (props) => /* @__PURE__ */ jsx("div", { children: "js" }); +export { + Component +}; +//# sourceMappingURL=js.mjs.map diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs.map b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs.map new file mode 100644 index 0000000..3b75149 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/js.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"js.mjs","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-modern-transform/js.js"],"sourcesContent":["export const Component = (props) =>
js
;\n"],"names":[],"mappings":";AAAO,MAAM,YAAY,CAAC,UAAU,oBAAC,SAAI,UAAE,KAAA,CAAA;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs new file mode 100644 index 0000000..db486cb --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs @@ -0,0 +1,6 @@ +import { jsx } from "react/jsx-runtime"; +const Component = (props) => /* @__PURE__ */ jsx("div", { children: "jsx" }); +export { + Component +}; +//# sourceMappingURL=jsx.mjs.map diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs.map b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs.map new file mode 100644 index 0000000..02ee464 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/jsx.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"jsx.mjs","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-modern-transform/jsx.jsx"],"sourcesContent":["export const Component = (props) =>
jsx
;\n"],"names":[],"mappings":";AAAa,MAAA,YAAY,CAAC,UAAU,oBAAC,SAAI,UAAG,MAAA,CAAA;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs new file mode 100644 index 0000000..617ba6c --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs @@ -0,0 +1,6 @@ +import { jsx } from "react/jsx-runtime"; +const Component = () => /* @__PURE__ */ jsx("div", { children: "jsx" }); +export { + Component +}; +//# sourceMappingURL=tsx.mjs.map diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs.map b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs.map new file mode 100644 index 0000000..c15435c --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/__compiled__/esm/tsx.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"tsx.mjs","sources":["../../../../../../../../Users/xavescor/projects/bobrik/src/fixtures/react-modern-transform/tsx.tsx"],"sourcesContent":["export const Component = () =>
jsx
;\n"],"names":[],"mappings":";AAAO,MAAM,YAAY,MAAO,oBAAA,OAAA,EAAI,UAAG,MAAA,CAAA;"} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.d.ts b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.d.ts new file mode 100644 index 0000000..845526a --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.d.ts @@ -0,0 +1 @@ +export * from "./../__compiled__/cjs/js.js"; diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.js b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.js new file mode 100644 index 0000000..ce3a095 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.js @@ -0,0 +1 @@ +module.exports = require("./../__compiled__/cjs/js.js"); diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.mjs b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.mjs new file mode 100644 index 0000000..149544e --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/js/index.mjs @@ -0,0 +1 @@ +export * from "./../__compiled__/esm/js.mjs"; diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.d.ts b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.d.ts new file mode 100644 index 0000000..69b92f0 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.d.ts @@ -0,0 +1 @@ +export * from "./../__compiled__/cjs/jsx.js"; diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.js b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.js new file mode 100644 index 0000000..051b34b --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.js @@ -0,0 +1 @@ +module.exports = require("./../__compiled__/cjs/jsx.js"); diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.mjs b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.mjs new file mode 100644 index 0000000..b3c7603 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/jsx/index.mjs @@ -0,0 +1 @@ +export * from "./../__compiled__/esm/jsx.mjs"; diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/package.json b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/package.json new file mode 100644 index 0000000..b972e06 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/package.json @@ -0,0 +1,40 @@ +{ + "name": "react-modern-transform", + "type": "commonjs", + "version": "0.0.0", + "description": "", + "exports": { + "./js": { + "import": { + "default": "./__compiled__/esm/js.mjs" + }, + "require": { + "default": "./__compiled__/cjs/js.js" + }, + "default": "./__compiled__/cjs/js.js" + }, + "./jsx": { + "import": { + "default": "./__compiled__/esm/jsx.mjs" + }, + "require": { + "default": "./__compiled__/cjs/jsx.js" + }, + "default": "./__compiled__/cjs/jsx.js" + }, + "./tsx": { + "import": { + "default": "./__compiled__/esm/tsx.mjs" + }, + "require": { + "default": "./__compiled__/cjs/tsx.js" + }, + "default": "./__compiled__/cjs/tsx.js" + }, + "./package.json": "./package.json" + }, + "dependencies": { + "react": "^17.0.0", + "@types/react": "^17.0.0" + } +} \ No newline at end of file diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.d.ts b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.d.ts new file mode 100644 index 0000000..15ccf41 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.d.ts @@ -0,0 +1 @@ +export * from "./../__compiled__/cjs/tsx.js"; diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.js b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.js new file mode 100644 index 0000000..430f0d8 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.js @@ -0,0 +1 @@ +module.exports = require("./../__compiled__/cjs/tsx.js"); diff --git a/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.mjs b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.mjs new file mode 100644 index 0000000..87381f8 --- /dev/null +++ b/src/__dir_snapshots__/f49423423aa60f02d472d8b5e03af6b6610877c4f4750a6d007185e596f0c961/tsx/index.mjs @@ -0,0 +1 @@ +export * from "./../__compiled__/esm/tsx.mjs"; diff --git a/src/build.test.ts b/src/build.test.ts index bce1498..eb9e27e 100644 --- a/src/build.test.ts +++ b/src/build.test.ts @@ -177,3 +177,44 @@ describe("bugs", () => { expect(tmpDir).toMatchDirSnapshot(); }); }); + +describe("react", () => { + describe("errors", () => { + test("jsx", async ({ tmpDir }: { tmpDir: string }) => { + const res = await run({ + outputDir: tmpDir, + sourceDir: "./src/fixtures/react-jsx-error", + }); + + expect(res.error).toBeTruthy(); + expect(res.errors[0]).toMatchInlineSnapshot( + `"[smartbundle:react] SmartBundle cannot find the react dependency inside dependencies, optionalDependencies or peerDependencies. Please, install it before bundling"`, + ); + }); + }); + + describe("transform", () => { + test("legacy-createElement", async ({ tmpDir }: { tmpDir: string }) => { + const res = await run({ + outputDir: tmpDir, + sourceDir: "./src/fixtures/react-legacy-transform", + }); + + console.error(res.errors); + expect(res.error).toBeFalsy(); + // @ts-expect-error + expect(tmpDir).toMatchDirSnapshot(); + }); + + test("modern-jsx/runtime", async ({ tmpDir }: { tmpDir: string }) => { + const res = await run({ + outputDir: tmpDir, + sourceDir: "./src/fixtures/react-modern-transform", + }); + + expect(res.error).toBeFalsy(); + // @ts-expect-error + expect(tmpDir).toMatchDirSnapshot(); + }); + }); +}); diff --git a/src/buildVite.ts b/src/buildVite.ts index 5e9ea57..5bb776e 100644 --- a/src/buildVite.ts +++ b/src/buildVite.ts @@ -1,6 +1,5 @@ -import { build, type UserConfig } from "vite"; +import { build, type UserConfig, Rollup } from "vite"; import { errors } from "./errors.js"; -import { Rollup } from "vite"; type BuildViteOptions = { viteConfig: UserConfig; @@ -20,16 +19,31 @@ type BuildResult = BuildSuccess | BuildError; export async function buildVite({ viteConfig, }: BuildViteOptions): Promise { - const outputs = await build(viteConfig); - if (!Array.isArray(outputs)) { + try { + const outputs = await build(viteConfig); + if (!Array.isArray(outputs)) { + return { + error: true, + errors: [errors.rollupError], + }; + } + return { - error: true, - errors: [errors.rollupError], + error: false, + output: outputs.flatMap((x) => + x.output.filter((x) => x.type === "chunk"), + ), }; + } catch (e) { + if (e instanceof Error) { + return { + error: true, + errors: [e.message], + }; + } } - return { - error: false, - output: outputs.flatMap((x) => x.output.filter((x) => x.type === "chunk")), + error: true, + errors: [errors.rollupError], }; } diff --git a/src/createViteConfig.ts b/src/createViteConfig.ts index 8fe74eb..ef4de6c 100644 --- a/src/createViteConfig.ts +++ b/src/createViteConfig.ts @@ -3,6 +3,7 @@ import { type PackageJson } from "./packageJson.js"; import { join, relative } from "node:path"; import { defineConfig } from "vite"; import { babelPlugin } from "./plugins/babel/index.js"; +import { reactPlugin } from "./plugins/react/index.js"; type CreateViteConfigParam = { dirs: Dirs; @@ -71,9 +72,10 @@ export function createViteConfig({ dirs, packageJson }: CreateViteConfigParam) { const depsValidator = createExternalDepValidator(packageJson); const viteConfig = defineConfig({ - plugins: [babelPlugin({ packageJson, dirs })], + plugins: [reactPlugin({ packageJson }), babelPlugin({ packageJson, dirs })], publicDir: false, root: sourceDir, + logLevel: "silent", build: { outDir, write: true, diff --git a/src/fixtures/react-jsx-error/legacy-js.js b/src/fixtures/react-jsx-error/legacy-js.js new file mode 100644 index 0000000..4c312d0 --- /dev/null +++ b/src/fixtures/react-jsx-error/legacy-js.js @@ -0,0 +1,3 @@ +import React from "react"; + +export const Component = (props) =>
js
; diff --git a/src/fixtures/react-jsx-error/legacy-jsx.jsx b/src/fixtures/react-jsx-error/legacy-jsx.jsx new file mode 100644 index 0000000..a76dee1 --- /dev/null +++ b/src/fixtures/react-jsx-error/legacy-jsx.jsx @@ -0,0 +1,3 @@ +import React from "react"; + +export const Component = (props) =>
jsx
; diff --git a/src/fixtures/react-jsx-error/package.json b/src/fixtures/react-jsx-error/package.json new file mode 100644 index 0000000..2dd191a --- /dev/null +++ b/src/fixtures/react-jsx-error/package.json @@ -0,0 +1,10 @@ +{ + "private": true, + "name": "react-jsx-error", + "type": "module", + "version": "0.0.0", + "exports": { + "./js": "./legacy-js.js", + "./jsx": "./legacy-jsx.jsx" + } +} diff --git a/src/fixtures/react-legacy-transform/js.js b/src/fixtures/react-legacy-transform/js.js new file mode 100644 index 0000000..4c312d0 --- /dev/null +++ b/src/fixtures/react-legacy-transform/js.js @@ -0,0 +1,3 @@ +import React from "react"; + +export const Component = (props) =>
js
; diff --git a/src/fixtures/react-legacy-transform/jsx.jsx b/src/fixtures/react-legacy-transform/jsx.jsx new file mode 100644 index 0000000..a76dee1 --- /dev/null +++ b/src/fixtures/react-legacy-transform/jsx.jsx @@ -0,0 +1,3 @@ +import React from "react"; + +export const Component = (props) =>
jsx
; diff --git a/src/fixtures/react-legacy-transform/package.json b/src/fixtures/react-legacy-transform/package.json new file mode 100644 index 0000000..d6f5e23 --- /dev/null +++ b/src/fixtures/react-legacy-transform/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "name": "react-legacy-transform", + "type": "module", + "version": "0.0.0", + "dependencies": { + "react": "^16.8.0", + "@types/react": "^16.8.0" + }, + "exports": { + "./js": "./js.js", + "./jsx": "./jsx.jsx", + "./tsx": "./tsx.tsx" + } +} diff --git a/src/fixtures/react-legacy-transform/tsconfig.json b/src/fixtures/react-legacy-transform/tsconfig.json new file mode 100644 index 0000000..5e815fe --- /dev/null +++ b/src/fixtures/react-legacy-transform/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "jsx": "react" + } +} diff --git a/src/fixtures/react-legacy-transform/tsx.tsx b/src/fixtures/react-legacy-transform/tsx.tsx new file mode 100644 index 0000000..61eb6fc --- /dev/null +++ b/src/fixtures/react-legacy-transform/tsx.tsx @@ -0,0 +1,3 @@ +import React from "react"; + +export const Component = () =>
jsx
; diff --git a/src/fixtures/react-modern-transform/js.js b/src/fixtures/react-modern-transform/js.js new file mode 100644 index 0000000..99779b7 --- /dev/null +++ b/src/fixtures/react-modern-transform/js.js @@ -0,0 +1 @@ +export const Component = (props) =>
js
; diff --git a/src/fixtures/react-modern-transform/jsx.jsx b/src/fixtures/react-modern-transform/jsx.jsx new file mode 100644 index 0000000..5a53b3d --- /dev/null +++ b/src/fixtures/react-modern-transform/jsx.jsx @@ -0,0 +1 @@ +export const Component = (props) =>
jsx
; diff --git a/src/fixtures/react-modern-transform/package.json b/src/fixtures/react-modern-transform/package.json new file mode 100644 index 0000000..5876c1f --- /dev/null +++ b/src/fixtures/react-modern-transform/package.json @@ -0,0 +1,15 @@ +{ + "private": true, + "name": "react-modern-transform", + "type": "module", + "version": "0.0.0", + "dependencies": { + "react": "^17.0.0", + "@types/react": "^17.0.0" + }, + "exports": { + "./js": "./js.js", + "./jsx": "./jsx.jsx", + "./tsx": "./tsx.tsx" + } +} diff --git a/src/fixtures/react-modern-transform/tsconfig.json b/src/fixtures/react-modern-transform/tsconfig.json new file mode 100644 index 0000000..32cf346 --- /dev/null +++ b/src/fixtures/react-modern-transform/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "skipLibCheck": true, + "jsx": "react-jsx" + } +} diff --git a/src/fixtures/react-modern-transform/tsx.tsx b/src/fixtures/react-modern-transform/tsx.tsx new file mode 100644 index 0000000..6c898e7 --- /dev/null +++ b/src/fixtures/react-modern-transform/tsx.tsx @@ -0,0 +1 @@ +export const Component = () =>
jsx
; diff --git a/src/index.ts b/src/index.ts index 956e707..c8515ad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -38,7 +38,16 @@ export async function defineViteConfig(args: Args = {}) { return viteConfig; } -export async function run(args: Args) { +type RunResult = + | { + error: false; + } + | { + error: true; + errors: Array; + }; + +export async function run(args: Args): Promise { const dirs = resolveDirs(args); const { sourceDir, outDir, packagePath, outBinsDir } = dirs; @@ -47,7 +56,6 @@ export async function run(args: Args) { const packageJson = await parsePackageJson({ sourceDir, packagePath }); if (Array.isArray(packageJson)) { - console.log(packageJson); return { error: true, errors: packageJson }; } diff --git a/src/plugins/react/index.ts b/src/plugins/react/index.ts new file mode 100644 index 0000000..d626500 --- /dev/null +++ b/src/plugins/react/index.ts @@ -0,0 +1,67 @@ +import { type Plugin, transformWithEsbuild } from "vite"; +import type { PackageJson } from "../../packageJson.js"; +import semver from "semver"; + +type ReactPluginArg = { + packageJson: PackageJson; +}; + +const errorJsxMessage = + "SmartBundle cannot find the react dependency inside dependencies, optionalDependencies or peerDependencies. Please, install it before bundling"; + +export function reactPlugin({ packageJson }: ReactPluginArg): Plugin { + const pluginName = "smartbundle:react"; + + const reactVersion = + packageJson.dependencies?.react ?? + packageJson.devDependencies?.react ?? + packageJson.optionalDependencies?.react; + + if (!reactVersion) { + return { + name: pluginName, + transform(code, id) { + if (id.endsWith(".jsx") || id.endsWith(".tsx")) { + this.error(new Error(errorJsxMessage)); + } + }, + buildEnd(err) { + if (err) { + const isJsxError = err.message.includes("JSX"); + if (isJsxError) { + this.error(new Error(errorJsxMessage)); + } + } + }, + }; + } + + const isLegacyTransform = semver.lt( + semver.minVersion(reactVersion)!, + "17.0.0", + ); + + return { + name: pluginName, + enforce: "pre", + async transform(code, id) { + const isJs = id.endsWith(".js"); + const isJsx = id.endsWith(".jsx"); + const isTsx = id.endsWith(".tsx"); + if (!(isJs || isJsx || isTsx)) { + return null; + } + + return await transformWithEsbuild( + code, + id, + { + loader: isJs || isJsx ? "jsx" : "tsx", + jsx: isLegacyTransform ? "transform" : "automatic", + sourcemap: true, + }, + this.getCombinedSourcemap(), + ); + }, + }; +} diff --git a/src/run.ts b/src/run.ts index 4de916d..78994d0 100644 --- a/src/run.ts +++ b/src/run.ts @@ -1,4 +1,10 @@ import { args } from "./args.js"; import { run } from "./index.js"; -run(args); +run(args).then((res) => { + if (res.error) { + for (const error of res.errors) { + console.error(error); + } + } +});