diff --git a/package.json b/package.json index 3f7ed57e..d0dab90c 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ "@nx/storybook": "16.10.0", "@nx/vite": "16.10.0", "@nx/workspace": "16.10.0", - "@nxkit/playwright": "^3.0.2", "@swc-node/register": "1.6.8", "@swc/cli": "0.1.62", "@swc/core": "^1.2.173", diff --git a/packages/qwik-nx/generators.json b/packages/qwik-nx/generators.json index f8915f91..b9d7de75 100644 --- a/packages/qwik-nx/generators.json +++ b/packages/qwik-nx/generators.json @@ -45,11 +45,6 @@ "description": "Set up Tailwind configuration for a project.", "aliases": ["tailwind", "tw", "t"] }, - "e2e-project": { - "factory": "./src/generators/e2e-project/generator", - "schema": "./src/generators/e2e-project/schema.json", - "description": "Create an E2E app for a Qwik app" - }, "cloudflare-pages-integration": { "factory": "./src/generators/integrations/cloudflare-pages-integration/generator", "schema": "./src/generators/integrations/cloudflare-pages-integration/schema.json", diff --git a/packages/qwik-nx/src/generators/application/generator.ts b/packages/qwik-nx/src/generators/application/generator.ts index ed2be819..94103fc9 100644 --- a/packages/qwik-nx/src/generators/application/generator.ts +++ b/packages/qwik-nx/src/generators/application/generator.ts @@ -20,7 +20,7 @@ import { SetupTailwindOptions } from './../setup-tailwind/schema.d'; import { NormalizedSchema, QwikAppGeneratorSchema } from './schema'; import { getQwikApplicationProjectTargets } from './utils/get-qwik-application-project-params'; import { normalizeOptions } from './utils/normalize-options'; -import { addE2eProject } from '../e2e-project/generator'; +import { addE2eProject } from './utils/add-e2e'; function addFiles(tree: Tree, options: NormalizedSchema) { const templateOptions = { @@ -89,12 +89,7 @@ export async function appGenerator( normalizedOptions.e2eTestRunner && normalizedOptions.e2eTestRunner !== 'none' ) { - const e2eProjectTask = await addE2eProject(tree, { - project: normalizedOptions.projectName, - directory: normalizedOptions.directory, - e2eTestRunner: normalizedOptions.e2eTestRunner, - skipFormat: true, - }); + const e2eProjectTask = await addE2eProject(tree, normalizedOptions); tasks.push(e2eProjectTask); } diff --git a/packages/qwik-nx/src/generators/application/schema.d.ts b/packages/qwik-nx/src/generators/application/schema.d.ts index c24aedcf..5e1b5547 100644 --- a/packages/qwik-nx/src/generators/application/schema.d.ts +++ b/packages/qwik-nx/src/generators/application/schema.d.ts @@ -28,4 +28,6 @@ export interface NormalizedSchema extends QwikAppGeneratorSchema { parsedTags: string[]; styleExtension: Exclude | null; projectNameAndRootFormat: ProjectNameAndRootFormat; + e2eProjectName: string; + e2eProjectRoot: string; } diff --git a/packages/qwik-nx/src/generators/application/utils/add-e2e.ts b/packages/qwik-nx/src/generators/application/utils/add-e2e.ts new file mode 100644 index 00000000..a76c61a7 --- /dev/null +++ b/packages/qwik-nx/src/generators/application/utils/add-e2e.ts @@ -0,0 +1,77 @@ +import { + addProjectConfiguration, + ensurePackage, + GeneratorCallback, + getPackageManagerCommand, + joinPathFragments, + Tree, +} from '@nx/devkit'; +import { getInstalledNxVersion } from '../../../utils/get-installed-nx-version'; +import { NormalizedSchema } from '../schema'; +import { Linter } from '@nx/linter'; + +export async function addE2eProject( + tree: Tree, + options: NormalizedSchema +): Promise { + if (options.e2eTestRunner === 'cypress') { + return addCypress(tree, options); + } + + if (options.e2eTestRunner === 'playwright') { + return addPlaywright(tree, options); + } + + return () => void 0; +} + +async function addCypress(tree: Tree, options: NormalizedSchema) { + const { configurationGenerator } = ensurePackage< + typeof import('@nx/cypress') + >('@nx/cypress', getInstalledNxVersion(tree)); + + addProjectConfiguration(tree, options.e2eProjectName, { + projectType: 'application', + root: options.e2eProjectRoot, + sourceRoot: joinPathFragments(options.e2eProjectRoot, 'src'), + targets: {}, + tags: [], + implicitDependencies: [options.name], + }); + return await configurationGenerator(tree, { + project: options.e2eProjectName, + directory: 'src', + linter: options.linter, + skipFormat: true, + devServerTarget: `${options.name}:serve:development`, + }); +} + +async function addPlaywright(tree: Tree, options: NormalizedSchema) { + const { configurationGenerator: playwrightConfigurationGenerator } = + ensurePackage( + '@nx/playwright', + getInstalledNxVersion(tree) + ); + + addProjectConfiguration(tree, options.e2eProjectName, { + projectType: 'application', + root: options.e2eProjectRoot, + sourceRoot: joinPathFragments(options.e2eProjectRoot, 'src'), + targets: {}, + implicitDependencies: [options.name], + }); + return await playwrightConfigurationGenerator(tree, { + project: options.e2eProjectName, + skipFormat: true, + directory: 'src', + js: false, + linter: options.linter ?? Linter.EsLint, + webServerCommand: `${getPackageManagerCommand().exec} nx serve ${ + options.name + }`, + webServerAddress: `http://localhost:${options.devServerPort ?? 4200}`, + setParserOptionsProject: true, + skipPackageJson: false, + }); +} diff --git a/packages/qwik-nx/src/generators/application/utils/normalize-options.ts b/packages/qwik-nx/src/generators/application/utils/normalize-options.ts index a73c6498..1514e790 100644 --- a/packages/qwik-nx/src/generators/application/utils/normalize-options.ts +++ b/packages/qwik-nx/src/generators/application/utils/normalize-options.ts @@ -26,6 +26,10 @@ export async function normalizeOptions( options.strict = options.strict ?? true; options.unitTestRunner = options.unitTestRunner ?? 'vitest'; + const rootProject = appProjectRoot === '.'; + const e2eProjectName = rootProject ? 'e2e' : `${appProjectName}-e2e`; + const e2eProjectRoot = rootProject ? 'e2e' : `${appProjectRoot}-e2e`; + const styleExtension = options.style !== 'none' ? options.style : null; return { @@ -40,5 +44,7 @@ export async function normalizeOptions( devServerPort: options.devServerPort ?? 5173, previewServerPort: options.previewServerPort ?? 4173, projectNameAndRootFormat, + e2eProjectName, + e2eProjectRoot, }; } diff --git a/packages/qwik-nx/src/generators/e2e-project/__snapshots__/generator.spec.ts.snap b/packages/qwik-nx/src/generators/e2e-project/__snapshots__/generator.spec.ts.snap deleted file mode 100644 index 050a03be..00000000 --- a/packages/qwik-nx/src/generators/e2e-project/__snapshots__/generator.spec.ts.snap +++ /dev/null @@ -1,2689 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/apps/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/apps/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "apps/frontend/myapp-e2e", - "sourceRoot": "apps/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nx/cypress:cypress", - "options": Object { - "cypressConfig": "apps/frontend/myapp-e2e/cypress.config.ts", - "devServerTarget": "myapp:serve", - "testingType": "e2e", - }, - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/apps/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/apps/frontend" 2`] = ` -Array [ - Object { - "path": ".eslintignore", - "type": "CREATE", - }, - Object { - "path": ".eslintrc.json", - "type": "CREATE", - }, - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/cypress.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/e2e/app.cy.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/fixtures/example.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/app.po.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/commands.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/e2e.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/apps/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/apps/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "apps/frontend/myapp-e2e", - "sourceRoot": "apps/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "debug": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "debug": true, - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/frontend/myapp-e2e/test-results", - "playwrightConfig": "apps/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/frontend/myapp-e2e/test-results", - "playwrightConfig": "apps/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - "show-report": Object { - "executor": "@nxkit/playwright:show-report", - "options": Object { - "reportPath": "dist/apps/frontend/myapp-e2e/playwright-report", - }, - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/apps/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/apps/frontend" 2`] = ` -Array [ - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/playwright.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/e2e/app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/tests-examples/demo-todo-app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.e2e.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "apps/frontend/myapp-e2e", - "sourceRoot": "apps/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nx/cypress:cypress", - "options": Object { - "cypressConfig": "apps/frontend/myapp-e2e/cypress.config.ts", - "devServerTarget": "myapp:serve", - "testingType": "e2e", - }, - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/frontend" 2`] = ` -Array [ - Object { - "path": ".eslintignore", - "type": "CREATE", - }, - Object { - "path": ".eslintrc.json", - "type": "CREATE", - }, - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/cypress.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/e2e/app.cy.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/fixtures/example.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/app.po.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/commands.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/e2e.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "apps/frontend/myapp-e2e", - "sourceRoot": "apps/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "debug": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "debug": true, - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/frontend/myapp-e2e/test-results", - "playwrightConfig": "apps/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/frontend/myapp-e2e/test-results", - "playwrightConfig": "apps/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - "show-report": Object { - "executor": "@nxkit/playwright:show-report", - "options": Object { - "reportPath": "dist/apps/frontend/myapp-e2e/playwright-report", - }, - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "/frontend" 2`] = ` -Array [ - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/playwright.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/e2e/app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/tests-examples/demo-todo-app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.e2e.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages" and framework is "cypress" should generate "myapp-e2e" with project's root at "packages/myapp-e2e": "/packages" 1`] = ` -Object { - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "myapp-e2e", - "projectType": "application", - "root": "packages/myapp-e2e", - "sourceRoot": "packages/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nx/cypress:cypress", - "options": Object { - "cypressConfig": "packages/myapp-e2e/cypress.config.ts", - "devServerTarget": "myapp:serve", - "testingType": "e2e", - }, - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "packages/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages" and framework is "cypress" should generate "myapp-e2e" with project's root at "packages/myapp-e2e": "/packages" 2`] = ` -Array [ - Object { - "path": ".eslintignore", - "type": "CREATE", - }, - Object { - "path": ".eslintrc.json", - "type": "CREATE", - }, - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/cypress.config.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/e2e/app.cy.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/fixtures/example.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/support/app.po.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/support/commands.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/support/e2e.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages" and framework is "playwright" should generate "myapp-e2e" with project's root at "packages/myapp-e2e": "/packages" 1`] = ` -Object { - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "myapp-e2e", - "projectType": "application", - "root": "packages/myapp-e2e", - "sourceRoot": "packages/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "debug": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "debug": true, - "devServerTarget": "myapp:serve", - "outputPath": "dist/packages/myapp-e2e/test-results", - "playwrightConfig": "packages/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "devServerTarget": "myapp:serve", - "outputPath": "dist/packages/myapp-e2e/test-results", - "playwrightConfig": "packages/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "packages/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - "show-report": Object { - "executor": "@nxkit/playwright:show-report", - "options": Object { - "reportPath": "dist/packages/myapp-e2e/playwright-report", - }, - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages" and framework is "playwright" should generate "myapp-e2e" with project's root at "packages/myapp-e2e": "/packages" 2`] = ` -Array [ - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/playwright.config.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/e2e/app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/src/tests-examples/demo-todo-app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/tsconfig.e2e.json", - "type": "CREATE", - }, - Object { - "path": "packages/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "packages/frontend/myapp-e2e": "/packages/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "packages/frontend/myapp-e2e", - "sourceRoot": "packages/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nx/cypress:cypress", - "options": Object { - "cypressConfig": "packages/frontend/myapp-e2e/cypress.config.ts", - "devServerTarget": "myapp:serve", - "testingType": "e2e", - }, - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "packages/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "packages/frontend/myapp-e2e": "/packages/frontend" 2`] = ` -Array [ - Object { - "path": ".eslintignore", - "type": "CREATE", - }, - Object { - "path": ".eslintrc.json", - "type": "CREATE", - }, - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/cypress.config.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/e2e/app.cy.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/fixtures/example.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/support/app.po.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/support/commands.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/support/e2e.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "packages/frontend/myapp-e2e": "/packages/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "packages/frontend/myapp-e2e", - "sourceRoot": "packages/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "debug": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "debug": true, - "devServerTarget": "myapp:serve", - "outputPath": "dist/packages/frontend/myapp-e2e/test-results", - "playwrightConfig": "packages/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "devServerTarget": "myapp:serve", - "outputPath": "dist/packages/frontend/myapp-e2e/test-results", - "playwrightConfig": "packages/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "packages/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - "show-report": Object { - "executor": "@nxkit/playwright:show-report", - "options": Object { - "reportPath": "dist/packages/frontend/myapp-e2e/playwright-report", - }, - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "/packages/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "packages/frontend/myapp-e2e": "/packages/frontend" 2`] = ` -Array [ - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/playwright.config.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/e2e/app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/src/tests-examples/demo-todo-app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/tsconfig.e2e.json", - "type": "CREATE", - }, - Object { - "path": "packages/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps" and framework is "cypress" should generate "myapp-e2e" with project's root at "apps/myapp-e2e": "apps" 1`] = ` -Object { - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "myapp-e2e", - "projectType": "application", - "root": "apps/myapp-e2e", - "sourceRoot": "apps/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nx/cypress:cypress", - "options": Object { - "cypressConfig": "apps/myapp-e2e/cypress.config.ts", - "devServerTarget": "myapp:serve", - "testingType": "e2e", - }, - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps" and framework is "cypress" should generate "myapp-e2e" with project's root at "apps/myapp-e2e": "apps" 2`] = ` -Array [ - Object { - "path": ".eslintignore", - "type": "CREATE", - }, - Object { - "path": ".eslintrc.json", - "type": "CREATE", - }, - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/cypress.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/e2e/app.cy.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/fixtures/example.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/support/app.po.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/support/commands.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/support/e2e.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps" and framework is "playwright" should generate "myapp-e2e" with project's root at "apps/myapp-e2e": "apps" 1`] = ` -Object { - "$schema": "../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "myapp-e2e", - "projectType": "application", - "root": "apps/myapp-e2e", - "sourceRoot": "apps/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "debug": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "debug": true, - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/myapp-e2e/test-results", - "playwrightConfig": "apps/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/myapp-e2e/test-results", - "playwrightConfig": "apps/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - "show-report": Object { - "executor": "@nxkit/playwright:show-report", - "options": Object { - "reportPath": "dist/apps/myapp-e2e/playwright-report", - }, - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps" and framework is "playwright" should generate "myapp-e2e" with project's root at "apps/myapp-e2e": "apps" 2`] = ` -Array [ - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/playwright.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/e2e/app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/src/tests-examples/demo-todo-app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/tsconfig.e2e.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "apps/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "apps/frontend/myapp-e2e", - "sourceRoot": "apps/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nx/cypress:cypress", - "options": Object { - "cypressConfig": "apps/frontend/myapp-e2e/cypress.config.ts", - "devServerTarget": "myapp:serve", - "testingType": "e2e", - }, - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps/frontend" and framework is "cypress" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "apps/frontend" 2`] = ` -Array [ - Object { - "path": ".eslintignore", - "type": "CREATE", - }, - Object { - "path": ".eslintrc.json", - "type": "CREATE", - }, - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/cypress.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/e2e/app.cy.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/fixtures/example.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/app.po.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/commands.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/support/e2e.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "apps/frontend" 1`] = ` -Object { - "$schema": "../../../node_modules/nx/schemas/project-schema.json", - "implicitDependencies": Array [ - "myapp", - ], - "name": "frontend-myapp-e2e", - "projectType": "application", - "root": "apps/frontend/myapp-e2e", - "sourceRoot": "apps/frontend/myapp-e2e/src", - "tags": Array [], - "targets": Object { - "debug": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "debug": true, - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/frontend/myapp-e2e/test-results", - "playwrightConfig": "apps/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "e2e": Object { - "configurations": Object { - "production": Object { - "devServerTarget": "myapp:serve:production", - }, - }, - "executor": "@nxkit/playwright:test", - "options": Object { - "devServerTarget": "myapp:serve", - "outputPath": "dist/apps/frontend/myapp-e2e/test-results", - "playwrightConfig": "apps/frontend/myapp-e2e/playwright.config.ts", - }, - "outputs": Array [ - "{workspaceRoot}/dist/{projectRoot}", - ], - }, - "lint": Object { - "executor": "@nx/linter:eslint", - "options": Object { - "lintFilePatterns": Array [ - "apps/frontend/myapp-e2e/**/*.{js,ts}", - ], - }, - "outputs": Array [ - "{options.outputFile}", - ], - }, - "show-report": Object { - "executor": "@nxkit/playwright:show-report", - "options": Object { - "reportPath": "dist/apps/frontend/myapp-e2e/playwright-report", - }, - }, - }, -} -`; - -exports[`e2e project should be able to resolve directory path based on the workspace layout when directory is "apps/frontend" and framework is "playwright" should generate "frontend-myapp-e2e" with project's root at "apps/frontend/myapp-e2e": "apps/frontend" 2`] = ` -Array [ - Object { - "path": ".prettierignore", - "type": "CREATE", - }, - Object { - "path": ".prettierrc", - "type": "CREATE", - }, - Object { - "path": "apps/.gitignore", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/playwright.config.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/e2e/app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/src/tests-examples/demo-todo-app.spec.ts", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.e2e.json", - "type": "CREATE", - }, - Object { - "path": "apps/frontend/myapp-e2e/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.eslintrc.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/.prettierignore", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/package.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/project.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/favicon.svg", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/manifest.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/public/robots.txt", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/README.md", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/header/header.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/icons/qwik.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/components/router-head/router-head.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.dev.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.preview.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/entry.ssr.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/global.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/root.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/flower.,", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/flower/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/index.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/layout.tsx", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/src/routes/service-worker.ts", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.app.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/tsconfig.spec.json", - "type": "CREATE", - }, - Object { - "path": "apps/myapp/vite.config.ts", - "type": "CREATE", - }, - Object { - "path": "libs/.gitignore", - "type": "CREATE", - }, - Object { - "path": "nx.json", - "type": "CREATE", - }, - Object { - "path": "package.json", - "type": "CREATE", - }, - Object { - "path": "tsconfig.base.json", - "type": "CREATE", - }, -] -`; diff --git a/packages/qwik-nx/src/generators/e2e-project/generator.spec.ts b/packages/qwik-nx/src/generators/e2e-project/generator.spec.ts deleted file mode 100644 index 7e72fc32..00000000 --- a/packages/qwik-nx/src/generators/e2e-project/generator.spec.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing'; -import { Tree, readProjectConfiguration } from '@nx/devkit'; -import { appGenerator } from './../application/generator'; - -import generator from './generator'; -import { E2eProjectGeneratorSchema } from './schema'; -import { getFormattedListChanges } from '../../utils/testing-generators'; - -// eslint-disable-next-line @typescript-eslint/no-var-requires -const devkit = require('@nx/devkit'); -const getInstalledNxVersionModule = require('../../utils/get-installed-nx-version'); - -describe('e2e project', () => { - let appTree: Tree; - const defaultOptions: Omit = { - project: 'myapp', - skipFormat: true, - }; - - jest.spyOn(devkit, 'ensurePackage').mockReturnValue(Promise.resolve()); - jest - .spyOn(getInstalledNxVersionModule, 'getInstalledNxVersion') - .mockReturnValue('15.6.0'); - - beforeEach(async () => { - appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' }); - await appGenerator(appTree, { - name: 'myapp', - e2eTestRunner: 'none', - }); - }); - - it('--e2eTestRunner playwright', async () => { - await generator(appTree, { - ...defaultOptions, - e2eTestRunner: 'playwright', - }); - const config = readProjectConfiguration(appTree, 'myapp-e2e'); - expect(config).toBeDefined(); - expect(config.targets?.e2e.executor).toEqual('@nxkit/playwright:test'); - expect(appTree.exists('apps/myapp-e2e/playwright.config.ts')).toBeTruthy(); - }); - - it('--e2eTestRunner cypress', async () => { - await generator(appTree, { - ...defaultOptions, - e2eTestRunner: 'cypress', - }); - const config = readProjectConfiguration(appTree, 'myapp-e2e'); - expect(config).toBeDefined(); - expect(config.targets?.e2e.executor).toEqual('@nx/cypress:cypress'); - expect(appTree.exists('apps/myapp-e2e/cypress.config.ts')).toBeTruthy(); - }); - - describe('should be able to resolve directory path based on the workspace layout', () => { - test.each` - directory | expectedProjectName | projectRoot | framework - ${'/frontend'} | ${'frontend-myapp-e2e'} | ${'apps/frontend/myapp-e2e'} | ${'cypress'} - ${'apps'} | ${'myapp-e2e'} | ${'apps/myapp-e2e'} | ${'cypress'} - ${'/apps/frontend'} | ${'frontend-myapp-e2e'} | ${'apps/frontend/myapp-e2e'} | ${'cypress'} - ${'apps/frontend'} | ${'frontend-myapp-e2e'} | ${'apps/frontend/myapp-e2e'} | ${'cypress'} - ${'/packages'} | ${'myapp-e2e'} | ${'packages/myapp-e2e'} | ${'cypress'} - ${'/packages/frontend'} | ${'frontend-myapp-e2e'} | ${'packages/frontend/myapp-e2e'} | ${'cypress'} - ${'/frontend'} | ${'frontend-myapp-e2e'} | ${'apps/frontend/myapp-e2e'} | ${'playwright'} - ${'apps'} | ${'myapp-e2e'} | ${'apps/myapp-e2e'} | ${'playwright'} - ${'/apps/frontend'} | ${'frontend-myapp-e2e'} | ${'apps/frontend/myapp-e2e'} | ${'playwright'} - ${'apps/frontend'} | ${'frontend-myapp-e2e'} | ${'apps/frontend/myapp-e2e'} | ${'playwright'} - ${'/packages'} | ${'myapp-e2e'} | ${'packages/myapp-e2e'} | ${'playwright'} - ${'/packages/frontend'} | ${'frontend-myapp-e2e'} | ${'packages/frontend/myapp-e2e'} | ${'playwright'} - `( - 'when directory is "$directory" and framework is "$framework" should generate "$expectedProjectName" with project\'s root at "$projectRoot"', - async ({ directory, framework, expectedProjectName, projectRoot }) => { - await generator(appTree, { - ...defaultOptions, - e2eTestRunner: framework, - directory, - }); - - const config = readProjectConfiguration(appTree, expectedProjectName); - - expect(config.root).toBe(projectRoot); - expect(config).toMatchSnapshot( - JSON.stringify(directory, expectedProjectName) - ); - expect(getFormattedListChanges(appTree)).toMatchSnapshot( - JSON.stringify(directory, expectedProjectName) - ); - } - ); - }); -}); diff --git a/packages/qwik-nx/src/generators/e2e-project/generator.ts b/packages/qwik-nx/src/generators/e2e-project/generator.ts deleted file mode 100644 index aa10c3f5..00000000 --- a/packages/qwik-nx/src/generators/e2e-project/generator.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { - ensurePackage, - GeneratorCallback, - readProjectConfiguration, - Tree, -} from '@nx/devkit'; -import { getInstalledNxVersion } from '../../utils/get-installed-nx-version'; -import { nxKitVersion } from '../../utils/versions'; -import { E2eProjectGeneratorSchema, NormalizedSchema } from './schema'; -import { normalizeOptions } from './utils/normalize-options'; - -export async function addE2eProject( - tree: Tree, - options: E2eProjectGeneratorSchema -): Promise { - const projectConfiguration = readProjectConfiguration(tree, options.project); - - if (projectConfiguration.projectType !== 'application') { - throw new Error('Cannot setup e2e project for the given frontend project.'); - } - - const normalizedOptions = normalizeOptions(tree, options); - if (options.e2eTestRunner === 'cypress') { - return addCypress(tree, normalizedOptions); - } - - if (options.e2eTestRunner === 'playwright') { - return addPlaywright(tree, normalizedOptions); - } - - return () => void 0; -} - -async function addCypress(tree: Tree, options: NormalizedSchema) { - await ensurePackage('@nx/cypress', getInstalledNxVersion(tree)); - const { cypressProjectGenerator } = await import('@nx/cypress'); - - return await cypressProjectGenerator(tree, { - ...options, - name: options.e2eProjectName, - directory: options.directory, - project: options.project, - bundler: 'vite', - skipFormat: options.skipFormat, - }); -} - -async function addPlaywright(tree: Tree, options: NormalizedSchema) { - await ensurePackage('@nxkit/playwright', nxKitVersion); - const { projectGenerator } = await import('@nxkit/playwright'); - - return await projectGenerator(tree, { - ...options, - name: options.e2eProjectName, - directory: options.directory, - frontendProject: options.project, - skipFormat: options.skipFormat, - }); -} - -export default addE2eProject; diff --git a/packages/qwik-nx/src/generators/e2e-project/schema.d.ts b/packages/qwik-nx/src/generators/e2e-project/schema.d.ts deleted file mode 100644 index d0d060af..00000000 --- a/packages/qwik-nx/src/generators/e2e-project/schema.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export interface E2eProjectGeneratorSchema { - project: string; - e2eTestRunner: 'playwright' | 'cypress'; - directory?: string; - skipFormat?: boolean; -} - -export interface NormalizedSchema extends E2eProjectGeneratorSchema { - e2eProjectName: string; - projectRoot: string; - projectDirectory: string; -} diff --git a/packages/qwik-nx/src/generators/e2e-project/schema.json b/packages/qwik-nx/src/generators/e2e-project/schema.json deleted file mode 100644 index 42118d65..00000000 --- a/packages/qwik-nx/src/generators/e2e-project/schema.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "$schema": "http://json-schema.org/schema", - "$id": "E2eProject", - "title": "Create an E2E app for a Qwik app", - "type": "object", - "properties": { - "project": { - "type": "string", - "description": "", - "$default": { - "$source": "argv", - "index": 0 - }, - "x-prompt": "The name of the frontend project to test." - }, - "e2eTestRunner": { - "type": "string", - "enum": ["playwright", "cypress"], - "description": "Test runner to use for end to end (E2E) tests.", - "default": "playwright" - }, - "directory": { - "type": "string", - "description": "A directory where the project is placed" - }, - "skipFormat": { - "description": "Skip formatting files.", - "type": "boolean", - "default": false - } - }, - "required": ["project", "e2eTestRunner"] -} diff --git a/packages/qwik-nx/src/generators/e2e-project/utils/normalize-options.ts b/packages/qwik-nx/src/generators/e2e-project/utils/normalize-options.ts deleted file mode 100644 index 65bb8515..00000000 --- a/packages/qwik-nx/src/generators/e2e-project/utils/normalize-options.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { - extractLayoutDirectory, - getWorkspaceLayout, - names, - normalizePath, - Tree, -} from '@nx/devkit'; -import { E2eProjectGeneratorSchema, NormalizedSchema } from '../schema'; - -function getE2eProjectName(options: E2eProjectGeneratorSchema) { - return names(options.project + '-e2e').fileName; -} -function normalizeDirectory(options: E2eProjectGeneratorSchema) { - const name = getE2eProjectName(options); - const { projectDirectory } = extractLayoutDirectory(options.directory ?? ''); - return projectDirectory - ? `${names(projectDirectory).fileName}/${names(name).fileName}` - : names(name).fileName; -} - -export function normalizeOptions( - tree: Tree, - options: E2eProjectGeneratorSchema -): NormalizedSchema { - const extracted = extractLayoutDirectory(options.directory ?? ''); - - const appsDir = extracted.layoutDirectory ?? getWorkspaceLayout(tree).appsDir; - - const fullProjectDirectory = normalizeDirectory(options); - - const projectRoot = normalizePath(`${appsDir}/${fullProjectDirectory}`); - - return { - ...options, - e2eProjectName: getE2eProjectName(options), - projectRoot, - projectDirectory: fullProjectDirectory, - }; -} diff --git a/packages/qwik-nx/src/generators/index.ts b/packages/qwik-nx/src/generators/index.ts index 4df4725a..82225e5c 100644 --- a/packages/qwik-nx/src/generators/index.ts +++ b/packages/qwik-nx/src/generators/index.ts @@ -2,8 +2,6 @@ export { appGenerator } from './application/generator'; export type { QwikAppGeneratorSchema } from './application/schema'; export { componentGenerator } from './component/generator'; export type { ComponentGeneratorSchema } from './component/schema'; -export { addE2eProject } from './e2e-project/generator'; -export type { E2eProjectGeneratorSchema } from './e2e-project/schema'; export { qwikInitGenerator } from './init/init'; export type { InitGeneratorSchema } from './init/schema'; export { cloudflarePagesIntegrationGenerator } from './integrations/cloudflare-pages-integration/generator'; diff --git a/packages/qwik-nx/src/utils/versions.ts b/packages/qwik-nx/src/utils/versions.ts index 2786ac7d..21861f2b 100644 --- a/packages/qwik-nx/src/utils/versions.ts +++ b/packages/qwik-nx/src/utils/versions.ts @@ -17,9 +17,6 @@ export const autoprefixerVersion = '~10.4.11'; export const postcssVersion = '~8.4.16'; export const tailwindcssVersion = '~3.1.8'; -// nxkit packages -export const nxKitVersion = '^3.0.2'; - // cloudflare-pages integration export const wranglerVersion = '^3.1.0'; export const nxCloudflareWrangler = '^2.4.2'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index affa0578..82cb7fcf 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,4 @@ -lockfileVersion: '6.1' +lockfileVersion: '6.0' settings: autoInstallPeers: true @@ -46,6 +46,9 @@ devDependencies: '@nx/linter': specifier: 16.10.0 version: 16.10.0(@swc-node/register@1.6.8)(@swc/core@1.2.173)(@types/node@16.11.7)(eslint@8.46.0)(nx@16.10.0)(verdaccio@5.21.1) + '@nx/playwright': + specifier: 16.10.0 + version: 16.10.0(@playwright/test@1.39.0)(@swc-node/register@1.6.8)(@swc/core@1.2.173)(@types/node@16.11.7)(eslint@8.46.0)(nx@16.10.0)(verdaccio@5.21.1) '@nx/plugin': specifier: 16.10.0 version: 16.10.0(@swc-node/register@1.6.8)(@swc/core@1.2.173)(@types/node@16.11.7)(eslint@8.46.0)(nx@16.10.0)(ts-node@10.9.1)(typescript@4.9.5)(verdaccio@5.21.1) @@ -1905,6 +1908,7 @@ packages: integrity: sha512-kbHkIuItXn93o2NmTdwi5Mk1ujyuSIysRE/XHtrcps/27GuUKEIqBJp6TdJ4Sq+ze59RlzYSHMKuDKZbfg9+uQ==, } engines: { node: '>=v18' } + requiresBuild: true dependencies: '@commitlint/types': 18.1.0 ajv: 8.12.0 @@ -1940,6 +1944,7 @@ packages: integrity: sha512-w3Vt4K+O7+nSr9/gFSEfZ1exKUOPSlJaRpnk7Y+XowEhvwT7AIk1HNANH+gETf0zGZ020+hfiMW/Ome+SNCUsg==, } engines: { node: '>=v18' } + requiresBuild: true dev: true optional: true @@ -2084,6 +2089,7 @@ packages: integrity: sha512-3mZpzOEJkELt7BbaZp6+bofJyxViyObebagFn0A7IHaLARhPkWTivXdjvZHS12nAORftv88Yhbh8eCPKfSvB7g==, } engines: { node: '>=v18' } + requiresBuild: true dependencies: '@commitlint/config-validator': 18.1.0 '@commitlint/types': 18.1.0 @@ -2142,6 +2148,7 @@ packages: integrity: sha512-65vGxZmbs+2OVwEItxhp3Ul7X2m2LyLfifYI/NdPwRqblmuES2w2aIRhIjb7cwUIBHHSTT8WXj4ixVHQibmvLQ==, } engines: { node: '>=v18' } + requiresBuild: true dependencies: chalk: 4.1.0 dev: true @@ -3542,6 +3549,34 @@ packages: dev: true optional: true + /@nx/playwright@16.10.0(@playwright/test@1.39.0)(@swc-node/register@1.6.8)(@swc/core@1.2.173)(@types/node@16.11.7)(eslint@8.46.0)(nx@16.10.0)(verdaccio@5.21.1): + resolution: + { + integrity: sha512-E+Z+kkusaA2OnYIOwpocdwqQPSplp3II2c9W7g7MDA0sJyoHc9Xggw0Xdfncm19RXRT0OmBxA3laN5a4GdN1ZQ==, + } + peerDependencies: + '@playwright/test': ^1.36.0 + peerDependenciesMeta: + '@playwright/test': + optional: true + dependencies: + '@nx/devkit': 16.10.0(nx@16.10.0) + '@nx/linter': 16.10.0(@swc-node/register@1.6.8)(@swc/core@1.2.173)(@types/node@16.11.7)(eslint@8.46.0)(nx@16.10.0)(verdaccio@5.21.1) + '@playwright/test': 1.39.0 + tslib: 2.5.0 + transitivePeerDependencies: + - '@babel/traverse' + - '@swc-node/register' + - '@swc/core' + - '@swc/wasm' + - '@types/node' + - debug + - eslint + - nx + - supports-color + - verdaccio + dev: true + /@nx/plugin@16.10.0(@swc-node/register@1.6.8)(@swc/core@1.2.173)(@types/node@16.11.7)(eslint@8.46.0)(nx@16.10.0)(ts-node@10.9.1)(typescript@4.9.5)(verdaccio@5.21.1): resolution: { @@ -4263,6 +4298,7 @@ packages: { integrity: sha512-bw+lEsxis6eqJYW8Ql6+yTqkE6RuFtsQPSe5JxXbqYRFQEER5aJA9a5UH9igqDWm3X4iLHIKOHlnAXLM4mi7uQ==, } + requiresBuild: true dependencies: undici-types: 5.26.5 dev: true @@ -6447,6 +6483,7 @@ packages: integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==, } engines: { node: '>=v16' } + requiresBuild: true peerDependencies: '@types/node': '*' cosmiconfig: '>=8.2' @@ -9663,6 +9700,7 @@ packages: integrity: sha512-3TV69ZbrvV6U5DfQimop50jE9Dl6J8O1ja1dvBbMba/sZ3YBEQqJ2VZRoQPVnhlzjNtU1vaXRZVrVjU4qtm8yA==, } hasBin: true + requiresBuild: true dev: true optional: true @@ -13505,6 +13543,7 @@ packages: { integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==, } + requiresBuild: true dev: true optional: true