Skip to content

Commit

Permalink
chore: change module type
Browse files Browse the repository at this point in the history
Co-authored-by: Jack Shelton <[email protected]>
  • Loading branch information
shairez and thejackshelton committed Feb 5, 2024
1 parent 8bb33d5 commit e266d97
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
14 changes: 12 additions & 2 deletions packages/playwright-ct-qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 1 addition & 13 deletions packages/playwright-ct-qwik/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"]
Expand Down
10 changes: 7 additions & 3 deletions packages/playwright-ct-qwik/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/playwright-ct-qwik/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"target": "ES6",
"module": "ESNext",
"module": "CommonJS",
"moduleResolution": "node",
"declaration": true,
"lib": ["DOM", "ES6"],
Expand Down

0 comments on commit e266d97

Please sign in to comment.