-
Notifications
You must be signed in to change notification settings - Fork 10
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
wrapper for angular #482
Comments
Hello @Vwings , thanks for opening an issue. I've been waiting for someone to show interest in an Angular wrapper, and you are the first! This is something I could use some help, last time I used Angular was en version 2, and I've never published an Angular component before. Is this something you could be interested to contribute with? |
@dvelasquez Thanks for your reply! I like the idea of this project, let me see if I can contribute some code. |
@Vwings Let me know if you need any help or explanation on how it works 👍 |
Hello @dvelasquez , I've finished the angular wrapper, the package's name is I also created a demo project in What else can I do before creating pull request? |
In the root folder there is an e2e set of tests to run and they are located at There you should create an Every wrapper is using the same version of the report.json, that makes easier to reuse 99% of the assertions in every wrapper. I'll be back from holidays next week and then I'll make a more extensive code review. Thanks very much for your interest and contributions! |
Hello, angular cypress test is added and passed. I added an The angular demo currently don't contain the content of the public page. I noticed that each wrapper has a separate Maybe we can change the structure of the demo to this:
I would appreciate hearing your opinion on this. |
Hey @Vwings thanks for your contribution, and thanks for adding the cypress tests and the demo. Regarding the iframe thing: This issue is not only a MVP.css problem, but also a Lighthouse issue. You can check the refactor progress here: GoogleChrome/lighthouse#12254 I've used the iframe as a workaround so I don't have to worry about this. I like your approach and I would love to do that change but in a separate Pull Request. For now you can open a PR with this project being a little different. I have some questions regarding the publication of the package and the scaffolding of the project. Until now I've been using this type of folder structure:
And every package.json has this attributes: "name": "lighthouse-viewer",
"description": "Package with the lighthouse-viewer files from the official repositories of Lighthouse",
"version": "0.1.19",
"private": false,
"main": "./dist/lighthouse-viewer.umd.js",
"module": "./dist/lighthouse-viewer.esm.js",
"types": "./dist/types/index.d.ts",
"files": [
"/dist"
],
} So, whenever we run npm publish, the whole folder is packaged as a But in the Angular Wrapper I see that the scaffolding is quite different:
So my question here is which package is going to be published to NPM? I think it should be Also we need to add the fields for main, module and types to the package.json that will be published. We could also publish the root Let me know what you think. |
Thanks for your reply! There is a The script will build library project, copy README and LICENSE files to dist folder, and finally publish the folder The following properties will also be added to the
|
The PR has been merged. Thanks very much for your contribution. Quick question: would you be interested helping to maintain this project? |
Of course, I am willing to help maintain this project. |
Great I will add you as a contributor ;) |
@Vwings quick question, do you have an example in another repository using this package? |
@dvelasquez Hello, I published the package to my repository and used in a private repo. If you are looking for a demo in separate project, I can create one and publish to github. I've changed some features since the last pull request:
I'm not using this component inside an iframe and want to generate a standalone HTML file like lighthouse, so I changed this function. And I added a script in
Many of these are custom changes and is not suitable to merge into this repo. I've seen the publish issue, is there any other way to publish packages? |
Cool features! So a couple of thoughts:
The changes you have made sound very interesting. I would like to take a look to them if it's possible. Now I'm going to focus on stabilise the build, update to Lighthouse 9 and fix the publish issue. I would love to keep this project as simple as possible and be able to add custom code on top of it too. |
Glad you are interested in my changes, here is the branch https://github.com/Vwings/lighthouse-viewer/tree/feat/export-listener_1.0.2. For publish issue, currently there are 3
I'm not sure if the publish action will only recognize the third If |
Yes, we can do that @Vwings Now we are using a wildcard for the package folder, but since the amount of packages is limited, we can specify directly, making this more explicit and with a more granular control. The change would be from something like this: {
"command": {
"publish": {
"ignoreChanges": ["ignored-file", "*.md", "**/packages/**/demo/**"],
"message": "chore(release): publish"
}
},
"packages": [
"packages/*"
],
"version": "independent"
} To something like this: {
"command": {
"publish": {
"ignoreChanges": ["ignored-file", "*.md", "**/packages/**/demo/**"],
"message": "chore(release): publish"
}
},
"packages": [
"packages/lighthouse-viewer",
"packages/react2-lighthouse-viewer",
"packages/ngx-lighthouse-viewer/lib/etc..."
],
"version": "independent"
} I'm also wondering if it's possible to create an angular component/library without using the angular-cli. |
That's a good idea, I think I will try to use rollup or change the project's structure. I hope we can avoid adding special lerna configuration because of |
Hi @Vwings. I've been having consistent issues with keeping the angular library up to date, and until today there is no fix or publication of the Angular package. So, I've decided to remove support for Angular for the time being. I'm doing several changes that will require rewrite a lot of the parts, for example, ditch parcel1 for vite and possibly migrate from Lerna to NX. Probably after the migration to NX, we will be able to add the Angular wrapper again. I don't see any issue if you want to take over the Angular wrapper and publish it yourself. |
I'm still not convinced of using NX to manage monorepos. I will give it a try in the future to restore the Angular configuration and see how it goes. For now, I will close this PR. Let me know if you are going to create and publish an Angular wrapper by yourself. If that is the case, I will not try to give it support from here. |
Hi @dvelasquez |
Great! Once is created don't forget to add it to the list of tools in the main Lighthouse repository for visibility: https://github.com/GoogleChrome/lighthouse#related-projects |
Is there any plan to make a wrapper for angular?
The text was updated successfully, but these errors were encountered: