-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5b8725
commit bb65dea
Showing
68 changed files
with
15,762 additions
and
15,532 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,12 @@ | ||
{ | ||
"migrations": [ | ||
{ | ||
"version": "18.1.0-beta.3", | ||
"description": "Moves affected.defaultBase to defaultBase in `nx.json`", | ||
"implementation": "./src/migrations/update-17-2-0/move-default-base", | ||
"package": "nx", | ||
"name": "move-default-base-to-nx-json-root" | ||
}, | ||
{ | ||
"cli": "nx", | ||
"version": "18.1.0-beta.3", | ||
"description": "Remove invalid baseUrl option from @nx/playwright:playwright targets in project.json.", | ||
"implementation": "./src/migrations/update-18-1-0/remove-baseUrl-from-project-json", | ||
"package": "@nx/playwright", | ||
"name": "18-1-0-remove-baseUrl-from-project-json" | ||
}, | ||
{ | ||
"cli": "nx", | ||
"version": "18.1.0-beta.3", | ||
"description": "Update to Cypress ^13.6.6 if the workspace is using Cypress v13 to ensure workspaces don't use v13.6.5 which has an issue when verifying Cypress.", | ||
"implementation": "./src/migrations/update-18-1-0/update-cypress-version-13-6-6", | ||
"package": "@nx/cypress", | ||
"name": "update-cypress-version-13-6-6" | ||
}, | ||
{ | ||
"cli": "nx", | ||
"version": "18.1.1-beta.0", | ||
"description": "Ensure targetDefaults inputs for task hashing when '@nx/webpack:webpack' is used are correct for Module Federation.", | ||
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs", | ||
"package": "@nx/react", | ||
"name": "fix-target-defaults-for-webpack" | ||
}, | ||
{ | ||
"cli": "nx", | ||
"version": "18.1.1-beta.0", | ||
"description": "Ensure targetDefaults inputs for task hashing when '@nx/angular:webpack-browser' is used are correct for Module Federation.", | ||
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs", | ||
"package": "@nx/angular", | ||
"name": "fix-target-defaults-for-webpack-browser" | ||
"version": "19.1.0-beta.6", | ||
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs", | ||
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi", | ||
"package": "@nx/eslint-plugin", | ||
"name": "update-19-1-0-rename-no-extra-semi" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 47 additions & 8 deletions
55
packages/preact/src/generators/application/lib/add-cypress.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,56 @@ | ||
import { Tree, ensurePackage, NX_VERSION } from '@nx/devkit'; | ||
import { | ||
addProjectConfiguration, | ||
ensurePackage, | ||
joinPathFragments, | ||
NX_VERSION, | ||
Tree, | ||
} from '@nx/devkit'; | ||
import { NormalizedSchema } from '../schema'; | ||
|
||
export async function addCypress(host: Tree, options: NormalizedSchema) { | ||
export async function addCypress(tree: Tree, options: NormalizedSchema) { | ||
if (options.e2eTestRunner !== 'cypress') { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
return () => {}; | ||
return () => {}; // eslint-disable-line @typescript-eslint/no-empty-function | ||
} | ||
const { cypressProjectGenerator } = ensurePackage< | ||
|
||
const { webStaticServeGenerator } = ensurePackage<typeof import('@nx/web')>( | ||
'@nx/web', | ||
NX_VERSION | ||
); | ||
|
||
await webStaticServeGenerator(tree, { | ||
buildTarget: `${options.name}:build`, | ||
targetName: 'serve-static', | ||
spa: true, | ||
}); | ||
|
||
const { configurationGenerator } = ensurePackage< | ||
typeof import('@nx/cypress') | ||
>('@nx/cypress', NX_VERSION); | ||
|
||
return await cypressProjectGenerator(host, { | ||
name: options.name + '-e2e', | ||
project: options.name, | ||
addProjectConfiguration(tree, options.e2eProjectName, { | ||
projectType: 'application', | ||
root: options.e2eProjectRoot, | ||
sourceRoot: joinPathFragments(options.e2eProjectRoot, 'src'), | ||
targets: {}, | ||
implicitDependencies: [options.name], | ||
tags: [], | ||
}); | ||
|
||
return await configurationGenerator(tree, { | ||
...options, | ||
project: options.e2eProjectName, | ||
directory: 'src', | ||
// the name and root are already normalized, instruct the generator to use them as is | ||
bundler: 'webpack', | ||
skipFormat: true, | ||
devServerTarget: `${options.name}:${options.e2eWebServerTarget}`, | ||
baseUrl: options.e2eWebServerAddress, | ||
jsx: true, | ||
rootProject: false, | ||
webServerCommands: { | ||
default: `nx run ${options.name}:${options.e2eWebServerTarget}`, | ||
production: `nx run ${options.name}:preview`, | ||
}, | ||
ciWebServerCommand: `nx run ${options.name}:serve-static`, | ||
}); | ||
} |
Oops, something went wrong.