Skip to content

Conversation

@the-ult
Copy link
Contributor

@the-ult the-ult commented Jan 6, 2022

fix for using the proper dependencies AND using NX per-project-configuration

@see

Fix:

  • fix dependencies
  • update dependencies
  • improve config
  • fix eslint-plugin-angular-testing-library errors

New generated package.json

{ "name": "@testing-library/angular", "version": "0.0.0-semantically-released", "description": "Test your Angular components with the dom-testing-library", "repository": { "type": "git", "url": "git+https://github.com/testing-library/angular-testing-library.git" }, "keywords": [ "angular", "ngx", "ng", "typescript", "angular2", "test", "dom-testing-library" ], "author": "Tim Deschryver", "license": "MIT", "bugs": { "url": "https://github.com/testing-library/angular-testing-library/issues" }, "homepage": "https://github.com/testing-library/angular-testing-library#readme", "schematics": "./schematics/collection.json", "ng-add": { "save": "devDependencies" }, "ng-update": { "migrations": "./schematics/migrations/migration.json" }, "peerDependencies": { "@angular/common": ">= 13.0.0", "@angular/platform-browser": ">= 13.0.0", "@angular/router": ">= 13.0.0", "@angular/core": ">= 13.0.0", "rxjs": ">= 7.4.0" }, "dependencies": { "@testing-library/dom": "^8.0.0", "tslib": "^2.3.1" }, "publishConfig": { "access": "public" }, "module": "fesm2015/testing-library-angular.mjs", "es2020": "fesm2020/testing-library-angular.mjs", "esm2020": "esm2020/testing-library-angular.mjs", "fesm2020": "fesm2020/testing-library-angular.mjs", "fesm2015": "fesm2015/testing-library-angular.mjs", "typings": "testing-library-angular.d.ts", "exports": { "./package.json": { "default": "./package.json" }, ".": { "types": "./testing-library-angular.d.ts", "esm2020": "./esm2020/testing-library-angular.mjs", "es2020": "./fesm2020/testing-library-angular.mjs", "es2015": "./fesm2015/testing-library-angular.mjs", "node": "./fesm2015/testing-library-angular.mjs", "default": "./fesm2020/testing-library-angular.mjs" } }, "sideEffects": false }
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Am I correct to assume that this was a bug in NX?
If that's not the case, could you point me to the fix because it isn't obvious to me 😅

the-ult and others added 5 commits January 7, 2022 11:09
Co-authored-by: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com>
Set outdir to the same as testing-library and the way NX has as default.
…ependencies' into chore/use-workspace-and-proper-dependencies
@the-ult
Copy link
Contributor Author

the-ult commented Jan 7, 2022

Thanks for the great review and suggestions @timdeschryver 👍

@the-ult
Copy link
Contributor Author

the-ult commented Jan 7, 2022

Am I correct to assume that this was a bug in NX? If that's not the case, could you point me to the fix because it isn't obvious to me 😅

Which line/bug are you referring to? 😇

@timdeschryver
Copy link
Member

@the-ult this one #270
Where packages e.g. @angular/form was added to the package.json as a peer dependency

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Thank you!

@timdeschryver timdeschryver merged commit 11105d0 into testing-library:main Jan 7, 2022
"@angular-eslint/template-parser": "13.0.1",
"@angular/cli": "13.1.2",
"@angular/compiler-cli": "13.1.1",
"@angular/forms": "13.1.1",
Copy link
Contributor Author

@the-ult the-ult Jan 9, 2022

Choose a reason for hiding this comment

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

@timdeschryver
The 'fix' / prevent @angular/forms and @testing-library/user-event being exported in the generated package.json I moved them to the devDependencies, since they are only used in 'dev' -> tests

don't think it is fixed in NX yet -> nrwl/nx#8096

@the-ult
Copy link
Contributor Author

the-ult commented Jan 9, 2022

Am I correct to assume that this was a bug in NX? If that's not the case, could you point me to the fix because it isn't obvious to me 😅

https://github.com/testing-library/angular-testing-library/pull/277/files#r780759922

@the-ult the-ult deleted the chore/use-workspace-and-proper-dependencies branch January 9, 2022 10:08
@github-actions
Copy link

🎉 This PR is included in version 11.0.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2 participants