diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1376890..1dd9414 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,17 +22,9 @@ jobs: - name: Install Dependencies for Vite Plugin Relay run: pnpm i - name: Install Playwright - run: npx playwright install --with-deps - - name: Build Vite Plugin Relay - run: pnpm build - - name: Install Dependencies for Vite 3 Example Site - run: pnpm --filter example-vite-3 i - - name: Test Vite 3 Example Site - run: pnpm --filter example-vite-3 test - - name: Install Dependencies for Vite 2 Example Site - run: pnpm --filter example-vite-2 i - - name: Test Vite 2 Example Site - run: pnpm --filter example-vite-2 test + run: pnpm --filter example exec playwright install --with-deps + - name: Test Example Site + run: pnpm --filter example test lint: runs-on: ubuntu-latest diff --git a/examples/latest/.gitignore b/examples/latest/.gitignore index a547bf3..b88c813 100644 --- a/examples/latest/.gitignore +++ b/examples/latest/.gitignore @@ -22,3 +22,7 @@ dist-ssr *.njsproj *.sln *.sw? +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/examples/latest/index.html b/examples/latest/index.html index 7faa519..aa3e64a 100644 --- a/examples/latest/index.html +++ b/examples/latest/index.html @@ -1,4 +1,4 @@ - + diff --git a/examples/latest/package.json b/examples/latest/package.json index da69f3c..8ae1662 100644 --- a/examples/latest/package.json +++ b/examples/latest/package.json @@ -1,5 +1,5 @@ { - "name": "example-vite-3", + "name": "example", "private": true, "version": "0.0.0", "type": "module", @@ -18,6 +18,7 @@ }, "devDependencies": { "@playwright/test": "1.40.1", + "@types/node": "^20.10.4", "@types/react": "^18.2.43", "@types/react-dom": "^18.2.17", "@types/react-relay": "^16.0.5", diff --git a/examples/latest/playwright.config.ts b/examples/latest/playwright.config.ts new file mode 100644 index 0000000..b097d6a --- /dev/null +++ b/examples/latest/playwright.config.ts @@ -0,0 +1,29 @@ +import { defineConfig, devices } from "@playwright/test"; + +/** + * See https://playwright.dev/docs/test-configuration. + */ +export default defineConfig({ + testDir: "./src", + fullyParallel: true, + forbidOnly: !!process.env.CI, + retries: process.env.CI ? 2 : 0, + workers: process.env.CI ? 1 : undefined, + use: { + trace: "on-first-retry", + }, + projects: [ + { + name: "chromium", + use: { ...devices["Desktop Chrome"] }, + }, + { + name: "firefox", + use: { ...devices["Desktop Firefox"] }, + }, + { + name: "webkit", + use: { ...devices["Desktop Safari"] }, + }, + ], +}); diff --git a/examples/latest/src/App.spec.ts b/examples/latest/src/App.spec.ts index e07c54f..7c1bcc7 100644 --- a/examples/latest/src/App.spec.ts +++ b/examples/latest/src/App.spec.ts @@ -1,8 +1,9 @@ import { test, expect, Page } from "@playwright/test"; import { GraphQLResponseWithData as RelayGraphQLResponseWithData } from "relay-runtime"; -import path from "path"; import { AppQuery$data } from "./__generated__/AppQuery.graphql"; +const apiUrl = "https://spacex-production.up.railway.app/graphql"; + // Mutable removes the readonly property from a type. This is done because the Relay compiler outputs types with readonly fields. type Mutable = { -readonly [P in keyof T]: T[P]; @@ -34,37 +35,33 @@ test.beforeEach(async ({ page }) => { if (route.request().resourceType() === "document") { return route.fulfill({ status: 200, - path: path.join(__dirname, "../dist/index.html"), + path: new URL("../dist/index.html", import.meta.url).pathname, }); } else { const url = new URL(route.request().url()); return route.fulfill({ status: 200, - path: path.join(__dirname, "../dist", url.pathname), + path: new URL("../dist" + url.pathname, import.meta.url).pathname, }); } }); }); test("renders list with many ships", async ({ page }) => { - await modifyGraphQLResponse( - page, - "https://api.spacex.land/graphql", - (body: GraphQLResponseWithData>) => { - body.data.ships = [ - { - id: "one", - name: "Ship One", - }, - { - id: "two", - name: "Ship Two", - }, - ]; + await modifyGraphQLResponse(page, apiUrl, (body: GraphQLResponseWithData>) => { + body.data.ships = [ + { + id: "one", + name: "Ship One", + }, + { + id: "two", + name: "Ship Two", + }, + ]; - return body; - }, - ); + return body; + }); await page.goto(`http://localhost`, { waitUntil: "networkidle" }); @@ -83,14 +80,10 @@ test("renders list with many ships", async ({ page }) => { }); test("renders list with no ships", async ({ page }) => { - await modifyGraphQLResponse( - page, - "https://api.spacex.land/graphql", - (body: GraphQLResponseWithData>) => { - body.data.ships = []; - return body; - }, - ); + await modifyGraphQLResponse(page, apiUrl, (body: GraphQLResponseWithData>) => { + body.data.ships = []; + return body; + }); await page.goto(`http://localhost`, { waitUntil: "networkidle" }); diff --git a/examples/latest/src/App.tsx b/examples/latest/src/App.tsx index 38d3639..93190a2 100644 --- a/examples/latest/src/App.tsx +++ b/examples/latest/src/App.tsx @@ -24,11 +24,7 @@ export default function App(): ReactElement { Data Viewer

Ships

-
    - {data.ships?.map((ship) => ( -
  • {ship?.name}
  • - ))} -
+
    {data.ships?.map((ship) =>
  • {ship?.name}
  • )}
); } diff --git a/package.json b/package.json index 21885ce..91d1781 100644 --- a/package.json +++ b/package.json @@ -37,8 +37,8 @@ "build": "tsup src/plugin.ts --dts --clean --format cjs,esm --no-splitting --env.NODE_ENV production", "dev": "tsup src/plugin.ts --dts --clean --format cjs,esm --no-splitting --watch", "test": "pnpm -r --parallel --filter=!vite-plugin-relay exec pnpm test", - "lint": "prettier --check . && eslint src/** examples/vite-2/src/** examples/vite-3/src/**", - "format": "prettier --write . && eslint src/** examples/vite-2/src/** examples/vite-3/src/** --fix", + "lint": "prettier --check . && eslint src/** examples/latest/src/**", + "format": "prettier --write . && eslint src/** examples/latest/src/** --fix", "prepare": "husky install && yarn build" }, "peerDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 757cb9e..5df623d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11,6 +11,9 @@ importers: '@babel/core': specifier: ^7.23.5 version: 7.23.5 + babel-plugin-relay: + specifier: '>=14.1.0' + version: 16.0.0 devDependencies: '@swc/core': specifier: ^1.3.100 @@ -67,110 +70,9 @@ importers: '@playwright/test': specifier: 1.40.1 version: 1.40.1 - '@types/react': - specifier: ^18.2.43 - version: 18.2.43 - '@types/react-dom': - specifier: ^18.2.17 - version: 18.2.17 - '@types/react-relay': - specifier: ^16.0.5 - version: 16.0.5 - '@types/relay-runtime': - specifier: ^14.1.19 - version: 14.1.19 - '@vitejs/plugin-react': - specifier: ^4.2.1 - version: 4.2.1(vite@5.0.7) - babel-plugin-relay: - specifier: ^16.0.0 - version: 16.0.0 - concurrently: - specifier: ^8.2.2 - version: 8.2.2 - relay-compiler: - specifier: ^16.0.0 - version: 16.0.0 - typescript: - specifier: ^5.3.3 - version: 5.3.3 - vite: - specifier: ^5.0.7 - version: 5.0.7(@types/node@20.10.4) - vite-plugin-relay: - specifier: workspace:* - version: link:../.. - - examples/vite-2: - dependencies: - react: - specifier: ^18.2.0 - version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) - react-relay: - specifier: 16.0.0 - version: 16.0.0(react@18.2.0) - relay-runtime: - specifier: 16.0.0 - version: 16.0.0 - devDependencies: - '@playwright/test': - specifier: ^1.40.1 - version: 1.40.1 - '@types/react': - specifier: ^18.2.43 - version: 18.2.43 - '@types/react-dom': - specifier: ^18.2.17 - version: 18.2.17 - '@types/react-relay': - specifier: 16.0.5 - version: 16.0.5 - '@types/relay-runtime': - specifier: 14.1.19 - version: 14.1.19 - '@vitejs/plugin-react-refresh': - specifier: ^1.3.6 - version: 1.3.6 - babel-plugin-relay: - specifier: 16.0.0 - version: 16.0.0 - concurrently: - specifier: ^8.2.2 - version: 8.2.2 - relay-compiler: - specifier: 16.0.0 - version: 16.0.0 - typescript: - specifier: ^5.3.3 - version: 5.3.3 - vite: - specifier: ^5.0.7 - version: 5.0.7(@types/node@20.10.4) - vite-plugin-relay: - specifier: workspace:* - version: link:../.. - - examples/vite-3: - dependencies: - react: - specifier: ^18.2.0 - version: 18.2.0 - react-dom: - specifier: ^18.2.0 - version: 18.2.0(react@18.2.0) - react-relay: - specifier: ^16.0.0 - version: 16.0.0(react@18.2.0) - relay-runtime: - specifier: 16.0.0 - version: 16.0.0 - devDependencies: - '@playwright/test': - specifier: 1.40.1 - version: 1.40.1 + '@types/node': + specifier: ^20.10.4 + version: 20.10.4 '@types/react': specifier: ^18.2.43 version: 18.2.43 @@ -729,14 +631,6 @@ packages: playwright: 1.40.1 dev: true - /@rollup/pluginutils@4.2.1: - resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==} - engines: {node: '>= 8.0.0'} - dependencies: - estree-walker: 2.0.2 - picomatch: 2.3.1 - dev: true - /@rollup/rollup-android-arm-eabi@4.7.0: resolution: {integrity: sha512-rGku10pL1StFlFvXX5pEv88KdGW6DHUghsxyP/aRYb9eH+74jTGJ3U0S/rtlsQ4yYq1Hcc7AMkoJOb1xu29Fxw==} cpu: [arm] @@ -995,7 +889,6 @@ packages: /@types/parse-json@4.0.2: resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} - dev: true /@types/prop-types@15.7.11: resolution: {integrity: sha512-ga8y9v9uyeiLdpKddhxYQkxNDrfvuPrlFb0N1qnZZByvcElJaXthF1UhvCh9TLWJBEHeNtdnbysW7Y6Uq8CVng==} @@ -1169,20 +1062,6 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitejs/plugin-react-refresh@1.3.6: - resolution: {integrity: sha512-iNR/UqhUOmFFxiezt0em9CgmiJBdWR+5jGxB2FihaoJfqGt76kiwaKoVOJVU5NYcDWMdN06LbyN2VIGIoYdsEA==} - engines: {node: '>=12.0.0'} - deprecated: This package has been deprecated in favor of @vitejs/plugin-react - dependencies: - '@babel/core': 7.23.5 - '@babel/plugin-transform-react-jsx-self': 7.23.3(@babel/core@7.23.5) - '@babel/plugin-transform-react-jsx-source': 7.23.3(@babel/core@7.23.5) - '@rollup/pluginutils': 4.2.1 - react-refresh: 0.10.0 - transitivePeerDependencies: - - supports-color - dev: true - /@vitejs/plugin-react@4.2.1(vite@5.0.7): resolution: {integrity: sha512-oojO9IDc4nCUUi8qIR11KoQm0XFFLIwsRBwHRR4d/88IWghn1y6ckz/bJ8GHDCsYEJee8mDzqtJxh15/cisJNQ==} engines: {node: ^14.18.0 || >=16.0.0} @@ -1256,7 +1135,6 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 - dev: true /argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1277,7 +1155,6 @@ packages: '@babel/runtime': 7.23.5 cosmiconfig: 6.0.0 resolve: 1.22.8 - dev: true /babel-plugin-relay@16.0.0: resolution: {integrity: sha512-IF6wciLao6wmmc4+deLKHwoOpVU5YzG46xZ70UVafliD+cD46iP9qyXkMcOycNcPsXyvqB63/hz3KrH1ygwHFg==} @@ -1285,7 +1162,6 @@ packages: babel-plugin-macros: 2.8.0 cosmiconfig: 5.2.1 graphql: 15.3.0 - dev: true /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -1340,24 +1216,20 @@ packages: engines: {node: '>=4'} dependencies: callsites: 2.0.0 - dev: true /caller-path@2.0.0: resolution: {integrity: sha512-MCL3sf6nCSXOwCTzvPKhN18TU7AHTvdtam8DAogxcrJ8Rjfbbg7Lgng64H9Iy+vUV6VGFClN/TyxBkAebLRR4A==} engines: {node: '>=4'} dependencies: caller-callsite: 2.0.0 - dev: true /callsites@2.0.0: resolution: {integrity: sha512-ksWePWBloaWPxJYQ8TL0JHvtci6G5QTKwQ95RcWAa/lzoAKuAOflGdAK92hpHXjkwb8zLxoLNUoNYZgVsaJzvQ==} engines: {node: '>=4'} - dev: true /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} - dev: true /caniuse-lite@1.0.30001566: resolution: {integrity: sha512-ggIhCsTxmITBAMmK8yZjEhCO5/47jKXPu6Dha/wuCS4JePVL+3uiDEBuhu2aIoT+bqTOR8L76Ip1ARL9xYsEJA==} @@ -1457,7 +1329,6 @@ packages: is-directory: 0.3.1 js-yaml: 3.14.1 parse-json: 4.0.0 - dev: true /cosmiconfig@6.0.0: resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==} @@ -1468,7 +1339,6 @@ packages: parse-json: 5.2.0 path-type: 4.0.0 yaml: 1.10.2 - dev: true /cross-fetch@3.1.8: resolution: {integrity: sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==} @@ -1538,7 +1408,6 @@ packages: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 - dev: true /esbuild@0.19.9: resolution: {integrity: sha512-U9CHtKSy+EpPsEBa+/A2gMs/h3ylBC0H0KSqIg7tpztHerLi6nrrcoUJAkNCEPumx8yJ+Byic4BVwHgRbN0TBg==} @@ -1665,7 +1534,6 @@ packages: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - dev: true /esquery@1.5.0: resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} @@ -1686,10 +1554,6 @@ packages: engines: {node: '>=4.0'} dev: true - /estree-walker@2.0.2: - resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true - /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} @@ -1814,7 +1678,6 @@ packages: /function-bind@1.1.2: resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - dev: true /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -1896,7 +1759,6 @@ packages: /graphql@15.3.0: resolution: {integrity: sha512-GTCJtzJmkFLWRfFJuoo9RWWa/FfamUHgiFosxi/X1Ani4AVWbeyBenZTNX6dM+7WSbbFfTo/25eh0LLkwHMw2w==} engines: {node: '>= 10.x'} - dev: true /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} @@ -1912,7 +1774,6 @@ packages: engines: {node: '>= 0.4'} dependencies: function-bind: 1.1.2 - dev: true /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} @@ -1936,7 +1797,6 @@ packages: dependencies: caller-path: 2.0.0 resolve-from: 3.0.0 - dev: true /import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -1944,7 +1804,6 @@ packages: dependencies: parent-module: 1.0.1 resolve-from: 4.0.0 - dev: true /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} @@ -1970,7 +1829,6 @@ packages: /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - dev: true /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} @@ -1983,12 +1841,10 @@ packages: resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==} dependencies: hasown: 2.0.0 - dev: true /is-directory@0.3.1: resolution: {integrity: sha512-yVChGzahRFvbkscn2MlwGismPO12i9+znNruC5gVEntG3qu0xQMzsGg/JFbrsqDOHtHFPci+V5aP5T9I+yeKqw==} engines: {node: '>=0.10.0'} - dev: true /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} @@ -2040,7 +1896,6 @@ packages: dependencies: argparse: 1.0.10 esprima: 4.0.1 - dev: true /js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} @@ -2060,11 +1915,9 @@ packages: /json-parse-better-errors@1.0.2: resolution: {integrity: sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==} - dev: true /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - dev: true /json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} @@ -2100,7 +1953,6 @@ packages: /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: true /load-tsconfig@0.2.5: resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} @@ -2273,7 +2125,6 @@ packages: engines: {node: '>=6'} dependencies: callsites: 3.1.0 - dev: true /parse-json@4.0.0: resolution: {integrity: sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==} @@ -2281,7 +2132,6 @@ packages: dependencies: error-ex: 1.3.2 json-parse-better-errors: 1.0.2 - dev: true /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} @@ -2291,7 +2141,6 @@ packages: error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - dev: true /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} @@ -2310,12 +2159,10 @@ packages: /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - dev: true /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -2407,11 +2254,6 @@ packages: scheduler: 0.23.0 dev: false - /react-refresh@0.10.0: - resolution: {integrity: sha512-PgidR3wST3dDYKr6b4pJoqQFpPGNKDSCDx4cZoshjXipw3LzO7mG1My2pwEzz2JVkF+inx3xRpDeQLFQGH/hsQ==} - engines: {node: '>=0.10.0'} - dev: true - /react-refresh@0.14.0: resolution: {integrity: sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ==} engines: {node: '>=0.10.0'} @@ -2472,12 +2314,10 @@ packages: /resolve-from@3.0.0: resolution: {integrity: sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==} engines: {node: '>=4'} - dev: true /resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} - dev: true /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} @@ -2491,7 +2331,6 @@ packages: is-core-module: 2.13.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} @@ -2603,7 +2442,6 @@ packages: /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: true /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} @@ -2668,7 +2506,6 @@ packages: /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - dev: true /text-table@0.2.0: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} @@ -2907,7 +2744,6 @@ packages: /yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} - dev: true /yaml@2.3.4: resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} diff --git a/src/plugin.ts b/src/plugin.ts index 56c4425..808519a 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -4,7 +4,6 @@ import { transformSync } from "@babel/core"; export default { name: "vite:relay", transform(src, id) { - if (/.(t|j)sx?/.test(id) && src.includes("graphql`")) { const out = transformSync(src, { plugins: [["babel-plugin-relay"]],