diff --git a/packages/playwright-ct-qwik/package.json b/packages/playwright-ct-qwik/package.json index 427c9b5..957ff78 100644 --- a/packages/playwright-ct-qwik/package.json +++ b/packages/playwright-ct-qwik/package.json @@ -2,8 +2,18 @@ "name": "playwright-ct-qwik", "version": "0.0.0", "exports": { - "node": "./definition.js", - "default": "./src/index.js" + ".": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "./register": { + "types": "./src/register-source.d.ts", + "default": "./src/register-source.js" + }, + "./hooks": { + "types": "./src/hooks.d.ts", + "default": "./src/hooks.js" + } }, "files": [ "package.json", diff --git a/packages/playwright-ct-qwik/project.json b/packages/playwright-ct-qwik/project.json index 3869e33..080196a 100644 --- a/packages/playwright-ct-qwik/project.json +++ b/packages/playwright-ct-qwik/project.json @@ -26,16 +26,6 @@ ] } }, - "build-definition": { - "executor": "@nx/js:tsc", - "outputs": ["{options.outputPath}"], - "options": { - "outputPath": "dist/packages/playwright-ct-qwik", - "main": "packages/playwright-ct-qwik/definition.ts", - "tsConfig": "packages/playwright-ct-qwik/tsconfig.definition.json", - "clean": false - } - }, "copy": { "executor": "nx:run-commands", "options": { @@ -45,9 +35,7 @@ "build": { "executor": "nx:run-commands", "options": { - "commands": [ - "nx run playwright-ct-qwik:build-definition --skip-nx-cache && nx run playwright-ct-qwik:build-mount --skip-nx-cache" - ] + "commands": ["nx run playwright-ct-qwik:build-mount --skip-nx-cache"] }, "outputPath": "node_modules/playwright-ct-qwik", "outputs": ["{workspaceRoot}/dist/packages/playwright-ct-qwik"] diff --git a/packages/playwright-ct-qwik/src/index.ts b/packages/playwright-ct-qwik/src/index.ts index 5b54ba2..c8c51df 100644 --- a/packages/playwright-ct-qwik/src/index.ts +++ b/packages/playwright-ct-qwik/src/index.ts @@ -26,9 +26,13 @@ import path from 'path'; const plugin = async () => { // Only fetch upon request to avoid resolution in workers. - const { createPlugin } = require('@playwright/experimental-ct-core/plugin'); - return createPlugin(path.join(__dirname, 'register-source.mjs'), () => - import('@builder.io/qwik/optimizer').then((plugin) => plugin.qwikVite()), + const { + createPlugin, + } = require('@playwright/experimental-ct-core/lib/vitePlugin'); + return createPlugin(path.join(__dirname, 'register-source.js'), () => + import('@builder.io/qwik/optimizer').then((plugin) => + plugin.qwikVite({ srcDir: 'apps/qwik-app/src', csr: true }), + ), ); }; // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/playwright-ct-qwik/tsconfig.lib.json b/packages/playwright-ct-qwik/tsconfig.lib.json index bfb25a0..2b2ca77 100644 --- a/packages/playwright-ct-qwik/tsconfig.lib.json +++ b/packages/playwright-ct-qwik/tsconfig.lib.json @@ -2,7 +2,7 @@ "extends": "./tsconfig.json", "compilerOptions": { "target": "ES6", - "module": "ESNext", + "module": "CommonJS", "moduleResolution": "node", "declaration": true, "lib": ["DOM", "ES6"],