Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(testing): remove unused dependencies from @nrwl/cypress (#13771)
- Loading branch information
Showing
11 changed files
with
38 additions
and
197 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
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
1 change: 1 addition & 0 deletions
1
packages/cypress/src/generators/cypress-component-project/schema.d.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,4 +1,5 @@ | ||
export interface CypressComponentProjectSchema { | ||
project: string; | ||
skipFormat: boolean; | ||
bundler?: 'webpack' | 'vite'; | ||
} |
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 was deleted.
Oops, something went wrong.
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,71 +1,18 @@ | ||
import * as wp from '@cypress/webpack-preprocessor'; | ||
import { TsconfigPathsPlugin } from 'tsconfig-paths-webpack-plugin'; | ||
import ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin'); | ||
import { stripIndents } from '@nrwl/devkit'; | ||
import { installedCypressVersion } from '@nrwl/cypress/src/utils/cypress-version'; | ||
import nodeExternals = require('webpack-node-externals'); | ||
|
||
/** | ||
* @deprecated This function is no longer necessary and will be removed in Nx 14 | ||
/* | ||
* Keeping this file here, so users who still use the old preprocessor will | ||
* continue to have instructions for how to update their workspace. | ||
* | ||
* We deprecated this back in Nx 12, so it's time to force users to stop using it. | ||
* | ||
* TODO: Remove this file in Nx 16 | ||
*/ | ||
export function preprocessTypescript( | ||
config: any, | ||
customizeWebpackConfig?: (webpackConfig: any) => any | ||
) { | ||
if (installedCypressVersion() >= 7) { | ||
console.log(stripIndents` | ||
throw new Error(stripIndents` | ||
preprocessTypescript is now deprecated since Cypress has added typescript support. | ||
If you would still like preprocess files with webpack, use the "@cypress/webpack-preprocessor" package.`); | ||
} | ||
|
||
if (!config.env.tsConfig) { | ||
throw new Error( | ||
'Please provide an absolute path to a tsconfig.json as cypressConfig.env.tsConfig' | ||
); | ||
} | ||
|
||
return async (file) => { | ||
const webpackOptions = customizeWebpackConfig | ||
? customizeWebpackConfig(getWebpackConfig(config)) | ||
: getWebpackConfig(config); | ||
return wp({ webpackOptions })(file); | ||
}; | ||
} | ||
|
||
export function getWebpackConfig(config: any) { | ||
const extensions = ['.ts', '.tsx', '.mjs', '.js', '.jsx']; | ||
return { | ||
resolve: { | ||
extensions, | ||
plugins: [ | ||
new TsconfigPathsPlugin({ | ||
configFile: config.env.tsConfig, | ||
extensions, | ||
}), | ||
], | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.([jt])sx?$/, | ||
loader: require.resolve('ts-loader'), | ||
exclude: [/node_modules/], | ||
options: { | ||
configFile: config.env.tsConfig, | ||
// https://github.com/TypeStrong/ts-loader/pull/685 | ||
experimentalWatchApi: true, | ||
transpileOnly: true, | ||
}, | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new ForkTsCheckerWebpackPlugin({ | ||
typescript: { | ||
configFile: config.env.tsConfig, | ||
}, | ||
}), | ||
], | ||
externals: [nodeExternals()], | ||
}; | ||
} |
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
4f9b9d4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nx-dev – ./
nx.dev
nx-dev-git-master-nrwl.vercel.app
nx-five.vercel.app
nx-dev-nrwl.vercel.app