Skip to content

Commit

Permalink
fix(testing): add preset secondary entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
barbados-clemens committed Jul 19, 2023
1 parent 4d5509b commit b1a7f67
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 28 deletions.
7 changes: 7 additions & 0 deletions packages/playwright/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export {
playwrightExecutor,
PlaywrightExecutorSchema,
} from './src/executors/playwright/playwright';
export { initGenerator } from './src/generators/init/init';
export { configurationGenerator } from './src/generators/configuration/configuration';
export { nxE2EPreset, NxPlaywrightOptions } from './src/utils/preset';
7 changes: 5 additions & 2 deletions packages/playwright/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@
"Playwright",
"CLI"
],
"main": "./src/index",
"typings": "./src/index.d.ts",
"main": "./index.js",
"typings": "./index.d.ts",
"exports": {
"./preset": "./preset.js"
},
"author": "Victor Savkin",
"license": "MIT",
"bugs": {
Expand Down
1 change: 1 addition & 0 deletions packages/playwright/preset.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/utils/preset';
42 changes: 25 additions & 17 deletions packages/playwright/project.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "playwright",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "packages/playwright/src",
"sourceRoot": "packages/playwright",
"projectType": "library",
"targets": {
"build": {
Expand All @@ -15,30 +15,38 @@
"executor": "@nx/js:tsc",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "build/packages/playwright",
"main": "packages/playwright/src/index.ts",
"tsConfig": "packages/playwright/tsconfig.lib.json",
"assets": [
"packages/playwright/*.md",
{
"input": "./packages/playwright/src",
"glob": "**/!(*.ts)",
"output": "./src"
"input": "packages/playwright",
"glob": "**/files/**",
"output": "/"
},
{
"input": "./packages/playwright/src",
"glob": "**/*.d.ts",
"output": "./src"
"input": "packages/playwright",
"glob": "**/files/**/.gitkeep",
"output": "/"
},
{
"input": "packages/playwright",
"glob": "**/*.json",
"ignore": ["**/tsconfig*.json", "project.json", ".eslintrc.json"],
"output": "/"
},
{
"input": "./packages/playwright",
"glob": "generators.json",
"output": "."
"input": "packages/playwright",
"glob": "**/*.js",
"ignore": ["**/jest.config.js"],
"output": "/"
},
{
"input": "packages/playwright",
"glob": "**/*.d.ts",
"output": "/"
},
{
"input": "./packages/playwright",
"glob": "executors.json",
"output": "."
"input": "",
"glob": "LICENSE",
"output": "/"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from '@playwright/test';
import { nxE2EPreset } from '@nx/playwright'
import { nxE2EPreset } from '@nx/playwright/preset';
import { workspaceRoot } from '@nx/devkit';

/**
Expand Down
7 changes: 0 additions & 7 deletions packages/playwright/src/index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion packages/playwright/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"declaration": true,
"types": ["node"]
},
"include": ["src/**/*.ts"],
"include": ["**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
}

0 comments on commit b1a7f67

Please sign in to comment.