fix: resolve ES modules compatibility in E2E test files
- Replace __dirname with import.meta.url pattern for ES modules compatibility - Add fileURLToPath imports to all E2E test files - Fix duplicate require statements in setup-verification.spec.ts - Update playwright.config.ts to use relative path instead of __dirname This fixes the 'ReferenceError: __dirname is not defined in ES module scope' error when running Playwright tests in the ES modules environment.
This commit is contained in:
21
node_modules/@radix-ui/react-use-effect-event/LICENSE
generated
vendored
Normal file
21
node_modules/@radix-ui/react-use-effect-event/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2022 WorkOS
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
5
node_modules/@radix-ui/react-use-effect-event/README.md
generated
vendored
Normal file
5
node_modules/@radix-ui/react-use-effect-event/README.md
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# `react-use-is-hydrated`
|
||||
|
||||
## Usage
|
||||
|
||||
This is an internal utility, not intended for public usage.
|
||||
65
node_modules/@radix-ui/react-use-effect-event/package.json
generated
vendored
Normal file
65
node_modules/@radix-ui/react-use-effect-event/package.json
generated
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "@radix-ui/react-use-effect-event",
|
||||
"version": "0.0.2",
|
||||
"license": "MIT",
|
||||
"source": "./src/index.ts",
|
||||
"main": "./dist/index.js",
|
||||
"module": "./dist/index.mjs",
|
||||
"files": [
|
||||
"src",
|
||||
"dist",
|
||||
"README.md"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"peerDependencies": {
|
||||
"@types/react": "*",
|
||||
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@types/react": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@radix-ui/react-use-layout-effect": "1.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^19.0.7",
|
||||
"@types/react-dom": "^19.0.3",
|
||||
"@types/use-sync-external-store": "^0.0.6",
|
||||
"eslint": "^9.18.0",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"typescript": "^5.7.3",
|
||||
"@repo/typescript-config": "0.0.0",
|
||||
"@repo/builder": "0.0.0",
|
||||
"@repo/eslint-config": "0.0.0"
|
||||
},
|
||||
"homepage": "https://radix-ui.com/primitives",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/radix-ui/primitives.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/radix-ui/primitives/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --max-warnings 0 src",
|
||||
"clean": "rm -rf dist",
|
||||
"typecheck": "tsc --noEmit",
|
||||
"build": "radix-build"
|
||||
},
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"types": "./dist/index.d.mts",
|
||||
"default": "./dist/index.mjs"
|
||||
},
|
||||
"require": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"default": "./dist/index.js"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
node_modules/@radix-ui/react-use-effect-event/src/index.ts
generated
vendored
Normal file
1
node_modules/@radix-ui/react-use-effect-event/src/index.ts
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export { useEffectEvent } from './use-effect-event';
|
||||
36
node_modules/@radix-ui/react-use-effect-event/src/use-effect-event.tsx
generated
vendored
Normal file
36
node_modules/@radix-ui/react-use-effect-event/src/use-effect-event.tsx
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
/* eslint-disable react-hooks/rules-of-hooks */
|
||||
import { useLayoutEffect } from '@radix-ui/react-use-layout-effect';
|
||||
import * as React from 'react';
|
||||
|
||||
type AnyFunction = (...args: any[]) => any;
|
||||
|
||||
// See https://github.com/webpack/webpack/issues/14814
|
||||
const useReactEffectEvent = (React as any)[' useEffectEvent '.trim().toString()];
|
||||
const useReactInsertionEffect = (React as any)[' useInsertionEffect '.trim().toString()];
|
||||
|
||||
/**
|
||||
* Designed to approximate the behavior on `experimental_useEffectEvent` as best
|
||||
* as possible until its stable release, and back-fill it as a shim as needed.
|
||||
*/
|
||||
export function useEffectEvent<T extends AnyFunction>(callback?: T): T {
|
||||
if (typeof useReactEffectEvent === 'function') {
|
||||
return useReactEffectEvent(callback);
|
||||
}
|
||||
|
||||
const ref = React.useRef<AnyFunction | undefined>(() => {
|
||||
throw new Error('Cannot call an event handler while rendering.');
|
||||
});
|
||||
// See https://github.com/webpack/webpack/issues/14814
|
||||
if (typeof useReactInsertionEffect === 'function') {
|
||||
useReactInsertionEffect(() => {
|
||||
ref.current = callback;
|
||||
});
|
||||
} else {
|
||||
useLayoutEffect(() => {
|
||||
ref.current = callback;
|
||||
});
|
||||
}
|
||||
|
||||
// https://github.com/facebook/react/issues/19240
|
||||
return React.useMemo(() => ((...args) => ref.current?.(...args)) as T, []);
|
||||
}
|
||||
Reference in New Issue
Block a user