Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(angular): angular mount #22858

Merged
merged 15 commits into from
Jul 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -1791,14 +1791,6 @@ jobs:
- run:
name: Build
command: yarn workspace @cypress/angular build
- run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No tests for npm/angular. To test this, we would need to install all of the webpack deps for Angular so all of the mounting tests are found in the system-tests/project-fixtures/angular/src/app/mount.cy.ts which are run in npm-webpack-dev-server e2e tests.

name: Run tests
command: yarn test-ci
working_directory: npm/angular
- store_test_results:
path: npm/angular/test_results
- store_artifacts:
path: npm/angular/test_results
- store-npm-logs

npm-react:
3 changes: 2 additions & 1 deletion cli/.gitignore
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ types/minimatch
types/sinon
types/sinon-chai
# copied from net-stubbing package on build
types/net-stubbing.ts
types/net-stubbing.d.ts
# ignore CLI output build folder
build

@@ -19,3 +19,4 @@ vue
vue2
react*
mount-utils
angular
9 changes: 7 additions & 2 deletions cli/package.json
Original file line number Diff line number Diff line change
@@ -103,12 +103,12 @@
"index.js",
"index.mjs",
"types/**/*.d.ts",
"types/net-stubbing.ts",
"mount-utils",
"vue",
"react",
"vue2",
"react18"
"react18",
"angular"
],
"bin": {
"cypress": "bin/cypress"
@@ -150,6 +150,11 @@
"./mount-utils": {
"require": "./mount-utils/dist/index.js",
"types": "./mount-utils/dist/index.d.ts"
},
"./angular": {
"import": "./angular/dist/index.js",
"require": "./angular/dist/index.js",
"types": "./angular/dist/index.d.ts"
}
},
"workspaces": {
1 change: 1 addition & 0 deletions cli/scripts/post-build.js
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@ const npmModulesToCopy = [
'react18',
'vue',
'vue2',
'angular',
]

npmModulesToCopy.forEach((folder) => {
2 changes: 1 addition & 1 deletion cli/scripts/post-install.js
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ shell.sed('-i', 'from \'sinon\';', 'from \'../sinon\';', sinonChaiFilename)

// copy experimental network stubbing type definitions
// so users can import: `import 'cypress/types/net-stubbing'`
fs.copySync(resolvePkg('@packages/net-stubbing/lib/external-types.ts'), 'types/net-stubbing.ts')
fs.copySync(resolvePkg('@packages/net-stubbing/lib/external-types.ts'), 'types/net-stubbing.d.ts')

// https://github.com/cypress-io/cypress/issues/18069
// To avoid type clashes, some files should be commented out entirely by patch-package
2 changes: 1 addition & 1 deletion cli/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@
// hmm, how to load it better?
/// <reference path="./cypress-npm-api.d.ts" />

/// <reference path="./net-stubbing.ts" />
/// <reference path="./net-stubbing.d.ts" />
/// <reference path="./cypress.d.ts" />
/// <reference path="./cypress-global-vars.d.ts" />
/// <reference path="./cypress-type-helpers.d.ts" />
5 changes: 4 additions & 1 deletion cli/types/tslint.json
Original file line number Diff line number Diff line change
@@ -38,7 +38,10 @@
"./mocha/*",
"./minimatch/*",
"./sinon/**/*",
"./sinon-chai/*"
"./sinon-chai/*",
// Copied from net-stubbing and renamed to a declaration file. Since it's not originally
// a declaration file, we need to exclude it from linting.
"./net-stubbing.d.ts"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed #22417 as a part of this work. Angular crawls all of the imported types and emits warnings due to this file not being included in the compilation. .d.ts files are fine and it's what this file should be anyway. I had to ignore this file in the tslint.json as dtslint complains. Since this file is originally a normal ts file, fixing the dtslint warnings causes ts warnings, so ignoring seemed best.

]
}
}
13 changes: 0 additions & 13 deletions npm/angular/.editorconfig

This file was deleted.

34 changes: 4 additions & 30 deletions npm/angular/.eslintrc
Original file line number Diff line number Diff line change
@@ -1,43 +1,17 @@
{
"plugins": [
"cypress",
"@cypress/dev",
"@angular-eslint/eslint-plugin"
"cypress"
],
"extends": [
"plugin:@cypress/dev/general",
"plugin:@cypress/dev/tests"
],
"parser": "@typescript-eslint/parser",
"env": {
"cypress/globals": true
},
"root": true,
"globals": {
"jest": "readonly"
},
"rules": {
"no-console": "off",
"mocha/no-global-tests": "off",
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": "off",
"no-unused-vars": "off",
"no-console": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"overrides": [
{
"files": [
"lib/*",
"src/*"
]
},
{
"files": [
"**/*.json"
],
"rules": {
"quotes": "off",
"comma-dangle": "off"
}
}
]
}
}
53 changes: 0 additions & 53 deletions npm/angular/.gitignore

This file was deleted.

3 changes: 3 additions & 0 deletions npm/angular/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
examples
src
cypress
6 changes: 6 additions & 0 deletions npm/angular/.releaserc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
...require('../../.releaserc.base'),
branches: [
{ name: 'master', channel: 'latest' },
],
}
File renamed without changes.
Loading